swa07016

NavBar 구현 및 Landing, About, Menu 페이지 라우팅

Showing 418 changed files with 20529 additions and 60 deletions
This diff could not be displayed because it is too large.
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
6 "@testing-library/jest-dom": "^4.2.4", 6 "@testing-library/jest-dom": "^4.2.4",
7 "@testing-library/react": "^9.3.2", 7 "@testing-library/react": "^9.3.2",
8 "@testing-library/user-event": "^7.1.2", 8 "@testing-library/user-event": "^7.1.2",
9 + "bootstrap": "^4.5.0",
9 "react": "^16.13.1", 10 "react": "^16.13.1",
10 "react-dom": "^16.13.1", 11 "react-dom": "^16.13.1",
11 - "react-scripts": "3.4.1" 12 + "react-scripts": "3.4.1",
13 + "reactstrap": "^8.4.1"
12 }, 14 },
13 "scripts": { 15 "scripts": {
14 "start": "react-scripts start", 16 "start": "react-scripts start",
......
No preview for this file type
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 <html lang="en"> 2 <html lang="en">
3 <head> 3 <head>
4 <meta charset="utf-8" /> 4 <meta charset="utf-8" />
5 - <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> 5 + <link rel="icon" href="%PUBLIC_URL%/fork.ico" />
6 <meta name="viewport" content="width=device-width, initial-scale=1" /> 6 <meta name="viewport" content="width=device-width, initial-scale=1" />
7 <meta name="theme-color" content="#000000" /> 7 <meta name="theme-color" content="#000000" />
8 <meta 8 <meta
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
24 work correctly both with client-side routing and a non-root public URL. 24 work correctly both with client-side routing and a non-root public URL.
25 Learn how to configure a non-root public URL by running `npm run build`. 25 Learn how to configure a non-root public URL by running `npm run build`.
26 --> 26 -->
27 - <title>React App</title> 27 + <title>MEALKHU</title>
28 </head> 28 </head>
29 <body> 29 <body>
30 <noscript>You need to enable JavaScript to run this app.</noscript> 30 <noscript>You need to enable JavaScript to run this app.</noscript>
......
1 -.App {
2 - text-align: center;
3 -}
4 -
5 -.App-logo {
6 - height: 40vmin;
7 - pointer-events: none;
8 -}
9 -
10 -@media (prefers-reduced-motion: no-preference) {
11 - .App-logo {
12 - animation: App-logo-spin infinite 20s linear;
13 - }
14 -}
15 -
16 -.App-header {
17 - background-color: #282c34;
18 - min-height: 100vh;
19 - display: flex;
20 - flex-direction: column;
21 - align-items: center;
22 - justify-content: center;
23 - font-size: calc(10px + 2vmin);
24 - color: white;
25 -}
26 -
27 -.App-link {
28 - color: #61dafb;
29 -}
30 -
31 -@keyframes App-logo-spin {
32 - from {
33 - transform: rotate(0deg);
34 - }
35 - to {
36 - transform: rotate(360deg);
37 - }
38 -}
1 import React from 'react'; 1 import React from 'react';
2 -import './App.css'; 2 +import LandingPage from './pages/LandingPage';
3 +import AboutPage from './pages/AboutPage';
4 +import MenuPage from './pages/MenuPage';
5 +import {
6 + BrowserRouter as Router,
7 + Switch,
8 + Route,
9 + Link
10 +} from "react-router-dom";
3 11
4 function App() { 12 function App() {
5 return ( 13 return (
6 - <div> 14 + <Router>
7 - Hello world 15 + <>
8 - </div> 16 + <Switch>
17 + <Route exact path="/" component={LandingPage}/>
18 + <Route exact path="/about" component={AboutPage}/>
19 + <Route exact path="/menu" component={MenuPage}/>
20 + {/* mypick, login 라우팅 */}
21 + </Switch>
22 + </>
23 + </Router>
9 ); 24 );
10 } 25 }
11 26
12 -export default App; 27 +export default App;
...\ No newline at end of file ...\ No newline at end of file
......
1 +import React, { useState } from 'react';
2 +import { Container, NavbarText } from 'reactstrap';
3 +import {
4 + Collapse,
5 + Navbar,
6 + NavbarToggler,
7 + NavbarBrand,
8 + Nav,
9 + NavItem,
10 + NavLink
11 +} from 'reactstrap';
12 +
13 +const NavBar = (props) => {
14 + const [isOpen, setIsOpen] = useState(false);
15 +
16 + const toggle = () => setIsOpen(!isOpen);
17 +
18 + return (
19 + <div>
20 +
21 + <Navbar style={{'background-color': '#940f0f'}} light expand="md">
22 + <Container className="themed-container">
23 + <png>
24 + <a href='/'><img src="logo.png" width="50" /></a>
25 + </png>
26 + <NavbarBrand href="/" style={{'marginLeft':'1.5rem', 'color':'#fff'}}>MEALKHU</NavbarBrand>
27 + <NavbarToggler onClick={toggle} />
28 + <Collapse isOpen={isOpen} navbar>
29 + <Nav className="mr-auto" navbar>
30 + <NavItem>
31 + <NavLink href="/about" style={{'color':'#fff'}}>About</NavLink>
32 + </NavItem>
33 + <NavItem>
34 + <NavLink href="/menu" style={{'color':'#fff'}}>Menu</NavLink>
35 + </NavItem>
36 + <NavItem>
37 + <NavLink href="/mypick" style={{'color':'#fff'}}>MyPick</NavLink>
38 + </NavItem>
39 + </Nav>
40 + <NavbarText style={{'color':'#fff'}}>OSS Project</NavbarText>
41 + </Collapse>
42 + </Container>
43 + </Navbar>
44 + </div>
45 + );
46 +}
47 +
48 +export default NavBar;
...\ No newline at end of file ...\ No newline at end of file
1 -body {
2 - margin: 0;
3 - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 - sans-serif;
6 - -webkit-font-smoothing: antialiased;
7 - -moz-osx-font-smoothing: grayscale;
8 -}
9 -
10 -code {
11 - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 - monospace;
13 -}
1 import React from 'react'; 1 import React from 'react';
2 import ReactDOM from 'react-dom'; 2 import ReactDOM from 'react-dom';
3 -import './index.css';
4 import App from './App'; 3 import App from './App';
5 import * as serviceWorker from './serviceWorker'; 4 import * as serviceWorker from './serviceWorker';
5 +import 'bootstrap/dist/css/bootstrap.min.css';
6 6
7 ReactDOM.render( 7 ReactDOM.render(
8 <React.StrictMode> 8 <React.StrictMode>
......
1 +import React from 'react';
2 +import NavBar from '../components/NavBar';
3 +
4 +const AboutPage = (props) => {
5 + return (
6 + <>
7 + <NavBar/>
8 + about page
9 + </>
10 + );
11 +}
12 +
13 +export default AboutPage;
...\ No newline at end of file ...\ No newline at end of file
1 +import React from 'react';
2 +import NavBar from '../components/NavBar';
3 +
4 +const LandingPage = (props) => {
5 + return (
6 + <>
7 + <NavBar/>
8 + Landign page
9 + </>
10 + );
11 +}
12 +
13 +export default LandingPage;
...\ No newline at end of file ...\ No newline at end of file
1 +import React from 'react';
2 +import NavBar from '../components/NavBar';
3 +
4 +const MenuPage = (props) => {
5 + return (
6 + <>
7 + <NavBar/>
8 + menu page
9 + </>
10 + );
11 +}
12 +
13 +export default MenuPage;
...\ No newline at end of file ...\ No newline at end of file
1 +#!/bin/sh
2 +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 +
4 +case `uname` in
5 + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 +esac
7 +
8 +if [ -x "$basedir/node" ]; then
9 + "$basedir/node" "$basedir/../loose-envify/cli.js" "$@"
10 + ret=$?
11 +else
12 + node "$basedir/../loose-envify/cli.js" "$@"
13 + ret=$?
14 +fi
15 +exit $ret
1 +@ECHO off
2 +SETLOCAL
3 +CALL :find_dp0
4 +
5 +IF EXIST "%dp0%\node.exe" (
6 + SET "_prog=%dp0%\node.exe"
7 +) ELSE (
8 + SET "_prog=node"
9 + SET PATHEXT=%PATHEXT:;.JS;=;%
10 +)
11 +
12 +"%_prog%" "%dp0%\..\loose-envify\cli.js" %*
13 +ENDLOCAL
14 +EXIT /b %errorlevel%
15 +:find_dp0
16 +SET dp0=%~dp0
17 +EXIT /b
1 +#!/usr/bin/env pwsh
2 +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 +
4 +$exe=""
5 +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 + # Fix case when both the Windows and Linux builds of Node
7 + # are installed in the same directory
8 + $exe=".exe"
9 +}
10 +$ret=0
11 +if (Test-Path "$basedir/node$exe") {
12 + & "$basedir/node$exe" "$basedir/../loose-envify/cli.js" $args
13 + $ret=$LASTEXITCODE
14 +} else {
15 + & "node$exe" "$basedir/../loose-envify/cli.js" $args
16 + $ret=$LASTEXITCODE
17 +}
18 +exit $ret
1 +MIT License
2 +
3 +Copyright (c) 2014-present Sebastian McKenzie and other contributors
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining
6 +a copy of this software and associated documentation files (the
7 +"Software"), to deal in the Software without restriction, including
8 +without limitation the rights to use, copy, modify, merge, publish,
9 +distribute, sublicense, and/or sell copies of the Software, and to
10 +permit persons to whom the Software is furnished to do so, subject to
11 +the following conditions:
12 +
13 +The above copyright notice and this permission notice shall be
14 +included in all copies or substantial portions of the Software.
15 +
16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 +# @babel/runtime
2 +
3 +> babel's modular runtime helpers
4 +
5 +See our website [@babel/runtime](https://babeljs.io/docs/en/next/babel-runtime.html) for more information.
6 +
7 +## Install
8 +
9 +Using npm:
10 +
11 +```sh
12 +npm install --save @babel/runtime
13 +```
14 +
15 +or using yarn:
16 +
17 +```sh
18 +yarn add @babel/runtime
19 +```
1 +var AwaitValue = require("./AwaitValue");
2 +
3 +function AsyncGenerator(gen) {
4 + var front, back;
5 +
6 + function send(key, arg) {
7 + return new Promise(function (resolve, reject) {
8 + var request = {
9 + key: key,
10 + arg: arg,
11 + resolve: resolve,
12 + reject: reject,
13 + next: null
14 + };
15 +
16 + if (back) {
17 + back = back.next = request;
18 + } else {
19 + front = back = request;
20 + resume(key, arg);
21 + }
22 + });
23 + }
24 +
25 + function resume(key, arg) {
26 + try {
27 + var result = gen[key](arg);
28 + var value = result.value;
29 + var wrappedAwait = value instanceof AwaitValue;
30 + Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) {
31 + if (wrappedAwait) {
32 + resume(key === "return" ? "return" : "next", arg);
33 + return;
34 + }
35 +
36 + settle(result.done ? "return" : "normal", arg);
37 + }, function (err) {
38 + resume("throw", err);
39 + });
40 + } catch (err) {
41 + settle("throw", err);
42 + }
43 + }
44 +
45 + function settle(type, value) {
46 + switch (type) {
47 + case "return":
48 + front.resolve({
49 + value: value,
50 + done: true
51 + });
52 + break;
53 +
54 + case "throw":
55 + front.reject(value);
56 + break;
57 +
58 + default:
59 + front.resolve({
60 + value: value,
61 + done: false
62 + });
63 + break;
64 + }
65 +
66 + front = front.next;
67 +
68 + if (front) {
69 + resume(front.key, front.arg);
70 + } else {
71 + back = null;
72 + }
73 + }
74 +
75 + this._invoke = send;
76 +
77 + if (typeof gen["return"] !== "function") {
78 + this["return"] = undefined;
79 + }
80 +}
81 +
82 +if (typeof Symbol === "function" && Symbol.asyncIterator) {
83 + AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
84 + return this;
85 + };
86 +}
87 +
88 +AsyncGenerator.prototype.next = function (arg) {
89 + return this._invoke("next", arg);
90 +};
91 +
92 +AsyncGenerator.prototype["throw"] = function (arg) {
93 + return this._invoke("throw", arg);
94 +};
95 +
96 +AsyncGenerator.prototype["return"] = function (arg) {
97 + return this._invoke("return", arg);
98 +};
99 +
100 +module.exports = AsyncGenerator;
...\ No newline at end of file ...\ No newline at end of file
1 +function _AwaitValue(value) {
2 + this.wrapped = value;
3 +}
4 +
5 +module.exports = _AwaitValue;
...\ No newline at end of file ...\ No newline at end of file
1 +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
2 + var desc = {};
3 + Object.keys(descriptor).forEach(function (key) {
4 + desc[key] = descriptor[key];
5 + });
6 + desc.enumerable = !!desc.enumerable;
7 + desc.configurable = !!desc.configurable;
8 +
9 + if ('value' in desc || desc.initializer) {
10 + desc.writable = true;
11 + }
12 +
13 + desc = decorators.slice().reverse().reduce(function (desc, decorator) {
14 + return decorator(target, property, desc) || desc;
15 + }, desc);
16 +
17 + if (context && desc.initializer !== void 0) {
18 + desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
19 + desc.initializer = undefined;
20 + }
21 +
22 + if (desc.initializer === void 0) {
23 + Object.defineProperty(target, property, desc);
24 + desc = null;
25 + }
26 +
27 + return desc;
28 +}
29 +
30 +module.exports = _applyDecoratedDescriptor;
...\ No newline at end of file ...\ No newline at end of file
1 +function _arrayLikeToArray(arr, len) {
2 + if (len == null || len > arr.length) len = arr.length;
3 +
4 + for (var i = 0, arr2 = new Array(len); i < len; i++) {
5 + arr2[i] = arr[i];
6 + }
7 +
8 + return arr2;
9 +}
10 +
11 +module.exports = _arrayLikeToArray;
...\ No newline at end of file ...\ No newline at end of file
1 +function _arrayWithHoles(arr) {
2 + if (Array.isArray(arr)) return arr;
3 +}
4 +
5 +module.exports = _arrayWithHoles;
...\ No newline at end of file ...\ No newline at end of file
1 +var arrayLikeToArray = require("./arrayLikeToArray");
2 +
3 +function _arrayWithoutHoles(arr) {
4 + if (Array.isArray(arr)) return arrayLikeToArray(arr);
5 +}
6 +
7 +module.exports = _arrayWithoutHoles;
...\ No newline at end of file ...\ No newline at end of file
1 +function _assertThisInitialized(self) {
2 + if (self === void 0) {
3 + throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4 + }
5 +
6 + return self;
7 +}
8 +
9 +module.exports = _assertThisInitialized;
...\ No newline at end of file ...\ No newline at end of file
1 +function _asyncGeneratorDelegate(inner, awaitWrap) {
2 + var iter = {},
3 + waiting = false;
4 +
5 + function pump(key, value) {
6 + waiting = true;
7 + value = new Promise(function (resolve) {
8 + resolve(inner[key](value));
9 + });
10 + return {
11 + done: false,
12 + value: awaitWrap(value)
13 + };
14 + }
15 +
16 + ;
17 +
18 + if (typeof Symbol === "function" && Symbol.iterator) {
19 + iter[Symbol.iterator] = function () {
20 + return this;
21 + };
22 + }
23 +
24 + iter.next = function (value) {
25 + if (waiting) {
26 + waiting = false;
27 + return value;
28 + }
29 +
30 + return pump("next", value);
31 + };
32 +
33 + if (typeof inner["throw"] === "function") {
34 + iter["throw"] = function (value) {
35 + if (waiting) {
36 + waiting = false;
37 + throw value;
38 + }
39 +
40 + return pump("throw", value);
41 + };
42 + }
43 +
44 + if (typeof inner["return"] === "function") {
45 + iter["return"] = function (value) {
46 + if (waiting) {
47 + waiting = false;
48 + return value;
49 + }
50 +
51 + return pump("return", value);
52 + };
53 + }
54 +
55 + return iter;
56 +}
57 +
58 +module.exports = _asyncGeneratorDelegate;
...\ No newline at end of file ...\ No newline at end of file
1 +function _asyncIterator(iterable) {
2 + var method;
3 +
4 + if (typeof Symbol !== "undefined") {
5 + if (Symbol.asyncIterator) {
6 + method = iterable[Symbol.asyncIterator];
7 + if (method != null) return method.call(iterable);
8 + }
9 +
10 + if (Symbol.iterator) {
11 + method = iterable[Symbol.iterator];
12 + if (method != null) return method.call(iterable);
13 + }
14 + }
15 +
16 + throw new TypeError("Object is not async iterable");
17 +}
18 +
19 +module.exports = _asyncIterator;
...\ No newline at end of file ...\ No newline at end of file
1 +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2 + try {
3 + var info = gen[key](arg);
4 + var value = info.value;
5 + } catch (error) {
6 + reject(error);
7 + return;
8 + }
9 +
10 + if (info.done) {
11 + resolve(value);
12 + } else {
13 + Promise.resolve(value).then(_next, _throw);
14 + }
15 +}
16 +
17 +function _asyncToGenerator(fn) {
18 + return function () {
19 + var self = this,
20 + args = arguments;
21 + return new Promise(function (resolve, reject) {
22 + var gen = fn.apply(self, args);
23 +
24 + function _next(value) {
25 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
26 + }
27 +
28 + function _throw(err) {
29 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
30 + }
31 +
32 + _next(undefined);
33 + });
34 + };
35 +}
36 +
37 +module.exports = _asyncToGenerator;
...\ No newline at end of file ...\ No newline at end of file
1 +var AwaitValue = require("./AwaitValue");
2 +
3 +function _awaitAsyncGenerator(value) {
4 + return new AwaitValue(value);
5 +}
6 +
7 +module.exports = _awaitAsyncGenerator;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classCallCheck(instance, Constructor) {
2 + if (!(instance instanceof Constructor)) {
3 + throw new TypeError("Cannot call a class as a function");
4 + }
5 +}
6 +
7 +module.exports = _classCallCheck;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classNameTDZError(name) {
2 + throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys.");
3 +}
4 +
5 +module.exports = _classNameTDZError;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classPrivateFieldDestructureSet(receiver, privateMap) {
2 + if (!privateMap.has(receiver)) {
3 + throw new TypeError("attempted to set private field on non-instance");
4 + }
5 +
6 + var descriptor = privateMap.get(receiver);
7 +
8 + if (descriptor.set) {
9 + if (!("__destrObj" in descriptor)) {
10 + descriptor.__destrObj = {
11 + set value(v) {
12 + descriptor.set.call(receiver, v);
13 + }
14 +
15 + };
16 + }
17 +
18 + return descriptor.__destrObj;
19 + } else {
20 + if (!descriptor.writable) {
21 + throw new TypeError("attempted to set read only private field");
22 + }
23 +
24 + return descriptor;
25 + }
26 +}
27 +
28 +module.exports = _classPrivateFieldDestructureSet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classPrivateFieldGet(receiver, privateMap) {
2 + var descriptor = privateMap.get(receiver);
3 +
4 + if (!descriptor) {
5 + throw new TypeError("attempted to get private field on non-instance");
6 + }
7 +
8 + if (descriptor.get) {
9 + return descriptor.get.call(receiver);
10 + }
11 +
12 + return descriptor.value;
13 +}
14 +
15 +module.exports = _classPrivateFieldGet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classPrivateFieldBase(receiver, privateKey) {
2 + if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
3 + throw new TypeError("attempted to use private field on non-instance");
4 + }
5 +
6 + return receiver;
7 +}
8 +
9 +module.exports = _classPrivateFieldBase;
...\ No newline at end of file ...\ No newline at end of file
1 +var id = 0;
2 +
3 +function _classPrivateFieldKey(name) {
4 + return "__private_" + id++ + "_" + name;
5 +}
6 +
7 +module.exports = _classPrivateFieldKey;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classPrivateFieldSet(receiver, privateMap, value) {
2 + var descriptor = privateMap.get(receiver);
3 +
4 + if (!descriptor) {
5 + throw new TypeError("attempted to set private field on non-instance");
6 + }
7 +
8 + if (descriptor.set) {
9 + descriptor.set.call(receiver, value);
10 + } else {
11 + if (!descriptor.writable) {
12 + throw new TypeError("attempted to set read only private field");
13 + }
14 +
15 + descriptor.value = value;
16 + }
17 +
18 + return value;
19 +}
20 +
21 +module.exports = _classPrivateFieldSet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classPrivateMethodGet(receiver, privateSet, fn) {
2 + if (!privateSet.has(receiver)) {
3 + throw new TypeError("attempted to get private field on non-instance");
4 + }
5 +
6 + return fn;
7 +}
8 +
9 +module.exports = _classPrivateMethodGet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classPrivateMethodSet() {
2 + throw new TypeError("attempted to reassign private method");
3 +}
4 +
5 +module.exports = _classPrivateMethodSet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
2 + if (receiver !== classConstructor) {
3 + throw new TypeError("Private static access of wrong provenance");
4 + }
5 +
6 + if (descriptor.get) {
7 + return descriptor.get.call(receiver);
8 + }
9 +
10 + return descriptor.value;
11 +}
12 +
13 +module.exports = _classStaticPrivateFieldSpecGet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
2 + if (receiver !== classConstructor) {
3 + throw new TypeError("Private static access of wrong provenance");
4 + }
5 +
6 + if (descriptor.set) {
7 + descriptor.set.call(receiver, value);
8 + } else {
9 + if (!descriptor.writable) {
10 + throw new TypeError("attempted to set read only private field");
11 + }
12 +
13 + descriptor.value = value;
14 + }
15 +
16 + return value;
17 +}
18 +
19 +module.exports = _classStaticPrivateFieldSpecSet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
2 + if (receiver !== classConstructor) {
3 + throw new TypeError("Private static access of wrong provenance");
4 + }
5 +
6 + return method;
7 +}
8 +
9 +module.exports = _classStaticPrivateMethodGet;
...\ No newline at end of file ...\ No newline at end of file
1 +function _classStaticPrivateMethodSet() {
2 + throw new TypeError("attempted to set read only static private field");
3 +}
4 +
5 +module.exports = _classStaticPrivateMethodSet;
...\ No newline at end of file ...\ No newline at end of file
1 +var setPrototypeOf = require("./setPrototypeOf");
2 +
3 +var isNativeReflectConstruct = require("./isNativeReflectConstruct");
4 +
5 +function _construct(Parent, args, Class) {
6 + if (isNativeReflectConstruct()) {
7 + module.exports = _construct = Reflect.construct;
8 + } else {
9 + module.exports = _construct = function _construct(Parent, args, Class) {
10 + var a = [null];
11 + a.push.apply(a, args);
12 + var Constructor = Function.bind.apply(Parent, a);
13 + var instance = new Constructor();
14 + if (Class) setPrototypeOf(instance, Class.prototype);
15 + return instance;
16 + };
17 + }
18 +
19 + return _construct.apply(null, arguments);
20 +}
21 +
22 +module.exports = _construct;
...\ No newline at end of file ...\ No newline at end of file
1 +function _defineProperties(target, props) {
2 + for (var i = 0; i < props.length; i++) {
3 + var descriptor = props[i];
4 + descriptor.enumerable = descriptor.enumerable || false;
5 + descriptor.configurable = true;
6 + if ("value" in descriptor) descriptor.writable = true;
7 + Object.defineProperty(target, descriptor.key, descriptor);
8 + }
9 +}
10 +
11 +function _createClass(Constructor, protoProps, staticProps) {
12 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
13 + if (staticProps) _defineProperties(Constructor, staticProps);
14 + return Constructor;
15 +}
16 +
17 +module.exports = _createClass;
...\ No newline at end of file ...\ No newline at end of file
1 +var unsupportedIterableToArray = require("./unsupportedIterableToArray");
2 +
3 +function _createForOfIteratorHelper(o) {
4 + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
5 + if (Array.isArray(o) || (o = unsupportedIterableToArray(o))) {
6 + var i = 0;
7 +
8 + var F = function F() {};
9 +
10 + return {
11 + s: F,
12 + n: function n() {
13 + if (i >= o.length) return {
14 + done: true
15 + };
16 + return {
17 + done: false,
18 + value: o[i++]
19 + };
20 + },
21 + e: function e(_e) {
22 + throw _e;
23 + },
24 + f: F
25 + };
26 + }
27 +
28 + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
29 + }
30 +
31 + var it,
32 + normalCompletion = true,
33 + didErr = false,
34 + err;
35 + return {
36 + s: function s() {
37 + it = o[Symbol.iterator]();
38 + },
39 + n: function n() {
40 + var step = it.next();
41 + normalCompletion = step.done;
42 + return step;
43 + },
44 + e: function e(_e2) {
45 + didErr = true;
46 + err = _e2;
47 + },
48 + f: function f() {
49 + try {
50 + if (!normalCompletion && it["return"] != null) it["return"]();
51 + } finally {
52 + if (didErr) throw err;
53 + }
54 + }
55 + };
56 +}
57 +
58 +module.exports = _createForOfIteratorHelper;
...\ No newline at end of file ...\ No newline at end of file
1 +var unsupportedIterableToArray = require("./unsupportedIterableToArray");
2 +
3 +function _createForOfIteratorHelperLoose(o) {
4 + var i = 0;
5 +
6 + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
7 + if (Array.isArray(o) || (o = unsupportedIterableToArray(o))) return function () {
8 + if (i >= o.length) return {
9 + done: true
10 + };
11 + return {
12 + done: false,
13 + value: o[i++]
14 + };
15 + };
16 + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
17 + }
18 +
19 + i = o[Symbol.iterator]();
20 + return i.next.bind(i);
21 +}
22 +
23 +module.exports = _createForOfIteratorHelperLoose;
...\ No newline at end of file ...\ No newline at end of file
1 +var getPrototypeOf = require("./getPrototypeOf");
2 +
3 +var isNativeReflectConstruct = require("./isNativeReflectConstruct");
4 +
5 +var possibleConstructorReturn = require("./possibleConstructorReturn");
6 +
7 +function _createSuper(Derived) {
8 + var hasNativeReflectConstruct = isNativeReflectConstruct();
9 + return function () {
10 + var Super = getPrototypeOf(Derived),
11 + result;
12 +
13 + if (hasNativeReflectConstruct) {
14 + var NewTarget = getPrototypeOf(this).constructor;
15 + result = Reflect.construct(Super, arguments, NewTarget);
16 + } else {
17 + result = Super.apply(this, arguments);
18 + }
19 +
20 + return possibleConstructorReturn(this, result);
21 + };
22 +}
23 +
24 +module.exports = _createSuper;
...\ No newline at end of file ...\ No newline at end of file
1 +var toArray = require("./toArray");
2 +
3 +var toPropertyKey = require("./toPropertyKey");
4 +
5 +function _decorate(decorators, factory, superClass, mixins) {
6 + var api = _getDecoratorsApi();
7 +
8 + if (mixins) {
9 + for (var i = 0; i < mixins.length; i++) {
10 + api = mixins[i](api);
11 + }
12 + }
13 +
14 + var r = factory(function initialize(O) {
15 + api.initializeInstanceElements(O, decorated.elements);
16 + }, superClass);
17 + var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators);
18 + api.initializeClassElements(r.F, decorated.elements);
19 + return api.runClassFinishers(r.F, decorated.finishers);
20 +}
21 +
22 +function _getDecoratorsApi() {
23 + _getDecoratorsApi = function _getDecoratorsApi() {
24 + return api;
25 + };
26 +
27 + var api = {
28 + elementsDefinitionOrder: [["method"], ["field"]],
29 + initializeInstanceElements: function initializeInstanceElements(O, elements) {
30 + ["method", "field"].forEach(function (kind) {
31 + elements.forEach(function (element) {
32 + if (element.kind === kind && element.placement === "own") {
33 + this.defineClassElement(O, element);
34 + }
35 + }, this);
36 + }, this);
37 + },
38 + initializeClassElements: function initializeClassElements(F, elements) {
39 + var proto = F.prototype;
40 + ["method", "field"].forEach(function (kind) {
41 + elements.forEach(function (element) {
42 + var placement = element.placement;
43 +
44 + if (element.kind === kind && (placement === "static" || placement === "prototype")) {
45 + var receiver = placement === "static" ? F : proto;
46 + this.defineClassElement(receiver, element);
47 + }
48 + }, this);
49 + }, this);
50 + },
51 + defineClassElement: function defineClassElement(receiver, element) {
52 + var descriptor = element.descriptor;
53 +
54 + if (element.kind === "field") {
55 + var initializer = element.initializer;
56 + descriptor = {
57 + enumerable: descriptor.enumerable,
58 + writable: descriptor.writable,
59 + configurable: descriptor.configurable,
60 + value: initializer === void 0 ? void 0 : initializer.call(receiver)
61 + };
62 + }
63 +
64 + Object.defineProperty(receiver, element.key, descriptor);
65 + },
66 + decorateClass: function decorateClass(elements, decorators) {
67 + var newElements = [];
68 + var finishers = [];
69 + var placements = {
70 + "static": [],
71 + prototype: [],
72 + own: []
73 + };
74 + elements.forEach(function (element) {
75 + this.addElementPlacement(element, placements);
76 + }, this);
77 + elements.forEach(function (element) {
78 + if (!_hasDecorators(element)) return newElements.push(element);
79 + var elementFinishersExtras = this.decorateElement(element, placements);
80 + newElements.push(elementFinishersExtras.element);
81 + newElements.push.apply(newElements, elementFinishersExtras.extras);
82 + finishers.push.apply(finishers, elementFinishersExtras.finishers);
83 + }, this);
84 +
85 + if (!decorators) {
86 + return {
87 + elements: newElements,
88 + finishers: finishers
89 + };
90 + }
91 +
92 + var result = this.decorateConstructor(newElements, decorators);
93 + finishers.push.apply(finishers, result.finishers);
94 + result.finishers = finishers;
95 + return result;
96 + },
97 + addElementPlacement: function addElementPlacement(element, placements, silent) {
98 + var keys = placements[element.placement];
99 +
100 + if (!silent && keys.indexOf(element.key) !== -1) {
101 + throw new TypeError("Duplicated element (" + element.key + ")");
102 + }
103 +
104 + keys.push(element.key);
105 + },
106 + decorateElement: function decorateElement(element, placements) {
107 + var extras = [];
108 + var finishers = [];
109 +
110 + for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) {
111 + var keys = placements[element.placement];
112 + keys.splice(keys.indexOf(element.key), 1);
113 + var elementObject = this.fromElementDescriptor(element);
114 + var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject);
115 + element = elementFinisherExtras.element;
116 + this.addElementPlacement(element, placements);
117 +
118 + if (elementFinisherExtras.finisher) {
119 + finishers.push(elementFinisherExtras.finisher);
120 + }
121 +
122 + var newExtras = elementFinisherExtras.extras;
123 +
124 + if (newExtras) {
125 + for (var j = 0; j < newExtras.length; j++) {
126 + this.addElementPlacement(newExtras[j], placements);
127 + }
128 +
129 + extras.push.apply(extras, newExtras);
130 + }
131 + }
132 +
133 + return {
134 + element: element,
135 + finishers: finishers,
136 + extras: extras
137 + };
138 + },
139 + decorateConstructor: function decorateConstructor(elements, decorators) {
140 + var finishers = [];
141 +
142 + for (var i = decorators.length - 1; i >= 0; i--) {
143 + var obj = this.fromClassDescriptor(elements);
144 + var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj);
145 +
146 + if (elementsAndFinisher.finisher !== undefined) {
147 + finishers.push(elementsAndFinisher.finisher);
148 + }
149 +
150 + if (elementsAndFinisher.elements !== undefined) {
151 + elements = elementsAndFinisher.elements;
152 +
153 + for (var j = 0; j < elements.length - 1; j++) {
154 + for (var k = j + 1; k < elements.length; k++) {
155 + if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) {
156 + throw new TypeError("Duplicated element (" + elements[j].key + ")");
157 + }
158 + }
159 + }
160 + }
161 + }
162 +
163 + return {
164 + elements: elements,
165 + finishers: finishers
166 + };
167 + },
168 + fromElementDescriptor: function fromElementDescriptor(element) {
169 + var obj = {
170 + kind: element.kind,
171 + key: element.key,
172 + placement: element.placement,
173 + descriptor: element.descriptor
174 + };
175 + var desc = {
176 + value: "Descriptor",
177 + configurable: true
178 + };
179 + Object.defineProperty(obj, Symbol.toStringTag, desc);
180 + if (element.kind === "field") obj.initializer = element.initializer;
181 + return obj;
182 + },
183 + toElementDescriptors: function toElementDescriptors(elementObjects) {
184 + if (elementObjects === undefined) return;
185 + return toArray(elementObjects).map(function (elementObject) {
186 + var element = this.toElementDescriptor(elementObject);
187 + this.disallowProperty(elementObject, "finisher", "An element descriptor");
188 + this.disallowProperty(elementObject, "extras", "An element descriptor");
189 + return element;
190 + }, this);
191 + },
192 + toElementDescriptor: function toElementDescriptor(elementObject) {
193 + var kind = String(elementObject.kind);
194 +
195 + if (kind !== "method" && kind !== "field") {
196 + throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"');
197 + }
198 +
199 + var key = toPropertyKey(elementObject.key);
200 + var placement = String(elementObject.placement);
201 +
202 + if (placement !== "static" && placement !== "prototype" && placement !== "own") {
203 + throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"');
204 + }
205 +
206 + var descriptor = elementObject.descriptor;
207 + this.disallowProperty(elementObject, "elements", "An element descriptor");
208 + var element = {
209 + kind: kind,
210 + key: key,
211 + placement: placement,
212 + descriptor: Object.assign({}, descriptor)
213 + };
214 +
215 + if (kind !== "field") {
216 + this.disallowProperty(elementObject, "initializer", "A method descriptor");
217 + } else {
218 + this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor");
219 + this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor");
220 + this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor");
221 + element.initializer = elementObject.initializer;
222 + }
223 +
224 + return element;
225 + },
226 + toElementFinisherExtras: function toElementFinisherExtras(elementObject) {
227 + var element = this.toElementDescriptor(elementObject);
228 +
229 + var finisher = _optionalCallableProperty(elementObject, "finisher");
230 +
231 + var extras = this.toElementDescriptors(elementObject.extras);
232 + return {
233 + element: element,
234 + finisher: finisher,
235 + extras: extras
236 + };
237 + },
238 + fromClassDescriptor: function fromClassDescriptor(elements) {
239 + var obj = {
240 + kind: "class",
241 + elements: elements.map(this.fromElementDescriptor, this)
242 + };
243 + var desc = {
244 + value: "Descriptor",
245 + configurable: true
246 + };
247 + Object.defineProperty(obj, Symbol.toStringTag, desc);
248 + return obj;
249 + },
250 + toClassDescriptor: function toClassDescriptor(obj) {
251 + var kind = String(obj.kind);
252 +
253 + if (kind !== "class") {
254 + throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"');
255 + }
256 +
257 + this.disallowProperty(obj, "key", "A class descriptor");
258 + this.disallowProperty(obj, "placement", "A class descriptor");
259 + this.disallowProperty(obj, "descriptor", "A class descriptor");
260 + this.disallowProperty(obj, "initializer", "A class descriptor");
261 + this.disallowProperty(obj, "extras", "A class descriptor");
262 +
263 + var finisher = _optionalCallableProperty(obj, "finisher");
264 +
265 + var elements = this.toElementDescriptors(obj.elements);
266 + return {
267 + elements: elements,
268 + finisher: finisher
269 + };
270 + },
271 + runClassFinishers: function runClassFinishers(constructor, finishers) {
272 + for (var i = 0; i < finishers.length; i++) {
273 + var newConstructor = (0, finishers[i])(constructor);
274 +
275 + if (newConstructor !== undefined) {
276 + if (typeof newConstructor !== "function") {
277 + throw new TypeError("Finishers must return a constructor.");
278 + }
279 +
280 + constructor = newConstructor;
281 + }
282 + }
283 +
284 + return constructor;
285 + },
286 + disallowProperty: function disallowProperty(obj, name, objectType) {
287 + if (obj[name] !== undefined) {
288 + throw new TypeError(objectType + " can't have a ." + name + " property.");
289 + }
290 + }
291 + };
292 + return api;
293 +}
294 +
295 +function _createElementDescriptor(def) {
296 + var key = toPropertyKey(def.key);
297 + var descriptor;
298 +
299 + if (def.kind === "method") {
300 + descriptor = {
301 + value: def.value,
302 + writable: true,
303 + configurable: true,
304 + enumerable: false
305 + };
306 + } else if (def.kind === "get") {
307 + descriptor = {
308 + get: def.value,
309 + configurable: true,
310 + enumerable: false
311 + };
312 + } else if (def.kind === "set") {
313 + descriptor = {
314 + set: def.value,
315 + configurable: true,
316 + enumerable: false
317 + };
318 + } else if (def.kind === "field") {
319 + descriptor = {
320 + configurable: true,
321 + writable: true,
322 + enumerable: true
323 + };
324 + }
325 +
326 + var element = {
327 + kind: def.kind === "field" ? "field" : "method",
328 + key: key,
329 + placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype",
330 + descriptor: descriptor
331 + };
332 + if (def.decorators) element.decorators = def.decorators;
333 + if (def.kind === "field") element.initializer = def.value;
334 + return element;
335 +}
336 +
337 +function _coalesceGetterSetter(element, other) {
338 + if (element.descriptor.get !== undefined) {
339 + other.descriptor.get = element.descriptor.get;
340 + } else {
341 + other.descriptor.set = element.descriptor.set;
342 + }
343 +}
344 +
345 +function _coalesceClassElements(elements) {
346 + var newElements = [];
347 +
348 + var isSameElement = function isSameElement(other) {
349 + return other.kind === "method" && other.key === element.key && other.placement === element.placement;
350 + };
351 +
352 + for (var i = 0; i < elements.length; i++) {
353 + var element = elements[i];
354 + var other;
355 +
356 + if (element.kind === "method" && (other = newElements.find(isSameElement))) {
357 + if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) {
358 + if (_hasDecorators(element) || _hasDecorators(other)) {
359 + throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated.");
360 + }
361 +
362 + other.descriptor = element.descriptor;
363 + } else {
364 + if (_hasDecorators(element)) {
365 + if (_hasDecorators(other)) {
366 + throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ").");
367 + }
368 +
369 + other.decorators = element.decorators;
370 + }
371 +
372 + _coalesceGetterSetter(element, other);
373 + }
374 + } else {
375 + newElements.push(element);
376 + }
377 + }
378 +
379 + return newElements;
380 +}
381 +
382 +function _hasDecorators(element) {
383 + return element.decorators && element.decorators.length;
384 +}
385 +
386 +function _isDataDescriptor(desc) {
387 + return desc !== undefined && !(desc.value === undefined && desc.writable === undefined);
388 +}
389 +
390 +function _optionalCallableProperty(obj, name) {
391 + var value = obj[name];
392 +
393 + if (value !== undefined && typeof value !== "function") {
394 + throw new TypeError("Expected '" + name + "' to be a function");
395 + }
396 +
397 + return value;
398 +}
399 +
400 +module.exports = _decorate;
...\ No newline at end of file ...\ No newline at end of file
1 +function _defaults(obj, defaults) {
2 + var keys = Object.getOwnPropertyNames(defaults);
3 +
4 + for (var i = 0; i < keys.length; i++) {
5 + var key = keys[i];
6 + var value = Object.getOwnPropertyDescriptor(defaults, key);
7 +
8 + if (value && value.configurable && obj[key] === undefined) {
9 + Object.defineProperty(obj, key, value);
10 + }
11 + }
12 +
13 + return obj;
14 +}
15 +
16 +module.exports = _defaults;
...\ No newline at end of file ...\ No newline at end of file
1 +function _defineEnumerableProperties(obj, descs) {
2 + for (var key in descs) {
3 + var desc = descs[key];
4 + desc.configurable = desc.enumerable = true;
5 + if ("value" in desc) desc.writable = true;
6 + Object.defineProperty(obj, key, desc);
7 + }
8 +
9 + if (Object.getOwnPropertySymbols) {
10 + var objectSymbols = Object.getOwnPropertySymbols(descs);
11 +
12 + for (var i = 0; i < objectSymbols.length; i++) {
13 + var sym = objectSymbols[i];
14 + var desc = descs[sym];
15 + desc.configurable = desc.enumerable = true;
16 + if ("value" in desc) desc.writable = true;
17 + Object.defineProperty(obj, sym, desc);
18 + }
19 + }
20 +
21 + return obj;
22 +}
23 +
24 +module.exports = _defineEnumerableProperties;
...\ No newline at end of file ...\ No newline at end of file
1 +function _defineProperty(obj, key, value) {
2 + if (key in obj) {
3 + Object.defineProperty(obj, key, {
4 + value: value,
5 + enumerable: true,
6 + configurable: true,
7 + writable: true
8 + });
9 + } else {
10 + obj[key] = value;
11 + }
12 +
13 + return obj;
14 +}
15 +
16 +module.exports = _defineProperty;
...\ No newline at end of file ...\ No newline at end of file
1 +import AwaitValue from "./AwaitValue";
2 +export default function AsyncGenerator(gen) {
3 + var front, back;
4 +
5 + function send(key, arg) {
6 + return new Promise(function (resolve, reject) {
7 + var request = {
8 + key: key,
9 + arg: arg,
10 + resolve: resolve,
11 + reject: reject,
12 + next: null
13 + };
14 +
15 + if (back) {
16 + back = back.next = request;
17 + } else {
18 + front = back = request;
19 + resume(key, arg);
20 + }
21 + });
22 + }
23 +
24 + function resume(key, arg) {
25 + try {
26 + var result = gen[key](arg);
27 + var value = result.value;
28 + var wrappedAwait = value instanceof AwaitValue;
29 + Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) {
30 + if (wrappedAwait) {
31 + resume(key === "return" ? "return" : "next", arg);
32 + return;
33 + }
34 +
35 + settle(result.done ? "return" : "normal", arg);
36 + }, function (err) {
37 + resume("throw", err);
38 + });
39 + } catch (err) {
40 + settle("throw", err);
41 + }
42 + }
43 +
44 + function settle(type, value) {
45 + switch (type) {
46 + case "return":
47 + front.resolve({
48 + value: value,
49 + done: true
50 + });
51 + break;
52 +
53 + case "throw":
54 + front.reject(value);
55 + break;
56 +
57 + default:
58 + front.resolve({
59 + value: value,
60 + done: false
61 + });
62 + break;
63 + }
64 +
65 + front = front.next;
66 +
67 + if (front) {
68 + resume(front.key, front.arg);
69 + } else {
70 + back = null;
71 + }
72 + }
73 +
74 + this._invoke = send;
75 +
76 + if (typeof gen["return"] !== "function") {
77 + this["return"] = undefined;
78 + }
79 +}
80 +
81 +if (typeof Symbol === "function" && Symbol.asyncIterator) {
82 + AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
83 + return this;
84 + };
85 +}
86 +
87 +AsyncGenerator.prototype.next = function (arg) {
88 + return this._invoke("next", arg);
89 +};
90 +
91 +AsyncGenerator.prototype["throw"] = function (arg) {
92 + return this._invoke("throw", arg);
93 +};
94 +
95 +AsyncGenerator.prototype["return"] = function (arg) {
96 + return this._invoke("return", arg);
97 +};
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _AwaitValue(value) {
2 + this.wrapped = value;
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
2 + var desc = {};
3 + Object.keys(descriptor).forEach(function (key) {
4 + desc[key] = descriptor[key];
5 + });
6 + desc.enumerable = !!desc.enumerable;
7 + desc.configurable = !!desc.configurable;
8 +
9 + if ('value' in desc || desc.initializer) {
10 + desc.writable = true;
11 + }
12 +
13 + desc = decorators.slice().reverse().reduce(function (desc, decorator) {
14 + return decorator(target, property, desc) || desc;
15 + }, desc);
16 +
17 + if (context && desc.initializer !== void 0) {
18 + desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
19 + desc.initializer = undefined;
20 + }
21 +
22 + if (desc.initializer === void 0) {
23 + Object.defineProperty(target, property, desc);
24 + desc = null;
25 + }
26 +
27 + return desc;
28 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _arrayLikeToArray(arr, len) {
2 + if (len == null || len > arr.length) len = arr.length;
3 +
4 + for (var i = 0, arr2 = new Array(len); i < len; i++) {
5 + arr2[i] = arr[i];
6 + }
7 +
8 + return arr2;
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _arrayWithHoles(arr) {
2 + if (Array.isArray(arr)) return arr;
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import arrayLikeToArray from "./arrayLikeToArray";
2 +export default function _arrayWithoutHoles(arr) {
3 + if (Array.isArray(arr)) return arrayLikeToArray(arr);
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _assertThisInitialized(self) {
2 + if (self === void 0) {
3 + throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4 + }
5 +
6 + return self;
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _asyncGeneratorDelegate(inner, awaitWrap) {
2 + var iter = {},
3 + waiting = false;
4 +
5 + function pump(key, value) {
6 + waiting = true;
7 + value = new Promise(function (resolve) {
8 + resolve(inner[key](value));
9 + });
10 + return {
11 + done: false,
12 + value: awaitWrap(value)
13 + };
14 + }
15 +
16 + ;
17 +
18 + if (typeof Symbol === "function" && Symbol.iterator) {
19 + iter[Symbol.iterator] = function () {
20 + return this;
21 + };
22 + }
23 +
24 + iter.next = function (value) {
25 + if (waiting) {
26 + waiting = false;
27 + return value;
28 + }
29 +
30 + return pump("next", value);
31 + };
32 +
33 + if (typeof inner["throw"] === "function") {
34 + iter["throw"] = function (value) {
35 + if (waiting) {
36 + waiting = false;
37 + throw value;
38 + }
39 +
40 + return pump("throw", value);
41 + };
42 + }
43 +
44 + if (typeof inner["return"] === "function") {
45 + iter["return"] = function (value) {
46 + if (waiting) {
47 + waiting = false;
48 + return value;
49 + }
50 +
51 + return pump("return", value);
52 + };
53 + }
54 +
55 + return iter;
56 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _asyncIterator(iterable) {
2 + var method;
3 +
4 + if (typeof Symbol !== "undefined") {
5 + if (Symbol.asyncIterator) {
6 + method = iterable[Symbol.asyncIterator];
7 + if (method != null) return method.call(iterable);
8 + }
9 +
10 + if (Symbol.iterator) {
11 + method = iterable[Symbol.iterator];
12 + if (method != null) return method.call(iterable);
13 + }
14 + }
15 +
16 + throw new TypeError("Object is not async iterable");
17 +}
...\ No newline at end of file ...\ No newline at end of file
1 +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2 + try {
3 + var info = gen[key](arg);
4 + var value = info.value;
5 + } catch (error) {
6 + reject(error);
7 + return;
8 + }
9 +
10 + if (info.done) {
11 + resolve(value);
12 + } else {
13 + Promise.resolve(value).then(_next, _throw);
14 + }
15 +}
16 +
17 +export default function _asyncToGenerator(fn) {
18 + return function () {
19 + var self = this,
20 + args = arguments;
21 + return new Promise(function (resolve, reject) {
22 + var gen = fn.apply(self, args);
23 +
24 + function _next(value) {
25 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
26 + }
27 +
28 + function _throw(err) {
29 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
30 + }
31 +
32 + _next(undefined);
33 + });
34 + };
35 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import AwaitValue from "./AwaitValue";
2 +export default function _awaitAsyncGenerator(value) {
3 + return new AwaitValue(value);
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classCallCheck(instance, Constructor) {
2 + if (!(instance instanceof Constructor)) {
3 + throw new TypeError("Cannot call a class as a function");
4 + }
5 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classNameTDZError(name) {
2 + throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys.");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classPrivateFieldDestructureSet(receiver, privateMap) {
2 + if (!privateMap.has(receiver)) {
3 + throw new TypeError("attempted to set private field on non-instance");
4 + }
5 +
6 + var descriptor = privateMap.get(receiver);
7 +
8 + if (descriptor.set) {
9 + if (!("__destrObj" in descriptor)) {
10 + descriptor.__destrObj = {
11 + set value(v) {
12 + descriptor.set.call(receiver, v);
13 + }
14 +
15 + };
16 + }
17 +
18 + return descriptor.__destrObj;
19 + } else {
20 + if (!descriptor.writable) {
21 + throw new TypeError("attempted to set read only private field");
22 + }
23 +
24 + return descriptor;
25 + }
26 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classPrivateFieldGet(receiver, privateMap) {
2 + var descriptor = privateMap.get(receiver);
3 +
4 + if (!descriptor) {
5 + throw new TypeError("attempted to get private field on non-instance");
6 + }
7 +
8 + if (descriptor.get) {
9 + return descriptor.get.call(receiver);
10 + }
11 +
12 + return descriptor.value;
13 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classPrivateFieldBase(receiver, privateKey) {
2 + if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
3 + throw new TypeError("attempted to use private field on non-instance");
4 + }
5 +
6 + return receiver;
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +var id = 0;
2 +export default function _classPrivateFieldKey(name) {
3 + return "__private_" + id++ + "_" + name;
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classPrivateFieldSet(receiver, privateMap, value) {
2 + var descriptor = privateMap.get(receiver);
3 +
4 + if (!descriptor) {
5 + throw new TypeError("attempted to set private field on non-instance");
6 + }
7 +
8 + if (descriptor.set) {
9 + descriptor.set.call(receiver, value);
10 + } else {
11 + if (!descriptor.writable) {
12 + throw new TypeError("attempted to set read only private field");
13 + }
14 +
15 + descriptor.value = value;
16 + }
17 +
18 + return value;
19 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classPrivateMethodGet(receiver, privateSet, fn) {
2 + if (!privateSet.has(receiver)) {
3 + throw new TypeError("attempted to get private field on non-instance");
4 + }
5 +
6 + return fn;
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classPrivateMethodSet() {
2 + throw new TypeError("attempted to reassign private method");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
2 + if (receiver !== classConstructor) {
3 + throw new TypeError("Private static access of wrong provenance");
4 + }
5 +
6 + if (descriptor.get) {
7 + return descriptor.get.call(receiver);
8 + }
9 +
10 + return descriptor.value;
11 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
2 + if (receiver !== classConstructor) {
3 + throw new TypeError("Private static access of wrong provenance");
4 + }
5 +
6 + if (descriptor.set) {
7 + descriptor.set.call(receiver, value);
8 + } else {
9 + if (!descriptor.writable) {
10 + throw new TypeError("attempted to set read only private field");
11 + }
12 +
13 + descriptor.value = value;
14 + }
15 +
16 + return value;
17 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
2 + if (receiver !== classConstructor) {
3 + throw new TypeError("Private static access of wrong provenance");
4 + }
5 +
6 + return method;
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _classStaticPrivateMethodSet() {
2 + throw new TypeError("attempted to set read only static private field");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import setPrototypeOf from "./setPrototypeOf";
2 +import isNativeReflectConstruct from "./isNativeReflectConstruct";
3 +export default function _construct(Parent, args, Class) {
4 + if (isNativeReflectConstruct()) {
5 + _construct = Reflect.construct;
6 + } else {
7 + _construct = function _construct(Parent, args, Class) {
8 + var a = [null];
9 + a.push.apply(a, args);
10 + var Constructor = Function.bind.apply(Parent, a);
11 + var instance = new Constructor();
12 + if (Class) setPrototypeOf(instance, Class.prototype);
13 + return instance;
14 + };
15 + }
16 +
17 + return _construct.apply(null, arguments);
18 +}
...\ No newline at end of file ...\ No newline at end of file
1 +function _defineProperties(target, props) {
2 + for (var i = 0; i < props.length; i++) {
3 + var descriptor = props[i];
4 + descriptor.enumerable = descriptor.enumerable || false;
5 + descriptor.configurable = true;
6 + if ("value" in descriptor) descriptor.writable = true;
7 + Object.defineProperty(target, descriptor.key, descriptor);
8 + }
9 +}
10 +
11 +export default function _createClass(Constructor, protoProps, staticProps) {
12 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
13 + if (staticProps) _defineProperties(Constructor, staticProps);
14 + return Constructor;
15 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import unsupportedIterableToArray from "./unsupportedIterableToArray";
2 +export default function _createForOfIteratorHelper(o) {
3 + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
4 + if (Array.isArray(o) || (o = unsupportedIterableToArray(o))) {
5 + var i = 0;
6 +
7 + var F = function F() {};
8 +
9 + return {
10 + s: F,
11 + n: function n() {
12 + if (i >= o.length) return {
13 + done: true
14 + };
15 + return {
16 + done: false,
17 + value: o[i++]
18 + };
19 + },
20 + e: function e(_e) {
21 + throw _e;
22 + },
23 + f: F
24 + };
25 + }
26 +
27 + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
28 + }
29 +
30 + var it,
31 + normalCompletion = true,
32 + didErr = false,
33 + err;
34 + return {
35 + s: function s() {
36 + it = o[Symbol.iterator]();
37 + },
38 + n: function n() {
39 + var step = it.next();
40 + normalCompletion = step.done;
41 + return step;
42 + },
43 + e: function e(_e2) {
44 + didErr = true;
45 + err = _e2;
46 + },
47 + f: function f() {
48 + try {
49 + if (!normalCompletion && it["return"] != null) it["return"]();
50 + } finally {
51 + if (didErr) throw err;
52 + }
53 + }
54 + };
55 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import unsupportedIterableToArray from "./unsupportedIterableToArray";
2 +export default function _createForOfIteratorHelperLoose(o) {
3 + var i = 0;
4 +
5 + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
6 + if (Array.isArray(o) || (o = unsupportedIterableToArray(o))) return function () {
7 + if (i >= o.length) return {
8 + done: true
9 + };
10 + return {
11 + done: false,
12 + value: o[i++]
13 + };
14 + };
15 + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16 + }
17 +
18 + i = o[Symbol.iterator]();
19 + return i.next.bind(i);
20 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getPrototypeOf from "./getPrototypeOf";
2 +import isNativeReflectConstruct from "./isNativeReflectConstruct";
3 +import possibleConstructorReturn from "./possibleConstructorReturn";
4 +export default function _createSuper(Derived) {
5 + var hasNativeReflectConstruct = isNativeReflectConstruct();
6 + return function () {
7 + var Super = getPrototypeOf(Derived),
8 + result;
9 +
10 + if (hasNativeReflectConstruct) {
11 + var NewTarget = getPrototypeOf(this).constructor;
12 + result = Reflect.construct(Super, arguments, NewTarget);
13 + } else {
14 + result = Super.apply(this, arguments);
15 + }
16 +
17 + return possibleConstructorReturn(this, result);
18 + };
19 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import toArray from "./toArray";
2 +import toPropertyKey from "./toPropertyKey";
3 +export default function _decorate(decorators, factory, superClass, mixins) {
4 + var api = _getDecoratorsApi();
5 +
6 + if (mixins) {
7 + for (var i = 0; i < mixins.length; i++) {
8 + api = mixins[i](api);
9 + }
10 + }
11 +
12 + var r = factory(function initialize(O) {
13 + api.initializeInstanceElements(O, decorated.elements);
14 + }, superClass);
15 + var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators);
16 + api.initializeClassElements(r.F, decorated.elements);
17 + return api.runClassFinishers(r.F, decorated.finishers);
18 +}
19 +
20 +function _getDecoratorsApi() {
21 + _getDecoratorsApi = function _getDecoratorsApi() {
22 + return api;
23 + };
24 +
25 + var api = {
26 + elementsDefinitionOrder: [["method"], ["field"]],
27 + initializeInstanceElements: function initializeInstanceElements(O, elements) {
28 + ["method", "field"].forEach(function (kind) {
29 + elements.forEach(function (element) {
30 + if (element.kind === kind && element.placement === "own") {
31 + this.defineClassElement(O, element);
32 + }
33 + }, this);
34 + }, this);
35 + },
36 + initializeClassElements: function initializeClassElements(F, elements) {
37 + var proto = F.prototype;
38 + ["method", "field"].forEach(function (kind) {
39 + elements.forEach(function (element) {
40 + var placement = element.placement;
41 +
42 + if (element.kind === kind && (placement === "static" || placement === "prototype")) {
43 + var receiver = placement === "static" ? F : proto;
44 + this.defineClassElement(receiver, element);
45 + }
46 + }, this);
47 + }, this);
48 + },
49 + defineClassElement: function defineClassElement(receiver, element) {
50 + var descriptor = element.descriptor;
51 +
52 + if (element.kind === "field") {
53 + var initializer = element.initializer;
54 + descriptor = {
55 + enumerable: descriptor.enumerable,
56 + writable: descriptor.writable,
57 + configurable: descriptor.configurable,
58 + value: initializer === void 0 ? void 0 : initializer.call(receiver)
59 + };
60 + }
61 +
62 + Object.defineProperty(receiver, element.key, descriptor);
63 + },
64 + decorateClass: function decorateClass(elements, decorators) {
65 + var newElements = [];
66 + var finishers = [];
67 + var placements = {
68 + "static": [],
69 + prototype: [],
70 + own: []
71 + };
72 + elements.forEach(function (element) {
73 + this.addElementPlacement(element, placements);
74 + }, this);
75 + elements.forEach(function (element) {
76 + if (!_hasDecorators(element)) return newElements.push(element);
77 + var elementFinishersExtras = this.decorateElement(element, placements);
78 + newElements.push(elementFinishersExtras.element);
79 + newElements.push.apply(newElements, elementFinishersExtras.extras);
80 + finishers.push.apply(finishers, elementFinishersExtras.finishers);
81 + }, this);
82 +
83 + if (!decorators) {
84 + return {
85 + elements: newElements,
86 + finishers: finishers
87 + };
88 + }
89 +
90 + var result = this.decorateConstructor(newElements, decorators);
91 + finishers.push.apply(finishers, result.finishers);
92 + result.finishers = finishers;
93 + return result;
94 + },
95 + addElementPlacement: function addElementPlacement(element, placements, silent) {
96 + var keys = placements[element.placement];
97 +
98 + if (!silent && keys.indexOf(element.key) !== -1) {
99 + throw new TypeError("Duplicated element (" + element.key + ")");
100 + }
101 +
102 + keys.push(element.key);
103 + },
104 + decorateElement: function decorateElement(element, placements) {
105 + var extras = [];
106 + var finishers = [];
107 +
108 + for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) {
109 + var keys = placements[element.placement];
110 + keys.splice(keys.indexOf(element.key), 1);
111 + var elementObject = this.fromElementDescriptor(element);
112 + var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject);
113 + element = elementFinisherExtras.element;
114 + this.addElementPlacement(element, placements);
115 +
116 + if (elementFinisherExtras.finisher) {
117 + finishers.push(elementFinisherExtras.finisher);
118 + }
119 +
120 + var newExtras = elementFinisherExtras.extras;
121 +
122 + if (newExtras) {
123 + for (var j = 0; j < newExtras.length; j++) {
124 + this.addElementPlacement(newExtras[j], placements);
125 + }
126 +
127 + extras.push.apply(extras, newExtras);
128 + }
129 + }
130 +
131 + return {
132 + element: element,
133 + finishers: finishers,
134 + extras: extras
135 + };
136 + },
137 + decorateConstructor: function decorateConstructor(elements, decorators) {
138 + var finishers = [];
139 +
140 + for (var i = decorators.length - 1; i >= 0; i--) {
141 + var obj = this.fromClassDescriptor(elements);
142 + var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj);
143 +
144 + if (elementsAndFinisher.finisher !== undefined) {
145 + finishers.push(elementsAndFinisher.finisher);
146 + }
147 +
148 + if (elementsAndFinisher.elements !== undefined) {
149 + elements = elementsAndFinisher.elements;
150 +
151 + for (var j = 0; j < elements.length - 1; j++) {
152 + for (var k = j + 1; k < elements.length; k++) {
153 + if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) {
154 + throw new TypeError("Duplicated element (" + elements[j].key + ")");
155 + }
156 + }
157 + }
158 + }
159 + }
160 +
161 + return {
162 + elements: elements,
163 + finishers: finishers
164 + };
165 + },
166 + fromElementDescriptor: function fromElementDescriptor(element) {
167 + var obj = {
168 + kind: element.kind,
169 + key: element.key,
170 + placement: element.placement,
171 + descriptor: element.descriptor
172 + };
173 + var desc = {
174 + value: "Descriptor",
175 + configurable: true
176 + };
177 + Object.defineProperty(obj, Symbol.toStringTag, desc);
178 + if (element.kind === "field") obj.initializer = element.initializer;
179 + return obj;
180 + },
181 + toElementDescriptors: function toElementDescriptors(elementObjects) {
182 + if (elementObjects === undefined) return;
183 + return toArray(elementObjects).map(function (elementObject) {
184 + var element = this.toElementDescriptor(elementObject);
185 + this.disallowProperty(elementObject, "finisher", "An element descriptor");
186 + this.disallowProperty(elementObject, "extras", "An element descriptor");
187 + return element;
188 + }, this);
189 + },
190 + toElementDescriptor: function toElementDescriptor(elementObject) {
191 + var kind = String(elementObject.kind);
192 +
193 + if (kind !== "method" && kind !== "field") {
194 + throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"');
195 + }
196 +
197 + var key = toPropertyKey(elementObject.key);
198 + var placement = String(elementObject.placement);
199 +
200 + if (placement !== "static" && placement !== "prototype" && placement !== "own") {
201 + throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"');
202 + }
203 +
204 + var descriptor = elementObject.descriptor;
205 + this.disallowProperty(elementObject, "elements", "An element descriptor");
206 + var element = {
207 + kind: kind,
208 + key: key,
209 + placement: placement,
210 + descriptor: Object.assign({}, descriptor)
211 + };
212 +
213 + if (kind !== "field") {
214 + this.disallowProperty(elementObject, "initializer", "A method descriptor");
215 + } else {
216 + this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor");
217 + this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor");
218 + this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor");
219 + element.initializer = elementObject.initializer;
220 + }
221 +
222 + return element;
223 + },
224 + toElementFinisherExtras: function toElementFinisherExtras(elementObject) {
225 + var element = this.toElementDescriptor(elementObject);
226 +
227 + var finisher = _optionalCallableProperty(elementObject, "finisher");
228 +
229 + var extras = this.toElementDescriptors(elementObject.extras);
230 + return {
231 + element: element,
232 + finisher: finisher,
233 + extras: extras
234 + };
235 + },
236 + fromClassDescriptor: function fromClassDescriptor(elements) {
237 + var obj = {
238 + kind: "class",
239 + elements: elements.map(this.fromElementDescriptor, this)
240 + };
241 + var desc = {
242 + value: "Descriptor",
243 + configurable: true
244 + };
245 + Object.defineProperty(obj, Symbol.toStringTag, desc);
246 + return obj;
247 + },
248 + toClassDescriptor: function toClassDescriptor(obj) {
249 + var kind = String(obj.kind);
250 +
251 + if (kind !== "class") {
252 + throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"');
253 + }
254 +
255 + this.disallowProperty(obj, "key", "A class descriptor");
256 + this.disallowProperty(obj, "placement", "A class descriptor");
257 + this.disallowProperty(obj, "descriptor", "A class descriptor");
258 + this.disallowProperty(obj, "initializer", "A class descriptor");
259 + this.disallowProperty(obj, "extras", "A class descriptor");
260 +
261 + var finisher = _optionalCallableProperty(obj, "finisher");
262 +
263 + var elements = this.toElementDescriptors(obj.elements);
264 + return {
265 + elements: elements,
266 + finisher: finisher
267 + };
268 + },
269 + runClassFinishers: function runClassFinishers(constructor, finishers) {
270 + for (var i = 0; i < finishers.length; i++) {
271 + var newConstructor = (0, finishers[i])(constructor);
272 +
273 + if (newConstructor !== undefined) {
274 + if (typeof newConstructor !== "function") {
275 + throw new TypeError("Finishers must return a constructor.");
276 + }
277 +
278 + constructor = newConstructor;
279 + }
280 + }
281 +
282 + return constructor;
283 + },
284 + disallowProperty: function disallowProperty(obj, name, objectType) {
285 + if (obj[name] !== undefined) {
286 + throw new TypeError(objectType + " can't have a ." + name + " property.");
287 + }
288 + }
289 + };
290 + return api;
291 +}
292 +
293 +function _createElementDescriptor(def) {
294 + var key = toPropertyKey(def.key);
295 + var descriptor;
296 +
297 + if (def.kind === "method") {
298 + descriptor = {
299 + value: def.value,
300 + writable: true,
301 + configurable: true,
302 + enumerable: false
303 + };
304 + } else if (def.kind === "get") {
305 + descriptor = {
306 + get: def.value,
307 + configurable: true,
308 + enumerable: false
309 + };
310 + } else if (def.kind === "set") {
311 + descriptor = {
312 + set: def.value,
313 + configurable: true,
314 + enumerable: false
315 + };
316 + } else if (def.kind === "field") {
317 + descriptor = {
318 + configurable: true,
319 + writable: true,
320 + enumerable: true
321 + };
322 + }
323 +
324 + var element = {
325 + kind: def.kind === "field" ? "field" : "method",
326 + key: key,
327 + placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype",
328 + descriptor: descriptor
329 + };
330 + if (def.decorators) element.decorators = def.decorators;
331 + if (def.kind === "field") element.initializer = def.value;
332 + return element;
333 +}
334 +
335 +function _coalesceGetterSetter(element, other) {
336 + if (element.descriptor.get !== undefined) {
337 + other.descriptor.get = element.descriptor.get;
338 + } else {
339 + other.descriptor.set = element.descriptor.set;
340 + }
341 +}
342 +
343 +function _coalesceClassElements(elements) {
344 + var newElements = [];
345 +
346 + var isSameElement = function isSameElement(other) {
347 + return other.kind === "method" && other.key === element.key && other.placement === element.placement;
348 + };
349 +
350 + for (var i = 0; i < elements.length; i++) {
351 + var element = elements[i];
352 + var other;
353 +
354 + if (element.kind === "method" && (other = newElements.find(isSameElement))) {
355 + if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) {
356 + if (_hasDecorators(element) || _hasDecorators(other)) {
357 + throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated.");
358 + }
359 +
360 + other.descriptor = element.descriptor;
361 + } else {
362 + if (_hasDecorators(element)) {
363 + if (_hasDecorators(other)) {
364 + throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ").");
365 + }
366 +
367 + other.decorators = element.decorators;
368 + }
369 +
370 + _coalesceGetterSetter(element, other);
371 + }
372 + } else {
373 + newElements.push(element);
374 + }
375 + }
376 +
377 + return newElements;
378 +}
379 +
380 +function _hasDecorators(element) {
381 + return element.decorators && element.decorators.length;
382 +}
383 +
384 +function _isDataDescriptor(desc) {
385 + return desc !== undefined && !(desc.value === undefined && desc.writable === undefined);
386 +}
387 +
388 +function _optionalCallableProperty(obj, name) {
389 + var value = obj[name];
390 +
391 + if (value !== undefined && typeof value !== "function") {
392 + throw new TypeError("Expected '" + name + "' to be a function");
393 + }
394 +
395 + return value;
396 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _defaults(obj, defaults) {
2 + var keys = Object.getOwnPropertyNames(defaults);
3 +
4 + for (var i = 0; i < keys.length; i++) {
5 + var key = keys[i];
6 + var value = Object.getOwnPropertyDescriptor(defaults, key);
7 +
8 + if (value && value.configurable && obj[key] === undefined) {
9 + Object.defineProperty(obj, key, value);
10 + }
11 + }
12 +
13 + return obj;
14 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _defineEnumerableProperties(obj, descs) {
2 + for (var key in descs) {
3 + var desc = descs[key];
4 + desc.configurable = desc.enumerable = true;
5 + if ("value" in desc) desc.writable = true;
6 + Object.defineProperty(obj, key, desc);
7 + }
8 +
9 + if (Object.getOwnPropertySymbols) {
10 + var objectSymbols = Object.getOwnPropertySymbols(descs);
11 +
12 + for (var i = 0; i < objectSymbols.length; i++) {
13 + var sym = objectSymbols[i];
14 + var desc = descs[sym];
15 + desc.configurable = desc.enumerable = true;
16 + if ("value" in desc) desc.writable = true;
17 + Object.defineProperty(obj, sym, desc);
18 + }
19 + }
20 +
21 + return obj;
22 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _defineProperty(obj, key, value) {
2 + if (key in obj) {
3 + Object.defineProperty(obj, key, {
4 + value: value,
5 + enumerable: true,
6 + configurable: true,
7 + writable: true
8 + });
9 + } else {
10 + obj[key] = value;
11 + }
12 +
13 + return obj;
14 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _extends() {
2 + _extends = Object.assign || function (target) {
3 + for (var i = 1; i < arguments.length; i++) {
4 + var source = arguments[i];
5 +
6 + for (var key in source) {
7 + if (Object.prototype.hasOwnProperty.call(source, key)) {
8 + target[key] = source[key];
9 + }
10 + }
11 + }
12 +
13 + return target;
14 + };
15 +
16 + return _extends.apply(this, arguments);
17 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import superPropBase from "./superPropBase";
2 +export default function _get(target, property, receiver) {
3 + if (typeof Reflect !== "undefined" && Reflect.get) {
4 + _get = Reflect.get;
5 + } else {
6 + _get = function _get(target, property, receiver) {
7 + var base = superPropBase(target, property);
8 + if (!base) return;
9 + var desc = Object.getOwnPropertyDescriptor(base, property);
10 +
11 + if (desc.get) {
12 + return desc.get.call(receiver);
13 + }
14 +
15 + return desc.value;
16 + };
17 + }
18 +
19 + return _get(target, property, receiver || target);
20 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _getPrototypeOf(o) {
2 + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
3 + return o.__proto__ || Object.getPrototypeOf(o);
4 + };
5 + return _getPrototypeOf(o);
6 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import setPrototypeOf from "./setPrototypeOf";
2 +export default function _inherits(subClass, superClass) {
3 + if (typeof superClass !== "function" && superClass !== null) {
4 + throw new TypeError("Super expression must either be null or a function");
5 + }
6 +
7 + subClass.prototype = Object.create(superClass && superClass.prototype, {
8 + constructor: {
9 + value: subClass,
10 + writable: true,
11 + configurable: true
12 + }
13 + });
14 + if (superClass) setPrototypeOf(subClass, superClass);
15 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _inheritsLoose(subClass, superClass) {
2 + subClass.prototype = Object.create(superClass.prototype);
3 + subClass.prototype.constructor = subClass;
4 + subClass.__proto__ = superClass;
5 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _initializerDefineProperty(target, property, descriptor, context) {
2 + if (!descriptor) return;
3 + Object.defineProperty(target, property, {
4 + enumerable: descriptor.enumerable,
5 + configurable: descriptor.configurable,
6 + writable: descriptor.writable,
7 + value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
8 + });
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _initializerWarningHelper(descriptor, context) {
2 + throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.');
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _instanceof(left, right) {
2 + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
3 + return !!right[Symbol.hasInstance](left);
4 + } else {
5 + return left instanceof right;
6 + }
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _interopRequireDefault(obj) {
2 + return obj && obj.__esModule ? obj : {
3 + "default": obj
4 + };
5 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import _typeof from "../../helpers/esm/typeof";
2 +
3 +function _getRequireWildcardCache() {
4 + if (typeof WeakMap !== "function") return null;
5 + var cache = new WeakMap();
6 +
7 + _getRequireWildcardCache = function _getRequireWildcardCache() {
8 + return cache;
9 + };
10 +
11 + return cache;
12 +}
13 +
14 +export default function _interopRequireWildcard(obj) {
15 + if (obj && obj.__esModule) {
16 + return obj;
17 + }
18 +
19 + if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
20 + return {
21 + "default": obj
22 + };
23 + }
24 +
25 + var cache = _getRequireWildcardCache();
26 +
27 + if (cache && cache.has(obj)) {
28 + return cache.get(obj);
29 + }
30 +
31 + var newObj = {};
32 + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
33 +
34 + for (var key in obj) {
35 + if (Object.prototype.hasOwnProperty.call(obj, key)) {
36 + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
37 +
38 + if (desc && (desc.get || desc.set)) {
39 + Object.defineProperty(newObj, key, desc);
40 + } else {
41 + newObj[key] = obj[key];
42 + }
43 + }
44 + }
45 +
46 + newObj["default"] = obj;
47 +
48 + if (cache) {
49 + cache.set(obj, newObj);
50 + }
51 +
52 + return newObj;
53 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _isNativeFunction(fn) {
2 + return Function.toString.call(fn).indexOf("[native code]") !== -1;
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _isNativeReflectConstruct() {
2 + if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3 + if (Reflect.construct.sham) return false;
4 + if (typeof Proxy === "function") return true;
5 +
6 + try {
7 + Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
8 + return true;
9 + } catch (e) {
10 + return false;
11 + }
12 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _iterableToArray(iter) {
2 + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _iterableToArrayLimit(arr, i) {
2 + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
3 + var _arr = [];
4 + var _n = true;
5 + var _d = false;
6 + var _e = undefined;
7 +
8 + try {
9 + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
10 + _arr.push(_s.value);
11 +
12 + if (i && _arr.length === i) break;
13 + }
14 + } catch (err) {
15 + _d = true;
16 + _e = err;
17 + } finally {
18 + try {
19 + if (!_n && _i["return"] != null) _i["return"]();
20 + } finally {
21 + if (_d) throw _e;
22 + }
23 + }
24 +
25 + return _arr;
26 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _iterableToArrayLimitLoose(arr, i) {
2 + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
3 + var _arr = [];
4 +
5 + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
6 + _arr.push(_step.value);
7 +
8 + if (i && _arr.length === i) break;
9 + }
10 +
11 + return _arr;
12 +}
...\ No newline at end of file ...\ No newline at end of file
1 +var REACT_ELEMENT_TYPE;
2 +export default function _createRawReactElement(type, props, key, children) {
3 + if (!REACT_ELEMENT_TYPE) {
4 + REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7;
5 + }
6 +
7 + var defaultProps = type && type.defaultProps;
8 + var childrenLength = arguments.length - 3;
9 +
10 + if (!props && childrenLength !== 0) {
11 + props = {
12 + children: void 0
13 + };
14 + }
15 +
16 + if (childrenLength === 1) {
17 + props.children = children;
18 + } else if (childrenLength > 1) {
19 + var childArray = new Array(childrenLength);
20 +
21 + for (var i = 0; i < childrenLength; i++) {
22 + childArray[i] = arguments[i + 3];
23 + }
24 +
25 + props.children = childArray;
26 + }
27 +
28 + if (props && defaultProps) {
29 + for (var propName in defaultProps) {
30 + if (props[propName] === void 0) {
31 + props[propName] = defaultProps[propName];
32 + }
33 + }
34 + } else if (!props) {
35 + props = defaultProps || {};
36 + }
37 +
38 + return {
39 + $$typeof: REACT_ELEMENT_TYPE,
40 + type: type,
41 + key: key === undefined ? null : '' + key,
42 + ref: null,
43 + props: props,
44 + _owner: null
45 + };
46 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _newArrowCheck(innerThis, boundThis) {
2 + if (innerThis !== boundThis) {
3 + throw new TypeError("Cannot instantiate an arrow function");
4 + }
5 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _nonIterableRest() {
2 + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _nonIterableSpread() {
2 + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _objectDestructuringEmpty(obj) {
2 + if (obj == null) throw new TypeError("Cannot destructure undefined");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import defineProperty from "./defineProperty";
2 +export default function _objectSpread(target) {
3 + for (var i = 1; i < arguments.length; i++) {
4 + var source = arguments[i] != null ? Object(arguments[i]) : {};
5 + var ownKeys = Object.keys(source);
6 +
7 + if (typeof Object.getOwnPropertySymbols === 'function') {
8 + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
9 + return Object.getOwnPropertyDescriptor(source, sym).enumerable;
10 + }));
11 + }
12 +
13 + ownKeys.forEach(function (key) {
14 + defineProperty(target, key, source[key]);
15 + });
16 + }
17 +
18 + return target;
19 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import defineProperty from "./defineProperty";
2 +
3 +function ownKeys(object, enumerableOnly) {
4 + var keys = Object.keys(object);
5 +
6 + if (Object.getOwnPropertySymbols) {
7 + var symbols = Object.getOwnPropertySymbols(object);
8 + if (enumerableOnly) symbols = symbols.filter(function (sym) {
9 + return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10 + });
11 + keys.push.apply(keys, symbols);
12 + }
13 +
14 + return keys;
15 +}
16 +
17 +export default function _objectSpread2(target) {
18 + for (var i = 1; i < arguments.length; i++) {
19 + var source = arguments[i] != null ? arguments[i] : {};
20 +
21 + if (i % 2) {
22 + ownKeys(Object(source), true).forEach(function (key) {
23 + defineProperty(target, key, source[key]);
24 + });
25 + } else if (Object.getOwnPropertyDescriptors) {
26 + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
27 + } else {
28 + ownKeys(Object(source)).forEach(function (key) {
29 + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
30 + });
31 + }
32 + }
33 +
34 + return target;
35 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose";
2 +export default function _objectWithoutProperties(source, excluded) {
3 + if (source == null) return {};
4 + var target = objectWithoutPropertiesLoose(source, excluded);
5 + var key, i;
6 +
7 + if (Object.getOwnPropertySymbols) {
8 + var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
9 +
10 + for (i = 0; i < sourceSymbolKeys.length; i++) {
11 + key = sourceSymbolKeys[i];
12 + if (excluded.indexOf(key) >= 0) continue;
13 + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
14 + target[key] = source[key];
15 + }
16 + }
17 +
18 + return target;
19 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _objectWithoutPropertiesLoose(source, excluded) {
2 + if (source == null) return {};
3 + var target = {};
4 + var sourceKeys = Object.keys(source);
5 + var key, i;
6 +
7 + for (i = 0; i < sourceKeys.length; i++) {
8 + key = sourceKeys[i];
9 + if (excluded.indexOf(key) >= 0) continue;
10 + target[key] = source[key];
11 + }
12 +
13 + return target;
14 +}
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "type": "module"
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import _typeof from "../../helpers/esm/typeof";
2 +import assertThisInitialized from "./assertThisInitialized";
3 +export default function _possibleConstructorReturn(self, call) {
4 + if (call && (_typeof(call) === "object" || typeof call === "function")) {
5 + return call;
6 + }
7 +
8 + return assertThisInitialized(self);
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _readOnlyError(name) {
2 + throw new Error("\"" + name + "\" is read-only");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import superPropBase from "./superPropBase";
2 +import defineProperty from "./defineProperty";
3 +
4 +function set(target, property, value, receiver) {
5 + if (typeof Reflect !== "undefined" && Reflect.set) {
6 + set = Reflect.set;
7 + } else {
8 + set = function set(target, property, value, receiver) {
9 + var base = superPropBase(target, property);
10 + var desc;
11 +
12 + if (base) {
13 + desc = Object.getOwnPropertyDescriptor(base, property);
14 +
15 + if (desc.set) {
16 + desc.set.call(receiver, value);
17 + return true;
18 + } else if (!desc.writable) {
19 + return false;
20 + }
21 + }
22 +
23 + desc = Object.getOwnPropertyDescriptor(receiver, property);
24 +
25 + if (desc) {
26 + if (!desc.writable) {
27 + return false;
28 + }
29 +
30 + desc.value = value;
31 + Object.defineProperty(receiver, property, desc);
32 + } else {
33 + defineProperty(receiver, property, value);
34 + }
35 +
36 + return true;
37 + };
38 + }
39 +
40 + return set(target, property, value, receiver);
41 +}
42 +
43 +export default function _set(target, property, value, receiver, isStrict) {
44 + var s = set(target, property, value, receiver || target);
45 +
46 + if (!s && isStrict) {
47 + throw new Error('failed to set property');
48 + }
49 +
50 + return value;
51 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _setPrototypeOf(o, p) {
2 + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
3 + o.__proto__ = p;
4 + return o;
5 + };
6 +
7 + return _setPrototypeOf(o, p);
8 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _skipFirstGeneratorNext(fn) {
2 + return function () {
3 + var it = fn.apply(this, arguments);
4 + it.next();
5 + return it;
6 + };
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import arrayWithHoles from "./arrayWithHoles";
2 +import iterableToArrayLimit from "./iterableToArrayLimit";
3 +import unsupportedIterableToArray from "./unsupportedIterableToArray";
4 +import nonIterableRest from "./nonIterableRest";
5 +export default function _slicedToArray(arr, i) {
6 + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import arrayWithHoles from "./arrayWithHoles";
2 +import iterableToArrayLimitLoose from "./iterableToArrayLimitLoose";
3 +import unsupportedIterableToArray from "./unsupportedIterableToArray";
4 +import nonIterableRest from "./nonIterableRest";
5 +export default function _slicedToArrayLoose(arr, i) {
6 + return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getPrototypeOf from "./getPrototypeOf";
2 +export default function _superPropBase(object, property) {
3 + while (!Object.prototype.hasOwnProperty.call(object, property)) {
4 + object = getPrototypeOf(object);
5 + if (object === null) break;
6 + }
7 +
8 + return object;
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _taggedTemplateLiteral(strings, raw) {
2 + if (!raw) {
3 + raw = strings.slice(0);
4 + }
5 +
6 + return Object.freeze(Object.defineProperties(strings, {
7 + raw: {
8 + value: Object.freeze(raw)
9 + }
10 + }));
11 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _taggedTemplateLiteralLoose(strings, raw) {
2 + if (!raw) {
3 + raw = strings.slice(0);
4 + }
5 +
6 + strings.raw = raw;
7 + return strings;
8 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _tdzError(name) {
2 + throw new ReferenceError(name + " is not defined - temporal dead zone");
3 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import undef from "./temporalUndefined";
2 +import err from "./tdz";
3 +export default function _temporalRef(val, name) {
4 + return val === undef ? err(name) : val;
5 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _temporalUndefined() {}
...\ No newline at end of file ...\ No newline at end of file
1 +import arrayWithHoles from "./arrayWithHoles";
2 +import iterableToArray from "./iterableToArray";
3 +import unsupportedIterableToArray from "./unsupportedIterableToArray";
4 +import nonIterableRest from "./nonIterableRest";
5 +export default function _toArray(arr) {
6 + return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import arrayWithoutHoles from "./arrayWithoutHoles";
2 +import iterableToArray from "./iterableToArray";
3 +import unsupportedIterableToArray from "./unsupportedIterableToArray";
4 +import nonIterableSpread from "./nonIterableSpread";
5 +export default function _toConsumableArray(arr) {
6 + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
7 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import _typeof from "../../helpers/esm/typeof";
2 +export default function _toPrimitive(input, hint) {
3 + if (_typeof(input) !== "object" || input === null) return input;
4 + var prim = input[Symbol.toPrimitive];
5 +
6 + if (prim !== undefined) {
7 + var res = prim.call(input, hint || "default");
8 + if (_typeof(res) !== "object") return res;
9 + throw new TypeError("@@toPrimitive must return a primitive value.");
10 + }
11 +
12 + return (hint === "string" ? String : Number)(input);
13 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import _typeof from "../../helpers/esm/typeof";
2 +import toPrimitive from "./toPrimitive";
3 +export default function _toPropertyKey(arg) {
4 + var key = toPrimitive(arg, "string");
5 + return _typeof(key) === "symbol" ? key : String(key);
6 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export default function _typeof(obj) {
2 + "@babel/helpers - typeof";
3 +
4 + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
5 + _typeof = function _typeof(obj) {
6 + return typeof obj;
7 + };
8 + } else {
9 + _typeof = function _typeof(obj) {
10 + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11 + };
12 + }
13 +
14 + return _typeof(obj);
15 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import arrayLikeToArray from "./arrayLikeToArray";
2 +export default function _unsupportedIterableToArray(o, minLen) {
3 + if (!o) return;
4 + if (typeof o === "string") return arrayLikeToArray(o, minLen);
5 + var n = Object.prototype.toString.call(o).slice(8, -1);
6 + if (n === "Object" && o.constructor) n = o.constructor.name;
7 + if (n === "Map" || n === "Set") return Array.from(o);
8 + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import AsyncGenerator from "./AsyncGenerator";
2 +export default function _wrapAsyncGenerator(fn) {
3 + return function () {
4 + return new AsyncGenerator(fn.apply(this, arguments));
5 + };
6 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import getPrototypeOf from "./getPrototypeOf";
2 +import setPrototypeOf from "./setPrototypeOf";
3 +import isNativeFunction from "./isNativeFunction";
4 +import construct from "./construct";
5 +export default function _wrapNativeSuper(Class) {
6 + var _cache = typeof Map === "function" ? new Map() : undefined;
7 +
8 + _wrapNativeSuper = function _wrapNativeSuper(Class) {
9 + if (Class === null || !isNativeFunction(Class)) return Class;
10 +
11 + if (typeof Class !== "function") {
12 + throw new TypeError("Super expression must either be null or a function");
13 + }
14 +
15 + if (typeof _cache !== "undefined") {
16 + if (_cache.has(Class)) return _cache.get(Class);
17 +
18 + _cache.set(Class, Wrapper);
19 + }
20 +
21 + function Wrapper() {
22 + return construct(Class, arguments, getPrototypeOf(this).constructor);
23 + }
24 +
25 + Wrapper.prototype = Object.create(Class.prototype, {
26 + constructor: {
27 + value: Wrapper,
28 + enumerable: false,
29 + writable: true,
30 + configurable: true
31 + }
32 + });
33 + return setPrototypeOf(Wrapper, Class);
34 + };
35 +
36 + return _wrapNativeSuper(Class);
37 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import _typeof from "../../helpers/esm/typeof";
2 +import wrapNativeSuper from "./wrapNativeSuper";
3 +import getPrototypeOf from "./getPrototypeOf";
4 +import possibleConstructorReturn from "./possibleConstructorReturn";
5 +import inherits from "./inherits";
6 +export default function _wrapRegExp(re, groups) {
7 + _wrapRegExp = function _wrapRegExp(re, groups) {
8 + return new BabelRegExp(re, undefined, groups);
9 + };
10 +
11 + var _RegExp = wrapNativeSuper(RegExp);
12 +
13 + var _super = RegExp.prototype;
14 +
15 + var _groups = new WeakMap();
16 +
17 + function BabelRegExp(re, flags, groups) {
18 + var _this = _RegExp.call(this, re, flags);
19 +
20 + _groups.set(_this, groups || _groups.get(re));
21 +
22 + return _this;
23 + }
24 +
25 + inherits(BabelRegExp, _RegExp);
26 +
27 + BabelRegExp.prototype.exec = function (str) {
28 + var result = _super.exec.call(this, str);
29 +
30 + if (result) result.groups = buildGroups(result, this);
31 + return result;
32 + };
33 +
34 + BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
35 + if (typeof substitution === "string") {
36 + var groups = _groups.get(this);
37 +
38 + return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
39 + return "$" + groups[name];
40 + }));
41 + } else if (typeof substitution === "function") {
42 + var _this = this;
43 +
44 + return _super[Symbol.replace].call(this, str, function () {
45 + var args = [];
46 + args.push.apply(args, arguments);
47 +
48 + if (_typeof(args[args.length - 1]) !== "object") {
49 + args.push(buildGroups(args, _this));
50 + }
51 +
52 + return substitution.apply(this, args);
53 + });
54 + } else {
55 + return _super[Symbol.replace].call(this, str, substitution);
56 + }
57 + };
58 +
59 + function buildGroups(result, re) {
60 + var g = _groups.get(re);
61 +
62 + return Object.keys(g).reduce(function (groups, name) {
63 + groups[name] = result[g[name]];
64 + return groups;
65 + }, Object.create(null));
66 + }
67 +
68 + return _wrapRegExp.apply(this, arguments);
69 +}
...\ No newline at end of file ...\ No newline at end of file
1 +function _extends() {
2 + module.exports = _extends = Object.assign || function (target) {
3 + for (var i = 1; i < arguments.length; i++) {
4 + var source = arguments[i];
5 +
6 + for (var key in source) {
7 + if (Object.prototype.hasOwnProperty.call(source, key)) {
8 + target[key] = source[key];
9 + }
10 + }
11 + }
12 +
13 + return target;
14 + };
15 +
16 + return _extends.apply(this, arguments);
17 +}
18 +
19 +module.exports = _extends;
...\ No newline at end of file ...\ No newline at end of file
1 +var superPropBase = require("./superPropBase");
2 +
3 +function _get(target, property, receiver) {
4 + if (typeof Reflect !== "undefined" && Reflect.get) {
5 + module.exports = _get = Reflect.get;
6 + } else {
7 + module.exports = _get = function _get(target, property, receiver) {
8 + var base = superPropBase(target, property);
9 + if (!base) return;
10 + var desc = Object.getOwnPropertyDescriptor(base, property);
11 +
12 + if (desc.get) {
13 + return desc.get.call(receiver);
14 + }
15 +
16 + return desc.value;
17 + };
18 + }
19 +
20 + return _get(target, property, receiver || target);
21 +}
22 +
23 +module.exports = _get;
...\ No newline at end of file ...\ No newline at end of file
1 +function _getPrototypeOf(o) {
2 + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
3 + return o.__proto__ || Object.getPrototypeOf(o);
4 + };
5 + return _getPrototypeOf(o);
6 +}
7 +
8 +module.exports = _getPrototypeOf;
...\ No newline at end of file ...\ No newline at end of file
1 +var setPrototypeOf = require("./setPrototypeOf");
2 +
3 +function _inherits(subClass, superClass) {
4 + if (typeof superClass !== "function" && superClass !== null) {
5 + throw new TypeError("Super expression must either be null or a function");
6 + }
7 +
8 + subClass.prototype = Object.create(superClass && superClass.prototype, {
9 + constructor: {
10 + value: subClass,
11 + writable: true,
12 + configurable: true
13 + }
14 + });
15 + if (superClass) setPrototypeOf(subClass, superClass);
16 +}
17 +
18 +module.exports = _inherits;
...\ No newline at end of file ...\ No newline at end of file
1 +function _inheritsLoose(subClass, superClass) {
2 + subClass.prototype = Object.create(superClass.prototype);
3 + subClass.prototype.constructor = subClass;
4 + subClass.__proto__ = superClass;
5 +}
6 +
7 +module.exports = _inheritsLoose;
...\ No newline at end of file ...\ No newline at end of file
1 +function _initializerDefineProperty(target, property, descriptor, context) {
2 + if (!descriptor) return;
3 + Object.defineProperty(target, property, {
4 + enumerable: descriptor.enumerable,
5 + configurable: descriptor.configurable,
6 + writable: descriptor.writable,
7 + value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
8 + });
9 +}
10 +
11 +module.exports = _initializerDefineProperty;
...\ No newline at end of file ...\ No newline at end of file
1 +function _initializerWarningHelper(descriptor, context) {
2 + throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.');
3 +}
4 +
5 +module.exports = _initializerWarningHelper;
...\ No newline at end of file ...\ No newline at end of file
1 +function _instanceof(left, right) {
2 + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
3 + return !!right[Symbol.hasInstance](left);
4 + } else {
5 + return left instanceof right;
6 + }
7 +}
8 +
9 +module.exports = _instanceof;
...\ No newline at end of file ...\ No newline at end of file
1 +function _interopRequireDefault(obj) {
2 + return obj && obj.__esModule ? obj : {
3 + "default": obj
4 + };
5 +}
6 +
7 +module.exports = _interopRequireDefault;
...\ No newline at end of file ...\ No newline at end of file
1 +var _typeof = require("../helpers/typeof");
2 +
3 +function _getRequireWildcardCache() {
4 + if (typeof WeakMap !== "function") return null;
5 + var cache = new WeakMap();
6 +
7 + _getRequireWildcardCache = function _getRequireWildcardCache() {
8 + return cache;
9 + };
10 +
11 + return cache;
12 +}
13 +
14 +function _interopRequireWildcard(obj) {
15 + if (obj && obj.__esModule) {
16 + return obj;
17 + }
18 +
19 + if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
20 + return {
21 + "default": obj
22 + };
23 + }
24 +
25 + var cache = _getRequireWildcardCache();
26 +
27 + if (cache && cache.has(obj)) {
28 + return cache.get(obj);
29 + }
30 +
31 + var newObj = {};
32 + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
33 +
34 + for (var key in obj) {
35 + if (Object.prototype.hasOwnProperty.call(obj, key)) {
36 + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
37 +
38 + if (desc && (desc.get || desc.set)) {
39 + Object.defineProperty(newObj, key, desc);
40 + } else {
41 + newObj[key] = obj[key];
42 + }
43 + }
44 + }
45 +
46 + newObj["default"] = obj;
47 +
48 + if (cache) {
49 + cache.set(obj, newObj);
50 + }
51 +
52 + return newObj;
53 +}
54 +
55 +module.exports = _interopRequireWildcard;
...\ No newline at end of file ...\ No newline at end of file
1 +function _isNativeFunction(fn) {
2 + return Function.toString.call(fn).indexOf("[native code]") !== -1;
3 +}
4 +
5 +module.exports = _isNativeFunction;
...\ No newline at end of file ...\ No newline at end of file
1 +function _isNativeReflectConstruct() {
2 + if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3 + if (Reflect.construct.sham) return false;
4 + if (typeof Proxy === "function") return true;
5 +
6 + try {
7 + Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
8 + return true;
9 + } catch (e) {
10 + return false;
11 + }
12 +}
13 +
14 +module.exports = _isNativeReflectConstruct;
...\ No newline at end of file ...\ No newline at end of file
1 +function _iterableToArray(iter) {
2 + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
3 +}
4 +
5 +module.exports = _iterableToArray;
...\ No newline at end of file ...\ No newline at end of file
1 +function _iterableToArrayLimit(arr, i) {
2 + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
3 + var _arr = [];
4 + var _n = true;
5 + var _d = false;
6 + var _e = undefined;
7 +
8 + try {
9 + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
10 + _arr.push(_s.value);
11 +
12 + if (i && _arr.length === i) break;
13 + }
14 + } catch (err) {
15 + _d = true;
16 + _e = err;
17 + } finally {
18 + try {
19 + if (!_n && _i["return"] != null) _i["return"]();
20 + } finally {
21 + if (_d) throw _e;
22 + }
23 + }
24 +
25 + return _arr;
26 +}
27 +
28 +module.exports = _iterableToArrayLimit;
...\ No newline at end of file ...\ No newline at end of file
1 +function _iterableToArrayLimitLoose(arr, i) {
2 + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
3 + var _arr = [];
4 +
5 + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
6 + _arr.push(_step.value);
7 +
8 + if (i && _arr.length === i) break;
9 + }
10 +
11 + return _arr;
12 +}
13 +
14 +module.exports = _iterableToArrayLimitLoose;
...\ No newline at end of file ...\ No newline at end of file
1 +var REACT_ELEMENT_TYPE;
2 +
3 +function _createRawReactElement(type, props, key, children) {
4 + if (!REACT_ELEMENT_TYPE) {
5 + REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7;
6 + }
7 +
8 + var defaultProps = type && type.defaultProps;
9 + var childrenLength = arguments.length - 3;
10 +
11 + if (!props && childrenLength !== 0) {
12 + props = {
13 + children: void 0
14 + };
15 + }
16 +
17 + if (childrenLength === 1) {
18 + props.children = children;
19 + } else if (childrenLength > 1) {
20 + var childArray = new Array(childrenLength);
21 +
22 + for (var i = 0; i < childrenLength; i++) {
23 + childArray[i] = arguments[i + 3];
24 + }
25 +
26 + props.children = childArray;
27 + }
28 +
29 + if (props && defaultProps) {
30 + for (var propName in defaultProps) {
31 + if (props[propName] === void 0) {
32 + props[propName] = defaultProps[propName];
33 + }
34 + }
35 + } else if (!props) {
36 + props = defaultProps || {};
37 + }
38 +
39 + return {
40 + $$typeof: REACT_ELEMENT_TYPE,
41 + type: type,
42 + key: key === undefined ? null : '' + key,
43 + ref: null,
44 + props: props,
45 + _owner: null
46 + };
47 +}
48 +
49 +module.exports = _createRawReactElement;
...\ No newline at end of file ...\ No newline at end of file
1 +var arrayLikeToArray = require("./arrayLikeToArray");
2 +
3 +function _maybeArrayLike(next, arr, i) {
4 + if (arr && !Array.isArray(arr) && typeof arr.length === "number") {
5 + var len = arr.length;
6 + return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len);
7 + }
8 +
9 + return next(arr, i);
10 +}
11 +
12 +module.exports = _maybeArrayLike;
...\ No newline at end of file ...\ No newline at end of file
1 +function _newArrowCheck(innerThis, boundThis) {
2 + if (innerThis !== boundThis) {
3 + throw new TypeError("Cannot instantiate an arrow function");
4 + }
5 +}
6 +
7 +module.exports = _newArrowCheck;
...\ No newline at end of file ...\ No newline at end of file
1 +function _nonIterableRest() {
2 + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3 +}
4 +
5 +module.exports = _nonIterableRest;
...\ No newline at end of file ...\ No newline at end of file
1 +function _nonIterableSpread() {
2 + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3 +}
4 +
5 +module.exports = _nonIterableSpread;
...\ No newline at end of file ...\ No newline at end of file
1 +function _objectDestructuringEmpty(obj) {
2 + if (obj == null) throw new TypeError("Cannot destructure undefined");
3 +}
4 +
5 +module.exports = _objectDestructuringEmpty;
...\ No newline at end of file ...\ No newline at end of file
1 +var defineProperty = require("./defineProperty");
2 +
3 +function _objectSpread(target) {
4 + for (var i = 1; i < arguments.length; i++) {
5 + var source = arguments[i] != null ? Object(arguments[i]) : {};
6 + var ownKeys = Object.keys(source);
7 +
8 + if (typeof Object.getOwnPropertySymbols === 'function') {
9 + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
10 + return Object.getOwnPropertyDescriptor(source, sym).enumerable;
11 + }));
12 + }
13 +
14 + ownKeys.forEach(function (key) {
15 + defineProperty(target, key, source[key]);
16 + });
17 + }
18 +
19 + return target;
20 +}
21 +
22 +module.exports = _objectSpread;
...\ No newline at end of file ...\ No newline at end of file
1 +var defineProperty = require("./defineProperty");
2 +
3 +function ownKeys(object, enumerableOnly) {
4 + var keys = Object.keys(object);
5 +
6 + if (Object.getOwnPropertySymbols) {
7 + var symbols = Object.getOwnPropertySymbols(object);
8 + if (enumerableOnly) symbols = symbols.filter(function (sym) {
9 + return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10 + });
11 + keys.push.apply(keys, symbols);
12 + }
13 +
14 + return keys;
15 +}
16 +
17 +function _objectSpread2(target) {
18 + for (var i = 1; i < arguments.length; i++) {
19 + var source = arguments[i] != null ? arguments[i] : {};
20 +
21 + if (i % 2) {
22 + ownKeys(Object(source), true).forEach(function (key) {
23 + defineProperty(target, key, source[key]);
24 + });
25 + } else if (Object.getOwnPropertyDescriptors) {
26 + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
27 + } else {
28 + ownKeys(Object(source)).forEach(function (key) {
29 + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
30 + });
31 + }
32 + }
33 +
34 + return target;
35 +}
36 +
37 +module.exports = _objectSpread2;
...\ No newline at end of file ...\ No newline at end of file
1 +var objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose");
2 +
3 +function _objectWithoutProperties(source, excluded) {
4 + if (source == null) return {};
5 + var target = objectWithoutPropertiesLoose(source, excluded);
6 + var key, i;
7 +
8 + if (Object.getOwnPropertySymbols) {
9 + var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
10 +
11 + for (i = 0; i < sourceSymbolKeys.length; i++) {
12 + key = sourceSymbolKeys[i];
13 + if (excluded.indexOf(key) >= 0) continue;
14 + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
15 + target[key] = source[key];
16 + }
17 + }
18 +
19 + return target;
20 +}
21 +
22 +module.exports = _objectWithoutProperties;
...\ No newline at end of file ...\ No newline at end of file
1 +function _objectWithoutPropertiesLoose(source, excluded) {
2 + if (source == null) return {};
3 + var target = {};
4 + var sourceKeys = Object.keys(source);
5 + var key, i;
6 +
7 + for (i = 0; i < sourceKeys.length; i++) {
8 + key = sourceKeys[i];
9 + if (excluded.indexOf(key) >= 0) continue;
10 + target[key] = source[key];
11 + }
12 +
13 + return target;
14 +}
15 +
16 +module.exports = _objectWithoutPropertiesLoose;
...\ No newline at end of file ...\ No newline at end of file
1 +var _typeof = require("../helpers/typeof");
2 +
3 +var assertThisInitialized = require("./assertThisInitialized");
4 +
5 +function _possibleConstructorReturn(self, call) {
6 + if (call && (_typeof(call) === "object" || typeof call === "function")) {
7 + return call;
8 + }
9 +
10 + return assertThisInitialized(self);
11 +}
12 +
13 +module.exports = _possibleConstructorReturn;
...\ No newline at end of file ...\ No newline at end of file
1 +function _readOnlyError(name) {
2 + throw new Error("\"" + name + "\" is read-only");
3 +}
4 +
5 +module.exports = _readOnlyError;
...\ No newline at end of file ...\ No newline at end of file
1 +var superPropBase = require("./superPropBase");
2 +
3 +var defineProperty = require("./defineProperty");
4 +
5 +function set(target, property, value, receiver) {
6 + if (typeof Reflect !== "undefined" && Reflect.set) {
7 + set = Reflect.set;
8 + } else {
9 + set = function set(target, property, value, receiver) {
10 + var base = superPropBase(target, property);
11 + var desc;
12 +
13 + if (base) {
14 + desc = Object.getOwnPropertyDescriptor(base, property);
15 +
16 + if (desc.set) {
17 + desc.set.call(receiver, value);
18 + return true;
19 + } else if (!desc.writable) {
20 + return false;
21 + }
22 + }
23 +
24 + desc = Object.getOwnPropertyDescriptor(receiver, property);
25 +
26 + if (desc) {
27 + if (!desc.writable) {
28 + return false;
29 + }
30 +
31 + desc.value = value;
32 + Object.defineProperty(receiver, property, desc);
33 + } else {
34 + defineProperty(receiver, property, value);
35 + }
36 +
37 + return true;
38 + };
39 + }
40 +
41 + return set(target, property, value, receiver);
42 +}
43 +
44 +function _set(target, property, value, receiver, isStrict) {
45 + var s = set(target, property, value, receiver || target);
46 +
47 + if (!s && isStrict) {
48 + throw new Error('failed to set property');
49 + }
50 +
51 + return value;
52 +}
53 +
54 +module.exports = _set;
...\ No newline at end of file ...\ No newline at end of file
1 +function _setPrototypeOf(o, p) {
2 + module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
3 + o.__proto__ = p;
4 + return o;
5 + };
6 +
7 + return _setPrototypeOf(o, p);
8 +}
9 +
10 +module.exports = _setPrototypeOf;
...\ No newline at end of file ...\ No newline at end of file
1 +function _skipFirstGeneratorNext(fn) {
2 + return function () {
3 + var it = fn.apply(this, arguments);
4 + it.next();
5 + return it;
6 + };
7 +}
8 +
9 +module.exports = _skipFirstGeneratorNext;
...\ No newline at end of file ...\ No newline at end of file
1 +var arrayWithHoles = require("./arrayWithHoles");
2 +
3 +var iterableToArrayLimit = require("./iterableToArrayLimit");
4 +
5 +var unsupportedIterableToArray = require("./unsupportedIterableToArray");
6 +
7 +var nonIterableRest = require("./nonIterableRest");
8 +
9 +function _slicedToArray(arr, i) {
10 + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
11 +}
12 +
13 +module.exports = _slicedToArray;
...\ No newline at end of file ...\ No newline at end of file
1 +var arrayWithHoles = require("./arrayWithHoles");
2 +
3 +var iterableToArrayLimitLoose = require("./iterableToArrayLimitLoose");
4 +
5 +var unsupportedIterableToArray = require("./unsupportedIterableToArray");
6 +
7 +var nonIterableRest = require("./nonIterableRest");
8 +
9 +function _slicedToArrayLoose(arr, i) {
10 + return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
11 +}
12 +
13 +module.exports = _slicedToArrayLoose;
...\ No newline at end of file ...\ No newline at end of file
1 +var getPrototypeOf = require("./getPrototypeOf");
2 +
3 +function _superPropBase(object, property) {
4 + while (!Object.prototype.hasOwnProperty.call(object, property)) {
5 + object = getPrototypeOf(object);
6 + if (object === null) break;
7 + }
8 +
9 + return object;
10 +}
11 +
12 +module.exports = _superPropBase;
...\ No newline at end of file ...\ No newline at end of file
1 +function _taggedTemplateLiteral(strings, raw) {
2 + if (!raw) {
3 + raw = strings.slice(0);
4 + }
5 +
6 + return Object.freeze(Object.defineProperties(strings, {
7 + raw: {
8 + value: Object.freeze(raw)
9 + }
10 + }));
11 +}
12 +
13 +module.exports = _taggedTemplateLiteral;
...\ No newline at end of file ...\ No newline at end of file
1 +function _taggedTemplateLiteralLoose(strings, raw) {
2 + if (!raw) {
3 + raw = strings.slice(0);
4 + }
5 +
6 + strings.raw = raw;
7 + return strings;
8 +}
9 +
10 +module.exports = _taggedTemplateLiteralLoose;
...\ No newline at end of file ...\ No newline at end of file
1 +function _tdzError(name) {
2 + throw new ReferenceError(name + " is not defined - temporal dead zone");
3 +}
4 +
5 +module.exports = _tdzError;
...\ No newline at end of file ...\ No newline at end of file
1 +var temporalUndefined = require("./temporalUndefined");
2 +
3 +var tdz = require("./tdz");
4 +
5 +function _temporalRef(val, name) {
6 + return val === temporalUndefined ? tdz(name) : val;
7 +}
8 +
9 +module.exports = _temporalRef;
...\ No newline at end of file ...\ No newline at end of file
1 +function _temporalUndefined() {}
2 +
3 +module.exports = _temporalUndefined;
...\ No newline at end of file ...\ No newline at end of file
1 +var arrayWithHoles = require("./arrayWithHoles");
2 +
3 +var iterableToArray = require("./iterableToArray");
4 +
5 +var unsupportedIterableToArray = require("./unsupportedIterableToArray");
6 +
7 +var nonIterableRest = require("./nonIterableRest");
8 +
9 +function _toArray(arr) {
10 + return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
11 +}
12 +
13 +module.exports = _toArray;
...\ No newline at end of file ...\ No newline at end of file
1 +var arrayWithoutHoles = require("./arrayWithoutHoles");
2 +
3 +var iterableToArray = require("./iterableToArray");
4 +
5 +var unsupportedIterableToArray = require("./unsupportedIterableToArray");
6 +
7 +var nonIterableSpread = require("./nonIterableSpread");
8 +
9 +function _toConsumableArray(arr) {
10 + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
11 +}
12 +
13 +module.exports = _toConsumableArray;
...\ No newline at end of file ...\ No newline at end of file
1 +var _typeof = require("../helpers/typeof");
2 +
3 +function _toPrimitive(input, hint) {
4 + if (_typeof(input) !== "object" || input === null) return input;
5 + var prim = input[Symbol.toPrimitive];
6 +
7 + if (prim !== undefined) {
8 + var res = prim.call(input, hint || "default");
9 + if (_typeof(res) !== "object") return res;
10 + throw new TypeError("@@toPrimitive must return a primitive value.");
11 + }
12 +
13 + return (hint === "string" ? String : Number)(input);
14 +}
15 +
16 +module.exports = _toPrimitive;
...\ No newline at end of file ...\ No newline at end of file
1 +var _typeof = require("../helpers/typeof");
2 +
3 +var toPrimitive = require("./toPrimitive");
4 +
5 +function _toPropertyKey(arg) {
6 + var key = toPrimitive(arg, "string");
7 + return _typeof(key) === "symbol" ? key : String(key);
8 +}
9 +
10 +module.exports = _toPropertyKey;
...\ No newline at end of file ...\ No newline at end of file
1 +function _typeof(obj) {
2 + "@babel/helpers - typeof";
3 +
4 + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
5 + module.exports = _typeof = function _typeof(obj) {
6 + return typeof obj;
7 + };
8 + } else {
9 + module.exports = _typeof = function _typeof(obj) {
10 + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11 + };
12 + }
13 +
14 + return _typeof(obj);
15 +}
16 +
17 +module.exports = _typeof;
...\ No newline at end of file ...\ No newline at end of file
1 +var arrayLikeToArray = require("./arrayLikeToArray");
2 +
3 +function _unsupportedIterableToArray(o, minLen) {
4 + if (!o) return;
5 + if (typeof o === "string") return arrayLikeToArray(o, minLen);
6 + var n = Object.prototype.toString.call(o).slice(8, -1);
7 + if (n === "Object" && o.constructor) n = o.constructor.name;
8 + if (n === "Map" || n === "Set") return Array.from(o);
9 + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
10 +}
11 +
12 +module.exports = _unsupportedIterableToArray;
...\ No newline at end of file ...\ No newline at end of file
1 +var AsyncGenerator = require("./AsyncGenerator");
2 +
3 +function _wrapAsyncGenerator(fn) {
4 + return function () {
5 + return new AsyncGenerator(fn.apply(this, arguments));
6 + };
7 +}
8 +
9 +module.exports = _wrapAsyncGenerator;
...\ No newline at end of file ...\ No newline at end of file
1 +var getPrototypeOf = require("./getPrototypeOf");
2 +
3 +var setPrototypeOf = require("./setPrototypeOf");
4 +
5 +var isNativeFunction = require("./isNativeFunction");
6 +
7 +var construct = require("./construct");
8 +
9 +function _wrapNativeSuper(Class) {
10 + var _cache = typeof Map === "function" ? new Map() : undefined;
11 +
12 + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
13 + if (Class === null || !isNativeFunction(Class)) return Class;
14 +
15 + if (typeof Class !== "function") {
16 + throw new TypeError("Super expression must either be null or a function");
17 + }
18 +
19 + if (typeof _cache !== "undefined") {
20 + if (_cache.has(Class)) return _cache.get(Class);
21 +
22 + _cache.set(Class, Wrapper);
23 + }
24 +
25 + function Wrapper() {
26 + return construct(Class, arguments, getPrototypeOf(this).constructor);
27 + }
28 +
29 + Wrapper.prototype = Object.create(Class.prototype, {
30 + constructor: {
31 + value: Wrapper,
32 + enumerable: false,
33 + writable: true,
34 + configurable: true
35 + }
36 + });
37 + return setPrototypeOf(Wrapper, Class);
38 + };
39 +
40 + return _wrapNativeSuper(Class);
41 +}
42 +
43 +module.exports = _wrapNativeSuper;
...\ No newline at end of file ...\ No newline at end of file
1 +var _typeof = require("../helpers/typeof");
2 +
3 +var wrapNativeSuper = require("./wrapNativeSuper");
4 +
5 +var getPrototypeOf = require("./getPrototypeOf");
6 +
7 +var possibleConstructorReturn = require("./possibleConstructorReturn");
8 +
9 +var inherits = require("./inherits");
10 +
11 +function _wrapRegExp(re, groups) {
12 + module.exports = _wrapRegExp = function _wrapRegExp(re, groups) {
13 + return new BabelRegExp(re, undefined, groups);
14 + };
15 +
16 + var _RegExp = wrapNativeSuper(RegExp);
17 +
18 + var _super = RegExp.prototype;
19 +
20 + var _groups = new WeakMap();
21 +
22 + function BabelRegExp(re, flags, groups) {
23 + var _this = _RegExp.call(this, re, flags);
24 +
25 + _groups.set(_this, groups || _groups.get(re));
26 +
27 + return _this;
28 + }
29 +
30 + inherits(BabelRegExp, _RegExp);
31 +
32 + BabelRegExp.prototype.exec = function (str) {
33 + var result = _super.exec.call(this, str);
34 +
35 + if (result) result.groups = buildGroups(result, this);
36 + return result;
37 + };
38 +
39 + BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
40 + if (typeof substitution === "string") {
41 + var groups = _groups.get(this);
42 +
43 + return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
44 + return "$" + groups[name];
45 + }));
46 + } else if (typeof substitution === "function") {
47 + var _this = this;
48 +
49 + return _super[Symbol.replace].call(this, str, function () {
50 + var args = [];
51 + args.push.apply(args, arguments);
52 +
53 + if (_typeof(args[args.length - 1]) !== "object") {
54 + args.push(buildGroups(args, _this));
55 + }
56 +
57 + return substitution.apply(this, args);
58 + });
59 + } else {
60 + return _super[Symbol.replace].call(this, str, substitution);
61 + }
62 + };
63 +
64 + function buildGroups(result, re) {
65 + var g = _groups.get(re);
66 +
67 + return Object.keys(g).reduce(function (groups, name) {
68 + groups[name] = result[g[name]];
69 + return groups;
70 + }, Object.create(null));
71 + }
72 +
73 + return _wrapRegExp.apply(this, arguments);
74 +}
75 +
76 +module.exports = _wrapRegExp;
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "_from": "@babel/runtime@^7.1.2",
3 + "_id": "@babel/runtime@7.9.6",
4 + "_inBundle": false,
5 + "_integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==",
6 + "_location": "/@babel/runtime",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "@babel/runtime@^7.1.2",
12 + "name": "@babel/runtime",
13 + "escapedName": "@babel%2fruntime",
14 + "scope": "@babel",
15 + "rawSpec": "^7.1.2",
16 + "saveSpec": null,
17 + "fetchSpec": "^7.1.2"
18 + },
19 + "_requiredBy": [
20 + "/history",
21 + "/mini-create-react-context",
22 + "/react-router",
23 + "/react-router-dom"
24 + ],
25 + "_resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz",
26 + "_shasum": "a9102eb5cadedf3f31d08a9ecf294af7827ea29f",
27 + "_spec": "@babel/runtime@^7.1.2",
28 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router-dom",
29 + "author": {
30 + "name": "Sebastian McKenzie",
31 + "email": "sebmck@gmail.com"
32 + },
33 + "bugs": {
34 + "url": "https://github.com/babel/babel/issues"
35 + },
36 + "bundleDependencies": false,
37 + "dependencies": {
38 + "regenerator-runtime": "^0.13.4"
39 + },
40 + "deprecated": false,
41 + "description": "babel's modular runtime helpers",
42 + "devDependencies": {
43 + "@babel/helpers": "^7.9.6"
44 + },
45 + "gitHead": "9c2846bcacc75aa931ea9d556950c2113765d43d",
46 + "homepage": "https://babeljs.io/docs/en/next/babel-runtime",
47 + "license": "MIT",
48 + "name": "@babel/runtime",
49 + "publishConfig": {
50 + "access": "public"
51 + },
52 + "repository": {
53 + "type": "git",
54 + "url": "git+https://github.com/babel/babel.git",
55 + "directory": "packages/babel-runtime"
56 + },
57 + "version": "7.9.6"
58 +}
1 +module.exports = require("regenerator-runtime");
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('DOMUtils');
3 +module.exports = require('./index.js').DOMUtils;
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('ExecutionEnvironment');
3 +module.exports = require('./index.js').ExecutionEnvironment;
1 +MIT License
2 +
3 +Copyright (c) React Training 2016-2018
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('LocationUtils');
3 +module.exports = require('./index.js').LocationUtils;
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('PathUtils');
3 +module.exports = require('./index.js').PathUtils;
1 +# history &middot; [![npm package][npm-badge]][npm] [![Travis][build-badge]][build]
2 +
3 +[npm-badge]: https://img.shields.io/npm/v/history.svg?style=flat-square
4 +[npm]: https://www.npmjs.org/package/history
5 +[build-badge]: https://img.shields.io/travis/ReactTraining/history/master.svg?style=flat-square
6 +[build]: https://travis-ci.org/ReactTraining/history
7 +
8 +The history library lets you easily manage session history anywhere JavaScript runs. `history` abstracts away the differences in various environments and provides a minimal API that lets you manage the history stack, navigate, and persist state between sessions.
9 +
10 +## Documentation
11 +
12 +Documentation for the current branch can be found in the [docs](docs) directory.
13 +
14 +## Changes
15 +
16 +To see the changes that were made in a given release, please lookup the tag on [the releases page](https://github.com/ReactTraining/history/releases).
17 +
18 +For changes released in version 4.6.3 and earlier, please see [the `CHANGES.md` file](https://github.com/ReactTraining/history/blob/845d690c5576c7f55ecbe14babe0092e8e5bc2bb/CHANGES.md).
19 +
20 +## Development
21 +
22 +Development of the current stable release, version 4, happens on [the `master` branch](https://github.com/ReactTraining/history/tree/master). Please keep in mind that this branch may include some work that has not yet been published as part of an official release. However, since `master` is always stable, you should feel free to build your own working release straight from master at any time.
23 +
24 +Development of the next major release, version 5, happens on [the `dev` branch](https://github.com/ReactTraining/history/tree/dev).
25 +
26 +If you're interested in helping out, please read [our contributing guidelines](CONTRIBUTING.md).
27 +
28 +## About
29 +
30 +`history` is developed and maintained by [React Training](https://reacttraining.com). If
31 +you're interested in learning more about what React can do for your company, please
32 +[get in touch](mailto:hello@reacttraining.com)!
33 +
34 +## Thanks
35 +
36 +A big thank-you to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to run our build in real browsers.
37 +
38 +Also, thanks to [Dan Shaw](https://www.npmjs.com/~dshaw) for letting us use the `history` npm package name. Thanks, Dan!
1 +'use strict';
2 +
3 +Object.defineProperty(exports, '__esModule', { value: true });
4 +
5 +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6 +
7 +var resolvePathname = _interopDefault(require('resolve-pathname'));
8 +var valueEqual = _interopDefault(require('value-equal'));
9 +var warning = _interopDefault(require('tiny-warning'));
10 +var invariant = _interopDefault(require('tiny-invariant'));
11 +
12 +function _extends() {
13 + _extends = Object.assign || function (target) {
14 + for (var i = 1; i < arguments.length; i++) {
15 + var source = arguments[i];
16 +
17 + for (var key in source) {
18 + if (Object.prototype.hasOwnProperty.call(source, key)) {
19 + target[key] = source[key];
20 + }
21 + }
22 + }
23 +
24 + return target;
25 + };
26 +
27 + return _extends.apply(this, arguments);
28 +}
29 +
30 +function addLeadingSlash(path) {
31 + return path.charAt(0) === '/' ? path : '/' + path;
32 +}
33 +function stripLeadingSlash(path) {
34 + return path.charAt(0) === '/' ? path.substr(1) : path;
35 +}
36 +function hasBasename(path, prefix) {
37 + return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
38 +}
39 +function stripBasename(path, prefix) {
40 + return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
41 +}
42 +function stripTrailingSlash(path) {
43 + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
44 +}
45 +function parsePath(path) {
46 + var pathname = path || '/';
47 + var search = '';
48 + var hash = '';
49 + var hashIndex = pathname.indexOf('#');
50 +
51 + if (hashIndex !== -1) {
52 + hash = pathname.substr(hashIndex);
53 + pathname = pathname.substr(0, hashIndex);
54 + }
55 +
56 + var searchIndex = pathname.indexOf('?');
57 +
58 + if (searchIndex !== -1) {
59 + search = pathname.substr(searchIndex);
60 + pathname = pathname.substr(0, searchIndex);
61 + }
62 +
63 + return {
64 + pathname: pathname,
65 + search: search === '?' ? '' : search,
66 + hash: hash === '#' ? '' : hash
67 + };
68 +}
69 +function createPath(location) {
70 + var pathname = location.pathname,
71 + search = location.search,
72 + hash = location.hash;
73 + var path = pathname || '/';
74 + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
75 + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
76 + return path;
77 +}
78 +
79 +function createLocation(path, state, key, currentLocation) {
80 + var location;
81 +
82 + if (typeof path === 'string') {
83 + // Two-arg form: push(path, state)
84 + location = parsePath(path);
85 + location.state = state;
86 + } else {
87 + // One-arg form: push(location)
88 + location = _extends({}, path);
89 + if (location.pathname === undefined) location.pathname = '';
90 +
91 + if (location.search) {
92 + if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
93 + } else {
94 + location.search = '';
95 + }
96 +
97 + if (location.hash) {
98 + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
99 + } else {
100 + location.hash = '';
101 + }
102 +
103 + if (state !== undefined && location.state === undefined) location.state = state;
104 + }
105 +
106 + try {
107 + location.pathname = decodeURI(location.pathname);
108 + } catch (e) {
109 + if (e instanceof URIError) {
110 + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
111 + } else {
112 + throw e;
113 + }
114 + }
115 +
116 + if (key) location.key = key;
117 +
118 + if (currentLocation) {
119 + // Resolve incomplete/relative pathname relative to current location.
120 + if (!location.pathname) {
121 + location.pathname = currentLocation.pathname;
122 + } else if (location.pathname.charAt(0) !== '/') {
123 + location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
124 + }
125 + } else {
126 + // When there is no prior location and pathname is empty, set it to /
127 + if (!location.pathname) {
128 + location.pathname = '/';
129 + }
130 + }
131 +
132 + return location;
133 +}
134 +function locationsAreEqual(a, b) {
135 + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);
136 +}
137 +
138 +function createTransitionManager() {
139 + var prompt = null;
140 +
141 + function setPrompt(nextPrompt) {
142 + warning(prompt == null, 'A history supports only one prompt at a time');
143 + prompt = nextPrompt;
144 + return function () {
145 + if (prompt === nextPrompt) prompt = null;
146 + };
147 + }
148 +
149 + function confirmTransitionTo(location, action, getUserConfirmation, callback) {
150 + // TODO: If another transition starts while we're still confirming
151 + // the previous one, we may end up in a weird state. Figure out the
152 + // best way to handle this.
153 + if (prompt != null) {
154 + var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
155 +
156 + if (typeof result === 'string') {
157 + if (typeof getUserConfirmation === 'function') {
158 + getUserConfirmation(result, callback);
159 + } else {
160 + warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
161 + callback(true);
162 + }
163 + } else {
164 + // Return false from a transition hook to cancel the transition.
165 + callback(result !== false);
166 + }
167 + } else {
168 + callback(true);
169 + }
170 + }
171 +
172 + var listeners = [];
173 +
174 + function appendListener(fn) {
175 + var isActive = true;
176 +
177 + function listener() {
178 + if (isActive) fn.apply(void 0, arguments);
179 + }
180 +
181 + listeners.push(listener);
182 + return function () {
183 + isActive = false;
184 + listeners = listeners.filter(function (item) {
185 + return item !== listener;
186 + });
187 + };
188 + }
189 +
190 + function notifyListeners() {
191 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
192 + args[_key] = arguments[_key];
193 + }
194 +
195 + listeners.forEach(function (listener) {
196 + return listener.apply(void 0, args);
197 + });
198 + }
199 +
200 + return {
201 + setPrompt: setPrompt,
202 + confirmTransitionTo: confirmTransitionTo,
203 + appendListener: appendListener,
204 + notifyListeners: notifyListeners
205 + };
206 +}
207 +
208 +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
209 +function getConfirmation(message, callback) {
210 + callback(window.confirm(message)); // eslint-disable-line no-alert
211 +}
212 +/**
213 + * Returns true if the HTML5 history API is supported. Taken from Modernizr.
214 + *
215 + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
216 + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
217 + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
218 + */
219 +
220 +function supportsHistory() {
221 + var ua = window.navigator.userAgent;
222 + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
223 + return window.history && 'pushState' in window.history;
224 +}
225 +/**
226 + * Returns true if browser fires popstate on hash change.
227 + * IE10 and IE11 do not.
228 + */
229 +
230 +function supportsPopStateOnHashChange() {
231 + return window.navigator.userAgent.indexOf('Trident') === -1;
232 +}
233 +/**
234 + * Returns false if using go(n) with hash history causes a full page reload.
235 + */
236 +
237 +function supportsGoWithoutReloadUsingHash() {
238 + return window.navigator.userAgent.indexOf('Firefox') === -1;
239 +}
240 +/**
241 + * Returns true if a given popstate event is an extraneous WebKit event.
242 + * Accounts for the fact that Chrome on iOS fires real popstate events
243 + * containing undefined state when pressing the back button.
244 + */
245 +
246 +function isExtraneousPopstateEvent(event) {
247 + return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
248 +}
249 +
250 +var PopStateEvent = 'popstate';
251 +var HashChangeEvent = 'hashchange';
252 +
253 +function getHistoryState() {
254 + try {
255 + return window.history.state || {};
256 + } catch (e) {
257 + // IE 11 sometimes throws when accessing window.history.state
258 + // See https://github.com/ReactTraining/history/pull/289
259 + return {};
260 + }
261 +}
262 +/**
263 + * Creates a history object that uses the HTML5 history API including
264 + * pushState, replaceState, and the popstate event.
265 + */
266 +
267 +
268 +function createBrowserHistory(props) {
269 + if (props === void 0) {
270 + props = {};
271 + }
272 +
273 + !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0;
274 + var globalHistory = window.history;
275 + var canUseHistory = supportsHistory();
276 + var needsHashChangeListener = !supportsPopStateOnHashChange();
277 + var _props = props,
278 + _props$forceRefresh = _props.forceRefresh,
279 + forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
280 + _props$getUserConfirm = _props.getUserConfirmation,
281 + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
282 + _props$keyLength = _props.keyLength,
283 + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
284 + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
285 +
286 + function getDOMLocation(historyState) {
287 + var _ref = historyState || {},
288 + key = _ref.key,
289 + state = _ref.state;
290 +
291 + var _window$location = window.location,
292 + pathname = _window$location.pathname,
293 + search = _window$location.search,
294 + hash = _window$location.hash;
295 + var path = pathname + search + hash;
296 + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
297 + if (basename) path = stripBasename(path, basename);
298 + return createLocation(path, state, key);
299 + }
300 +
301 + function createKey() {
302 + return Math.random().toString(36).substr(2, keyLength);
303 + }
304 +
305 + var transitionManager = createTransitionManager();
306 +
307 + function setState(nextState) {
308 + _extends(history, nextState);
309 +
310 + history.length = globalHistory.length;
311 + transitionManager.notifyListeners(history.location, history.action);
312 + }
313 +
314 + function handlePopState(event) {
315 + // Ignore extraneous popstate events in WebKit.
316 + if (isExtraneousPopstateEvent(event)) return;
317 + handlePop(getDOMLocation(event.state));
318 + }
319 +
320 + function handleHashChange() {
321 + handlePop(getDOMLocation(getHistoryState()));
322 + }
323 +
324 + var forceNextPop = false;
325 +
326 + function handlePop(location) {
327 + if (forceNextPop) {
328 + forceNextPop = false;
329 + setState();
330 + } else {
331 + var action = 'POP';
332 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
333 + if (ok) {
334 + setState({
335 + action: action,
336 + location: location
337 + });
338 + } else {
339 + revertPop(location);
340 + }
341 + });
342 + }
343 + }
344 +
345 + function revertPop(fromLocation) {
346 + var toLocation = history.location; // TODO: We could probably make this more reliable by
347 + // keeping a list of keys we've seen in sessionStorage.
348 + // Instead, we just default to 0 for keys we don't know.
349 +
350 + var toIndex = allKeys.indexOf(toLocation.key);
351 + if (toIndex === -1) toIndex = 0;
352 + var fromIndex = allKeys.indexOf(fromLocation.key);
353 + if (fromIndex === -1) fromIndex = 0;
354 + var delta = toIndex - fromIndex;
355 +
356 + if (delta) {
357 + forceNextPop = true;
358 + go(delta);
359 + }
360 + }
361 +
362 + var initialLocation = getDOMLocation(getHistoryState());
363 + var allKeys = [initialLocation.key]; // Public interface
364 +
365 + function createHref(location) {
366 + return basename + createPath(location);
367 + }
368 +
369 + function push(path, state) {
370 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
371 + var action = 'PUSH';
372 + var location = createLocation(path, state, createKey(), history.location);
373 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
374 + if (!ok) return;
375 + var href = createHref(location);
376 + var key = location.key,
377 + state = location.state;
378 +
379 + if (canUseHistory) {
380 + globalHistory.pushState({
381 + key: key,
382 + state: state
383 + }, null, href);
384 +
385 + if (forceRefresh) {
386 + window.location.href = href;
387 + } else {
388 + var prevIndex = allKeys.indexOf(history.location.key);
389 + var nextKeys = allKeys.slice(0, prevIndex + 1);
390 + nextKeys.push(location.key);
391 + allKeys = nextKeys;
392 + setState({
393 + action: action,
394 + location: location
395 + });
396 + }
397 + } else {
398 + warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
399 + window.location.href = href;
400 + }
401 + });
402 + }
403 +
404 + function replace(path, state) {
405 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
406 + var action = 'REPLACE';
407 + var location = createLocation(path, state, createKey(), history.location);
408 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
409 + if (!ok) return;
410 + var href = createHref(location);
411 + var key = location.key,
412 + state = location.state;
413 +
414 + if (canUseHistory) {
415 + globalHistory.replaceState({
416 + key: key,
417 + state: state
418 + }, null, href);
419 +
420 + if (forceRefresh) {
421 + window.location.replace(href);
422 + } else {
423 + var prevIndex = allKeys.indexOf(history.location.key);
424 + if (prevIndex !== -1) allKeys[prevIndex] = location.key;
425 + setState({
426 + action: action,
427 + location: location
428 + });
429 + }
430 + } else {
431 + warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
432 + window.location.replace(href);
433 + }
434 + });
435 + }
436 +
437 + function go(n) {
438 + globalHistory.go(n);
439 + }
440 +
441 + function goBack() {
442 + go(-1);
443 + }
444 +
445 + function goForward() {
446 + go(1);
447 + }
448 +
449 + var listenerCount = 0;
450 +
451 + function checkDOMListeners(delta) {
452 + listenerCount += delta;
453 +
454 + if (listenerCount === 1 && delta === 1) {
455 + window.addEventListener(PopStateEvent, handlePopState);
456 + if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
457 + } else if (listenerCount === 0) {
458 + window.removeEventListener(PopStateEvent, handlePopState);
459 + if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
460 + }
461 + }
462 +
463 + var isBlocked = false;
464 +
465 + function block(prompt) {
466 + if (prompt === void 0) {
467 + prompt = false;
468 + }
469 +
470 + var unblock = transitionManager.setPrompt(prompt);
471 +
472 + if (!isBlocked) {
473 + checkDOMListeners(1);
474 + isBlocked = true;
475 + }
476 +
477 + return function () {
478 + if (isBlocked) {
479 + isBlocked = false;
480 + checkDOMListeners(-1);
481 + }
482 +
483 + return unblock();
484 + };
485 + }
486 +
487 + function listen(listener) {
488 + var unlisten = transitionManager.appendListener(listener);
489 + checkDOMListeners(1);
490 + return function () {
491 + checkDOMListeners(-1);
492 + unlisten();
493 + };
494 + }
495 +
496 + var history = {
497 + length: globalHistory.length,
498 + action: 'POP',
499 + location: initialLocation,
500 + createHref: createHref,
501 + push: push,
502 + replace: replace,
503 + go: go,
504 + goBack: goBack,
505 + goForward: goForward,
506 + block: block,
507 + listen: listen
508 + };
509 + return history;
510 +}
511 +
512 +var HashChangeEvent$1 = 'hashchange';
513 +var HashPathCoders = {
514 + hashbang: {
515 + encodePath: function encodePath(path) {
516 + return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
517 + },
518 + decodePath: function decodePath(path) {
519 + return path.charAt(0) === '!' ? path.substr(1) : path;
520 + }
521 + },
522 + noslash: {
523 + encodePath: stripLeadingSlash,
524 + decodePath: addLeadingSlash
525 + },
526 + slash: {
527 + encodePath: addLeadingSlash,
528 + decodePath: addLeadingSlash
529 + }
530 +};
531 +
532 +function stripHash(url) {
533 + var hashIndex = url.indexOf('#');
534 + return hashIndex === -1 ? url : url.slice(0, hashIndex);
535 +}
536 +
537 +function getHashPath() {
538 + // We can't use window.location.hash here because it's not
539 + // consistent across browsers - Firefox will pre-decode it!
540 + var href = window.location.href;
541 + var hashIndex = href.indexOf('#');
542 + return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
543 +}
544 +
545 +function pushHashPath(path) {
546 + window.location.hash = path;
547 +}
548 +
549 +function replaceHashPath(path) {
550 + window.location.replace(stripHash(window.location.href) + '#' + path);
551 +}
552 +
553 +function createHashHistory(props) {
554 + if (props === void 0) {
555 + props = {};
556 + }
557 +
558 + !canUseDOM ? invariant(false, 'Hash history needs a DOM') : void 0;
559 + var globalHistory = window.history;
560 + var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
561 + var _props = props,
562 + _props$getUserConfirm = _props.getUserConfirmation,
563 + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
564 + _props$hashType = _props.hashType,
565 + hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
566 + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
567 + var _HashPathCoders$hashT = HashPathCoders[hashType],
568 + encodePath = _HashPathCoders$hashT.encodePath,
569 + decodePath = _HashPathCoders$hashT.decodePath;
570 +
571 + function getDOMLocation() {
572 + var path = decodePath(getHashPath());
573 + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
574 + if (basename) path = stripBasename(path, basename);
575 + return createLocation(path);
576 + }
577 +
578 + var transitionManager = createTransitionManager();
579 +
580 + function setState(nextState) {
581 + _extends(history, nextState);
582 +
583 + history.length = globalHistory.length;
584 + transitionManager.notifyListeners(history.location, history.action);
585 + }
586 +
587 + var forceNextPop = false;
588 + var ignorePath = null;
589 +
590 + function locationsAreEqual$$1(a, b) {
591 + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
592 + }
593 +
594 + function handleHashChange() {
595 + var path = getHashPath();
596 + var encodedPath = encodePath(path);
597 +
598 + if (path !== encodedPath) {
599 + // Ensure we always have a properly-encoded hash.
600 + replaceHashPath(encodedPath);
601 + } else {
602 + var location = getDOMLocation();
603 + var prevLocation = history.location;
604 + if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
605 +
606 + if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
607 +
608 + ignorePath = null;
609 + handlePop(location);
610 + }
611 + }
612 +
613 + function handlePop(location) {
614 + if (forceNextPop) {
615 + forceNextPop = false;
616 + setState();
617 + } else {
618 + var action = 'POP';
619 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
620 + if (ok) {
621 + setState({
622 + action: action,
623 + location: location
624 + });
625 + } else {
626 + revertPop(location);
627 + }
628 + });
629 + }
630 + }
631 +
632 + function revertPop(fromLocation) {
633 + var toLocation = history.location; // TODO: We could probably make this more reliable by
634 + // keeping a list of paths we've seen in sessionStorage.
635 + // Instead, we just default to 0 for paths we don't know.
636 +
637 + var toIndex = allPaths.lastIndexOf(createPath(toLocation));
638 + if (toIndex === -1) toIndex = 0;
639 + var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
640 + if (fromIndex === -1) fromIndex = 0;
641 + var delta = toIndex - fromIndex;
642 +
643 + if (delta) {
644 + forceNextPop = true;
645 + go(delta);
646 + }
647 + } // Ensure the hash is encoded properly before doing anything else.
648 +
649 +
650 + var path = getHashPath();
651 + var encodedPath = encodePath(path);
652 + if (path !== encodedPath) replaceHashPath(encodedPath);
653 + var initialLocation = getDOMLocation();
654 + var allPaths = [createPath(initialLocation)]; // Public interface
655 +
656 + function createHref(location) {
657 + var baseTag = document.querySelector('base');
658 + var href = '';
659 +
660 + if (baseTag && baseTag.getAttribute('href')) {
661 + href = stripHash(window.location.href);
662 + }
663 +
664 + return href + '#' + encodePath(basename + createPath(location));
665 + }
666 +
667 + function push(path, state) {
668 + warning(state === undefined, 'Hash history cannot push state; it is ignored');
669 + var action = 'PUSH';
670 + var location = createLocation(path, undefined, undefined, history.location);
671 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
672 + if (!ok) return;
673 + var path = createPath(location);
674 + var encodedPath = encodePath(basename + path);
675 + var hashChanged = getHashPath() !== encodedPath;
676 +
677 + if (hashChanged) {
678 + // We cannot tell if a hashchange was caused by a PUSH, so we'd
679 + // rather setState here and ignore the hashchange. The caveat here
680 + // is that other hash histories in the page will consider it a POP.
681 + ignorePath = path;
682 + pushHashPath(encodedPath);
683 + var prevIndex = allPaths.lastIndexOf(createPath(history.location));
684 + var nextPaths = allPaths.slice(0, prevIndex + 1);
685 + nextPaths.push(path);
686 + allPaths = nextPaths;
687 + setState({
688 + action: action,
689 + location: location
690 + });
691 + } else {
692 + warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
693 + setState();
694 + }
695 + });
696 + }
697 +
698 + function replace(path, state) {
699 + warning(state === undefined, 'Hash history cannot replace state; it is ignored');
700 + var action = 'REPLACE';
701 + var location = createLocation(path, undefined, undefined, history.location);
702 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
703 + if (!ok) return;
704 + var path = createPath(location);
705 + var encodedPath = encodePath(basename + path);
706 + var hashChanged = getHashPath() !== encodedPath;
707 +
708 + if (hashChanged) {
709 + // We cannot tell if a hashchange was caused by a REPLACE, so we'd
710 + // rather setState here and ignore the hashchange. The caveat here
711 + // is that other hash histories in the page will consider it a POP.
712 + ignorePath = path;
713 + replaceHashPath(encodedPath);
714 + }
715 +
716 + var prevIndex = allPaths.indexOf(createPath(history.location));
717 + if (prevIndex !== -1) allPaths[prevIndex] = path;
718 + setState({
719 + action: action,
720 + location: location
721 + });
722 + });
723 + }
724 +
725 + function go(n) {
726 + warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
727 + globalHistory.go(n);
728 + }
729 +
730 + function goBack() {
731 + go(-1);
732 + }
733 +
734 + function goForward() {
735 + go(1);
736 + }
737 +
738 + var listenerCount = 0;
739 +
740 + function checkDOMListeners(delta) {
741 + listenerCount += delta;
742 +
743 + if (listenerCount === 1 && delta === 1) {
744 + window.addEventListener(HashChangeEvent$1, handleHashChange);
745 + } else if (listenerCount === 0) {
746 + window.removeEventListener(HashChangeEvent$1, handleHashChange);
747 + }
748 + }
749 +
750 + var isBlocked = false;
751 +
752 + function block(prompt) {
753 + if (prompt === void 0) {
754 + prompt = false;
755 + }
756 +
757 + var unblock = transitionManager.setPrompt(prompt);
758 +
759 + if (!isBlocked) {
760 + checkDOMListeners(1);
761 + isBlocked = true;
762 + }
763 +
764 + return function () {
765 + if (isBlocked) {
766 + isBlocked = false;
767 + checkDOMListeners(-1);
768 + }
769 +
770 + return unblock();
771 + };
772 + }
773 +
774 + function listen(listener) {
775 + var unlisten = transitionManager.appendListener(listener);
776 + checkDOMListeners(1);
777 + return function () {
778 + checkDOMListeners(-1);
779 + unlisten();
780 + };
781 + }
782 +
783 + var history = {
784 + length: globalHistory.length,
785 + action: 'POP',
786 + location: initialLocation,
787 + createHref: createHref,
788 + push: push,
789 + replace: replace,
790 + go: go,
791 + goBack: goBack,
792 + goForward: goForward,
793 + block: block,
794 + listen: listen
795 + };
796 + return history;
797 +}
798 +
799 +function clamp(n, lowerBound, upperBound) {
800 + return Math.min(Math.max(n, lowerBound), upperBound);
801 +}
802 +/**
803 + * Creates a history object that stores locations in memory.
804 + */
805 +
806 +
807 +function createMemoryHistory(props) {
808 + if (props === void 0) {
809 + props = {};
810 + }
811 +
812 + var _props = props,
813 + getUserConfirmation = _props.getUserConfirmation,
814 + _props$initialEntries = _props.initialEntries,
815 + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
816 + _props$initialIndex = _props.initialIndex,
817 + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
818 + _props$keyLength = _props.keyLength,
819 + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
820 + var transitionManager = createTransitionManager();
821 +
822 + function setState(nextState) {
823 + _extends(history, nextState);
824 +
825 + history.length = history.entries.length;
826 + transitionManager.notifyListeners(history.location, history.action);
827 + }
828 +
829 + function createKey() {
830 + return Math.random().toString(36).substr(2, keyLength);
831 + }
832 +
833 + var index = clamp(initialIndex, 0, initialEntries.length - 1);
834 + var entries = initialEntries.map(function (entry) {
835 + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
836 + }); // Public interface
837 +
838 + var createHref = createPath;
839 +
840 + function push(path, state) {
841 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
842 + var action = 'PUSH';
843 + var location = createLocation(path, state, createKey(), history.location);
844 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
845 + if (!ok) return;
846 + var prevIndex = history.index;
847 + var nextIndex = prevIndex + 1;
848 + var nextEntries = history.entries.slice(0);
849 +
850 + if (nextEntries.length > nextIndex) {
851 + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
852 + } else {
853 + nextEntries.push(location);
854 + }
855 +
856 + setState({
857 + action: action,
858 + location: location,
859 + index: nextIndex,
860 + entries: nextEntries
861 + });
862 + });
863 + }
864 +
865 + function replace(path, state) {
866 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
867 + var action = 'REPLACE';
868 + var location = createLocation(path, state, createKey(), history.location);
869 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
870 + if (!ok) return;
871 + history.entries[history.index] = location;
872 + setState({
873 + action: action,
874 + location: location
875 + });
876 + });
877 + }
878 +
879 + function go(n) {
880 + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
881 + var action = 'POP';
882 + var location = history.entries[nextIndex];
883 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
884 + if (ok) {
885 + setState({
886 + action: action,
887 + location: location,
888 + index: nextIndex
889 + });
890 + } else {
891 + // Mimic the behavior of DOM histories by
892 + // causing a render after a cancelled POP.
893 + setState();
894 + }
895 + });
896 + }
897 +
898 + function goBack() {
899 + go(-1);
900 + }
901 +
902 + function goForward() {
903 + go(1);
904 + }
905 +
906 + function canGo(n) {
907 + var nextIndex = history.index + n;
908 + return nextIndex >= 0 && nextIndex < history.entries.length;
909 + }
910 +
911 + function block(prompt) {
912 + if (prompt === void 0) {
913 + prompt = false;
914 + }
915 +
916 + return transitionManager.setPrompt(prompt);
917 + }
918 +
919 + function listen(listener) {
920 + return transitionManager.appendListener(listener);
921 + }
922 +
923 + var history = {
924 + length: entries.length,
925 + action: 'POP',
926 + location: entries[index],
927 + index: index,
928 + entries: entries,
929 + createHref: createHref,
930 + push: push,
931 + replace: replace,
932 + go: go,
933 + goBack: goBack,
934 + goForward: goForward,
935 + canGo: canGo,
936 + block: block,
937 + listen: listen
938 + };
939 + return history;
940 +}
941 +
942 +exports.createBrowserHistory = createBrowserHistory;
943 +exports.createHashHistory = createHashHistory;
944 +exports.createMemoryHistory = createMemoryHistory;
945 +exports.createLocation = createLocation;
946 +exports.locationsAreEqual = locationsAreEqual;
947 +exports.parsePath = parsePath;
948 +exports.createPath = createPath;
1 +"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var resolvePathname=_interopDefault(require("resolve-pathname")),valueEqual=_interopDefault(require("value-equal"));require("tiny-warning");var invariant=_interopDefault(require("tiny-invariant"));function _extends(){return(_extends=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t}).apply(this,arguments)}function addLeadingSlash(t){return"/"===t.charAt(0)?t:"/"+t}function stripLeadingSlash(t){return"/"===t.charAt(0)?t.substr(1):t}function hasBasename(t,n){return 0===t.toLowerCase().indexOf(n.toLowerCase())&&-1!=="/?#".indexOf(t.charAt(n.length))}function stripBasename(t,n){return hasBasename(t,n)?t.substr(n.length):t}function stripTrailingSlash(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function parsePath(t){var n=t||"/",e="",a="",r=n.indexOf("#");-1!==r&&(a=n.substr(r),n=n.substr(0,r));var o=n.indexOf("?");return-1!==o&&(e=n.substr(o),n=n.substr(0,o)),{pathname:n,search:"?"===e?"":e,hash:"#"===a?"":a}}function createPath(t){var n=t.pathname,e=t.search,a=t.hash,r=n||"/";return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),a&&"#"!==a&&(r+="#"===a.charAt(0)?a:"#"+a),r}function createLocation(t,n,e,a){var r;"string"==typeof t?(r=parsePath(t)).state=n:(void 0===(r=_extends({},t)).pathname&&(r.pathname=""),r.search?"?"!==r.search.charAt(0)&&(r.search="?"+r.search):r.search="",r.hash?"#"!==r.hash.charAt(0)&&(r.hash="#"+r.hash):r.hash="",void 0!==n&&void 0===r.state&&(r.state=n));try{r.pathname=decodeURI(r.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+r.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return e&&(r.key=e),a?r.pathname?"/"!==r.pathname.charAt(0)&&(r.pathname=resolvePathname(r.pathname,a.pathname)):r.pathname=a.pathname:r.pathname||(r.pathname="/"),r}function locationsAreEqual(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash&&t.key===n.key&&valueEqual(t.state,n.state)}function createTransitionManager(){var o=null;var a=[];return{setPrompt:function(t){return o=t,function(){o===t&&(o=null)}},confirmTransitionTo:function(t,n,e,a){if(null!=o){var r="function"==typeof o?o(t,n):o;"string"==typeof r?"function"==typeof e?e(r,a):a(!0):a(!1!==r)}else a(!0)},appendListener:function(t){var n=!0;function e(){n&&t.apply(void 0,arguments)}return a.push(e),function(){n=!1,a=a.filter(function(t){return t!==e})}},notifyListeners:function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];a.forEach(function(t){return t.apply(void 0,n)})}}}var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement);function getConfirmation(t,n){n(window.confirm(t))}function supportsHistory(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)}function supportsPopStateOnHashChange(){return-1===window.navigator.userAgent.indexOf("Trident")}function supportsGoWithoutReloadUsingHash(){return-1===window.navigator.userAgent.indexOf("Firefox")}function isExtraneousPopstateEvent(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}var PopStateEvent="popstate",HashChangeEvent="hashchange";function getHistoryState(){try{return window.history.state||{}}catch(t){return{}}}function createBrowserHistory(t){void 0===t&&(t={}),canUseDOM||invariant(!1);var s=window.history,c=supportsHistory(),n=!supportsPopStateOnHashChange(),e=t,a=e.forceRefresh,h=void 0!==a&&a,r=e.getUserConfirmation,u=void 0===r?getConfirmation:r,o=e.keyLength,i=void 0===o?6:o,f=t.basename?stripTrailingSlash(addLeadingSlash(t.basename)):"";function l(t){var n=t||{},e=n.key,a=n.state,r=window.location,o=r.pathname+r.search+r.hash;return f&&(o=stripBasename(o,f)),createLocation(o,a,e)}function d(){return Math.random().toString(36).substr(2,i)}var v=createTransitionManager();function p(t){_extends(T,t),T.length=s.length,v.notifyListeners(T.location,T.action)}function g(t){isExtraneousPopstateEvent(t)||w(l(t.state))}function P(){w(l(getHistoryState()))}var m=!1;function w(n){if(m)m=!1,p();else{v.confirmTransitionTo(n,"POP",u,function(t){t?p({action:"POP",location:n}):function(t){var n=T.location,e=H.indexOf(n.key);-1===e&&(e=0);var a=H.indexOf(t.key);-1===a&&(a=0);var r=e-a;r&&(m=!0,L(r))}(n)})}}var y=l(getHistoryState()),H=[y.key];function x(t){return f+createPath(t)}function L(t){s.go(t)}var O=0;function E(t){1===(O+=t)&&1===t?(window.addEventListener(PopStateEvent,g),n&&window.addEventListener(HashChangeEvent,P)):0===O&&(window.removeEventListener(PopStateEvent,g),n&&window.removeEventListener(HashChangeEvent,P))}var S=!1;var T={length:s.length,action:"POP",location:y,createHref:x,push:function(t,n){var i=createLocation(t,n,d(),T.location);v.confirmTransitionTo(i,"PUSH",u,function(t){if(t){var n=x(i),e=i.key,a=i.state;if(c)if(s.pushState({key:e,state:a},null,n),h)window.location.href=n;else{var r=H.indexOf(T.location.key),o=H.slice(0,r+1);o.push(i.key),H=o,p({action:"PUSH",location:i})}else window.location.href=n}})},replace:function(t,n){var o="REPLACE",i=createLocation(t,n,d(),T.location);v.confirmTransitionTo(i,o,u,function(t){if(t){var n=x(i),e=i.key,a=i.state;if(c)if(s.replaceState({key:e,state:a},null,n),h)window.location.replace(n);else{var r=H.indexOf(T.location.key);-1!==r&&(H[r]=i.key),p({action:o,location:i})}else window.location.replace(n)}})},go:L,goBack:function(){L(-1)},goForward:function(){L(1)},block:function(t){void 0===t&&(t=!1);var n=v.setPrompt(t);return S||(E(1),S=!0),function(){return S&&(S=!1,E(-1)),n()}},listen:function(t){var n=v.appendListener(t);return E(1),function(){E(-1),n()}}};return T}var HashChangeEvent$1="hashchange",HashPathCoders={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+stripLeadingSlash(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:stripLeadingSlash,decodePath:addLeadingSlash},slash:{encodePath:addLeadingSlash,decodePath:addLeadingSlash}};function stripHash(t){var n=t.indexOf("#");return-1===n?t:t.slice(0,n)}function getHashPath(){var t=window.location.href,n=t.indexOf("#");return-1===n?"":t.substring(n+1)}function pushHashPath(t){window.location.hash=t}function replaceHashPath(t){window.location.replace(stripHash(window.location.href)+"#"+t)}function createHashHistory(t){void 0===t&&(t={}),canUseDOM||invariant(!1);var n=window.history,e=(supportsGoWithoutReloadUsingHash(),t),a=e.getUserConfirmation,i=void 0===a?getConfirmation:a,r=e.hashType,o=void 0===r?"slash":r,s=t.basename?stripTrailingSlash(addLeadingSlash(t.basename)):"",c=HashPathCoders[o],h=c.encodePath,u=c.decodePath;function f(){var t=u(getHashPath());return s&&(t=stripBasename(t,s)),createLocation(t)}var l=createTransitionManager();function d(t){_extends(E,t),E.length=n.length,l.notifyListeners(E.location,E.action)}var v=!1,p=null;function g(){var t=getHashPath(),n=h(t);if(t!==n)replaceHashPath(n);else{var e=f(),a=E.location;if(!v&&function(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash}(a,e))return;if(p===createPath(e))return;p=null,function(n){if(v)v=!1,d();else{l.confirmTransitionTo(n,"POP",i,function(t){t?d({action:"POP",location:n}):function(t){var n=E.location,e=y.lastIndexOf(createPath(n));-1===e&&(e=0);var a=y.lastIndexOf(createPath(t));-1===a&&(a=0);var r=e-a;r&&(v=!0,H(r))}(n)})}}(e)}}var P=getHashPath(),m=h(P);P!==m&&replaceHashPath(m);var w=f(),y=[createPath(w)];function H(t){n.go(t)}var x=0;function L(t){1===(x+=t)&&1===t?window.addEventListener(HashChangeEvent$1,g):0===x&&window.removeEventListener(HashChangeEvent$1,g)}var O=!1;var E={length:n.length,action:"POP",location:w,createHref:function(t){var n=document.querySelector("base"),e="";return n&&n.getAttribute("href")&&(e=stripHash(window.location.href)),e+"#"+h(s+createPath(t))},push:function(t,n){var o=createLocation(t,void 0,void 0,E.location);l.confirmTransitionTo(o,"PUSH",i,function(t){if(t){var n=createPath(o),e=h(s+n);if(getHashPath()!==e){p=n,pushHashPath(e);var a=y.lastIndexOf(createPath(E.location)),r=y.slice(0,a+1);r.push(n),y=r,d({action:"PUSH",location:o})}else d()}})},replace:function(t,n){var r="REPLACE",o=createLocation(t,void 0,void 0,E.location);l.confirmTransitionTo(o,r,i,function(t){if(t){var n=createPath(o),e=h(s+n);getHashPath()!==e&&(p=n,replaceHashPath(e));var a=y.indexOf(createPath(E.location));-1!==a&&(y[a]=n),d({action:r,location:o})}})},go:H,goBack:function(){H(-1)},goForward:function(){H(1)},block:function(t){void 0===t&&(t=!1);var n=l.setPrompt(t);return O||(L(1),O=!0),function(){return O&&(O=!1,L(-1)),n()}},listen:function(t){var n=l.appendListener(t);return L(1),function(){L(-1),n()}}};return E}function clamp(t,n,e){return Math.min(Math.max(t,n),e)}function createMemoryHistory(t){void 0===t&&(t={});var n=t,r=n.getUserConfirmation,e=n.initialEntries,a=void 0===e?["/"]:e,o=n.initialIndex,i=void 0===o?0:o,s=n.keyLength,c=void 0===s?6:s,h=createTransitionManager();function u(t){_extends(g,t),g.length=g.entries.length,h.notifyListeners(g.location,g.action)}function f(){return Math.random().toString(36).substr(2,c)}var l=clamp(i,0,a.length-1),d=a.map(function(t){return createLocation(t,void 0,"string"==typeof t?f():t.key||f())}),v=createPath;function p(t){var n=clamp(g.index+t,0,g.entries.length-1),e=g.entries[n];h.confirmTransitionTo(e,"POP",r,function(t){t?u({action:"POP",location:e,index:n}):u()})}var g={length:d.length,action:"POP",location:d[l],index:l,entries:d,createHref:v,push:function(t,n){var a=createLocation(t,n,f(),g.location);h.confirmTransitionTo(a,"PUSH",r,function(t){if(t){var n=g.index+1,e=g.entries.slice(0);e.length>n?e.splice(n,e.length-n,a):e.push(a),u({action:"PUSH",location:a,index:n,entries:e})}})},replace:function(t,n){var e="REPLACE",a=createLocation(t,n,f(),g.location);h.confirmTransitionTo(a,e,r,function(t){t&&(g.entries[g.index]=a,u({action:e,location:a}))})},go:p,goBack:function(){p(-1)},goForward:function(){p(1)},canGo:function(t){var n=g.index+t;return 0<=n&&n<g.entries.length},block:function(t){return void 0===t&&(t=!1),h.setPrompt(t)},listen:function(t){return h.appendListener(t)}};return g}exports.createBrowserHistory=createBrowserHistory,exports.createHashHistory=createHashHistory,exports.createMemoryHistory=createMemoryHistory,exports.createLocation=createLocation,exports.locationsAreEqual=locationsAreEqual,exports.parsePath=parsePath,exports.createPath=createPath;
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('createBrowserHistory');
3 +module.exports = require('./index.js').createBrowserHistory;
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('createHashHistory');
3 +module.exports = require('./index.js').createHashHistory;
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('createMemoryHistory');
3 +module.exports = require('./index.js').createMemoryHistory;
1 +'use strict';
2 +require('./warnAboutDeprecatedCJSRequire.js')('createTransitionManager');
3 +module.exports = require('./index.js').createTransitionManager;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('DOMUtils');
5 +
6 +import { DOMUtils } from '../esm/history.js';
7 +export default DOMUtils;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('ExecutionEnvironment');
5 +
6 +import { ExecutionEnvironment } from '../esm/history.js';
7 +export default ExecutionEnvironment;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('LocationUtils');
5 +
6 +import { LocationUtils } from '../esm/history.js';
7 +export default LocationUtils;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('PathUtils');
5 +
6 +import { PathUtils } from '../esm/history.js';
7 +export default PathUtils;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('createBrowserHistory');
5 +
6 +import { createBrowserHistory } from '../esm/history.js';
7 +export default createBrowserHistory;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('createHashHistory');
5 +
6 +import { createHashHistory } from '../esm/history.js';
7 +export default createHashHistory;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('createMemoryHistory');
5 +
6 +import { createMemoryHistory } from '../esm/history.js';
7 +export default createMemoryHistory;
1 +'use strict';
2 +
3 +import warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';
4 +warnAboutDeprecatedESMImport('createTransitionManager');
5 +
6 +import { createTransitionManager } from '../esm/history.js';
7 +export default createTransitionManager;
1 +'use strict';
2 +
3 +var printWarning = function() {};
4 +
5 +if (process.env.NODE_ENV !== 'production') {
6 + printWarning = function(format, subs) {
7 + var index = 0;
8 + var message =
9 + 'Warning: ' +
10 + (subs.length > 0
11 + ? format.replace(/%s/g, function() {
12 + return subs[index++];
13 + })
14 + : format);
15 +
16 + if (typeof console !== 'undefined') {
17 + console.error(message);
18 + }
19 +
20 + try {
21 + // --- Welcome to debugging history ---
22 + // This error was thrown as a convenience so that you can use the
23 + // stack trace to find the callsite that triggered this warning.
24 + throw new Error(message);
25 + } catch (e) {}
26 + };
27 +}
28 +
29 +export default function(member) {
30 + printWarning(
31 + 'Please use `import { %s } from "history"` instead of `import %s from "history/es/%s"`. ' +
32 + 'Support for the latter will be removed in the next major release.',
33 + [member, member]
34 + );
35 +}
1 +import _extends from '@babel/runtime/helpers/esm/extends';
2 +import resolvePathname from 'resolve-pathname';
3 +import valueEqual from 'value-equal';
4 +import warning from 'tiny-warning';
5 +import invariant from 'tiny-invariant';
6 +
7 +function addLeadingSlash(path) {
8 + return path.charAt(0) === '/' ? path : '/' + path;
9 +}
10 +function stripLeadingSlash(path) {
11 + return path.charAt(0) === '/' ? path.substr(1) : path;
12 +}
13 +function hasBasename(path, prefix) {
14 + return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
15 +}
16 +function stripBasename(path, prefix) {
17 + return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
18 +}
19 +function stripTrailingSlash(path) {
20 + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
21 +}
22 +function parsePath(path) {
23 + var pathname = path || '/';
24 + var search = '';
25 + var hash = '';
26 + var hashIndex = pathname.indexOf('#');
27 +
28 + if (hashIndex !== -1) {
29 + hash = pathname.substr(hashIndex);
30 + pathname = pathname.substr(0, hashIndex);
31 + }
32 +
33 + var searchIndex = pathname.indexOf('?');
34 +
35 + if (searchIndex !== -1) {
36 + search = pathname.substr(searchIndex);
37 + pathname = pathname.substr(0, searchIndex);
38 + }
39 +
40 + return {
41 + pathname: pathname,
42 + search: search === '?' ? '' : search,
43 + hash: hash === '#' ? '' : hash
44 + };
45 +}
46 +function createPath(location) {
47 + var pathname = location.pathname,
48 + search = location.search,
49 + hash = location.hash;
50 + var path = pathname || '/';
51 + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
52 + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
53 + return path;
54 +}
55 +
56 +function createLocation(path, state, key, currentLocation) {
57 + var location;
58 +
59 + if (typeof path === 'string') {
60 + // Two-arg form: push(path, state)
61 + location = parsePath(path);
62 + location.state = state;
63 + } else {
64 + // One-arg form: push(location)
65 + location = _extends({}, path);
66 + if (location.pathname === undefined) location.pathname = '';
67 +
68 + if (location.search) {
69 + if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
70 + } else {
71 + location.search = '';
72 + }
73 +
74 + if (location.hash) {
75 + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
76 + } else {
77 + location.hash = '';
78 + }
79 +
80 + if (state !== undefined && location.state === undefined) location.state = state;
81 + }
82 +
83 + try {
84 + location.pathname = decodeURI(location.pathname);
85 + } catch (e) {
86 + if (e instanceof URIError) {
87 + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
88 + } else {
89 + throw e;
90 + }
91 + }
92 +
93 + if (key) location.key = key;
94 +
95 + if (currentLocation) {
96 + // Resolve incomplete/relative pathname relative to current location.
97 + if (!location.pathname) {
98 + location.pathname = currentLocation.pathname;
99 + } else if (location.pathname.charAt(0) !== '/') {
100 + location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
101 + }
102 + } else {
103 + // When there is no prior location and pathname is empty, set it to /
104 + if (!location.pathname) {
105 + location.pathname = '/';
106 + }
107 + }
108 +
109 + return location;
110 +}
111 +function locationsAreEqual(a, b) {
112 + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);
113 +}
114 +
115 +function createTransitionManager() {
116 + var prompt = null;
117 +
118 + function setPrompt(nextPrompt) {
119 + process.env.NODE_ENV !== "production" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;
120 + prompt = nextPrompt;
121 + return function () {
122 + if (prompt === nextPrompt) prompt = null;
123 + };
124 + }
125 +
126 + function confirmTransitionTo(location, action, getUserConfirmation, callback) {
127 + // TODO: If another transition starts while we're still confirming
128 + // the previous one, we may end up in a weird state. Figure out the
129 + // best way to handle this.
130 + if (prompt != null) {
131 + var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
132 +
133 + if (typeof result === 'string') {
134 + if (typeof getUserConfirmation === 'function') {
135 + getUserConfirmation(result, callback);
136 + } else {
137 + process.env.NODE_ENV !== "production" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
138 + callback(true);
139 + }
140 + } else {
141 + // Return false from a transition hook to cancel the transition.
142 + callback(result !== false);
143 + }
144 + } else {
145 + callback(true);
146 + }
147 + }
148 +
149 + var listeners = [];
150 +
151 + function appendListener(fn) {
152 + var isActive = true;
153 +
154 + function listener() {
155 + if (isActive) fn.apply(void 0, arguments);
156 + }
157 +
158 + listeners.push(listener);
159 + return function () {
160 + isActive = false;
161 + listeners = listeners.filter(function (item) {
162 + return item !== listener;
163 + });
164 + };
165 + }
166 +
167 + function notifyListeners() {
168 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
169 + args[_key] = arguments[_key];
170 + }
171 +
172 + listeners.forEach(function (listener) {
173 + return listener.apply(void 0, args);
174 + });
175 + }
176 +
177 + return {
178 + setPrompt: setPrompt,
179 + confirmTransitionTo: confirmTransitionTo,
180 + appendListener: appendListener,
181 + notifyListeners: notifyListeners
182 + };
183 +}
184 +
185 +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
186 +function getConfirmation(message, callback) {
187 + callback(window.confirm(message)); // eslint-disable-line no-alert
188 +}
189 +/**
190 + * Returns true if the HTML5 history API is supported. Taken from Modernizr.
191 + *
192 + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
193 + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
194 + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
195 + */
196 +
197 +function supportsHistory() {
198 + var ua = window.navigator.userAgent;
199 + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
200 + return window.history && 'pushState' in window.history;
201 +}
202 +/**
203 + * Returns true if browser fires popstate on hash change.
204 + * IE10 and IE11 do not.
205 + */
206 +
207 +function supportsPopStateOnHashChange() {
208 + return window.navigator.userAgent.indexOf('Trident') === -1;
209 +}
210 +/**
211 + * Returns false if using go(n) with hash history causes a full page reload.
212 + */
213 +
214 +function supportsGoWithoutReloadUsingHash() {
215 + return window.navigator.userAgent.indexOf('Firefox') === -1;
216 +}
217 +/**
218 + * Returns true if a given popstate event is an extraneous WebKit event.
219 + * Accounts for the fact that Chrome on iOS fires real popstate events
220 + * containing undefined state when pressing the back button.
221 + */
222 +
223 +function isExtraneousPopstateEvent(event) {
224 + return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
225 +}
226 +
227 +var PopStateEvent = 'popstate';
228 +var HashChangeEvent = 'hashchange';
229 +
230 +function getHistoryState() {
231 + try {
232 + return window.history.state || {};
233 + } catch (e) {
234 + // IE 11 sometimes throws when accessing window.history.state
235 + // See https://github.com/ReactTraining/history/pull/289
236 + return {};
237 + }
238 +}
239 +/**
240 + * Creates a history object that uses the HTML5 history API including
241 + * pushState, replaceState, and the popstate event.
242 + */
243 +
244 +
245 +function createBrowserHistory(props) {
246 + if (props === void 0) {
247 + props = {};
248 + }
249 +
250 + !canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;
251 + var globalHistory = window.history;
252 + var canUseHistory = supportsHistory();
253 + var needsHashChangeListener = !supportsPopStateOnHashChange();
254 + var _props = props,
255 + _props$forceRefresh = _props.forceRefresh,
256 + forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
257 + _props$getUserConfirm = _props.getUserConfirmation,
258 + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
259 + _props$keyLength = _props.keyLength,
260 + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
261 + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
262 +
263 + function getDOMLocation(historyState) {
264 + var _ref = historyState || {},
265 + key = _ref.key,
266 + state = _ref.state;
267 +
268 + var _window$location = window.location,
269 + pathname = _window$location.pathname,
270 + search = _window$location.search,
271 + hash = _window$location.hash;
272 + var path = pathname + search + hash;
273 + process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
274 + if (basename) path = stripBasename(path, basename);
275 + return createLocation(path, state, key);
276 + }
277 +
278 + function createKey() {
279 + return Math.random().toString(36).substr(2, keyLength);
280 + }
281 +
282 + var transitionManager = createTransitionManager();
283 +
284 + function setState(nextState) {
285 + _extends(history, nextState);
286 +
287 + history.length = globalHistory.length;
288 + transitionManager.notifyListeners(history.location, history.action);
289 + }
290 +
291 + function handlePopState(event) {
292 + // Ignore extraneous popstate events in WebKit.
293 + if (isExtraneousPopstateEvent(event)) return;
294 + handlePop(getDOMLocation(event.state));
295 + }
296 +
297 + function handleHashChange() {
298 + handlePop(getDOMLocation(getHistoryState()));
299 + }
300 +
301 + var forceNextPop = false;
302 +
303 + function handlePop(location) {
304 + if (forceNextPop) {
305 + forceNextPop = false;
306 + setState();
307 + } else {
308 + var action = 'POP';
309 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
310 + if (ok) {
311 + setState({
312 + action: action,
313 + location: location
314 + });
315 + } else {
316 + revertPop(location);
317 + }
318 + });
319 + }
320 + }
321 +
322 + function revertPop(fromLocation) {
323 + var toLocation = history.location; // TODO: We could probably make this more reliable by
324 + // keeping a list of keys we've seen in sessionStorage.
325 + // Instead, we just default to 0 for keys we don't know.
326 +
327 + var toIndex = allKeys.indexOf(toLocation.key);
328 + if (toIndex === -1) toIndex = 0;
329 + var fromIndex = allKeys.indexOf(fromLocation.key);
330 + if (fromIndex === -1) fromIndex = 0;
331 + var delta = toIndex - fromIndex;
332 +
333 + if (delta) {
334 + forceNextPop = true;
335 + go(delta);
336 + }
337 + }
338 +
339 + var initialLocation = getDOMLocation(getHistoryState());
340 + var allKeys = [initialLocation.key]; // Public interface
341 +
342 + function createHref(location) {
343 + return basename + createPath(location);
344 + }
345 +
346 + function push(path, state) {
347 + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
348 + var action = 'PUSH';
349 + var location = createLocation(path, state, createKey(), history.location);
350 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
351 + if (!ok) return;
352 + var href = createHref(location);
353 + var key = location.key,
354 + state = location.state;
355 +
356 + if (canUseHistory) {
357 + globalHistory.pushState({
358 + key: key,
359 + state: state
360 + }, null, href);
361 +
362 + if (forceRefresh) {
363 + window.location.href = href;
364 + } else {
365 + var prevIndex = allKeys.indexOf(history.location.key);
366 + var nextKeys = allKeys.slice(0, prevIndex + 1);
367 + nextKeys.push(location.key);
368 + allKeys = nextKeys;
369 + setState({
370 + action: action,
371 + location: location
372 + });
373 + }
374 + } else {
375 + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
376 + window.location.href = href;
377 + }
378 + });
379 + }
380 +
381 + function replace(path, state) {
382 + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
383 + var action = 'REPLACE';
384 + var location = createLocation(path, state, createKey(), history.location);
385 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
386 + if (!ok) return;
387 + var href = createHref(location);
388 + var key = location.key,
389 + state = location.state;
390 +
391 + if (canUseHistory) {
392 + globalHistory.replaceState({
393 + key: key,
394 + state: state
395 + }, null, href);
396 +
397 + if (forceRefresh) {
398 + window.location.replace(href);
399 + } else {
400 + var prevIndex = allKeys.indexOf(history.location.key);
401 + if (prevIndex !== -1) allKeys[prevIndex] = location.key;
402 + setState({
403 + action: action,
404 + location: location
405 + });
406 + }
407 + } else {
408 + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
409 + window.location.replace(href);
410 + }
411 + });
412 + }
413 +
414 + function go(n) {
415 + globalHistory.go(n);
416 + }
417 +
418 + function goBack() {
419 + go(-1);
420 + }
421 +
422 + function goForward() {
423 + go(1);
424 + }
425 +
426 + var listenerCount = 0;
427 +
428 + function checkDOMListeners(delta) {
429 + listenerCount += delta;
430 +
431 + if (listenerCount === 1 && delta === 1) {
432 + window.addEventListener(PopStateEvent, handlePopState);
433 + if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
434 + } else if (listenerCount === 0) {
435 + window.removeEventListener(PopStateEvent, handlePopState);
436 + if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
437 + }
438 + }
439 +
440 + var isBlocked = false;
441 +
442 + function block(prompt) {
443 + if (prompt === void 0) {
444 + prompt = false;
445 + }
446 +
447 + var unblock = transitionManager.setPrompt(prompt);
448 +
449 + if (!isBlocked) {
450 + checkDOMListeners(1);
451 + isBlocked = true;
452 + }
453 +
454 + return function () {
455 + if (isBlocked) {
456 + isBlocked = false;
457 + checkDOMListeners(-1);
458 + }
459 +
460 + return unblock();
461 + };
462 + }
463 +
464 + function listen(listener) {
465 + var unlisten = transitionManager.appendListener(listener);
466 + checkDOMListeners(1);
467 + return function () {
468 + checkDOMListeners(-1);
469 + unlisten();
470 + };
471 + }
472 +
473 + var history = {
474 + length: globalHistory.length,
475 + action: 'POP',
476 + location: initialLocation,
477 + createHref: createHref,
478 + push: push,
479 + replace: replace,
480 + go: go,
481 + goBack: goBack,
482 + goForward: goForward,
483 + block: block,
484 + listen: listen
485 + };
486 + return history;
487 +}
488 +
489 +var HashChangeEvent$1 = 'hashchange';
490 +var HashPathCoders = {
491 + hashbang: {
492 + encodePath: function encodePath(path) {
493 + return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
494 + },
495 + decodePath: function decodePath(path) {
496 + return path.charAt(0) === '!' ? path.substr(1) : path;
497 + }
498 + },
499 + noslash: {
500 + encodePath: stripLeadingSlash,
501 + decodePath: addLeadingSlash
502 + },
503 + slash: {
504 + encodePath: addLeadingSlash,
505 + decodePath: addLeadingSlash
506 + }
507 +};
508 +
509 +function stripHash(url) {
510 + var hashIndex = url.indexOf('#');
511 + return hashIndex === -1 ? url : url.slice(0, hashIndex);
512 +}
513 +
514 +function getHashPath() {
515 + // We can't use window.location.hash here because it's not
516 + // consistent across browsers - Firefox will pre-decode it!
517 + var href = window.location.href;
518 + var hashIndex = href.indexOf('#');
519 + return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
520 +}
521 +
522 +function pushHashPath(path) {
523 + window.location.hash = path;
524 +}
525 +
526 +function replaceHashPath(path) {
527 + window.location.replace(stripHash(window.location.href) + '#' + path);
528 +}
529 +
530 +function createHashHistory(props) {
531 + if (props === void 0) {
532 + props = {};
533 + }
534 +
535 + !canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0;
536 + var globalHistory = window.history;
537 + var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
538 + var _props = props,
539 + _props$getUserConfirm = _props.getUserConfirmation,
540 + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
541 + _props$hashType = _props.hashType,
542 + hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
543 + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
544 + var _HashPathCoders$hashT = HashPathCoders[hashType],
545 + encodePath = _HashPathCoders$hashT.encodePath,
546 + decodePath = _HashPathCoders$hashT.decodePath;
547 +
548 + function getDOMLocation() {
549 + var path = decodePath(getHashPath());
550 + process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
551 + if (basename) path = stripBasename(path, basename);
552 + return createLocation(path);
553 + }
554 +
555 + var transitionManager = createTransitionManager();
556 +
557 + function setState(nextState) {
558 + _extends(history, nextState);
559 +
560 + history.length = globalHistory.length;
561 + transitionManager.notifyListeners(history.location, history.action);
562 + }
563 +
564 + var forceNextPop = false;
565 + var ignorePath = null;
566 +
567 + function locationsAreEqual$$1(a, b) {
568 + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
569 + }
570 +
571 + function handleHashChange() {
572 + var path = getHashPath();
573 + var encodedPath = encodePath(path);
574 +
575 + if (path !== encodedPath) {
576 + // Ensure we always have a properly-encoded hash.
577 + replaceHashPath(encodedPath);
578 + } else {
579 + var location = getDOMLocation();
580 + var prevLocation = history.location;
581 + if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
582 +
583 + if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
584 +
585 + ignorePath = null;
586 + handlePop(location);
587 + }
588 + }
589 +
590 + function handlePop(location) {
591 + if (forceNextPop) {
592 + forceNextPop = false;
593 + setState();
594 + } else {
595 + var action = 'POP';
596 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
597 + if (ok) {
598 + setState({
599 + action: action,
600 + location: location
601 + });
602 + } else {
603 + revertPop(location);
604 + }
605 + });
606 + }
607 + }
608 +
609 + function revertPop(fromLocation) {
610 + var toLocation = history.location; // TODO: We could probably make this more reliable by
611 + // keeping a list of paths we've seen in sessionStorage.
612 + // Instead, we just default to 0 for paths we don't know.
613 +
614 + var toIndex = allPaths.lastIndexOf(createPath(toLocation));
615 + if (toIndex === -1) toIndex = 0;
616 + var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
617 + if (fromIndex === -1) fromIndex = 0;
618 + var delta = toIndex - fromIndex;
619 +
620 + if (delta) {
621 + forceNextPop = true;
622 + go(delta);
623 + }
624 + } // Ensure the hash is encoded properly before doing anything else.
625 +
626 +
627 + var path = getHashPath();
628 + var encodedPath = encodePath(path);
629 + if (path !== encodedPath) replaceHashPath(encodedPath);
630 + var initialLocation = getDOMLocation();
631 + var allPaths = [createPath(initialLocation)]; // Public interface
632 +
633 + function createHref(location) {
634 + var baseTag = document.querySelector('base');
635 + var href = '';
636 +
637 + if (baseTag && baseTag.getAttribute('href')) {
638 + href = stripHash(window.location.href);
639 + }
640 +
641 + return href + '#' + encodePath(basename + createPath(location));
642 + }
643 +
644 + function push(path, state) {
645 + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;
646 + var action = 'PUSH';
647 + var location = createLocation(path, undefined, undefined, history.location);
648 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
649 + if (!ok) return;
650 + var path = createPath(location);
651 + var encodedPath = encodePath(basename + path);
652 + var hashChanged = getHashPath() !== encodedPath;
653 +
654 + if (hashChanged) {
655 + // We cannot tell if a hashchange was caused by a PUSH, so we'd
656 + // rather setState here and ignore the hashchange. The caveat here
657 + // is that other hash histories in the page will consider it a POP.
658 + ignorePath = path;
659 + pushHashPath(encodedPath);
660 + var prevIndex = allPaths.lastIndexOf(createPath(history.location));
661 + var nextPaths = allPaths.slice(0, prevIndex + 1);
662 + nextPaths.push(path);
663 + allPaths = nextPaths;
664 + setState({
665 + action: action,
666 + location: location
667 + });
668 + } else {
669 + process.env.NODE_ENV !== "production" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;
670 + setState();
671 + }
672 + });
673 + }
674 +
675 + function replace(path, state) {
676 + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;
677 + var action = 'REPLACE';
678 + var location = createLocation(path, undefined, undefined, history.location);
679 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
680 + if (!ok) return;
681 + var path = createPath(location);
682 + var encodedPath = encodePath(basename + path);
683 + var hashChanged = getHashPath() !== encodedPath;
684 +
685 + if (hashChanged) {
686 + // We cannot tell if a hashchange was caused by a REPLACE, so we'd
687 + // rather setState here and ignore the hashchange. The caveat here
688 + // is that other hash histories in the page will consider it a POP.
689 + ignorePath = path;
690 + replaceHashPath(encodedPath);
691 + }
692 +
693 + var prevIndex = allPaths.indexOf(createPath(history.location));
694 + if (prevIndex !== -1) allPaths[prevIndex] = path;
695 + setState({
696 + action: action,
697 + location: location
698 + });
699 + });
700 + }
701 +
702 + function go(n) {
703 + process.env.NODE_ENV !== "production" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;
704 + globalHistory.go(n);
705 + }
706 +
707 + function goBack() {
708 + go(-1);
709 + }
710 +
711 + function goForward() {
712 + go(1);
713 + }
714 +
715 + var listenerCount = 0;
716 +
717 + function checkDOMListeners(delta) {
718 + listenerCount += delta;
719 +
720 + if (listenerCount === 1 && delta === 1) {
721 + window.addEventListener(HashChangeEvent$1, handleHashChange);
722 + } else if (listenerCount === 0) {
723 + window.removeEventListener(HashChangeEvent$1, handleHashChange);
724 + }
725 + }
726 +
727 + var isBlocked = false;
728 +
729 + function block(prompt) {
730 + if (prompt === void 0) {
731 + prompt = false;
732 + }
733 +
734 + var unblock = transitionManager.setPrompt(prompt);
735 +
736 + if (!isBlocked) {
737 + checkDOMListeners(1);
738 + isBlocked = true;
739 + }
740 +
741 + return function () {
742 + if (isBlocked) {
743 + isBlocked = false;
744 + checkDOMListeners(-1);
745 + }
746 +
747 + return unblock();
748 + };
749 + }
750 +
751 + function listen(listener) {
752 + var unlisten = transitionManager.appendListener(listener);
753 + checkDOMListeners(1);
754 + return function () {
755 + checkDOMListeners(-1);
756 + unlisten();
757 + };
758 + }
759 +
760 + var history = {
761 + length: globalHistory.length,
762 + action: 'POP',
763 + location: initialLocation,
764 + createHref: createHref,
765 + push: push,
766 + replace: replace,
767 + go: go,
768 + goBack: goBack,
769 + goForward: goForward,
770 + block: block,
771 + listen: listen
772 + };
773 + return history;
774 +}
775 +
776 +function clamp(n, lowerBound, upperBound) {
777 + return Math.min(Math.max(n, lowerBound), upperBound);
778 +}
779 +/**
780 + * Creates a history object that stores locations in memory.
781 + */
782 +
783 +
784 +function createMemoryHistory(props) {
785 + if (props === void 0) {
786 + props = {};
787 + }
788 +
789 + var _props = props,
790 + getUserConfirmation = _props.getUserConfirmation,
791 + _props$initialEntries = _props.initialEntries,
792 + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
793 + _props$initialIndex = _props.initialIndex,
794 + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
795 + _props$keyLength = _props.keyLength,
796 + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
797 + var transitionManager = createTransitionManager();
798 +
799 + function setState(nextState) {
800 + _extends(history, nextState);
801 +
802 + history.length = history.entries.length;
803 + transitionManager.notifyListeners(history.location, history.action);
804 + }
805 +
806 + function createKey() {
807 + return Math.random().toString(36).substr(2, keyLength);
808 + }
809 +
810 + var index = clamp(initialIndex, 0, initialEntries.length - 1);
811 + var entries = initialEntries.map(function (entry) {
812 + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
813 + }); // Public interface
814 +
815 + var createHref = createPath;
816 +
817 + function push(path, state) {
818 + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
819 + var action = 'PUSH';
820 + var location = createLocation(path, state, createKey(), history.location);
821 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
822 + if (!ok) return;
823 + var prevIndex = history.index;
824 + var nextIndex = prevIndex + 1;
825 + var nextEntries = history.entries.slice(0);
826 +
827 + if (nextEntries.length > nextIndex) {
828 + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
829 + } else {
830 + nextEntries.push(location);
831 + }
832 +
833 + setState({
834 + action: action,
835 + location: location,
836 + index: nextIndex,
837 + entries: nextEntries
838 + });
839 + });
840 + }
841 +
842 + function replace(path, state) {
843 + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
844 + var action = 'REPLACE';
845 + var location = createLocation(path, state, createKey(), history.location);
846 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
847 + if (!ok) return;
848 + history.entries[history.index] = location;
849 + setState({
850 + action: action,
851 + location: location
852 + });
853 + });
854 + }
855 +
856 + function go(n) {
857 + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
858 + var action = 'POP';
859 + var location = history.entries[nextIndex];
860 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
861 + if (ok) {
862 + setState({
863 + action: action,
864 + location: location,
865 + index: nextIndex
866 + });
867 + } else {
868 + // Mimic the behavior of DOM histories by
869 + // causing a render after a cancelled POP.
870 + setState();
871 + }
872 + });
873 + }
874 +
875 + function goBack() {
876 + go(-1);
877 + }
878 +
879 + function goForward() {
880 + go(1);
881 + }
882 +
883 + function canGo(n) {
884 + var nextIndex = history.index + n;
885 + return nextIndex >= 0 && nextIndex < history.entries.length;
886 + }
887 +
888 + function block(prompt) {
889 + if (prompt === void 0) {
890 + prompt = false;
891 + }
892 +
893 + return transitionManager.setPrompt(prompt);
894 + }
895 +
896 + function listen(listener) {
897 + return transitionManager.appendListener(listener);
898 + }
899 +
900 + var history = {
901 + length: entries.length,
902 + action: 'POP',
903 + location: entries[index],
904 + index: index,
905 + entries: entries,
906 + createHref: createHref,
907 + push: push,
908 + replace: replace,
909 + go: go,
910 + goBack: goBack,
911 + goForward: goForward,
912 + canGo: canGo,
913 + block: block,
914 + listen: listen
915 + };
916 + return history;
917 +}
918 +
919 +export { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath };
1 +'use strict';
2 +
3 +if (process.env.NODE_ENV === 'production') {
4 + module.exports = require('./cjs/history.min.js');
5 +} else {
6 + module.exports = require('./cjs/history.js');
7 +}
1 +{
2 + "_from": "history@^4.9.0",
3 + "_id": "history@4.10.1",
4 + "_inBundle": false,
5 + "_integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
6 + "_location": "/history",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "history@^4.9.0",
12 + "name": "history",
13 + "escapedName": "history",
14 + "rawSpec": "^4.9.0",
15 + "saveSpec": null,
16 + "fetchSpec": "^4.9.0"
17 + },
18 + "_requiredBy": [
19 + "/react-router",
20 + "/react-router-dom"
21 + ],
22 + "_resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
23 + "_shasum": "33371a65e3a83b267434e2b3f3b1b4c58aad4cf3",
24 + "_spec": "history@^4.9.0",
25 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router-dom",
26 + "author": {
27 + "name": "Michael Jackson"
28 + },
29 + "browserify": {
30 + "transform": [
31 + "loose-envify"
32 + ]
33 + },
34 + "bugs": {
35 + "url": "https://github.com/ReactTraining/history/issues"
36 + },
37 + "bundleDependencies": false,
38 + "dependencies": {
39 + "@babel/runtime": "^7.1.2",
40 + "loose-envify": "^1.2.0",
41 + "resolve-pathname": "^3.0.0",
42 + "tiny-invariant": "^1.0.2",
43 + "tiny-warning": "^1.0.0",
44 + "value-equal": "^1.0.1"
45 + },
46 + "deprecated": false,
47 + "description": "Manage session history with JavaScript",
48 + "devDependencies": {
49 + "@babel/core": "^7.1.2",
50 + "@babel/plugin-transform-object-assign": "^7.0.0",
51 + "@babel/plugin-transform-runtime": "^7.1.0",
52 + "@babel/preset-env": "^7.1.0",
53 + "babel-core": "^7.0.0-bridge.0",
54 + "babel-eslint": "^7.0.0",
55 + "babel-loader": "^8.0.4",
56 + "babel-plugin-dev-expression": "^0.2.1",
57 + "eslint": "^3.3.0",
58 + "eslint-plugin-import": "^2.0.0",
59 + "expect": "^21.0.0",
60 + "jest-mock": "^21.0.0",
61 + "karma": "^3.1.3",
62 + "karma-browserstack-launcher": "^1.3.0",
63 + "karma-chrome-launcher": "^2.2.0",
64 + "karma-firefox-launcher": "^1.1.0",
65 + "karma-mocha": "^1.3.0",
66 + "karma-mocha-reporter": "^2.2.5",
67 + "karma-sourcemap-loader": "^0.3.7",
68 + "karma-webpack": "^3.0.5",
69 + "mocha": "^5.2.0",
70 + "rollup": "^0.66.6",
71 + "rollup-plugin-babel": "^4.0.3",
72 + "rollup-plugin-commonjs": "^9.2.0",
73 + "rollup-plugin-node-resolve": "^3.4.0",
74 + "rollup-plugin-replace": "^2.1.0",
75 + "rollup-plugin-size-snapshot": "^0.7.0",
76 + "rollup-plugin-uglify": "^6.0.0",
77 + "webpack": "^3.12.0"
78 + },
79 + "files": [
80 + "DOMUtils.js",
81 + "ExecutionEnvironment.js",
82 + "LocationUtils.js",
83 + "PathUtils.js",
84 + "cjs",
85 + "createBrowserHistory.js",
86 + "createHashHistory.js",
87 + "createMemoryHistory.js",
88 + "createTransitionManager.js",
89 + "es",
90 + "esm",
91 + "umd",
92 + "warnAboutDeprecatedCJSRequire.js"
93 + ],
94 + "homepage": "https://github.com/ReactTraining/history#readme",
95 + "keywords": [
96 + "history",
97 + "location"
98 + ],
99 + "license": "MIT",
100 + "main": "index.js",
101 + "module": "esm/history.js",
102 + "name": "history",
103 + "repository": {
104 + "type": "git",
105 + "url": "git+https://github.com/ReactTraining/history.git"
106 + },
107 + "scripts": {
108 + "build": "rollup -c",
109 + "clean": "git clean -fdX .",
110 + "lint": "eslint modules",
111 + "prepublishOnly": "yarn build",
112 + "test": "karma start --single-run"
113 + },
114 + "sideEffects": false,
115 + "unpkg": "umd/history.js",
116 + "version": "4.10.1"
117 +}
1 +(function (global, factory) {
2 + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3 + typeof define === 'function' && define.amd ? define(['exports'], factory) :
4 + (factory((global.History = {})));
5 +}(this, (function (exports) { 'use strict';
6 +
7 + function _extends() {
8 + _extends = Object.assign || function (target) {
9 + for (var i = 1; i < arguments.length; i++) {
10 + var source = arguments[i];
11 +
12 + for (var key in source) {
13 + if (Object.prototype.hasOwnProperty.call(source, key)) {
14 + target[key] = source[key];
15 + }
16 + }
17 + }
18 +
19 + return target;
20 + };
21 +
22 + return _extends.apply(this, arguments);
23 + }
24 +
25 + function isAbsolute(pathname) {
26 + return pathname.charAt(0) === '/';
27 + }
28 +
29 + // About 1.5x faster than the two-arg version of Array#splice()
30 + function spliceOne(list, index) {
31 + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
32 + list[i] = list[k];
33 + }
34 +
35 + list.pop();
36 + }
37 +
38 + // This implementation is based heavily on node's url.parse
39 + function resolvePathname(to, from) {
40 + if (from === undefined) from = '';
41 +
42 + var toParts = (to && to.split('/')) || [];
43 + var fromParts = (from && from.split('/')) || [];
44 +
45 + var isToAbs = to && isAbsolute(to);
46 + var isFromAbs = from && isAbsolute(from);
47 + var mustEndAbs = isToAbs || isFromAbs;
48 +
49 + if (to && isAbsolute(to)) {
50 + // to is absolute
51 + fromParts = toParts;
52 + } else if (toParts.length) {
53 + // to is relative, drop the filename
54 + fromParts.pop();
55 + fromParts = fromParts.concat(toParts);
56 + }
57 +
58 + if (!fromParts.length) return '/';
59 +
60 + var hasTrailingSlash;
61 + if (fromParts.length) {
62 + var last = fromParts[fromParts.length - 1];
63 + hasTrailingSlash = last === '.' || last === '..' || last === '';
64 + } else {
65 + hasTrailingSlash = false;
66 + }
67 +
68 + var up = 0;
69 + for (var i = fromParts.length; i >= 0; i--) {
70 + var part = fromParts[i];
71 +
72 + if (part === '.') {
73 + spliceOne(fromParts, i);
74 + } else if (part === '..') {
75 + spliceOne(fromParts, i);
76 + up++;
77 + } else if (up) {
78 + spliceOne(fromParts, i);
79 + up--;
80 + }
81 + }
82 +
83 + if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
84 +
85 + if (
86 + mustEndAbs &&
87 + fromParts[0] !== '' &&
88 + (!fromParts[0] || !isAbsolute(fromParts[0]))
89 + )
90 + fromParts.unshift('');
91 +
92 + var result = fromParts.join('/');
93 +
94 + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
95 +
96 + return result;
97 + }
98 +
99 + function valueOf(obj) {
100 + return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
101 + }
102 +
103 + function valueEqual(a, b) {
104 + // Test for strict equality first.
105 + if (a === b) return true;
106 +
107 + // Otherwise, if either of them == null they are not equal.
108 + if (a == null || b == null) return false;
109 +
110 + if (Array.isArray(a)) {
111 + return (
112 + Array.isArray(b) &&
113 + a.length === b.length &&
114 + a.every(function(item, index) {
115 + return valueEqual(item, b[index]);
116 + })
117 + );
118 + }
119 +
120 + if (typeof a === 'object' || typeof b === 'object') {
121 + var aValue = valueOf(a);
122 + var bValue = valueOf(b);
123 +
124 + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
125 +
126 + return Object.keys(Object.assign({}, a, b)).every(function(key) {
127 + return valueEqual(a[key], b[key]);
128 + });
129 + }
130 +
131 + return false;
132 + }
133 +
134 + function addLeadingSlash(path) {
135 + return path.charAt(0) === '/' ? path : '/' + path;
136 + }
137 + function stripLeadingSlash(path) {
138 + return path.charAt(0) === '/' ? path.substr(1) : path;
139 + }
140 + function hasBasename(path, prefix) {
141 + return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
142 + }
143 + function stripBasename(path, prefix) {
144 + return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
145 + }
146 + function stripTrailingSlash(path) {
147 + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
148 + }
149 + function parsePath(path) {
150 + var pathname = path || '/';
151 + var search = '';
152 + var hash = '';
153 + var hashIndex = pathname.indexOf('#');
154 +
155 + if (hashIndex !== -1) {
156 + hash = pathname.substr(hashIndex);
157 + pathname = pathname.substr(0, hashIndex);
158 + }
159 +
160 + var searchIndex = pathname.indexOf('?');
161 +
162 + if (searchIndex !== -1) {
163 + search = pathname.substr(searchIndex);
164 + pathname = pathname.substr(0, searchIndex);
165 + }
166 +
167 + return {
168 + pathname: pathname,
169 + search: search === '?' ? '' : search,
170 + hash: hash === '#' ? '' : hash
171 + };
172 + }
173 + function createPath(location) {
174 + var pathname = location.pathname,
175 + search = location.search,
176 + hash = location.hash;
177 + var path = pathname || '/';
178 + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
179 + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
180 + return path;
181 + }
182 +
183 + function createLocation(path, state, key, currentLocation) {
184 + var location;
185 +
186 + if (typeof path === 'string') {
187 + // Two-arg form: push(path, state)
188 + location = parsePath(path);
189 + location.state = state;
190 + } else {
191 + // One-arg form: push(location)
192 + location = _extends({}, path);
193 + if (location.pathname === undefined) location.pathname = '';
194 +
195 + if (location.search) {
196 + if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
197 + } else {
198 + location.search = '';
199 + }
200 +
201 + if (location.hash) {
202 + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
203 + } else {
204 + location.hash = '';
205 + }
206 +
207 + if (state !== undefined && location.state === undefined) location.state = state;
208 + }
209 +
210 + try {
211 + location.pathname = decodeURI(location.pathname);
212 + } catch (e) {
213 + if (e instanceof URIError) {
214 + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
215 + } else {
216 + throw e;
217 + }
218 + }
219 +
220 + if (key) location.key = key;
221 +
222 + if (currentLocation) {
223 + // Resolve incomplete/relative pathname relative to current location.
224 + if (!location.pathname) {
225 + location.pathname = currentLocation.pathname;
226 + } else if (location.pathname.charAt(0) !== '/') {
227 + location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
228 + }
229 + } else {
230 + // When there is no prior location and pathname is empty, set it to /
231 + if (!location.pathname) {
232 + location.pathname = '/';
233 + }
234 + }
235 +
236 + return location;
237 + }
238 + function locationsAreEqual(a, b) {
239 + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);
240 + }
241 +
242 + function warning(condition, message) {
243 + {
244 + if (condition) {
245 + return;
246 + }
247 +
248 + var text = "Warning: " + message;
249 +
250 + if (typeof console !== 'undefined') {
251 + console.warn(text);
252 + }
253 +
254 + try {
255 + throw Error(text);
256 + } catch (x) {}
257 + }
258 + }
259 +
260 + function createTransitionManager() {
261 + var prompt = null;
262 +
263 + function setPrompt(nextPrompt) {
264 + warning(prompt == null, 'A history supports only one prompt at a time');
265 + prompt = nextPrompt;
266 + return function () {
267 + if (prompt === nextPrompt) prompt = null;
268 + };
269 + }
270 +
271 + function confirmTransitionTo(location, action, getUserConfirmation, callback) {
272 + // TODO: If another transition starts while we're still confirming
273 + // the previous one, we may end up in a weird state. Figure out the
274 + // best way to handle this.
275 + if (prompt != null) {
276 + var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
277 +
278 + if (typeof result === 'string') {
279 + if (typeof getUserConfirmation === 'function') {
280 + getUserConfirmation(result, callback);
281 + } else {
282 + warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
283 + callback(true);
284 + }
285 + } else {
286 + // Return false from a transition hook to cancel the transition.
287 + callback(result !== false);
288 + }
289 + } else {
290 + callback(true);
291 + }
292 + }
293 +
294 + var listeners = [];
295 +
296 + function appendListener(fn) {
297 + var isActive = true;
298 +
299 + function listener() {
300 + if (isActive) fn.apply(void 0, arguments);
301 + }
302 +
303 + listeners.push(listener);
304 + return function () {
305 + isActive = false;
306 + listeners = listeners.filter(function (item) {
307 + return item !== listener;
308 + });
309 + };
310 + }
311 +
312 + function notifyListeners() {
313 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
314 + args[_key] = arguments[_key];
315 + }
316 +
317 + listeners.forEach(function (listener) {
318 + return listener.apply(void 0, args);
319 + });
320 + }
321 +
322 + return {
323 + setPrompt: setPrompt,
324 + confirmTransitionTo: confirmTransitionTo,
325 + appendListener: appendListener,
326 + notifyListeners: notifyListeners
327 + };
328 + }
329 +
330 + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
331 + function getConfirmation(message, callback) {
332 + callback(window.confirm(message)); // eslint-disable-line no-alert
333 + }
334 + /**
335 + * Returns true if the HTML5 history API is supported. Taken from Modernizr.
336 + *
337 + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
338 + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
339 + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
340 + */
341 +
342 + function supportsHistory() {
343 + var ua = window.navigator.userAgent;
344 + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
345 + return window.history && 'pushState' in window.history;
346 + }
347 + /**
348 + * Returns true if browser fires popstate on hash change.
349 + * IE10 and IE11 do not.
350 + */
351 +
352 + function supportsPopStateOnHashChange() {
353 + return window.navigator.userAgent.indexOf('Trident') === -1;
354 + }
355 + /**
356 + * Returns false if using go(n) with hash history causes a full page reload.
357 + */
358 +
359 + function supportsGoWithoutReloadUsingHash() {
360 + return window.navigator.userAgent.indexOf('Firefox') === -1;
361 + }
362 + /**
363 + * Returns true if a given popstate event is an extraneous WebKit event.
364 + * Accounts for the fact that Chrome on iOS fires real popstate events
365 + * containing undefined state when pressing the back button.
366 + */
367 +
368 + function isExtraneousPopstateEvent(event) {
369 + return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
370 + }
371 +
372 + var prefix = 'Invariant failed';
373 + function invariant(condition, message) {
374 + if (condition) {
375 + return;
376 + }
377 +
378 + {
379 + throw new Error(prefix + ": " + (message || ''));
380 + }
381 + }
382 +
383 + var PopStateEvent = 'popstate';
384 + var HashChangeEvent = 'hashchange';
385 +
386 + function getHistoryState() {
387 + try {
388 + return window.history.state || {};
389 + } catch (e) {
390 + // IE 11 sometimes throws when accessing window.history.state
391 + // See https://github.com/ReactTraining/history/pull/289
392 + return {};
393 + }
394 + }
395 + /**
396 + * Creates a history object that uses the HTML5 history API including
397 + * pushState, replaceState, and the popstate event.
398 + */
399 +
400 +
401 + function createBrowserHistory(props) {
402 + if (props === void 0) {
403 + props = {};
404 + }
405 +
406 + !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0;
407 + var globalHistory = window.history;
408 + var canUseHistory = supportsHistory();
409 + var needsHashChangeListener = !supportsPopStateOnHashChange();
410 + var _props = props,
411 + _props$forceRefresh = _props.forceRefresh,
412 + forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
413 + _props$getUserConfirm = _props.getUserConfirmation,
414 + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
415 + _props$keyLength = _props.keyLength,
416 + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
417 + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
418 +
419 + function getDOMLocation(historyState) {
420 + var _ref = historyState || {},
421 + key = _ref.key,
422 + state = _ref.state;
423 +
424 + var _window$location = window.location,
425 + pathname = _window$location.pathname,
426 + search = _window$location.search,
427 + hash = _window$location.hash;
428 + var path = pathname + search + hash;
429 + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
430 + if (basename) path = stripBasename(path, basename);
431 + return createLocation(path, state, key);
432 + }
433 +
434 + function createKey() {
435 + return Math.random().toString(36).substr(2, keyLength);
436 + }
437 +
438 + var transitionManager = createTransitionManager();
439 +
440 + function setState(nextState) {
441 + _extends(history, nextState);
442 +
443 + history.length = globalHistory.length;
444 + transitionManager.notifyListeners(history.location, history.action);
445 + }
446 +
447 + function handlePopState(event) {
448 + // Ignore extraneous popstate events in WebKit.
449 + if (isExtraneousPopstateEvent(event)) return;
450 + handlePop(getDOMLocation(event.state));
451 + }
452 +
453 + function handleHashChange() {
454 + handlePop(getDOMLocation(getHistoryState()));
455 + }
456 +
457 + var forceNextPop = false;
458 +
459 + function handlePop(location) {
460 + if (forceNextPop) {
461 + forceNextPop = false;
462 + setState();
463 + } else {
464 + var action = 'POP';
465 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
466 + if (ok) {
467 + setState({
468 + action: action,
469 + location: location
470 + });
471 + } else {
472 + revertPop(location);
473 + }
474 + });
475 + }
476 + }
477 +
478 + function revertPop(fromLocation) {
479 + var toLocation = history.location; // TODO: We could probably make this more reliable by
480 + // keeping a list of keys we've seen in sessionStorage.
481 + // Instead, we just default to 0 for keys we don't know.
482 +
483 + var toIndex = allKeys.indexOf(toLocation.key);
484 + if (toIndex === -1) toIndex = 0;
485 + var fromIndex = allKeys.indexOf(fromLocation.key);
486 + if (fromIndex === -1) fromIndex = 0;
487 + var delta = toIndex - fromIndex;
488 +
489 + if (delta) {
490 + forceNextPop = true;
491 + go(delta);
492 + }
493 + }
494 +
495 + var initialLocation = getDOMLocation(getHistoryState());
496 + var allKeys = [initialLocation.key]; // Public interface
497 +
498 + function createHref(location) {
499 + return basename + createPath(location);
500 + }
501 +
502 + function push(path, state) {
503 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
504 + var action = 'PUSH';
505 + var location = createLocation(path, state, createKey(), history.location);
506 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
507 + if (!ok) return;
508 + var href = createHref(location);
509 + var key = location.key,
510 + state = location.state;
511 +
512 + if (canUseHistory) {
513 + globalHistory.pushState({
514 + key: key,
515 + state: state
516 + }, null, href);
517 +
518 + if (forceRefresh) {
519 + window.location.href = href;
520 + } else {
521 + var prevIndex = allKeys.indexOf(history.location.key);
522 + var nextKeys = allKeys.slice(0, prevIndex + 1);
523 + nextKeys.push(location.key);
524 + allKeys = nextKeys;
525 + setState({
526 + action: action,
527 + location: location
528 + });
529 + }
530 + } else {
531 + warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
532 + window.location.href = href;
533 + }
534 + });
535 + }
536 +
537 + function replace(path, state) {
538 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
539 + var action = 'REPLACE';
540 + var location = createLocation(path, state, createKey(), history.location);
541 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
542 + if (!ok) return;
543 + var href = createHref(location);
544 + var key = location.key,
545 + state = location.state;
546 +
547 + if (canUseHistory) {
548 + globalHistory.replaceState({
549 + key: key,
550 + state: state
551 + }, null, href);
552 +
553 + if (forceRefresh) {
554 + window.location.replace(href);
555 + } else {
556 + var prevIndex = allKeys.indexOf(history.location.key);
557 + if (prevIndex !== -1) allKeys[prevIndex] = location.key;
558 + setState({
559 + action: action,
560 + location: location
561 + });
562 + }
563 + } else {
564 + warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
565 + window.location.replace(href);
566 + }
567 + });
568 + }
569 +
570 + function go(n) {
571 + globalHistory.go(n);
572 + }
573 +
574 + function goBack() {
575 + go(-1);
576 + }
577 +
578 + function goForward() {
579 + go(1);
580 + }
581 +
582 + var listenerCount = 0;
583 +
584 + function checkDOMListeners(delta) {
585 + listenerCount += delta;
586 +
587 + if (listenerCount === 1 && delta === 1) {
588 + window.addEventListener(PopStateEvent, handlePopState);
589 + if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
590 + } else if (listenerCount === 0) {
591 + window.removeEventListener(PopStateEvent, handlePopState);
592 + if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
593 + }
594 + }
595 +
596 + var isBlocked = false;
597 +
598 + function block(prompt) {
599 + if (prompt === void 0) {
600 + prompt = false;
601 + }
602 +
603 + var unblock = transitionManager.setPrompt(prompt);
604 +
605 + if (!isBlocked) {
606 + checkDOMListeners(1);
607 + isBlocked = true;
608 + }
609 +
610 + return function () {
611 + if (isBlocked) {
612 + isBlocked = false;
613 + checkDOMListeners(-1);
614 + }
615 +
616 + return unblock();
617 + };
618 + }
619 +
620 + function listen(listener) {
621 + var unlisten = transitionManager.appendListener(listener);
622 + checkDOMListeners(1);
623 + return function () {
624 + checkDOMListeners(-1);
625 + unlisten();
626 + };
627 + }
628 +
629 + var history = {
630 + length: globalHistory.length,
631 + action: 'POP',
632 + location: initialLocation,
633 + createHref: createHref,
634 + push: push,
635 + replace: replace,
636 + go: go,
637 + goBack: goBack,
638 + goForward: goForward,
639 + block: block,
640 + listen: listen
641 + };
642 + return history;
643 + }
644 +
645 + var HashChangeEvent$1 = 'hashchange';
646 + var HashPathCoders = {
647 + hashbang: {
648 + encodePath: function encodePath(path) {
649 + return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
650 + },
651 + decodePath: function decodePath(path) {
652 + return path.charAt(0) === '!' ? path.substr(1) : path;
653 + }
654 + },
655 + noslash: {
656 + encodePath: stripLeadingSlash,
657 + decodePath: addLeadingSlash
658 + },
659 + slash: {
660 + encodePath: addLeadingSlash,
661 + decodePath: addLeadingSlash
662 + }
663 + };
664 +
665 + function stripHash(url) {
666 + var hashIndex = url.indexOf('#');
667 + return hashIndex === -1 ? url : url.slice(0, hashIndex);
668 + }
669 +
670 + function getHashPath() {
671 + // We can't use window.location.hash here because it's not
672 + // consistent across browsers - Firefox will pre-decode it!
673 + var href = window.location.href;
674 + var hashIndex = href.indexOf('#');
675 + return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
676 + }
677 +
678 + function pushHashPath(path) {
679 + window.location.hash = path;
680 + }
681 +
682 + function replaceHashPath(path) {
683 + window.location.replace(stripHash(window.location.href) + '#' + path);
684 + }
685 +
686 + function createHashHistory(props) {
687 + if (props === void 0) {
688 + props = {};
689 + }
690 +
691 + !canUseDOM ? invariant(false, 'Hash history needs a DOM') : void 0;
692 + var globalHistory = window.history;
693 + var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
694 + var _props = props,
695 + _props$getUserConfirm = _props.getUserConfirmation,
696 + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
697 + _props$hashType = _props.hashType,
698 + hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
699 + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
700 + var _HashPathCoders$hashT = HashPathCoders[hashType],
701 + encodePath = _HashPathCoders$hashT.encodePath,
702 + decodePath = _HashPathCoders$hashT.decodePath;
703 +
704 + function getDOMLocation() {
705 + var path = decodePath(getHashPath());
706 + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
707 + if (basename) path = stripBasename(path, basename);
708 + return createLocation(path);
709 + }
710 +
711 + var transitionManager = createTransitionManager();
712 +
713 + function setState(nextState) {
714 + _extends(history, nextState);
715 +
716 + history.length = globalHistory.length;
717 + transitionManager.notifyListeners(history.location, history.action);
718 + }
719 +
720 + var forceNextPop = false;
721 + var ignorePath = null;
722 +
723 + function locationsAreEqual$$1(a, b) {
724 + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
725 + }
726 +
727 + function handleHashChange() {
728 + var path = getHashPath();
729 + var encodedPath = encodePath(path);
730 +
731 + if (path !== encodedPath) {
732 + // Ensure we always have a properly-encoded hash.
733 + replaceHashPath(encodedPath);
734 + } else {
735 + var location = getDOMLocation();
736 + var prevLocation = history.location;
737 + if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
738 +
739 + if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
740 +
741 + ignorePath = null;
742 + handlePop(location);
743 + }
744 + }
745 +
746 + function handlePop(location) {
747 + if (forceNextPop) {
748 + forceNextPop = false;
749 + setState();
750 + } else {
751 + var action = 'POP';
752 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
753 + if (ok) {
754 + setState({
755 + action: action,
756 + location: location
757 + });
758 + } else {
759 + revertPop(location);
760 + }
761 + });
762 + }
763 + }
764 +
765 + function revertPop(fromLocation) {
766 + var toLocation = history.location; // TODO: We could probably make this more reliable by
767 + // keeping a list of paths we've seen in sessionStorage.
768 + // Instead, we just default to 0 for paths we don't know.
769 +
770 + var toIndex = allPaths.lastIndexOf(createPath(toLocation));
771 + if (toIndex === -1) toIndex = 0;
772 + var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
773 + if (fromIndex === -1) fromIndex = 0;
774 + var delta = toIndex - fromIndex;
775 +
776 + if (delta) {
777 + forceNextPop = true;
778 + go(delta);
779 + }
780 + } // Ensure the hash is encoded properly before doing anything else.
781 +
782 +
783 + var path = getHashPath();
784 + var encodedPath = encodePath(path);
785 + if (path !== encodedPath) replaceHashPath(encodedPath);
786 + var initialLocation = getDOMLocation();
787 + var allPaths = [createPath(initialLocation)]; // Public interface
788 +
789 + function createHref(location) {
790 + var baseTag = document.querySelector('base');
791 + var href = '';
792 +
793 + if (baseTag && baseTag.getAttribute('href')) {
794 + href = stripHash(window.location.href);
795 + }
796 +
797 + return href + '#' + encodePath(basename + createPath(location));
798 + }
799 +
800 + function push(path, state) {
801 + warning(state === undefined, 'Hash history cannot push state; it is ignored');
802 + var action = 'PUSH';
803 + var location = createLocation(path, undefined, undefined, history.location);
804 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
805 + if (!ok) return;
806 + var path = createPath(location);
807 + var encodedPath = encodePath(basename + path);
808 + var hashChanged = getHashPath() !== encodedPath;
809 +
810 + if (hashChanged) {
811 + // We cannot tell if a hashchange was caused by a PUSH, so we'd
812 + // rather setState here and ignore the hashchange. The caveat here
813 + // is that other hash histories in the page will consider it a POP.
814 + ignorePath = path;
815 + pushHashPath(encodedPath);
816 + var prevIndex = allPaths.lastIndexOf(createPath(history.location));
817 + var nextPaths = allPaths.slice(0, prevIndex + 1);
818 + nextPaths.push(path);
819 + allPaths = nextPaths;
820 + setState({
821 + action: action,
822 + location: location
823 + });
824 + } else {
825 + warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
826 + setState();
827 + }
828 + });
829 + }
830 +
831 + function replace(path, state) {
832 + warning(state === undefined, 'Hash history cannot replace state; it is ignored');
833 + var action = 'REPLACE';
834 + var location = createLocation(path, undefined, undefined, history.location);
835 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
836 + if (!ok) return;
837 + var path = createPath(location);
838 + var encodedPath = encodePath(basename + path);
839 + var hashChanged = getHashPath() !== encodedPath;
840 +
841 + if (hashChanged) {
842 + // We cannot tell if a hashchange was caused by a REPLACE, so we'd
843 + // rather setState here and ignore the hashchange. The caveat here
844 + // is that other hash histories in the page will consider it a POP.
845 + ignorePath = path;
846 + replaceHashPath(encodedPath);
847 + }
848 +
849 + var prevIndex = allPaths.indexOf(createPath(history.location));
850 + if (prevIndex !== -1) allPaths[prevIndex] = path;
851 + setState({
852 + action: action,
853 + location: location
854 + });
855 + });
856 + }
857 +
858 + function go(n) {
859 + warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
860 + globalHistory.go(n);
861 + }
862 +
863 + function goBack() {
864 + go(-1);
865 + }
866 +
867 + function goForward() {
868 + go(1);
869 + }
870 +
871 + var listenerCount = 0;
872 +
873 + function checkDOMListeners(delta) {
874 + listenerCount += delta;
875 +
876 + if (listenerCount === 1 && delta === 1) {
877 + window.addEventListener(HashChangeEvent$1, handleHashChange);
878 + } else if (listenerCount === 0) {
879 + window.removeEventListener(HashChangeEvent$1, handleHashChange);
880 + }
881 + }
882 +
883 + var isBlocked = false;
884 +
885 + function block(prompt) {
886 + if (prompt === void 0) {
887 + prompt = false;
888 + }
889 +
890 + var unblock = transitionManager.setPrompt(prompt);
891 +
892 + if (!isBlocked) {
893 + checkDOMListeners(1);
894 + isBlocked = true;
895 + }
896 +
897 + return function () {
898 + if (isBlocked) {
899 + isBlocked = false;
900 + checkDOMListeners(-1);
901 + }
902 +
903 + return unblock();
904 + };
905 + }
906 +
907 + function listen(listener) {
908 + var unlisten = transitionManager.appendListener(listener);
909 + checkDOMListeners(1);
910 + return function () {
911 + checkDOMListeners(-1);
912 + unlisten();
913 + };
914 + }
915 +
916 + var history = {
917 + length: globalHistory.length,
918 + action: 'POP',
919 + location: initialLocation,
920 + createHref: createHref,
921 + push: push,
922 + replace: replace,
923 + go: go,
924 + goBack: goBack,
925 + goForward: goForward,
926 + block: block,
927 + listen: listen
928 + };
929 + return history;
930 + }
931 +
932 + function clamp(n, lowerBound, upperBound) {
933 + return Math.min(Math.max(n, lowerBound), upperBound);
934 + }
935 + /**
936 + * Creates a history object that stores locations in memory.
937 + */
938 +
939 +
940 + function createMemoryHistory(props) {
941 + if (props === void 0) {
942 + props = {};
943 + }
944 +
945 + var _props = props,
946 + getUserConfirmation = _props.getUserConfirmation,
947 + _props$initialEntries = _props.initialEntries,
948 + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
949 + _props$initialIndex = _props.initialIndex,
950 + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
951 + _props$keyLength = _props.keyLength,
952 + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
953 + var transitionManager = createTransitionManager();
954 +
955 + function setState(nextState) {
956 + _extends(history, nextState);
957 +
958 + history.length = history.entries.length;
959 + transitionManager.notifyListeners(history.location, history.action);
960 + }
961 +
962 + function createKey() {
963 + return Math.random().toString(36).substr(2, keyLength);
964 + }
965 +
966 + var index = clamp(initialIndex, 0, initialEntries.length - 1);
967 + var entries = initialEntries.map(function (entry) {
968 + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
969 + }); // Public interface
970 +
971 + var createHref = createPath;
972 +
973 + function push(path, state) {
974 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
975 + var action = 'PUSH';
976 + var location = createLocation(path, state, createKey(), history.location);
977 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
978 + if (!ok) return;
979 + var prevIndex = history.index;
980 + var nextIndex = prevIndex + 1;
981 + var nextEntries = history.entries.slice(0);
982 +
983 + if (nextEntries.length > nextIndex) {
984 + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
985 + } else {
986 + nextEntries.push(location);
987 + }
988 +
989 + setState({
990 + action: action,
991 + location: location,
992 + index: nextIndex,
993 + entries: nextEntries
994 + });
995 + });
996 + }
997 +
998 + function replace(path, state) {
999 + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
1000 + var action = 'REPLACE';
1001 + var location = createLocation(path, state, createKey(), history.location);
1002 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
1003 + if (!ok) return;
1004 + history.entries[history.index] = location;
1005 + setState({
1006 + action: action,
1007 + location: location
1008 + });
1009 + });
1010 + }
1011 +
1012 + function go(n) {
1013 + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
1014 + var action = 'POP';
1015 + var location = history.entries[nextIndex];
1016 + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
1017 + if (ok) {
1018 + setState({
1019 + action: action,
1020 + location: location,
1021 + index: nextIndex
1022 + });
1023 + } else {
1024 + // Mimic the behavior of DOM histories by
1025 + // causing a render after a cancelled POP.
1026 + setState();
1027 + }
1028 + });
1029 + }
1030 +
1031 + function goBack() {
1032 + go(-1);
1033 + }
1034 +
1035 + function goForward() {
1036 + go(1);
1037 + }
1038 +
1039 + function canGo(n) {
1040 + var nextIndex = history.index + n;
1041 + return nextIndex >= 0 && nextIndex < history.entries.length;
1042 + }
1043 +
1044 + function block(prompt) {
1045 + if (prompt === void 0) {
1046 + prompt = false;
1047 + }
1048 +
1049 + return transitionManager.setPrompt(prompt);
1050 + }
1051 +
1052 + function listen(listener) {
1053 + return transitionManager.appendListener(listener);
1054 + }
1055 +
1056 + var history = {
1057 + length: entries.length,
1058 + action: 'POP',
1059 + location: entries[index],
1060 + index: index,
1061 + entries: entries,
1062 + createHref: createHref,
1063 + push: push,
1064 + replace: replace,
1065 + go: go,
1066 + goBack: goBack,
1067 + goForward: goForward,
1068 + canGo: canGo,
1069 + block: block,
1070 + listen: listen
1071 + };
1072 + return history;
1073 + }
1074 +
1075 + exports.createBrowserHistory = createBrowserHistory;
1076 + exports.createHashHistory = createHashHistory;
1077 + exports.createMemoryHistory = createMemoryHistory;
1078 + exports.createLocation = createLocation;
1079 + exports.locationsAreEqual = locationsAreEqual;
1080 + exports.parsePath = parsePath;
1081 + exports.createPath = createPath;
1082 +
1083 + Object.defineProperty(exports, '__esModule', { value: true });
1084 +
1085 +})));
1 +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.History={})}(this,function(n){"use strict";function E(){return(E=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n}).apply(this,arguments)}function d(n){return"/"===n.charAt(0)}function v(n,t){for(var e=t,o=e+1,r=n.length;o<r;e+=1,o+=1)n[e]=n[o];n.pop()}function i(n){return n.valueOf?n.valueOf():Object.prototype.valueOf.call(n)}function H(n){return"/"===n.charAt(0)?n:"/"+n}function t(n){return"/"===n.charAt(0)?n.substr(1):n}function S(n,t){return function(n,t){return 0===n.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(n.charAt(t.length))}(n,t)?n.substr(t.length):n}function U(n){return"/"===n.charAt(n.length-1)?n.slice(0,-1):n}function a(n){var t=n||"/",e="",o="",r=t.indexOf("#");-1!==r&&(o=t.substr(r),t=t.substr(0,r));var i=t.indexOf("?");return-1!==i&&(e=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===e?"":e,hash:"#"===o?"":o}}function j(n){var t=n.pathname,e=n.search,o=n.hash,r=t||"/";return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}function C(n,t,e,o){var r;"string"==typeof n?(r=a(n)).state=t:(void 0===(r=E({},n)).pathname&&(r.pathname=""),r.search?"?"!==r.search.charAt(0)&&(r.search="?"+r.search):r.search="",r.hash?"#"!==r.hash.charAt(0)&&(r.hash="#"+r.hash):r.hash="",void 0!==t&&void 0===r.state&&(r.state=t));try{r.pathname=decodeURI(r.pathname)}catch(n){throw n instanceof URIError?new URIError('Pathname "'+r.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):n}return e&&(r.key=e),o?r.pathname?"/"!==r.pathname.charAt(0)&&(r.pathname=function(n,t){void 0===t&&(t="");var e,o=n&&n.split("/")||[],r=t&&t.split("/")||[],i=n&&d(n),a=t&&d(t),c=i||a;if(n&&d(n)?r=o:o.length&&(r.pop(),r=r.concat(o)),!r.length)return"/";if(r.length){var u=r[r.length-1];e="."===u||".."===u||""===u}else e=!1;for(var f=0,s=r.length;0<=s;s--){var h=r[s];"."===h?v(r,s):".."===h?(v(r,s),f++):f&&(v(r,s),f--)}if(!c)for(;f--;)r.unshift("..");!c||""===r[0]||r[0]&&d(r[0])||r.unshift("");var l=r.join("/");return e&&"/"!==l.substr(-1)&&(l+="/"),l}(r.pathname,o.pathname)):r.pathname=o.pathname:r.pathname||(r.pathname="/"),r}function I(){var i=null;var o=[];return{setPrompt:function(n){return i=n,function(){i===n&&(i=null)}},confirmTransitionTo:function(n,t,e,o){if(null!=i){var r="function"==typeof i?i(n,t):i;"string"==typeof r?"function"==typeof e?e(r,o):o(!0):o(!1!==r)}else o(!0)},appendListener:function(n){var t=!0;function e(){t&&n.apply(void 0,arguments)}return o.push(e),function(){t=!1,o=o.filter(function(n){return n!==e})}},notifyListeners:function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];o.forEach(function(n){return n.apply(void 0,t)})}}}var M=!("undefined"==typeof window||!window.document||!window.document.createElement);function R(n,t){t(window.confirm(n))}var e="Invariant failed";function B(n){if(!n)throw new Error(e)}var F="popstate",q="hashchange";function _(){try{return window.history.state||{}}catch(n){return{}}}var T="hashchange",L={hashbang:{encodePath:function(n){return"!"===n.charAt(0)?n:"!/"+t(n)},decodePath:function(n){return"!"===n.charAt(0)?n.substr(1):n}},noslash:{encodePath:t,decodePath:H},slash:{encodePath:H,decodePath:H}};function G(n){var t=n.indexOf("#");return-1===t?n:n.slice(0,t)}function W(){var n=window.location.href,t=n.indexOf("#");return-1===t?"":n.substring(t+1)}function z(n){window.location.replace(G(window.location.href)+"#"+n)}function g(n,t,e){return Math.min(Math.max(n,t),e)}n.createBrowserHistory=function(n){void 0===n&&(n={}),M||B(!1);var c=window.history,u=function(){var n=window.navigator.userAgent;return(-1===n.indexOf("Android 2.")&&-1===n.indexOf("Android 4.0")||-1===n.indexOf("Mobile Safari")||-1!==n.indexOf("Chrome")||-1!==n.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)}(),t=!(-1===window.navigator.userAgent.indexOf("Trident")),e=n,o=e.forceRefresh,f=void 0!==o&&o,r=e.getUserConfirmation,s=void 0===r?R:r,i=e.keyLength,a=void 0===i?6:i,h=n.basename?U(H(n.basename)):"";function l(n){var t=n||{},e=t.key,o=t.state,r=window.location,i=r.pathname+r.search+r.hash;return h&&(i=S(i,h)),C(i,o,e)}function d(){return Math.random().toString(36).substr(2,a)}var v=I();function p(n){E(L,n),L.length=c.length,v.notifyListeners(L.location,L.action)}function w(n){!function(n){return void 0===n.state&&-1===navigator.userAgent.indexOf("CriOS")}(n)&&m(l(n.state))}function g(){m(l(_()))}var y=!1;function m(t){if(y)y=!1,p();else{v.confirmTransitionTo(t,"POP",s,function(n){n?p({action:"POP",location:t}):function(n){var t=L.location,e=O.indexOf(t.key);-1===e&&(e=0);var o=O.indexOf(n.key);-1===o&&(o=0);var r=e-o;r&&(y=!0,b(r))}(t)})}}var P=l(_()),O=[P.key];function x(n){return h+j(n)}function b(n){c.go(n)}var A=0;function k(n){1===(A+=n)&&1===n?(window.addEventListener(F,w),t&&window.addEventListener(q,g)):0===A&&(window.removeEventListener(F,w),t&&window.removeEventListener(q,g))}var T=!1,L={length:c.length,action:"POP",location:P,createHref:x,push:function(n,t){var a=C(n,t,d(),L.location);v.confirmTransitionTo(a,"PUSH",s,function(n){if(n){var t=x(a),e=a.key,o=a.state;if(u)if(c.pushState({key:e,state:o},null,t),f)window.location.href=t;else{var r=O.indexOf(L.location.key),i=O.slice(0,r+1);i.push(a.key),O=i,p({action:"PUSH",location:a})}else window.location.href=t}})},replace:function(n,t){var i="REPLACE",a=C(n,t,d(),L.location);v.confirmTransitionTo(a,i,s,function(n){if(n){var t=x(a),e=a.key,o=a.state;if(u)if(c.replaceState({key:e,state:o},null,t),f)window.location.replace(t);else{var r=O.indexOf(L.location.key);-1!==r&&(O[r]=a.key),p({action:i,location:a})}else window.location.replace(t)}})},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},block:function(n){void 0===n&&(n=!1);var t=v.setPrompt(n);return T||(k(1),T=!0),function(){return T&&(T=!1,k(-1)),t()}},listen:function(n){var t=v.appendListener(n);return k(1),function(){k(-1),t()}}};return L},n.createHashHistory=function(n){void 0===n&&(n={}),M||B(!1);var t=window.history,e=(window.navigator.userAgent.indexOf("Firefox"),n),o=e.getUserConfirmation,a=void 0===o?R:o,r=e.hashType,i=void 0===r?"slash":r,c=n.basename?U(H(n.basename)):"",u=L[i],f=u.encodePath,s=u.decodePath;function h(){var n=s(W());return c&&(n=S(n,c)),C(n)}var l=I();function d(n){E(k,n),k.length=t.length,l.notifyListeners(k.location,k.action)}var v=!1,p=null;function w(){var n=W(),t=f(n);if(n!==t)z(t);else{var e=h(),o=k.location;if(!v&&function(n,t){return n.pathname===t.pathname&&n.search===t.search&&n.hash===t.hash}(o,e))return;if(p===j(e))return;p=null,function(t){if(v)v=!1,d();else{l.confirmTransitionTo(t,"POP",a,function(n){n?d({action:"POP",location:t}):function(n){var t=k.location,e=P.lastIndexOf(j(t));-1===e&&(e=0);var o=P.lastIndexOf(j(n));-1===o&&(o=0);var r=e-o;r&&(v=!0,O(r))}(t)})}}(e)}}var g=W(),y=f(g);g!==y&&z(y);var m=h(),P=[j(m)];function O(n){t.go(n)}var x=0;function b(n){1===(x+=n)&&1===n?window.addEventListener(T,w):0===x&&window.removeEventListener(T,w)}var A=!1,k={length:t.length,action:"POP",location:m,createHref:function(n){var t=document.querySelector("base"),e="";return t&&t.getAttribute("href")&&(e=G(window.location.href)),e+"#"+f(c+j(n))},push:function(n,t){var i=C(n,void 0,void 0,k.location);l.confirmTransitionTo(i,"PUSH",a,function(n){if(n){var t=j(i),e=f(c+t);if(W()!==e){p=t,function(n){window.location.hash=n}(e);var o=P.lastIndexOf(j(k.location)),r=P.slice(0,o+1);r.push(t),P=r,d({action:"PUSH",location:i})}else d()}})},replace:function(n,t){var r="REPLACE",i=C(n,void 0,void 0,k.location);l.confirmTransitionTo(i,r,a,function(n){if(n){var t=j(i),e=f(c+t);W()!==e&&(p=t,z(e));var o=P.indexOf(j(k.location));-1!==o&&(P[o]=t),d({action:r,location:i})}})},go:O,goBack:function(){O(-1)},goForward:function(){O(1)},block:function(n){void 0===n&&(n=!1);var t=l.setPrompt(n);return A||(b(1),A=!0),function(){return A&&(A=!1,b(-1)),t()}},listen:function(n){var t=l.appendListener(n);return b(1),function(){b(-1),t()}}};return k},n.createMemoryHistory=function(n){void 0===n&&(n={});var t=n,r=t.getUserConfirmation,e=t.initialEntries,o=void 0===e?["/"]:e,i=t.initialIndex,a=void 0===i?0:i,c=t.keyLength,u=void 0===c?6:c,f=I();function s(n){E(w,n),w.length=w.entries.length,f.notifyListeners(w.location,w.action)}function h(){return Math.random().toString(36).substr(2,u)}var l=g(a,0,o.length-1),d=o.map(function(n){return C(n,void 0,"string"==typeof n?h():n.key||h())}),v=j;function p(n){var t=g(w.index+n,0,w.entries.length-1),e=w.entries[t];f.confirmTransitionTo(e,"POP",r,function(n){n?s({action:"POP",location:e,index:t}):s()})}var w={length:d.length,action:"POP",location:d[l],index:l,entries:d,createHref:v,push:function(n,t){var o=C(n,t,h(),w.location);f.confirmTransitionTo(o,"PUSH",r,function(n){if(n){var t=w.index+1,e=w.entries.slice(0);e.length>t?e.splice(t,e.length-t,o):e.push(o),s({action:"PUSH",location:o,index:t,entries:e})}})},replace:function(n,t){var e="REPLACE",o=C(n,t,h(),w.location);f.confirmTransitionTo(o,e,r,function(n){n&&(w.entries[w.index]=o,s({action:e,location:o}))})},go:p,goBack:function(){p(-1)},goForward:function(){p(1)},canGo:function(n){var t=w.index+n;return 0<=t&&t<w.entries.length},block:function(n){return void 0===n&&(n=!1),f.setPrompt(n)},listen:function(n){return f.appendListener(n)}};return w},n.createLocation=C,n.locationsAreEqual=function(n,t){return n.pathname===t.pathname&&n.search===t.search&&n.hash===t.hash&&n.key===t.key&&function e(t,o){if(t===o)return!0;if(null==t||null==o)return!1;if(Array.isArray(t))return Array.isArray(o)&&t.length===o.length&&t.every(function(n,t){return e(n,o[t])});if("object"!=typeof t&&"object"!=typeof o)return!1;var n=i(t),r=i(o);return n!==t||r!==o?e(n,r):Object.keys(Object.assign({},t,o)).every(function(n){return e(t[n],o[n])})}(n.state,t.state)},n.parsePath=a,n.createPath=j,Object.defineProperty(n,"__esModule",{value:!0})});
1 +'use strict';
2 +
3 +var printWarning = function() {};
4 +
5 +if (process.env.NODE_ENV !== 'production') {
6 + printWarning = function(format, subs) {
7 + var index = 0;
8 + var message =
9 + 'Warning: ' +
10 + (subs.length > 0
11 + ? format.replace(/%s/g, function() {
12 + return subs[index++];
13 + })
14 + : format);
15 +
16 + if (typeof console !== 'undefined') {
17 + console.error(message);
18 + }
19 +
20 + try {
21 + // --- Welcome to debugging history ---
22 + // This error was thrown as a convenience so that you can use the
23 + // stack trace to find the callsite that triggered this warning.
24 + throw new Error(message);
25 + } catch (e) {}
26 + };
27 +}
28 +
29 +module.exports = function(member) {
30 + printWarning(
31 + 'Please use `require("history").%s` instead of `require("history/%s")`. ' +
32 + 'Support for the latter will be removed in the next major release.',
33 + [member, member]
34 + );
35 +};
1 +# 3.3.2 (January 22, 2020)
2 +- Fix `React.memo` for v16.12+ (#93)
3 +
4 +# 3.3.1 (November 14, 2019)
5 +- Fix for UMD bundle (#85)
6 +- Tooling changes (#83, #84, #87)
7 +
8 +# 3.3.0 (January 23, 2019)
9 +- Prevent hoisting of React.memo statics (#73)
10 +
11 +# 3.2.1 (December 3, 2018)
12 +- Fixed `defaultProps`, `displayName` and `propTypes` being hoisted from `React.forwardRef` to `React.forwardRef`. ([#71])
13 +
14 +# 3.2.0 (November 26, 2018)
15 +- Added support for `getDerivedStateFromError`. ([#68])
16 +- Added support for React versions less than 0.14. ([#69])
17 +
18 +# 3.1.0 (October 30, 2018)
19 +- Added support for `contextType`. ([#62])
20 +- Reduced bundle size. ([e89c7a6])
21 +- Removed TypeScript definitions. ([#61])
22 +
23 +# 3.0.1 (July 28, 2018)
24 +- Fixed prop-types warnings. ([e0846fe])
25 +
26 +# 3.0.0 (July 27, 2018)
27 +- Dropped support for React versions less than 0.14. ([#55])
28 +- Added support for `React.forwardRef` components. ([#55])
29 +
30 +[#55]: https://github.com/mridgway/hoist-non-react-statics/pull/55
31 +[#61]: https://github.com/mridgway/hoist-non-react-statics/pull/61
32 +[#62]: https://github.com/mridgway/hoist-non-react-statics/pull/62
33 +[#68]: https://github.com/mridgway/hoist-non-react-statics/pull/68
34 +[#69]: https://github.com/mridgway/hoist-non-react-statics/pull/69
35 +[#71]: https://github.com/mridgway/hoist-non-react-statics/pull/71
36 +[e0846fe]: https://github.com/mridgway/hoist-non-react-statics/commit/e0846feefbad8b34d300de9966ffd607aacb81a3
37 +[e89c7a6]: https://github.com/mridgway/hoist-non-react-statics/commit/e89c7a6168edc19eeadb2d149e600b888e8b0446
1 +Software License Agreement (BSD License)
2 +========================================
3 +
4 +Copyright (c) 2015, Yahoo! Inc. All rights reserved.
5 +----------------------------------------------------
6 +
7 +Redistribution and use of this software in source and binary forms, with or
8 +without modification, are permitted provided that the following conditions are
9 +met:
10 +
11 + * Redistributions of source code must retain the above copyright notice, this
12 + list of conditions and the following disclaimer.
13 + * Redistributions in binary form must reproduce the above copyright notice,
14 + this list of conditions and the following disclaimer in the documentation
15 + and/or other materials provided with the distribution.
16 + * Neither the name of Yahoo! Inc. nor the names of YUI's contributors may be
17 + used to endorse or promote products derived from this software without
18 + specific prior written permission of Yahoo! Inc.
19 +
20 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24 +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 +# hoist-non-react-statics
2 +
3 +[![NPM version](https://badge.fury.io/js/hoist-non-react-statics.svg)](http://badge.fury.io/js/hoist-non-react-statics)
4 +[![Build Status](https://img.shields.io/travis/mridgway/hoist-non-react-statics.svg)](https://travis-ci.org/mridgway/hoist-non-react-statics)
5 +[![Coverage Status](https://img.shields.io/coveralls/mridgway/hoist-non-react-statics.svg)](https://coveralls.io/r/mridgway/hoist-non-react-statics?branch=master)
6 +[![Dependency Status](https://img.shields.io/david/mridgway/hoist-non-react-statics.svg)](https://david-dm.org/mridgway/hoist-non-react-statics)
7 +[![devDependency Status](https://img.shields.io/david/dev/mridgway/hoist-non-react-statics.svg)](https://david-dm.org/mridgway/hoist-non-react-statics#info=devDependencies)
8 +
9 +Copies non-react specific statics from a child component to a parent component.
10 +Similar to `Object.assign`, but with React static keywords blacklisted from
11 +being overridden.
12 +
13 +```bash
14 +$ npm install --save hoist-non-react-statics
15 +```
16 +
17 +## Usage
18 +
19 +```js
20 +import hoistNonReactStatics from 'hoist-non-react-statics';
21 +
22 +hoistNonReactStatics(targetComponent, sourceComponent);
23 +```
24 +
25 +If you have specific statics that you don't want to be hoisted, you can also pass a third parameter to exclude them:
26 +
27 +```js
28 +hoistNonReactStatics(targetComponent, sourceComponent, { myStatic: true, myOtherStatic: true });
29 +```
30 +
31 +## What does this module do?
32 +
33 +See this [explanation](https://facebook.github.io/react/docs/higher-order-components.html#static-methods-must-be-copied-over) from the React docs.
34 +
35 +## Compatible React Versions
36 +
37 +Please use latest 3.x. Versions prior to 3.x will not support ForwardRefs.
38 +
39 +| hoist-non-react-statics Version | Compatible React Version |
40 +|--------------------------|-------------------------------|
41 +| 3.x | 0.13-16.x With ForwardRef Support |
42 +| 2.x | 0.13-16.x Without ForwardRef Support |
43 +| 1.x | 0.13-16.2 |
44 +
45 +## Browser Support
46 +
47 +This package uses `Object.defineProperty` which has a broken implementation in IE8. In order to use this package in IE8, you will need a polyfill that fixes this method.
48 +
49 +## License
50 +This software is free to use under the Yahoo Inc. BSD license.
51 +See the [LICENSE file][] for license text and copyright information.
52 +
53 +[LICENSE file]: https://github.com/mridgway/hoist-non-react-statics/blob/master/LICENSE.md
54 +
55 +Third-party open source code used are listed in our [package.json file]( https://github.com/mridgway/hoist-non-react-statics/blob/master/package.json).
1 +'use strict';
2 +
3 +var reactIs = require('react-is');
4 +
5 +/**
6 + * Copyright 2015, Yahoo! Inc.
7 + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
8 + */
9 +var REACT_STATICS = {
10 + childContextTypes: true,
11 + contextType: true,
12 + contextTypes: true,
13 + defaultProps: true,
14 + displayName: true,
15 + getDefaultProps: true,
16 + getDerivedStateFromError: true,
17 + getDerivedStateFromProps: true,
18 + mixins: true,
19 + propTypes: true,
20 + type: true
21 +};
22 +var KNOWN_STATICS = {
23 + name: true,
24 + length: true,
25 + prototype: true,
26 + caller: true,
27 + callee: true,
28 + arguments: true,
29 + arity: true
30 +};
31 +var FORWARD_REF_STATICS = {
32 + '$$typeof': true,
33 + render: true,
34 + defaultProps: true,
35 + displayName: true,
36 + propTypes: true
37 +};
38 +var MEMO_STATICS = {
39 + '$$typeof': true,
40 + compare: true,
41 + defaultProps: true,
42 + displayName: true,
43 + propTypes: true,
44 + type: true
45 +};
46 +var TYPE_STATICS = {};
47 +TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
48 +TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
49 +
50 +function getStatics(component) {
51 + // React v16.11 and below
52 + if (reactIs.isMemo(component)) {
53 + return MEMO_STATICS;
54 + } // React v16.12 and above
55 +
56 +
57 + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
58 +}
59 +
60 +var defineProperty = Object.defineProperty;
61 +var getOwnPropertyNames = Object.getOwnPropertyNames;
62 +var getOwnPropertySymbols = Object.getOwnPropertySymbols;
63 +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
64 +var getPrototypeOf = Object.getPrototypeOf;
65 +var objectPrototype = Object.prototype;
66 +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
67 + if (typeof sourceComponent !== 'string') {
68 + // don't hoist over string (html) components
69 + if (objectPrototype) {
70 + var inheritedComponent = getPrototypeOf(sourceComponent);
71 +
72 + if (inheritedComponent && inheritedComponent !== objectPrototype) {
73 + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
74 + }
75 + }
76 +
77 + var keys = getOwnPropertyNames(sourceComponent);
78 +
79 + if (getOwnPropertySymbols) {
80 + keys = keys.concat(getOwnPropertySymbols(sourceComponent));
81 + }
82 +
83 + var targetStatics = getStatics(targetComponent);
84 + var sourceStatics = getStatics(sourceComponent);
85 +
86 + for (var i = 0; i < keys.length; ++i) {
87 + var key = keys[i];
88 +
89 + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
90 + var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
91 +
92 + try {
93 + // Avoid failures from read-only properties
94 + defineProperty(targetComponent, key, descriptor);
95 + } catch (e) {}
96 + }
97 + }
98 + }
99 +
100 + return targetComponent;
101 +}
102 +
103 +module.exports = hoistNonReactStatics;
1 +(function (global, factory) {
2 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 + typeof define === 'function' && define.amd ? define(factory) :
4 + (global = global || self, global.hoistNonReactStatics = factory());
5 +}(this, (function () { 'use strict';
6 +
7 + function unwrapExports (x) {
8 + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9 + }
10 +
11 + function createCommonjsModule(fn, module) {
12 + return module = { exports: {} }, fn(module, module.exports), module.exports;
13 + }
14 +
15 + var reactIs_production_min = createCommonjsModule(function (module, exports) {
16 + Object.defineProperty(exports,"__esModule",{value:!0});
17 + var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
18 + 60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m}
19 + exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
20 + exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h};
21 + exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p};
22 + });
23 +
24 + unwrapExports(reactIs_production_min);
25 + var reactIs_production_min_1 = reactIs_production_min.typeOf;
26 + var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
27 + var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
28 + var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
29 + var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
30 + var reactIs_production_min_6 = reactIs_production_min.Element;
31 + var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
32 + var reactIs_production_min_8 = reactIs_production_min.Fragment;
33 + var reactIs_production_min_9 = reactIs_production_min.Lazy;
34 + var reactIs_production_min_10 = reactIs_production_min.Memo;
35 + var reactIs_production_min_11 = reactIs_production_min.Portal;
36 + var reactIs_production_min_12 = reactIs_production_min.Profiler;
37 + var reactIs_production_min_13 = reactIs_production_min.StrictMode;
38 + var reactIs_production_min_14 = reactIs_production_min.Suspense;
39 + var reactIs_production_min_15 = reactIs_production_min.isValidElementType;
40 + var reactIs_production_min_16 = reactIs_production_min.isAsyncMode;
41 + var reactIs_production_min_17 = reactIs_production_min.isConcurrentMode;
42 + var reactIs_production_min_18 = reactIs_production_min.isContextConsumer;
43 + var reactIs_production_min_19 = reactIs_production_min.isContextProvider;
44 + var reactIs_production_min_20 = reactIs_production_min.isElement;
45 + var reactIs_production_min_21 = reactIs_production_min.isForwardRef;
46 + var reactIs_production_min_22 = reactIs_production_min.isFragment;
47 + var reactIs_production_min_23 = reactIs_production_min.isLazy;
48 + var reactIs_production_min_24 = reactIs_production_min.isMemo;
49 + var reactIs_production_min_25 = reactIs_production_min.isPortal;
50 + var reactIs_production_min_26 = reactIs_production_min.isProfiler;
51 + var reactIs_production_min_27 = reactIs_production_min.isStrictMode;
52 + var reactIs_production_min_28 = reactIs_production_min.isSuspense;
53 +
54 + var reactIs_development = createCommonjsModule(function (module, exports) {
55 +
56 +
57 +
58 + if (process.env.NODE_ENV !== "production") {
59 + (function() {
60 +
61 + Object.defineProperty(exports, '__esModule', { value: true });
62 +
63 + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
64 + // nor polyfill, then a plain number is used for performance.
65 + var hasSymbol = typeof Symbol === 'function' && Symbol.for;
66 + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
67 + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
68 + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
69 + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
70 + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
71 + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
72 + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
73 + // (unstable) APIs that have been removed. Can we remove the symbols?
74 +
75 + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
76 + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
77 + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
78 + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
79 + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
80 + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
81 + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
82 + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
83 + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
84 + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
85 +
86 + function isValidElementType(type) {
87 + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
88 + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
89 + }
90 +
91 + /**
92 + * Forked from fbjs/warning:
93 + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
94 + *
95 + * Only change is we use console.warn instead of console.error,
96 + * and do nothing when 'console' is not supported.
97 + * This really simplifies the code.
98 + * ---
99 + * Similar to invariant but only logs a warning if the condition is not met.
100 + * This can be used to log issues in development environments in critical
101 + * paths. Removing the logging code for production environments will keep the
102 + * same logic and follow the same code paths.
103 + */
104 + var lowPriorityWarningWithoutStack = function () {};
105 +
106 + {
107 + var printWarning = function (format) {
108 + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
109 + args[_key - 1] = arguments[_key];
110 + }
111 +
112 + var argIndex = 0;
113 + var message = 'Warning: ' + format.replace(/%s/g, function () {
114 + return args[argIndex++];
115 + });
116 +
117 + if (typeof console !== 'undefined') {
118 + console.warn(message);
119 + }
120 +
121 + try {
122 + // --- Welcome to debugging React ---
123 + // This error was thrown as a convenience so that you can use this stack
124 + // to find the callsite that caused this warning to fire.
125 + throw new Error(message);
126 + } catch (x) {}
127 + };
128 +
129 + lowPriorityWarningWithoutStack = function (condition, format) {
130 + if (format === undefined) {
131 + throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
132 + }
133 +
134 + if (!condition) {
135 + for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
136 + args[_key2 - 2] = arguments[_key2];
137 + }
138 +
139 + printWarning.apply(void 0, [format].concat(args));
140 + }
141 + };
142 + }
143 +
144 + var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
145 +
146 + function typeOf(object) {
147 + if (typeof object === 'object' && object !== null) {
148 + var $$typeof = object.$$typeof;
149 +
150 + switch ($$typeof) {
151 + case REACT_ELEMENT_TYPE:
152 + var type = object.type;
153 +
154 + switch (type) {
155 + case REACT_ASYNC_MODE_TYPE:
156 + case REACT_CONCURRENT_MODE_TYPE:
157 + case REACT_FRAGMENT_TYPE:
158 + case REACT_PROFILER_TYPE:
159 + case REACT_STRICT_MODE_TYPE:
160 + case REACT_SUSPENSE_TYPE:
161 + return type;
162 +
163 + default:
164 + var $$typeofType = type && type.$$typeof;
165 +
166 + switch ($$typeofType) {
167 + case REACT_CONTEXT_TYPE:
168 + case REACT_FORWARD_REF_TYPE:
169 + case REACT_LAZY_TYPE:
170 + case REACT_MEMO_TYPE:
171 + case REACT_PROVIDER_TYPE:
172 + return $$typeofType;
173 +
174 + default:
175 + return $$typeof;
176 + }
177 +
178 + }
179 +
180 + case REACT_PORTAL_TYPE:
181 + return $$typeof;
182 + }
183 + }
184 +
185 + return undefined;
186 + } // AsyncMode is deprecated along with isAsyncMode
187 +
188 + var AsyncMode = REACT_ASYNC_MODE_TYPE;
189 + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
190 + var ContextConsumer = REACT_CONTEXT_TYPE;
191 + var ContextProvider = REACT_PROVIDER_TYPE;
192 + var Element = REACT_ELEMENT_TYPE;
193 + var ForwardRef = REACT_FORWARD_REF_TYPE;
194 + var Fragment = REACT_FRAGMENT_TYPE;
195 + var Lazy = REACT_LAZY_TYPE;
196 + var Memo = REACT_MEMO_TYPE;
197 + var Portal = REACT_PORTAL_TYPE;
198 + var Profiler = REACT_PROFILER_TYPE;
199 + var StrictMode = REACT_STRICT_MODE_TYPE;
200 + var Suspense = REACT_SUSPENSE_TYPE;
201 + var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
202 +
203 + function isAsyncMode(object) {
204 + {
205 + if (!hasWarnedAboutDeprecatedIsAsyncMode) {
206 + hasWarnedAboutDeprecatedIsAsyncMode = true;
207 + lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
208 + }
209 + }
210 +
211 + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
212 + }
213 + function isConcurrentMode(object) {
214 + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
215 + }
216 + function isContextConsumer(object) {
217 + return typeOf(object) === REACT_CONTEXT_TYPE;
218 + }
219 + function isContextProvider(object) {
220 + return typeOf(object) === REACT_PROVIDER_TYPE;
221 + }
222 + function isElement(object) {
223 + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
224 + }
225 + function isForwardRef(object) {
226 + return typeOf(object) === REACT_FORWARD_REF_TYPE;
227 + }
228 + function isFragment(object) {
229 + return typeOf(object) === REACT_FRAGMENT_TYPE;
230 + }
231 + function isLazy(object) {
232 + return typeOf(object) === REACT_LAZY_TYPE;
233 + }
234 + function isMemo(object) {
235 + return typeOf(object) === REACT_MEMO_TYPE;
236 + }
237 + function isPortal(object) {
238 + return typeOf(object) === REACT_PORTAL_TYPE;
239 + }
240 + function isProfiler(object) {
241 + return typeOf(object) === REACT_PROFILER_TYPE;
242 + }
243 + function isStrictMode(object) {
244 + return typeOf(object) === REACT_STRICT_MODE_TYPE;
245 + }
246 + function isSuspense(object) {
247 + return typeOf(object) === REACT_SUSPENSE_TYPE;
248 + }
249 +
250 + exports.typeOf = typeOf;
251 + exports.AsyncMode = AsyncMode;
252 + exports.ConcurrentMode = ConcurrentMode;
253 + exports.ContextConsumer = ContextConsumer;
254 + exports.ContextProvider = ContextProvider;
255 + exports.Element = Element;
256 + exports.ForwardRef = ForwardRef;
257 + exports.Fragment = Fragment;
258 + exports.Lazy = Lazy;
259 + exports.Memo = Memo;
260 + exports.Portal = Portal;
261 + exports.Profiler = Profiler;
262 + exports.StrictMode = StrictMode;
263 + exports.Suspense = Suspense;
264 + exports.isValidElementType = isValidElementType;
265 + exports.isAsyncMode = isAsyncMode;
266 + exports.isConcurrentMode = isConcurrentMode;
267 + exports.isContextConsumer = isContextConsumer;
268 + exports.isContextProvider = isContextProvider;
269 + exports.isElement = isElement;
270 + exports.isForwardRef = isForwardRef;
271 + exports.isFragment = isFragment;
272 + exports.isLazy = isLazy;
273 + exports.isMemo = isMemo;
274 + exports.isPortal = isPortal;
275 + exports.isProfiler = isProfiler;
276 + exports.isStrictMode = isStrictMode;
277 + exports.isSuspense = isSuspense;
278 + })();
279 + }
280 + });
281 +
282 + unwrapExports(reactIs_development);
283 + var reactIs_development_1 = reactIs_development.typeOf;
284 + var reactIs_development_2 = reactIs_development.AsyncMode;
285 + var reactIs_development_3 = reactIs_development.ConcurrentMode;
286 + var reactIs_development_4 = reactIs_development.ContextConsumer;
287 + var reactIs_development_5 = reactIs_development.ContextProvider;
288 + var reactIs_development_6 = reactIs_development.Element;
289 + var reactIs_development_7 = reactIs_development.ForwardRef;
290 + var reactIs_development_8 = reactIs_development.Fragment;
291 + var reactIs_development_9 = reactIs_development.Lazy;
292 + var reactIs_development_10 = reactIs_development.Memo;
293 + var reactIs_development_11 = reactIs_development.Portal;
294 + var reactIs_development_12 = reactIs_development.Profiler;
295 + var reactIs_development_13 = reactIs_development.StrictMode;
296 + var reactIs_development_14 = reactIs_development.Suspense;
297 + var reactIs_development_15 = reactIs_development.isValidElementType;
298 + var reactIs_development_16 = reactIs_development.isAsyncMode;
299 + var reactIs_development_17 = reactIs_development.isConcurrentMode;
300 + var reactIs_development_18 = reactIs_development.isContextConsumer;
301 + var reactIs_development_19 = reactIs_development.isContextProvider;
302 + var reactIs_development_20 = reactIs_development.isElement;
303 + var reactIs_development_21 = reactIs_development.isForwardRef;
304 + var reactIs_development_22 = reactIs_development.isFragment;
305 + var reactIs_development_23 = reactIs_development.isLazy;
306 + var reactIs_development_24 = reactIs_development.isMemo;
307 + var reactIs_development_25 = reactIs_development.isPortal;
308 + var reactIs_development_26 = reactIs_development.isProfiler;
309 + var reactIs_development_27 = reactIs_development.isStrictMode;
310 + var reactIs_development_28 = reactIs_development.isSuspense;
311 +
312 + var reactIs = createCommonjsModule(function (module) {
313 +
314 + if (process.env.NODE_ENV === 'production') {
315 + module.exports = reactIs_production_min;
316 + } else {
317 + module.exports = reactIs_development;
318 + }
319 + });
320 + var reactIs_1 = reactIs.typeOf;
321 + var reactIs_2 = reactIs.AsyncMode;
322 + var reactIs_3 = reactIs.ConcurrentMode;
323 + var reactIs_4 = reactIs.ContextConsumer;
324 + var reactIs_5 = reactIs.ContextProvider;
325 + var reactIs_6 = reactIs.Element;
326 + var reactIs_7 = reactIs.ForwardRef;
327 + var reactIs_8 = reactIs.Fragment;
328 + var reactIs_9 = reactIs.Lazy;
329 + var reactIs_10 = reactIs.Memo;
330 + var reactIs_11 = reactIs.Portal;
331 + var reactIs_12 = reactIs.Profiler;
332 + var reactIs_13 = reactIs.StrictMode;
333 + var reactIs_14 = reactIs.Suspense;
334 + var reactIs_15 = reactIs.isValidElementType;
335 + var reactIs_16 = reactIs.isAsyncMode;
336 + var reactIs_17 = reactIs.isConcurrentMode;
337 + var reactIs_18 = reactIs.isContextConsumer;
338 + var reactIs_19 = reactIs.isContextProvider;
339 + var reactIs_20 = reactIs.isElement;
340 + var reactIs_21 = reactIs.isForwardRef;
341 + var reactIs_22 = reactIs.isFragment;
342 + var reactIs_23 = reactIs.isLazy;
343 + var reactIs_24 = reactIs.isMemo;
344 + var reactIs_25 = reactIs.isPortal;
345 + var reactIs_26 = reactIs.isProfiler;
346 + var reactIs_27 = reactIs.isStrictMode;
347 + var reactIs_28 = reactIs.isSuspense;
348 +
349 + /**
350 + * Copyright 2015, Yahoo! Inc.
351 + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
352 + */
353 + var REACT_STATICS = {
354 + childContextTypes: true,
355 + contextType: true,
356 + contextTypes: true,
357 + defaultProps: true,
358 + displayName: true,
359 + getDefaultProps: true,
360 + getDerivedStateFromError: true,
361 + getDerivedStateFromProps: true,
362 + mixins: true,
363 + propTypes: true,
364 + type: true
365 + };
366 + var KNOWN_STATICS = {
367 + name: true,
368 + length: true,
369 + prototype: true,
370 + caller: true,
371 + callee: true,
372 + arguments: true,
373 + arity: true
374 + };
375 + var FORWARD_REF_STATICS = {
376 + '$$typeof': true,
377 + render: true,
378 + defaultProps: true,
379 + displayName: true,
380 + propTypes: true
381 + };
382 + var MEMO_STATICS = {
383 + '$$typeof': true,
384 + compare: true,
385 + defaultProps: true,
386 + displayName: true,
387 + propTypes: true,
388 + type: true
389 + };
390 + var TYPE_STATICS = {};
391 + TYPE_STATICS[reactIs_7] = FORWARD_REF_STATICS;
392 + TYPE_STATICS[reactIs_10] = MEMO_STATICS;
393 +
394 + function getStatics(component) {
395 + // React v16.11 and below
396 + if (reactIs_24(component)) {
397 + return MEMO_STATICS;
398 + } // React v16.12 and above
399 +
400 +
401 + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
402 + }
403 +
404 + var defineProperty = Object.defineProperty;
405 + var getOwnPropertyNames = Object.getOwnPropertyNames;
406 + var getOwnPropertySymbols = Object.getOwnPropertySymbols;
407 + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
408 + var getPrototypeOf = Object.getPrototypeOf;
409 + var objectPrototype = Object.prototype;
410 + function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
411 + if (typeof sourceComponent !== 'string') {
412 + // don't hoist over string (html) components
413 + if (objectPrototype) {
414 + var inheritedComponent = getPrototypeOf(sourceComponent);
415 +
416 + if (inheritedComponent && inheritedComponent !== objectPrototype) {
417 + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
418 + }
419 + }
420 +
421 + var keys = getOwnPropertyNames(sourceComponent);
422 +
423 + if (getOwnPropertySymbols) {
424 + keys = keys.concat(getOwnPropertySymbols(sourceComponent));
425 + }
426 +
427 + var targetStatics = getStatics(targetComponent);
428 + var sourceStatics = getStatics(sourceComponent);
429 +
430 + for (var i = 0; i < keys.length; ++i) {
431 + var key = keys[i];
432 +
433 + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
434 + var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
435 +
436 + try {
437 + // Avoid failures from read-only properties
438 + defineProperty(targetComponent, key, descriptor);
439 + } catch (e) {}
440 + }
441 + }
442 + }
443 +
444 + return targetComponent;
445 + }
446 +
447 + return hoistNonReactStatics;
448 +
449 +})));
1 +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).hoistNonReactStatics=t()}(this,(function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,f=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,i=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,y=r?Symbol.for("react.concurrent_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,d=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,S=r?Symbol.for("react.fundamental"):60117,$=r?Symbol.for("react.responder"):60118,v=r?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case u:case y:case c:case f:case a:case p:return e;default:switch(e=e&&e.$$typeof){case i:case l:case b:case d:case s:return e;default:return t}}case n:return t}}}function P(e){return g(e)===y}t.typeOf=g,t.AsyncMode=u,t.ConcurrentMode=y,t.ContextConsumer=i,t.ContextProvider=s,t.Element=o,t.ForwardRef=l,t.Fragment=c,t.Lazy=b,t.Memo=d,t.Portal=n,t.Profiler=f,t.StrictMode=a,t.Suspense=p,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===y||e===f||e===a||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===d||e.$$typeof===s||e.$$typeof===i||e.$$typeof===l||e.$$typeof===S||e.$$typeof===$||e.$$typeof===v)},t.isAsyncMode=function(e){return P(e)||g(e)===u},t.isConcurrentMode=P,t.isContextConsumer=function(e){return g(e)===i},t.isContextProvider=function(e){return g(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return g(e)===l},t.isFragment=function(e){return g(e)===c},t.isLazy=function(e){return g(e)===b},t.isMemo=function(e){return g(e)===d},t.isPortal=function(e){return g(e)===n},t.isProfiler=function(e){return g(e)===f},t.isStrictMode=function(e){return g(e)===a},t.isSuspense=function(e){return g(e)===p}}));e(r);var o=t((function(e,t){"production"!==process.env.NODE_ENV&&function(){Object.defineProperty(t,"__esModule",{value:!0});var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,c=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,i=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,y=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,$=e?Symbol.for("react.scope"):60119;var v=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];var n=0,c="Warning: "+e.replace(/%s/g,(function(){return r[n++]}));void 0!==console&&console.warn(c);try{throw Error(c)}catch(e){}},g=function(e,t){if(void 0===t)throw Error("`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning message argument");if(!e){for(var r=arguments.length,o=Array(r>2?r-2:0),n=2;r>n;n++)o[n-2]=arguments[n];v.apply(void 0,[t].concat(o))}};function P(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var p=e.type;switch(p){case i:case u:case n:case a:case c:case l:return p;default:var b=p&&p.$$typeof;switch(b){case s:case y:case d:case m:case f:return b;default:return t}}case o:return t}}}var h=i,w=u,M=s,x=f,C=r,O=y,_=n,j=d,E=m,F=o,N=a,R=c,T=l,A=!1;function z(e){return P(e)===u}t.typeOf=P,t.AsyncMode=h,t.ConcurrentMode=w,t.ContextConsumer=M,t.ContextProvider=x,t.Element=C,t.ForwardRef=O,t.Fragment=_,t.Lazy=j,t.Memo=E,t.Portal=F,t.Profiler=N,t.StrictMode=R,t.Suspense=T,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===a||e===c||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===m||e.$$typeof===f||e.$$typeof===s||e.$$typeof===y||e.$$typeof===b||e.$$typeof===S||e.$$typeof===$)},t.isAsyncMode=function(e){return A||(A=!0,g(!1,"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),z(e)||P(e)===i},t.isConcurrentMode=z,t.isContextConsumer=function(e){return P(e)===s},t.isContextProvider=function(e){return P(e)===f},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return P(e)===y},t.isFragment=function(e){return P(e)===n},t.isLazy=function(e){return P(e)===d},t.isMemo=function(e){return P(e)===m},t.isPortal=function(e){return P(e)===o},t.isProfiler=function(e){return P(e)===a},t.isStrictMode=function(e){return P(e)===c},t.isSuspense=function(e){return P(e)===l}}()}));e(o);var n=t((function(e){e.exports="production"===process.env.NODE_ENV?r:o})),c=n.Memo,a=n.isMemo,f={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function y(e){return a(e)?i:u[e.$$typeof]||f}u[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[c]=i;var l=Object.defineProperty,p=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,S=Object.prototype;return function e(t,r,o){if("string"!=typeof r){if(S){var n=b(r);n&&n!==S&&e(t,n,o)}var c=p(r);m&&(c=c.concat(m(r)));for(var a=y(t),f=y(r),i=0;c.length>i;++i){var u=c[i];if(!(s[u]||o&&o[u]||f&&f[u]||a&&a[u])){var $=d(r,u);try{l(t,u,$)}catch(e){}}}}return t}}));
1 +{
2 + "_from": "hoist-non-react-statics@^3.1.0",
3 + "_id": "hoist-non-react-statics@3.3.2",
4 + "_inBundle": false,
5 + "_integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
6 + "_location": "/hoist-non-react-statics",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "hoist-non-react-statics@^3.1.0",
12 + "name": "hoist-non-react-statics",
13 + "escapedName": "hoist-non-react-statics",
14 + "rawSpec": "^3.1.0",
15 + "saveSpec": null,
16 + "fetchSpec": "^3.1.0"
17 + },
18 + "_requiredBy": [
19 + "/react-router"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
22 + "_shasum": "ece0acaf71d62c2969c2ec59feff42a4b1a85b45",
23 + "_spec": "hoist-non-react-statics@^3.1.0",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router",
25 + "author": {
26 + "name": "Michael Ridgway",
27 + "email": "mcridgway@gmail.com"
28 + },
29 + "bugs": {
30 + "url": "https://github.com/mridgway/hoist-non-react-statics/issues"
31 + },
32 + "bundleDependencies": false,
33 + "dependencies": {
34 + "react-is": "^16.7.0"
35 + },
36 + "deprecated": false,
37 + "description": "Copies non-react specific statics from a child component to a parent component",
38 + "devDependencies": {
39 + "@babel/core": "^7.5.0",
40 + "@babel/plugin-proposal-class-properties": "^7.5.0",
41 + "@babel/preset-env": "^7.5.0",
42 + "@babel/preset-react": "^7.0.0",
43 + "@babel/register": "^7.4.4",
44 + "chai": "^4.2.0",
45 + "coveralls": "^2.11.1",
46 + "create-react-class": "^15.5.3",
47 + "eslint": "^4.13.1",
48 + "mocha": "^6.1.4",
49 + "nyc": "^14.1.1",
50 + "pre-commit": "^1.0.7",
51 + "prop-types": "^15.6.2",
52 + "react": "^16.7.0",
53 + "rimraf": "^2.6.2",
54 + "rollup": "^1.16.6",
55 + "rollup-plugin-babel": "^4.3.3",
56 + "rollup-plugin-commonjs": "^10.0.1",
57 + "rollup-plugin-node-resolve": "^5.2.0",
58 + "rollup-plugin-terser": "^5.1.1"
59 + },
60 + "files": [
61 + "src",
62 + "dist",
63 + "index.d.ts"
64 + ],
65 + "homepage": "https://github.com/mridgway/hoist-non-react-statics#readme",
66 + "keywords": [
67 + "react"
68 + ],
69 + "license": "BSD-3-Clause",
70 + "main": "dist/hoist-non-react-statics.cjs.js",
71 + "name": "hoist-non-react-statics",
72 + "publishConfig": {
73 + "registry": "https://registry.npmjs.org/"
74 + },
75 + "repository": {
76 + "type": "git",
77 + "url": "git://github.com/mridgway/hoist-non-react-statics.git"
78 + },
79 + "scripts": {
80 + "build": "rimraf dist && rollup -c",
81 + "coverage": "nyc report --reporter=text-lcov | coveralls",
82 + "lint": "eslint src",
83 + "prepublish": "npm test",
84 + "test": "nyc mocha tests/unit/ --recursive --reporter spec --require=@babel/register"
85 + },
86 + "version": "3.3.2"
87 +}
1 +/**
2 + * Copyright 2015, Yahoo! Inc.
3 + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
4 + */
5 +import { ForwardRef, Memo, isMemo } from 'react-is';
6 +
7 +const REACT_STATICS = {
8 + childContextTypes: true,
9 + contextType: true,
10 + contextTypes: true,
11 + defaultProps: true,
12 + displayName: true,
13 + getDefaultProps: true,
14 + getDerivedStateFromError: true,
15 + getDerivedStateFromProps: true,
16 + mixins: true,
17 + propTypes: true,
18 + type: true
19 +};
20 +
21 +const KNOWN_STATICS = {
22 + name: true,
23 + length: true,
24 + prototype: true,
25 + caller: true,
26 + callee: true,
27 + arguments: true,
28 + arity: true
29 +};
30 +
31 +const FORWARD_REF_STATICS = {
32 + '$$typeof': true,
33 + render: true,
34 + defaultProps: true,
35 + displayName: true,
36 + propTypes: true
37 +};
38 +
39 +const MEMO_STATICS = {
40 + '$$typeof': true,
41 + compare: true,
42 + defaultProps: true,
43 + displayName: true,
44 + propTypes: true,
45 + type: true,
46 +}
47 +
48 +const TYPE_STATICS = {};
49 +TYPE_STATICS[ForwardRef] = FORWARD_REF_STATICS;
50 +TYPE_STATICS[Memo] = MEMO_STATICS;
51 +
52 +function getStatics(component) {
53 + // React v16.11 and below
54 + if (isMemo(component)) {
55 + return MEMO_STATICS;
56 + }
57 +
58 + // React v16.12 and above
59 + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
60 +}
61 +
62 +const defineProperty = Object.defineProperty;
63 +const getOwnPropertyNames = Object.getOwnPropertyNames;
64 +const getOwnPropertySymbols = Object.getOwnPropertySymbols;
65 +const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
66 +const getPrototypeOf = Object.getPrototypeOf;
67 +const objectPrototype = Object.prototype;
68 +
69 +export default function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
70 + if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
71 +
72 + if (objectPrototype) {
73 + const inheritedComponent = getPrototypeOf(sourceComponent);
74 + if (inheritedComponent && inheritedComponent !== objectPrototype) {
75 + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
76 + }
77 + }
78 +
79 + let keys = getOwnPropertyNames(sourceComponent);
80 +
81 + if (getOwnPropertySymbols) {
82 + keys = keys.concat(getOwnPropertySymbols(sourceComponent));
83 + }
84 +
85 + const targetStatics = getStatics(targetComponent);
86 + const sourceStatics = getStatics(sourceComponent);
87 +
88 + for (let i = 0; i < keys.length; ++i) {
89 + const key = keys[i];
90 + if (!KNOWN_STATICS[key] &&
91 + !(blacklist && blacklist[key]) &&
92 + !(sourceStatics && sourceStatics[key]) &&
93 + !(targetStatics && targetStatics[key])
94 + ) {
95 + const descriptor = getOwnPropertyDescriptor(sourceComponent, key);
96 + try { // Avoid failures from read-only properties
97 + defineProperty(targetComponent, key, descriptor);
98 + } catch (e) {}
99 + }
100 + }
101 + }
102 +
103 + return targetComponent;
104 +};
1 +
2 +# isarray
3 +
4 +`Array#isArray` for older browsers.
5 +
6 +## Usage
7 +
8 +```js
9 +var isArray = require('isarray');
10 +
11 +console.log(isArray([])); // => true
12 +console.log(isArray({})); // => false
13 +```
14 +
15 +## Installation
16 +
17 +With [npm](http://npmjs.org) do
18 +
19 +```bash
20 +$ npm install isarray
21 +```
22 +
23 +Then bundle for the browser with
24 +[browserify](https://github.com/substack/browserify).
25 +
26 +With [component](http://component.io) do
27 +
28 +```bash
29 +$ component install juliangruber/isarray
30 +```
31 +
32 +## License
33 +
34 +(MIT)
35 +
36 +Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
37 +
38 +Permission is hereby granted, free of charge, to any person obtaining a copy of
39 +this software and associated documentation files (the "Software"), to deal in
40 +the Software without restriction, including without limitation the rights to
41 +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
42 +of the Software, and to permit persons to whom the Software is furnished to do
43 +so, subject to the following conditions:
44 +
45 +The above copyright notice and this permission notice shall be included in all
46 +copies or substantial portions of the Software.
47 +
48 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
51 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
53 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54 +SOFTWARE.
1 +
2 +/**
3 + * Require the given path.
4 + *
5 + * @param {String} path
6 + * @return {Object} exports
7 + * @api public
8 + */
9 +
10 +function require(path, parent, orig) {
11 + var resolved = require.resolve(path);
12 +
13 + // lookup failed
14 + if (null == resolved) {
15 + orig = orig || path;
16 + parent = parent || 'root';
17 + var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
18 + err.path = orig;
19 + err.parent = parent;
20 + err.require = true;
21 + throw err;
22 + }
23 +
24 + var module = require.modules[resolved];
25 +
26 + // perform real require()
27 + // by invoking the module's
28 + // registered function
29 + if (!module.exports) {
30 + module.exports = {};
31 + module.client = module.component = true;
32 + module.call(this, module.exports, require.relative(resolved), module);
33 + }
34 +
35 + return module.exports;
36 +}
37 +
38 +/**
39 + * Registered modules.
40 + */
41 +
42 +require.modules = {};
43 +
44 +/**
45 + * Registered aliases.
46 + */
47 +
48 +require.aliases = {};
49 +
50 +/**
51 + * Resolve `path`.
52 + *
53 + * Lookup:
54 + *
55 + * - PATH/index.js
56 + * - PATH.js
57 + * - PATH
58 + *
59 + * @param {String} path
60 + * @return {String} path or null
61 + * @api private
62 + */
63 +
64 +require.resolve = function(path) {
65 + if (path.charAt(0) === '/') path = path.slice(1);
66 + var index = path + '/index.js';
67 +
68 + var paths = [
69 + path,
70 + path + '.js',
71 + path + '.json',
72 + path + '/index.js',
73 + path + '/index.json'
74 + ];
75 +
76 + for (var i = 0; i < paths.length; i++) {
77 + var path = paths[i];
78 + if (require.modules.hasOwnProperty(path)) return path;
79 + }
80 +
81 + if (require.aliases.hasOwnProperty(index)) {
82 + return require.aliases[index];
83 + }
84 +};
85 +
86 +/**
87 + * Normalize `path` relative to the current path.
88 + *
89 + * @param {String} curr
90 + * @param {String} path
91 + * @return {String}
92 + * @api private
93 + */
94 +
95 +require.normalize = function(curr, path) {
96 + var segs = [];
97 +
98 + if ('.' != path.charAt(0)) return path;
99 +
100 + curr = curr.split('/');
101 + path = path.split('/');
102 +
103 + for (var i = 0; i < path.length; ++i) {
104 + if ('..' == path[i]) {
105 + curr.pop();
106 + } else if ('.' != path[i] && '' != path[i]) {
107 + segs.push(path[i]);
108 + }
109 + }
110 +
111 + return curr.concat(segs).join('/');
112 +};
113 +
114 +/**
115 + * Register module at `path` with callback `definition`.
116 + *
117 + * @param {String} path
118 + * @param {Function} definition
119 + * @api private
120 + */
121 +
122 +require.register = function(path, definition) {
123 + require.modules[path] = definition;
124 +};
125 +
126 +/**
127 + * Alias a module definition.
128 + *
129 + * @param {String} from
130 + * @param {String} to
131 + * @api private
132 + */
133 +
134 +require.alias = function(from, to) {
135 + if (!require.modules.hasOwnProperty(from)) {
136 + throw new Error('Failed to alias "' + from + '", it does not exist');
137 + }
138 + require.aliases[to] = from;
139 +};
140 +
141 +/**
142 + * Return a require function relative to the `parent` path.
143 + *
144 + * @param {String} parent
145 + * @return {Function}
146 + * @api private
147 + */
148 +
149 +require.relative = function(parent) {
150 + var p = require.normalize(parent, '..');
151 +
152 + /**
153 + * lastIndexOf helper.
154 + */
155 +
156 + function lastIndexOf(arr, obj) {
157 + var i = arr.length;
158 + while (i--) {
159 + if (arr[i] === obj) return i;
160 + }
161 + return -1;
162 + }
163 +
164 + /**
165 + * The relative require() itself.
166 + */
167 +
168 + function localRequire(path) {
169 + var resolved = localRequire.resolve(path);
170 + return require(resolved, parent, path);
171 + }
172 +
173 + /**
174 + * Resolve relative to the parent.
175 + */
176 +
177 + localRequire.resolve = function(path) {
178 + var c = path.charAt(0);
179 + if ('/' == c) return path.slice(1);
180 + if ('.' == c) return require.normalize(p, path);
181 +
182 + // resolve deps by returning
183 + // the dep in the nearest "deps"
184 + // directory
185 + var segs = parent.split('/');
186 + var i = lastIndexOf(segs, 'deps') + 1;
187 + if (!i) i = 0;
188 + path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
189 + return path;
190 + };
191 +
192 + /**
193 + * Check if module is defined at `path`.
194 + */
195 +
196 + localRequire.exists = function(path) {
197 + return require.modules.hasOwnProperty(localRequire.resolve(path));
198 + };
199 +
200 + return localRequire;
201 +};
202 +require.register("isarray/index.js", function(exports, require, module){
203 +module.exports = Array.isArray || function (arr) {
204 + return Object.prototype.toString.call(arr) == '[object Array]';
205 +};
206 +
207 +});
208 +require.alias("isarray/index.js", "isarray/index.js");
209 +
1 +{
2 + "name" : "isarray",
3 + "description" : "Array#isArray for older browsers",
4 + "version" : "0.0.1",
5 + "repository" : "juliangruber/isarray",
6 + "homepage": "https://github.com/juliangruber/isarray",
7 + "main" : "index.js",
8 + "scripts" : [
9 + "index.js"
10 + ],
11 + "dependencies" : {},
12 + "keywords": ["browser","isarray","array"],
13 + "author": {
14 + "name": "Julian Gruber",
15 + "email": "mail@juliangruber.com",
16 + "url": "http://juliangruber.com"
17 + },
18 + "license": "MIT"
19 +}
1 +module.exports = Array.isArray || function (arr) {
2 + return Object.prototype.toString.call(arr) == '[object Array]';
3 +};
1 +{
2 + "_from": "isarray@0.0.1",
3 + "_id": "isarray@0.0.1",
4 + "_inBundle": false,
5 + "_integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
6 + "_location": "/isarray",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "version",
10 + "registry": true,
11 + "raw": "isarray@0.0.1",
12 + "name": "isarray",
13 + "escapedName": "isarray",
14 + "rawSpec": "0.0.1",
15 + "saveSpec": null,
16 + "fetchSpec": "0.0.1"
17 + },
18 + "_requiredBy": [
19 + "/path-to-regexp"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
22 + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
23 + "_spec": "isarray@0.0.1",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\path-to-regexp",
25 + "author": {
26 + "name": "Julian Gruber",
27 + "email": "mail@juliangruber.com",
28 + "url": "http://juliangruber.com"
29 + },
30 + "bugs": {
31 + "url": "https://github.com/juliangruber/isarray/issues"
32 + },
33 + "bundleDependencies": false,
34 + "dependencies": {},
35 + "deprecated": false,
36 + "description": "Array#isArray for older browsers",
37 + "devDependencies": {
38 + "tap": "*"
39 + },
40 + "homepage": "https://github.com/juliangruber/isarray",
41 + "keywords": [
42 + "browser",
43 + "isarray",
44 + "array"
45 + ],
46 + "license": "MIT",
47 + "main": "index.js",
48 + "name": "isarray",
49 + "repository": {
50 + "type": "git",
51 + "url": "git://github.com/juliangruber/isarray.git"
52 + },
53 + "scripts": {
54 + "test": "tap test/*.js"
55 + },
56 + "version": "0.0.1"
57 +}
1 +### Version 4.0.0 (2018-01-28) ###
2 +
3 +- Added: Support for ES2018. The only change needed was recognizing the `s`
4 + regex flag.
5 +- Changed: _All_ tokens returned by the `matchToToken` function now have a
6 + `closed` property. It is set to `undefined` for the tokens where “closed”
7 + doesn’t make sense. This means that all tokens objects have the same shape,
8 + which might improve performance.
9 +
10 +These are the breaking changes:
11 +
12 +- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but
13 + `['/a/s']`. (There are of course other variations of this.)
14 +- Code that rely on some token objects not having the `closed` property could
15 + now behave differently.
16 +
17 +
18 +### Version 3.0.2 (2017-06-28) ###
19 +
20 +- No code changes. Just updates to the readme.
21 +
22 +
23 +### Version 3.0.1 (2017-01-30) ###
24 +
25 +- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched
26 + correctly.
27 +
28 +
29 +### Version 3.0.0 (2017-01-11) ###
30 +
31 +This release contains one breaking change, that should [improve performance in
32 +V8][v8-perf]:
33 +
34 +> So how can you, as a JavaScript developer, ensure that your RegExps are fast?
35 +> If you are not interested in hooking into RegExp internals, make sure that
36 +> neither the RegExp instance, nor its prototype is modified in order to get the
37 +> best performance:
38 +>
39 +> ```js
40 +> var re = /./g;
41 +> re.exec(''); // Fast path.
42 +> re.new_property = 'slow';
43 +> ```
44 +
45 +This module used to export a single regex, with `.matchToToken` bolted
46 +on, just like in the above example. This release changes the exports of
47 +the module to avoid this issue.
48 +
49 +Before:
50 +
51 +```js
52 +import jsTokens from "js-tokens"
53 +// or:
54 +var jsTokens = require("js-tokens")
55 +var matchToToken = jsTokens.matchToToken
56 +```
57 +
58 +After:
59 +
60 +```js
61 +import jsTokens, {matchToToken} from "js-tokens"
62 +// or:
63 +var jsTokens = require("js-tokens").default
64 +var matchToToken = require("js-tokens").matchToToken
65 +```
66 +
67 +[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html
68 +
69 +
70 +### Version 2.0.0 (2016-06-19) ###
71 +
72 +- Added: Support for ES2016. In other words, support for the `**` exponentiation
73 + operator.
74 +
75 +These are the breaking changes:
76 +
77 +- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`.
78 +- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`.
79 +
80 +
81 +### Version 1.0.3 (2016-03-27) ###
82 +
83 +- Improved: Made the regex ever so slightly smaller.
84 +- Updated: The readme.
85 +
86 +
87 +### Version 1.0.2 (2015-10-18) ###
88 +
89 +- Improved: Limited npm package contents for a smaller download. Thanks to
90 + @zertosh!
91 +
92 +
93 +### Version 1.0.1 (2015-06-20) ###
94 +
95 +- Fixed: Declared an undeclared variable.
96 +
97 +
98 +### Version 1.0.0 (2015-02-26) ###
99 +
100 +- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That
101 + type is now equivalent to the Punctuator token in the ECMAScript
102 + specification. (Backwards-incompatible change.)
103 +- Fixed: A `-` followed by a number is now correctly matched as a punctuator
104 + followed by a number. It used to be matched as just a number, but there is no
105 + such thing as negative number literals. (Possibly backwards-incompatible
106 + change.)
107 +
108 +
109 +### Version 0.4.1 (2015-02-21) ###
110 +
111 +- Added: Support for the regex `u` flag.
112 +
113 +
114 +### Version 0.4.0 (2015-02-21) ###
115 +
116 +- Improved: `jsTokens.matchToToken` performance.
117 +- Added: Support for octal and binary number literals.
118 +- Added: Support for template strings.
119 +
120 +
121 +### Version 0.3.1 (2015-01-06) ###
122 +
123 +- Fixed: Support for unicode spaces. They used to be allowed in names (which is
124 + very confusing), and some unicode newlines were wrongly allowed in strings and
125 + regexes.
126 +
127 +
128 +### Version 0.3.0 (2014-12-19) ###
129 +
130 +- Changed: The `jsTokens.names` array has been replaced with the
131 + `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no
132 + longer part of the public API; instead use said function. See this [gist] for
133 + an example. (Backwards-incompatible change.)
134 +- Changed: The empty string is now considered an “invalid” token, instead an
135 + “empty” token (its own group). (Backwards-incompatible change.)
136 +- Removed: component support. (Backwards-incompatible change.)
137 +
138 +[gist]: https://gist.github.com/lydell/be49dbf80c382c473004
139 +
140 +
141 +### Version 0.2.0 (2014-06-19) ###
142 +
143 +- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own
144 + category (“functionArrow”), for simplicity. (Backwards-incompatible change.)
145 +- Added: ES6 splats (`...`) are now matched as an operator (instead of three
146 + punctuations). (Backwards-incompatible change.)
147 +
148 +
149 +### Version 0.1.0 (2014-03-08) ###
150 +
151 +- Initial release.
1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.
1 +Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens)
2 +========
3 +
4 +A regex that tokenizes JavaScript.
5 +
6 +```js
7 +var jsTokens = require("js-tokens").default
8 +
9 +var jsString = "var foo=opts.foo;\n..."
10 +
11 +jsString.match(jsTokens)
12 +// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...]
13 +```
14 +
15 +
16 +Installation
17 +============
18 +
19 +`npm install js-tokens`
20 +
21 +```js
22 +import jsTokens from "js-tokens"
23 +// or:
24 +var jsTokens = require("js-tokens").default
25 +```
26 +
27 +
28 +Usage
29 +=====
30 +
31 +### `jsTokens` ###
32 +
33 +A regex with the `g` flag that matches JavaScript tokens.
34 +
35 +The regex _always_ matches, even invalid JavaScript and the empty string.
36 +
37 +The next match is always directly after the previous.
38 +
39 +### `var token = matchToToken(match)` ###
40 +
41 +```js
42 +import {matchToToken} from "js-tokens"
43 +// or:
44 +var matchToToken = require("js-tokens").matchToToken
45 +```
46 +
47 +Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type:
48 +String, value: String}` object. The following types are available:
49 +
50 +- string
51 +- comment
52 +- regex
53 +- number
54 +- name
55 +- punctuator
56 +- whitespace
57 +- invalid
58 +
59 +Multi-line comments and strings also have a `closed` property indicating if the
60 +token was closed or not (see below).
61 +
62 +Comments and strings both come in several flavors. To distinguish them, check if
63 +the token starts with `//`, `/*`, `'`, `"` or `` ` ``.
64 +
65 +Names are ECMAScript IdentifierNames, that is, including both identifiers and
66 +keywords. You may use [is-keyword-js] to tell them apart.
67 +
68 +Whitespace includes both line terminators and other whitespace.
69 +
70 +[is-keyword-js]: https://github.com/crissdev/is-keyword-js
71 +
72 +
73 +ECMAScript support
74 +==================
75 +
76 +The intention is to always support the latest ECMAScript version whose feature
77 +set has been finalized.
78 +
79 +If adding support for a newer version requires changes, a new version with a
80 +major verion bump will be released.
81 +
82 +Currently, ECMAScript 2018 is supported.
83 +
84 +
85 +Invalid code handling
86 +=====================
87 +
88 +Unterminated strings are still matched as strings. JavaScript strings cannot
89 +contain (unescaped) newlines, so unterminated strings simply end at the end of
90 +the line. Unterminated template strings can contain unescaped newlines, though,
91 +so they go on to the end of input.
92 +
93 +Unterminated multi-line comments are also still matched as comments. They
94 +simply go on to the end of the input.
95 +
96 +Unterminated regex literals are likely matched as division and whatever is
97 +inside the regex.
98 +
99 +Invalid ASCII characters have their own capturing group.
100 +
101 +Invalid non-ASCII characters are treated as names, to simplify the matching of
102 +names (except unicode spaces which are treated as whitespace). Note: See also
103 +the [ES2018](#es2018) section.
104 +
105 +Regex literals may contain invalid regex syntax. They are still matched as
106 +regex literals. They may also contain repeated regex flags, to keep the regex
107 +simple.
108 +
109 +Strings may contain invalid escape sequences.
110 +
111 +
112 +Limitations
113 +===========
114 +
115 +Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be
116 +perfect. But that’s not the point either.
117 +
118 +You may compare jsTokens with [esprima] by using `esprima-compare.js`.
119 +See `npm run esprima-compare`!
120 +
121 +[esprima]: http://esprima.org/
122 +
123 +### Template string interpolation ###
124 +
125 +Template strings are matched as single tokens, from the starting `` ` `` to the
126 +ending `` ` ``, including interpolations (whose tokens are not matched
127 +individually).
128 +
129 +Matching template string interpolations requires recursive balancing of `{` and
130 +`}`—something that JavaScript regexes cannot do. Only one level of nesting is
131 +supported.
132 +
133 +### Division and regex literals collision ###
134 +
135 +Consider this example:
136 +
137 +```js
138 +var g = 9.82
139 +var number = bar / 2/g
140 +
141 +var regex = / 2/g
142 +```
143 +
144 +A human can easily understand that in the `number` line we’re dealing with
145 +division, and in the `regex` line we’re dealing with a regex literal. How come?
146 +Because humans can look at the whole code to put the `/` characters in context.
147 +A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also
148 +look backwards. See the [ES2018](#es2018) section).
149 +
150 +When the `jsTokens` regex scans throught the above, it will see the following
151 +at the end of both the `number` and `regex` rows:
152 +
153 +```js
154 +/ 2/g
155 +```
156 +
157 +It is then impossible to know if that is a regex literal, or part of an
158 +expression dealing with division.
159 +
160 +Here is a similar case:
161 +
162 +```js
163 +foo /= 2/g
164 +foo(/= 2/g)
165 +```
166 +
167 +The first line divides the `foo` variable with `2/g`. The second line calls the
168 +`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only
169 +sees forwards, it cannot tell the two cases apart.
170 +
171 +There are some cases where we _can_ tell division and regex literals apart,
172 +though.
173 +
174 +First off, we have the simple cases where there’s only one slash in the line:
175 +
176 +```js
177 +var foo = 2/g
178 +foo /= 2
179 +```
180 +
181 +Regex literals cannot contain newlines, so the above cases are correctly
182 +identified as division. Things are only problematic when there are more than
183 +one non-comment slash in a single line.
184 +
185 +Secondly, not every character is a valid regex flag.
186 +
187 +```js
188 +var number = bar / 2/e
189 +```
190 +
191 +The above example is also correctly identified as division, because `e` is not a
192 +valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*`
193 +(any letter) as flags, but it is not worth it since it increases the amount of
194 +ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are
195 +allowed. This means that the above example will be identified as division as
196 +long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6
197 +characters long.
198 +
199 +Lastly, we can look _forward_ for information.
200 +
201 +- If the token following what looks like a regex literal is not valid after a
202 + regex literal, but is valid in a division expression, then the regex literal
203 + is treated as division instead. For example, a flagless regex cannot be
204 + followed by a string, number or name, but all of those three can be the
205 + denominator of a division.
206 +- Generally, if what looks like a regex literal is followed by an operator, the
207 + regex literal is treated as division instead. This is because regexes are
208 + seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division
209 + could likely be part of such an expression.
210 +
211 +Please consult the regex source and the test cases for precise information on
212 +when regex or division is matched (should you need to know). In short, you
213 +could sum it up as:
214 +
215 +If the end of a statement looks like a regex literal (even if it isn’t), it
216 +will be treated as one. Otherwise it should work as expected (if you write sane
217 +code).
218 +
219 +### ES2018 ###
220 +
221 +ES2018 added some nice regex improvements to the language.
222 +
223 +- [Unicode property escapes] should allow telling names and invalid non-ASCII
224 + characters apart without blowing up the regex size.
225 +- [Lookbehind assertions] should allow matching telling division and regex
226 + literals apart in more cases.
227 +- [Named capture groups] might simplify some things.
228 +
229 +These things would be nice to do, but are not critical. They probably have to
230 +wait until the oldest maintained Node.js LTS release supports those features.
231 +
232 +[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html
233 +[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html
234 +[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html
235 +
236 +
237 +License
238 +=======
239 +
240 +[MIT](LICENSE).
1 +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
2 +// License: MIT. (See LICENSE.)
3 +
4 +Object.defineProperty(exports, "__esModule", {
5 + value: true
6 +})
7 +
8 +// This regex comes from regex.coffee, and is inserted here by generate-index.js
9 +// (run `npm run build`).
10 +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g
11 +
12 +exports.matchToToken = function(match) {
13 + var token = {type: "invalid", value: match[0], closed: undefined}
14 + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4])
15 + else if (match[ 5]) token.type = "comment"
16 + else if (match[ 6]) token.type = "comment", token.closed = !!match[7]
17 + else if (match[ 8]) token.type = "regex"
18 + else if (match[ 9]) token.type = "number"
19 + else if (match[10]) token.type = "name"
20 + else if (match[11]) token.type = "punctuator"
21 + else if (match[12]) token.type = "whitespace"
22 + return token
23 +}
1 +{
2 + "_from": "js-tokens@^3.0.0 || ^4.0.0",
3 + "_id": "js-tokens@4.0.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
6 + "_location": "/js-tokens",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "js-tokens@^3.0.0 || ^4.0.0",
12 + "name": "js-tokens",
13 + "escapedName": "js-tokens",
14 + "rawSpec": "^3.0.0 || ^4.0.0",
15 + "saveSpec": null,
16 + "fetchSpec": "^3.0.0 || ^4.0.0"
17 + },
18 + "_requiredBy": [
19 + "/loose-envify"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
22 + "_shasum": "19203fb59991df98e3a287050d4647cdeaf32499",
23 + "_spec": "js-tokens@^3.0.0 || ^4.0.0",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\loose-envify",
25 + "author": {
26 + "name": "Simon Lydell"
27 + },
28 + "bugs": {
29 + "url": "https://github.com/lydell/js-tokens/issues"
30 + },
31 + "bundleDependencies": false,
32 + "deprecated": false,
33 + "description": "A regex that tokenizes JavaScript.",
34 + "devDependencies": {
35 + "coffeescript": "2.1.1",
36 + "esprima": "4.0.0",
37 + "everything.js": "1.0.3",
38 + "mocha": "5.0.0"
39 + },
40 + "files": [
41 + "index.js"
42 + ],
43 + "homepage": "https://github.com/lydell/js-tokens#readme",
44 + "keywords": [
45 + "JavaScript",
46 + "js",
47 + "token",
48 + "tokenize",
49 + "regex"
50 + ],
51 + "license": "MIT",
52 + "name": "js-tokens",
53 + "repository": {
54 + "type": "git",
55 + "url": "git+https://github.com/lydell/js-tokens.git"
56 + },
57 + "scripts": {
58 + "build": "node generate-index.js",
59 + "dev": "npm run build && npm test",
60 + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js",
61 + "test": "mocha --ui tdd"
62 + },
63 + "version": "4.0.0"
64 +}
1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2015 Andres Suarez <zertosh@gmail.com>
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.
1 +# loose-envify
2 +
3 +[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify)
4 +
5 +Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster.
6 +
7 +## Gotchas
8 +
9 +* Doesn't handle broken syntax.
10 +* Doesn't look inside embedded expressions in template strings.
11 + - **this won't work:**
12 + ```js
13 + console.log(`the current env is ${process.env.NODE_ENV}`);
14 + ```
15 +* Doesn't replace oddly-spaced or oddly-commented expressions.
16 + - **this won't work:**
17 + ```js
18 + console.log(process./*won't*/env./*work*/NODE_ENV);
19 + ```
20 +
21 +## Usage/Options
22 +
23 +loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI.
24 +
25 +## Benchmark
26 +
27 +```
28 +envify:
29 +
30 + $ for i in {1..5}; do node bench/bench.js 'envify'; done
31 + 708ms
32 + 727ms
33 + 791ms
34 + 719ms
35 + 720ms
36 +
37 +loose-envify:
38 +
39 + $ for i in {1..5}; do node bench/bench.js '../'; done
40 + 51ms
41 + 52ms
42 + 52ms
43 + 52ms
44 + 52ms
45 +```
1 +#!/usr/bin/env node
2 +'use strict';
3 +
4 +var looseEnvify = require('./');
5 +var fs = require('fs');
6 +
7 +if (process.argv[2]) {
8 + fs.createReadStream(process.argv[2], {encoding: 'utf8'})
9 + .pipe(looseEnvify(process.argv[2]))
10 + .pipe(process.stdout);
11 +} else {
12 + process.stdin.resume()
13 + process.stdin
14 + .pipe(looseEnvify(__filename))
15 + .pipe(process.stdout);
16 +}
1 +// envify compatibility
2 +'use strict';
3 +
4 +module.exports = require('./loose-envify');
1 +'use strict';
2 +
3 +module.exports = require('./loose-envify')(process.env);
1 +'use strict';
2 +
3 +var stream = require('stream');
4 +var util = require('util');
5 +var replace = require('./replace');
6 +
7 +var jsonExtRe = /\.json$/;
8 +
9 +module.exports = function(rootEnv) {
10 + rootEnv = rootEnv || process.env;
11 + return function (file, trOpts) {
12 + if (jsonExtRe.test(file)) {
13 + return stream.PassThrough();
14 + }
15 + var envs = trOpts ? [rootEnv, trOpts] : [rootEnv];
16 + return new LooseEnvify(envs);
17 + };
18 +};
19 +
20 +function LooseEnvify(envs) {
21 + stream.Transform.call(this);
22 + this._data = '';
23 + this._envs = envs;
24 +}
25 +util.inherits(LooseEnvify, stream.Transform);
26 +
27 +LooseEnvify.prototype._transform = function(buf, enc, cb) {
28 + this._data += buf;
29 + cb();
30 +};
31 +
32 +LooseEnvify.prototype._flush = function(cb) {
33 + var replaced = replace(this._data, this._envs);
34 + this.push(replaced);
35 + cb();
36 +};
1 +{
2 + "_from": "loose-envify@^1.3.1",
3 + "_id": "loose-envify@1.4.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
6 + "_location": "/loose-envify",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "loose-envify@^1.3.1",
12 + "name": "loose-envify",
13 + "escapedName": "loose-envify",
14 + "rawSpec": "^1.3.1",
15 + "saveSpec": null,
16 + "fetchSpec": "^1.3.1"
17 + },
18 + "_requiredBy": [
19 + "/history",
20 + "/prop-types",
21 + "/react-router",
22 + "/react-router-dom"
23 + ],
24 + "_resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
25 + "_shasum": "71ee51fa7be4caec1a63839f7e682d8132d30caf",
26 + "_spec": "loose-envify@^1.3.1",
27 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router-dom",
28 + "author": {
29 + "name": "Andres Suarez",
30 + "email": "zertosh@gmail.com"
31 + },
32 + "bin": {
33 + "loose-envify": "cli.js"
34 + },
35 + "bugs": {
36 + "url": "https://github.com/zertosh/loose-envify/issues"
37 + },
38 + "bundleDependencies": false,
39 + "dependencies": {
40 + "js-tokens": "^3.0.0 || ^4.0.0"
41 + },
42 + "deprecated": false,
43 + "description": "Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST",
44 + "devDependencies": {
45 + "browserify": "^13.1.1",
46 + "envify": "^3.4.0",
47 + "tap": "^8.0.0"
48 + },
49 + "homepage": "https://github.com/zertosh/loose-envify",
50 + "keywords": [
51 + "environment",
52 + "variables",
53 + "browserify",
54 + "browserify-transform",
55 + "transform",
56 + "source",
57 + "configuration"
58 + ],
59 + "license": "MIT",
60 + "main": "index.js",
61 + "name": "loose-envify",
62 + "repository": {
63 + "type": "git",
64 + "url": "git://github.com/zertosh/loose-envify.git"
65 + },
66 + "scripts": {
67 + "test": "tap test/*.js"
68 + },
69 + "version": "1.4.0"
70 +}
1 +'use strict';
2 +
3 +var jsTokens = require('js-tokens').default;
4 +
5 +var processEnvRe = /\bprocess\.env\.[_$a-zA-Z][$\w]+\b/;
6 +var spaceOrCommentRe = /^(?:\s|\/[/*])/;
7 +
8 +function replace(src, envs) {
9 + if (!processEnvRe.test(src)) {
10 + return src;
11 + }
12 +
13 + var out = [];
14 + var purge = envs.some(function(env) {
15 + return env._ && env._.indexOf('purge') !== -1;
16 + });
17 +
18 + jsTokens.lastIndex = 0
19 + var parts = src.match(jsTokens);
20 +
21 + for (var i = 0; i < parts.length; i++) {
22 + if (parts[i ] === 'process' &&
23 + parts[i + 1] === '.' &&
24 + parts[i + 2] === 'env' &&
25 + parts[i + 3] === '.') {
26 + var prevCodeToken = getAdjacentCodeToken(-1, parts, i);
27 + var nextCodeToken = getAdjacentCodeToken(1, parts, i + 4);
28 + var replacement = getReplacementString(envs, parts[i + 4], purge);
29 + if (prevCodeToken !== '.' &&
30 + nextCodeToken !== '.' &&
31 + nextCodeToken !== '=' &&
32 + typeof replacement === 'string') {
33 + out.push(replacement);
34 + i += 4;
35 + continue;
36 + }
37 + }
38 + out.push(parts[i]);
39 + }
40 +
41 + return out.join('');
42 +}
43 +
44 +function getAdjacentCodeToken(dir, parts, i) {
45 + while (true) {
46 + var part = parts[i += dir];
47 + if (!spaceOrCommentRe.test(part)) {
48 + return part;
49 + }
50 + }
51 +}
52 +
53 +function getReplacementString(envs, name, purge) {
54 + for (var j = 0; j < envs.length; j++) {
55 + var env = envs[j];
56 + if (typeof env[name] !== 'undefined') {
57 + return JSON.stringify(env[name]);
58 + }
59 + }
60 + if (purge) {
61 + return 'undefined';
62 + }
63 +}
64 +
65 +module.exports = replace;
1 +Copyright (c) 2019-present StringEpsilon <StringEpsilon@gmail.com>
2 +
3 +Copyright (c) 2017-2019 James Kyle <me@thejameskyle.com>
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +# mini-create-react-context
2 +
3 +<p align="center">
4 +<a href="https://packagephobia.now.sh/result?p=mini-create-react-context">
5 + <img alt="npm install size" src="https://packagephobia.now.sh/badge?p=mini-create-react-context">
6 +</a>
7 +<a href="https://bundlephobia.com/result?p=mini-create-react-context@latest">
8 + <img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/mini-create-react-context/latest.svg?style=flat-square">
9 +</a>
10 +<a href="https://www.npmjs.com/package/mini-create-react-context">
11 + <img alt="npm" src="https://img.shields.io/npm/v/mini-create-react-context.svg?style=flat-square">
12 +</a>
13 +</p>
14 +
15 +> (A smaller) Polyfill for the [React context API](https://github.com/reactjs/rfcs/pull/2)
16 +
17 +## Install
18 +
19 +```sh
20 +npm install mini-create-react-context
21 +```
22 +
23 +You'll need to also have `react` and `prop-types` installed.
24 +
25 +## API
26 +
27 +```js
28 +const Context = createReactContext(defaultValue);
29 +/*
30 + <Context.Provider value={providedValue}>
31 + {children}
32 + </Context.Provider>
33 +
34 + ...
35 +
36 + <Context.Consumer>
37 + {value => children}
38 + </Context.Consumer>
39 +*/
40 +```
41 +
42 +## Example
43 +
44 +```js
45 +// @flow
46 +import React, { type Node } from 'react';
47 +import createReactContext, { type Context } from 'mini-create-react-context';
48 +
49 +type Theme = 'light' | 'dark';
50 +// Pass a default theme to ensure type correctness
51 +const ThemeContext: Context<Theme> = createReactContext('light');
52 +
53 +class ThemeToggler extends React.Component<
54 + { children: Node },
55 + { theme: Theme }
56 +> {
57 + state = { theme: 'light' };
58 + render() {
59 + return (
60 + // Pass the current context value to the Provider's `value` prop.
61 + // Changes are detected using strict comparison (Object.is)
62 + <ThemeContext.Provider value={this.state.theme}>
63 + <button
64 + onClick={() => {
65 + this.setState(state => ({
66 + theme: state.theme === 'light' ? 'dark' : 'light'
67 + }));
68 + }}
69 + >
70 + Toggle theme
71 + </button>
72 + {this.props.children}
73 + </ThemeContext.Provider>
74 + );
75 + }
76 +}
77 +
78 +class Title extends React.Component<{ children: Node }> {
79 + render() {
80 + return (
81 + // The Consumer uses a render prop API. Avoids conflicts in the
82 + // props namespace.
83 + <ThemeContext.Consumer>
84 + {theme => (
85 + <h1 style={{ color: theme === 'light' ? '#000' : '#fff' }}>
86 + {this.props.children}
87 + </h1>
88 + )}
89 + </ThemeContext.Consumer>
90 + );
91 + }
92 +}
93 +```
94 +
95 +## Compatibility
96 +
97 +This package only "ponyfills" the `React.createContext` API, not other unrelated React 16+ APIs. If you are using a version of React <16, keep in mind that you can only use features available in that version.
98 +
99 +For example, you cannot pass children types aren't valid pre React 16:
100 +
101 +```js
102 +<Context.Provider>
103 + <div/>
104 + <div/>
105 +</Context.Provider>
106 +```
107 +
108 +It will throw `A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.` because `<Context.Provider>` can only receive a single child element. To fix the error just wrap everyting in a single `<div>`:
109 +
110 +```js
111 +<Context.Provider>
112 + <div>
113 + <div/>
114 + <div/>
115 + </div>
116 +</Context.Provider>
117 +```
118 +
119 +## Size difference to the original:
120 +| | original | **mini**
121 +|------------|----------|-----
122 +|install size| [**50 kB**](https://packagephobia.now.sh/result?p=create-react-context) | [140 kB](https://packagephobia.now.sh/result?p=mini-create-react-context)
123 +|minified | [3.3 kB](https://bundlephobia.com/result?p=create-react-context) | [**2.3kB**](https://bundlephobia.com/result?p=mini-create-react-context)
124 +|minzip | 1.3 kB | **1.0kB**
1 +'use strict';function _interopDefault(e){return(e&&(typeof e==='object')&&'default'in e)?e['default']:e}var React=require('react'),React__default=_interopDefault(React),_inheritsLoose=_interopDefault(require('@babel/runtime/helpers/inheritsLoose')),PropTypes=_interopDefault(require('prop-types')),warning=_interopDefault(require('tiny-warning'));var MAX_SIGNED_31_BIT_INT = 1073741823;
2 +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
3 +
4 +function getUniqueId() {
5 + var key = '__global_unique_id__';
6 + return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
7 +}
8 +
9 +function objectIs(x, y) {
10 + if (x === y) {
11 + return x !== 0 || 1 / x === 1 / y;
12 + } else {
13 + return x !== x && y !== y;
14 + }
15 +}
16 +
17 +function createEventEmitter(value) {
18 + var handlers = [];
19 + return {
20 + on: function on(handler) {
21 + handlers.push(handler);
22 + },
23 + off: function off(handler) {
24 + handlers = handlers.filter(function (h) {
25 + return h !== handler;
26 + });
27 + },
28 + get: function get() {
29 + return value;
30 + },
31 + set: function set(newValue, changedBits) {
32 + value = newValue;
33 + handlers.forEach(function (handler) {
34 + return handler(value, changedBits);
35 + });
36 + }
37 + };
38 +}
39 +
40 +function onlyChild(children) {
41 + return Array.isArray(children) ? children[0] : children;
42 +}
43 +
44 +function createReactContext(defaultValue, calculateChangedBits) {
45 + var _Provider$childContex, _Consumer$contextType;
46 +
47 + var contextProp = '__create-react-context-' + getUniqueId() + '__';
48 +
49 + var Provider = /*#__PURE__*/function (_Component) {
50 + _inheritsLoose(Provider, _Component);
51 +
52 + function Provider() {
53 + var _this;
54 +
55 + _this = _Component.apply(this, arguments) || this;
56 + _this.emitter = createEventEmitter(_this.props.value);
57 + return _this;
58 + }
59 +
60 + var _proto = Provider.prototype;
61 +
62 + _proto.getChildContext = function getChildContext() {
63 + var _ref;
64 +
65 + return _ref = {}, _ref[contextProp] = this.emitter, _ref;
66 + };
67 +
68 + _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
69 + if (this.props.value !== nextProps.value) {
70 + var oldValue = this.props.value;
71 + var newValue = nextProps.value;
72 + var changedBits;
73 +
74 + if (objectIs(oldValue, newValue)) {
75 + changedBits = 0;
76 + } else {
77 + changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
78 +
79 + if (process.env.NODE_ENV !== 'production') {
80 + warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits);
81 + }
82 +
83 + changedBits |= 0;
84 +
85 + if (changedBits !== 0) {
86 + this.emitter.set(nextProps.value, changedBits);
87 + }
88 + }
89 + }
90 + };
91 +
92 + _proto.render = function render() {
93 + return this.props.children;
94 + };
95 +
96 + return Provider;
97 + }(React.Component);
98 +
99 + Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);
100 +
101 + var Consumer = /*#__PURE__*/function (_Component2) {
102 + _inheritsLoose(Consumer, _Component2);
103 +
104 + function Consumer() {
105 + var _this2;
106 +
107 + _this2 = _Component2.apply(this, arguments) || this;
108 + _this2.state = {
109 + value: _this2.getValue()
110 + };
111 +
112 + _this2.onUpdate = function (newValue, changedBits) {
113 + var observedBits = _this2.observedBits | 0;
114 +
115 + if ((observedBits & changedBits) !== 0) {
116 + _this2.setState({
117 + value: _this2.getValue()
118 + });
119 + }
120 + };
121 +
122 + return _this2;
123 + }
124 +
125 + var _proto2 = Consumer.prototype;
126 +
127 + _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
128 + var observedBits = nextProps.observedBits;
129 + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
130 + };
131 +
132 + _proto2.componentDidMount = function componentDidMount() {
133 + if (this.context[contextProp]) {
134 + this.context[contextProp].on(this.onUpdate);
135 + }
136 +
137 + var observedBits = this.props.observedBits;
138 + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
139 + };
140 +
141 + _proto2.componentWillUnmount = function componentWillUnmount() {
142 + if (this.context[contextProp]) {
143 + this.context[contextProp].off(this.onUpdate);
144 + }
145 + };
146 +
147 + _proto2.getValue = function getValue() {
148 + if (this.context[contextProp]) {
149 + return this.context[contextProp].get();
150 + } else {
151 + return defaultValue;
152 + }
153 + };
154 +
155 + _proto2.render = function render() {
156 + return onlyChild(this.props.children)(this.state.value);
157 + };
158 +
159 + return Consumer;
160 + }(React.Component);
161 +
162 + Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);
163 + return {
164 + Provider: Provider,
165 + Consumer: Consumer
166 + };
167 +}var index = React__default.createContext || createReactContext;module.exports=index;
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var e=require("react"),n=t(e),r=t(require("@babel/runtime/helpers/inheritsLoose")),o=t(require("prop-types")),i=t(require("tiny-warning")),u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function s(t){var e=[];return{on:function(t){e.push(t)},off:function(t){e=e.filter((function(e){return e!==t}))},get:function(){return t},set:function(n,r){t=n,e.forEach((function(e){return e(t,r)}))}}}var a=n.createContext||function(t,n){var a,c,l,p="__create-react-context-"+(u[l="__global_unique_id__"]=(u[l]||0)+1)+"__",f=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).emitter=s(e.props.value),e}r(e,t);var o=e.prototype;return o.getChildContext=function(){var t;return(t={})[p]=this.emitter,t},o.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var e,r=this.props.value,o=t.value;((u=r)===(s=o)?0!==u||1/u==1/s:u!=u&&s!=s)?e=0:(e="function"==typeof n?n(r,o):1073741823,"production"!==process.env.NODE_ENV&&i((1073741823&e)===e,"calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: "+e),0!==(e|=0)&&this.emitter.set(t.value,e))}var u,s},o.render=function(){return this.props.children},e}(e.Component);f.childContextTypes=((a={})[p]=o.object.isRequired,a);var v=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).state={value:t.getValue()},t.onUpdate=function(e,n){0!=((0|t.observedBits)&n)&&t.setState({value:t.getValue()})},t}r(n,e);var o=n.prototype;return o.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?1073741823:e},o.componentDidMount=function(){this.context[p]&&this.context[p].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?1073741823:t},o.componentWillUnmount=function(){this.context[p]&&this.context[p].off(this.onUpdate)},o.getValue=function(){return this.context[p]?this.context[p].get():t},o.render=function(){return(t=this.props.children,Array.isArray(t)?t[0]:t)(this.state.value);var t},n}(e.Component);return v.contextTypes=((c={})[p]=o.object,c),{Provider:f,Consumer:v}};module.exports=a;
...\ No newline at end of file ...\ No newline at end of file
1 +import React, { Component } from 'react';
2 +import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
3 +import PropTypes from 'prop-types';
4 +import warning from 'tiny-warning';
5 +
6 +var MAX_SIGNED_31_BIT_INT = 1073741823;
7 +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
8 +
9 +function getUniqueId() {
10 + var key = '__global_unique_id__';
11 + return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
12 +}
13 +
14 +function objectIs(x, y) {
15 + if (x === y) {
16 + return x !== 0 || 1 / x === 1 / y;
17 + } else {
18 + return x !== x && y !== y;
19 + }
20 +}
21 +
22 +function createEventEmitter(value) {
23 + var handlers = [];
24 + return {
25 + on: function on(handler) {
26 + handlers.push(handler);
27 + },
28 + off: function off(handler) {
29 + handlers = handlers.filter(function (h) {
30 + return h !== handler;
31 + });
32 + },
33 + get: function get() {
34 + return value;
35 + },
36 + set: function set(newValue, changedBits) {
37 + value = newValue;
38 + handlers.forEach(function (handler) {
39 + return handler(value, changedBits);
40 + });
41 + }
42 + };
43 +}
44 +
45 +function onlyChild(children) {
46 + return Array.isArray(children) ? children[0] : children;
47 +}
48 +
49 +function createReactContext(defaultValue, calculateChangedBits) {
50 + var _Provider$childContex, _Consumer$contextType;
51 +
52 + var contextProp = '__create-react-context-' + getUniqueId() + '__';
53 +
54 + var Provider = /*#__PURE__*/function (_Component) {
55 + _inheritsLoose(Provider, _Component);
56 +
57 + function Provider() {
58 + var _this;
59 +
60 + _this = _Component.apply(this, arguments) || this;
61 + _this.emitter = createEventEmitter(_this.props.value);
62 + return _this;
63 + }
64 +
65 + var _proto = Provider.prototype;
66 +
67 + _proto.getChildContext = function getChildContext() {
68 + var _ref;
69 +
70 + return _ref = {}, _ref[contextProp] = this.emitter, _ref;
71 + };
72 +
73 + _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
74 + if (this.props.value !== nextProps.value) {
75 + var oldValue = this.props.value;
76 + var newValue = nextProps.value;
77 + var changedBits;
78 +
79 + if (objectIs(oldValue, newValue)) {
80 + changedBits = 0;
81 + } else {
82 + changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
83 +
84 + if (process.env.NODE_ENV !== 'production') {
85 + warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits);
86 + }
87 +
88 + changedBits |= 0;
89 +
90 + if (changedBits !== 0) {
91 + this.emitter.set(nextProps.value, changedBits);
92 + }
93 + }
94 + }
95 + };
96 +
97 + _proto.render = function render() {
98 + return this.props.children;
99 + };
100 +
101 + return Provider;
102 + }(Component);
103 +
104 + Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);
105 +
106 + var Consumer = /*#__PURE__*/function (_Component2) {
107 + _inheritsLoose(Consumer, _Component2);
108 +
109 + function Consumer() {
110 + var _this2;
111 +
112 + _this2 = _Component2.apply(this, arguments) || this;
113 + _this2.state = {
114 + value: _this2.getValue()
115 + };
116 +
117 + _this2.onUpdate = function (newValue, changedBits) {
118 + var observedBits = _this2.observedBits | 0;
119 +
120 + if ((observedBits & changedBits) !== 0) {
121 + _this2.setState({
122 + value: _this2.getValue()
123 + });
124 + }
125 + };
126 +
127 + return _this2;
128 + }
129 +
130 + var _proto2 = Consumer.prototype;
131 +
132 + _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
133 + var observedBits = nextProps.observedBits;
134 + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
135 + };
136 +
137 + _proto2.componentDidMount = function componentDidMount() {
138 + if (this.context[contextProp]) {
139 + this.context[contextProp].on(this.onUpdate);
140 + }
141 +
142 + var observedBits = this.props.observedBits;
143 + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
144 + };
145 +
146 + _proto2.componentWillUnmount = function componentWillUnmount() {
147 + if (this.context[contextProp]) {
148 + this.context[contextProp].off(this.onUpdate);
149 + }
150 + };
151 +
152 + _proto2.getValue = function getValue() {
153 + if (this.context[contextProp]) {
154 + return this.context[contextProp].get();
155 + } else {
156 + return defaultValue;
157 + }
158 + };
159 +
160 + _proto2.render = function render() {
161 + return onlyChild(this.props.children)(this.state.value);
162 + };
163 +
164 + return Consumer;
165 + }(Component);
166 +
167 + Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);
168 + return {
169 + Provider: Provider,
170 + Consumer: Consumer
171 + };
172 +}
173 +
174 +var index = React.createContext || createReactContext;
175 +
176 +export default index;
1 +import * as React from 'react';
2 +
3 +export default function createReactContext<T>(
4 + defaultValue: T,
5 + calculateChangedBits?: (prev: T, next: T) => number
6 +): Context<T>;
7 +
8 +type RenderFn<T> = (value: T) => React.ReactNode;
9 +
10 +export type Context<T> = {
11 + Provider: React.ComponentClass<ProviderProps<T>>;
12 + Consumer: React.ComponentClass<ConsumerProps<T>>;
13 +};
14 +
15 +export type ProviderProps<T> = {
16 + value: T;
17 + children?: React.ReactNode;
18 + observedBits?: any,
19 +};
20 +
21 +export type ConsumerProps<T> = {
22 + children: RenderFn<T> | [RenderFn<T>];
23 + observedBits?: number;
24 +};
1 +{
2 + "_from": "mini-create-react-context@^0.4.0",
3 + "_id": "mini-create-react-context@0.4.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-b0TytUgFSbgFJGzJqXPKCFCBWigAjpjo+Fl7Vf7ZbKRDptszpppKxXH6DRXEABZ/gcEQczeb0iZ7JvL8e8jjCA==",
6 + "_location": "/mini-create-react-context",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "mini-create-react-context@^0.4.0",
12 + "name": "mini-create-react-context",
13 + "escapedName": "mini-create-react-context",
14 + "rawSpec": "^0.4.0",
15 + "saveSpec": null,
16 + "fetchSpec": "^0.4.0"
17 + },
18 + "_requiredBy": [
19 + "/react-router"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.0.tgz",
22 + "_shasum": "df60501c83151db69e28eac0ef08b4002efab040",
23 + "_spec": "mini-create-react-context@^0.4.0",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router",
25 + "author": {
26 + "name": "StringEpsilon"
27 + },
28 + "bugs": {
29 + "url": "https://github.com/StringEpsilon/mini-create-react-context/issues"
30 + },
31 + "bundleDependencies": false,
32 + "dependencies": {
33 + "@babel/runtime": "^7.5.5",
34 + "tiny-warning": "^1.0.3"
35 + },
36 + "deprecated": false,
37 + "description": "Smaller Polyfill for the proposed React context API",
38 + "devDependencies": {
39 + "@babel/core": "^7.8.6",
40 + "@babel/plugin-proposal-class-properties": "^7.8.3",
41 + "@babel/preset-env": "^7.8.6",
42 + "@babel/preset-react": "^7.8.3",
43 + "@babel/preset-typescript": "^7.8.3",
44 + "@types/enzyme": "^3.10.5",
45 + "@types/jest": "^25.1.3",
46 + "@types/react": "^16.8.23",
47 + "@wessberg/rollup-plugin-ts": "^1.2.19",
48 + "babel-jest": "^25.1.0",
49 + "enzyme": "^3.11.0",
50 + "enzyme-adapter-react-16": "^1.15.2",
51 + "enzyme-to-json": "^3.3.5",
52 + "jest": "^25.1.0",
53 + "prop-types": "^15.6.0",
54 + "raf": "^3.4.1",
55 + "react": "^16.2.0",
56 + "react-dom": "^16.2.0",
57 + "rollup": "^1.17.0",
58 + "rollup-plugin-commonjs": "^10.0.1",
59 + "rollup-plugin-node-resolve": "^5.2.0",
60 + "rollup-plugin-terser": "^5.2.0",
61 + "typescript": "^3.8.3"
62 + },
63 + "files": [
64 + "dist/**"
65 + ],
66 + "homepage": "https://github.com/StringEpsilon/mini-create-react-context#readme",
67 + "jest": {
68 + "snapshotSerializers": [
69 + "enzyme-to-json/serializer"
70 + ]
71 + },
72 + "keywords": [
73 + "react",
74 + "context",
75 + "contextTypes",
76 + "polyfill",
77 + "ponyfill"
78 + ],
79 + "license": "MIT",
80 + "main": "dist/cjs/index.js",
81 + "module": "dist/esm/index.js",
82 + "name": "mini-create-react-context",
83 + "peerDependencies": {
84 + "prop-types": "^15.0.0",
85 + "react": "^0.14.0 || ^15.0.0 || ^16.0.0"
86 + },
87 + "repository": {
88 + "type": "git",
89 + "url": "git+https://github.com/StringEpsilon/mini-create-react-context.git"
90 + },
91 + "scripts": {
92 + "build": "rollup -c rollup.config.js",
93 + "prepublish": "npm run build",
94 + "test": "jest"
95 + },
96 + "types": "dist/index.d.ts",
97 + "version": "0.4.0"
98 +}
1 +/*
2 +object-assign
3 +(c) Sindre Sorhus
4 +@license MIT
5 +*/
6 +
7 +'use strict';
8 +/* eslint-disable no-unused-vars */
9 +var getOwnPropertySymbols = Object.getOwnPropertySymbols;
10 +var hasOwnProperty = Object.prototype.hasOwnProperty;
11 +var propIsEnumerable = Object.prototype.propertyIsEnumerable;
12 +
13 +function toObject(val) {
14 + if (val === null || val === undefined) {
15 + throw new TypeError('Object.assign cannot be called with null or undefined');
16 + }
17 +
18 + return Object(val);
19 +}
20 +
21 +function shouldUseNative() {
22 + try {
23 + if (!Object.assign) {
24 + return false;
25 + }
26 +
27 + // Detect buggy property enumeration order in older V8 versions.
28 +
29 + // https://bugs.chromium.org/p/v8/issues/detail?id=4118
30 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
31 + test1[5] = 'de';
32 + if (Object.getOwnPropertyNames(test1)[0] === '5') {
33 + return false;
34 + }
35 +
36 + // https://bugs.chromium.org/p/v8/issues/detail?id=3056
37 + var test2 = {};
38 + for (var i = 0; i < 10; i++) {
39 + test2['_' + String.fromCharCode(i)] = i;
40 + }
41 + var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
42 + return test2[n];
43 + });
44 + if (order2.join('') !== '0123456789') {
45 + return false;
46 + }
47 +
48 + // https://bugs.chromium.org/p/v8/issues/detail?id=3056
49 + var test3 = {};
50 + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
51 + test3[letter] = letter;
52 + });
53 + if (Object.keys(Object.assign({}, test3)).join('') !==
54 + 'abcdefghijklmnopqrst') {
55 + return false;
56 + }
57 +
58 + return true;
59 + } catch (err) {
60 + // We don't expect any of the above to throw, but better to be safe.
61 + return false;
62 + }
63 +}
64 +
65 +module.exports = shouldUseNative() ? Object.assign : function (target, source) {
66 + var from;
67 + var to = toObject(target);
68 + var symbols;
69 +
70 + for (var s = 1; s < arguments.length; s++) {
71 + from = Object(arguments[s]);
72 +
73 + for (var key in from) {
74 + if (hasOwnProperty.call(from, key)) {
75 + to[key] = from[key];
76 + }
77 + }
78 +
79 + if (getOwnPropertySymbols) {
80 + symbols = getOwnPropertySymbols(from);
81 + for (var i = 0; i < symbols.length; i++) {
82 + if (propIsEnumerable.call(from, symbols[i])) {
83 + to[symbols[i]] = from[symbols[i]];
84 + }
85 + }
86 + }
87 + }
88 +
89 + return to;
90 +};
1 +The MIT License (MIT)
2 +
3 +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.
1 +{
2 + "_from": "object-assign@^4.1.1",
3 + "_id": "object-assign@4.1.1",
4 + "_inBundle": false,
5 + "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
6 + "_location": "/object-assign",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "object-assign@^4.1.1",
12 + "name": "object-assign",
13 + "escapedName": "object-assign",
14 + "rawSpec": "^4.1.1",
15 + "saveSpec": null,
16 + "fetchSpec": "^4.1.1"
17 + },
18 + "_requiredBy": [
19 + "/prop-types"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
22 + "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863",
23 + "_spec": "object-assign@^4.1.1",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\prop-types",
25 + "author": {
26 + "name": "Sindre Sorhus",
27 + "email": "sindresorhus@gmail.com",
28 + "url": "sindresorhus.com"
29 + },
30 + "bugs": {
31 + "url": "https://github.com/sindresorhus/object-assign/issues"
32 + },
33 + "bundleDependencies": false,
34 + "deprecated": false,
35 + "description": "ES2015 `Object.assign()` ponyfill",
36 + "devDependencies": {
37 + "ava": "^0.16.0",
38 + "lodash": "^4.16.4",
39 + "matcha": "^0.7.0",
40 + "xo": "^0.16.0"
41 + },
42 + "engines": {
43 + "node": ">=0.10.0"
44 + },
45 + "files": [
46 + "index.js"
47 + ],
48 + "homepage": "https://github.com/sindresorhus/object-assign#readme",
49 + "keywords": [
50 + "object",
51 + "assign",
52 + "extend",
53 + "properties",
54 + "es2015",
55 + "ecmascript",
56 + "harmony",
57 + "ponyfill",
58 + "prollyfill",
59 + "polyfill",
60 + "shim",
61 + "browser"
62 + ],
63 + "license": "MIT",
64 + "name": "object-assign",
65 + "repository": {
66 + "type": "git",
67 + "url": "git+https://github.com/sindresorhus/object-assign.git"
68 + },
69 + "scripts": {
70 + "bench": "matcha bench.js",
71 + "test": "xo && ava"
72 + },
73 + "version": "4.1.1"
74 +}
1 +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)
2 +
3 +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com)
4 +
5 +
6 +## Use the built-in
7 +
8 +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari),
9 +support `Object.assign()` :tada:. If you target only those environments, then by all
10 +means, use `Object.assign()` instead of this package.
11 +
12 +
13 +## Install
14 +
15 +```
16 +$ npm install --save object-assign
17 +```
18 +
19 +
20 +## Usage
21 +
22 +```js
23 +const objectAssign = require('object-assign');
24 +
25 +objectAssign({foo: 0}, {bar: 1});
26 +//=> {foo: 0, bar: 1}
27 +
28 +// multiple sources
29 +objectAssign({foo: 0}, {bar: 1}, {baz: 2});
30 +//=> {foo: 0, bar: 1, baz: 2}
31 +
32 +// overwrites equal keys
33 +objectAssign({foo: 0}, {foo: 1}, {foo: 2});
34 +//=> {foo: 2}
35 +
36 +// ignores null and undefined sources
37 +objectAssign({foo: 0}, null, {bar: 1}, undefined);
38 +//=> {foo: 0, bar: 1}
39 +```
40 +
41 +
42 +## API
43 +
44 +### objectAssign(target, [source, ...])
45 +
46 +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
47 +
48 +
49 +## Resources
50 +
51 +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)
52 +
53 +
54 +## Related
55 +
56 +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()`
57 +
58 +
59 +## License
60 +
61 +MIT © [Sindre Sorhus](https://sindresorhus.com)
1 +1.7.0 / 2016-11-08
2 +==================
3 +
4 + * Allow a `delimiter` option to be passed in with `tokensToRegExp` which will be used for "non-ending" token match situations
5 +
6 +1.6.0 / 2016-10-03
7 +==================
8 +
9 + * Populate `RegExp.keys` when using the `tokensToRegExp` method (making it consistent with the main export)
10 + * Allow a `delimiter` option to be passed in with `parse`
11 + * Updated TypeScript definition with `Keys` and `Options` updated
12 +
13 +1.5.3 / 2016-06-15
14 +==================
15 +
16 + * Add `\\` to the ignore character group to avoid backtracking on mismatched parens
17 +
18 +1.5.2 / 2016-06-15
19 +==================
20 +
21 + * Escape `\\` in string segments of regexp
22 +
23 +1.5.1 / 2016-06-08
24 +==================
25 +
26 + * Add `index.d.ts` to NPM package
27 +
28 +1.5.0 / 2016-05-20
29 +==================
30 +
31 + * Handle partial token segments (better)
32 + * Allow compile to handle asterisk token segments
33 +
34 +1.4.0 / 2016-05-18
35 +==================
36 +
37 + * Handle RegExp unions in path matching groups
38 +
39 +1.3.0 / 2016-05-08
40 +==================
41 +
42 + * Clarify README language and named parameter token support
43 + * Support advanced Closure Compiler with type annotations
44 + * Add pretty paths options to compiled function output
45 + * Add TypeScript definition to project
46 + * Improved prefix handling with non-complete segment parameters (E.g. `/:foo?-bar`)
47 +
48 +1.2.1 / 2015-08-17
49 +==================
50 +
51 + * Encode values before validation with path compilation function
52 + * More examples of using compilation in README
53 +
54 +1.2.0 / 2015-05-20
55 +==================
56 +
57 + * Add support for matching an asterisk (`*`) as an unnamed match everything group (`(.*)`)
58 +
59 +1.1.1 / 2015-05-11
60 +==================
61 +
62 + * Expose methods for working with path tokens
63 +
64 +1.1.0 / 2015-05-09
65 +==================
66 +
67 + * Expose the parser implementation to consumers
68 + * Implement a compiler function to generate valid strings
69 + * Huge refactor of tests to be more DRY and cover new parse and compile functions
70 + * Use chai in tests
71 + * Add .editorconfig
72 +
73 +1.0.3 / 2015-01-17
74 +==================
75 +
76 + * Optimised function runtime
77 + * Added `files` to `package.json`
78 +
79 +1.0.2 / 2014-12-17
80 +==================
81 +
82 + * Use `Array.isArray` shim
83 + * Remove ES5 incompatible code
84 + * Fixed repository path
85 + * Added new readme badges
86 +
87 +1.0.1 / 2014-08-27
88 +==================
89 +
90 + * Ensure installation works correctly on 0.8
91 +
92 +1.0.0 / 2014-08-17
93 +==================
94 +
95 + * No more API changes
96 +
97 +0.2.5 / 2014-08-07
98 +==================
99 +
100 + * Allow keys parameter to be omitted
101 +
102 +0.2.4 / 2014-08-02
103 +==================
104 +
105 + * Code coverage badge
106 + * Updated readme
107 + * Attach keys to the generated regexp
108 +
109 +0.2.3 / 2014-07-09
110 +==================
111 +
112 + * Add MIT license
113 +
114 +0.2.2 / 2014-07-06
115 +==================
116 +
117 + * A passed in trailing slash in non-strict mode will become optional
118 + * In non-end mode, the optional trailing slash will only match at the end
119 +
120 +0.2.1 / 2014-06-11
121 +==================
122 +
123 + * Fixed a major capturing group regexp regression
124 +
125 +0.2.0 / 2014-06-09
126 +==================
127 +
128 + * Improved support for arrays
129 + * Improved support for regexps
130 + * Better support for non-ending strict mode matches with a trailing slash
131 + * Travis CI support
132 + * Block using regexp special characters in the path
133 + * Removed support for the asterisk to match all
134 + * New support for parameter suffixes - `*`, `+` and `?`
135 + * Updated readme
136 + * Provide delimiter information with keys array
137 +
138 +0.1.2 / 2014-03-10
139 +==================
140 +
141 + * Move testing dependencies to `devDependencies`
142 +
143 +0.1.1 / 2014-03-10
144 +==================
145 +
146 + * Match entire substring with `options.end`
147 + * Properly handle ending and non-ending matches
148 +
149 +0.1.0 / 2014-03-06
150 +==================
151 +
152 + * Add `options.end`
153 +
154 +0.0.2 / 2013-02-10
155 +==================
156 +
157 + * Update to match current express
158 + * Add .license property to component.json
1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.
1 +# Path-to-RegExp
2 +
3 +> Turn an Express-style path string such as `/user/:name` into a regular expression.
4 +
5 +[![NPM version][npm-image]][npm-url]
6 +[![Build status][travis-image]][travis-url]
7 +[![Test coverage][coveralls-image]][coveralls-url]
8 +[![Dependency Status][david-image]][david-url]
9 +[![License][license-image]][license-url]
10 +[![Downloads][downloads-image]][downloads-url]
11 +
12 +## Installation
13 +
14 +```
15 +npm install path-to-regexp --save
16 +```
17 +
18 +## Usage
19 +
20 +```javascript
21 +var pathToRegexp = require('path-to-regexp')
22 +
23 +// pathToRegexp(path, keys, options)
24 +// pathToRegexp.parse(path)
25 +// pathToRegexp.compile(path)
26 +```
27 +
28 +- **path** An Express-style string, an array of strings, or a regular expression.
29 +- **keys** An array to be populated with the keys found in the path.
30 +- **options**
31 + - **sensitive** When `true` the route will be case sensitive. (default: `false`)
32 + - **strict** When `false` the trailing slash is optional. (default: `false`)
33 + - **end** When `false` the path will match at the beginning. (default: `true`)
34 + - **delimiter** Set the default delimiter for repeat parameters. (default: `'/'`)
35 +
36 +```javascript
37 +var keys = []
38 +var re = pathToRegexp('/foo/:bar', keys)
39 +// re = /^\/foo\/([^\/]+?)\/?$/i
40 +// keys = [{ name: 'bar', prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '[^\\/]+?' }]
41 +```
42 +
43 +**Please note:** The `RegExp` returned by `path-to-regexp` is intended for use with pathnames or hostnames. It can not handle the query strings or fragments of a URL.
44 +
45 +### Parameters
46 +
47 +The path string can be used to define parameters and populate the keys.
48 +
49 +#### Named Parameters
50 +
51 +Named parameters are defined by prefixing a colon to the parameter name (`:foo`). By default, the parameter will match until the following path segment.
52 +
53 +```js
54 +var re = pathToRegexp('/:foo/:bar', keys)
55 +// keys = [{ name: 'foo', prefix: '/', ... }, { name: 'bar', prefix: '/', ... }]
56 +
57 +re.exec('/test/route')
58 +//=> ['/test/route', 'test', 'route']
59 +```
60 +
61 +**Please note:** Named parameters must be made up of "word characters" (`[A-Za-z0-9_]`).
62 +
63 +```js
64 +var re = pathToRegexp('/(apple-)?icon-:res(\\d+).png', keys)
65 +// keys = [{ name: 0, prefix: '/', ... }, { name: 'res', prefix: '', ... }]
66 +
67 +re.exec('/icon-76.png')
68 +//=> ['/icon-76.png', undefined, '76']
69 +```
70 +
71 +#### Modified Parameters
72 +
73 +##### Optional
74 +
75 +Parameters can be suffixed with a question mark (`?`) to make the parameter optional. This will also make the prefix optional.
76 +
77 +```js
78 +var re = pathToRegexp('/:foo/:bar?', keys)
79 +// keys = [{ name: 'foo', ... }, { name: 'bar', delimiter: '/', optional: true, repeat: false }]
80 +
81 +re.exec('/test')
82 +//=> ['/test', 'test', undefined]
83 +
84 +re.exec('/test/route')
85 +//=> ['/test', 'test', 'route']
86 +```
87 +
88 +##### Zero or more
89 +
90 +Parameters can be suffixed with an asterisk (`*`) to denote a zero or more parameter matches. The prefix is taken into account for each match.
91 +
92 +```js
93 +var re = pathToRegexp('/:foo*', keys)
94 +// keys = [{ name: 'foo', delimiter: '/', optional: true, repeat: true }]
95 +
96 +re.exec('/')
97 +//=> ['/', undefined]
98 +
99 +re.exec('/bar/baz')
100 +//=> ['/bar/baz', 'bar/baz']
101 +```
102 +
103 +##### One or more
104 +
105 +Parameters can be suffixed with a plus sign (`+`) to denote a one or more parameter matches. The prefix is taken into account for each match.
106 +
107 +```js
108 +var re = pathToRegexp('/:foo+', keys)
109 +// keys = [{ name: 'foo', delimiter: '/', optional: false, repeat: true }]
110 +
111 +re.exec('/')
112 +//=> null
113 +
114 +re.exec('/bar/baz')
115 +//=> ['/bar/baz', 'bar/baz']
116 +```
117 +
118 +#### Custom Match Parameters
119 +
120 +All parameters can be provided a custom regexp, which overrides the default (`[^\/]+`).
121 +
122 +```js
123 +var re = pathToRegexp('/:foo(\\d+)', keys)
124 +// keys = [{ name: 'foo', ... }]
125 +
126 +re.exec('/123')
127 +//=> ['/123', '123']
128 +
129 +re.exec('/abc')
130 +//=> null
131 +```
132 +
133 +**Please note:** Backslashes need to be escaped with another backslash in strings.
134 +
135 +#### Unnamed Parameters
136 +
137 +It is possible to write an unnamed parameter that only consists of a matching group. It works the same as a named parameter, except it will be numerically indexed.
138 +
139 +```js
140 +var re = pathToRegexp('/:foo/(.*)', keys)
141 +// keys = [{ name: 'foo', ... }, { name: 0, ... }]
142 +
143 +re.exec('/test/route')
144 +//=> ['/test/route', 'test', 'route']
145 +```
146 +
147 +#### Asterisk
148 +
149 +An asterisk can be used for matching everything. It is equivalent to an unnamed matching group of `(.*)`.
150 +
151 +```js
152 +var re = pathToRegexp('/foo/*', keys)
153 +// keys = [{ name: '0', ... }]
154 +
155 +re.exec('/foo/bar/baz')
156 +//=> ['/foo/bar/baz', 'bar/baz']
157 +```
158 +
159 +### Parse
160 +
161 +The parse function is exposed via `pathToRegexp.parse`. This will return an array of strings and keys.
162 +
163 +```js
164 +var tokens = pathToRegexp.parse('/route/:foo/(.*)')
165 +
166 +console.log(tokens[0])
167 +//=> "/route"
168 +
169 +console.log(tokens[1])
170 +//=> { name: 'foo', prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '[^\\/]+?' }
171 +
172 +console.log(tokens[2])
173 +//=> { name: 0, prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '.*' }
174 +```
175 +
176 +**Note:** This method only works with Express-style strings.
177 +
178 +### Compile ("Reverse" Path-To-RegExp)
179 +
180 +Path-To-RegExp exposes a compile function for transforming an Express-style path into a valid path.
181 +
182 +```js
183 +var toPath = pathToRegexp.compile('/user/:id')
184 +
185 +toPath({ id: 123 }) //=> "/user/123"
186 +toPath({ id: 'café' }) //=> "/user/caf%C3%A9"
187 +toPath({ id: '/' }) //=> "/user/%2F"
188 +
189 +toPath({ id: ':' }) //=> "/user/%3A"
190 +toPath({ id: ':' }, { pretty: true }) //=> "/user/:"
191 +
192 +var toPathRepeated = pathToRegexp.compile('/:segment+')
193 +
194 +toPathRepeated({ segment: 'foo' }) //=> "/foo"
195 +toPathRepeated({ segment: ['a', 'b', 'c'] }) //=> "/a/b/c"
196 +
197 +var toPathRegexp = pathToRegexp.compile('/user/:id(\\d+)')
198 +
199 +toPathRegexp({ id: 123 }) //=> "/user/123"
200 +toPathRegexp({ id: '123' }) //=> "/user/123"
201 +toPathRegexp({ id: 'abc' }) //=> Throws `TypeError`.
202 +```
203 +
204 +**Note:** The generated function will throw on invalid input. It will do all necessary checks to ensure the generated path is valid. This method only works with strings.
205 +
206 +### Working with Tokens
207 +
208 +Path-To-RegExp exposes the two functions used internally that accept an array of tokens.
209 +
210 +* `pathToRegexp.tokensToRegExp(tokens, options)` Transform an array of tokens into a matching regular expression.
211 +* `pathToRegexp.tokensToFunction(tokens)` Transform an array of tokens into a path generator function.
212 +
213 +#### Token Information
214 +
215 +* `name` The name of the token (`string` for named or `number` for index)
216 +* `prefix` The prefix character for the segment (`/` or `.`)
217 +* `delimiter` The delimiter for the segment (same as prefix or `/`)
218 +* `optional` Indicates the token is optional (`boolean`)
219 +* `repeat` Indicates the token is repeated (`boolean`)
220 +* `partial` Indicates this token is a partial path segment (`boolean`)
221 +* `pattern` The RegExp used to match this token (`string`)
222 +* `asterisk` Indicates the token is an `*` match (`boolean`)
223 +
224 +## Compatibility with Express <= 4.x
225 +
226 +Path-To-RegExp breaks compatibility with Express <= `4.x`:
227 +
228 +* No longer a direct conversion to a RegExp with sugar on top - it's a path matcher with named and unnamed matching groups
229 + * It's unlikely you previously abused this feature, it's rare and you could always use a RegExp instead
230 +* All matching RegExp special characters can be used in a matching group. E.g. `/:user(.*)`
231 + * Other RegExp features are not support - no nested matching groups, non-capturing groups or look aheads
232 +* Parameters have suffixes that augment meaning - `*`, `+` and `?`. E.g. `/:user*`
233 +
234 +## TypeScript
235 +
236 +Includes a [`.d.ts`](index.d.ts) file for TypeScript users.
237 +
238 +## Live Demo
239 +
240 +You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/).
241 +
242 +## License
243 +
244 +MIT
245 +
246 +[npm-image]: https://img.shields.io/npm/v/path-to-regexp.svg?style=flat
247 +[npm-url]: https://npmjs.org/package/path-to-regexp
248 +[travis-image]: https://img.shields.io/travis/pillarjs/path-to-regexp.svg?style=flat
249 +[travis-url]: https://travis-ci.org/pillarjs/path-to-regexp
250 +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/path-to-regexp.svg?style=flat
251 +[coveralls-url]: https://coveralls.io/r/pillarjs/path-to-regexp?branch=master
252 +[david-image]: http://img.shields.io/david/pillarjs/path-to-regexp.svg?style=flat
253 +[david-url]: https://david-dm.org/pillarjs/path-to-regexp
254 +[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat
255 +[license-url]: LICENSE.md
256 +[downloads-image]: http://img.shields.io/npm/dm/path-to-regexp.svg?style=flat
257 +[downloads-url]: https://npmjs.org/package/path-to-regexp
1 +declare function pathToRegexp (path: pathToRegexp.Path, options?: pathToRegexp.RegExpOptions & pathToRegexp.ParseOptions): pathToRegexp.PathRegExp;
2 +declare function pathToRegexp (path: pathToRegexp.Path, keys?: pathToRegexp.Key[], options?: pathToRegexp.RegExpOptions & pathToRegexp.ParseOptions): pathToRegexp.PathRegExp;
3 +
4 +declare namespace pathToRegexp {
5 + export interface PathRegExp extends RegExp {
6 + // An array to be populated with the keys found in the path.
7 + keys: Key[];
8 + }
9 +
10 + export interface RegExpOptions {
11 + /**
12 + * When `true` the route will be case sensitive. (default: `false`)
13 + */
14 + sensitive?: boolean;
15 + /**
16 + * When `false` the trailing slash is optional. (default: `false`)
17 + */
18 + strict?: boolean;
19 + /**
20 + * When `false` the path will match at the beginning. (default: `true`)
21 + */
22 + end?: boolean;
23 + /**
24 + * Sets the final character for non-ending optimistic matches. (default: `/`)
25 + */
26 + delimiter?: string;
27 + }
28 +
29 + export interface ParseOptions {
30 + /**
31 + * Set the default delimiter for repeat parameters. (default: `'/'`)
32 + */
33 + delimiter?: string;
34 + }
35 +
36 + export interface TokensToFunctionOptions {
37 + /**
38 + * When `true` the regexp will be case sensitive. (default: `false`)
39 + */
40 + sensitive?: boolean;
41 + }
42 +
43 + /**
44 + * Parse an Express-style path into an array of tokens.
45 + */
46 + export function parse (path: string, options?: ParseOptions): Token[];
47 +
48 + /**
49 + * Transforming an Express-style path into a valid path.
50 + */
51 + export function compile (path: string, options?: ParseOptions & TokensToFunctionOptions): PathFunction;
52 +
53 + /**
54 + * Transform an array of tokens into a path generator function.
55 + */
56 + export function tokensToFunction (tokens: Token[], options?: TokensToFunctionOptions): PathFunction;
57 +
58 + /**
59 + * Transform an array of tokens into a matching regular expression.
60 + */
61 + export function tokensToRegExp (tokens: Token[], options?: RegExpOptions): PathRegExp;
62 + export function tokensToRegExp (tokens: Token[], keys?: Key[], options?: RegExpOptions): PathRegExp;
63 +
64 + export interface Key {
65 + name: string | number;
66 + prefix: string;
67 + delimiter: string;
68 + optional: boolean;
69 + repeat: boolean;
70 + pattern: string;
71 + partial: boolean;
72 + asterisk: boolean;
73 + }
74 +
75 + interface PathFunctionOptions {
76 + pretty?: boolean;
77 + }
78 +
79 + export type Token = string | Key;
80 + export type Path = string | RegExp | Array<string | RegExp>;
81 + export type PathFunction = (data?: Object, options?: PathFunctionOptions) => string;
82 +}
83 +
84 +export = pathToRegexp;
1 +var isarray = require('isarray')
2 +
3 +/**
4 + * Expose `pathToRegexp`.
5 + */
6 +module.exports = pathToRegexp
7 +module.exports.parse = parse
8 +module.exports.compile = compile
9 +module.exports.tokensToFunction = tokensToFunction
10 +module.exports.tokensToRegExp = tokensToRegExp
11 +
12 +/**
13 + * The main path matching regexp utility.
14 + *
15 + * @type {RegExp}
16 + */
17 +var PATH_REGEXP = new RegExp([
18 + // Match escaped characters that would otherwise appear in future matches.
19 + // This allows the user to escape special characters that won't transform.
20 + '(\\\\.)',
21 + // Match Express-style parameters and un-named parameters with a prefix
22 + // and optional suffixes. Matches appear as:
23 + //
24 + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
25 + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
26 + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
27 + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
28 +].join('|'), 'g')
29 +
30 +/**
31 + * Parse a string for the raw tokens.
32 + *
33 + * @param {string} str
34 + * @param {Object=} options
35 + * @return {!Array}
36 + */
37 +function parse (str, options) {
38 + var tokens = []
39 + var key = 0
40 + var index = 0
41 + var path = ''
42 + var defaultDelimiter = options && options.delimiter || '/'
43 + var res
44 +
45 + while ((res = PATH_REGEXP.exec(str)) != null) {
46 + var m = res[0]
47 + var escaped = res[1]
48 + var offset = res.index
49 + path += str.slice(index, offset)
50 + index = offset + m.length
51 +
52 + // Ignore already escaped sequences.
53 + if (escaped) {
54 + path += escaped[1]
55 + continue
56 + }
57 +
58 + var next = str[index]
59 + var prefix = res[2]
60 + var name = res[3]
61 + var capture = res[4]
62 + var group = res[5]
63 + var modifier = res[6]
64 + var asterisk = res[7]
65 +
66 + // Push the current path onto the tokens.
67 + if (path) {
68 + tokens.push(path)
69 + path = ''
70 + }
71 +
72 + var partial = prefix != null && next != null && next !== prefix
73 + var repeat = modifier === '+' || modifier === '*'
74 + var optional = modifier === '?' || modifier === '*'
75 + var delimiter = res[2] || defaultDelimiter
76 + var pattern = capture || group
77 +
78 + tokens.push({
79 + name: name || key++,
80 + prefix: prefix || '',
81 + delimiter: delimiter,
82 + optional: optional,
83 + repeat: repeat,
84 + partial: partial,
85 + asterisk: !!asterisk,
86 + pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
87 + })
88 + }
89 +
90 + // Match any characters still remaining.
91 + if (index < str.length) {
92 + path += str.substr(index)
93 + }
94 +
95 + // If the path exists, push it onto the end.
96 + if (path) {
97 + tokens.push(path)
98 + }
99 +
100 + return tokens
101 +}
102 +
103 +/**
104 + * Compile a string to a template function for the path.
105 + *
106 + * @param {string} str
107 + * @param {Object=} options
108 + * @return {!function(Object=, Object=)}
109 + */
110 +function compile (str, options) {
111 + return tokensToFunction(parse(str, options), options)
112 +}
113 +
114 +/**
115 + * Prettier encoding of URI path segments.
116 + *
117 + * @param {string}
118 + * @return {string}
119 + */
120 +function encodeURIComponentPretty (str) {
121 + return encodeURI(str).replace(/[\/?#]/g, function (c) {
122 + return '%' + c.charCodeAt(0).toString(16).toUpperCase()
123 + })
124 +}
125 +
126 +/**
127 + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
128 + *
129 + * @param {string}
130 + * @return {string}
131 + */
132 +function encodeAsterisk (str) {
133 + return encodeURI(str).replace(/[?#]/g, function (c) {
134 + return '%' + c.charCodeAt(0).toString(16).toUpperCase()
135 + })
136 +}
137 +
138 +/**
139 + * Expose a method for transforming tokens into the path function.
140 + */
141 +function tokensToFunction (tokens, options) {
142 + // Compile all the tokens into regexps.
143 + var matches = new Array(tokens.length)
144 +
145 + // Compile all the patterns before compilation.
146 + for (var i = 0; i < tokens.length; i++) {
147 + if (typeof tokens[i] === 'object') {
148 + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))
149 + }
150 + }
151 +
152 + return function (obj, opts) {
153 + var path = ''
154 + var data = obj || {}
155 + var options = opts || {}
156 + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
157 +
158 + for (var i = 0; i < tokens.length; i++) {
159 + var token = tokens[i]
160 +
161 + if (typeof token === 'string') {
162 + path += token
163 +
164 + continue
165 + }
166 +
167 + var value = data[token.name]
168 + var segment
169 +
170 + if (value == null) {
171 + if (token.optional) {
172 + // Prepend partial segment prefixes.
173 + if (token.partial) {
174 + path += token.prefix
175 + }
176 +
177 + continue
178 + } else {
179 + throw new TypeError('Expected "' + token.name + '" to be defined')
180 + }
181 + }
182 +
183 + if (isarray(value)) {
184 + if (!token.repeat) {
185 + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
186 + }
187 +
188 + if (value.length === 0) {
189 + if (token.optional) {
190 + continue
191 + } else {
192 + throw new TypeError('Expected "' + token.name + '" to not be empty')
193 + }
194 + }
195 +
196 + for (var j = 0; j < value.length; j++) {
197 + segment = encode(value[j])
198 +
199 + if (!matches[i].test(segment)) {
200 + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
201 + }
202 +
203 + path += (j === 0 ? token.prefix : token.delimiter) + segment
204 + }
205 +
206 + continue
207 + }
208 +
209 + segment = token.asterisk ? encodeAsterisk(value) : encode(value)
210 +
211 + if (!matches[i].test(segment)) {
212 + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
213 + }
214 +
215 + path += token.prefix + segment
216 + }
217 +
218 + return path
219 + }
220 +}
221 +
222 +/**
223 + * Escape a regular expression string.
224 + *
225 + * @param {string} str
226 + * @return {string}
227 + */
228 +function escapeString (str) {
229 + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
230 +}
231 +
232 +/**
233 + * Escape the capturing group by escaping special characters and meaning.
234 + *
235 + * @param {string} group
236 + * @return {string}
237 + */
238 +function escapeGroup (group) {
239 + return group.replace(/([=!:$\/()])/g, '\\$1')
240 +}
241 +
242 +/**
243 + * Attach the keys as a property of the regexp.
244 + *
245 + * @param {!RegExp} re
246 + * @param {Array} keys
247 + * @return {!RegExp}
248 + */
249 +function attachKeys (re, keys) {
250 + re.keys = keys
251 + return re
252 +}
253 +
254 +/**
255 + * Get the flags for a regexp from the options.
256 + *
257 + * @param {Object} options
258 + * @return {string}
259 + */
260 +function flags (options) {
261 + return options && options.sensitive ? '' : 'i'
262 +}
263 +
264 +/**
265 + * Pull out keys from a regexp.
266 + *
267 + * @param {!RegExp} path
268 + * @param {!Array} keys
269 + * @return {!RegExp}
270 + */
271 +function regexpToRegexp (path, keys) {
272 + // Use a negative lookahead to match only capturing groups.
273 + var groups = path.source.match(/\((?!\?)/g)
274 +
275 + if (groups) {
276 + for (var i = 0; i < groups.length; i++) {
277 + keys.push({
278 + name: i,
279 + prefix: null,
280 + delimiter: null,
281 + optional: false,
282 + repeat: false,
283 + partial: false,
284 + asterisk: false,
285 + pattern: null
286 + })
287 + }
288 + }
289 +
290 + return attachKeys(path, keys)
291 +}
292 +
293 +/**
294 + * Transform an array into a regexp.
295 + *
296 + * @param {!Array} path
297 + * @param {Array} keys
298 + * @param {!Object} options
299 + * @return {!RegExp}
300 + */
301 +function arrayToRegexp (path, keys, options) {
302 + var parts = []
303 +
304 + for (var i = 0; i < path.length; i++) {
305 + parts.push(pathToRegexp(path[i], keys, options).source)
306 + }
307 +
308 + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
309 +
310 + return attachKeys(regexp, keys)
311 +}
312 +
313 +/**
314 + * Create a path regexp from string input.
315 + *
316 + * @param {string} path
317 + * @param {!Array} keys
318 + * @param {!Object} options
319 + * @return {!RegExp}
320 + */
321 +function stringToRegexp (path, keys, options) {
322 + return tokensToRegExp(parse(path, options), keys, options)
323 +}
324 +
325 +/**
326 + * Expose a function for taking tokens and returning a RegExp.
327 + *
328 + * @param {!Array} tokens
329 + * @param {(Array|Object)=} keys
330 + * @param {Object=} options
331 + * @return {!RegExp}
332 + */
333 +function tokensToRegExp (tokens, keys, options) {
334 + if (!isarray(keys)) {
335 + options = /** @type {!Object} */ (keys || options)
336 + keys = []
337 + }
338 +
339 + options = options || {}
340 +
341 + var strict = options.strict
342 + var end = options.end !== false
343 + var route = ''
344 +
345 + // Iterate over the tokens and create our regexp string.
346 + for (var i = 0; i < tokens.length; i++) {
347 + var token = tokens[i]
348 +
349 + if (typeof token === 'string') {
350 + route += escapeString(token)
351 + } else {
352 + var prefix = escapeString(token.prefix)
353 + var capture = '(?:' + token.pattern + ')'
354 +
355 + keys.push(token)
356 +
357 + if (token.repeat) {
358 + capture += '(?:' + prefix + capture + ')*'
359 + }
360 +
361 + if (token.optional) {
362 + if (!token.partial) {
363 + capture = '(?:' + prefix + '(' + capture + '))?'
364 + } else {
365 + capture = prefix + '(' + capture + ')?'
366 + }
367 + } else {
368 + capture = prefix + '(' + capture + ')'
369 + }
370 +
371 + route += capture
372 + }
373 + }
374 +
375 + var delimiter = escapeString(options.delimiter || '/')
376 + var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
377 +
378 + // In non-strict mode we allow a slash at the end of match. If the path to
379 + // match already ends with a slash, we remove it for consistency. The slash
380 + // is valid at the end of a path match, not in the middle. This is important
381 + // in non-ending mode, where "/test/" shouldn't match "/test//route".
382 + if (!strict) {
383 + route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
384 + }
385 +
386 + if (end) {
387 + route += '$'
388 + } else {
389 + // In non-ending mode, we need the capturing groups to match as much as
390 + // possible by using a positive lookahead to the end or next path segment.
391 + route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
392 + }
393 +
394 + return attachKeys(new RegExp('^' + route, flags(options)), keys)
395 +}
396 +
397 +/**
398 + * Normalize the given path string, returning a regular expression.
399 + *
400 + * An empty array can be passed in for the keys, which will hold the
401 + * placeholder key descriptions. For example, using `/user/:id`, `keys` will
402 + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
403 + *
404 + * @param {(string|RegExp|Array)} path
405 + * @param {(Array|Object)=} keys
406 + * @param {Object=} options
407 + * @return {!RegExp}
408 + */
409 +function pathToRegexp (path, keys, options) {
410 + if (!isarray(keys)) {
411 + options = /** @type {!Object} */ (keys || options)
412 + keys = []
413 + }
414 +
415 + options = options || {}
416 +
417 + if (path instanceof RegExp) {
418 + return regexpToRegexp(path, /** @type {!Array} */ (keys))
419 + }
420 +
421 + if (isarray(path)) {
422 + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
423 + }
424 +
425 + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
426 +}
1 +{
2 + "_from": "path-to-regexp@^1.7.0",
3 + "_id": "path-to-regexp@1.8.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
6 + "_location": "/path-to-regexp",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "path-to-regexp@^1.7.0",
12 + "name": "path-to-regexp",
13 + "escapedName": "path-to-regexp",
14 + "rawSpec": "^1.7.0",
15 + "saveSpec": null,
16 + "fetchSpec": "^1.7.0"
17 + },
18 + "_requiredBy": [
19 + "/react-router"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
22 + "_shasum": "887b3ba9d84393e87a0a0b9f4cb756198b53548a",
23 + "_spec": "path-to-regexp@^1.7.0",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router",
25 + "bugs": {
26 + "url": "https://github.com/pillarjs/path-to-regexp/issues"
27 + },
28 + "bundleDependencies": false,
29 + "component": {
30 + "scripts": {
31 + "path-to-regexp": "index.js"
32 + }
33 + },
34 + "dependencies": {
35 + "isarray": "0.0.1"
36 + },
37 + "deprecated": false,
38 + "description": "Express style path to RegExp utility",
39 + "devDependencies": {
40 + "chai": "^2.3.0",
41 + "istanbul": "~0.3.0",
42 + "mocha": "~2.2.4",
43 + "standard": "~3.7.3",
44 + "ts-node": "^0.5.5",
45 + "typescript": "^1.8.7",
46 + "typings": "^1.0.4"
47 + },
48 + "files": [
49 + "index.js",
50 + "index.d.ts",
51 + "LICENSE"
52 + ],
53 + "homepage": "https://github.com/pillarjs/path-to-regexp#readme",
54 + "keywords": [
55 + "express",
56 + "regexp",
57 + "route",
58 + "routing"
59 + ],
60 + "license": "MIT",
61 + "main": "index.js",
62 + "name": "path-to-regexp",
63 + "repository": {
64 + "type": "git",
65 + "url": "git+https://github.com/pillarjs/path-to-regexp.git"
66 + },
67 + "scripts": {
68 + "lint": "standard",
69 + "prepublish": "typings install",
70 + "test": "npm run lint && npm run test-cov",
71 + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require ts-node/register -R spec test.ts",
72 + "test-spec": "mocha --require ts-node/register -R spec --bail test.ts"
73 + },
74 + "typings": "index.d.ts",
75 + "version": "1.8.0"
76 +}
1 +## 15.7.2
2 +* [Fix] ensure nullish values in `oneOf` do not crash ([#256](https://github.com/facebook/prop-types/issues/256))
3 +* [Fix] move `loose-envify` back to production deps, for browerify usage ([#203](https://github.com/facebook/prop-types/issues/203))
4 +
5 +## 15.7.1
6 +* [Fix] avoid template literal syntax ([#255](https://github.com/facebook/prop-types/issues/255), [#254](https://github.com/facebook/prop-types/issues/254))
7 +
8 +## 15.7.0
9 +* [New] Add `.elementType` ([#211](https://github.com/facebook/prop-types/pull/211))
10 +* [New] add `PropTypes.resetWarningCache` ([#178](https://github.com/facebook/prop-types/pull/178))
11 +* `oneOf`: improve warning when multiple arguments are supplied ([#244](https://github.com/facebook/prop-types/pull/244))
12 +* Fix `oneOf` when used with Symbols ([#224](https://github.com/facebook/prop-types/pull/224))
13 +* Avoid relying on `hasOwnProperty` being present on values' prototypes ([#112](https://github.com/facebook/prop-types/pull/112), [#187](https://github.com/facebook/prop-types/pull/187))
14 +* Improve readme ([#248](https://github.com/facebook/prop-types/pull/248), [#233](https://github.com/facebook/prop-types/pull/233))
15 +* Clean up mistaken runtime dep, swap envify for loose-envify ([#204](https://github.com/facebook/prop-types/pull/204))
16 +
17 +## 15.6.2
18 +* Remove the `fbjs` dependency by inlining some helpers from it ([#194](https://github.com/facebook/prop-types/pull/194)))
19 +
20 +## 15.6.1
21 +* Fix an issue where outdated BSD license headers were still present in the published bundle [#162](https://github.com/facebook/prop-types/issues/162)
22 +
23 +## 15.6.0
24 +
25 +* Switch from BSD + Patents to MIT license
26 +* Add PropTypes.exact, like PropTypes.shape but warns on extra object keys. ([@thejameskyle](https://github.com/thejameskyle) and [@aweary](https://github.com/aweary) in [#41](https://github.com/facebook/prop-types/pull/41) and [#87](https://github.com/facebook/prop-types/pull/87))
27 +
28 +## 15.5.10
29 +
30 +* Fix a false positive warning when using a production UMD build of a third-party library with a DEV version of React. ([@gaearon](https://github.com/gaearon) in [#50](https://github.com/facebook/prop-types/pull/50))
31 +
32 +## 15.5.9
33 +
34 +* Add `loose-envify` Browserify transform for users who don't envify globally. ([@mridgway](https://github.com/mridgway) in [#45](https://github.com/facebook/prop-types/pull/45))
35 +
36 +## 15.5.8
37 +
38 +* Limit the manual PropTypes call warning count because it has false positives with React versions earlier than 15.2.0 in the 15.x branch and 0.14.9 in the 0.14.x branch. ([@gaearon](https://github.com/gaearon) in [#26](https://github.com/facebook/prop-types/pull/26))
39 +
40 +## 15.5.7
41 +
42 +* **Critical Bugfix:** Fix an accidental breaking change that caused errors in production when used through `React.PropTypes`. ([@gaearon](https://github.com/gaearon) in [#20](https://github.com/facebook/prop-types/pull/20))
43 +* Improve the size of production UMD build. ([@aweary](https://github.com/aweary) in [38ba18](https://github.com/facebook/prop-types/commit/38ba18a4a8f705f4b2b33c88204573ddd604f2d6) and [7882a7](https://github.com/facebook/prop-types/commit/7882a7285293db5f284bcf559b869fd2cd4c44d4))
44 +
45 +## 15.5.6
46 +
47 +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
48 +
49 +* Fix a markdown issue in README. ([@bvaughn](https://github.com/bvaughn) in [174f77](https://github.com/facebook/prop-types/commit/174f77a50484fa628593e84b871fb40eed78b69a))
50 +
51 +## 15.5.5
52 +
53 +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
54 +
55 +* Add missing documentation and license files. ([@bvaughn](https://github.com/bvaughn) in [0a53d3](https://github.com/facebook/prop-types/commit/0a53d3a34283ae1e2d3aa396632b6dc2a2061e6a))
56 +
57 +## 15.5.4
58 +
59 +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
60 +
61 +* Reduce the size of the UMD Build. ([@acdlite](https://github.com/acdlite) in [31e9344](https://github.com/facebook/prop-types/commit/31e9344ca3233159928da66295da17dad82db1a8))
62 +* Remove bad package url. ([@ljharb](https://github.com/ljharb) in [158198f](https://github.com/facebook/prop-types/commit/158198fd6c468a3f6f742e0e355e622b3914048a))
63 +* Remove the accidentally included typechecking code from the production build.
64 +
65 +## 15.5.3
66 +
67 +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
68 +
69 +* Remove the accidentally included React package code from the UMD bundle. ([@acdlite](https://github.com/acdlite) in [df318bb](https://github.com/facebook/prop-types/commit/df318bba8a89bc5aadbb0292822cf4ed71d27ace))
70 +
71 +## 15.5.2
72 +
73 +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
74 +
75 +* Remove dependency on React for CommonJS entry point. ([@acdlite](https://github.com/acdlite) in [cae72bb](https://github.com/facebook/prop-types/commit/cae72bb281a3766c765e3624f6088c3713567e6d))
76 +
77 +
78 +## 15.5.1
79 +
80 +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
81 +
82 +* Remove accidental uncompiled ES6 syntax in the published package. ([@acdlite](https://github.com/acdlite) in [e191963](https://github.com/facebook/react/commit/e1919638b39dd65eedd250a8bb649773ca61b6f1))
83 +
84 +## 15.5.0
85 +
86 +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
87 +
88 +* Initial release.
89 +
90 +## Before 15.5.0
91 +
92 +PropTypes was previously included in React, but is now a separate package. For earlier history of PropTypes [see the React change log.](https://github.com/facebook/react/blob/master/CHANGELOG.md)
1 +MIT License
2 +
3 +Copyright (c) 2013-present, Facebook, Inc.
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +# prop-types [![Build Status](https://travis-ci.com/facebook/prop-types.svg?branch=master)](https://travis-ci.org/facebook/prop-types)
2 +
3 +Runtime type checking for React props and similar objects.
4 +
5 +You can use prop-types to document the intended types of properties passed to
6 +components. React (and potentially other libraries—see the checkPropTypes()
7 +reference below) will check props passed to your components against those
8 +definitions, and warn in development if they don’t match.
9 +
10 +## Installation
11 +
12 +```shell
13 +npm install --save prop-types
14 +```
15 +
16 +## Importing
17 +
18 +```js
19 +import PropTypes from 'prop-types'; // ES6
20 +var PropTypes = require('prop-types'); // ES5 with npm
21 +```
22 +
23 +### CDN
24 +
25 +If you prefer to exclude `prop-types` from your application and use it
26 +globally via `window.PropTypes`, the `prop-types` package provides
27 +single-file distributions, which are hosted on the following CDNs:
28 +
29 +* [**unpkg**](https://unpkg.com/prop-types/)
30 +```html
31 +<!-- development version -->
32 +<script src="https://unpkg.com/prop-types@15.6/prop-types.js"></script>
33 +
34 +<!-- production version -->
35 +<script src="https://unpkg.com/prop-types@15.6/prop-types.min.js"></script>
36 +```
37 +
38 +* [**cdnjs**](https://cdnjs.com/libraries/prop-types)
39 +```html
40 +<!-- development version -->
41 +<script src="https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.6.0/prop-types.js"></script>
42 +
43 +<!-- production version -->
44 +<script src="https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.6.0/prop-types.min.js"></script>
45 +```
46 +
47 +To load a specific version of `prop-types` replace `15.6.0` with the version number.
48 +
49 +## Usage
50 +
51 +PropTypes was originally exposed as part of the React core module, and is
52 +commonly used with React components.
53 +Here is an example of using PropTypes with a React component, which also
54 +documents the different validators provided:
55 +
56 +```js
57 +import React from 'react';
58 +import PropTypes from 'prop-types';
59 +
60 +class MyComponent extends React.Component {
61 + render() {
62 + // ... do things with the props
63 + }
64 +}
65 +
66 +MyComponent.propTypes = {
67 + // You can declare that a prop is a specific JS primitive. By default, these
68 + // are all optional.
69 + optionalArray: PropTypes.array,
70 + optionalBool: PropTypes.bool,
71 + optionalFunc: PropTypes.func,
72 + optionalNumber: PropTypes.number,
73 + optionalObject: PropTypes.object,
74 + optionalString: PropTypes.string,
75 + optionalSymbol: PropTypes.symbol,
76 +
77 + // Anything that can be rendered: numbers, strings, elements or an array
78 + // (or fragment) containing these types.
79 + optionalNode: PropTypes.node,
80 +
81 + // A React element (ie. <MyComponent />).
82 + optionalElement: PropTypes.element,
83 +
84 + // A React element type (ie. MyComponent).
85 + optionalElementType: PropTypes.elementType,
86 +
87 + // You can also declare that a prop is an instance of a class. This uses
88 + // JS's instanceof operator.
89 + optionalMessage: PropTypes.instanceOf(Message),
90 +
91 + // You can ensure that your prop is limited to specific values by treating
92 + // it as an enum.
93 + optionalEnum: PropTypes.oneOf(['News', 'Photos']),
94 +
95 + // An object that could be one of many types
96 + optionalUnion: PropTypes.oneOfType([
97 + PropTypes.string,
98 + PropTypes.number,
99 + PropTypes.instanceOf(Message)
100 + ]),
101 +
102 + // An array of a certain type
103 + optionalArrayOf: PropTypes.arrayOf(PropTypes.number),
104 +
105 + // An object with property values of a certain type
106 + optionalObjectOf: PropTypes.objectOf(PropTypes.number),
107 +
108 + // You can chain any of the above with `isRequired` to make sure a warning
109 + // is shown if the prop isn't provided.
110 +
111 + // An object taking on a particular shape
112 + optionalObjectWithShape: PropTypes.shape({
113 + optionalProperty: PropTypes.string,
114 + requiredProperty: PropTypes.number.isRequired
115 + }),
116 +
117 + // An object with warnings on extra properties
118 + optionalObjectWithStrictShape: PropTypes.exact({
119 + optionalProperty: PropTypes.string,
120 + requiredProperty: PropTypes.number.isRequired
121 + }),
122 +
123 + requiredFunc: PropTypes.func.isRequired,
124 +
125 + // A value of any data type
126 + requiredAny: PropTypes.any.isRequired,
127 +
128 + // You can also specify a custom validator. It should return an Error
129 + // object if the validation fails. Don't `console.warn` or throw, as this
130 + // won't work inside `oneOfType`.
131 + customProp: function(props, propName, componentName) {
132 + if (!/matchme/.test(props[propName])) {
133 + return new Error(
134 + 'Invalid prop `' + propName + '` supplied to' +
135 + ' `' + componentName + '`. Validation failed.'
136 + );
137 + }
138 + },
139 +
140 + // You can also supply a custom validator to `arrayOf` and `objectOf`.
141 + // It should return an Error object if the validation fails. The validator
142 + // will be called for each key in the array or object. The first two
143 + // arguments of the validator are the array or object itself, and the
144 + // current item's key.
145 + customArrayProp: PropTypes.arrayOf(function(propValue, key, componentName, location, propFullName) {
146 + if (!/matchme/.test(propValue[key])) {
147 + return new Error(
148 + 'Invalid prop `' + propFullName + '` supplied to' +
149 + ' `' + componentName + '`. Validation failed.'
150 + );
151 + }
152 + })
153 +};
154 +```
155 +
156 +Refer to the [React documentation](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) for more information.
157 +
158 +## Migrating from React.PropTypes
159 +
160 +Check out [Migrating from React.PropTypes](https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) for details on how to migrate to `prop-types` from `React.PropTypes`.
161 +
162 +Note that this blog posts **mentions a codemod script that performs the conversion automatically**.
163 +
164 +There are also important notes below.
165 +
166 +## How to Depend on This Package?
167 +
168 +For apps, we recommend putting it in `dependencies` with a caret range.
169 +For example:
170 +
171 +```js
172 + "dependencies": {
173 + "prop-types": "^15.5.7"
174 + }
175 +```
176 +
177 +For libraries, we *also* recommend leaving it in `dependencies`:
178 +
179 +```js
180 + "dependencies": {
181 + "prop-types": "^15.5.7"
182 + },
183 + "peerDependencies": {
184 + "react": "^15.5.0"
185 + }
186 +```
187 +
188 +**Note:** there are known issues in versions before 15.5.7 so we recommend using it as the minimal version.
189 +
190 +Make sure that the version range uses a caret (`^`) and thus is broad enough for npm to efficiently deduplicate packages.
191 +
192 +For UMD bundles of your components, make sure you **don’t** include `PropTypes` in the build. Usually this is done by marking it as an external (the specifics depend on your bundler), just like you do with React.
193 +
194 +## Compatibility
195 +
196 +### React 0.14
197 +
198 +This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released in March of 2016), there are no other changes in 0.14.9, so it should be a painless upgrade.
199 +
200 +```shell
201 +# ATTENTION: Only run this if you still use React 0.14!
202 +npm install --save react@^0.14.9 react-dom@^0.14.9
203 +```
204 +
205 +### React 15+
206 +
207 +This package is compatible with **React 15.3.0** and higher.
208 +
209 +```
210 +npm install --save react@^15.3.0 react-dom@^15.3.0
211 +```
212 +
213 +### What happens on other React versions?
214 +
215 +It outputs warnings with the message below even though the developer doesn’t do anything wrong. Unfortunately there is no solution for this other than updating React to either 15.3.0 or higher, or 0.14.9 if you’re using React 0.14.
216 +
217 +## Difference from `React.PropTypes`: Don’t Call Validator Functions
218 +
219 +First of all, **which version of React are you using**? You might be seeing this message because a component library has updated to use `prop-types` package, but your version of React is incompatible with it. See the [above section](#compatibility) for more details.
220 +
221 +Are you using either React 0.14.9 or a version higher than React 15.3.0? Read on.
222 +
223 +When you migrate components to use the standalone `prop-types`, **all validator functions will start throwing an error if you call them directly**. This makes sure that nobody relies on them in production code, and it is safe to strip their implementations to optimize the bundle size.
224 +
225 +Code like this is still fine:
226 +
227 +```js
228 +MyComponent.propTypes = {
229 + myProp: PropTypes.bool
230 +};
231 +```
232 +
233 +However, code like this will not work with the `prop-types` package:
234 +
235 +```js
236 +// Will not work with `prop-types` package!
237 +var errorOrNull = PropTypes.bool(42, 'myProp', 'MyComponent', 'prop');
238 +```
239 +
240 +It will throw an error:
241 +
242 +```
243 +Calling PropTypes validators directly is not supported by the `prop-types` package.
244 +Use PropTypes.checkPropTypes() to call them.
245 +```
246 +
247 +(If you see **a warning** rather than an error with this message, please check the [above section about compatibility](#compatibility).)
248 +
249 +This is new behavior, and you will only encounter it when you migrate from `React.PropTypes` to the `prop-types` package. For the vast majority of components, this doesn’t matter, and if you didn’t see [this warning](https://facebook.github.io/react/warnings/dont-call-proptypes.html) in your components, your code is safe to migrate. This is not a breaking change in React because you are only opting into this change for a component by explicitly changing your imports to use `prop-types`. If you temporarily need the old behavior, you can keep using `React.PropTypes` until React 16.
250 +
251 +**If you absolutely need to trigger the validation manually**, call `PropTypes.checkPropTypes()`. Unlike the validators themselves, this function is safe to call in production, as it will be replaced by an empty function:
252 +
253 +```js
254 +// Works with standalone PropTypes
255 +PropTypes.checkPropTypes(MyComponent.propTypes, props, 'prop', 'MyComponent');
256 +```
257 +See below for more info.
258 +
259 +**You might also see this error** if you’re calling a `PropTypes` validator from your own custom `PropTypes` validator. In this case, the fix is to make sure that you are passing *all* of the arguments to the inner function. There is a more in-depth explanation of how to fix it [on this page](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes). Alternatively, you can temporarily keep using `React.PropTypes` until React 16, as it would still only warn in this case.
260 +
261 +If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users.
262 +
263 +## PropTypes.checkPropTypes
264 +
265 +React will automatically check the propTypes you set on the component, but if
266 +you are using PropTypes without React then you may want to manually call
267 +`PropTypes.checkPropTypes`, like so:
268 +
269 +```js
270 +const myPropTypes = {
271 + name: PropTypes.string,
272 + age: PropTypes.number,
273 + // ... define your prop validations
274 +};
275 +
276 +const props = {
277 + name: 'hello', // is valid
278 + age: 'world', // not valid
279 +};
280 +
281 +// Let's say your component is called 'MyComponent'
282 +
283 +// Works with standalone PropTypes
284 +PropTypes.checkPropTypes(myPropTypes, props, 'age', 'MyComponent');
285 +// This will warn as follows:
286 +// Warning: Failed prop type: Invalid prop `age` of type `string` supplied to
287 +// `MyComponent`, expected `number`.
288 +```
289 +
290 +## PropTypes.resetWarningCache()
291 +
292 +`PropTypes.checkPropTypes(...)` only `console.error.log(...)`s a given message once. To reset the cache while testing call `PropTypes.resetWarningCache()`
293 +
294 +### License
295 +
296 +prop-types is [MIT licensed](./LICENSE).
1 +/**
2 + * Copyright (c) 2013-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +'use strict';
9 +
10 +var printWarning = function() {};
11 +
12 +if (process.env.NODE_ENV !== 'production') {
13 + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
14 + var loggedTypeFailures = {};
15 + var has = Function.call.bind(Object.prototype.hasOwnProperty);
16 +
17 + printWarning = function(text) {
18 + var message = 'Warning: ' + text;
19 + if (typeof console !== 'undefined') {
20 + console.error(message);
21 + }
22 + try {
23 + // --- Welcome to debugging React ---
24 + // This error was thrown as a convenience so that you can use this stack
25 + // to find the callsite that caused this warning to fire.
26 + throw new Error(message);
27 + } catch (x) {}
28 + };
29 +}
30 +
31 +/**
32 + * Assert that the values match with the type specs.
33 + * Error messages are memorized and will only be shown once.
34 + *
35 + * @param {object} typeSpecs Map of name to a ReactPropType
36 + * @param {object} values Runtime values that need to be type-checked
37 + * @param {string} location e.g. "prop", "context", "child context"
38 + * @param {string} componentName Name of the component for error messages.
39 + * @param {?Function} getStack Returns the component stack.
40 + * @private
41 + */
42 +function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
43 + if (process.env.NODE_ENV !== 'production') {
44 + for (var typeSpecName in typeSpecs) {
45 + if (has(typeSpecs, typeSpecName)) {
46 + var error;
47 + // Prop type validation may throw. In case they do, we don't want to
48 + // fail the render phase where it didn't fail before. So we log it.
49 + // After these have been cleaned up, we'll let them throw.
50 + try {
51 + // This is intentionally an invariant that gets caught. It's the same
52 + // behavior as without this statement except with a better message.
53 + if (typeof typeSpecs[typeSpecName] !== 'function') {
54 + var err = Error(
55 + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
56 + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
57 + );
58 + err.name = 'Invariant Violation';
59 + throw err;
60 + }
61 + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
62 + } catch (ex) {
63 + error = ex;
64 + }
65 + if (error && !(error instanceof Error)) {
66 + printWarning(
67 + (componentName || 'React class') + ': type specification of ' +
68 + location + ' `' + typeSpecName + '` is invalid; the type checker ' +
69 + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
70 + 'You may have forgotten to pass an argument to the type checker ' +
71 + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
72 + 'shape all require an argument).'
73 + );
74 + }
75 + if (error instanceof Error && !(error.message in loggedTypeFailures)) {
76 + // Only monitor this failure once because there tends to be a lot of the
77 + // same error.
78 + loggedTypeFailures[error.message] = true;
79 +
80 + var stack = getStack ? getStack() : '';
81 +
82 + printWarning(
83 + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
84 + );
85 + }
86 + }
87 + }
88 + }
89 +}
90 +
91 +/**
92 + * Resets warning cache when testing.
93 + *
94 + * @private
95 + */
96 +checkPropTypes.resetWarningCache = function() {
97 + if (process.env.NODE_ENV !== 'production') {
98 + loggedTypeFailures = {};
99 + }
100 +}
101 +
102 +module.exports = checkPropTypes;
1 +/**
2 + * Copyright (c) 2013-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +'use strict';
9 +
10 +// React 15.5 references this module, and assumes PropTypes are still callable in production.
11 +// Therefore we re-export development-only version with all the PropTypes checks here.
12 +// However if one is migrating to the `prop-types` npm library, they will go through the
13 +// `index.js` entry point, and it will branch depending on the environment.
14 +var factory = require('./factoryWithTypeCheckers');
15 +module.exports = function(isValidElement) {
16 + // It is still allowed in 15.5.
17 + var throwOnDirectAccess = false;
18 + return factory(isValidElement, throwOnDirectAccess);
19 +};
1 +/**
2 + * Copyright (c) 2013-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +'use strict';
9 +
10 +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
11 +
12 +function emptyFunction() {}
13 +function emptyFunctionWithReset() {}
14 +emptyFunctionWithReset.resetWarningCache = emptyFunction;
15 +
16 +module.exports = function() {
17 + function shim(props, propName, componentName, location, propFullName, secret) {
18 + if (secret === ReactPropTypesSecret) {
19 + // It is still safe when called from React.
20 + return;
21 + }
22 + var err = new Error(
23 + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
24 + 'Use PropTypes.checkPropTypes() to call them. ' +
25 + 'Read more at http://fb.me/use-check-prop-types'
26 + );
27 + err.name = 'Invariant Violation';
28 + throw err;
29 + };
30 + shim.isRequired = shim;
31 + function getShim() {
32 + return shim;
33 + };
34 + // Important!
35 + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
36 + var ReactPropTypes = {
37 + array: shim,
38 + bool: shim,
39 + func: shim,
40 + number: shim,
41 + object: shim,
42 + string: shim,
43 + symbol: shim,
44 +
45 + any: shim,
46 + arrayOf: getShim,
47 + element: shim,
48 + elementType: shim,
49 + instanceOf: getShim,
50 + node: shim,
51 + objectOf: getShim,
52 + oneOf: getShim,
53 + oneOfType: getShim,
54 + shape: getShim,
55 + exact: getShim,
56 +
57 + checkPropTypes: emptyFunctionWithReset,
58 + resetWarningCache: emptyFunction
59 + };
60 +
61 + ReactPropTypes.PropTypes = ReactPropTypes;
62 +
63 + return ReactPropTypes;
64 +};
1 +/**
2 + * Copyright (c) 2013-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +'use strict';
9 +
10 +var ReactIs = require('react-is');
11 +var assign = require('object-assign');
12 +
13 +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
14 +var checkPropTypes = require('./checkPropTypes');
15 +
16 +var has = Function.call.bind(Object.prototype.hasOwnProperty);
17 +var printWarning = function() {};
18 +
19 +if (process.env.NODE_ENV !== 'production') {
20 + printWarning = function(text) {
21 + var message = 'Warning: ' + text;
22 + if (typeof console !== 'undefined') {
23 + console.error(message);
24 + }
25 + try {
26 + // --- Welcome to debugging React ---
27 + // This error was thrown as a convenience so that you can use this stack
28 + // to find the callsite that caused this warning to fire.
29 + throw new Error(message);
30 + } catch (x) {}
31 + };
32 +}
33 +
34 +function emptyFunctionThatReturnsNull() {
35 + return null;
36 +}
37 +
38 +module.exports = function(isValidElement, throwOnDirectAccess) {
39 + /* global Symbol */
40 + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
41 + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
42 +
43 + /**
44 + * Returns the iterator method function contained on the iterable object.
45 + *
46 + * Be sure to invoke the function with the iterable as context:
47 + *
48 + * var iteratorFn = getIteratorFn(myIterable);
49 + * if (iteratorFn) {
50 + * var iterator = iteratorFn.call(myIterable);
51 + * ...
52 + * }
53 + *
54 + * @param {?object} maybeIterable
55 + * @return {?function}
56 + */
57 + function getIteratorFn(maybeIterable) {
58 + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
59 + if (typeof iteratorFn === 'function') {
60 + return iteratorFn;
61 + }
62 + }
63 +
64 + /**
65 + * Collection of methods that allow declaration and validation of props that are
66 + * supplied to React components. Example usage:
67 + *
68 + * var Props = require('ReactPropTypes');
69 + * var MyArticle = React.createClass({
70 + * propTypes: {
71 + * // An optional string prop named "description".
72 + * description: Props.string,
73 + *
74 + * // A required enum prop named "category".
75 + * category: Props.oneOf(['News','Photos']).isRequired,
76 + *
77 + * // A prop named "dialog" that requires an instance of Dialog.
78 + * dialog: Props.instanceOf(Dialog).isRequired
79 + * },
80 + * render: function() { ... }
81 + * });
82 + *
83 + * A more formal specification of how these methods are used:
84 + *
85 + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
86 + * decl := ReactPropTypes.{type}(.isRequired)?
87 + *
88 + * Each and every declaration produces a function with the same signature. This
89 + * allows the creation of custom validation functions. For example:
90 + *
91 + * var MyLink = React.createClass({
92 + * propTypes: {
93 + * // An optional string or URI prop named "href".
94 + * href: function(props, propName, componentName) {
95 + * var propValue = props[propName];
96 + * if (propValue != null && typeof propValue !== 'string' &&
97 + * !(propValue instanceof URI)) {
98 + * return new Error(
99 + * 'Expected a string or an URI for ' + propName + ' in ' +
100 + * componentName
101 + * );
102 + * }
103 + * }
104 + * },
105 + * render: function() {...}
106 + * });
107 + *
108 + * @internal
109 + */
110 +
111 + var ANONYMOUS = '<<anonymous>>';
112 +
113 + // Important!
114 + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
115 + var ReactPropTypes = {
116 + array: createPrimitiveTypeChecker('array'),
117 + bool: createPrimitiveTypeChecker('boolean'),
118 + func: createPrimitiveTypeChecker('function'),
119 + number: createPrimitiveTypeChecker('number'),
120 + object: createPrimitiveTypeChecker('object'),
121 + string: createPrimitiveTypeChecker('string'),
122 + symbol: createPrimitiveTypeChecker('symbol'),
123 +
124 + any: createAnyTypeChecker(),
125 + arrayOf: createArrayOfTypeChecker,
126 + element: createElementTypeChecker(),
127 + elementType: createElementTypeTypeChecker(),
128 + instanceOf: createInstanceTypeChecker,
129 + node: createNodeChecker(),
130 + objectOf: createObjectOfTypeChecker,
131 + oneOf: createEnumTypeChecker,
132 + oneOfType: createUnionTypeChecker,
133 + shape: createShapeTypeChecker,
134 + exact: createStrictShapeTypeChecker,
135 + };
136 +
137 + /**
138 + * inlined Object.is polyfill to avoid requiring consumers ship their own
139 + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
140 + */
141 + /*eslint-disable no-self-compare*/
142 + function is(x, y) {
143 + // SameValue algorithm
144 + if (x === y) {
145 + // Steps 1-5, 7-10
146 + // Steps 6.b-6.e: +0 != -0
147 + return x !== 0 || 1 / x === 1 / y;
148 + } else {
149 + // Step 6.a: NaN == NaN
150 + return x !== x && y !== y;
151 + }
152 + }
153 + /*eslint-enable no-self-compare*/
154 +
155 + /**
156 + * We use an Error-like object for backward compatibility as people may call
157 + * PropTypes directly and inspect their output. However, we don't use real
158 + * Errors anymore. We don't inspect their stack anyway, and creating them
159 + * is prohibitively expensive if they are created too often, such as what
160 + * happens in oneOfType() for any type before the one that matched.
161 + */
162 + function PropTypeError(message) {
163 + this.message = message;
164 + this.stack = '';
165 + }
166 + // Make `instanceof Error` still work for returned errors.
167 + PropTypeError.prototype = Error.prototype;
168 +
169 + function createChainableTypeChecker(validate) {
170 + if (process.env.NODE_ENV !== 'production') {
171 + var manualPropTypeCallCache = {};
172 + var manualPropTypeWarningCount = 0;
173 + }
174 + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
175 + componentName = componentName || ANONYMOUS;
176 + propFullName = propFullName || propName;
177 +
178 + if (secret !== ReactPropTypesSecret) {
179 + if (throwOnDirectAccess) {
180 + // New behavior only for users of `prop-types` package
181 + var err = new Error(
182 + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
183 + 'Use `PropTypes.checkPropTypes()` to call them. ' +
184 + 'Read more at http://fb.me/use-check-prop-types'
185 + );
186 + err.name = 'Invariant Violation';
187 + throw err;
188 + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
189 + // Old behavior for people using React.PropTypes
190 + var cacheKey = componentName + ':' + propName;
191 + if (
192 + !manualPropTypeCallCache[cacheKey] &&
193 + // Avoid spamming the console because they are often not actionable except for lib authors
194 + manualPropTypeWarningCount < 3
195 + ) {
196 + printWarning(
197 + 'You are manually calling a React.PropTypes validation ' +
198 + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
199 + 'and will throw in the standalone `prop-types` package. ' +
200 + 'You may be seeing this warning due to a third-party PropTypes ' +
201 + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
202 + );
203 + manualPropTypeCallCache[cacheKey] = true;
204 + manualPropTypeWarningCount++;
205 + }
206 + }
207 + }
208 + if (props[propName] == null) {
209 + if (isRequired) {
210 + if (props[propName] === null) {
211 + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
212 + }
213 + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
214 + }
215 + return null;
216 + } else {
217 + return validate(props, propName, componentName, location, propFullName);
218 + }
219 + }
220 +
221 + var chainedCheckType = checkType.bind(null, false);
222 + chainedCheckType.isRequired = checkType.bind(null, true);
223 +
224 + return chainedCheckType;
225 + }
226 +
227 + function createPrimitiveTypeChecker(expectedType) {
228 + function validate(props, propName, componentName, location, propFullName, secret) {
229 + var propValue = props[propName];
230 + var propType = getPropType(propValue);
231 + if (propType !== expectedType) {
232 + // `propValue` being instance of, say, date/regexp, pass the 'object'
233 + // check, but we can offer a more precise error message here rather than
234 + // 'of type `object`'.
235 + var preciseType = getPreciseType(propValue);
236 +
237 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
238 + }
239 + return null;
240 + }
241 + return createChainableTypeChecker(validate);
242 + }
243 +
244 + function createAnyTypeChecker() {
245 + return createChainableTypeChecker(emptyFunctionThatReturnsNull);
246 + }
247 +
248 + function createArrayOfTypeChecker(typeChecker) {
249 + function validate(props, propName, componentName, location, propFullName) {
250 + if (typeof typeChecker !== 'function') {
251 + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
252 + }
253 + var propValue = props[propName];
254 + if (!Array.isArray(propValue)) {
255 + var propType = getPropType(propValue);
256 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
257 + }
258 + for (var i = 0; i < propValue.length; i++) {
259 + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
260 + if (error instanceof Error) {
261 + return error;
262 + }
263 + }
264 + return null;
265 + }
266 + return createChainableTypeChecker(validate);
267 + }
268 +
269 + function createElementTypeChecker() {
270 + function validate(props, propName, componentName, location, propFullName) {
271 + var propValue = props[propName];
272 + if (!isValidElement(propValue)) {
273 + var propType = getPropType(propValue);
274 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
275 + }
276 + return null;
277 + }
278 + return createChainableTypeChecker(validate);
279 + }
280 +
281 + function createElementTypeTypeChecker() {
282 + function validate(props, propName, componentName, location, propFullName) {
283 + var propValue = props[propName];
284 + if (!ReactIs.isValidElementType(propValue)) {
285 + var propType = getPropType(propValue);
286 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
287 + }
288 + return null;
289 + }
290 + return createChainableTypeChecker(validate);
291 + }
292 +
293 + function createInstanceTypeChecker(expectedClass) {
294 + function validate(props, propName, componentName, location, propFullName) {
295 + if (!(props[propName] instanceof expectedClass)) {
296 + var expectedClassName = expectedClass.name || ANONYMOUS;
297 + var actualClassName = getClassName(props[propName]);
298 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
299 + }
300 + return null;
301 + }
302 + return createChainableTypeChecker(validate);
303 + }
304 +
305 + function createEnumTypeChecker(expectedValues) {
306 + if (!Array.isArray(expectedValues)) {
307 + if (process.env.NODE_ENV !== 'production') {
308 + if (arguments.length > 1) {
309 + printWarning(
310 + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
311 + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
312 + );
313 + } else {
314 + printWarning('Invalid argument supplied to oneOf, expected an array.');
315 + }
316 + }
317 + return emptyFunctionThatReturnsNull;
318 + }
319 +
320 + function validate(props, propName, componentName, location, propFullName) {
321 + var propValue = props[propName];
322 + for (var i = 0; i < expectedValues.length; i++) {
323 + if (is(propValue, expectedValues[i])) {
324 + return null;
325 + }
326 + }
327 +
328 + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
329 + var type = getPreciseType(value);
330 + if (type === 'symbol') {
331 + return String(value);
332 + }
333 + return value;
334 + });
335 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
336 + }
337 + return createChainableTypeChecker(validate);
338 + }
339 +
340 + function createObjectOfTypeChecker(typeChecker) {
341 + function validate(props, propName, componentName, location, propFullName) {
342 + if (typeof typeChecker !== 'function') {
343 + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
344 + }
345 + var propValue = props[propName];
346 + var propType = getPropType(propValue);
347 + if (propType !== 'object') {
348 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
349 + }
350 + for (var key in propValue) {
351 + if (has(propValue, key)) {
352 + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
353 + if (error instanceof Error) {
354 + return error;
355 + }
356 + }
357 + }
358 + return null;
359 + }
360 + return createChainableTypeChecker(validate);
361 + }
362 +
363 + function createUnionTypeChecker(arrayOfTypeCheckers) {
364 + if (!Array.isArray(arrayOfTypeCheckers)) {
365 + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
366 + return emptyFunctionThatReturnsNull;
367 + }
368 +
369 + for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
370 + var checker = arrayOfTypeCheckers[i];
371 + if (typeof checker !== 'function') {
372 + printWarning(
373 + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
374 + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
375 + );
376 + return emptyFunctionThatReturnsNull;
377 + }
378 + }
379 +
380 + function validate(props, propName, componentName, location, propFullName) {
381 + for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
382 + var checker = arrayOfTypeCheckers[i];
383 + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
384 + return null;
385 + }
386 + }
387 +
388 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
389 + }
390 + return createChainableTypeChecker(validate);
391 + }
392 +
393 + function createNodeChecker() {
394 + function validate(props, propName, componentName, location, propFullName) {
395 + if (!isNode(props[propName])) {
396 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
397 + }
398 + return null;
399 + }
400 + return createChainableTypeChecker(validate);
401 + }
402 +
403 + function createShapeTypeChecker(shapeTypes) {
404 + function validate(props, propName, componentName, location, propFullName) {
405 + var propValue = props[propName];
406 + var propType = getPropType(propValue);
407 + if (propType !== 'object') {
408 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
409 + }
410 + for (var key in shapeTypes) {
411 + var checker = shapeTypes[key];
412 + if (!checker) {
413 + continue;
414 + }
415 + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
416 + if (error) {
417 + return error;
418 + }
419 + }
420 + return null;
421 + }
422 + return createChainableTypeChecker(validate);
423 + }
424 +
425 + function createStrictShapeTypeChecker(shapeTypes) {
426 + function validate(props, propName, componentName, location, propFullName) {
427 + var propValue = props[propName];
428 + var propType = getPropType(propValue);
429 + if (propType !== 'object') {
430 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
431 + }
432 + // We need to check all keys in case some are required but missing from
433 + // props.
434 + var allKeys = assign({}, props[propName], shapeTypes);
435 + for (var key in allKeys) {
436 + var checker = shapeTypes[key];
437 + if (!checker) {
438 + return new PropTypeError(
439 + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
440 + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
441 + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
442 + );
443 + }
444 + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
445 + if (error) {
446 + return error;
447 + }
448 + }
449 + return null;
450 + }
451 +
452 + return createChainableTypeChecker(validate);
453 + }
454 +
455 + function isNode(propValue) {
456 + switch (typeof propValue) {
457 + case 'number':
458 + case 'string':
459 + case 'undefined':
460 + return true;
461 + case 'boolean':
462 + return !propValue;
463 + case 'object':
464 + if (Array.isArray(propValue)) {
465 + return propValue.every(isNode);
466 + }
467 + if (propValue === null || isValidElement(propValue)) {
468 + return true;
469 + }
470 +
471 + var iteratorFn = getIteratorFn(propValue);
472 + if (iteratorFn) {
473 + var iterator = iteratorFn.call(propValue);
474 + var step;
475 + if (iteratorFn !== propValue.entries) {
476 + while (!(step = iterator.next()).done) {
477 + if (!isNode(step.value)) {
478 + return false;
479 + }
480 + }
481 + } else {
482 + // Iterator will provide entry [k,v] tuples rather than values.
483 + while (!(step = iterator.next()).done) {
484 + var entry = step.value;
485 + if (entry) {
486 + if (!isNode(entry[1])) {
487 + return false;
488 + }
489 + }
490 + }
491 + }
492 + } else {
493 + return false;
494 + }
495 +
496 + return true;
497 + default:
498 + return false;
499 + }
500 + }
501 +
502 + function isSymbol(propType, propValue) {
503 + // Native Symbol.
504 + if (propType === 'symbol') {
505 + return true;
506 + }
507 +
508 + // falsy value can't be a Symbol
509 + if (!propValue) {
510 + return false;
511 + }
512 +
513 + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
514 + if (propValue['@@toStringTag'] === 'Symbol') {
515 + return true;
516 + }
517 +
518 + // Fallback for non-spec compliant Symbols which are polyfilled.
519 + if (typeof Symbol === 'function' && propValue instanceof Symbol) {
520 + return true;
521 + }
522 +
523 + return false;
524 + }
525 +
526 + // Equivalent of `typeof` but with special handling for array and regexp.
527 + function getPropType(propValue) {
528 + var propType = typeof propValue;
529 + if (Array.isArray(propValue)) {
530 + return 'array';
531 + }
532 + if (propValue instanceof RegExp) {
533 + // Old webkits (at least until Android 4.0) return 'function' rather than
534 + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
535 + // passes PropTypes.object.
536 + return 'object';
537 + }
538 + if (isSymbol(propType, propValue)) {
539 + return 'symbol';
540 + }
541 + return propType;
542 + }
543 +
544 + // This handles more types than `getPropType`. Only used for error messages.
545 + // See `createPrimitiveTypeChecker`.
546 + function getPreciseType(propValue) {
547 + if (typeof propValue === 'undefined' || propValue === null) {
548 + return '' + propValue;
549 + }
550 + var propType = getPropType(propValue);
551 + if (propType === 'object') {
552 + if (propValue instanceof Date) {
553 + return 'date';
554 + } else if (propValue instanceof RegExp) {
555 + return 'regexp';
556 + }
557 + }
558 + return propType;
559 + }
560 +
561 + // Returns a string that is postfixed to a warning about an invalid type.
562 + // For example, "undefined" or "of type array"
563 + function getPostfixForTypeWarning(value) {
564 + var type = getPreciseType(value);
565 + switch (type) {
566 + case 'array':
567 + case 'object':
568 + return 'an ' + type;
569 + case 'boolean':
570 + case 'date':
571 + case 'regexp':
572 + return 'a ' + type;
573 + default:
574 + return type;
575 + }
576 + }
577 +
578 + // Returns class name of the object, if any.
579 + function getClassName(propValue) {
580 + if (!propValue.constructor || !propValue.constructor.name) {
581 + return ANONYMOUS;
582 + }
583 + return propValue.constructor.name;
584 + }
585 +
586 + ReactPropTypes.checkPropTypes = checkPropTypes;
587 + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
588 + ReactPropTypes.PropTypes = ReactPropTypes;
589 +
590 + return ReactPropTypes;
591 +};
1 +/**
2 + * Copyright (c) 2013-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +if (process.env.NODE_ENV !== 'production') {
9 + var ReactIs = require('react-is');
10 +
11 + // By explicitly using `prop-types` you are opting into new development behavior.
12 + // http://fb.me/prop-types-in-prod
13 + var throwOnDirectAccess = true;
14 + module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);
15 +} else {
16 + // By explicitly using `prop-types` you are opting into new production behavior.
17 + // http://fb.me/prop-types-in-prod
18 + module.exports = require('./factoryWithThrowingShims')();
19 +}
1 +/**
2 + * Copyright (c) 2013-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +'use strict';
9 +
10 +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
11 +
12 +module.exports = ReactPropTypesSecret;
1 +{
2 + "_from": "prop-types@^15.6.2",
3 + "_id": "prop-types@15.7.2",
4 + "_inBundle": false,
5 + "_integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
6 + "_location": "/prop-types",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "prop-types@^15.6.2",
12 + "name": "prop-types",
13 + "escapedName": "prop-types",
14 + "rawSpec": "^15.6.2",
15 + "saveSpec": null,
16 + "fetchSpec": "^15.6.2"
17 + },
18 + "_requiredBy": [
19 + "/react-router",
20 + "/react-router-dom"
21 + ],
22 + "_resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
23 + "_shasum": "52c41e75b8c87e72b9d9360e0206b99dcbffa6c5",
24 + "_spec": "prop-types@^15.6.2",
25 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router-dom",
26 + "browserify": {
27 + "transform": [
28 + "loose-envify"
29 + ]
30 + },
31 + "bugs": {
32 + "url": "https://github.com/facebook/prop-types/issues"
33 + },
34 + "bundleDependencies": false,
35 + "dependencies": {
36 + "loose-envify": "^1.4.0",
37 + "object-assign": "^4.1.1",
38 + "react-is": "^16.8.1"
39 + },
40 + "deprecated": false,
41 + "description": "Runtime type checking for React props and similar objects.",
42 + "devDependencies": {
43 + "babel-jest": "^19.0.0",
44 + "babel-preset-react": "^6.24.1",
45 + "browserify": "^16.2.3",
46 + "bundle-collapser": "^1.2.1",
47 + "eslint": "^5.13.0",
48 + "jest": "^19.0.2",
49 + "react": "^15.5.1",
50 + "uglifyify": "^3.0.4",
51 + "uglifyjs": "^2.4.10"
52 + },
53 + "files": [
54 + "LICENSE",
55 + "README.md",
56 + "checkPropTypes.js",
57 + "factory.js",
58 + "factoryWithThrowingShims.js",
59 + "factoryWithTypeCheckers.js",
60 + "index.js",
61 + "prop-types.js",
62 + "prop-types.min.js",
63 + "lib"
64 + ],
65 + "homepage": "https://facebook.github.io/react/",
66 + "keywords": [
67 + "react"
68 + ],
69 + "license": "MIT",
70 + "main": "index.js",
71 + "name": "prop-types",
72 + "repository": {
73 + "type": "git",
74 + "url": "git+https://github.com/facebook/prop-types.git"
75 + },
76 + "scripts": {
77 + "build": "yarn umd && yarn umd-min",
78 + "lint": "eslint .",
79 + "prepublish": "yarn build",
80 + "pretest": "npm run lint",
81 + "test": "npm run tests-only",
82 + "tests-only": "jest",
83 + "umd": "NODE_ENV=development browserify index.js -t loose-envify --standalone PropTypes -o prop-types.js",
84 + "umd-min": "NODE_ENV=production browserify index.js -t loose-envify -t uglifyify --standalone PropTypes -p bundle-collapser/plugin -o | uglifyjs --compress unused,dead_code -o prop-types.min.js"
85 + },
86 + "version": "15.7.2"
87 +}
1 +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PropTypes = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2 +/**
3 + * Copyright (c) 2013-present, Facebook, Inc.
4 + *
5 + * This source code is licensed under the MIT license found in the
6 + * LICENSE file in the root directory of this source tree.
7 + */
8 +
9 +'use strict';
10 +
11 +var printWarning = function() {};
12 +
13 +if ("development" !== 'production') {
14 + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
15 + var loggedTypeFailures = {};
16 + var has = Function.call.bind(Object.prototype.hasOwnProperty);
17 +
18 + printWarning = function(text) {
19 + var message = 'Warning: ' + text;
20 + if (typeof console !== 'undefined') {
21 + console.error(message);
22 + }
23 + try {
24 + // --- Welcome to debugging React ---
25 + // This error was thrown as a convenience so that you can use this stack
26 + // to find the callsite that caused this warning to fire.
27 + throw new Error(message);
28 + } catch (x) {}
29 + };
30 +}
31 +
32 +/**
33 + * Assert that the values match with the type specs.
34 + * Error messages are memorized and will only be shown once.
35 + *
36 + * @param {object} typeSpecs Map of name to a ReactPropType
37 + * @param {object} values Runtime values that need to be type-checked
38 + * @param {string} location e.g. "prop", "context", "child context"
39 + * @param {string} componentName Name of the component for error messages.
40 + * @param {?Function} getStack Returns the component stack.
41 + * @private
42 + */
43 +function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
44 + if ("development" !== 'production') {
45 + for (var typeSpecName in typeSpecs) {
46 + if (has(typeSpecs, typeSpecName)) {
47 + var error;
48 + // Prop type validation may throw. In case they do, we don't want to
49 + // fail the render phase where it didn't fail before. So we log it.
50 + // After these have been cleaned up, we'll let them throw.
51 + try {
52 + // This is intentionally an invariant that gets caught. It's the same
53 + // behavior as without this statement except with a better message.
54 + if (typeof typeSpecs[typeSpecName] !== 'function') {
55 + var err = Error(
56 + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
57 + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
58 + );
59 + err.name = 'Invariant Violation';
60 + throw err;
61 + }
62 + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
63 + } catch (ex) {
64 + error = ex;
65 + }
66 + if (error && !(error instanceof Error)) {
67 + printWarning(
68 + (componentName || 'React class') + ': type specification of ' +
69 + location + ' `' + typeSpecName + '` is invalid; the type checker ' +
70 + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
71 + 'You may have forgotten to pass an argument to the type checker ' +
72 + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
73 + 'shape all require an argument).'
74 + );
75 + }
76 + if (error instanceof Error && !(error.message in loggedTypeFailures)) {
77 + // Only monitor this failure once because there tends to be a lot of the
78 + // same error.
79 + loggedTypeFailures[error.message] = true;
80 +
81 + var stack = getStack ? getStack() : '';
82 +
83 + printWarning(
84 + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
85 + );
86 + }
87 + }
88 + }
89 + }
90 +}
91 +
92 +/**
93 + * Resets warning cache when testing.
94 + *
95 + * @private
96 + */
97 +checkPropTypes.resetWarningCache = function() {
98 + if ("development" !== 'production') {
99 + loggedTypeFailures = {};
100 + }
101 +}
102 +
103 +module.exports = checkPropTypes;
104 +
105 +},{"./lib/ReactPropTypesSecret":5}],2:[function(require,module,exports){
106 +/**
107 + * Copyright (c) 2013-present, Facebook, Inc.
108 + *
109 + * This source code is licensed under the MIT license found in the
110 + * LICENSE file in the root directory of this source tree.
111 + */
112 +
113 +'use strict';
114 +
115 +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
116 +
117 +function emptyFunction() {}
118 +function emptyFunctionWithReset() {}
119 +emptyFunctionWithReset.resetWarningCache = emptyFunction;
120 +
121 +module.exports = function() {
122 + function shim(props, propName, componentName, location, propFullName, secret) {
123 + if (secret === ReactPropTypesSecret) {
124 + // It is still safe when called from React.
125 + return;
126 + }
127 + var err = new Error(
128 + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
129 + 'Use PropTypes.checkPropTypes() to call them. ' +
130 + 'Read more at http://fb.me/use-check-prop-types'
131 + );
132 + err.name = 'Invariant Violation';
133 + throw err;
134 + };
135 + shim.isRequired = shim;
136 + function getShim() {
137 + return shim;
138 + };
139 + // Important!
140 + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
141 + var ReactPropTypes = {
142 + array: shim,
143 + bool: shim,
144 + func: shim,
145 + number: shim,
146 + object: shim,
147 + string: shim,
148 + symbol: shim,
149 +
150 + any: shim,
151 + arrayOf: getShim,
152 + element: shim,
153 + elementType: shim,
154 + instanceOf: getShim,
155 + node: shim,
156 + objectOf: getShim,
157 + oneOf: getShim,
158 + oneOfType: getShim,
159 + shape: getShim,
160 + exact: getShim,
161 +
162 + checkPropTypes: emptyFunctionWithReset,
163 + resetWarningCache: emptyFunction
164 + };
165 +
166 + ReactPropTypes.PropTypes = ReactPropTypes;
167 +
168 + return ReactPropTypes;
169 +};
170 +
171 +},{"./lib/ReactPropTypesSecret":5}],3:[function(require,module,exports){
172 +/**
173 + * Copyright (c) 2013-present, Facebook, Inc.
174 + *
175 + * This source code is licensed under the MIT license found in the
176 + * LICENSE file in the root directory of this source tree.
177 + */
178 +
179 +'use strict';
180 +
181 +var ReactIs = require('react-is');
182 +var assign = require('object-assign');
183 +
184 +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
185 +var checkPropTypes = require('./checkPropTypes');
186 +
187 +var has = Function.call.bind(Object.prototype.hasOwnProperty);
188 +var printWarning = function() {};
189 +
190 +if ("development" !== 'production') {
191 + printWarning = function(text) {
192 + var message = 'Warning: ' + text;
193 + if (typeof console !== 'undefined') {
194 + console.error(message);
195 + }
196 + try {
197 + // --- Welcome to debugging React ---
198 + // This error was thrown as a convenience so that you can use this stack
199 + // to find the callsite that caused this warning to fire.
200 + throw new Error(message);
201 + } catch (x) {}
202 + };
203 +}
204 +
205 +function emptyFunctionThatReturnsNull() {
206 + return null;
207 +}
208 +
209 +module.exports = function(isValidElement, throwOnDirectAccess) {
210 + /* global Symbol */
211 + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
212 + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
213 +
214 + /**
215 + * Returns the iterator method function contained on the iterable object.
216 + *
217 + * Be sure to invoke the function with the iterable as context:
218 + *
219 + * var iteratorFn = getIteratorFn(myIterable);
220 + * if (iteratorFn) {
221 + * var iterator = iteratorFn.call(myIterable);
222 + * ...
223 + * }
224 + *
225 + * @param {?object} maybeIterable
226 + * @return {?function}
227 + */
228 + function getIteratorFn(maybeIterable) {
229 + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
230 + if (typeof iteratorFn === 'function') {
231 + return iteratorFn;
232 + }
233 + }
234 +
235 + /**
236 + * Collection of methods that allow declaration and validation of props that are
237 + * supplied to React components. Example usage:
238 + *
239 + * var Props = require('ReactPropTypes');
240 + * var MyArticle = React.createClass({
241 + * propTypes: {
242 + * // An optional string prop named "description".
243 + * description: Props.string,
244 + *
245 + * // A required enum prop named "category".
246 + * category: Props.oneOf(['News','Photos']).isRequired,
247 + *
248 + * // A prop named "dialog" that requires an instance of Dialog.
249 + * dialog: Props.instanceOf(Dialog).isRequired
250 + * },
251 + * render: function() { ... }
252 + * });
253 + *
254 + * A more formal specification of how these methods are used:
255 + *
256 + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
257 + * decl := ReactPropTypes.{type}(.isRequired)?
258 + *
259 + * Each and every declaration produces a function with the same signature. This
260 + * allows the creation of custom validation functions. For example:
261 + *
262 + * var MyLink = React.createClass({
263 + * propTypes: {
264 + * // An optional string or URI prop named "href".
265 + * href: function(props, propName, componentName) {
266 + * var propValue = props[propName];
267 + * if (propValue != null && typeof propValue !== 'string' &&
268 + * !(propValue instanceof URI)) {
269 + * return new Error(
270 + * 'Expected a string or an URI for ' + propName + ' in ' +
271 + * componentName
272 + * );
273 + * }
274 + * }
275 + * },
276 + * render: function() {...}
277 + * });
278 + *
279 + * @internal
280 + */
281 +
282 + var ANONYMOUS = '<<anonymous>>';
283 +
284 + // Important!
285 + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
286 + var ReactPropTypes = {
287 + array: createPrimitiveTypeChecker('array'),
288 + bool: createPrimitiveTypeChecker('boolean'),
289 + func: createPrimitiveTypeChecker('function'),
290 + number: createPrimitiveTypeChecker('number'),
291 + object: createPrimitiveTypeChecker('object'),
292 + string: createPrimitiveTypeChecker('string'),
293 + symbol: createPrimitiveTypeChecker('symbol'),
294 +
295 + any: createAnyTypeChecker(),
296 + arrayOf: createArrayOfTypeChecker,
297 + element: createElementTypeChecker(),
298 + elementType: createElementTypeTypeChecker(),
299 + instanceOf: createInstanceTypeChecker,
300 + node: createNodeChecker(),
301 + objectOf: createObjectOfTypeChecker,
302 + oneOf: createEnumTypeChecker,
303 + oneOfType: createUnionTypeChecker,
304 + shape: createShapeTypeChecker,
305 + exact: createStrictShapeTypeChecker,
306 + };
307 +
308 + /**
309 + * inlined Object.is polyfill to avoid requiring consumers ship their own
310 + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
311 + */
312 + /*eslint-disable no-self-compare*/
313 + function is(x, y) {
314 + // SameValue algorithm
315 + if (x === y) {
316 + // Steps 1-5, 7-10
317 + // Steps 6.b-6.e: +0 != -0
318 + return x !== 0 || 1 / x === 1 / y;
319 + } else {
320 + // Step 6.a: NaN == NaN
321 + return x !== x && y !== y;
322 + }
323 + }
324 + /*eslint-enable no-self-compare*/
325 +
326 + /**
327 + * We use an Error-like object for backward compatibility as people may call
328 + * PropTypes directly and inspect their output. However, we don't use real
329 + * Errors anymore. We don't inspect their stack anyway, and creating them
330 + * is prohibitively expensive if they are created too often, such as what
331 + * happens in oneOfType() for any type before the one that matched.
332 + */
333 + function PropTypeError(message) {
334 + this.message = message;
335 + this.stack = '';
336 + }
337 + // Make `instanceof Error` still work for returned errors.
338 + PropTypeError.prototype = Error.prototype;
339 +
340 + function createChainableTypeChecker(validate) {
341 + if ("development" !== 'production') {
342 + var manualPropTypeCallCache = {};
343 + var manualPropTypeWarningCount = 0;
344 + }
345 + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
346 + componentName = componentName || ANONYMOUS;
347 + propFullName = propFullName || propName;
348 +
349 + if (secret !== ReactPropTypesSecret) {
350 + if (throwOnDirectAccess) {
351 + // New behavior only for users of `prop-types` package
352 + var err = new Error(
353 + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
354 + 'Use `PropTypes.checkPropTypes()` to call them. ' +
355 + 'Read more at http://fb.me/use-check-prop-types'
356 + );
357 + err.name = 'Invariant Violation';
358 + throw err;
359 + } else if ("development" !== 'production' && typeof console !== 'undefined') {
360 + // Old behavior for people using React.PropTypes
361 + var cacheKey = componentName + ':' + propName;
362 + if (
363 + !manualPropTypeCallCache[cacheKey] &&
364 + // Avoid spamming the console because they are often not actionable except for lib authors
365 + manualPropTypeWarningCount < 3
366 + ) {
367 + printWarning(
368 + 'You are manually calling a React.PropTypes validation ' +
369 + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
370 + 'and will throw in the standalone `prop-types` package. ' +
371 + 'You may be seeing this warning due to a third-party PropTypes ' +
372 + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
373 + );
374 + manualPropTypeCallCache[cacheKey] = true;
375 + manualPropTypeWarningCount++;
376 + }
377 + }
378 + }
379 + if (props[propName] == null) {
380 + if (isRequired) {
381 + if (props[propName] === null) {
382 + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
383 + }
384 + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
385 + }
386 + return null;
387 + } else {
388 + return validate(props, propName, componentName, location, propFullName);
389 + }
390 + }
391 +
392 + var chainedCheckType = checkType.bind(null, false);
393 + chainedCheckType.isRequired = checkType.bind(null, true);
394 +
395 + return chainedCheckType;
396 + }
397 +
398 + function createPrimitiveTypeChecker(expectedType) {
399 + function validate(props, propName, componentName, location, propFullName, secret) {
400 + var propValue = props[propName];
401 + var propType = getPropType(propValue);
402 + if (propType !== expectedType) {
403 + // `propValue` being instance of, say, date/regexp, pass the 'object'
404 + // check, but we can offer a more precise error message here rather than
405 + // 'of type `object`'.
406 + var preciseType = getPreciseType(propValue);
407 +
408 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
409 + }
410 + return null;
411 + }
412 + return createChainableTypeChecker(validate);
413 + }
414 +
415 + function createAnyTypeChecker() {
416 + return createChainableTypeChecker(emptyFunctionThatReturnsNull);
417 + }
418 +
419 + function createArrayOfTypeChecker(typeChecker) {
420 + function validate(props, propName, componentName, location, propFullName) {
421 + if (typeof typeChecker !== 'function') {
422 + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
423 + }
424 + var propValue = props[propName];
425 + if (!Array.isArray(propValue)) {
426 + var propType = getPropType(propValue);
427 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
428 + }
429 + for (var i = 0; i < propValue.length; i++) {
430 + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
431 + if (error instanceof Error) {
432 + return error;
433 + }
434 + }
435 + return null;
436 + }
437 + return createChainableTypeChecker(validate);
438 + }
439 +
440 + function createElementTypeChecker() {
441 + function validate(props, propName, componentName, location, propFullName) {
442 + var propValue = props[propName];
443 + if (!isValidElement(propValue)) {
444 + var propType = getPropType(propValue);
445 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
446 + }
447 + return null;
448 + }
449 + return createChainableTypeChecker(validate);
450 + }
451 +
452 + function createElementTypeTypeChecker() {
453 + function validate(props, propName, componentName, location, propFullName) {
454 + var propValue = props[propName];
455 + if (!ReactIs.isValidElementType(propValue)) {
456 + var propType = getPropType(propValue);
457 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
458 + }
459 + return null;
460 + }
461 + return createChainableTypeChecker(validate);
462 + }
463 +
464 + function createInstanceTypeChecker(expectedClass) {
465 + function validate(props, propName, componentName, location, propFullName) {
466 + if (!(props[propName] instanceof expectedClass)) {
467 + var expectedClassName = expectedClass.name || ANONYMOUS;
468 + var actualClassName = getClassName(props[propName]);
469 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
470 + }
471 + return null;
472 + }
473 + return createChainableTypeChecker(validate);
474 + }
475 +
476 + function createEnumTypeChecker(expectedValues) {
477 + if (!Array.isArray(expectedValues)) {
478 + if ("development" !== 'production') {
479 + if (arguments.length > 1) {
480 + printWarning(
481 + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
482 + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
483 + );
484 + } else {
485 + printWarning('Invalid argument supplied to oneOf, expected an array.');
486 + }
487 + }
488 + return emptyFunctionThatReturnsNull;
489 + }
490 +
491 + function validate(props, propName, componentName, location, propFullName) {
492 + var propValue = props[propName];
493 + for (var i = 0; i < expectedValues.length; i++) {
494 + if (is(propValue, expectedValues[i])) {
495 + return null;
496 + }
497 + }
498 +
499 + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
500 + var type = getPreciseType(value);
501 + if (type === 'symbol') {
502 + return String(value);
503 + }
504 + return value;
505 + });
506 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
507 + }
508 + return createChainableTypeChecker(validate);
509 + }
510 +
511 + function createObjectOfTypeChecker(typeChecker) {
512 + function validate(props, propName, componentName, location, propFullName) {
513 + if (typeof typeChecker !== 'function') {
514 + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
515 + }
516 + var propValue = props[propName];
517 + var propType = getPropType(propValue);
518 + if (propType !== 'object') {
519 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
520 + }
521 + for (var key in propValue) {
522 + if (has(propValue, key)) {
523 + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
524 + if (error instanceof Error) {
525 + return error;
526 + }
527 + }
528 + }
529 + return null;
530 + }
531 + return createChainableTypeChecker(validate);
532 + }
533 +
534 + function createUnionTypeChecker(arrayOfTypeCheckers) {
535 + if (!Array.isArray(arrayOfTypeCheckers)) {
536 + "development" !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
537 + return emptyFunctionThatReturnsNull;
538 + }
539 +
540 + for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
541 + var checker = arrayOfTypeCheckers[i];
542 + if (typeof checker !== 'function') {
543 + printWarning(
544 + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
545 + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
546 + );
547 + return emptyFunctionThatReturnsNull;
548 + }
549 + }
550 +
551 + function validate(props, propName, componentName, location, propFullName) {
552 + for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
553 + var checker = arrayOfTypeCheckers[i];
554 + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
555 + return null;
556 + }
557 + }
558 +
559 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
560 + }
561 + return createChainableTypeChecker(validate);
562 + }
563 +
564 + function createNodeChecker() {
565 + function validate(props, propName, componentName, location, propFullName) {
566 + if (!isNode(props[propName])) {
567 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
568 + }
569 + return null;
570 + }
571 + return createChainableTypeChecker(validate);
572 + }
573 +
574 + function createShapeTypeChecker(shapeTypes) {
575 + function validate(props, propName, componentName, location, propFullName) {
576 + var propValue = props[propName];
577 + var propType = getPropType(propValue);
578 + if (propType !== 'object') {
579 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
580 + }
581 + for (var key in shapeTypes) {
582 + var checker = shapeTypes[key];
583 + if (!checker) {
584 + continue;
585 + }
586 + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
587 + if (error) {
588 + return error;
589 + }
590 + }
591 + return null;
592 + }
593 + return createChainableTypeChecker(validate);
594 + }
595 +
596 + function createStrictShapeTypeChecker(shapeTypes) {
597 + function validate(props, propName, componentName, location, propFullName) {
598 + var propValue = props[propName];
599 + var propType = getPropType(propValue);
600 + if (propType !== 'object') {
601 + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
602 + }
603 + // We need to check all keys in case some are required but missing from
604 + // props.
605 + var allKeys = assign({}, props[propName], shapeTypes);
606 + for (var key in allKeys) {
607 + var checker = shapeTypes[key];
608 + if (!checker) {
609 + return new PropTypeError(
610 + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
611 + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
612 + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
613 + );
614 + }
615 + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
616 + if (error) {
617 + return error;
618 + }
619 + }
620 + return null;
621 + }
622 +
623 + return createChainableTypeChecker(validate);
624 + }
625 +
626 + function isNode(propValue) {
627 + switch (typeof propValue) {
628 + case 'number':
629 + case 'string':
630 + case 'undefined':
631 + return true;
632 + case 'boolean':
633 + return !propValue;
634 + case 'object':
635 + if (Array.isArray(propValue)) {
636 + return propValue.every(isNode);
637 + }
638 + if (propValue === null || isValidElement(propValue)) {
639 + return true;
640 + }
641 +
642 + var iteratorFn = getIteratorFn(propValue);
643 + if (iteratorFn) {
644 + var iterator = iteratorFn.call(propValue);
645 + var step;
646 + if (iteratorFn !== propValue.entries) {
647 + while (!(step = iterator.next()).done) {
648 + if (!isNode(step.value)) {
649 + return false;
650 + }
651 + }
652 + } else {
653 + // Iterator will provide entry [k,v] tuples rather than values.
654 + while (!(step = iterator.next()).done) {
655 + var entry = step.value;
656 + if (entry) {
657 + if (!isNode(entry[1])) {
658 + return false;
659 + }
660 + }
661 + }
662 + }
663 + } else {
664 + return false;
665 + }
666 +
667 + return true;
668 + default:
669 + return false;
670 + }
671 + }
672 +
673 + function isSymbol(propType, propValue) {
674 + // Native Symbol.
675 + if (propType === 'symbol') {
676 + return true;
677 + }
678 +
679 + // falsy value can't be a Symbol
680 + if (!propValue) {
681 + return false;
682 + }
683 +
684 + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
685 + if (propValue['@@toStringTag'] === 'Symbol') {
686 + return true;
687 + }
688 +
689 + // Fallback for non-spec compliant Symbols which are polyfilled.
690 + if (typeof Symbol === 'function' && propValue instanceof Symbol) {
691 + return true;
692 + }
693 +
694 + return false;
695 + }
696 +
697 + // Equivalent of `typeof` but with special handling for array and regexp.
698 + function getPropType(propValue) {
699 + var propType = typeof propValue;
700 + if (Array.isArray(propValue)) {
701 + return 'array';
702 + }
703 + if (propValue instanceof RegExp) {
704 + // Old webkits (at least until Android 4.0) return 'function' rather than
705 + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
706 + // passes PropTypes.object.
707 + return 'object';
708 + }
709 + if (isSymbol(propType, propValue)) {
710 + return 'symbol';
711 + }
712 + return propType;
713 + }
714 +
715 + // This handles more types than `getPropType`. Only used for error messages.
716 + // See `createPrimitiveTypeChecker`.
717 + function getPreciseType(propValue) {
718 + if (typeof propValue === 'undefined' || propValue === null) {
719 + return '' + propValue;
720 + }
721 + var propType = getPropType(propValue);
722 + if (propType === 'object') {
723 + if (propValue instanceof Date) {
724 + return 'date';
725 + } else if (propValue instanceof RegExp) {
726 + return 'regexp';
727 + }
728 + }
729 + return propType;
730 + }
731 +
732 + // Returns a string that is postfixed to a warning about an invalid type.
733 + // For example, "undefined" or "of type array"
734 + function getPostfixForTypeWarning(value) {
735 + var type = getPreciseType(value);
736 + switch (type) {
737 + case 'array':
738 + case 'object':
739 + return 'an ' + type;
740 + case 'boolean':
741 + case 'date':
742 + case 'regexp':
743 + return 'a ' + type;
744 + default:
745 + return type;
746 + }
747 + }
748 +
749 + // Returns class name of the object, if any.
750 + function getClassName(propValue) {
751 + if (!propValue.constructor || !propValue.constructor.name) {
752 + return ANONYMOUS;
753 + }
754 + return propValue.constructor.name;
755 + }
756 +
757 + ReactPropTypes.checkPropTypes = checkPropTypes;
758 + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
759 + ReactPropTypes.PropTypes = ReactPropTypes;
760 +
761 + return ReactPropTypes;
762 +};
763 +
764 +},{"./checkPropTypes":1,"./lib/ReactPropTypesSecret":5,"object-assign":6,"react-is":10}],4:[function(require,module,exports){
765 +/**
766 + * Copyright (c) 2013-present, Facebook, Inc.
767 + *
768 + * This source code is licensed under the MIT license found in the
769 + * LICENSE file in the root directory of this source tree.
770 + */
771 +
772 +if ("development" !== 'production') {
773 + var ReactIs = require('react-is');
774 +
775 + // By explicitly using `prop-types` you are opting into new development behavior.
776 + // http://fb.me/prop-types-in-prod
777 + var throwOnDirectAccess = true;
778 + module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);
779 +} else {
780 + // By explicitly using `prop-types` you are opting into new production behavior.
781 + // http://fb.me/prop-types-in-prod
782 + module.exports = require('./factoryWithThrowingShims')();
783 +}
784 +
785 +},{"./factoryWithThrowingShims":2,"./factoryWithTypeCheckers":3,"react-is":10}],5:[function(require,module,exports){
786 +/**
787 + * Copyright (c) 2013-present, Facebook, Inc.
788 + *
789 + * This source code is licensed under the MIT license found in the
790 + * LICENSE file in the root directory of this source tree.
791 + */
792 +
793 +'use strict';
794 +
795 +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
796 +
797 +module.exports = ReactPropTypesSecret;
798 +
799 +},{}],6:[function(require,module,exports){
800 +/*
801 +object-assign
802 +(c) Sindre Sorhus
803 +@license MIT
804 +*/
805 +
806 +'use strict';
807 +/* eslint-disable no-unused-vars */
808 +var getOwnPropertySymbols = Object.getOwnPropertySymbols;
809 +var hasOwnProperty = Object.prototype.hasOwnProperty;
810 +var propIsEnumerable = Object.prototype.propertyIsEnumerable;
811 +
812 +function toObject(val) {
813 + if (val === null || val === undefined) {
814 + throw new TypeError('Object.assign cannot be called with null or undefined');
815 + }
816 +
817 + return Object(val);
818 +}
819 +
820 +function shouldUseNative() {
821 + try {
822 + if (!Object.assign) {
823 + return false;
824 + }
825 +
826 + // Detect buggy property enumeration order in older V8 versions.
827 +
828 + // https://bugs.chromium.org/p/v8/issues/detail?id=4118
829 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
830 + test1[5] = 'de';
831 + if (Object.getOwnPropertyNames(test1)[0] === '5') {
832 + return false;
833 + }
834 +
835 + // https://bugs.chromium.org/p/v8/issues/detail?id=3056
836 + var test2 = {};
837 + for (var i = 0; i < 10; i++) {
838 + test2['_' + String.fromCharCode(i)] = i;
839 + }
840 + var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
841 + return test2[n];
842 + });
843 + if (order2.join('') !== '0123456789') {
844 + return false;
845 + }
846 +
847 + // https://bugs.chromium.org/p/v8/issues/detail?id=3056
848 + var test3 = {};
849 + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
850 + test3[letter] = letter;
851 + });
852 + if (Object.keys(Object.assign({}, test3)).join('') !==
853 + 'abcdefghijklmnopqrst') {
854 + return false;
855 + }
856 +
857 + return true;
858 + } catch (err) {
859 + // We don't expect any of the above to throw, but better to be safe.
860 + return false;
861 + }
862 +}
863 +
864 +module.exports = shouldUseNative() ? Object.assign : function (target, source) {
865 + var from;
866 + var to = toObject(target);
867 + var symbols;
868 +
869 + for (var s = 1; s < arguments.length; s++) {
870 + from = Object(arguments[s]);
871 +
872 + for (var key in from) {
873 + if (hasOwnProperty.call(from, key)) {
874 + to[key] = from[key];
875 + }
876 + }
877 +
878 + if (getOwnPropertySymbols) {
879 + symbols = getOwnPropertySymbols(from);
880 + for (var i = 0; i < symbols.length; i++) {
881 + if (propIsEnumerable.call(from, symbols[i])) {
882 + to[symbols[i]] = from[symbols[i]];
883 + }
884 + }
885 + }
886 + }
887 +
888 + return to;
889 +};
890 +
891 +},{}],7:[function(require,module,exports){
892 +// shim for using process in browser
893 +var process = module.exports = {};
894 +
895 +// cached from whatever global is present so that test runners that stub it
896 +// don't break things. But we need to wrap it in a try catch in case it is
897 +// wrapped in strict mode code which doesn't define any globals. It's inside a
898 +// function because try/catches deoptimize in certain engines.
899 +
900 +var cachedSetTimeout;
901 +var cachedClearTimeout;
902 +
903 +function defaultSetTimout() {
904 + throw new Error('setTimeout has not been defined');
905 +}
906 +function defaultClearTimeout () {
907 + throw new Error('clearTimeout has not been defined');
908 +}
909 +(function () {
910 + try {
911 + if (typeof setTimeout === 'function') {
912 + cachedSetTimeout = setTimeout;
913 + } else {
914 + cachedSetTimeout = defaultSetTimout;
915 + }
916 + } catch (e) {
917 + cachedSetTimeout = defaultSetTimout;
918 + }
919 + try {
920 + if (typeof clearTimeout === 'function') {
921 + cachedClearTimeout = clearTimeout;
922 + } else {
923 + cachedClearTimeout = defaultClearTimeout;
924 + }
925 + } catch (e) {
926 + cachedClearTimeout = defaultClearTimeout;
927 + }
928 +} ())
929 +function runTimeout(fun) {
930 + if (cachedSetTimeout === setTimeout) {
931 + //normal enviroments in sane situations
932 + return setTimeout(fun, 0);
933 + }
934 + // if setTimeout wasn't available but was latter defined
935 + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
936 + cachedSetTimeout = setTimeout;
937 + return setTimeout(fun, 0);
938 + }
939 + try {
940 + // when when somebody has screwed with setTimeout but no I.E. maddness
941 + return cachedSetTimeout(fun, 0);
942 + } catch(e){
943 + try {
944 + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
945 + return cachedSetTimeout.call(null, fun, 0);
946 + } catch(e){
947 + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
948 + return cachedSetTimeout.call(this, fun, 0);
949 + }
950 + }
951 +
952 +
953 +}
954 +function runClearTimeout(marker) {
955 + if (cachedClearTimeout === clearTimeout) {
956 + //normal enviroments in sane situations
957 + return clearTimeout(marker);
958 + }
959 + // if clearTimeout wasn't available but was latter defined
960 + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
961 + cachedClearTimeout = clearTimeout;
962 + return clearTimeout(marker);
963 + }
964 + try {
965 + // when when somebody has screwed with setTimeout but no I.E. maddness
966 + return cachedClearTimeout(marker);
967 + } catch (e){
968 + try {
969 + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
970 + return cachedClearTimeout.call(null, marker);
971 + } catch (e){
972 + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
973 + // Some versions of I.E. have different rules for clearTimeout vs setTimeout
974 + return cachedClearTimeout.call(this, marker);
975 + }
976 + }
977 +
978 +
979 +
980 +}
981 +var queue = [];
982 +var draining = false;
983 +var currentQueue;
984 +var queueIndex = -1;
985 +
986 +function cleanUpNextTick() {
987 + if (!draining || !currentQueue) {
988 + return;
989 + }
990 + draining = false;
991 + if (currentQueue.length) {
992 + queue = currentQueue.concat(queue);
993 + } else {
994 + queueIndex = -1;
995 + }
996 + if (queue.length) {
997 + drainQueue();
998 + }
999 +}
1000 +
1001 +function drainQueue() {
1002 + if (draining) {
1003 + return;
1004 + }
1005 + var timeout = runTimeout(cleanUpNextTick);
1006 + draining = true;
1007 +
1008 + var len = queue.length;
1009 + while(len) {
1010 + currentQueue = queue;
1011 + queue = [];
1012 + while (++queueIndex < len) {
1013 + if (currentQueue) {
1014 + currentQueue[queueIndex].run();
1015 + }
1016 + }
1017 + queueIndex = -1;
1018 + len = queue.length;
1019 + }
1020 + currentQueue = null;
1021 + draining = false;
1022 + runClearTimeout(timeout);
1023 +}
1024 +
1025 +process.nextTick = function (fun) {
1026 + var args = new Array(arguments.length - 1);
1027 + if (arguments.length > 1) {
1028 + for (var i = 1; i < arguments.length; i++) {
1029 + args[i - 1] = arguments[i];
1030 + }
1031 + }
1032 + queue.push(new Item(fun, args));
1033 + if (queue.length === 1 && !draining) {
1034 + runTimeout(drainQueue);
1035 + }
1036 +};
1037 +
1038 +// v8 likes predictible objects
1039 +function Item(fun, array) {
1040 + this.fun = fun;
1041 + this.array = array;
1042 +}
1043 +Item.prototype.run = function () {
1044 + this.fun.apply(null, this.array);
1045 +};
1046 +process.title = 'browser';
1047 +process.browser = true;
1048 +process.env = {};
1049 +process.argv = [];
1050 +process.version = ''; // empty string to avoid regexp issues
1051 +process.versions = {};
1052 +
1053 +function noop() {}
1054 +
1055 +process.on = noop;
1056 +process.addListener = noop;
1057 +process.once = noop;
1058 +process.off = noop;
1059 +process.removeListener = noop;
1060 +process.removeAllListeners = noop;
1061 +process.emit = noop;
1062 +process.prependListener = noop;
1063 +process.prependOnceListener = noop;
1064 +
1065 +process.listeners = function (name) { return [] }
1066 +
1067 +process.binding = function (name) {
1068 + throw new Error('process.binding is not supported');
1069 +};
1070 +
1071 +process.cwd = function () { return '/' };
1072 +process.chdir = function (dir) {
1073 + throw new Error('process.chdir is not supported');
1074 +};
1075 +process.umask = function() { return 0; };
1076 +
1077 +},{}],8:[function(require,module,exports){
1078 +(function (process){
1079 +/** @license React v16.8.1
1080 + * react-is.development.js
1081 + *
1082 + * Copyright (c) Facebook, Inc. and its affiliates.
1083 + *
1084 + * This source code is licensed under the MIT license found in the
1085 + * LICENSE file in the root directory of this source tree.
1086 + */
1087 +
1088 +'use strict';
1089 +
1090 +
1091 +
1092 +if (process.env.NODE_ENV !== "production") {
1093 + (function() {
1094 +'use strict';
1095 +
1096 +Object.defineProperty(exports, '__esModule', { value: true });
1097 +
1098 +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1099 +// nor polyfill, then a plain number is used for performance.
1100 +var hasSymbol = typeof Symbol === 'function' && Symbol.for;
1101 +
1102 +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
1103 +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
1104 +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
1105 +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
1106 +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
1107 +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
1108 +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
1109 +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
1110 +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
1111 +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
1112 +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
1113 +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
1114 +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
1115 +
1116 +function isValidElementType(type) {
1117 + return typeof type === 'string' || typeof type === 'function' ||
1118 + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1119 + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
1120 +}
1121 +
1122 +/**
1123 + * Forked from fbjs/warning:
1124 + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
1125 + *
1126 + * Only change is we use console.warn instead of console.error,
1127 + * and do nothing when 'console' is not supported.
1128 + * This really simplifies the code.
1129 + * ---
1130 + * Similar to invariant but only logs a warning if the condition is not met.
1131 + * This can be used to log issues in development environments in critical
1132 + * paths. Removing the logging code for production environments will keep the
1133 + * same logic and follow the same code paths.
1134 + */
1135 +
1136 +var lowPriorityWarning = function () {};
1137 +
1138 +{
1139 + var printWarning = function (format) {
1140 + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1141 + args[_key - 1] = arguments[_key];
1142 + }
1143 +
1144 + var argIndex = 0;
1145 + var message = 'Warning: ' + format.replace(/%s/g, function () {
1146 + return args[argIndex++];
1147 + });
1148 + if (typeof console !== 'undefined') {
1149 + console.warn(message);
1150 + }
1151 + try {
1152 + // --- Welcome to debugging React ---
1153 + // This error was thrown as a convenience so that you can use this stack
1154 + // to find the callsite that caused this warning to fire.
1155 + throw new Error(message);
1156 + } catch (x) {}
1157 + };
1158 +
1159 + lowPriorityWarning = function (condition, format) {
1160 + if (format === undefined) {
1161 + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
1162 + }
1163 + if (!condition) {
1164 + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
1165 + args[_key2 - 2] = arguments[_key2];
1166 + }
1167 +
1168 + printWarning.apply(undefined, [format].concat(args));
1169 + }
1170 + };
1171 +}
1172 +
1173 +var lowPriorityWarning$1 = lowPriorityWarning;
1174 +
1175 +function typeOf(object) {
1176 + if (typeof object === 'object' && object !== null) {
1177 + var $$typeof = object.$$typeof;
1178 + switch ($$typeof) {
1179 + case REACT_ELEMENT_TYPE:
1180 + var type = object.type;
1181 +
1182 + switch (type) {
1183 + case REACT_ASYNC_MODE_TYPE:
1184 + case REACT_CONCURRENT_MODE_TYPE:
1185 + case REACT_FRAGMENT_TYPE:
1186 + case REACT_PROFILER_TYPE:
1187 + case REACT_STRICT_MODE_TYPE:
1188 + case REACT_SUSPENSE_TYPE:
1189 + return type;
1190 + default:
1191 + var $$typeofType = type && type.$$typeof;
1192 +
1193 + switch ($$typeofType) {
1194 + case REACT_CONTEXT_TYPE:
1195 + case REACT_FORWARD_REF_TYPE:
1196 + case REACT_PROVIDER_TYPE:
1197 + return $$typeofType;
1198 + default:
1199 + return $$typeof;
1200 + }
1201 + }
1202 + case REACT_LAZY_TYPE:
1203 + case REACT_MEMO_TYPE:
1204 + case REACT_PORTAL_TYPE:
1205 + return $$typeof;
1206 + }
1207 + }
1208 +
1209 + return undefined;
1210 +}
1211 +
1212 +// AsyncMode is deprecated along with isAsyncMode
1213 +var AsyncMode = REACT_ASYNC_MODE_TYPE;
1214 +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
1215 +var ContextConsumer = REACT_CONTEXT_TYPE;
1216 +var ContextProvider = REACT_PROVIDER_TYPE;
1217 +var Element = REACT_ELEMENT_TYPE;
1218 +var ForwardRef = REACT_FORWARD_REF_TYPE;
1219 +var Fragment = REACT_FRAGMENT_TYPE;
1220 +var Lazy = REACT_LAZY_TYPE;
1221 +var Memo = REACT_MEMO_TYPE;
1222 +var Portal = REACT_PORTAL_TYPE;
1223 +var Profiler = REACT_PROFILER_TYPE;
1224 +var StrictMode = REACT_STRICT_MODE_TYPE;
1225 +var Suspense = REACT_SUSPENSE_TYPE;
1226 +
1227 +var hasWarnedAboutDeprecatedIsAsyncMode = false;
1228 +
1229 +// AsyncMode should be deprecated
1230 +function isAsyncMode(object) {
1231 + {
1232 + if (!hasWarnedAboutDeprecatedIsAsyncMode) {
1233 + hasWarnedAboutDeprecatedIsAsyncMode = true;
1234 + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
1235 + }
1236 + }
1237 + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
1238 +}
1239 +function isConcurrentMode(object) {
1240 + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
1241 +}
1242 +function isContextConsumer(object) {
1243 + return typeOf(object) === REACT_CONTEXT_TYPE;
1244 +}
1245 +function isContextProvider(object) {
1246 + return typeOf(object) === REACT_PROVIDER_TYPE;
1247 +}
1248 +function isElement(object) {
1249 + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1250 +}
1251 +function isForwardRef(object) {
1252 + return typeOf(object) === REACT_FORWARD_REF_TYPE;
1253 +}
1254 +function isFragment(object) {
1255 + return typeOf(object) === REACT_FRAGMENT_TYPE;
1256 +}
1257 +function isLazy(object) {
1258 + return typeOf(object) === REACT_LAZY_TYPE;
1259 +}
1260 +function isMemo(object) {
1261 + return typeOf(object) === REACT_MEMO_TYPE;
1262 +}
1263 +function isPortal(object) {
1264 + return typeOf(object) === REACT_PORTAL_TYPE;
1265 +}
1266 +function isProfiler(object) {
1267 + return typeOf(object) === REACT_PROFILER_TYPE;
1268 +}
1269 +function isStrictMode(object) {
1270 + return typeOf(object) === REACT_STRICT_MODE_TYPE;
1271 +}
1272 +function isSuspense(object) {
1273 + return typeOf(object) === REACT_SUSPENSE_TYPE;
1274 +}
1275 +
1276 +exports.typeOf = typeOf;
1277 +exports.AsyncMode = AsyncMode;
1278 +exports.ConcurrentMode = ConcurrentMode;
1279 +exports.ContextConsumer = ContextConsumer;
1280 +exports.ContextProvider = ContextProvider;
1281 +exports.Element = Element;
1282 +exports.ForwardRef = ForwardRef;
1283 +exports.Fragment = Fragment;
1284 +exports.Lazy = Lazy;
1285 +exports.Memo = Memo;
1286 +exports.Portal = Portal;
1287 +exports.Profiler = Profiler;
1288 +exports.StrictMode = StrictMode;
1289 +exports.Suspense = Suspense;
1290 +exports.isValidElementType = isValidElementType;
1291 +exports.isAsyncMode = isAsyncMode;
1292 +exports.isConcurrentMode = isConcurrentMode;
1293 +exports.isContextConsumer = isContextConsumer;
1294 +exports.isContextProvider = isContextProvider;
1295 +exports.isElement = isElement;
1296 +exports.isForwardRef = isForwardRef;
1297 +exports.isFragment = isFragment;
1298 +exports.isLazy = isLazy;
1299 +exports.isMemo = isMemo;
1300 +exports.isPortal = isPortal;
1301 +exports.isProfiler = isProfiler;
1302 +exports.isStrictMode = isStrictMode;
1303 +exports.isSuspense = isSuspense;
1304 + })();
1305 +}
1306 +
1307 +}).call(this,require('_process'))
1308 +},{"_process":7}],9:[function(require,module,exports){
1309 +/** @license React v16.8.1
1310 + * react-is.production.min.js
1311 + *
1312 + * Copyright (c) Facebook, Inc. and its affiliates.
1313 + *
1314 + * This source code is licensed under the MIT license found in the
1315 + * LICENSE file in the root directory of this source tree.
1316 + */
1317 +
1318 +'use strict';Object.defineProperty(exports,"__esModule",{value:!0});
1319 +var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):
1320 +60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;
1321 +exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};
1322 +exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};
1323 +exports.isSuspense=function(a){return t(a)===p};
1324 +
1325 +},{}],10:[function(require,module,exports){
1326 +(function (process){
1327 +'use strict';
1328 +
1329 +if (process.env.NODE_ENV === 'production') {
1330 + module.exports = require('./cjs/react-is.production.min.js');
1331 +} else {
1332 + module.exports = require('./cjs/react-is.development.js');
1333 +}
1334 +
1335 +}).call(this,require('_process'))
1336 +},{"./cjs/react-is.development.js":8,"./cjs/react-is.production.min.js":9,"_process":7}]},{},[4])(4)
1337 +});
...\ No newline at end of file ...\ No newline at end of file
1 +!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.PropTypes=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function emptyFunction(){}function emptyFunctionWithReset(){}var ReactPropTypesSecret=require(3);emptyFunctionWithReset.resetWarningCache=emptyFunction,module.exports=function(){function e(e,t,n,r,o,p){if(p!==ReactPropTypesSecret){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return n.PropTypes=n,n}},{3:3}],2:[function(require,module,exports){module.exports=require(1)()},{1:1}],3:[function(require,module,exports){"use strict";module.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}]},{},[2])(2)});
...\ No newline at end of file ...\ No newline at end of file
1 +MIT License
2 +
3 +Copyright (c) Facebook, Inc. and its affiliates.
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +# `react-is`
2 +
3 +This package allows you to test arbitrary values and see if they're a particular React element type.
4 +
5 +## Installation
6 +
7 +```sh
8 +# Yarn
9 +yarn add react-is
10 +
11 +# NPM
12 +npm install react-is
13 +```
14 +
15 +## Usage
16 +
17 +### Determining if a Component is Valid
18 +
19 +```js
20 +import React from "react";
21 +import * as ReactIs from "react-is";
22 +
23 +class ClassComponent extends React.Component {
24 + render() {
25 + return React.createElement("div");
26 + }
27 +}
28 +
29 +const FunctionComponent = () => React.createElement("div");
30 +
31 +const ForwardRefComponent = React.forwardRef((props, ref) =>
32 + React.createElement(Component, { forwardedRef: ref, ...props })
33 +);
34 +
35 +const Context = React.createContext(false);
36 +
37 +ReactIs.isValidElementType("div"); // true
38 +ReactIs.isValidElementType(ClassComponent); // true
39 +ReactIs.isValidElementType(FunctionComponent); // true
40 +ReactIs.isValidElementType(ForwardRefComponent); // true
41 +ReactIs.isValidElementType(Context.Provider); // true
42 +ReactIs.isValidElementType(Context.Consumer); // true
43 +ReactIs.isValidElementType(React.createFactory("div")); // true
44 +```
45 +
46 +### Determining an Element's Type
47 +
48 +#### Context
49 +
50 +```js
51 +import React from "react";
52 +import * as ReactIs from 'react-is';
53 +
54 +const ThemeContext = React.createContext("blue");
55 +
56 +ReactIs.isContextConsumer(<ThemeContext.Consumer />); // true
57 +ReactIs.isContextProvider(<ThemeContext.Provider />); // true
58 +ReactIs.typeOf(<ThemeContext.Provider />) === ReactIs.ContextProvider; // true
59 +ReactIs.typeOf(<ThemeContext.Consumer />) === ReactIs.ContextConsumer; // true
60 +```
61 +
62 +#### Element
63 +
64 +```js
65 +import React from "react";
66 +import * as ReactIs from 'react-is';
67 +
68 +ReactIs.isElement(<div />); // true
69 +ReactIs.typeOf(<div />) === ReactIs.Element; // true
70 +```
71 +
72 +#### Fragment
73 +
74 +```js
75 +import React from "react";
76 +import * as ReactIs from 'react-is';
77 +
78 +ReactIs.isFragment(<></>); // true
79 +ReactIs.typeOf(<></>) === ReactIs.Fragment; // true
80 +```
81 +
82 +#### Portal
83 +
84 +```js
85 +import React from "react";
86 +import ReactDOM from "react-dom";
87 +import * as ReactIs from 'react-is';
88 +
89 +const div = document.createElement("div");
90 +const portal = ReactDOM.createPortal(<div />, div);
91 +
92 +ReactIs.isPortal(portal); // true
93 +ReactIs.typeOf(portal) === ReactIs.Portal; // true
94 +```
95 +
96 +#### StrictMode
97 +
98 +```js
99 +import React from "react";
100 +import * as ReactIs from 'react-is';
101 +
102 +ReactIs.isStrictMode(<React.StrictMode />); // true
103 +ReactIs.typeOf(<React.StrictMode />) === ReactIs.StrictMode; // true
104 +```
1 +{
2 + "branch": "pull/18344",
3 + "buildNumber": "106499",
4 + "checksum": "7fe5a2e",
5 + "commit": "da834083c",
6 + "environment": "ci",
7 + "reactVersion": "16.12.0-da834083c"
8 +}
1 +/** @license React v16.13.1
2 + * react-is.development.js
3 + *
4 + * Copyright (c) Facebook, Inc. and its affiliates.
5 + *
6 + * This source code is licensed under the MIT license found in the
7 + * LICENSE file in the root directory of this source tree.
8 + */
9 +
10 +'use strict';
11 +
12 +
13 +
14 +if (process.env.NODE_ENV !== "production") {
15 + (function() {
16 +'use strict';
17 +
18 +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
19 +// nor polyfill, then a plain number is used for performance.
20 +var hasSymbol = typeof Symbol === 'function' && Symbol.for;
21 +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
22 +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
23 +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
24 +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
25 +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
26 +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
27 +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
28 +// (unstable) APIs that have been removed. Can we remove the symbols?
29 +
30 +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
31 +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
32 +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
33 +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
34 +var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
35 +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
36 +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
37 +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
38 +var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
39 +var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
40 +var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
41 +
42 +function isValidElementType(type) {
43 + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
44 + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
45 +}
46 +
47 +function typeOf(object) {
48 + if (typeof object === 'object' && object !== null) {
49 + var $$typeof = object.$$typeof;
50 +
51 + switch ($$typeof) {
52 + case REACT_ELEMENT_TYPE:
53 + var type = object.type;
54 +
55 + switch (type) {
56 + case REACT_ASYNC_MODE_TYPE:
57 + case REACT_CONCURRENT_MODE_TYPE:
58 + case REACT_FRAGMENT_TYPE:
59 + case REACT_PROFILER_TYPE:
60 + case REACT_STRICT_MODE_TYPE:
61 + case REACT_SUSPENSE_TYPE:
62 + return type;
63 +
64 + default:
65 + var $$typeofType = type && type.$$typeof;
66 +
67 + switch ($$typeofType) {
68 + case REACT_CONTEXT_TYPE:
69 + case REACT_FORWARD_REF_TYPE:
70 + case REACT_LAZY_TYPE:
71 + case REACT_MEMO_TYPE:
72 + case REACT_PROVIDER_TYPE:
73 + return $$typeofType;
74 +
75 + default:
76 + return $$typeof;
77 + }
78 +
79 + }
80 +
81 + case REACT_PORTAL_TYPE:
82 + return $$typeof;
83 + }
84 + }
85 +
86 + return undefined;
87 +} // AsyncMode is deprecated along with isAsyncMode
88 +
89 +var AsyncMode = REACT_ASYNC_MODE_TYPE;
90 +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
91 +var ContextConsumer = REACT_CONTEXT_TYPE;
92 +var ContextProvider = REACT_PROVIDER_TYPE;
93 +var Element = REACT_ELEMENT_TYPE;
94 +var ForwardRef = REACT_FORWARD_REF_TYPE;
95 +var Fragment = REACT_FRAGMENT_TYPE;
96 +var Lazy = REACT_LAZY_TYPE;
97 +var Memo = REACT_MEMO_TYPE;
98 +var Portal = REACT_PORTAL_TYPE;
99 +var Profiler = REACT_PROFILER_TYPE;
100 +var StrictMode = REACT_STRICT_MODE_TYPE;
101 +var Suspense = REACT_SUSPENSE_TYPE;
102 +var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
103 +
104 +function isAsyncMode(object) {
105 + {
106 + if (!hasWarnedAboutDeprecatedIsAsyncMode) {
107 + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
108 +
109 + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
110 + }
111 + }
112 +
113 + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
114 +}
115 +function isConcurrentMode(object) {
116 + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
117 +}
118 +function isContextConsumer(object) {
119 + return typeOf(object) === REACT_CONTEXT_TYPE;
120 +}
121 +function isContextProvider(object) {
122 + return typeOf(object) === REACT_PROVIDER_TYPE;
123 +}
124 +function isElement(object) {
125 + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
126 +}
127 +function isForwardRef(object) {
128 + return typeOf(object) === REACT_FORWARD_REF_TYPE;
129 +}
130 +function isFragment(object) {
131 + return typeOf(object) === REACT_FRAGMENT_TYPE;
132 +}
133 +function isLazy(object) {
134 + return typeOf(object) === REACT_LAZY_TYPE;
135 +}
136 +function isMemo(object) {
137 + return typeOf(object) === REACT_MEMO_TYPE;
138 +}
139 +function isPortal(object) {
140 + return typeOf(object) === REACT_PORTAL_TYPE;
141 +}
142 +function isProfiler(object) {
143 + return typeOf(object) === REACT_PROFILER_TYPE;
144 +}
145 +function isStrictMode(object) {
146 + return typeOf(object) === REACT_STRICT_MODE_TYPE;
147 +}
148 +function isSuspense(object) {
149 + return typeOf(object) === REACT_SUSPENSE_TYPE;
150 +}
151 +
152 +exports.AsyncMode = AsyncMode;
153 +exports.ConcurrentMode = ConcurrentMode;
154 +exports.ContextConsumer = ContextConsumer;
155 +exports.ContextProvider = ContextProvider;
156 +exports.Element = Element;
157 +exports.ForwardRef = ForwardRef;
158 +exports.Fragment = Fragment;
159 +exports.Lazy = Lazy;
160 +exports.Memo = Memo;
161 +exports.Portal = Portal;
162 +exports.Profiler = Profiler;
163 +exports.StrictMode = StrictMode;
164 +exports.Suspense = Suspense;
165 +exports.isAsyncMode = isAsyncMode;
166 +exports.isConcurrentMode = isConcurrentMode;
167 +exports.isContextConsumer = isContextConsumer;
168 +exports.isContextProvider = isContextProvider;
169 +exports.isElement = isElement;
170 +exports.isForwardRef = isForwardRef;
171 +exports.isFragment = isFragment;
172 +exports.isLazy = isLazy;
173 +exports.isMemo = isMemo;
174 +exports.isPortal = isPortal;
175 +exports.isProfiler = isProfiler;
176 +exports.isStrictMode = isStrictMode;
177 +exports.isSuspense = isSuspense;
178 +exports.isValidElementType = isValidElementType;
179 +exports.typeOf = typeOf;
180 + })();
181 +}
1 +/** @license React v16.13.1
2 + * react-is.production.min.js
3 + *
4 + * Copyright (c) Facebook, Inc. and its affiliates.
5 + *
6 + * This source code is licensed under the MIT license found in the
7 + * LICENSE file in the root directory of this source tree.
8 + */
9 +
10 +'use strict';var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
11 +Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
12 +function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
13 +exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
14 +exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
15 +exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
1 +'use strict';
2 +
3 +if (process.env.NODE_ENV === 'production') {
4 + module.exports = require('./cjs/react-is.production.min.js');
5 +} else {
6 + module.exports = require('./cjs/react-is.development.js');
7 +}
1 +{
2 + "_from": "react-is@^16.8.1",
3 + "_id": "react-is@16.13.1",
4 + "_inBundle": false,
5 + "_integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
6 + "_location": "/react-is",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "react-is@^16.8.1",
12 + "name": "react-is",
13 + "escapedName": "react-is",
14 + "rawSpec": "^16.8.1",
15 + "saveSpec": null,
16 + "fetchSpec": "^16.8.1"
17 + },
18 + "_requiredBy": [
19 + "/hoist-non-react-statics",
20 + "/prop-types",
21 + "/react-router"
22 + ],
23 + "_resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
24 + "_shasum": "789729a4dc36de2999dc156dd6c1d9c18cea56a4",
25 + "_spec": "react-is@^16.8.1",
26 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\prop-types",
27 + "bugs": {
28 + "url": "https://github.com/facebook/react/issues"
29 + },
30 + "bundleDependencies": false,
31 + "deprecated": false,
32 + "description": "Brand checking of React Elements.",
33 + "files": [
34 + "LICENSE",
35 + "README.md",
36 + "build-info.json",
37 + "index.js",
38 + "cjs/",
39 + "umd/"
40 + ],
41 + "homepage": "https://reactjs.org/",
42 + "keywords": [
43 + "react"
44 + ],
45 + "license": "MIT",
46 + "main": "index.js",
47 + "name": "react-is",
48 + "repository": {
49 + "type": "git",
50 + "url": "git+https://github.com/facebook/react.git",
51 + "directory": "packages/react-is"
52 + },
53 + "version": "16.13.1"
54 +}
1 +/** @license React v16.13.1
2 + * react-is.development.js
3 + *
4 + * Copyright (c) Facebook, Inc. and its affiliates.
5 + *
6 + * This source code is licensed under the MIT license found in the
7 + * LICENSE file in the root directory of this source tree.
8 + */
9 +
10 +'use strict';
11 +
12 +(function (global, factory) {
13 + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
14 + typeof define === 'function' && define.amd ? define(['exports'], factory) :
15 + (global = global || self, factory(global.ReactIs = {}));
16 +}(this, (function (exports) { 'use strict';
17 +
18 + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
19 + // nor polyfill, then a plain number is used for performance.
20 + var hasSymbol = typeof Symbol === 'function' && Symbol.for;
21 + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
22 + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
23 + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
24 + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
25 + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
26 + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
27 + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
28 + // (unstable) APIs that have been removed. Can we remove the symbols?
29 +
30 + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
31 + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
32 + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
33 + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
34 + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
35 + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
36 + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
37 + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
38 + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
39 + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
40 + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
41 +
42 + function isValidElementType(type) {
43 + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
44 + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
45 + }
46 +
47 + function typeOf(object) {
48 + if (typeof object === 'object' && object !== null) {
49 + var $$typeof = object.$$typeof;
50 +
51 + switch ($$typeof) {
52 + case REACT_ELEMENT_TYPE:
53 + var type = object.type;
54 +
55 + switch (type) {
56 + case REACT_ASYNC_MODE_TYPE:
57 + case REACT_CONCURRENT_MODE_TYPE:
58 + case REACT_FRAGMENT_TYPE:
59 + case REACT_PROFILER_TYPE:
60 + case REACT_STRICT_MODE_TYPE:
61 + case REACT_SUSPENSE_TYPE:
62 + return type;
63 +
64 + default:
65 + var $$typeofType = type && type.$$typeof;
66 +
67 + switch ($$typeofType) {
68 + case REACT_CONTEXT_TYPE:
69 + case REACT_FORWARD_REF_TYPE:
70 + case REACT_LAZY_TYPE:
71 + case REACT_MEMO_TYPE:
72 + case REACT_PROVIDER_TYPE:
73 + return $$typeofType;
74 +
75 + default:
76 + return $$typeof;
77 + }
78 +
79 + }
80 +
81 + case REACT_PORTAL_TYPE:
82 + return $$typeof;
83 + }
84 + }
85 +
86 + return undefined;
87 + } // AsyncMode is deprecated along with isAsyncMode
88 +
89 + var AsyncMode = REACT_ASYNC_MODE_TYPE;
90 + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
91 + var ContextConsumer = REACT_CONTEXT_TYPE;
92 + var ContextProvider = REACT_PROVIDER_TYPE;
93 + var Element = REACT_ELEMENT_TYPE;
94 + var ForwardRef = REACT_FORWARD_REF_TYPE;
95 + var Fragment = REACT_FRAGMENT_TYPE;
96 + var Lazy = REACT_LAZY_TYPE;
97 + var Memo = REACT_MEMO_TYPE;
98 + var Portal = REACT_PORTAL_TYPE;
99 + var Profiler = REACT_PROFILER_TYPE;
100 + var StrictMode = REACT_STRICT_MODE_TYPE;
101 + var Suspense = REACT_SUSPENSE_TYPE;
102 + var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
103 +
104 + function isAsyncMode(object) {
105 + {
106 + if (!hasWarnedAboutDeprecatedIsAsyncMode) {
107 + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
108 +
109 + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
110 + }
111 + }
112 +
113 + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
114 + }
115 + function isConcurrentMode(object) {
116 + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
117 + }
118 + function isContextConsumer(object) {
119 + return typeOf(object) === REACT_CONTEXT_TYPE;
120 + }
121 + function isContextProvider(object) {
122 + return typeOf(object) === REACT_PROVIDER_TYPE;
123 + }
124 + function isElement(object) {
125 + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
126 + }
127 + function isForwardRef(object) {
128 + return typeOf(object) === REACT_FORWARD_REF_TYPE;
129 + }
130 + function isFragment(object) {
131 + return typeOf(object) === REACT_FRAGMENT_TYPE;
132 + }
133 + function isLazy(object) {
134 + return typeOf(object) === REACT_LAZY_TYPE;
135 + }
136 + function isMemo(object) {
137 + return typeOf(object) === REACT_MEMO_TYPE;
138 + }
139 + function isPortal(object) {
140 + return typeOf(object) === REACT_PORTAL_TYPE;
141 + }
142 + function isProfiler(object) {
143 + return typeOf(object) === REACT_PROFILER_TYPE;
144 + }
145 + function isStrictMode(object) {
146 + return typeOf(object) === REACT_STRICT_MODE_TYPE;
147 + }
148 + function isSuspense(object) {
149 + return typeOf(object) === REACT_SUSPENSE_TYPE;
150 + }
151 +
152 + exports.AsyncMode = AsyncMode;
153 + exports.ConcurrentMode = ConcurrentMode;
154 + exports.ContextConsumer = ContextConsumer;
155 + exports.ContextProvider = ContextProvider;
156 + exports.Element = Element;
157 + exports.ForwardRef = ForwardRef;
158 + exports.Fragment = Fragment;
159 + exports.Lazy = Lazy;
160 + exports.Memo = Memo;
161 + exports.Portal = Portal;
162 + exports.Profiler = Profiler;
163 + exports.StrictMode = StrictMode;
164 + exports.Suspense = Suspense;
165 + exports.isAsyncMode = isAsyncMode;
166 + exports.isConcurrentMode = isConcurrentMode;
167 + exports.isContextConsumer = isContextConsumer;
168 + exports.isContextProvider = isContextProvider;
169 + exports.isElement = isElement;
170 + exports.isForwardRef = isForwardRef;
171 + exports.isFragment = isFragment;
172 + exports.isLazy = isLazy;
173 + exports.isMemo = isMemo;
174 + exports.isPortal = isPortal;
175 + exports.isProfiler = isProfiler;
176 + exports.isStrictMode = isStrictMode;
177 + exports.isSuspense = isSuspense;
178 + exports.isValidElementType = isValidElementType;
179 + exports.typeOf = typeOf;
180 +
181 +})));
1 +/** @license React v16.13.1
2 + * react-is.production.min.js
3 + *
4 + * Copyright (c) Facebook, Inc. and its affiliates.
5 + *
6 + * This source code is licensed under the MIT license found in the
7 + * LICENSE file in the root directory of this source tree.
8 + */
9 +'use strict';(function(b,d){"object"===typeof exports&&"undefined"!==typeof module?d(exports):"function"===typeof define&&define.amd?define(["exports"],d):(b=b||self,d(b.ReactIs={}))})(this,function(b){function d(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case r:switch(a=a.type,a){case t:case e:case f:case g:case h:case k:return a;default:switch(a=a&&a.$$typeof,a){case l:case m:case n:case p:case q:return a;default:return b}}case u:return b}}}function v(a){return d(a)===e}var c=
10 +"function"===typeof Symbol&&Symbol.for,r=c?Symbol.for("react.element"):60103,u=c?Symbol.for("react.portal"):60106,f=c?Symbol.for("react.fragment"):60107,h=c?Symbol.for("react.strict_mode"):60108,g=c?Symbol.for("react.profiler"):60114,q=c?Symbol.for("react.provider"):60109,l=c?Symbol.for("react.context"):60110,t=c?Symbol.for("react.async_mode"):60111,e=c?Symbol.for("react.concurrent_mode"):60111,m=c?Symbol.for("react.forward_ref"):60112,k=c?Symbol.for("react.suspense"):60113,w=c?Symbol.for("react.suspense_list"):
11 +60120,p=c?Symbol.for("react.memo"):60115,n=c?Symbol.for("react.lazy"):60116,x=c?Symbol.for("react.block"):60121,y=c?Symbol.for("react.fundamental"):60117,z=c?Symbol.for("react.responder"):60118,A=c?Symbol.for("react.scope"):60119;b.AsyncMode=t;b.ConcurrentMode=e;b.ContextConsumer=l;b.ContextProvider=q;b.Element=r;b.ForwardRef=m;b.Fragment=f;b.Lazy=n;b.Memo=p;b.Portal=u;b.Profiler=g;b.StrictMode=h;b.Suspense=k;b.isAsyncMode=function(a){return v(a)||d(a)===t};b.isConcurrentMode=v;b.isContextConsumer=
12 +function(a){return d(a)===l};b.isContextProvider=function(a){return d(a)===q};b.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===r};b.isForwardRef=function(a){return d(a)===m};b.isFragment=function(a){return d(a)===f};b.isLazy=function(a){return d(a)===n};b.isMemo=function(a){return d(a)===p};b.isPortal=function(a){return d(a)===u};b.isProfiler=function(a){return d(a)===g};b.isStrictMode=function(a){return d(a)===h};b.isSuspense=function(a){return d(a)===k};b.isValidElementType=
13 +function(a){return"string"===typeof a||"function"===typeof a||a===f||a===e||a===g||a===h||a===k||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===n||a.$$typeof===p||a.$$typeof===q||a.$$typeof===l||a.$$typeof===m||a.$$typeof===y||a.$$typeof===z||a.$$typeof===A||a.$$typeof===x)};b.typeOf=d});
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("BrowserRouter");
3 +module.exports = require("./index.js").BrowserRouter;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("HashRouter");
3 +module.exports = require("./index.js").HashRouter;
1 +MIT License
2 +
3 +Copyright (c) React Training 2016-2018
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Link");
3 +module.exports = require("./index.js").Link;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("MemoryRouter");
3 +module.exports = require("./index.js").MemoryRouter;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("NavLink");
3 +module.exports = require("./index.js").NavLink;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Prompt");
3 +module.exports = require("./index.js").Prompt;
1 +# react-router-dom
2 +
3 +DOM bindings for [React Router](https://reacttraining.com/react-router).
4 +
5 +## Installation
6 +
7 +Using [npm](https://www.npmjs.com/):
8 +
9 + $ npm install --save react-router-dom
10 +
11 +Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
12 +
13 +```js
14 +// using ES6 modules
15 +import { BrowserRouter, Route, Link } from "react-router-dom";
16 +
17 +// using CommonJS modules
18 +const BrowserRouter = require("react-router-dom").BrowserRouter;
19 +const Route = require("react-router-dom").Route;
20 +const Link = require("react-router-dom").Link;
21 +```
22 +
23 +The UMD build is also available on [unpkg](https://unpkg.com):
24 +
25 +```html
26 +<script src="https://unpkg.com/react-router-dom/umd/react-router-dom.min.js"></script>
27 +```
28 +
29 +You can find the library on `window.ReactRouterDOM`.
30 +
31 +## Issues
32 +
33 +If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/ReactTraining/react-router/issues).
34 +
35 +## Credits
36 +
37 +React Router is built and maintained by [React Training](https://reacttraining.com).
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Redirect");
3 +module.exports = require("./index.js").Redirect;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Route");
3 +module.exports = require("./index.js").Route;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Router");
3 +module.exports = require("./index.js").Router;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("StaticRouter");
3 +module.exports = require("./index.js").StaticRouter;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Switch");
3 +module.exports = require("./index.js").Switch;
1 +'use strict';
2 +
3 +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4 +
5 +var reactRouter = require('react-router');
6 +var React = _interopDefault(require('react'));
7 +var history = require('history');
8 +var PropTypes = _interopDefault(require('prop-types'));
9 +var warning = _interopDefault(require('tiny-warning'));
10 +var invariant = _interopDefault(require('tiny-invariant'));
11 +
12 +function _extends() {
13 + _extends = Object.assign || function (target) {
14 + for (var i = 1; i < arguments.length; i++) {
15 + var source = arguments[i];
16 +
17 + for (var key in source) {
18 + if (Object.prototype.hasOwnProperty.call(source, key)) {
19 + target[key] = source[key];
20 + }
21 + }
22 + }
23 +
24 + return target;
25 + };
26 +
27 + return _extends.apply(this, arguments);
28 +}
29 +
30 +function _inheritsLoose(subClass, superClass) {
31 + subClass.prototype = Object.create(superClass.prototype);
32 + subClass.prototype.constructor = subClass;
33 + subClass.__proto__ = superClass;
34 +}
35 +
36 +function _objectWithoutPropertiesLoose(source, excluded) {
37 + if (source == null) return {};
38 + var target = {};
39 + var sourceKeys = Object.keys(source);
40 + var key, i;
41 +
42 + for (i = 0; i < sourceKeys.length; i++) {
43 + key = sourceKeys[i];
44 + if (excluded.indexOf(key) >= 0) continue;
45 + target[key] = source[key];
46 + }
47 +
48 + return target;
49 +}
50 +
51 +/**
52 + * The public API for a <Router> that uses HTML5 history.
53 + */
54 +
55 +var BrowserRouter =
56 +/*#__PURE__*/
57 +function (_React$Component) {
58 + _inheritsLoose(BrowserRouter, _React$Component);
59 +
60 + function BrowserRouter() {
61 + var _this;
62 +
63 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
64 + args[_key] = arguments[_key];
65 + }
66 +
67 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
68 + _this.history = history.createBrowserHistory(_this.props);
69 + return _this;
70 + }
71 +
72 + var _proto = BrowserRouter.prototype;
73 +
74 + _proto.render = function render() {
75 + return React.createElement(reactRouter.Router, {
76 + history: this.history,
77 + children: this.props.children
78 + });
79 + };
80 +
81 + return BrowserRouter;
82 +}(React.Component);
83 +
84 +{
85 + BrowserRouter.propTypes = {
86 + basename: PropTypes.string,
87 + children: PropTypes.node,
88 + forceRefresh: PropTypes.bool,
89 + getUserConfirmation: PropTypes.func,
90 + keyLength: PropTypes.number
91 + };
92 +
93 + BrowserRouter.prototype.componentDidMount = function () {
94 + warning(!this.props.history, "<BrowserRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`.") ;
95 + };
96 +}
97 +
98 +/**
99 + * The public API for a <Router> that uses window.location.hash.
100 + */
101 +
102 +var HashRouter =
103 +/*#__PURE__*/
104 +function (_React$Component) {
105 + _inheritsLoose(HashRouter, _React$Component);
106 +
107 + function HashRouter() {
108 + var _this;
109 +
110 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
111 + args[_key] = arguments[_key];
112 + }
113 +
114 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
115 + _this.history = history.createHashHistory(_this.props);
116 + return _this;
117 + }
118 +
119 + var _proto = HashRouter.prototype;
120 +
121 + _proto.render = function render() {
122 + return React.createElement(reactRouter.Router, {
123 + history: this.history,
124 + children: this.props.children
125 + });
126 + };
127 +
128 + return HashRouter;
129 +}(React.Component);
130 +
131 +{
132 + HashRouter.propTypes = {
133 + basename: PropTypes.string,
134 + children: PropTypes.node,
135 + getUserConfirmation: PropTypes.func,
136 + hashType: PropTypes.oneOf(["hashbang", "noslash", "slash"])
137 + };
138 +
139 + HashRouter.prototype.componentDidMount = function () {
140 + warning(!this.props.history, "<HashRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`.") ;
141 + };
142 +}
143 +
144 +var resolveToLocation = function resolveToLocation(to, currentLocation) {
145 + return typeof to === "function" ? to(currentLocation) : to;
146 +};
147 +var normalizeToLocation = function normalizeToLocation(to, currentLocation) {
148 + return typeof to === "string" ? history.createLocation(to, null, null, currentLocation) : to;
149 +};
150 +
151 +var forwardRefShim = function forwardRefShim(C) {
152 + return C;
153 +};
154 +
155 +var forwardRef = React.forwardRef;
156 +
157 +if (typeof forwardRef === "undefined") {
158 + forwardRef = forwardRefShim;
159 +}
160 +
161 +function isModifiedEvent(event) {
162 + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
163 +}
164 +
165 +var LinkAnchor = forwardRef(function (_ref, forwardedRef) {
166 + var innerRef = _ref.innerRef,
167 + navigate = _ref.navigate,
168 + _onClick = _ref.onClick,
169 + rest = _objectWithoutPropertiesLoose(_ref, ["innerRef", "navigate", "onClick"]);
170 +
171 + var target = rest.target;
172 +
173 + var props = _extends({}, rest, {
174 + onClick: function onClick(event) {
175 + try {
176 + if (_onClick) _onClick(event);
177 + } catch (ex) {
178 + event.preventDefault();
179 + throw ex;
180 + }
181 +
182 + if (!event.defaultPrevented && // onClick prevented default
183 + event.button === 0 && ( // ignore everything but left clicks
184 + !target || target === "_self") && // let browser handle "target=_blank" etc.
185 + !isModifiedEvent(event) // ignore clicks with modifier keys
186 + ) {
187 + event.preventDefault();
188 + navigate();
189 + }
190 + }
191 + }); // React 15 compat
192 +
193 +
194 + if (forwardRefShim !== forwardRef) {
195 + props.ref = forwardedRef || innerRef;
196 + } else {
197 + props.ref = innerRef;
198 + }
199 + /* eslint-disable-next-line jsx-a11y/anchor-has-content */
200 +
201 +
202 + return React.createElement("a", props);
203 +});
204 +
205 +{
206 + LinkAnchor.displayName = "LinkAnchor";
207 +}
208 +/**
209 + * The public API for rendering a history-aware <a>.
210 + */
211 +
212 +
213 +var Link = forwardRef(function (_ref2, forwardedRef) {
214 + var _ref2$component = _ref2.component,
215 + component = _ref2$component === void 0 ? LinkAnchor : _ref2$component,
216 + replace = _ref2.replace,
217 + to = _ref2.to,
218 + innerRef = _ref2.innerRef,
219 + rest = _objectWithoutPropertiesLoose(_ref2, ["component", "replace", "to", "innerRef"]);
220 +
221 + return React.createElement(reactRouter.__RouterContext.Consumer, null, function (context) {
222 + !context ? invariant(false, "You should not use <Link> outside a <Router>") : void 0;
223 + var history = context.history;
224 + var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);
225 + var href = location ? history.createHref(location) : "";
226 +
227 + var props = _extends({}, rest, {
228 + href: href,
229 + navigate: function navigate() {
230 + var location = resolveToLocation(to, context.location);
231 + var method = replace ? history.replace : history.push;
232 + method(location);
233 + }
234 + }); // React 15 compat
235 +
236 +
237 + if (forwardRefShim !== forwardRef) {
238 + props.ref = forwardedRef || innerRef;
239 + } else {
240 + props.innerRef = innerRef;
241 + }
242 +
243 + return React.createElement(component, props);
244 + });
245 +});
246 +
247 +{
248 + var toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]);
249 + var refType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({
250 + current: PropTypes.any
251 + })]);
252 + Link.displayName = "Link";
253 + Link.propTypes = {
254 + innerRef: refType,
255 + onClick: PropTypes.func,
256 + replace: PropTypes.bool,
257 + target: PropTypes.string,
258 + to: toType.isRequired
259 + };
260 +}
261 +
262 +var forwardRefShim$1 = function forwardRefShim(C) {
263 + return C;
264 +};
265 +
266 +var forwardRef$1 = React.forwardRef;
267 +
268 +if (typeof forwardRef$1 === "undefined") {
269 + forwardRef$1 = forwardRefShim$1;
270 +}
271 +
272 +function joinClassnames() {
273 + for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
274 + classnames[_key] = arguments[_key];
275 + }
276 +
277 + return classnames.filter(function (i) {
278 + return i;
279 + }).join(" ");
280 +}
281 +/**
282 + * A <Link> wrapper that knows if it's "active" or not.
283 + */
284 +
285 +
286 +var NavLink = forwardRef$1(function (_ref, forwardedRef) {
287 + var _ref$ariaCurrent = _ref["aria-current"],
288 + ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent,
289 + _ref$activeClassName = _ref.activeClassName,
290 + activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName,
291 + activeStyle = _ref.activeStyle,
292 + classNameProp = _ref.className,
293 + exact = _ref.exact,
294 + isActiveProp = _ref.isActive,
295 + locationProp = _ref.location,
296 + sensitive = _ref.sensitive,
297 + strict = _ref.strict,
298 + styleProp = _ref.style,
299 + to = _ref.to,
300 + innerRef = _ref.innerRef,
301 + rest = _objectWithoutPropertiesLoose(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "sensitive", "strict", "style", "to", "innerRef"]);
302 +
303 + return React.createElement(reactRouter.__RouterContext.Consumer, null, function (context) {
304 + !context ? invariant(false, "You should not use <NavLink> outside a <Router>") : void 0;
305 + var currentLocation = locationProp || context.location;
306 + var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);
307 + var path = toLocation.pathname; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
308 +
309 + var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
310 + var match = escapedPath ? reactRouter.matchPath(currentLocation.pathname, {
311 + path: escapedPath,
312 + exact: exact,
313 + sensitive: sensitive,
314 + strict: strict
315 + }) : null;
316 + var isActive = !!(isActiveProp ? isActiveProp(match, currentLocation) : match);
317 + var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp;
318 + var style = isActive ? _extends({}, styleProp, {}, activeStyle) : styleProp;
319 +
320 + var props = _extends({
321 + "aria-current": isActive && ariaCurrent || null,
322 + className: className,
323 + style: style,
324 + to: toLocation
325 + }, rest); // React 15 compat
326 +
327 +
328 + if (forwardRefShim$1 !== forwardRef$1) {
329 + props.ref = forwardedRef || innerRef;
330 + } else {
331 + props.innerRef = innerRef;
332 + }
333 +
334 + return React.createElement(Link, props);
335 + });
336 +});
337 +
338 +{
339 + NavLink.displayName = "NavLink";
340 + var ariaCurrentType = PropTypes.oneOf(["page", "step", "location", "date", "time", "true"]);
341 + NavLink.propTypes = _extends({}, Link.propTypes, {
342 + "aria-current": ariaCurrentType,
343 + activeClassName: PropTypes.string,
344 + activeStyle: PropTypes.object,
345 + className: PropTypes.string,
346 + exact: PropTypes.bool,
347 + isActive: PropTypes.func,
348 + location: PropTypes.object,
349 + sensitive: PropTypes.bool,
350 + strict: PropTypes.bool,
351 + style: PropTypes.object
352 + });
353 +}
354 +
355 +Object.defineProperty(exports, 'MemoryRouter', {
356 + enumerable: true,
357 + get: function () {
358 + return reactRouter.MemoryRouter;
359 + }
360 +});
361 +Object.defineProperty(exports, 'Prompt', {
362 + enumerable: true,
363 + get: function () {
364 + return reactRouter.Prompt;
365 + }
366 +});
367 +Object.defineProperty(exports, 'Redirect', {
368 + enumerable: true,
369 + get: function () {
370 + return reactRouter.Redirect;
371 + }
372 +});
373 +Object.defineProperty(exports, 'Route', {
374 + enumerable: true,
375 + get: function () {
376 + return reactRouter.Route;
377 + }
378 +});
379 +Object.defineProperty(exports, 'Router', {
380 + enumerable: true,
381 + get: function () {
382 + return reactRouter.Router;
383 + }
384 +});
385 +Object.defineProperty(exports, 'StaticRouter', {
386 + enumerable: true,
387 + get: function () {
388 + return reactRouter.StaticRouter;
389 + }
390 +});
391 +Object.defineProperty(exports, 'Switch', {
392 + enumerable: true,
393 + get: function () {
394 + return reactRouter.Switch;
395 + }
396 +});
397 +Object.defineProperty(exports, 'generatePath', {
398 + enumerable: true,
399 + get: function () {
400 + return reactRouter.generatePath;
401 + }
402 +});
403 +Object.defineProperty(exports, 'matchPath', {
404 + enumerable: true,
405 + get: function () {
406 + return reactRouter.matchPath;
407 + }
408 +});
409 +Object.defineProperty(exports, 'useHistory', {
410 + enumerable: true,
411 + get: function () {
412 + return reactRouter.useHistory;
413 + }
414 +});
415 +Object.defineProperty(exports, 'useLocation', {
416 + enumerable: true,
417 + get: function () {
418 + return reactRouter.useLocation;
419 + }
420 +});
421 +Object.defineProperty(exports, 'useParams', {
422 + enumerable: true,
423 + get: function () {
424 + return reactRouter.useParams;
425 + }
426 +});
427 +Object.defineProperty(exports, 'useRouteMatch', {
428 + enumerable: true,
429 + get: function () {
430 + return reactRouter.useRouteMatch;
431 + }
432 +});
433 +Object.defineProperty(exports, 'withRouter', {
434 + enumerable: true,
435 + get: function () {
436 + return reactRouter.withRouter;
437 + }
438 +});
439 +exports.BrowserRouter = BrowserRouter;
440 +exports.HashRouter = HashRouter;
441 +exports.Link = Link;
442 +exports.NavLink = NavLink;
443 +//# sourceMappingURL=react-router-dom.js.map
1 +{"version":3,"file":"react-router-dom.js","sources":["../modules/BrowserRouter.js","../modules/HashRouter.js","../modules/utils/locationUtils.js","../modules/Link.js","../modules/NavLink.js"],"sourcesContent":["import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createBrowserHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses HTML5 history.\n */\nclass BrowserRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n BrowserRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number\n };\n\n BrowserRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<BrowserRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { BrowserRouter as Router }`.\"\n );\n };\n}\n\nexport default BrowserRouter;\n","import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createHashHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses window.location.hash.\n */\nclass HashRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n HashRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf([\"hashbang\", \"noslash\", \"slash\"])\n };\n\n HashRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<HashRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { HashRouter as Router }`.\"\n );\n };\n}\n\nexport default HashRouter;\n","import { createLocation } from \"history\";\n\nexport const resolveToLocation = (to, currentLocation) =>\n typeof to === \"function\" ? to(currentLocation) : to;\n\nexport const normalizeToLocation = (to, currentLocation) => {\n return typeof to === \"string\"\n ? createLocation(to, null, null, currentLocation)\n : to;\n};\n","import React from \"react\";\nimport { __RouterContext as RouterContext } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nconst LinkAnchor = forwardRef(\n (\n {\n innerRef, // TODO: deprecate\n navigate,\n onClick,\n ...rest\n },\n forwardedRef\n ) => {\n const { target } = rest;\n\n let props = {\n ...rest,\n onClick: event => {\n try {\n if (onClick) onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (\n !event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but left clicks\n (!target || target === \"_self\") && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.ref = innerRef;\n }\n\n /* eslint-disable-next-line jsx-a11y/anchor-has-content */\n return <a {...props} />;\n }\n);\n\nif (__DEV__) {\n LinkAnchor.displayName = \"LinkAnchor\";\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nconst Link = forwardRef(\n (\n {\n component = LinkAnchor,\n replace,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Link> outside a <Router>\");\n\n const { history } = context;\n\n const location = normalizeToLocation(\n resolveToLocation(to, context.location),\n context.location\n );\n\n const href = location ? history.createHref(location) : \"\";\n const props = {\n ...rest,\n href,\n navigate() {\n const location = resolveToLocation(to, context.location);\n const method = replace ? history.replace : history.push;\n\n method(location);\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return React.createElement(component, props);\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n const toType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.object,\n PropTypes.func\n ]);\n const refType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any })\n ]);\n\n Link.displayName = \"Link\";\n\n Link.propTypes = {\n innerRef: refType,\n onClick: PropTypes.func,\n replace: PropTypes.bool,\n target: PropTypes.string,\n to: toType.isRequired\n };\n}\n\nexport default Link;\n","import React from \"react\";\nimport { __RouterContext as RouterContext, matchPath } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport Link from \"./Link.js\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction joinClassnames(...classnames) {\n return classnames.filter(i => i).join(\" \");\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nconst NavLink = forwardRef(\n (\n {\n \"aria-current\": ariaCurrent = \"page\",\n activeClassName = \"active\",\n activeStyle,\n className: classNameProp,\n exact,\n isActive: isActiveProp,\n location: locationProp,\n sensitive,\n strict,\n style: styleProp,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <NavLink> outside a <Router>\");\n\n const currentLocation = locationProp || context.location;\n const toLocation = normalizeToLocation(\n resolveToLocation(to, currentLocation),\n currentLocation\n );\n const { pathname: path } = toLocation;\n // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n const escapedPath =\n path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n\n const match = escapedPath\n ? matchPath(currentLocation.pathname, {\n path: escapedPath,\n exact,\n sensitive,\n strict\n })\n : null;\n const isActive = !!(isActiveProp\n ? isActiveProp(match, currentLocation)\n : match);\n\n const className = isActive\n ? joinClassnames(classNameProp, activeClassName)\n : classNameProp;\n const style = isActive ? { ...styleProp, ...activeStyle } : styleProp;\n\n const props = {\n \"aria-current\": (isActive && ariaCurrent) || null,\n className,\n style,\n to: toLocation,\n ...rest\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return <Link {...props} />;\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n\n const ariaCurrentType = PropTypes.oneOf([\n \"page\",\n \"step\",\n \"location\",\n \"date\",\n \"time\",\n \"true\"\n ]);\n\n NavLink.propTypes = {\n ...Link.propTypes,\n \"aria-current\": ariaCurrentType,\n activeClassName: PropTypes.string,\n activeStyle: PropTypes.object,\n className: PropTypes.string,\n exact: PropTypes.bool,\n isActive: PropTypes.func,\n location: PropTypes.object,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool,\n style: PropTypes.object\n };\n}\n\nexport default NavLink;\n"],"names":["BrowserRouter","history","createHistory","props","render","Router","children","React","Component","propTypes","basename","PropTypes","string","node","forceRefresh","bool","getUserConfirmation","func","keyLength","number","prototype","componentDidMount","warning","HashRouter","hashType","oneOf","resolveToLocation","to","currentLocation","normalizeToLocation","createLocation","forwardRefShim","C","forwardRef","isModifiedEvent","event","metaKey","altKey","ctrlKey","shiftKey","LinkAnchor","forwardedRef","innerRef","navigate","onClick","rest","target","ex","preventDefault","defaultPrevented","button","ref","displayName","Link","component","replace","RouterContext","context","invariant","location","href","createHref","method","push","createElement","toType","oneOfType","object","refType","shape","current","any","isRequired","joinClassnames","classnames","filter","i","join","NavLink","ariaCurrent","activeClassName","activeStyle","classNameProp","className","exact","isActiveProp","isActive","locationProp","sensitive","strict","styleProp","style","toLocation","path","pathname","escapedPath","match","matchPath","ariaCurrentType"],"mappings":"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"}
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var reactRouter=require("react-router"),React=_interopDefault(require("react")),history=require("history");require("prop-types"),require("tiny-warning");var invariant=_interopDefault(require("tiny-invariant"));function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}var BrowserRouter=function(n){function e(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n.call.apply(n,[this].concat(r))||this).history=history.createBrowserHistory(e.props),e}return _inheritsLoose(e,n),e.prototype.render=function(){return React.createElement(reactRouter.Router,{history:this.history,children:this.props.children})},e}(React.Component),HashRouter=function(n){function e(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n.call.apply(n,[this].concat(r))||this).history=history.createHashHistory(e.props),e}return _inheritsLoose(e,n),e.prototype.render=function(){return React.createElement(reactRouter.Router,{history:this.history,children:this.props.children})},e}(React.Component),resolveToLocation=function(e,t){return"function"==typeof e?e(t):e},normalizeToLocation=function(e,t){return"string"==typeof e?history.createLocation(e,null,null,t):e},forwardRefShim=function(e){return e},forwardRef=React.forwardRef;function isModifiedEvent(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}void 0===forwardRef&&(forwardRef=forwardRefShim);var LinkAnchor=forwardRef(function(e,t){var r=e.innerRef,o=e.navigate,n=e.onClick,a=_objectWithoutPropertiesLoose(e,["innerRef","navigate","onClick"]),i=a.target,c=_extends({},a,{onClick:function(t){try{n&&n(t)}catch(e){throw t.preventDefault(),e}t.defaultPrevented||0!==t.button||i&&"_self"!==i||isModifiedEvent(t)||(t.preventDefault(),o())}});return c.ref=forwardRefShim!==forwardRef&&t||r,React.createElement("a",c)}),Link=forwardRef(function(e,a){var t=e.component,i=void 0===t?LinkAnchor:t,c=e.replace,u=e.to,s=e.innerRef,f=_objectWithoutPropertiesLoose(e,["component","replace","to","innerRef"]);return React.createElement(reactRouter.__RouterContext.Consumer,null,function(t){t||invariant(!1);var r=t.history,e=normalizeToLocation(resolveToLocation(u,t.location),t.location),o=e?r.createHref(e):"",n=_extends({},f,{href:o,navigate:function(){var e=resolveToLocation(u,t.location);(c?r.replace:r.push)(e)}});return forwardRefShim!==forwardRef?n.ref=a||s:n.innerRef=s,React.createElement(i,n)})}),forwardRefShim$1=function(e){return e},forwardRef$1=React.forwardRef;function joinClassnames(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(function(e){return e}).join(" ")}void 0===forwardRef$1&&(forwardRef$1=forwardRefShim$1);var NavLink=forwardRef$1(function(e,f){var t=e["aria-current"],l=void 0===t?"page":t,r=e.activeClassName,p=void 0===r?"active":r,R=e.activeStyle,h=e.className,d=e.exact,y=e.isActive,m=e.location,v=e.sensitive,b=e.strict,w=e.style,x=e.to,g=e.innerRef,P=_objectWithoutPropertiesLoose(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return React.createElement(reactRouter.__RouterContext.Consumer,null,function(e){e||invariant(!1);var t=m||e.location,r=normalizeToLocation(resolveToLocation(x,t),t),o=r.pathname,n=o&&o.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),a=n?reactRouter.matchPath(t.pathname,{path:n,exact:d,sensitive:v,strict:b}):null,i=!!(y?y(a,t):a),c=i?joinClassnames(h,p):h,u=i?_extends({},w,{},R):w,s=_extends({"aria-current":i&&l||null,className:c,style:u,to:r},P);return forwardRefShim$1!==forwardRef$1?s.ref=f||g:s.innerRef=g,React.createElement(Link,s)})});Object.defineProperty(exports,"MemoryRouter",{enumerable:!0,get:function(){return reactRouter.MemoryRouter}}),Object.defineProperty(exports,"Prompt",{enumerable:!0,get:function(){return reactRouter.Prompt}}),Object.defineProperty(exports,"Redirect",{enumerable:!0,get:function(){return reactRouter.Redirect}}),Object.defineProperty(exports,"Route",{enumerable:!0,get:function(){return reactRouter.Route}}),Object.defineProperty(exports,"Router",{enumerable:!0,get:function(){return reactRouter.Router}}),Object.defineProperty(exports,"StaticRouter",{enumerable:!0,get:function(){return reactRouter.StaticRouter}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return reactRouter.Switch}}),Object.defineProperty(exports,"generatePath",{enumerable:!0,get:function(){return reactRouter.generatePath}}),Object.defineProperty(exports,"matchPath",{enumerable:!0,get:function(){return reactRouter.matchPath}}),Object.defineProperty(exports,"useHistory",{enumerable:!0,get:function(){return reactRouter.useHistory}}),Object.defineProperty(exports,"useLocation",{enumerable:!0,get:function(){return reactRouter.useLocation}}),Object.defineProperty(exports,"useParams",{enumerable:!0,get:function(){return reactRouter.useParams}}),Object.defineProperty(exports,"useRouteMatch",{enumerable:!0,get:function(){return reactRouter.useRouteMatch}}),Object.defineProperty(exports,"withRouter",{enumerable:!0,get:function(){return reactRouter.withRouter}}),exports.BrowserRouter=BrowserRouter,exports.HashRouter=HashRouter,exports.Link=Link,exports.NavLink=NavLink;
2 +//# sourceMappingURL=react-router-dom.min.js.map
1 +{"version":3,"file":"react-router-dom.min.js","sources":["../modules/BrowserRouter.js","../modules/HashRouter.js","../modules/utils/locationUtils.js","../modules/Link.js","../modules/NavLink.js"],"sourcesContent":["import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createBrowserHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses HTML5 history.\n */\nclass BrowserRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n BrowserRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number\n };\n\n BrowserRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<BrowserRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { BrowserRouter as Router }`.\"\n );\n };\n}\n\nexport default BrowserRouter;\n","import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createHashHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses window.location.hash.\n */\nclass HashRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n HashRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf([\"hashbang\", \"noslash\", \"slash\"])\n };\n\n HashRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<HashRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { HashRouter as Router }`.\"\n );\n };\n}\n\nexport default HashRouter;\n","import { createLocation } from \"history\";\n\nexport const resolveToLocation = (to, currentLocation) =>\n typeof to === \"function\" ? to(currentLocation) : to;\n\nexport const normalizeToLocation = (to, currentLocation) => {\n return typeof to === \"string\"\n ? createLocation(to, null, null, currentLocation)\n : to;\n};\n","import React from \"react\";\nimport { __RouterContext as RouterContext } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nconst LinkAnchor = forwardRef(\n (\n {\n innerRef, // TODO: deprecate\n navigate,\n onClick,\n ...rest\n },\n forwardedRef\n ) => {\n const { target } = rest;\n\n let props = {\n ...rest,\n onClick: event => {\n try {\n if (onClick) onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (\n !event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but left clicks\n (!target || target === \"_self\") && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.ref = innerRef;\n }\n\n /* eslint-disable-next-line jsx-a11y/anchor-has-content */\n return <a {...props} />;\n }\n);\n\nif (__DEV__) {\n LinkAnchor.displayName = \"LinkAnchor\";\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nconst Link = forwardRef(\n (\n {\n component = LinkAnchor,\n replace,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Link> outside a <Router>\");\n\n const { history } = context;\n\n const location = normalizeToLocation(\n resolveToLocation(to, context.location),\n context.location\n );\n\n const href = location ? history.createHref(location) : \"\";\n const props = {\n ...rest,\n href,\n navigate() {\n const location = resolveToLocation(to, context.location);\n const method = replace ? history.replace : history.push;\n\n method(location);\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return React.createElement(component, props);\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n const toType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.object,\n PropTypes.func\n ]);\n const refType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any })\n ]);\n\n Link.displayName = \"Link\";\n\n Link.propTypes = {\n innerRef: refType,\n onClick: PropTypes.func,\n replace: PropTypes.bool,\n target: PropTypes.string,\n to: toType.isRequired\n };\n}\n\nexport default Link;\n","import React from \"react\";\nimport { __RouterContext as RouterContext, matchPath } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport Link from \"./Link.js\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction joinClassnames(...classnames) {\n return classnames.filter(i => i).join(\" \");\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nconst NavLink = forwardRef(\n (\n {\n \"aria-current\": ariaCurrent = \"page\",\n activeClassName = \"active\",\n activeStyle,\n className: classNameProp,\n exact,\n isActive: isActiveProp,\n location: locationProp,\n sensitive,\n strict,\n style: styleProp,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <NavLink> outside a <Router>\");\n\n const currentLocation = locationProp || context.location;\n const toLocation = normalizeToLocation(\n resolveToLocation(to, currentLocation),\n currentLocation\n );\n const { pathname: path } = toLocation;\n // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n const escapedPath =\n path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n\n const match = escapedPath\n ? matchPath(currentLocation.pathname, {\n path: escapedPath,\n exact,\n sensitive,\n strict\n })\n : null;\n const isActive = !!(isActiveProp\n ? isActiveProp(match, currentLocation)\n : match);\n\n const className = isActive\n ? joinClassnames(classNameProp, activeClassName)\n : classNameProp;\n const style = isActive ? { ...styleProp, ...activeStyle } : styleProp;\n\n const props = {\n \"aria-current\": (isActive && ariaCurrent) || null,\n className,\n style,\n to: toLocation,\n ...rest\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return <Link {...props} />;\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n\n const ariaCurrentType = PropTypes.oneOf([\n \"page\",\n \"step\",\n \"location\",\n \"date\",\n \"time\",\n \"true\"\n ]);\n\n NavLink.propTypes = {\n ...Link.propTypes,\n \"aria-current\": ariaCurrentType,\n activeClassName: PropTypes.string,\n activeStyle: PropTypes.object,\n className: PropTypes.string,\n exact: PropTypes.bool,\n isActive: PropTypes.func,\n location: PropTypes.object,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool,\n style: PropTypes.object\n };\n}\n\nexport default NavLink;\n"],"names":["BrowserRouter","history","createHistory","_this","props","render","React","Router","this","children","Component","HashRouter","resolveToLocation","to","currentLocation","normalizeToLocation","createLocation","forwardRefShim","C","forwardRef","isModifiedEvent","event","metaKey","altKey","ctrlKey","shiftKey","LinkAnchor","forwardedRef","innerRef","navigate","onClick","rest","target","ex","preventDefault","defaultPrevented","button","ref","Link","component","replace","RouterContext","Consumer","context","invariant","location","href","createHref","push","createElement","joinClassnames","classnames","filter","i","join","NavLink","ariaCurrent","activeClassName","activeStyle","classNameProp","className","exact","isActiveProp","isActive","locationProp","sensitive","strict","styleProp","style","toLocation","path","pathname","escapedPath","match","matchPath"],"mappings":"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"}
...\ No newline at end of file ...\ No newline at end of file
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("BrowserRouter");
3 +
4 +import { BrowserRouter } from "../esm/react-router-dom.js";
5 +export default BrowserRouter;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("HashRouter");
3 +
4 +import { HashRouter } from "../esm/react-router-dom.js";
5 +export default HashRouter;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Link");
3 +
4 +import { Link } from "../esm/react-router-dom.js";
5 +export default Link;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("MemoryRouter");
3 +
4 +import { MemoryRouter } from "../esm/react-router-dom.js";
5 +export default MemoryRouter;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("NavLink");
3 +
4 +import { NavLink } from "../esm/react-router-dom.js";
5 +export default NavLink;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Prompt");
3 +
4 +import { Prompt } from "../esm/react-router-dom.js";
5 +export default Prompt;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Redirect");
3 +
4 +import { Redirect } from "../esm/react-router-dom.js";
5 +export default Redirect;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Route");
3 +
4 +import { Route } from "../esm/react-router-dom.js";
5 +export default Route;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Router");
3 +
4 +import { Router } from "../esm/react-router-dom.js";
5 +export default Router;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("StaticRouter");
3 +
4 +import { StaticRouter } from "../esm/react-router-dom.js";
5 +export default StaticRouter;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Switch");
3 +
4 +import { Switch } from "../esm/react-router-dom.js";
5 +export default Switch;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("generatePath");
3 +
4 +import { generatePath } from "../esm/react-router-dom.js";
5 +export default generatePath;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("matchPath");
3 +
4 +import { matchPath } from "../esm/react-router-dom.js";
5 +export default matchPath;
1 +/* eslint-disable prefer-arrow-callback, no-empty */
2 +var printWarning = function() {};
3 +
4 +if (process.env.NODE_ENV !== "production") {
5 + printWarning = function(format, subs) {
6 + var index = 0;
7 + var message =
8 + "Warning: " +
9 + (subs.length > 0
10 + ? format.replace(/%s/g, function() {
11 + return subs[index++];
12 + })
13 + : format);
14 +
15 + if (typeof console !== "undefined") {
16 + console.error(message);
17 + }
18 +
19 + try {
20 + // --- Welcome to debugging React Router ---
21 + // This error was thrown as a convenience so that you can use the
22 + // stack trace to find the callsite that triggered this warning.
23 + throw new Error(message);
24 + } catch (e) {}
25 + };
26 +}
27 +
28 +export default function(member) {
29 + printWarning(
30 + 'Please use `import { %s } from "react-router-dom"` instead of `import %s from "react-router-dom/es/%s"`. ' +
31 + "Support for the latter will be removed in the next major release.",
32 + [member, member]
33 + );
34 +}
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("withRouter");
3 +
4 +import { withRouter } from "../esm/react-router-dom.js";
5 +export default withRouter;
1 +import { Router, __RouterContext, matchPath } from 'react-router';
2 +export { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter } from 'react-router';
3 +import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
4 +import React from 'react';
5 +import { createBrowserHistory, createHashHistory, createLocation } from 'history';
6 +import PropTypes from 'prop-types';
7 +import warning from 'tiny-warning';
8 +import _extends from '@babel/runtime/helpers/esm/extends';
9 +import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
10 +import invariant from 'tiny-invariant';
11 +
12 +/**
13 + * The public API for a <Router> that uses HTML5 history.
14 + */
15 +
16 +var BrowserRouter =
17 +/*#__PURE__*/
18 +function (_React$Component) {
19 + _inheritsLoose(BrowserRouter, _React$Component);
20 +
21 + function BrowserRouter() {
22 + var _this;
23 +
24 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25 + args[_key] = arguments[_key];
26 + }
27 +
28 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
29 + _this.history = createBrowserHistory(_this.props);
30 + return _this;
31 + }
32 +
33 + var _proto = BrowserRouter.prototype;
34 +
35 + _proto.render = function render() {
36 + return React.createElement(Router, {
37 + history: this.history,
38 + children: this.props.children
39 + });
40 + };
41 +
42 + return BrowserRouter;
43 +}(React.Component);
44 +
45 +if (process.env.NODE_ENV !== "production") {
46 + BrowserRouter.propTypes = {
47 + basename: PropTypes.string,
48 + children: PropTypes.node,
49 + forceRefresh: PropTypes.bool,
50 + getUserConfirmation: PropTypes.func,
51 + keyLength: PropTypes.number
52 + };
53 +
54 + BrowserRouter.prototype.componentDidMount = function () {
55 + process.env.NODE_ENV !== "production" ? warning(!this.props.history, "<BrowserRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`.") : void 0;
56 + };
57 +}
58 +
59 +/**
60 + * The public API for a <Router> that uses window.location.hash.
61 + */
62 +
63 +var HashRouter =
64 +/*#__PURE__*/
65 +function (_React$Component) {
66 + _inheritsLoose(HashRouter, _React$Component);
67 +
68 + function HashRouter() {
69 + var _this;
70 +
71 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
72 + args[_key] = arguments[_key];
73 + }
74 +
75 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
76 + _this.history = createHashHistory(_this.props);
77 + return _this;
78 + }
79 +
80 + var _proto = HashRouter.prototype;
81 +
82 + _proto.render = function render() {
83 + return React.createElement(Router, {
84 + history: this.history,
85 + children: this.props.children
86 + });
87 + };
88 +
89 + return HashRouter;
90 +}(React.Component);
91 +
92 +if (process.env.NODE_ENV !== "production") {
93 + HashRouter.propTypes = {
94 + basename: PropTypes.string,
95 + children: PropTypes.node,
96 + getUserConfirmation: PropTypes.func,
97 + hashType: PropTypes.oneOf(["hashbang", "noslash", "slash"])
98 + };
99 +
100 + HashRouter.prototype.componentDidMount = function () {
101 + process.env.NODE_ENV !== "production" ? warning(!this.props.history, "<HashRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`.") : void 0;
102 + };
103 +}
104 +
105 +var resolveToLocation = function resolveToLocation(to, currentLocation) {
106 + return typeof to === "function" ? to(currentLocation) : to;
107 +};
108 +var normalizeToLocation = function normalizeToLocation(to, currentLocation) {
109 + return typeof to === "string" ? createLocation(to, null, null, currentLocation) : to;
110 +};
111 +
112 +var forwardRefShim = function forwardRefShim(C) {
113 + return C;
114 +};
115 +
116 +var forwardRef = React.forwardRef;
117 +
118 +if (typeof forwardRef === "undefined") {
119 + forwardRef = forwardRefShim;
120 +}
121 +
122 +function isModifiedEvent(event) {
123 + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
124 +}
125 +
126 +var LinkAnchor = forwardRef(function (_ref, forwardedRef) {
127 + var innerRef = _ref.innerRef,
128 + navigate = _ref.navigate,
129 + _onClick = _ref.onClick,
130 + rest = _objectWithoutPropertiesLoose(_ref, ["innerRef", "navigate", "onClick"]);
131 +
132 + var target = rest.target;
133 +
134 + var props = _extends({}, rest, {
135 + onClick: function onClick(event) {
136 + try {
137 + if (_onClick) _onClick(event);
138 + } catch (ex) {
139 + event.preventDefault();
140 + throw ex;
141 + }
142 +
143 + if (!event.defaultPrevented && // onClick prevented default
144 + event.button === 0 && ( // ignore everything but left clicks
145 + !target || target === "_self") && // let browser handle "target=_blank" etc.
146 + !isModifiedEvent(event) // ignore clicks with modifier keys
147 + ) {
148 + event.preventDefault();
149 + navigate();
150 + }
151 + }
152 + }); // React 15 compat
153 +
154 +
155 + if (forwardRefShim !== forwardRef) {
156 + props.ref = forwardedRef || innerRef;
157 + } else {
158 + props.ref = innerRef;
159 + }
160 + /* eslint-disable-next-line jsx-a11y/anchor-has-content */
161 +
162 +
163 + return React.createElement("a", props);
164 +});
165 +
166 +if (process.env.NODE_ENV !== "production") {
167 + LinkAnchor.displayName = "LinkAnchor";
168 +}
169 +/**
170 + * The public API for rendering a history-aware <a>.
171 + */
172 +
173 +
174 +var Link = forwardRef(function (_ref2, forwardedRef) {
175 + var _ref2$component = _ref2.component,
176 + component = _ref2$component === void 0 ? LinkAnchor : _ref2$component,
177 + replace = _ref2.replace,
178 + to = _ref2.to,
179 + innerRef = _ref2.innerRef,
180 + rest = _objectWithoutPropertiesLoose(_ref2, ["component", "replace", "to", "innerRef"]);
181 +
182 + return React.createElement(__RouterContext.Consumer, null, function (context) {
183 + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Link> outside a <Router>") : invariant(false) : void 0;
184 + var history = context.history;
185 + var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);
186 + var href = location ? history.createHref(location) : "";
187 +
188 + var props = _extends({}, rest, {
189 + href: href,
190 + navigate: function navigate() {
191 + var location = resolveToLocation(to, context.location);
192 + var method = replace ? history.replace : history.push;
193 + method(location);
194 + }
195 + }); // React 15 compat
196 +
197 +
198 + if (forwardRefShim !== forwardRef) {
199 + props.ref = forwardedRef || innerRef;
200 + } else {
201 + props.innerRef = innerRef;
202 + }
203 +
204 + return React.createElement(component, props);
205 + });
206 +});
207 +
208 +if (process.env.NODE_ENV !== "production") {
209 + var toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]);
210 + var refType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({
211 + current: PropTypes.any
212 + })]);
213 + Link.displayName = "Link";
214 + Link.propTypes = {
215 + innerRef: refType,
216 + onClick: PropTypes.func,
217 + replace: PropTypes.bool,
218 + target: PropTypes.string,
219 + to: toType.isRequired
220 + };
221 +}
222 +
223 +var forwardRefShim$1 = function forwardRefShim(C) {
224 + return C;
225 +};
226 +
227 +var forwardRef$1 = React.forwardRef;
228 +
229 +if (typeof forwardRef$1 === "undefined") {
230 + forwardRef$1 = forwardRefShim$1;
231 +}
232 +
233 +function joinClassnames() {
234 + for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
235 + classnames[_key] = arguments[_key];
236 + }
237 +
238 + return classnames.filter(function (i) {
239 + return i;
240 + }).join(" ");
241 +}
242 +/**
243 + * A <Link> wrapper that knows if it's "active" or not.
244 + */
245 +
246 +
247 +var NavLink = forwardRef$1(function (_ref, forwardedRef) {
248 + var _ref$ariaCurrent = _ref["aria-current"],
249 + ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent,
250 + _ref$activeClassName = _ref.activeClassName,
251 + activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName,
252 + activeStyle = _ref.activeStyle,
253 + classNameProp = _ref.className,
254 + exact = _ref.exact,
255 + isActiveProp = _ref.isActive,
256 + locationProp = _ref.location,
257 + sensitive = _ref.sensitive,
258 + strict = _ref.strict,
259 + styleProp = _ref.style,
260 + to = _ref.to,
261 + innerRef = _ref.innerRef,
262 + rest = _objectWithoutPropertiesLoose(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "sensitive", "strict", "style", "to", "innerRef"]);
263 +
264 + return React.createElement(__RouterContext.Consumer, null, function (context) {
265 + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <NavLink> outside a <Router>") : invariant(false) : void 0;
266 + var currentLocation = locationProp || context.location;
267 + var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);
268 + var path = toLocation.pathname; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
269 +
270 + var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
271 + var match = escapedPath ? matchPath(currentLocation.pathname, {
272 + path: escapedPath,
273 + exact: exact,
274 + sensitive: sensitive,
275 + strict: strict
276 + }) : null;
277 + var isActive = !!(isActiveProp ? isActiveProp(match, currentLocation) : match);
278 + var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp;
279 + var style = isActive ? _extends({}, styleProp, {}, activeStyle) : styleProp;
280 +
281 + var props = _extends({
282 + "aria-current": isActive && ariaCurrent || null,
283 + className: className,
284 + style: style,
285 + to: toLocation
286 + }, rest); // React 15 compat
287 +
288 +
289 + if (forwardRefShim$1 !== forwardRef$1) {
290 + props.ref = forwardedRef || innerRef;
291 + } else {
292 + props.innerRef = innerRef;
293 + }
294 +
295 + return React.createElement(Link, props);
296 + });
297 +});
298 +
299 +if (process.env.NODE_ENV !== "production") {
300 + NavLink.displayName = "NavLink";
301 + var ariaCurrentType = PropTypes.oneOf(["page", "step", "location", "date", "time", "true"]);
302 + NavLink.propTypes = _extends({}, Link.propTypes, {
303 + "aria-current": ariaCurrentType,
304 + activeClassName: PropTypes.string,
305 + activeStyle: PropTypes.object,
306 + className: PropTypes.string,
307 + exact: PropTypes.bool,
308 + isActive: PropTypes.func,
309 + location: PropTypes.object,
310 + sensitive: PropTypes.bool,
311 + strict: PropTypes.bool,
312 + style: PropTypes.object
313 + });
314 +}
315 +
316 +export { BrowserRouter, HashRouter, Link, NavLink };
317 +//# sourceMappingURL=react-router-dom.js.map
1 +{"version":3,"file":"react-router-dom.js","sources":["../modules/BrowserRouter.js","../modules/HashRouter.js","../modules/utils/locationUtils.js","../modules/Link.js","../modules/NavLink.js"],"sourcesContent":["import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createBrowserHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses HTML5 history.\n */\nclass BrowserRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n BrowserRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n forceRefresh: PropTypes.bool,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number\n };\n\n BrowserRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<BrowserRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { BrowserRouter as Router }`.\"\n );\n };\n}\n\nexport default BrowserRouter;\n","import React from \"react\";\nimport { Router } from \"react-router\";\nimport { createHashHistory as createHistory } from \"history\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\n/**\n * The public API for a <Router> that uses window.location.hash.\n */\nclass HashRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n HashRouter.propTypes = {\n basename: PropTypes.string,\n children: PropTypes.node,\n getUserConfirmation: PropTypes.func,\n hashType: PropTypes.oneOf([\"hashbang\", \"noslash\", \"slash\"])\n };\n\n HashRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<HashRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { HashRouter as Router }`.\"\n );\n };\n}\n\nexport default HashRouter;\n","import { createLocation } from \"history\";\n\nexport const resolveToLocation = (to, currentLocation) =>\n typeof to === \"function\" ? to(currentLocation) : to;\n\nexport const normalizeToLocation = (to, currentLocation) => {\n return typeof to === \"string\"\n ? createLocation(to, null, null, currentLocation)\n : to;\n};\n","import React from \"react\";\nimport { __RouterContext as RouterContext } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nconst LinkAnchor = forwardRef(\n (\n {\n innerRef, // TODO: deprecate\n navigate,\n onClick,\n ...rest\n },\n forwardedRef\n ) => {\n const { target } = rest;\n\n let props = {\n ...rest,\n onClick: event => {\n try {\n if (onClick) onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (\n !event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but left clicks\n (!target || target === \"_self\") && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.ref = innerRef;\n }\n\n /* eslint-disable-next-line jsx-a11y/anchor-has-content */\n return <a {...props} />;\n }\n);\n\nif (__DEV__) {\n LinkAnchor.displayName = \"LinkAnchor\";\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nconst Link = forwardRef(\n (\n {\n component = LinkAnchor,\n replace,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Link> outside a <Router>\");\n\n const { history } = context;\n\n const location = normalizeToLocation(\n resolveToLocation(to, context.location),\n context.location\n );\n\n const href = location ? history.createHref(location) : \"\";\n const props = {\n ...rest,\n href,\n navigate() {\n const location = resolveToLocation(to, context.location);\n const method = replace ? history.replace : history.push;\n\n method(location);\n }\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return React.createElement(component, props);\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n const toType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.object,\n PropTypes.func\n ]);\n const refType = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any })\n ]);\n\n Link.displayName = \"Link\";\n\n Link.propTypes = {\n innerRef: refType,\n onClick: PropTypes.func,\n replace: PropTypes.bool,\n target: PropTypes.string,\n to: toType.isRequired\n };\n}\n\nexport default Link;\n","import React from \"react\";\nimport { __RouterContext as RouterContext, matchPath } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport Link from \"./Link.js\";\nimport {\n resolveToLocation,\n normalizeToLocation\n} from \"./utils/locationUtils.js\";\n\n// React 15 compat\nconst forwardRefShim = C => C;\nlet { forwardRef } = React;\nif (typeof forwardRef === \"undefined\") {\n forwardRef = forwardRefShim;\n}\n\nfunction joinClassnames(...classnames) {\n return classnames.filter(i => i).join(\" \");\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nconst NavLink = forwardRef(\n (\n {\n \"aria-current\": ariaCurrent = \"page\",\n activeClassName = \"active\",\n activeStyle,\n className: classNameProp,\n exact,\n isActive: isActiveProp,\n location: locationProp,\n sensitive,\n strict,\n style: styleProp,\n to,\n innerRef, // TODO: deprecate\n ...rest\n },\n forwardedRef\n ) => {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <NavLink> outside a <Router>\");\n\n const currentLocation = locationProp || context.location;\n const toLocation = normalizeToLocation(\n resolveToLocation(to, currentLocation),\n currentLocation\n );\n const { pathname: path } = toLocation;\n // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n const escapedPath =\n path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n\n const match = escapedPath\n ? matchPath(currentLocation.pathname, {\n path: escapedPath,\n exact,\n sensitive,\n strict\n })\n : null;\n const isActive = !!(isActiveProp\n ? isActiveProp(match, currentLocation)\n : match);\n\n const className = isActive\n ? joinClassnames(classNameProp, activeClassName)\n : classNameProp;\n const style = isActive ? { ...styleProp, ...activeStyle } : styleProp;\n\n const props = {\n \"aria-current\": (isActive && ariaCurrent) || null,\n className,\n style,\n to: toLocation,\n ...rest\n };\n\n // React 15 compat\n if (forwardRefShim !== forwardRef) {\n props.ref = forwardedRef || innerRef;\n } else {\n props.innerRef = innerRef;\n }\n\n return <Link {...props} />;\n }}\n </RouterContext.Consumer>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n\n const ariaCurrentType = PropTypes.oneOf([\n \"page\",\n \"step\",\n \"location\",\n \"date\",\n \"time\",\n \"true\"\n ]);\n\n NavLink.propTypes = {\n ...Link.propTypes,\n \"aria-current\": ariaCurrentType,\n activeClassName: PropTypes.string,\n activeStyle: PropTypes.object,\n className: PropTypes.string,\n exact: PropTypes.bool,\n isActive: PropTypes.func,\n location: PropTypes.object,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool,\n style: PropTypes.object\n };\n}\n\nexport default NavLink;\n"],"names":["BrowserRouter","history","createHistory","props","render","children","React","Component","propTypes","basename","PropTypes","string","node","forceRefresh","bool","getUserConfirmation","func","keyLength","number","prototype","componentDidMount","warning","HashRouter","hashType","oneOf","resolveToLocation","to","currentLocation","normalizeToLocation","createLocation","forwardRefShim","C","forwardRef","isModifiedEvent","event","metaKey","altKey","ctrlKey","shiftKey","LinkAnchor","forwardedRef","innerRef","navigate","onClick","rest","target","ex","preventDefault","defaultPrevented","button","ref","displayName","Link","component","replace","RouterContext","context","invariant","location","href","createHref","method","push","createElement","toType","oneOfType","object","refType","shape","current","any","isRequired","joinClassnames","classnames","filter","i","join","NavLink","ariaCurrent","activeClassName","activeStyle","classNameProp","className","exact","isActiveProp","isActive","locationProp","sensitive","strict","styleProp","style","toLocation","path","pathname","escapedPath","match","matchPath","ariaCurrentType"],"mappings":"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"}
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("generatePath");
3 +module.exports = require("./index.js").generatePath;
1 +"use strict";
2 +
3 +if (process.env.NODE_ENV === "production") {
4 + module.exports = require("./cjs/react-router-dom.min.js");
5 +} else {
6 + module.exports = require("./cjs/react-router-dom.js");
7 +}
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("matchPath");
3 +module.exports = require("./index.js").matchPath;
1 +import React from "react";
2 +import { Router } from "react-router";
3 +import { createBrowserHistory as createHistory } from "history";
4 +import PropTypes from "prop-types";
5 +import warning from "tiny-warning";
6 +
7 +/**
8 + * The public API for a <Router> that uses HTML5 history.
9 + */
10 +class BrowserRouter extends React.Component {
11 + history = createHistory(this.props);
12 +
13 + render() {
14 + return <Router history={this.history} children={this.props.children} />;
15 + }
16 +}
17 +
18 +if (__DEV__) {
19 + BrowserRouter.propTypes = {
20 + basename: PropTypes.string,
21 + children: PropTypes.node,
22 + forceRefresh: PropTypes.bool,
23 + getUserConfirmation: PropTypes.func,
24 + keyLength: PropTypes.number
25 + };
26 +
27 + BrowserRouter.prototype.componentDidMount = function() {
28 + warning(
29 + !this.props.history,
30 + "<BrowserRouter> ignores the history prop. To use a custom history, " +
31 + "use `import { Router }` instead of `import { BrowserRouter as Router }`."
32 + );
33 + };
34 +}
35 +
36 +export default BrowserRouter;
1 +import React from "react";
2 +import { Router } from "react-router";
3 +import { createHashHistory as createHistory } from "history";
4 +import PropTypes from "prop-types";
5 +import warning from "tiny-warning";
6 +
7 +/**
8 + * The public API for a <Router> that uses window.location.hash.
9 + */
10 +class HashRouter extends React.Component {
11 + history = createHistory(this.props);
12 +
13 + render() {
14 + return <Router history={this.history} children={this.props.children} />;
15 + }
16 +}
17 +
18 +if (__DEV__) {
19 + HashRouter.propTypes = {
20 + basename: PropTypes.string,
21 + children: PropTypes.node,
22 + getUserConfirmation: PropTypes.func,
23 + hashType: PropTypes.oneOf(["hashbang", "noslash", "slash"])
24 + };
25 +
26 + HashRouter.prototype.componentDidMount = function() {
27 + warning(
28 + !this.props.history,
29 + "<HashRouter> ignores the history prop. To use a custom history, " +
30 + "use `import { Router }` instead of `import { HashRouter as Router }`."
31 + );
32 + };
33 +}
34 +
35 +export default HashRouter;
1 +import React from "react";
2 +import { __RouterContext as RouterContext } from "react-router";
3 +import PropTypes from "prop-types";
4 +import invariant from "tiny-invariant";
5 +import {
6 + resolveToLocation,
7 + normalizeToLocation
8 +} from "./utils/locationUtils.js";
9 +
10 +// React 15 compat
11 +const forwardRefShim = C => C;
12 +let { forwardRef } = React;
13 +if (typeof forwardRef === "undefined") {
14 + forwardRef = forwardRefShim;
15 +}
16 +
17 +function isModifiedEvent(event) {
18 + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
19 +}
20 +
21 +const LinkAnchor = forwardRef(
22 + (
23 + {
24 + innerRef, // TODO: deprecate
25 + navigate,
26 + onClick,
27 + ...rest
28 + },
29 + forwardedRef
30 + ) => {
31 + const { target } = rest;
32 +
33 + let props = {
34 + ...rest,
35 + onClick: event => {
36 + try {
37 + if (onClick) onClick(event);
38 + } catch (ex) {
39 + event.preventDefault();
40 + throw ex;
41 + }
42 +
43 + if (
44 + !event.defaultPrevented && // onClick prevented default
45 + event.button === 0 && // ignore everything but left clicks
46 + (!target || target === "_self") && // let browser handle "target=_blank" etc.
47 + !isModifiedEvent(event) // ignore clicks with modifier keys
48 + ) {
49 + event.preventDefault();
50 + navigate();
51 + }
52 + }
53 + };
54 +
55 + // React 15 compat
56 + if (forwardRefShim !== forwardRef) {
57 + props.ref = forwardedRef || innerRef;
58 + } else {
59 + props.ref = innerRef;
60 + }
61 +
62 + /* eslint-disable-next-line jsx-a11y/anchor-has-content */
63 + return <a {...props} />;
64 + }
65 +);
66 +
67 +if (__DEV__) {
68 + LinkAnchor.displayName = "LinkAnchor";
69 +}
70 +
71 +/**
72 + * The public API for rendering a history-aware <a>.
73 + */
74 +const Link = forwardRef(
75 + (
76 + {
77 + component = LinkAnchor,
78 + replace,
79 + to,
80 + innerRef, // TODO: deprecate
81 + ...rest
82 + },
83 + forwardedRef
84 + ) => {
85 + return (
86 + <RouterContext.Consumer>
87 + {context => {
88 + invariant(context, "You should not use <Link> outside a <Router>");
89 +
90 + const { history } = context;
91 +
92 + const location = normalizeToLocation(
93 + resolveToLocation(to, context.location),
94 + context.location
95 + );
96 +
97 + const href = location ? history.createHref(location) : "";
98 + const props = {
99 + ...rest,
100 + href,
101 + navigate() {
102 + const location = resolveToLocation(to, context.location);
103 + const method = replace ? history.replace : history.push;
104 +
105 + method(location);
106 + }
107 + };
108 +
109 + // React 15 compat
110 + if (forwardRefShim !== forwardRef) {
111 + props.ref = forwardedRef || innerRef;
112 + } else {
113 + props.innerRef = innerRef;
114 + }
115 +
116 + return React.createElement(component, props);
117 + }}
118 + </RouterContext.Consumer>
119 + );
120 + }
121 +);
122 +
123 +if (__DEV__) {
124 + const toType = PropTypes.oneOfType([
125 + PropTypes.string,
126 + PropTypes.object,
127 + PropTypes.func
128 + ]);
129 + const refType = PropTypes.oneOfType([
130 + PropTypes.string,
131 + PropTypes.func,
132 + PropTypes.shape({ current: PropTypes.any })
133 + ]);
134 +
135 + Link.displayName = "Link";
136 +
137 + Link.propTypes = {
138 + innerRef: refType,
139 + onClick: PropTypes.func,
140 + replace: PropTypes.bool,
141 + target: PropTypes.string,
142 + to: toType.isRequired
143 + };
144 +}
145 +
146 +export default Link;
1 +import React from "react";
2 +import { __RouterContext as RouterContext, matchPath } from "react-router";
3 +import PropTypes from "prop-types";
4 +import invariant from "tiny-invariant";
5 +import Link from "./Link.js";
6 +import {
7 + resolveToLocation,
8 + normalizeToLocation
9 +} from "./utils/locationUtils.js";
10 +
11 +// React 15 compat
12 +const forwardRefShim = C => C;
13 +let { forwardRef } = React;
14 +if (typeof forwardRef === "undefined") {
15 + forwardRef = forwardRefShim;
16 +}
17 +
18 +function joinClassnames(...classnames) {
19 + return classnames.filter(i => i).join(" ");
20 +}
21 +
22 +/**
23 + * A <Link> wrapper that knows if it's "active" or not.
24 + */
25 +const NavLink = forwardRef(
26 + (
27 + {
28 + "aria-current": ariaCurrent = "page",
29 + activeClassName = "active",
30 + activeStyle,
31 + className: classNameProp,
32 + exact,
33 + isActive: isActiveProp,
34 + location: locationProp,
35 + sensitive,
36 + strict,
37 + style: styleProp,
38 + to,
39 + innerRef, // TODO: deprecate
40 + ...rest
41 + },
42 + forwardedRef
43 + ) => {
44 + return (
45 + <RouterContext.Consumer>
46 + {context => {
47 + invariant(context, "You should not use <NavLink> outside a <Router>");
48 +
49 + const currentLocation = locationProp || context.location;
50 + const toLocation = normalizeToLocation(
51 + resolveToLocation(to, currentLocation),
52 + currentLocation
53 + );
54 + const { pathname: path } = toLocation;
55 + // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
56 + const escapedPath =
57 + path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
58 +
59 + const match = escapedPath
60 + ? matchPath(currentLocation.pathname, {
61 + path: escapedPath,
62 + exact,
63 + sensitive,
64 + strict
65 + })
66 + : null;
67 + const isActive = !!(isActiveProp
68 + ? isActiveProp(match, currentLocation)
69 + : match);
70 +
71 + const className = isActive
72 + ? joinClassnames(classNameProp, activeClassName)
73 + : classNameProp;
74 + const style = isActive ? { ...styleProp, ...activeStyle } : styleProp;
75 +
76 + const props = {
77 + "aria-current": (isActive && ariaCurrent) || null,
78 + className,
79 + style,
80 + to: toLocation,
81 + ...rest
82 + };
83 +
84 + // React 15 compat
85 + if (forwardRefShim !== forwardRef) {
86 + props.ref = forwardedRef || innerRef;
87 + } else {
88 + props.innerRef = innerRef;
89 + }
90 +
91 + return <Link {...props} />;
92 + }}
93 + </RouterContext.Consumer>
94 + );
95 + }
96 +);
97 +
98 +if (__DEV__) {
99 + NavLink.displayName = "NavLink";
100 +
101 + const ariaCurrentType = PropTypes.oneOf([
102 + "page",
103 + "step",
104 + "location",
105 + "date",
106 + "time",
107 + "true"
108 + ]);
109 +
110 + NavLink.propTypes = {
111 + ...Link.propTypes,
112 + "aria-current": ariaCurrentType,
113 + activeClassName: PropTypes.string,
114 + activeStyle: PropTypes.object,
115 + className: PropTypes.string,
116 + exact: PropTypes.bool,
117 + isActive: PropTypes.func,
118 + location: PropTypes.object,
119 + sensitive: PropTypes.bool,
120 + strict: PropTypes.bool,
121 + style: PropTypes.object
122 + };
123 +}
124 +
125 +export default NavLink;
1 +export {
2 + MemoryRouter,
3 + Prompt,
4 + Redirect,
5 + Route,
6 + Router,
7 + StaticRouter,
8 + Switch,
9 + generatePath,
10 + matchPath,
11 + withRouter,
12 + useHistory,
13 + useLocation,
14 + useParams,
15 + useRouteMatch
16 +} from "react-router";
17 +
18 +export { default as BrowserRouter } from "./BrowserRouter.js";
19 +export { default as HashRouter } from "./HashRouter.js";
20 +export { default as Link } from "./Link.js";
21 +export { default as NavLink } from "./NavLink.js";
1 +import { createLocation } from "history";
2 +
3 +export const resolveToLocation = (to, currentLocation) =>
4 + typeof to === "function" ? to(currentLocation) : to;
5 +
6 +export const normalizeToLocation = (to, currentLocation) => {
7 + return typeof to === "string"
8 + ? createLocation(to, null, null, currentLocation)
9 + : to;
10 +};
1 +{
2 + "_from": "react-router-dom",
3 + "_id": "react-router-dom@5.2.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==",
6 + "_location": "/react-router-dom",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "tag",
10 + "registry": true,
11 + "raw": "react-router-dom",
12 + "name": "react-router-dom",
13 + "escapedName": "react-router-dom",
14 + "rawSpec": "",
15 + "saveSpec": null,
16 + "fetchSpec": "latest"
17 + },
18 + "_requiredBy": [
19 + "#USER",
20 + "/"
21 + ],
22 + "_resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz",
23 + "_shasum": "9e65a4d0c45e13289e66c7b17c7e175d0ea15662",
24 + "_spec": "react-router-dom",
25 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject",
26 + "author": {
27 + "name": "React Training",
28 + "email": "hello@reacttraining.com"
29 + },
30 + "browserify": {
31 + "transform": [
32 + "loose-envify"
33 + ]
34 + },
35 + "bugs": {
36 + "url": "https://github.com/ReactTraining/react-router/issues"
37 + },
38 + "bundleDependencies": false,
39 + "dependencies": {
40 + "@babel/runtime": "^7.1.2",
41 + "history": "^4.9.0",
42 + "loose-envify": "^1.3.1",
43 + "prop-types": "^15.6.2",
44 + "react-router": "5.2.0",
45 + "tiny-invariant": "^1.0.2",
46 + "tiny-warning": "^1.0.0"
47 + },
48 + "deprecated": false,
49 + "description": "DOM bindings for React Router",
50 + "files": [
51 + "BrowserRouter.js",
52 + "HashRouter.js",
53 + "Link.js",
54 + "MemoryRouter.js",
55 + "NavLink.js",
56 + "Prompt.js",
57 + "Redirect.js",
58 + "Route.js",
59 + "Router.js",
60 + "StaticRouter.js",
61 + "Switch.js",
62 + "cjs",
63 + "es",
64 + "esm",
65 + "index.js",
66 + "generatePath.js",
67 + "matchPath.js",
68 + "modules/*.js",
69 + "modules/utils/*.js",
70 + "withRouter.js",
71 + "warnAboutDeprecatedCJSRequire.js",
72 + "umd"
73 + ],
74 + "gitHead": "21a62e55c0d6196002bd4ab5b3350514976928cf",
75 + "homepage": "https://github.com/ReactTraining/react-router#readme",
76 + "keywords": [
77 + "react",
78 + "router",
79 + "route",
80 + "routing",
81 + "history",
82 + "link"
83 + ],
84 + "license": "MIT",
85 + "main": "index.js",
86 + "module": "esm/react-router-dom.js",
87 + "name": "react-router-dom",
88 + "peerDependencies": {
89 + "react": ">=15"
90 + },
91 + "repository": {
92 + "type": "git",
93 + "url": "git+https://github.com/ReactTraining/react-router.git"
94 + },
95 + "scripts": {
96 + "build": "rollup -c",
97 + "lint": "eslint modules"
98 + },
99 + "sideEffects": false,
100 + "version": "5.2.0"
101 +}
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
1 +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).ReactRouterDOM={},t.React)}(this,function(t,c){"use strict";var C="default"in c?c.default:c;function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,s=n?Symbol.for("react.context"):60110,f=n?Symbol.for("react.async_mode"):60111,l=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,v=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,m=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118;function w(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case f:case l:case i:case c:case a:case h:return t;default:switch(t=t&&t.$$typeof){case s:case p:case u:return t;default:return e}}case y:case v:case o:return e}}}function b(t){return w(t)===l}e.typeOf=w,e.AsyncMode=f,e.ConcurrentMode=l,e.ContextConsumer=s,e.ContextProvider=u,e.Element=r,e.ForwardRef=p,e.Fragment=i,e.Lazy=y,e.Memo=v,e.Portal=o,e.Profiler=c,e.StrictMode=a,e.Suspense=h,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===l||t===c||t===a||t===h||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===v||t.$$typeof===u||t.$$typeof===s||t.$$typeof===p||t.$$typeof===m||t.$$typeof===g)},e.isAsyncMode=function(t){return b(t)||w(t)===f},e.isConcurrentMode=b,e.isContextConsumer=function(t){return w(t)===s},e.isContextProvider=function(t){return w(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},e.isForwardRef=function(t){return w(t)===p},e.isFragment=function(t){return w(t)===i},e.isLazy=function(t){return w(t)===y},e.isMemo=function(t){return w(t)===v},e.isPortal=function(t){return w(t)===o},e.isProfiler=function(t){return w(t)===c},e.isStrictMode=function(t){return w(t)===a},e.isSuspense=function(t){return w(t)===h}});e(o);o.typeOf,o.AsyncMode,o.ConcurrentMode,o.ContextConsumer,o.ContextProvider,o.Element,o.ForwardRef,o.Fragment,o.Lazy,o.Memo,o.Portal,o.Profiler,o.StrictMode,o.Suspense,o.isValidElementType,o.isAsyncMode,o.isConcurrentMode,o.isContextConsumer,o.isContextProvider,o.isElement,o.isForwardRef,o.isFragment,o.isLazy,o.isMemo,o.isPortal,o.isProfiler,o.isStrictMode,o.isSuspense;var i=n(function(t,e){});e(i);i.typeOf,i.AsyncMode,i.ConcurrentMode,i.ContextConsumer,i.ContextProvider,i.Element,i.ForwardRef,i.Fragment,i.Lazy,i.Memo,i.Portal,i.Profiler,i.StrictMode,i.Suspense,i.isValidElementType,i.isAsyncMode,i.isConcurrentMode,i.isContextConsumer,i.isContextProvider,i.isElement,i.isForwardRef,i.isFragment,i.isLazy,i.isMemo,i.isPortal,i.isProfiler,i.isStrictMode,i.isSuspense;var a=n(function(t){t.exports=o}),u=(a.isValidElementType,Object.getOwnPropertySymbols),s=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()||Object.assign,Function.call.bind(Object.prototype.hasOwnProperty);function l(){}function p(){}p.resetWarningCache=l;var h=n(function(t){t.exports=function(){function t(t,e,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}var n={array:t.isRequired=t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:p,resetWarningCache:l};return n.PropTypes=n}()});function T(){return(T=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function d(t){return"/"===t.charAt(0)}function v(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()}var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var m="Invariant failed";function k(t){if(!t)throw new Error(m)}function A(t){return"/"===t.charAt(0)?t:"/"+t}function g(t){return"/"===t.charAt(0)?t.substr(1):t}function M(t,e){return function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)}(t,e)?t.substr(e.length):t}function _(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function j(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function L(t,e,n,r){var o;"string"==typeof t?(o=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(o=T({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=function(t,e){var n=1<arguments.length&&void 0!==e?e:"",r=t&&t.split("/")||[],o=n&&n.split("/")||[],i=t&&d(t),a=n&&d(n),c=i||a;if(t&&d(t)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";var u=void 0;if(o.length){var s=o[o.length-1];u="."===s||".."===s||""===s}else u=!1;for(var f=0,l=o.length;0<=l;l--){var p=o[l];"."===p?v(o,l):".."===p?(v(o,l),f++):f&&(v(o,l),f--)}if(!c)for(;f--;)o.unshift("..");!c||""===o[0]||o[0]&&d(o[0])||o.unshift("");var h=o.join("/");return u&&"/"!==h.substr(-1)&&(h+="/"),h}(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function S(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&function n(e,r){if(e===r)return!0;if(null==e||null==r)return!1;if(Array.isArray(e))return Array.isArray(r)&&e.length===r.length&&e.every(function(t,e){return n(t,r[e])});var t=void 0===e?"undefined":y(e);if(t!==(void 0===r?"undefined":y(r)))return!1;if("object"!==t)return!1;var o=e.valueOf(),i=r.valueOf();if(o!==e||i!==r)return n(o,i);var a=Object.keys(e),c=Object.keys(r);return a.length===c.length&&a.every(function(t){return n(e[t],r[t])})}(t.state,e.state)}function $(){var i=null;var r=[];return{setPrompt:function(t){return i=t,function(){i===t&&(i=null)}},confirmTransitionTo:function(t,e,n,r){if(null!=i){var o="function"==typeof i?i(t,e):i;"string"==typeof o?"function"==typeof n?n(o,r):r(!0):r(!1!==o)}else r(!0)},appendListener:function(t){var e=!0;function n(){e&&t.apply(void 0,arguments)}return r.push(n),function(){e=!1,r=r.filter(function(t){return t!==n})}},notifyListeners:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.forEach(function(t){return t.apply(void 0,e)})}}}var U=!("undefined"==typeof window||!window.document||!window.document.createElement);function F(t,e){e(window.confirm(t))}var N="popstate",H="hashchange";function I(){try{return window.history.state||{}}catch(t){return{}}}function w(t){void 0===t&&(t={}),U||k(!1);var c=window.history,u=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)}(),e=!(-1===window.navigator.userAgent.indexOf("Trident")),n=t,r=n.forceRefresh,s=void 0!==r&&r,o=n.getUserConfirmation,f=void 0===o?F:o,i=n.keyLength,a=void 0===i?6:i,l=t.basename?_(A(t.basename)):"";function p(t){var e=t||{},n=e.key,r=e.state,o=window.location,i=o.pathname+o.search+o.hash;return l&&(i=M(i,l)),L(i,r,n)}function h(){return Math.random().toString(36).substr(2,a)}var d=$();function v(t){T(R,t),R.length=c.length,d.notifyListeners(R.location,R.action)}function y(t){!function(t){void 0===t.state&&navigator.userAgent.indexOf("CriOS")}(t)&&w(p(t.state))}function m(){w(p(I()))}var g=!1;function w(e){if(g)g=!1,v();else{d.confirmTransitionTo(e,"POP",f,function(t){t?v({action:"POP",location:e}):function(t){var e=R.location,n=x.indexOf(e.key);-1===n&&(n=0);var r=x.indexOf(t.key);-1===r&&(r=0);var o=n-r;o&&(g=!0,O(o))}(e)})}}var b=p(I()),x=[b.key];function P(t){return l+j(t)}function O(t){c.go(t)}var C=0;function E(t){1===(C+=t)&&1===t?(window.addEventListener(N,y),e&&window.addEventListener(H,m)):0===C&&(window.removeEventListener(N,y),e&&window.removeEventListener(H,m))}var S=!1;var R={length:c.length,action:"POP",location:b,createHref:P,push:function(t,e){var a=L(t,e,h(),R.location);d.confirmTransitionTo(a,"PUSH",f,function(t){if(t){var e=P(a),n=a.key,r=a.state;if(u)if(c.pushState({key:n,state:r},null,e),s)window.location.href=e;else{var o=x.indexOf(R.location.key),i=x.slice(0,-1===o?0:o+1);i.push(a.key),x=i,v({action:"PUSH",location:a})}else window.location.href=e}})},replace:function(t,e){var i="REPLACE",a=L(t,e,h(),R.location);d.confirmTransitionTo(a,i,f,function(t){if(t){var e=P(a),n=a.key,r=a.state;if(u)if(c.replaceState({key:n,state:r},null,e),s)window.location.replace(e);else{var o=x.indexOf(R.location.key);-1!==o&&(x[o]=a.key),v({action:i,location:a})}else window.location.replace(e)}})},go:O,goBack:function(){O(-1)},goForward:function(){O(1)},block:function(t){void 0===t&&(t=!1);var e=d.setPrompt(t);return S||(E(1),S=!0),function(){return S&&(S=!1,E(-1)),e()}},listen:function(t){var e=d.appendListener(t);return E(1),function(){E(-1),e()}}};return R}var R="hashchange",B={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+g(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:g,decodePath:A},slash:{encodePath:A,decodePath:A}};function D(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)}function W(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,0<=e?e:0)+"#"+t)}function b(t){void 0===t&&(t={}),U||k(!1);var e=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),t),r=n.getUserConfirmation,a=void 0===r?F:r,o=n.hashType,i=void 0===o?"slash":o,c=t.basename?_(A(t.basename)):"",u=B[i],s=u.encodePath,f=u.decodePath;function l(){var t=f(D());return c&&(t=M(t,c)),L(t)}var p=$();function h(t){T(E,t),E.length=e.length,p.notifyListeners(E.location,E.action)}var d=!1,v=null;function y(){var t=D(),e=s(t);if(t!==e)W(e);else{var n=l(),r=E.location;if(!d&&S(r,n))return;if(v===j(n))return;v=null,function(e){if(d)d=!1,h();else{p.confirmTransitionTo(e,"POP",a,function(t){t?h({action:"POP",location:e}):function(t){var e=E.location,n=b.lastIndexOf(j(e));-1===n&&(n=0);var r=b.lastIndexOf(j(t));-1===r&&(r=0);var o=n-r;o&&(d=!0,x(o))}(e)})}}(n)}}var m=D(),g=s(m);m!==g&&W(g);var w=l(),b=[j(w)];function x(t){e.go(t)}var P=0;function O(t){1===(P+=t)&&1===t?window.addEventListener(R,y):0===P&&window.removeEventListener(R,y)}var C=!1;var E={length:e.length,action:"POP",location:w,createHref:function(t){return"#"+s(c+j(t))},push:function(t,e){var i=L(t,void 0,void 0,E.location);p.confirmTransitionTo(i,"PUSH",a,function(t){if(t){var e=j(i),n=s(c+e);if(D()!==n){v=e,function(t){window.location.hash=t}(n);var r=b.lastIndexOf(j(E.location)),o=b.slice(0,-1===r?0:r+1);o.push(e),b=o,h({action:"PUSH",location:i})}else h()}})},replace:function(t,e){var o="REPLACE",i=L(t,void 0,void 0,E.location);p.confirmTransitionTo(i,o,a,function(t){if(t){var e=j(i),n=s(c+e);D()!==n&&(v=e,W(n));var r=b.indexOf(j(E.location));-1!==r&&(b[r]=e),h({action:o,location:i})}})},go:x,goBack:function(){x(-1)},goForward:function(){x(1)},block:function(t){void 0===t&&(t=!1);var e=p.setPrompt(t);return C||(O(1),C=!0),function(){return C&&(C=!1,O(-1)),e()}},listen:function(t){var e=p.appendListener(t);return O(1),function(){O(-1),e()}}};return E}function x(t,e,n){return Math.min(Math.max(t,e),n)}function P(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}var O=1073741823,E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function V(t,e){return tt(X(t,e))}var z=C.createContext||function(r,o){var t,e,i="__create-react-context-"+function(){var t="__global_unique_id__";return E[t]=(E[t]||0)+1}()+"__",n=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).emitter=function(n){var r=[];return{on:function(t){r.push(t)},off:function(e){r=r.filter(function(t){return t!==e})},get:function(){return n},set:function(t,e){n=t,r.forEach(function(t){return t(n,e)})}}}(t.props.value),t}P(t,e);var n=t.prototype;return n.getChildContext=function(){var t;return(t={})[i]=this.emitter,t},n.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var e,n=this.props.value,r=t.value;!function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}(n,r)?(e="function"==typeof o?o(n,r):O,0!==(e|=0)&&this.emitter.set(t.value,e)):e=0}},n.render=function(){return this.props.children},t}(c.Component);n.childContextTypes=((t={})[i]=h.object.isRequired,t);var a=function(t){function e(){var n;return(n=t.apply(this,arguments)||this).state={value:n.getValue()},n.onUpdate=function(t,e){0!=((0|n.observedBits)&e)&&n.setState({value:n.getValue()})},n}P(e,t);var n=e.prototype;return n.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?O:e},n.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?O:t},n.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},n.getValue=function(){return this.context[i]?this.context[i].get():r},n.render=function(){return function(t){return Array.isArray(t)?t[0]:t}(this.props.children)(this.state.value)},e}(c.Component);return a.contextTypes=((e={})[i]=h.object,e),{Provider:n,Consumer:a}},q=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},K=it,J=X,G=tt,Y=ot,Q=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function X(t,e){for(var n,r,o=[],i=0,a=0,c="",u=e&&e.delimiter||"/";null!=(n=Q.exec(t));){var s=n[0],f=n[1],l=n.index;if(c+=t.slice(a,l),a=l+s.length,f)c+=f[1];else{var p=t[a],h=n[2],d=n[3],v=n[4],y=n[5],m=n[6],g=n[7];c&&(o.push(c),c="");var w=null!=h&&null!=p&&p!==h,b="+"===m||"*"===m,x="?"===m||"*"===m,P=n[2]||u,O=v||y;o.push({name:d||i++,prefix:h||"",delimiter:P,optional:x,repeat:b,partial:w,asterisk:!!g,pattern:O?(r=O,r.replace(/([=!:$\/()])/g,"\\$1")):g?".*":"[^"+et(P)+"]+?"})}}return a<t.length&&(c+=t.substr(a)),c&&o.push(c),o}function Z(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function tt(f){for(var l=new Array(f.length),t=0;t<f.length;t++)"object"==typeof f[t]&&(l[t]=new RegExp("^(?:"+f[t].pattern+")$"));return function(t,e){for(var n="",r=t||{},o=(e||{}).pretty?Z:encodeURIComponent,i=0;i<f.length;i++){var a=f[i];if("string"!=typeof a){var c,u=r[a.name];if(null==u){if(a.optional){a.partial&&(n+=a.prefix);continue}throw new TypeError('Expected "'+a.name+'" to be defined')}if(q(u)){if(!a.repeat)throw new TypeError('Expected "'+a.name+'" to not repeat, but received `'+JSON.stringify(u)+"`");if(0===u.length){if(a.optional)continue;throw new TypeError('Expected "'+a.name+'" to not be empty')}for(var s=0;s<u.length;s++){if(c=o(u[s]),!l[i].test(c))throw new TypeError('Expected all "'+a.name+'" to match "'+a.pattern+'", but received `'+JSON.stringify(c)+"`");n+=(0===s?a.prefix:a.delimiter)+c}}else{if(c=a.asterisk?encodeURI(u).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):o(u),!l[i].test(c))throw new TypeError('Expected "'+a.name+'" to match "'+a.pattern+'", but received "'+c+'"');n+=a.prefix+c}}else n+=a}return n}}function et(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function nt(t,e){return t.keys=e,t}function rt(t){return t.sensitive?"":"i"}function ot(t,e,n){q(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",a=0;a<t.length;a++){var c=t[a];if("string"==typeof c)i+=et(c);else{var u=et(c.prefix),s="(?:"+c.pattern+")";e.push(c),c.repeat&&(s+="(?:"+u+s+")*"),i+=s=c.optional?c.partial?u+"("+s+")?":"(?:"+u+"("+s+"))?":u+"("+s+")"}}var f=et(n.delimiter||"/"),l=i.slice(-f.length)===f;return r||(i=(l?i.slice(0,-f.length):i)+"(?:"+f+"(?=$))?"),i+=o?"$":r&&l?"":"(?="+f+"|$)",nt(new RegExp("^"+i,rt(n)),e)}function it(t,e,n){return q(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return nt(t,e)}(t,e):q(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(it(t[o],e,n).source);return nt(new RegExp("(?:"+r.join("|")+")",rt(n)),e)}(t,e,n):function(t,e,n){return ot(X(t,n),e,n)}(t,e,n)}function at(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||(o[n]=t[n]);return o}K.parse=J,K.compile=V,K.tokensToFunction=G,K.tokensToRegExp=Y;var ct={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ut={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},st={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ft={};function lt(t){return a.isMemo(t)?st:ft[t.$$typeof]||ct}ft[a.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var pt=Object.defineProperty,ht=Object.getOwnPropertyNames,dt=Object.getOwnPropertySymbols,vt=Object.getOwnPropertyDescriptor,yt=Object.getPrototypeOf,mt=Object.prototype;var gt=function t(e,n,r){if("string"==typeof n)return e;if(mt){var o=yt(n);o&&o!==mt&&t(e,o,r)}var i=ht(n);dt&&(i=i.concat(dt(n)));for(var a=lt(e),c=lt(n),u=0;u<i.length;++u){var s=i[u];if(!(ut[s]||r&&r[s]||c&&c[s]||a&&a[s])){var f=vt(n,s);try{pt(e,s,f)}catch(t){}}}return e},wt=function(t){var e=z();return e.displayName=t,e}("Router-History"),bt=function(t){var e=z();return e.displayName=t,e}("Router"),xt=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={location:t.history.location},e._isMounted=!1,e._pendingLocation=null,t.staticContext||(e.unlisten=t.history.listen(function(t){e._isMounted?e.setState({location:t}):e._pendingLocation=t})),e}r(t,n),t.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var e=t.prototype;return e.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},e.componentWillUnmount=function(){this.unlisten&&this.unlisten()},e.render=function(){return C.createElement(bt.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},C.createElement(wt.Provider,{children:this.props.children||null,value:this.props.history}))},t}(C.Component),Pt=function(o){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))||this).history=function(t){void 0===t&&(t={});var e=t,o=e.getUserConfirmation,n=e.initialEntries,r=void 0===n?["/"]:n,i=e.initialIndex,a=void 0===i?0:i,c=e.keyLength,u=void 0===c?6:c,s=$();function f(t){T(y,t),y.length=y.entries.length,s.notifyListeners(y.location,y.action)}function l(){return Math.random().toString(36).substr(2,u)}var p=x(a,0,r.length-1),h=r.map(function(t){return L(t,void 0,"string"==typeof t?l():t.key||l())}),d=j;function v(t){var e=x(y.index+t,0,y.entries.length-1),n=y.entries[e];s.confirmTransitionTo(n,"POP",o,function(t){t?f({action:"POP",location:n,index:e}):f()})}var y={length:h.length,action:"POP",location:h[p],index:p,entries:h,createHref:d,push:function(t,e){var r=L(t,e,l(),y.location);s.confirmTransitionTo(r,"PUSH",o,function(t){if(t){var e=y.index+1,n=y.entries.slice(0);n.length>e?n.splice(e,n.length-e,r):n.push(r),f({action:"PUSH",location:r,index:e,entries:n})}})},replace:function(t,e){var n="REPLACE",r=L(t,e,l(),y.location);s.confirmTransitionTo(r,n,o,function(t){t&&(y.entries[y.index]=r,f({action:n,location:r}))})},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(t){var e=y.index+t;return 0<=e&&e<y.entries.length},block:function(t){return void 0===t&&(t=!1),s.setPrompt(t)},listen:function(t){return s.appendListener(t)}};return y}(t.props),t}return r(t,o),t.prototype.render=function(){return C.createElement(xt,{history:this.history,children:this.props.children})},t}(C.Component),Ot=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(t){this.props.onUpdate&&this.props.onUpdate.call(this,this,t)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},e}(C.Component);var Ct={},Et=1e4,St=0;function Rt(t,e){return void 0===t&&(t="/"),void 0===e&&(e={}),"/"===t?t:function(t){if(Ct[t])return Ct[t];var e=K.compile(t);return St<Et&&(Ct[t]=e,St++),e}(t)(e,{pretty:!0})}var Tt={},kt=1e4,At=0;function Mt(s,t){void 0===t&&(t={}),"string"!=typeof t&&!Array.isArray(t)||(t={path:t});var e=t,n=e.path,r=e.exact,f=void 0!==r&&r,o=e.strict,l=void 0!==o&&o,i=e.sensitive,p=void 0!==i&&i;return[].concat(n).reduce(function(t,e){if(!e&&""!==e)return null;if(t)return t;var n=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=Tt[n]||(Tt[n]={});if(r[t])return r[t];var o=[],i={regexp:K(t,o,e),keys:o};return At<kt&&(r[t]=i,At++),i}(e,{end:f,strict:l,sensitive:p}),r=n.regexp,o=n.keys,i=r.exec(s);if(!i)return null;var a=i[0],c=i.slice(1),u=s===a;return f&&!u?null:{path:e,url:"/"===e&&""===a?"/":a,isExact:u,params:o.reduce(function(t,e,n){return t[e.name]=c[n],t},{})}},null)}var _t=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var c=this;return C.createElement(bt.Consumer,null,function(t){t||k(!1);var e=c.props.location||t.location,n=T({},t,{location:e,match:c.props.computedMatch?c.props.computedMatch:c.props.path?Mt(e.pathname,c.props):t.match}),r=c.props,o=r.children,i=r.component,a=r.render;return Array.isArray(o)&&0===o.length&&(o=null),C.createElement(bt.Provider,{value:n},n.match?o?"function"==typeof o?o(n):o:i?C.createElement(i,n):a?a(n):null:"function"==typeof o?o(n):null)})},e}(C.Component);function jt(t){return"/"===t.charAt(0)?t:"/"+t}function Lt(t){return"string"==typeof t?t:j(t)}function $t(){return function(){k(!1)}}function Ut(){}var Ft=function(o){function t(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=o.call.apply(o,[this].concat(n))||this).handlePush=function(t){return e.navigateTo(t,"PUSH")},e.handleReplace=function(t){return e.navigateTo(t,"REPLACE")},e.handleListen=function(){return Ut},e.handleBlock=function(){return Ut},e}r(t,o);var e=t.prototype;return e.navigateTo=function(t,e){var n=this.props,r=n.basename,o=void 0===r?"":r,i=n.context,a=void 0===i?{}:i;a.action=e,a.location=function(t,e){return t?T({},e,{pathname:jt(t)+e.pathname}):e}(o,L(t)),a.url=Lt(a.location)},e.render=function(){var t=this.props,e=t.basename,n=void 0===e?"":e,r=t.context,o=void 0===r?{}:r,i=t.location,a=void 0===i?"/":i,c=at(t,["basename","context","location"]),u={createHref:function(t){return jt(n+Lt(t))},action:"POP",location:function(t,e){if(!t)return e;var n=jt(t);return 0!==e.pathname.indexOf(n)?e:T({},e,{pathname:e.pathname.substr(n.length)})}(n,L(a)),push:this.handlePush,replace:this.handleReplace,go:$t(),goBack:$t(),goForward:$t(),listen:this.handleListen,block:this.handleBlock};return C.createElement(xt,T({},c,{history:u,staticContext:o}))},t}(C.Component),Nt=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var t=this;return C.createElement(bt.Consumer,null,function(n){n||k(!1);var r,o,i=t.props.location||n.location;return C.Children.forEach(t.props.children,function(t){if(null==o&&C.isValidElement(t)){var e=(r=t).props.path||t.props.from;o=e?Mt(i.pathname,T({},t.props,{path:e})):n.match}}),o?C.cloneElement(r,{location:i,computedMatch:o}):null})},e}(C.Component);var Ht=C.useContext;function It(){return Ht(bt).location}function Bt(t,e){return"function"==typeof t?t(e):t}function Dt(t,e){return"string"==typeof t?L(t,null,null,e):t}function Wt(t){return t}var Vt=function(o){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))||this).history=w(t.props),t}return r(t,o),t.prototype.render=function(){return C.createElement(xt,{history:this.history,children:this.props.children})},t}(C.Component),zt=function(o){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))||this).history=b(t.props),t}return r(t,o),t.prototype.render=function(){return C.createElement(xt,{history:this.history,children:this.props.children})},t}(C.Component),qt=C.forwardRef;void 0===qt&&(qt=Wt);function Kt(t){return t}var Jt=qt(function(t,e){var n=t.innerRef,r=t.navigate,o=t.onClick,i=at(t,["innerRef","navigate","onClick"]),a=i.target,c=T({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||a&&"_self"!==a||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=Wt!==qt&&e||n,C.createElement("a",c)}),Gt=qt(function(t,i){var e=t.component,a=void 0===e?Jt:e,c=t.replace,u=t.to,s=t.innerRef,f=at(t,["component","replace","to","innerRef"]);return C.createElement(bt.Consumer,null,function(e){e||k(!1);var n=e.history,t=Dt(Bt(u,e.location),e.location),r=t?n.createHref(t):"",o=T({},f,{href:r,navigate:function(){var t=Bt(u,e.location);(c?n.replace:n.push)(t)}});return Wt!==qt?o.ref=i||s:o.innerRef=s,C.createElement(a,o)})}),Yt=C.forwardRef;void 0===Yt&&(Yt=Kt);var Qt=Yt(function(t,f){var e=t["aria-current"],l=void 0===e?"page":e,n=t.activeClassName,p=void 0===n?"active":n,h=t.activeStyle,d=t.className,v=t.exact,y=t.isActive,m=t.location,g=t.sensitive,w=t.strict,b=t.style,x=t.to,P=t.innerRef,O=at(t,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return C.createElement(bt.Consumer,null,function(t){t||k(!1);var e=m||t.location,n=Dt(Bt(x,e),e),r=n.pathname,o=r&&r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),i=o?Mt(e.pathname,{path:o,exact:v,sensitive:g,strict:w}):null,a=!!(y?y(i,e):i),c=a?function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter(function(t){return t}).join(" ")}(d,p):d,u=a?T({},b,{},h):b,s=T({"aria-current":a&&l||null,className:c,style:u,to:n},O);return Kt!==Yt?s.ref=f||P:s.innerRef=P,C.createElement(Gt,s)})});t.BrowserRouter=Vt,t.HashRouter=zt,t.Link=Gt,t.MemoryRouter=Pt,t.NavLink=Qt,t.Prompt=function(t){var r=t.message,e=t.when,o=void 0===e||e;return C.createElement(bt.Consumer,null,function(t){if(t||k(!1),!o||t.staticContext)return null;var n=t.history.block;return C.createElement(Ot,{onMount:function(t){t.release=n(r)},onUpdate:function(t,e){e.message!==r&&(t.release(),t.release=n(r))},onUnmount:function(t){t.release()},message:r})})},t.Redirect=function(t){var i=t.computedMatch,a=t.to,e=t.push,c=void 0!==e&&e;return C.createElement(bt.Consumer,null,function(t){t||k(!1);var e=t.history,n=t.staticContext,r=c?e.push:e.replace,o=L(i?"string"==typeof a?Rt(a,i.params):T({},a,{pathname:Rt(a.pathname,i.params)}):a);return n?(r(o),null):C.createElement(Ot,{onMount:function(){r(o)},onUpdate:function(t,e){var n=L(e.to);S(n,T({},o,{key:n.key}))||r(o)},to:a})})},t.Route=_t,t.Router=xt,t.StaticRouter=Ft,t.Switch=Nt,t.generatePath=Rt,t.matchPath=Mt,t.useHistory=function(){return Ht(wt)},t.useLocation=It,t.useParams=function(){var t=Ht(bt).match;return t?t.params:{}},t.useRouteMatch=function(t){var e=It(),n=Ht(bt).match;return t?Mt(e.pathname,t):n},t.withRouter=function(r){function t(t){var e=t.wrappedComponentRef,n=at(t,["wrappedComponentRef"]);return C.createElement(bt.Consumer,null,function(t){return t||k(!1),C.createElement(r,T({},n,t,{ref:e}))})}var e="withRouter("+(r.displayName||r.name)+")";return t.displayName=e,t.WrappedComponent=r,gt(t,r)},Object.defineProperty(t,"__esModule",{value:!0})});
2 +//# sourceMappingURL=react-router-dom.min.js.map
This diff could not be displayed because it is too large.
1 +/* eslint-disable prefer-arrow-callback, no-empty */
2 +"use strict";
3 +
4 +var printWarning = function() {};
5 +
6 +if (process.env.NODE_ENV !== "production") {
7 + printWarning = function(format, subs) {
8 + var index = 0;
9 + var message =
10 + "Warning: " +
11 + (subs.length > 0
12 + ? format.replace(/%s/g, function() {
13 + return subs[index++];
14 + })
15 + : format);
16 +
17 + if (typeof console !== "undefined") {
18 + console.error(message);
19 + }
20 +
21 + try {
22 + // --- Welcome to debugging React Router ---
23 + // This error was thrown as a convenience so that you can use the
24 + // stack trace to find the callsite that triggered this warning.
25 + throw new Error(message);
26 + } catch (e) {}
27 + };
28 +}
29 +
30 +module.exports = function(member) {
31 + printWarning(
32 + 'Please use `require("react-router-dom").%s` instead of `require("react-router-dom/%s")`. ' +
33 + "Support for the latter will be removed in the next major release.",
34 + [member, member]
35 + );
36 +};
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("withRouter");
3 +module.exports = require("./index.js").withRouter;
1 +MIT License
2 +
3 +Copyright (c) React Training 2016-2018
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("MemoryRouter");
3 +module.exports = require("./index.js").MemoryRouter;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Prompt");
3 +module.exports = require("./index.js").Prompt;
1 +# react-router
2 +
3 +Declarative routing for [React](https://facebook.github.io/react).
4 +
5 +## Installation
6 +
7 +Using [npm](https://www.npmjs.com/):
8 +
9 + $ npm install --save react-router
10 +
11 +**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.
12 +
13 +Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
14 +
15 +```js
16 +// using ES6 modules
17 +import { Router, Route, Switch } from "react-router";
18 +
19 +// using CommonJS modules
20 +var Router = require("react-router").Router;
21 +var Route = require("react-router").Route;
22 +var Switch = require("react-router").Switch;
23 +```
24 +
25 +The UMD build is also available on [unpkg](https://unpkg.com):
26 +
27 +```html
28 +<script src="https://unpkg.com/react-router/umd/react-router.min.js"></script>
29 +```
30 +
31 +You can find the library on `window.ReactRouter`.
32 +
33 +## Issues
34 +
35 +If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/ReactTraining/react-router/issues).
36 +
37 +## Credits
38 +
39 +React Router is built and maintained by [React Training](https://reacttraining.com).
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Redirect");
3 +module.exports = require("./index.js").Redirect;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Route");
3 +module.exports = require("./index.js").Route;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Router");
3 +module.exports = require("./index.js").Router;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("StaticRouter");
3 +module.exports = require("./index.js").StaticRouter;
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("Switch");
3 +module.exports = require("./index.js").Switch;
1 +'use strict';
2 +
3 +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4 +
5 +var React = _interopDefault(require('react'));
6 +var PropTypes = _interopDefault(require('prop-types'));
7 +var history = require('history');
8 +var warning = _interopDefault(require('tiny-warning'));
9 +var createContext = _interopDefault(require('mini-create-react-context'));
10 +var invariant = _interopDefault(require('tiny-invariant'));
11 +var pathToRegexp = _interopDefault(require('path-to-regexp'));
12 +var reactIs = require('react-is');
13 +var hoistStatics = _interopDefault(require('hoist-non-react-statics'));
14 +
15 +function _extends() {
16 + _extends = Object.assign || function (target) {
17 + for (var i = 1; i < arguments.length; i++) {
18 + var source = arguments[i];
19 +
20 + for (var key in source) {
21 + if (Object.prototype.hasOwnProperty.call(source, key)) {
22 + target[key] = source[key];
23 + }
24 + }
25 + }
26 +
27 + return target;
28 + };
29 +
30 + return _extends.apply(this, arguments);
31 +}
32 +
33 +function _inheritsLoose(subClass, superClass) {
34 + subClass.prototype = Object.create(superClass.prototype);
35 + subClass.prototype.constructor = subClass;
36 + subClass.__proto__ = superClass;
37 +}
38 +
39 +function _objectWithoutPropertiesLoose(source, excluded) {
40 + if (source == null) return {};
41 + var target = {};
42 + var sourceKeys = Object.keys(source);
43 + var key, i;
44 +
45 + for (i = 0; i < sourceKeys.length; i++) {
46 + key = sourceKeys[i];
47 + if (excluded.indexOf(key) >= 0) continue;
48 + target[key] = source[key];
49 + }
50 +
51 + return target;
52 +}
53 +
54 +// TODO: Replace with React.createContext once we can assume React 16+
55 +
56 +var createNamedContext = function createNamedContext(name) {
57 + var context = createContext();
58 + context.displayName = name;
59 + return context;
60 +};
61 +
62 +var historyContext =
63 +/*#__PURE__*/
64 +createNamedContext("Router-History");
65 +
66 +// TODO: Replace with React.createContext once we can assume React 16+
67 +
68 +var createNamedContext$1 = function createNamedContext(name) {
69 + var context = createContext();
70 + context.displayName = name;
71 + return context;
72 +};
73 +
74 +var context =
75 +/*#__PURE__*/
76 +createNamedContext$1("Router");
77 +
78 +/**
79 + * The public API for putting history on context.
80 + */
81 +
82 +var Router =
83 +/*#__PURE__*/
84 +function (_React$Component) {
85 + _inheritsLoose(Router, _React$Component);
86 +
87 + Router.computeRootMatch = function computeRootMatch(pathname) {
88 + return {
89 + path: "/",
90 + url: "/",
91 + params: {},
92 + isExact: pathname === "/"
93 + };
94 + };
95 +
96 + function Router(props) {
97 + var _this;
98 +
99 + _this = _React$Component.call(this, props) || this;
100 + _this.state = {
101 + location: props.history.location
102 + }; // This is a bit of a hack. We have to start listening for location
103 + // changes here in the constructor in case there are any <Redirect>s
104 + // on the initial render. If there are, they will replace/push when
105 + // they mount and since cDM fires in children before parents, we may
106 + // get a new location before the <Router> is mounted.
107 +
108 + _this._isMounted = false;
109 + _this._pendingLocation = null;
110 +
111 + if (!props.staticContext) {
112 + _this.unlisten = props.history.listen(function (location) {
113 + if (_this._isMounted) {
114 + _this.setState({
115 + location: location
116 + });
117 + } else {
118 + _this._pendingLocation = location;
119 + }
120 + });
121 + }
122 +
123 + return _this;
124 + }
125 +
126 + var _proto = Router.prototype;
127 +
128 + _proto.componentDidMount = function componentDidMount() {
129 + this._isMounted = true;
130 +
131 + if (this._pendingLocation) {
132 + this.setState({
133 + location: this._pendingLocation
134 + });
135 + }
136 + };
137 +
138 + _proto.componentWillUnmount = function componentWillUnmount() {
139 + if (this.unlisten) this.unlisten();
140 + };
141 +
142 + _proto.render = function render() {
143 + return React.createElement(context.Provider, {
144 + value: {
145 + history: this.props.history,
146 + location: this.state.location,
147 + match: Router.computeRootMatch(this.state.location.pathname),
148 + staticContext: this.props.staticContext
149 + }
150 + }, React.createElement(historyContext.Provider, {
151 + children: this.props.children || null,
152 + value: this.props.history
153 + }));
154 + };
155 +
156 + return Router;
157 +}(React.Component);
158 +
159 +{
160 + Router.propTypes = {
161 + children: PropTypes.node,
162 + history: PropTypes.object.isRequired,
163 + staticContext: PropTypes.object
164 + };
165 +
166 + Router.prototype.componentDidUpdate = function (prevProps) {
167 + warning(prevProps.history === this.props.history, "You cannot change <Router history>") ;
168 + };
169 +}
170 +
171 +/**
172 + * The public API for a <Router> that stores location in memory.
173 + */
174 +
175 +var MemoryRouter =
176 +/*#__PURE__*/
177 +function (_React$Component) {
178 + _inheritsLoose(MemoryRouter, _React$Component);
179 +
180 + function MemoryRouter() {
181 + var _this;
182 +
183 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
184 + args[_key] = arguments[_key];
185 + }
186 +
187 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
188 + _this.history = history.createMemoryHistory(_this.props);
189 + return _this;
190 + }
191 +
192 + var _proto = MemoryRouter.prototype;
193 +
194 + _proto.render = function render() {
195 + return React.createElement(Router, {
196 + history: this.history,
197 + children: this.props.children
198 + });
199 + };
200 +
201 + return MemoryRouter;
202 +}(React.Component);
203 +
204 +{
205 + MemoryRouter.propTypes = {
206 + initialEntries: PropTypes.array,
207 + initialIndex: PropTypes.number,
208 + getUserConfirmation: PropTypes.func,
209 + keyLength: PropTypes.number,
210 + children: PropTypes.node
211 + };
212 +
213 + MemoryRouter.prototype.componentDidMount = function () {
214 + warning(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.") ;
215 + };
216 +}
217 +
218 +var Lifecycle =
219 +/*#__PURE__*/
220 +function (_React$Component) {
221 + _inheritsLoose(Lifecycle, _React$Component);
222 +
223 + function Lifecycle() {
224 + return _React$Component.apply(this, arguments) || this;
225 + }
226 +
227 + var _proto = Lifecycle.prototype;
228 +
229 + _proto.componentDidMount = function componentDidMount() {
230 + if (this.props.onMount) this.props.onMount.call(this, this);
231 + };
232 +
233 + _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
234 + if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
235 + };
236 +
237 + _proto.componentWillUnmount = function componentWillUnmount() {
238 + if (this.props.onUnmount) this.props.onUnmount.call(this, this);
239 + };
240 +
241 + _proto.render = function render() {
242 + return null;
243 + };
244 +
245 + return Lifecycle;
246 +}(React.Component);
247 +
248 +/**
249 + * The public API for prompting the user before navigating away from a screen.
250 + */
251 +
252 +function Prompt(_ref) {
253 + var message = _ref.message,
254 + _ref$when = _ref.when,
255 + when = _ref$when === void 0 ? true : _ref$when;
256 + return React.createElement(context.Consumer, null, function (context) {
257 + !context ? invariant(false, "You should not use <Prompt> outside a <Router>") : void 0;
258 + if (!when || context.staticContext) return null;
259 + var method = context.history.block;
260 + return React.createElement(Lifecycle, {
261 + onMount: function onMount(self) {
262 + self.release = method(message);
263 + },
264 + onUpdate: function onUpdate(self, prevProps) {
265 + if (prevProps.message !== message) {
266 + self.release();
267 + self.release = method(message);
268 + }
269 + },
270 + onUnmount: function onUnmount(self) {
271 + self.release();
272 + },
273 + message: message
274 + });
275 + });
276 +}
277 +
278 +{
279 + var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
280 + Prompt.propTypes = {
281 + when: PropTypes.bool,
282 + message: messageType.isRequired
283 + };
284 +}
285 +
286 +var cache = {};
287 +var cacheLimit = 10000;
288 +var cacheCount = 0;
289 +
290 +function compilePath(path) {
291 + if (cache[path]) return cache[path];
292 + var generator = pathToRegexp.compile(path);
293 +
294 + if (cacheCount < cacheLimit) {
295 + cache[path] = generator;
296 + cacheCount++;
297 + }
298 +
299 + return generator;
300 +}
301 +/**
302 + * Public API for generating a URL pathname from a path and parameters.
303 + */
304 +
305 +
306 +function generatePath(path, params) {
307 + if (path === void 0) {
308 + path = "/";
309 + }
310 +
311 + if (params === void 0) {
312 + params = {};
313 + }
314 +
315 + return path === "/" ? path : compilePath(path)(params, {
316 + pretty: true
317 + });
318 +}
319 +
320 +/**
321 + * The public API for navigating programmatically with a component.
322 + */
323 +
324 +function Redirect(_ref) {
325 + var computedMatch = _ref.computedMatch,
326 + to = _ref.to,
327 + _ref$push = _ref.push,
328 + push = _ref$push === void 0 ? false : _ref$push;
329 + return React.createElement(context.Consumer, null, function (context) {
330 + !context ? invariant(false, "You should not use <Redirect> outside a <Router>") : void 0;
331 + var history$1 = context.history,
332 + staticContext = context.staticContext;
333 + var method = push ? history$1.push : history$1.replace;
334 + var location = history.createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, {
335 + pathname: generatePath(to.pathname, computedMatch.params)
336 + }) : to); // When rendering in a static context,
337 + // set the new location immediately.
338 +
339 + if (staticContext) {
340 + method(location);
341 + return null;
342 + }
343 +
344 + return React.createElement(Lifecycle, {
345 + onMount: function onMount() {
346 + method(location);
347 + },
348 + onUpdate: function onUpdate(self, prevProps) {
349 + var prevLocation = history.createLocation(prevProps.to);
350 +
351 + if (!history.locationsAreEqual(prevLocation, _extends({}, location, {
352 + key: prevLocation.key
353 + }))) {
354 + method(location);
355 + }
356 + },
357 + to: to
358 + });
359 + });
360 +}
361 +
362 +{
363 + Redirect.propTypes = {
364 + push: PropTypes.bool,
365 + from: PropTypes.string,
366 + to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
367 + };
368 +}
369 +
370 +var cache$1 = {};
371 +var cacheLimit$1 = 10000;
372 +var cacheCount$1 = 0;
373 +
374 +function compilePath$1(path, options) {
375 + var cacheKey = "" + options.end + options.strict + options.sensitive;
376 + var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
377 + if (pathCache[path]) return pathCache[path];
378 + var keys = [];
379 + var regexp = pathToRegexp(path, keys, options);
380 + var result = {
381 + regexp: regexp,
382 + keys: keys
383 + };
384 +
385 + if (cacheCount$1 < cacheLimit$1) {
386 + pathCache[path] = result;
387 + cacheCount$1++;
388 + }
389 +
390 + return result;
391 +}
392 +/**
393 + * Public API for matching a URL pathname to a path.
394 + */
395 +
396 +
397 +function matchPath(pathname, options) {
398 + if (options === void 0) {
399 + options = {};
400 + }
401 +
402 + if (typeof options === "string" || Array.isArray(options)) {
403 + options = {
404 + path: options
405 + };
406 + }
407 +
408 + var _options = options,
409 + path = _options.path,
410 + _options$exact = _options.exact,
411 + exact = _options$exact === void 0 ? false : _options$exact,
412 + _options$strict = _options.strict,
413 + strict = _options$strict === void 0 ? false : _options$strict,
414 + _options$sensitive = _options.sensitive,
415 + sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
416 + var paths = [].concat(path);
417 + return paths.reduce(function (matched, path) {
418 + if (!path && path !== "") return null;
419 + if (matched) return matched;
420 +
421 + var _compilePath = compilePath$1(path, {
422 + end: exact,
423 + strict: strict,
424 + sensitive: sensitive
425 + }),
426 + regexp = _compilePath.regexp,
427 + keys = _compilePath.keys;
428 +
429 + var match = regexp.exec(pathname);
430 + if (!match) return null;
431 + var url = match[0],
432 + values = match.slice(1);
433 + var isExact = pathname === url;
434 + if (exact && !isExact) return null;
435 + return {
436 + path: path,
437 + // the path used to match
438 + url: path === "/" && url === "" ? "/" : url,
439 + // the matched portion of the URL
440 + isExact: isExact,
441 + // whether or not we matched exactly
442 + params: keys.reduce(function (memo, key, index) {
443 + memo[key.name] = values[index];
444 + return memo;
445 + }, {})
446 + };
447 + }, null);
448 +}
449 +
450 +function isEmptyChildren(children) {
451 + return React.Children.count(children) === 0;
452 +}
453 +
454 +function evalChildrenDev(children, props, path) {
455 + var value = children(props);
456 + 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`") ;
457 + return value || null;
458 +}
459 +/**
460 + * The public API for matching a single path and rendering.
461 + */
462 +
463 +
464 +var Route =
465 +/*#__PURE__*/
466 +function (_React$Component) {
467 + _inheritsLoose(Route, _React$Component);
468 +
469 + function Route() {
470 + return _React$Component.apply(this, arguments) || this;
471 + }
472 +
473 + var _proto = Route.prototype;
474 +
475 + _proto.render = function render() {
476 + var _this = this;
477 +
478 + return React.createElement(context.Consumer, null, function (context$1) {
479 + !context$1 ? invariant(false, "You should not use <Route> outside a <Router>") : void 0;
480 + var location = _this.props.location || context$1.location;
481 + var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
482 + : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
483 +
484 + var props = _extends({}, context$1, {
485 + location: location,
486 + match: match
487 + });
488 +
489 + var _this$props = _this.props,
490 + children = _this$props.children,
491 + component = _this$props.component,
492 + render = _this$props.render; // Preact uses an empty array as children by
493 + // default, so use null if that's the case.
494 +
495 + if (Array.isArray(children) && children.length === 0) {
496 + children = null;
497 + }
498 +
499 + return React.createElement(context.Provider, {
500 + value: props
501 + }, props.match ? children ? typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : children : component ? React.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : null);
502 + });
503 + };
504 +
505 + return Route;
506 +}(React.Component);
507 +
508 +{
509 + Route.propTypes = {
510 + children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
511 + component: function component(props, propName) {
512 + if (props[propName] && !reactIs.isValidElementType(props[propName])) {
513 + return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component");
514 + }
515 + },
516 + exact: PropTypes.bool,
517 + location: PropTypes.object,
518 + path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
519 + render: PropTypes.func,
520 + sensitive: PropTypes.bool,
521 + strict: PropTypes.bool
522 + };
523 +
524 + Route.prototype.componentDidMount = function () {
525 + 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") ;
526 + 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") ;
527 + 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") ;
528 + };
529 +
530 + Route.prototype.componentDidUpdate = function (prevProps) {
531 + 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.') ;
532 + 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.') ;
533 + };
534 +}
535 +
536 +function addLeadingSlash(path) {
537 + return path.charAt(0) === "/" ? path : "/" + path;
538 +}
539 +
540 +function addBasename(basename, location) {
541 + if (!basename) return location;
542 + return _extends({}, location, {
543 + pathname: addLeadingSlash(basename) + location.pathname
544 + });
545 +}
546 +
547 +function stripBasename(basename, location) {
548 + if (!basename) return location;
549 + var base = addLeadingSlash(basename);
550 + if (location.pathname.indexOf(base) !== 0) return location;
551 + return _extends({}, location, {
552 + pathname: location.pathname.substr(base.length)
553 + });
554 +}
555 +
556 +function createURL(location) {
557 + return typeof location === "string" ? location : history.createPath(location);
558 +}
559 +
560 +function staticHandler(methodName) {
561 + return function () {
562 + invariant(false, "You cannot %s with <StaticRouter>", methodName) ;
563 + };
564 +}
565 +
566 +function noop() {}
567 +/**
568 + * The public top-level API for a "static" <Router>, so-called because it
569 + * can't actually change the current location. Instead, it just records
570 + * location changes in a context object. Useful mainly in testing and
571 + * server-rendering scenarios.
572 + */
573 +
574 +
575 +var StaticRouter =
576 +/*#__PURE__*/
577 +function (_React$Component) {
578 + _inheritsLoose(StaticRouter, _React$Component);
579 +
580 + function StaticRouter() {
581 + var _this;
582 +
583 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
584 + args[_key] = arguments[_key];
585 + }
586 +
587 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
588 +
589 + _this.handlePush = function (location) {
590 + return _this.navigateTo(location, "PUSH");
591 + };
592 +
593 + _this.handleReplace = function (location) {
594 + return _this.navigateTo(location, "REPLACE");
595 + };
596 +
597 + _this.handleListen = function () {
598 + return noop;
599 + };
600 +
601 + _this.handleBlock = function () {
602 + return noop;
603 + };
604 +
605 + return _this;
606 + }
607 +
608 + var _proto = StaticRouter.prototype;
609 +
610 + _proto.navigateTo = function navigateTo(location, action) {
611 + var _this$props = this.props,
612 + _this$props$basename = _this$props.basename,
613 + basename = _this$props$basename === void 0 ? "" : _this$props$basename,
614 + _this$props$context = _this$props.context,
615 + context = _this$props$context === void 0 ? {} : _this$props$context;
616 + context.action = action;
617 + context.location = addBasename(basename, history.createLocation(location));
618 + context.url = createURL(context.location);
619 + };
620 +
621 + _proto.render = function render() {
622 + var _this$props2 = this.props,
623 + _this$props2$basename = _this$props2.basename,
624 + basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
625 + _this$props2$context = _this$props2.context,
626 + context = _this$props2$context === void 0 ? {} : _this$props2$context,
627 + _this$props2$location = _this$props2.location,
628 + location = _this$props2$location === void 0 ? "/" : _this$props2$location,
629 + rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]);
630 +
631 + var history$1 = {
632 + createHref: function createHref(path) {
633 + return addLeadingSlash(basename + createURL(path));
634 + },
635 + action: "POP",
636 + location: stripBasename(basename, history.createLocation(location)),
637 + push: this.handlePush,
638 + replace: this.handleReplace,
639 + go: staticHandler("go"),
640 + goBack: staticHandler("goBack"),
641 + goForward: staticHandler("goForward"),
642 + listen: this.handleListen,
643 + block: this.handleBlock
644 + };
645 + return React.createElement(Router, _extends({}, rest, {
646 + history: history$1,
647 + staticContext: context
648 + }));
649 + };
650 +
651 + return StaticRouter;
652 +}(React.Component);
653 +
654 +{
655 + StaticRouter.propTypes = {
656 + basename: PropTypes.string,
657 + context: PropTypes.object,
658 + location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
659 + };
660 +
661 + StaticRouter.prototype.componentDidMount = function () {
662 + warning(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.") ;
663 + };
664 +}
665 +
666 +/**
667 + * The public API for rendering the first <Route> that matches.
668 + */
669 +
670 +var Switch =
671 +/*#__PURE__*/
672 +function (_React$Component) {
673 + _inheritsLoose(Switch, _React$Component);
674 +
675 + function Switch() {
676 + return _React$Component.apply(this, arguments) || this;
677 + }
678 +
679 + var _proto = Switch.prototype;
680 +
681 + _proto.render = function render() {
682 + var _this = this;
683 +
684 + return React.createElement(context.Consumer, null, function (context) {
685 + !context ? invariant(false, "You should not use <Switch> outside a <Router>") : void 0;
686 + var location = _this.props.location || context.location;
687 + var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
688 + // here because toArray adds keys to all child elements and we do not want
689 + // to trigger an unmount/remount for two <Route>s that render the same
690 + // component at different URLs.
691 +
692 + React.Children.forEach(_this.props.children, function (child) {
693 + if (match == null && React.isValidElement(child)) {
694 + element = child;
695 + var path = child.props.path || child.props.from;
696 + match = path ? matchPath(location.pathname, _extends({}, child.props, {
697 + path: path
698 + })) : context.match;
699 + }
700 + });
701 + return match ? React.cloneElement(element, {
702 + location: location,
703 + computedMatch: match
704 + }) : null;
705 + });
706 + };
707 +
708 + return Switch;
709 +}(React.Component);
710 +
711 +{
712 + Switch.propTypes = {
713 + children: PropTypes.node,
714 + location: PropTypes.object
715 + };
716 +
717 + Switch.prototype.componentDidUpdate = function (prevProps) {
718 + 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.') ;
719 + 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.') ;
720 + };
721 +}
722 +
723 +/**
724 + * A public higher-order component to access the imperative API
725 + */
726 +
727 +function withRouter(Component) {
728 + var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
729 +
730 + var C = function C(props) {
731 + var wrappedComponentRef = props.wrappedComponentRef,
732 + remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]);
733 +
734 + return React.createElement(context.Consumer, null, function (context) {
735 + !context ? invariant(false, "You should not use <" + displayName + " /> outside a <Router>") : void 0;
736 + return React.createElement(Component, _extends({}, remainingProps, context, {
737 + ref: wrappedComponentRef
738 + }));
739 + });
740 + };
741 +
742 + C.displayName = displayName;
743 + C.WrappedComponent = Component;
744 +
745 + {
746 + C.propTypes = {
747 + wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object])
748 + };
749 + }
750 +
751 + return hoistStatics(C, Component);
752 +}
753 +
754 +var useContext = React.useContext;
755 +function useHistory() {
756 + {
757 + !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useHistory()") : void 0;
758 + }
759 +
760 + return useContext(historyContext);
761 +}
762 +function useLocation() {
763 + {
764 + !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useLocation()") : void 0;
765 + }
766 +
767 + return useContext(context).location;
768 +}
769 +function useParams() {
770 + {
771 + !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useParams()") : void 0;
772 + }
773 +
774 + var match = useContext(context).match;
775 + return match ? match.params : {};
776 +}
777 +function useRouteMatch(path) {
778 + {
779 + !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useRouteMatch()") : void 0;
780 + }
781 +
782 + var location = useLocation();
783 + var match = useContext(context).match;
784 + return path ? matchPath(location.pathname, path) : match;
785 +}
786 +
787 +{
788 + if (typeof window !== "undefined") {
789 + var global = window;
790 + var key = "__react_router_build__";
791 + var buildNames = {
792 + cjs: "CommonJS",
793 + esm: "ES modules",
794 + umd: "UMD"
795 + };
796 +
797 + if (global[key] && global[key] !== "cjs") {
798 + var initialBuildName = buildNames[global[key]];
799 + var secondaryBuildName = buildNames["cjs"]; // TODO: Add link to article that explains in detail how to avoid
800 + // loading 2 different builds.
801 +
802 + 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.");
803 + }
804 +
805 + global[key] = "cjs";
806 + }
807 +}
808 +
809 +exports.MemoryRouter = MemoryRouter;
810 +exports.Prompt = Prompt;
811 +exports.Redirect = Redirect;
812 +exports.Route = Route;
813 +exports.Router = Router;
814 +exports.StaticRouter = StaticRouter;
815 +exports.Switch = Switch;
816 +exports.__HistoryContext = historyContext;
817 +exports.__RouterContext = context;
818 +exports.generatePath = generatePath;
819 +exports.matchPath = matchPath;
820 +exports.useHistory = useHistory;
821 +exports.useLocation = useLocation;
822 +exports.useParams = useParams;
823 +exports.useRouteMatch = useRouteMatch;
824 +exports.withRouter = withRouter;
825 +//# sourceMappingURL=react-router.js.map
1 +{"version":3,"file":"react-router.js","sources":["../modules/createNameContext.js","../modules/HistoryContext.js","../modules/RouterContext.js","../modules/Router.js","../modules/MemoryRouter.js","../modules/Lifecycle.js","../modules/Prompt.js","../modules/generatePath.js","../modules/Redirect.js","../modules/matchPath.js","../modules/Route.js","../modules/StaticRouter.js","../modules/Switch.js","../modules/withRouter.js","../modules/hooks.js","../modules/index.js"],"sourcesContent":["// TODO: Replace with React.createContext once we can assume React 16+\nimport createContext from \"mini-create-react-context\";\n\nconst createNamedContext = name => {\n const context = createContext();\n context.displayName = name;\n\n return context;\n};\n\nexport default createNamedContext;\n","import createNamedContext from \"./createNameContext\";\n\nconst historyContext = /*#__PURE__*/ createNamedContext(\"Router-History\");\nexport default historyContext;\n","// TODO: Replace with React.createContext once we can assume React 16+\nimport createContext from \"mini-create-react-context\";\n\nconst createNamedContext = name => {\n const context = createContext();\n context.displayName = name;\n\n return context;\n};\n\nconst context = /*#__PURE__*/ createNamedContext(\"Router\");\nexport default context;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\nimport HistoryContext from \"./HistoryContext.js\";\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * The public API for putting history on context.\n */\nclass Router extends React.Component {\n static computeRootMatch(pathname) {\n return { path: \"/\", url: \"/\", params: {}, isExact: pathname === \"/\" };\n }\n\n constructor(props) {\n super(props);\n\n this.state = {\n location: props.history.location\n };\n\n // This is a bit of a hack. We have to start listening for location\n // changes here in the constructor in case there are any <Redirect>s\n // on the initial render. If there are, they will replace/push when\n // they mount and since cDM fires in children before parents, we may\n // get a new location before the <Router> is mounted.\n this._isMounted = false;\n this._pendingLocation = null;\n\n if (!props.staticContext) {\n this.unlisten = props.history.listen(location => {\n if (this._isMounted) {\n this.setState({ location });\n } else {\n this._pendingLocation = location;\n }\n });\n }\n }\n\n componentDidMount() {\n this._isMounted = true;\n\n if (this._pendingLocation) {\n this.setState({ location: this._pendingLocation });\n }\n }\n\n componentWillUnmount() {\n if (this.unlisten) this.unlisten();\n }\n\n render() {\n return (\n <RouterContext.Provider\n value={{\n history: this.props.history,\n location: this.state.location,\n match: Router.computeRootMatch(this.state.location.pathname),\n staticContext: this.props.staticContext\n }}\n >\n <HistoryContext.Provider\n children={this.props.children || null}\n value={this.props.history}\n />\n </RouterContext.Provider>\n );\n }\n}\n\nif (__DEV__) {\n Router.propTypes = {\n children: PropTypes.node,\n history: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n };\n\n Router.prototype.componentDidUpdate = function(prevProps) {\n warning(\n prevProps.history === this.props.history,\n \"You cannot change <Router history>\"\n );\n };\n}\n\nexport default Router;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createMemoryHistory as createHistory } from \"history\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\n/**\n * The public API for a <Router> that stores location in memory.\n */\nclass MemoryRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n MemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n };\n\n MemoryRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<MemoryRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { MemoryRouter as Router }`.\"\n );\n };\n}\n\nexport default MemoryRouter;\n","import React from \"react\";\n\nclass Lifecycle extends React.Component {\n componentDidMount() {\n if (this.props.onMount) this.props.onMount.call(this, this);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);\n }\n\n componentWillUnmount() {\n if (this.props.onUnmount) this.props.onUnmount.call(this, this);\n }\n\n render() {\n return null;\n }\n}\n\nexport default Lifecycle;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\n\nimport Lifecycle from \"./Lifecycle.js\";\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * The public API for prompting the user before navigating away from a screen.\n */\nfunction Prompt({ message, when = true }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Prompt> outside a <Router>\");\n\n if (!when || context.staticContext) return null;\n\n const method = context.history.block;\n\n return (\n <Lifecycle\n onMount={self => {\n self.release = method(message);\n }}\n onUpdate={(self, prevProps) => {\n if (prevProps.message !== message) {\n self.release();\n self.release = method(message);\n }\n }}\n onUnmount={self => {\n self.release();\n }}\n message={message}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n}\n\nif (__DEV__) {\n const messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);\n\n Prompt.propTypes = {\n when: PropTypes.bool,\n message: messageType.isRequired\n };\n}\n\nexport default Prompt;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path) {\n if (cache[path]) return cache[path];\n\n const generator = pathToRegexp.compile(path);\n\n if (cacheCount < cacheLimit) {\n cache[path] = generator;\n cacheCount++;\n }\n\n return generator;\n}\n\n/**\n * Public API for generating a URL pathname from a path and parameters.\n */\nfunction generatePath(path = \"/\", params = {}) {\n return path === \"/\" ? path : compilePath(path)(params, { pretty: true });\n}\n\nexport default generatePath;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, locationsAreEqual } from \"history\";\nimport invariant from \"tiny-invariant\";\n\nimport Lifecycle from \"./Lifecycle.js\";\nimport RouterContext from \"./RouterContext.js\";\nimport generatePath from \"./generatePath.js\";\n\n/**\n * The public API for navigating programmatically with a component.\n */\nfunction Redirect({ computedMatch, to, push = false }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Redirect> outside a <Router>\");\n\n const { history, staticContext } = context;\n\n const method = push ? history.push : history.replace;\n const location = createLocation(\n computedMatch\n ? typeof to === \"string\"\n ? generatePath(to, computedMatch.params)\n : {\n ...to,\n pathname: generatePath(to.pathname, computedMatch.params)\n }\n : to\n );\n\n // When rendering in a static context,\n // set the new location immediately.\n if (staticContext) {\n method(location);\n return null;\n }\n\n return (\n <Lifecycle\n onMount={() => {\n method(location);\n }}\n onUpdate={(self, prevProps) => {\n const prevLocation = createLocation(prevProps.to);\n if (\n !locationsAreEqual(prevLocation, {\n ...location,\n key: prevLocation.key\n })\n ) {\n method(location);\n }\n }}\n to={to}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n}\n\nif (__DEV__) {\n Redirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n };\n}\n\nexport default Redirect;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path, options) {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n const pathCache = cache[cacheKey] || (cache[cacheKey] = {});\n\n if (pathCache[path]) return pathCache[path];\n\n const keys = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache[path] = result;\n cacheCount++;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nfunction matchPath(pathname, options = {}) {\n if (typeof options === \"string\" || Array.isArray(options)) {\n options = { path: options };\n }\n\n const { path, exact = false, strict = false, sensitive = false } = options;\n\n const paths = [].concat(path);\n\n return paths.reduce((matched, path) => {\n if (!path && path !== \"\") return null;\n if (matched) return matched;\n\n const { regexp, keys } = compilePath(path, {\n end: exact,\n strict,\n sensitive\n });\n const match = regexp.exec(pathname);\n\n if (!match) return null;\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path, // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}\n\nexport default matchPath;\n","import React from \"react\";\nimport { isValidElementType } from \"react-is\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nfunction isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n}\n\nfunction evalChildrenDev(children, props, path) {\n const value = children(props);\n\n warning(\n value !== undefined,\n \"You returned `undefined` from the `children` function of \" +\n `<Route${path ? ` path=\"${path}\"` : \"\"}>, but you ` +\n \"should have returned a React element or `null`\"\n );\n\n return value || null;\n}\n\n/**\n * The public API for matching a single path and rendering.\n */\nclass Route extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Route> outside a <Router>\");\n\n const location = this.props.location || context.location;\n const match = this.props.computedMatch\n ? this.props.computedMatch // <Switch> already computed the match for us\n : this.props.path\n ? matchPath(location.pathname, this.props)\n : context.match;\n\n const props = { ...context, location, match };\n\n let { children, component, render } = this.props;\n\n // Preact uses an empty array as children by\n // default, so use null if that's the case.\n if (Array.isArray(children) && children.length === 0) {\n children = null;\n }\n\n return (\n <RouterContext.Provider value={props}>\n {props.match\n ? children\n ? typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : children\n : component\n ? React.createElement(component, props)\n : render\n ? render(props)\n : null\n : typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : null}\n </RouterContext.Provider>\n );\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Route.propTypes = {\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: (props, propName) => {\n if (props[propName] && !isValidElementType(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to 'Route': the prop is not a valid React component`\n );\n }\n },\n exact: PropTypes.bool,\n location: PropTypes.object,\n path: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string)\n ]),\n render: PropTypes.func,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool\n };\n\n Route.prototype.componentDidMount = function() {\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.component\n ),\n \"You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored\"\n );\n\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.render\n ),\n \"You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored\"\n );\n\n warning(\n !(this.props.component && this.props.render),\n \"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored\"\n );\n };\n\n Route.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<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.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<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.'\n );\n };\n}\n\nexport default Route;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, createPath } from \"history\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === \"/\" ? path : \"/\" + path;\n}\n\nfunction addBasename(basename, location) {\n if (!basename) return location;\n\n return {\n ...location,\n pathname: addLeadingSlash(basename) + location.pathname\n };\n}\n\nfunction stripBasename(basename, location) {\n if (!basename) return location;\n\n const base = addLeadingSlash(basename);\n\n if (location.pathname.indexOf(base) !== 0) return location;\n\n return {\n ...location,\n pathname: location.pathname.substr(base.length)\n };\n}\n\nfunction createURL(location) {\n return typeof location === \"string\" ? location : createPath(location);\n}\n\nfunction staticHandler(methodName) {\n return () => {\n invariant(false, \"You cannot %s with <StaticRouter>\", methodName);\n };\n}\n\nfunction noop() {}\n\n/**\n * The public top-level API for a \"static\" <Router>, so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\nclass StaticRouter extends React.Component {\n navigateTo(location, action) {\n const { basename = \"\", context = {} } = this.props;\n context.action = action;\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }\n\n handlePush = location => this.navigateTo(location, \"PUSH\");\n handleReplace = location => this.navigateTo(location, \"REPLACE\");\n handleListen = () => noop;\n handleBlock = () => noop;\n\n render() {\n const { basename = \"\", context = {}, location = \"/\", ...rest } = this.props;\n\n const history = {\n createHref: path => addLeadingSlash(basename + createURL(path)),\n action: \"POP\",\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler(\"go\"),\n goBack: staticHandler(\"goBack\"),\n goForward: staticHandler(\"goForward\"),\n listen: this.handleListen,\n block: this.handleBlock\n };\n\n return <Router {...rest} history={history} staticContext={context} />;\n }\n}\n\nif (__DEV__) {\n StaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n };\n\n StaticRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<StaticRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { StaticRouter as Router }`.\"\n );\n };\n}\n\nexport default StaticRouter;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\n/**\n * The public API for rendering the first <Route> that matches.\n */\nclass Switch extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Switch> outside a <Router>\");\n\n const location = this.props.location || context.location;\n\n let element, match;\n\n // We use React.Children.forEach instead of React.Children.toArray().find()\n // here because toArray adds keys to all child elements and we do not want\n // to trigger an unmount/remount for two <Route>s that render the same\n // component at different URLs.\n React.Children.forEach(this.props.children, child => {\n if (match == null && React.isValidElement(child)) {\n element = child;\n\n const path = child.props.path || child.props.from;\n\n match = path\n ? matchPath(location.pathname, { ...child.props, path })\n : context.match;\n }\n });\n\n return match\n ? React.cloneElement(element, { location, computedMatch: match })\n : null;\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Switch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n };\n\n Switch.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<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.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<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.'\n );\n };\n}\n\nexport default Switch;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nimport invariant from \"tiny-invariant\";\n\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * A public higher-order component to access the imperative API\n */\nfunction withRouter(Component) {\n const displayName = `withRouter(${Component.displayName || Component.name})`;\n const C = props => {\n const { wrappedComponentRef, ...remainingProps } = props;\n\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(\n context,\n `You should not use <${displayName} /> outside a <Router>`\n );\n return (\n <Component\n {...remainingProps}\n {...context}\n ref={wrappedComponentRef}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n };\n\n C.displayName = displayName;\n C.WrappedComponent = Component;\n\n if (__DEV__) {\n C.propTypes = {\n wrappedComponentRef: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.object\n ])\n };\n }\n\n return hoistStatics(C, Component);\n}\n\nexport default withRouter;\n","import React from \"react\";\nimport invariant from \"tiny-invariant\";\n\nimport Context from \"./RouterContext.js\";\nimport HistoryContext from \"./HistoryContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nconst useContext = React.useContext;\n\nexport function useHistory() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useHistory()\"\n );\n }\n\n return useContext(HistoryContext);\n}\n\nexport function useLocation() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useLocation()\"\n );\n }\n\n return useContext(Context).location;\n}\n\nexport function useParams() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useParams()\"\n );\n }\n\n const match = useContext(Context).match;\n return match ? match.params : {};\n}\n\nexport function useRouteMatch(path) {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useRouteMatch()\"\n );\n }\n\n const location = useLocation();\n const match = useContext(Context).match;\n\n return path ? matchPath(location.pathname, path) : match;\n}\n","if (__DEV__) {\n if (typeof window !== \"undefined\") {\n const global = window;\n const key = \"__react_router_build__\";\n const buildNames = { cjs: \"CommonJS\", esm: \"ES modules\", umd: \"UMD\" };\n\n if (global[key] && global[key] !== process.env.BUILD_FORMAT) {\n const initialBuildName = buildNames[global[key]];\n const secondaryBuildName = buildNames[process.env.BUILD_FORMAT];\n\n // TODO: Add link to article that explains in detail how to avoid\n // loading 2 different builds.\n throw new Error(\n `You are loading the ${secondaryBuildName} build of React Router ` +\n `on a page that is already running the ${initialBuildName} ` +\n `build, so things won't work right.`\n );\n }\n\n global[key] = process.env.BUILD_FORMAT;\n }\n}\n\nexport { default as MemoryRouter } from \"./MemoryRouter.js\";\nexport { default as Prompt } from \"./Prompt.js\";\nexport { default as Redirect } from \"./Redirect.js\";\nexport { default as Route } from \"./Route.js\";\nexport { default as Router } from \"./Router.js\";\nexport { default as StaticRouter } from \"./StaticRouter.js\";\nexport { default as Switch } from \"./Switch.js\";\nexport { default as generatePath } from \"./generatePath.js\";\nexport { default as matchPath } from \"./matchPath.js\";\nexport { default as withRouter } from \"./withRouter.js\";\n\nimport { useHistory, useLocation, useParams, useRouteMatch } from \"./hooks.js\";\nexport { useHistory, useLocation, useParams, useRouteMatch };\n\nexport { default as __HistoryContext } from \"./HistoryContext.js\";\nexport { default as __RouterContext } from \"./RouterContext.js\";\n"],"names":["createNamedContext","name","context","createContext","displayName","historyContext","Router","computeRootMatch","pathname","path","url","params","isExact","props","state","location","history","_isMounted","_pendingLocation","staticContext","unlisten","listen","setState","componentDidMount","componentWillUnmount","render","RouterContext","match","HistoryContext","children","React","Component","propTypes","PropTypes","node","object","isRequired","prototype","componentDidUpdate","prevProps","warning","MemoryRouter","createHistory","initialEntries","array","initialIndex","number","getUserConfirmation","func","keyLength","Lifecycle","onMount","call","onUpdate","onUnmount","Prompt","message","when","invariant","method","block","self","release","messageType","oneOfType","string","bool","cache","cacheLimit","cacheCount","compilePath","generator","pathToRegexp","compile","generatePath","pretty","Redirect","computedMatch","to","push","replace","createLocation","prevLocation","locationsAreEqual","key","from","options","cacheKey","end","strict","sensitive","pathCache","keys","regexp","result","matchPath","Array","isArray","exact","paths","concat","reduce","matched","exec","values","memo","index","isEmptyChildren","Children","count","evalChildrenDev","value","undefined","Route","component","length","createElement","propName","isValidElementType","Error","arrayOf","addLeadingSlash","charAt","addBasename","basename","stripBasename","base","indexOf","substr","createURL","createPath","staticHandler","methodName","noop","StaticRouter","handlePush","navigateTo","handleReplace","handleListen","handleBlock","action","rest","createHref","go","goBack","goForward","Switch","element","forEach","child","isValidElement","cloneElement","withRouter","C","wrappedComponentRef","remainingProps","WrappedComponent","hoistStatics","useContext","useHistory","useLocation","Context","useParams","useRouteMatch","window","global","buildNames","cjs","esm","umd","process","initialBuildName","secondaryBuildName"],"mappings":"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"}
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var React=_interopDefault(require("react"));require("prop-types");var history=require("history");require("tiny-warning");var createContext=_interopDefault(require("mini-create-react-context")),invariant=_interopDefault(require("tiny-invariant")),pathToRegexp=_interopDefault(require("path-to-regexp"));require("react-is");var hoistStatics=_interopDefault(require("hoist-non-react-statics"));function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _objectWithoutPropertiesLoose(t,e){if(null==t)return{};var n,o,r={},a=Object.keys(t);for(o=0;o<a.length;o++)n=a[o],0<=e.indexOf(n)||(r[n]=t[n]);return r}var createNamedContext=function(t){var e=createContext();return e.displayName=t,e},historyContext=createNamedContext("Router-History"),createNamedContext$1=function(t){var e=createContext();return e.displayName=t,e},context=createNamedContext$1("Router"),Router=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={location:t.history.location},e._isMounted=!1,e._pendingLocation=null,t.staticContext||(e.unlisten=t.history.listen(function(t){e._isMounted?e.setState({location:t}):e._pendingLocation=t})),e}_inheritsLoose(t,n),t.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var e=t.prototype;return e.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},e.componentWillUnmount=function(){this.unlisten&&this.unlisten()},e.render=function(){return React.createElement(context.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},React.createElement(historyContext.Provider,{children:this.props.children||null,value:this.props.history}))},t}(React.Component),MemoryRouter=function(r){function t(){for(var t,e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=r.call.apply(r,[this].concat(n))||this).history=history.createMemoryHistory(t.props),t}return _inheritsLoose(t,r),t.prototype.render=function(){return React.createElement(Router,{history:this.history,children:this.props.children})},t}(React.Component),Lifecycle=function(t){function e(){return t.apply(this,arguments)||this}_inheritsLoose(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(t){this.props.onUpdate&&this.props.onUpdate.call(this,this,t)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},e}(React.Component);function Prompt(t){var o=t.message,e=t.when,r=void 0===e||e;return React.createElement(context.Consumer,null,function(t){if(t||invariant(!1),!r||t.staticContext)return null;var n=t.history.block;return React.createElement(Lifecycle,{onMount:function(t){t.release=n(o)},onUpdate:function(t,e){e.message!==o&&(t.release(),t.release=n(o))},onUnmount:function(t){t.release()},message:o})})}var cache={},cacheLimit=1e4,cacheCount=0;function compilePath(t){if(cache[t])return cache[t];var e=pathToRegexp.compile(t);return cacheCount<cacheLimit&&(cache[t]=e,cacheCount++),e}function generatePath(t,e){return void 0===t&&(t="/"),void 0===e&&(e={}),"/"===t?t:compilePath(t)(e,{pretty:!0})}function Redirect(t){var a=t.computedMatch,i=t.to,e=t.push,c=void 0!==e&&e;return React.createElement(context.Consumer,null,function(t){t||invariant(!1);var e=t.history,n=t.staticContext,o=c?e.push:e.replace,r=history.createLocation(a?"string"==typeof i?generatePath(i,a.params):_extends({},i,{pathname:generatePath(i.pathname,a.params)}):i);return n?(o(r),null):React.createElement(Lifecycle,{onMount:function(){o(r)},onUpdate:function(t,e){var n=history.createLocation(e.to);history.locationsAreEqual(n,_extends({},r,{key:n.key}))||o(r)},to:i})})}var cache$1={},cacheLimit$1=1e4,cacheCount$1=0;function compilePath$1(t,e){var n=""+e.end+e.strict+e.sensitive,o=cache$1[n]||(cache$1[n]={});if(o[t])return o[t];var r=[],a={regexp:pathToRegexp(t,r,e),keys:r};return cacheCount$1<cacheLimit$1&&(o[t]=a,cacheCount$1++),a}function matchPath(u,t){void 0===t&&(t={}),"string"!=typeof t&&!Array.isArray(t)||(t={path:t});var e=t,n=e.path,o=e.exact,p=void 0!==o&&o,r=e.strict,h=void 0!==r&&r,a=e.sensitive,l=void 0!==a&&a;return[].concat(n).reduce(function(t,e){if(!e&&""!==e)return null;if(t)return t;var n=compilePath$1(e,{end:p,strict:h,sensitive:l}),o=n.regexp,r=n.keys,a=o.exec(u);if(!a)return null;var i=a[0],c=a.slice(1),s=u===i;return p&&!s?null:{path:e,url:"/"===e&&""===i?"/":i,isExact:s,params:r.reduce(function(t,e,n){return t[e.name]=c[n],t},{})}},null)}var Route=function(t){function e(){return t.apply(this,arguments)||this}return _inheritsLoose(e,t),e.prototype.render=function(){var c=this;return React.createElement(context.Consumer,null,function(t){t||invariant(!1);var e=c.props.location||t.location,n=_extends({},t,{location:e,match:c.props.computedMatch?c.props.computedMatch:c.props.path?matchPath(e.pathname,c.props):t.match}),o=c.props,r=o.children,a=o.component,i=o.render;return Array.isArray(r)&&0===r.length&&(r=null),React.createElement(context.Provider,{value:n},n.match?r?"function"==typeof r?r(n):r:a?React.createElement(a,n):i?i(n):null:"function"==typeof r?r(n):null)})},e}(React.Component);function addLeadingSlash(t){return"/"===t.charAt(0)?t:"/"+t}function addBasename(t,e){return t?_extends({},e,{pathname:addLeadingSlash(t)+e.pathname}):e}function stripBasename(t,e){if(!t)return e;var n=addLeadingSlash(t);return 0!==e.pathname.indexOf(n)?e:_extends({},e,{pathname:e.pathname.substr(n.length)})}function createURL(t){return"string"==typeof t?t:history.createPath(t)}function staticHandler(t){return function(){invariant(!1)}}function noop(){}var StaticRouter=function(r){function t(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=r.call.apply(r,[this].concat(n))||this).handlePush=function(t){return e.navigateTo(t,"PUSH")},e.handleReplace=function(t){return e.navigateTo(t,"REPLACE")},e.handleListen=function(){return noop},e.handleBlock=function(){return noop},e}_inheritsLoose(t,r);var e=t.prototype;return e.navigateTo=function(t,e){var n=this.props,o=n.basename,r=void 0===o?"":o,a=n.context,i=void 0===a?{}:a;i.action=e,i.location=addBasename(r,history.createLocation(t)),i.url=createURL(i.location)},e.render=function(){var t=this.props,e=t.basename,n=void 0===e?"":e,o=t.context,r=void 0===o?{}:o,a=t.location,i=void 0===a?"/":a,c=_objectWithoutPropertiesLoose(t,["basename","context","location"]),s={createHref:function(t){return addLeadingSlash(n+createURL(t))},action:"POP",location:stripBasename(n,history.createLocation(i)),push:this.handlePush,replace:this.handleReplace,go:staticHandler(),goBack:staticHandler(),goForward:staticHandler(),listen:this.handleListen,block:this.handleBlock};return React.createElement(Router,_extends({},c,{history:s,staticContext:r}))},t}(React.Component),Switch=function(t){function e(){return t.apply(this,arguments)||this}return _inheritsLoose(e,t),e.prototype.render=function(){var t=this;return React.createElement(context.Consumer,null,function(n){n||invariant(!1);var o,r,a=t.props.location||n.location;return React.Children.forEach(t.props.children,function(t){if(null==r&&React.isValidElement(t)){var e=(o=t).props.path||t.props.from;r=e?matchPath(a.pathname,_extends({},t.props,{path:e})):n.match}}),r?React.cloneElement(o,{location:a,computedMatch:r}):null})},e}(React.Component);function withRouter(o){function t(t){var e=t.wrappedComponentRef,n=_objectWithoutPropertiesLoose(t,["wrappedComponentRef"]);return React.createElement(context.Consumer,null,function(t){return t||invariant(!1),React.createElement(o,_extends({},n,t,{ref:e}))})}var e="withRouter("+(o.displayName||o.name)+")";return t.displayName=e,t.WrappedComponent=o,hoistStatics(t,o)}var useContext=React.useContext;function useHistory(){return useContext(historyContext)}function useLocation(){return useContext(context).location}function useParams(){var t=useContext(context).match;return t?t.params:{}}function useRouteMatch(t){var e=useLocation(),n=useContext(context).match;return t?matchPath(e.pathname,t):n}exports.MemoryRouter=MemoryRouter,exports.Prompt=Prompt,exports.Redirect=Redirect,exports.Route=Route,exports.Router=Router,exports.StaticRouter=StaticRouter,exports.Switch=Switch,exports.__HistoryContext=historyContext,exports.__RouterContext=context,exports.generatePath=generatePath,exports.matchPath=matchPath,exports.useHistory=useHistory,exports.useLocation=useLocation,exports.useParams=useParams,exports.useRouteMatch=useRouteMatch,exports.withRouter=withRouter;
2 +//# sourceMappingURL=react-router.min.js.map
1 +{"version":3,"file":"react-router.min.js","sources":["../modules/createNameContext.js","../modules/HistoryContext.js","../modules/RouterContext.js","../modules/Router.js","../modules/MemoryRouter.js","../modules/Lifecycle.js","../modules/Prompt.js","../modules/generatePath.js","../modules/Redirect.js","../modules/matchPath.js","../modules/Route.js","../modules/StaticRouter.js","../modules/Switch.js","../modules/withRouter.js","../modules/hooks.js"],"sourcesContent":["// TODO: Replace with React.createContext once we can assume React 16+\nimport createContext from \"mini-create-react-context\";\n\nconst createNamedContext = name => {\n const context = createContext();\n context.displayName = name;\n\n return context;\n};\n\nexport default createNamedContext;\n","import createNamedContext from \"./createNameContext\";\n\nconst historyContext = /*#__PURE__*/ createNamedContext(\"Router-History\");\nexport default historyContext;\n","// TODO: Replace with React.createContext once we can assume React 16+\nimport createContext from \"mini-create-react-context\";\n\nconst createNamedContext = name => {\n const context = createContext();\n context.displayName = name;\n\n return context;\n};\n\nconst context = /*#__PURE__*/ createNamedContext(\"Router\");\nexport default context;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\nimport HistoryContext from \"./HistoryContext.js\";\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * The public API for putting history on context.\n */\nclass Router extends React.Component {\n static computeRootMatch(pathname) {\n return { path: \"/\", url: \"/\", params: {}, isExact: pathname === \"/\" };\n }\n\n constructor(props) {\n super(props);\n\n this.state = {\n location: props.history.location\n };\n\n // This is a bit of a hack. We have to start listening for location\n // changes here in the constructor in case there are any <Redirect>s\n // on the initial render. If there are, they will replace/push when\n // they mount and since cDM fires in children before parents, we may\n // get a new location before the <Router> is mounted.\n this._isMounted = false;\n this._pendingLocation = null;\n\n if (!props.staticContext) {\n this.unlisten = props.history.listen(location => {\n if (this._isMounted) {\n this.setState({ location });\n } else {\n this._pendingLocation = location;\n }\n });\n }\n }\n\n componentDidMount() {\n this._isMounted = true;\n\n if (this._pendingLocation) {\n this.setState({ location: this._pendingLocation });\n }\n }\n\n componentWillUnmount() {\n if (this.unlisten) this.unlisten();\n }\n\n render() {\n return (\n <RouterContext.Provider\n value={{\n history: this.props.history,\n location: this.state.location,\n match: Router.computeRootMatch(this.state.location.pathname),\n staticContext: this.props.staticContext\n }}\n >\n <HistoryContext.Provider\n children={this.props.children || null}\n value={this.props.history}\n />\n </RouterContext.Provider>\n );\n }\n}\n\nif (__DEV__) {\n Router.propTypes = {\n children: PropTypes.node,\n history: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n };\n\n Router.prototype.componentDidUpdate = function(prevProps) {\n warning(\n prevProps.history === this.props.history,\n \"You cannot change <Router history>\"\n );\n };\n}\n\nexport default Router;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createMemoryHistory as createHistory } from \"history\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\n/**\n * The public API for a <Router> that stores location in memory.\n */\nclass MemoryRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n MemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n };\n\n MemoryRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<MemoryRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { MemoryRouter as Router }`.\"\n );\n };\n}\n\nexport default MemoryRouter;\n","import React from \"react\";\n\nclass Lifecycle extends React.Component {\n componentDidMount() {\n if (this.props.onMount) this.props.onMount.call(this, this);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);\n }\n\n componentWillUnmount() {\n if (this.props.onUnmount) this.props.onUnmount.call(this, this);\n }\n\n render() {\n return null;\n }\n}\n\nexport default Lifecycle;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\n\nimport Lifecycle from \"./Lifecycle.js\";\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * The public API for prompting the user before navigating away from a screen.\n */\nfunction Prompt({ message, when = true }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Prompt> outside a <Router>\");\n\n if (!when || context.staticContext) return null;\n\n const method = context.history.block;\n\n return (\n <Lifecycle\n onMount={self => {\n self.release = method(message);\n }}\n onUpdate={(self, prevProps) => {\n if (prevProps.message !== message) {\n self.release();\n self.release = method(message);\n }\n }}\n onUnmount={self => {\n self.release();\n }}\n message={message}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n}\n\nif (__DEV__) {\n const messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);\n\n Prompt.propTypes = {\n when: PropTypes.bool,\n message: messageType.isRequired\n };\n}\n\nexport default Prompt;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path) {\n if (cache[path]) return cache[path];\n\n const generator = pathToRegexp.compile(path);\n\n if (cacheCount < cacheLimit) {\n cache[path] = generator;\n cacheCount++;\n }\n\n return generator;\n}\n\n/**\n * Public API for generating a URL pathname from a path and parameters.\n */\nfunction generatePath(path = \"/\", params = {}) {\n return path === \"/\" ? path : compilePath(path)(params, { pretty: true });\n}\n\nexport default generatePath;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, locationsAreEqual } from \"history\";\nimport invariant from \"tiny-invariant\";\n\nimport Lifecycle from \"./Lifecycle.js\";\nimport RouterContext from \"./RouterContext.js\";\nimport generatePath from \"./generatePath.js\";\n\n/**\n * The public API for navigating programmatically with a component.\n */\nfunction Redirect({ computedMatch, to, push = false }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Redirect> outside a <Router>\");\n\n const { history, staticContext } = context;\n\n const method = push ? history.push : history.replace;\n const location = createLocation(\n computedMatch\n ? typeof to === \"string\"\n ? generatePath(to, computedMatch.params)\n : {\n ...to,\n pathname: generatePath(to.pathname, computedMatch.params)\n }\n : to\n );\n\n // When rendering in a static context,\n // set the new location immediately.\n if (staticContext) {\n method(location);\n return null;\n }\n\n return (\n <Lifecycle\n onMount={() => {\n method(location);\n }}\n onUpdate={(self, prevProps) => {\n const prevLocation = createLocation(prevProps.to);\n if (\n !locationsAreEqual(prevLocation, {\n ...location,\n key: prevLocation.key\n })\n ) {\n method(location);\n }\n }}\n to={to}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n}\n\nif (__DEV__) {\n Redirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n };\n}\n\nexport default Redirect;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path, options) {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n const pathCache = cache[cacheKey] || (cache[cacheKey] = {});\n\n if (pathCache[path]) return pathCache[path];\n\n const keys = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache[path] = result;\n cacheCount++;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nfunction matchPath(pathname, options = {}) {\n if (typeof options === \"string\" || Array.isArray(options)) {\n options = { path: options };\n }\n\n const { path, exact = false, strict = false, sensitive = false } = options;\n\n const paths = [].concat(path);\n\n return paths.reduce((matched, path) => {\n if (!path && path !== \"\") return null;\n if (matched) return matched;\n\n const { regexp, keys } = compilePath(path, {\n end: exact,\n strict,\n sensitive\n });\n const match = regexp.exec(pathname);\n\n if (!match) return null;\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path, // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}\n\nexport default matchPath;\n","import React from \"react\";\nimport { isValidElementType } from \"react-is\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nfunction isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n}\n\nfunction evalChildrenDev(children, props, path) {\n const value = children(props);\n\n warning(\n value !== undefined,\n \"You returned `undefined` from the `children` function of \" +\n `<Route${path ? ` path=\"${path}\"` : \"\"}>, but you ` +\n \"should have returned a React element or `null`\"\n );\n\n return value || null;\n}\n\n/**\n * The public API for matching a single path and rendering.\n */\nclass Route extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Route> outside a <Router>\");\n\n const location = this.props.location || context.location;\n const match = this.props.computedMatch\n ? this.props.computedMatch // <Switch> already computed the match for us\n : this.props.path\n ? matchPath(location.pathname, this.props)\n : context.match;\n\n const props = { ...context, location, match };\n\n let { children, component, render } = this.props;\n\n // Preact uses an empty array as children by\n // default, so use null if that's the case.\n if (Array.isArray(children) && children.length === 0) {\n children = null;\n }\n\n return (\n <RouterContext.Provider value={props}>\n {props.match\n ? children\n ? typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : children\n : component\n ? React.createElement(component, props)\n : render\n ? render(props)\n : null\n : typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : null}\n </RouterContext.Provider>\n );\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Route.propTypes = {\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: (props, propName) => {\n if (props[propName] && !isValidElementType(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to 'Route': the prop is not a valid React component`\n );\n }\n },\n exact: PropTypes.bool,\n location: PropTypes.object,\n path: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string)\n ]),\n render: PropTypes.func,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool\n };\n\n Route.prototype.componentDidMount = function() {\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.component\n ),\n \"You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored\"\n );\n\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.render\n ),\n \"You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored\"\n );\n\n warning(\n !(this.props.component && this.props.render),\n \"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored\"\n );\n };\n\n Route.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<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.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<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.'\n );\n };\n}\n\nexport default Route;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, createPath } from \"history\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === \"/\" ? path : \"/\" + path;\n}\n\nfunction addBasename(basename, location) {\n if (!basename) return location;\n\n return {\n ...location,\n pathname: addLeadingSlash(basename) + location.pathname\n };\n}\n\nfunction stripBasename(basename, location) {\n if (!basename) return location;\n\n const base = addLeadingSlash(basename);\n\n if (location.pathname.indexOf(base) !== 0) return location;\n\n return {\n ...location,\n pathname: location.pathname.substr(base.length)\n };\n}\n\nfunction createURL(location) {\n return typeof location === \"string\" ? location : createPath(location);\n}\n\nfunction staticHandler(methodName) {\n return () => {\n invariant(false, \"You cannot %s with <StaticRouter>\", methodName);\n };\n}\n\nfunction noop() {}\n\n/**\n * The public top-level API for a \"static\" <Router>, so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\nclass StaticRouter extends React.Component {\n navigateTo(location, action) {\n const { basename = \"\", context = {} } = this.props;\n context.action = action;\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }\n\n handlePush = location => this.navigateTo(location, \"PUSH\");\n handleReplace = location => this.navigateTo(location, \"REPLACE\");\n handleListen = () => noop;\n handleBlock = () => noop;\n\n render() {\n const { basename = \"\", context = {}, location = \"/\", ...rest } = this.props;\n\n const history = {\n createHref: path => addLeadingSlash(basename + createURL(path)),\n action: \"POP\",\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler(\"go\"),\n goBack: staticHandler(\"goBack\"),\n goForward: staticHandler(\"goForward\"),\n listen: this.handleListen,\n block: this.handleBlock\n };\n\n return <Router {...rest} history={history} staticContext={context} />;\n }\n}\n\nif (__DEV__) {\n StaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n };\n\n StaticRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<StaticRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { StaticRouter as Router }`.\"\n );\n };\n}\n\nexport default StaticRouter;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\n/**\n * The public API for rendering the first <Route> that matches.\n */\nclass Switch extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Switch> outside a <Router>\");\n\n const location = this.props.location || context.location;\n\n let element, match;\n\n // We use React.Children.forEach instead of React.Children.toArray().find()\n // here because toArray adds keys to all child elements and we do not want\n // to trigger an unmount/remount for two <Route>s that render the same\n // component at different URLs.\n React.Children.forEach(this.props.children, child => {\n if (match == null && React.isValidElement(child)) {\n element = child;\n\n const path = child.props.path || child.props.from;\n\n match = path\n ? matchPath(location.pathname, { ...child.props, path })\n : context.match;\n }\n });\n\n return match\n ? React.cloneElement(element, { location, computedMatch: match })\n : null;\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Switch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n };\n\n Switch.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<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.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<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.'\n );\n };\n}\n\nexport default Switch;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nimport invariant from \"tiny-invariant\";\n\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * A public higher-order component to access the imperative API\n */\nfunction withRouter(Component) {\n const displayName = `withRouter(${Component.displayName || Component.name})`;\n const C = props => {\n const { wrappedComponentRef, ...remainingProps } = props;\n\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(\n context,\n `You should not use <${displayName} /> outside a <Router>`\n );\n return (\n <Component\n {...remainingProps}\n {...context}\n ref={wrappedComponentRef}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n };\n\n C.displayName = displayName;\n C.WrappedComponent = Component;\n\n if (__DEV__) {\n C.propTypes = {\n wrappedComponentRef: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.object\n ])\n };\n }\n\n return hoistStatics(C, Component);\n}\n\nexport default withRouter;\n","import React from \"react\";\nimport invariant from \"tiny-invariant\";\n\nimport Context from \"./RouterContext.js\";\nimport HistoryContext from \"./HistoryContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nconst useContext = React.useContext;\n\nexport function useHistory() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useHistory()\"\n );\n }\n\n return useContext(HistoryContext);\n}\n\nexport function useLocation() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useLocation()\"\n );\n }\n\n return useContext(Context).location;\n}\n\nexport function useParams() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useParams()\"\n );\n }\n\n const match = useContext(Context).match;\n return match ? match.params : {};\n}\n\nexport function useRouteMatch(path) {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useRouteMatch()\"\n );\n }\n\n const location = useLocation();\n const match = useContext(Context).match;\n\n return path ? matchPath(location.pathname, path) : match;\n}\n"],"names":["createNamedContext","name","context","createContext","displayName","historyContext","Router","props","state","location","history","_isMounted","_pendingLocation","staticContext","unlisten","listen","_this","setState","computeRootMatch","pathname","path","url","params","isExact","componentDidMount","this","componentWillUnmount","render","React","RouterContext","Provider","value","match","HistoryContext","children","Component","MemoryRouter","createHistory","Lifecycle","onMount","call","componentDidUpdate","prevProps","onUpdate","onUnmount","Prompt","message","when","Consumer","invariant","method","block","self","release","cache","cacheLimit","cacheCount","compilePath","generator","pathToRegexp","compile","generatePath","pretty","Redirect","computedMatch","to","push","replace","createLocation","prevLocation","locationsAreEqual","key","options","cacheKey","end","strict","sensitive","pathCache","keys","result","regexp","matchPath","Array","isArray","exact","concat","reduce","matched","exec","values","memo","index","Route","component","length","createElement","addLeadingSlash","charAt","addBasename","basename","stripBasename","base","indexOf","substr","createURL","createPath","staticHandler","methodName","noop","StaticRouter","handlePush","navigateTo","handleReplace","handleListen","handleBlock","action","rest","createHref","go","goBack","goForward","Switch","element","Children","forEach","child","isValidElement","from","cloneElement","withRouter","C","wrappedComponentRef","remainingProps","ref","WrappedComponent","hoistStatics","useContext","useHistory","useLocation","Context","useParams","useRouteMatch"],"mappings":"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"}
...\ No newline at end of file ...\ No newline at end of file
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("MemoryRouter");
3 +
4 +import { MemoryRouter } from "../esm/react-router.js";
5 +export default MemoryRouter;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Prompt");
3 +
4 +import { Prompt } from "../esm/react-router.js";
5 +export default Prompt;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Redirect");
3 +
4 +import { Redirect } from "../esm/react-router.js";
5 +export default Redirect;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Route");
3 +
4 +import { Route } from "../esm/react-router.js";
5 +export default Route;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Router");
3 +
4 +import { Router } from "../esm/react-router.js";
5 +export default Router;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("StaticRouter");
3 +
4 +import { StaticRouter } from "../esm/react-router.js";
5 +export default StaticRouter;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("Switch");
3 +
4 +import { Switch } from "../esm/react-router.js";
5 +export default Switch;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("generatePath");
3 +
4 +import { generatePath } from "../esm/react-router.js";
5 +export default generatePath;
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("matchPath");
3 +
4 +import { matchPath } from "../esm/react-router.js";
5 +export default matchPath;
1 +/* eslint-disable prefer-arrow-callback, no-empty */
2 +var printWarning = function() {};
3 +
4 +if (process.env.NODE_ENV !== "production") {
5 + printWarning = function(format, subs) {
6 + var index = 0;
7 + var message =
8 + "Warning: " +
9 + (subs.length > 0
10 + ? format.replace(/%s/g, function() {
11 + return subs[index++];
12 + })
13 + : format);
14 +
15 + if (typeof console !== "undefined") {
16 + console.error(message);
17 + }
18 +
19 + try {
20 + // --- Welcome to debugging React Router ---
21 + // This error was thrown as a convenience so that you can use the
22 + // stack trace to find the callsite that triggered this warning.
23 + throw new Error(message);
24 + } catch (e) {}
25 + };
26 +}
27 +
28 +export default function(member) {
29 + printWarning(
30 + 'Please use `import { %s } from "react-router"` instead of `import %s from "react-router/es/%s"`. ' +
31 + "Support for the latter will be removed in the next major release.",
32 + [member, member]
33 + );
34 +}
1 +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js";
2 +warnAboutDeprecatedESMImport("withRouter");
3 +
4 +import { withRouter } from "../esm/react-router.js";
5 +export default withRouter;
1 +import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
2 +import React from 'react';
3 +import PropTypes from 'prop-types';
4 +import { createMemoryHistory, createLocation, locationsAreEqual, createPath } from 'history';
5 +import warning from 'tiny-warning';
6 +import createContext from 'mini-create-react-context';
7 +import invariant from 'tiny-invariant';
8 +import _extends from '@babel/runtime/helpers/esm/extends';
9 +import pathToRegexp from 'path-to-regexp';
10 +import { isValidElementType } from 'react-is';
11 +import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
12 +import hoistStatics from 'hoist-non-react-statics';
13 +
14 +// TODO: Replace with React.createContext once we can assume React 16+
15 +
16 +var createNamedContext = function createNamedContext(name) {
17 + var context = createContext();
18 + context.displayName = name;
19 + return context;
20 +};
21 +
22 +var historyContext =
23 +/*#__PURE__*/
24 +createNamedContext("Router-History");
25 +
26 +// TODO: Replace with React.createContext once we can assume React 16+
27 +
28 +var createNamedContext$1 = function createNamedContext(name) {
29 + var context = createContext();
30 + context.displayName = name;
31 + return context;
32 +};
33 +
34 +var context =
35 +/*#__PURE__*/
36 +createNamedContext$1("Router");
37 +
38 +/**
39 + * The public API for putting history on context.
40 + */
41 +
42 +var Router =
43 +/*#__PURE__*/
44 +function (_React$Component) {
45 + _inheritsLoose(Router, _React$Component);
46 +
47 + Router.computeRootMatch = function computeRootMatch(pathname) {
48 + return {
49 + path: "/",
50 + url: "/",
51 + params: {},
52 + isExact: pathname === "/"
53 + };
54 + };
55 +
56 + function Router(props) {
57 + var _this;
58 +
59 + _this = _React$Component.call(this, props) || this;
60 + _this.state = {
61 + location: props.history.location
62 + }; // This is a bit of a hack. We have to start listening for location
63 + // changes here in the constructor in case there are any <Redirect>s
64 + // on the initial render. If there are, they will replace/push when
65 + // they mount and since cDM fires in children before parents, we may
66 + // get a new location before the <Router> is mounted.
67 +
68 + _this._isMounted = false;
69 + _this._pendingLocation = null;
70 +
71 + if (!props.staticContext) {
72 + _this.unlisten = props.history.listen(function (location) {
73 + if (_this._isMounted) {
74 + _this.setState({
75 + location: location
76 + });
77 + } else {
78 + _this._pendingLocation = location;
79 + }
80 + });
81 + }
82 +
83 + return _this;
84 + }
85 +
86 + var _proto = Router.prototype;
87 +
88 + _proto.componentDidMount = function componentDidMount() {
89 + this._isMounted = true;
90 +
91 + if (this._pendingLocation) {
92 + this.setState({
93 + location: this._pendingLocation
94 + });
95 + }
96 + };
97 +
98 + _proto.componentWillUnmount = function componentWillUnmount() {
99 + if (this.unlisten) this.unlisten();
100 + };
101 +
102 + _proto.render = function render() {
103 + return React.createElement(context.Provider, {
104 + value: {
105 + history: this.props.history,
106 + location: this.state.location,
107 + match: Router.computeRootMatch(this.state.location.pathname),
108 + staticContext: this.props.staticContext
109 + }
110 + }, React.createElement(historyContext.Provider, {
111 + children: this.props.children || null,
112 + value: this.props.history
113 + }));
114 + };
115 +
116 + return Router;
117 +}(React.Component);
118 +
119 +if (process.env.NODE_ENV !== "production") {
120 + Router.propTypes = {
121 + children: PropTypes.node,
122 + history: PropTypes.object.isRequired,
123 + staticContext: PropTypes.object
124 + };
125 +
126 + Router.prototype.componentDidUpdate = function (prevProps) {
127 + process.env.NODE_ENV !== "production" ? warning(prevProps.history === this.props.history, "You cannot change <Router history>") : void 0;
128 + };
129 +}
130 +
131 +/**
132 + * The public API for a <Router> that stores location in memory.
133 + */
134 +
135 +var MemoryRouter =
136 +/*#__PURE__*/
137 +function (_React$Component) {
138 + _inheritsLoose(MemoryRouter, _React$Component);
139 +
140 + function MemoryRouter() {
141 + var _this;
142 +
143 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
144 + args[_key] = arguments[_key];
145 + }
146 +
147 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
148 + _this.history = createMemoryHistory(_this.props);
149 + return _this;
150 + }
151 +
152 + var _proto = MemoryRouter.prototype;
153 +
154 + _proto.render = function render() {
155 + return React.createElement(Router, {
156 + history: this.history,
157 + children: this.props.children
158 + });
159 + };
160 +
161 + return MemoryRouter;
162 +}(React.Component);
163 +
164 +if (process.env.NODE_ENV !== "production") {
165 + MemoryRouter.propTypes = {
166 + initialEntries: PropTypes.array,
167 + initialIndex: PropTypes.number,
168 + getUserConfirmation: PropTypes.func,
169 + keyLength: PropTypes.number,
170 + children: PropTypes.node
171 + };
172 +
173 + MemoryRouter.prototype.componentDidMount = function () {
174 + 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;
175 + };
176 +}
177 +
178 +var Lifecycle =
179 +/*#__PURE__*/
180 +function (_React$Component) {
181 + _inheritsLoose(Lifecycle, _React$Component);
182 +
183 + function Lifecycle() {
184 + return _React$Component.apply(this, arguments) || this;
185 + }
186 +
187 + var _proto = Lifecycle.prototype;
188 +
189 + _proto.componentDidMount = function componentDidMount() {
190 + if (this.props.onMount) this.props.onMount.call(this, this);
191 + };
192 +
193 + _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
194 + if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
195 + };
196 +
197 + _proto.componentWillUnmount = function componentWillUnmount() {
198 + if (this.props.onUnmount) this.props.onUnmount.call(this, this);
199 + };
200 +
201 + _proto.render = function render() {
202 + return null;
203 + };
204 +
205 + return Lifecycle;
206 +}(React.Component);
207 +
208 +/**
209 + * The public API for prompting the user before navigating away from a screen.
210 + */
211 +
212 +function Prompt(_ref) {
213 + var message = _ref.message,
214 + _ref$when = _ref.when,
215 + when = _ref$when === void 0 ? true : _ref$when;
216 + return React.createElement(context.Consumer, null, function (context) {
217 + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Prompt> outside a <Router>") : invariant(false) : void 0;
218 + if (!when || context.staticContext) return null;
219 + var method = context.history.block;
220 + return React.createElement(Lifecycle, {
221 + onMount: function onMount(self) {
222 + self.release = method(message);
223 + },
224 + onUpdate: function onUpdate(self, prevProps) {
225 + if (prevProps.message !== message) {
226 + self.release();
227 + self.release = method(message);
228 + }
229 + },
230 + onUnmount: function onUnmount(self) {
231 + self.release();
232 + },
233 + message: message
234 + });
235 + });
236 +}
237 +
238 +if (process.env.NODE_ENV !== "production") {
239 + var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
240 + Prompt.propTypes = {
241 + when: PropTypes.bool,
242 + message: messageType.isRequired
243 + };
244 +}
245 +
246 +var cache = {};
247 +var cacheLimit = 10000;
248 +var cacheCount = 0;
249 +
250 +function compilePath(path) {
251 + if (cache[path]) return cache[path];
252 + var generator = pathToRegexp.compile(path);
253 +
254 + if (cacheCount < cacheLimit) {
255 + cache[path] = generator;
256 + cacheCount++;
257 + }
258 +
259 + return generator;
260 +}
261 +/**
262 + * Public API for generating a URL pathname from a path and parameters.
263 + */
264 +
265 +
266 +function generatePath(path, params) {
267 + if (path === void 0) {
268 + path = "/";
269 + }
270 +
271 + if (params === void 0) {
272 + params = {};
273 + }
274 +
275 + return path === "/" ? path : compilePath(path)(params, {
276 + pretty: true
277 + });
278 +}
279 +
280 +/**
281 + * The public API for navigating programmatically with a component.
282 + */
283 +
284 +function Redirect(_ref) {
285 + var computedMatch = _ref.computedMatch,
286 + to = _ref.to,
287 + _ref$push = _ref.push,
288 + push = _ref$push === void 0 ? false : _ref$push;
289 + return React.createElement(context.Consumer, null, function (context) {
290 + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Redirect> outside a <Router>") : invariant(false) : void 0;
291 + var history = context.history,
292 + staticContext = context.staticContext;
293 + var method = push ? history.push : history.replace;
294 + var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, {
295 + pathname: generatePath(to.pathname, computedMatch.params)
296 + }) : to); // When rendering in a static context,
297 + // set the new location immediately.
298 +
299 + if (staticContext) {
300 + method(location);
301 + return null;
302 + }
303 +
304 + return React.createElement(Lifecycle, {
305 + onMount: function onMount() {
306 + method(location);
307 + },
308 + onUpdate: function onUpdate(self, prevProps) {
309 + var prevLocation = createLocation(prevProps.to);
310 +
311 + if (!locationsAreEqual(prevLocation, _extends({}, location, {
312 + key: prevLocation.key
313 + }))) {
314 + method(location);
315 + }
316 + },
317 + to: to
318 + });
319 + });
320 +}
321 +
322 +if (process.env.NODE_ENV !== "production") {
323 + Redirect.propTypes = {
324 + push: PropTypes.bool,
325 + from: PropTypes.string,
326 + to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
327 + };
328 +}
329 +
330 +var cache$1 = {};
331 +var cacheLimit$1 = 10000;
332 +var cacheCount$1 = 0;
333 +
334 +function compilePath$1(path, options) {
335 + var cacheKey = "" + options.end + options.strict + options.sensitive;
336 + var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
337 + if (pathCache[path]) return pathCache[path];
338 + var keys = [];
339 + var regexp = pathToRegexp(path, keys, options);
340 + var result = {
341 + regexp: regexp,
342 + keys: keys
343 + };
344 +
345 + if (cacheCount$1 < cacheLimit$1) {
346 + pathCache[path] = result;
347 + cacheCount$1++;
348 + }
349 +
350 + return result;
351 +}
352 +/**
353 + * Public API for matching a URL pathname to a path.
354 + */
355 +
356 +
357 +function matchPath(pathname, options) {
358 + if (options === void 0) {
359 + options = {};
360 + }
361 +
362 + if (typeof options === "string" || Array.isArray(options)) {
363 + options = {
364 + path: options
365 + };
366 + }
367 +
368 + var _options = options,
369 + path = _options.path,
370 + _options$exact = _options.exact,
371 + exact = _options$exact === void 0 ? false : _options$exact,
372 + _options$strict = _options.strict,
373 + strict = _options$strict === void 0 ? false : _options$strict,
374 + _options$sensitive = _options.sensitive,
375 + sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
376 + var paths = [].concat(path);
377 + return paths.reduce(function (matched, path) {
378 + if (!path && path !== "") return null;
379 + if (matched) return matched;
380 +
381 + var _compilePath = compilePath$1(path, {
382 + end: exact,
383 + strict: strict,
384 + sensitive: sensitive
385 + }),
386 + regexp = _compilePath.regexp,
387 + keys = _compilePath.keys;
388 +
389 + var match = regexp.exec(pathname);
390 + if (!match) return null;
391 + var url = match[0],
392 + values = match.slice(1);
393 + var isExact = pathname === url;
394 + if (exact && !isExact) return null;
395 + return {
396 + path: path,
397 + // the path used to match
398 + url: path === "/" && url === "" ? "/" : url,
399 + // the matched portion of the URL
400 + isExact: isExact,
401 + // whether or not we matched exactly
402 + params: keys.reduce(function (memo, key, index) {
403 + memo[key.name] = values[index];
404 + return memo;
405 + }, {})
406 + };
407 + }, null);
408 +}
409 +
410 +function isEmptyChildren(children) {
411 + return React.Children.count(children) === 0;
412 +}
413 +
414 +function evalChildrenDev(children, props, path) {
415 + var value = children(props);
416 + 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;
417 + return value || null;
418 +}
419 +/**
420 + * The public API for matching a single path and rendering.
421 + */
422 +
423 +
424 +var Route =
425 +/*#__PURE__*/
426 +function (_React$Component) {
427 + _inheritsLoose(Route, _React$Component);
428 +
429 + function Route() {
430 + return _React$Component.apply(this, arguments) || this;
431 + }
432 +
433 + var _proto = Route.prototype;
434 +
435 + _proto.render = function render() {
436 + var _this = this;
437 +
438 + return React.createElement(context.Consumer, null, function (context$1) {
439 + !context$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Route> outside a <Router>") : invariant(false) : void 0;
440 + var location = _this.props.location || context$1.location;
441 + var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
442 + : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
443 +
444 + var props = _extends({}, context$1, {
445 + location: location,
446 + match: match
447 + });
448 +
449 + var _this$props = _this.props,
450 + children = _this$props.children,
451 + component = _this$props.component,
452 + render = _this$props.render; // Preact uses an empty array as children by
453 + // default, so use null if that's the case.
454 +
455 + if (Array.isArray(children) && children.length === 0) {
456 + children = null;
457 + }
458 +
459 + return React.createElement(context.Provider, {
460 + value: props
461 + }, props.match ? children ? typeof children === "function" ? process.env.NODE_ENV !== "production" ? evalChildrenDev(children, props, _this.props.path) : children(props) : children : component ? 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);
462 + });
463 + };
464 +
465 + return Route;
466 +}(React.Component);
467 +
468 +if (process.env.NODE_ENV !== "production") {
469 + Route.propTypes = {
470 + children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
471 + component: function component(props, propName) {
472 + if (props[propName] && !isValidElementType(props[propName])) {
473 + return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component");
474 + }
475 + },
476 + exact: PropTypes.bool,
477 + location: PropTypes.object,
478 + path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
479 + render: PropTypes.func,
480 + sensitive: PropTypes.bool,
481 + strict: PropTypes.bool
482 + };
483 +
484 + Route.prototype.componentDidMount = function () {
485 + 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;
486 + 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;
487 + 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;
488 + };
489 +
490 + Route.prototype.componentDidUpdate = function (prevProps) {
491 + 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;
492 + 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;
493 + };
494 +}
495 +
496 +function addLeadingSlash(path) {
497 + return path.charAt(0) === "/" ? path : "/" + path;
498 +}
499 +
500 +function addBasename(basename, location) {
501 + if (!basename) return location;
502 + return _extends({}, location, {
503 + pathname: addLeadingSlash(basename) + location.pathname
504 + });
505 +}
506 +
507 +function stripBasename(basename, location) {
508 + if (!basename) return location;
509 + var base = addLeadingSlash(basename);
510 + if (location.pathname.indexOf(base) !== 0) return location;
511 + return _extends({}, location, {
512 + pathname: location.pathname.substr(base.length)
513 + });
514 +}
515 +
516 +function createURL(location) {
517 + return typeof location === "string" ? location : createPath(location);
518 +}
519 +
520 +function staticHandler(methodName) {
521 + return function () {
522 + process.env.NODE_ENV !== "production" ? invariant(false, "You cannot %s with <StaticRouter>", methodName) : invariant(false) ;
523 + };
524 +}
525 +
526 +function noop() {}
527 +/**
528 + * The public top-level API for a "static" <Router>, so-called because it
529 + * can't actually change the current location. Instead, it just records
530 + * location changes in a context object. Useful mainly in testing and
531 + * server-rendering scenarios.
532 + */
533 +
534 +
535 +var StaticRouter =
536 +/*#__PURE__*/
537 +function (_React$Component) {
538 + _inheritsLoose(StaticRouter, _React$Component);
539 +
540 + function StaticRouter() {
541 + var _this;
542 +
543 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
544 + args[_key] = arguments[_key];
545 + }
546 +
547 + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
548 +
549 + _this.handlePush = function (location) {
550 + return _this.navigateTo(location, "PUSH");
551 + };
552 +
553 + _this.handleReplace = function (location) {
554 + return _this.navigateTo(location, "REPLACE");
555 + };
556 +
557 + _this.handleListen = function () {
558 + return noop;
559 + };
560 +
561 + _this.handleBlock = function () {
562 + return noop;
563 + };
564 +
565 + return _this;
566 + }
567 +
568 + var _proto = StaticRouter.prototype;
569 +
570 + _proto.navigateTo = function navigateTo(location, action) {
571 + var _this$props = this.props,
572 + _this$props$basename = _this$props.basename,
573 + basename = _this$props$basename === void 0 ? "" : _this$props$basename,
574 + _this$props$context = _this$props.context,
575 + context = _this$props$context === void 0 ? {} : _this$props$context;
576 + context.action = action;
577 + context.location = addBasename(basename, createLocation(location));
578 + context.url = createURL(context.location);
579 + };
580 +
581 + _proto.render = function render() {
582 + var _this$props2 = this.props,
583 + _this$props2$basename = _this$props2.basename,
584 + basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
585 + _this$props2$context = _this$props2.context,
586 + context = _this$props2$context === void 0 ? {} : _this$props2$context,
587 + _this$props2$location = _this$props2.location,
588 + location = _this$props2$location === void 0 ? "/" : _this$props2$location,
589 + rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]);
590 +
591 + var history = {
592 + createHref: function createHref(path) {
593 + return addLeadingSlash(basename + createURL(path));
594 + },
595 + action: "POP",
596 + location: stripBasename(basename, createLocation(location)),
597 + push: this.handlePush,
598 + replace: this.handleReplace,
599 + go: staticHandler("go"),
600 + goBack: staticHandler("goBack"),
601 + goForward: staticHandler("goForward"),
602 + listen: this.handleListen,
603 + block: this.handleBlock
604 + };
605 + return React.createElement(Router, _extends({}, rest, {
606 + history: history,
607 + staticContext: context
608 + }));
609 + };
610 +
611 + return StaticRouter;
612 +}(React.Component);
613 +
614 +if (process.env.NODE_ENV !== "production") {
615 + StaticRouter.propTypes = {
616 + basename: PropTypes.string,
617 + context: PropTypes.object,
618 + location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
619 + };
620 +
621 + StaticRouter.prototype.componentDidMount = function () {
622 + 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;
623 + };
624 +}
625 +
626 +/**
627 + * The public API for rendering the first <Route> that matches.
628 + */
629 +
630 +var Switch =
631 +/*#__PURE__*/
632 +function (_React$Component) {
633 + _inheritsLoose(Switch, _React$Component);
634 +
635 + function Switch() {
636 + return _React$Component.apply(this, arguments) || this;
637 + }
638 +
639 + var _proto = Switch.prototype;
640 +
641 + _proto.render = function render() {
642 + var _this = this;
643 +
644 + return React.createElement(context.Consumer, null, function (context) {
645 + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Switch> outside a <Router>") : invariant(false) : void 0;
646 + var location = _this.props.location || context.location;
647 + var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
648 + // here because toArray adds keys to all child elements and we do not want
649 + // to trigger an unmount/remount for two <Route>s that render the same
650 + // component at different URLs.
651 +
652 + React.Children.forEach(_this.props.children, function (child) {
653 + if (match == null && React.isValidElement(child)) {
654 + element = child;
655 + var path = child.props.path || child.props.from;
656 + match = path ? matchPath(location.pathname, _extends({}, child.props, {
657 + path: path
658 + })) : context.match;
659 + }
660 + });
661 + return match ? React.cloneElement(element, {
662 + location: location,
663 + computedMatch: match
664 + }) : null;
665 + });
666 + };
667 +
668 + return Switch;
669 +}(React.Component);
670 +
671 +if (process.env.NODE_ENV !== "production") {
672 + Switch.propTypes = {
673 + children: PropTypes.node,
674 + location: PropTypes.object
675 + };
676 +
677 + Switch.prototype.componentDidUpdate = function (prevProps) {
678 + 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;
679 + 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;
680 + };
681 +}
682 +
683 +/**
684 + * A public higher-order component to access the imperative API
685 + */
686 +
687 +function withRouter(Component) {
688 + var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
689 +
690 + var C = function C(props) {
691 + var wrappedComponentRef = props.wrappedComponentRef,
692 + remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]);
693 +
694 + return React.createElement(context.Consumer, null, function (context) {
695 + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <" + displayName + " /> outside a <Router>") : invariant(false) : void 0;
696 + return React.createElement(Component, _extends({}, remainingProps, context, {
697 + ref: wrappedComponentRef
698 + }));
699 + });
700 + };
701 +
702 + C.displayName = displayName;
703 + C.WrappedComponent = Component;
704 +
705 + if (process.env.NODE_ENV !== "production") {
706 + C.propTypes = {
707 + wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object])
708 + };
709 + }
710 +
711 + return hoistStatics(C, Component);
712 +}
713 +
714 +var useContext = React.useContext;
715 +function useHistory() {
716 + if (process.env.NODE_ENV !== "production") {
717 + !(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;
718 + }
719 +
720 + return useContext(historyContext);
721 +}
722 +function useLocation() {
723 + if (process.env.NODE_ENV !== "production") {
724 + !(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;
725 + }
726 +
727 + return useContext(context).location;
728 +}
729 +function useParams() {
730 + if (process.env.NODE_ENV !== "production") {
731 + !(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;
732 + }
733 +
734 + var match = useContext(context).match;
735 + return match ? match.params : {};
736 +}
737 +function useRouteMatch(path) {
738 + if (process.env.NODE_ENV !== "production") {
739 + !(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;
740 + }
741 +
742 + var location = useLocation();
743 + var match = useContext(context).match;
744 + return path ? matchPath(location.pathname, path) : match;
745 +}
746 +
747 +if (process.env.NODE_ENV !== "production") {
748 + if (typeof window !== "undefined") {
749 + var global = window;
750 + var key = "__react_router_build__";
751 + var buildNames = {
752 + cjs: "CommonJS",
753 + esm: "ES modules",
754 + umd: "UMD"
755 + };
756 +
757 + if (global[key] && global[key] !== "esm") {
758 + var initialBuildName = buildNames[global[key]];
759 + var secondaryBuildName = buildNames["esm"]; // TODO: Add link to article that explains in detail how to avoid
760 + // loading 2 different builds.
761 +
762 + 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.");
763 + }
764 +
765 + global[key] = "esm";
766 + }
767 +}
768 +
769 +export { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, historyContext as __HistoryContext, context as __RouterContext, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter };
770 +//# sourceMappingURL=react-router.js.map
1 +{"version":3,"file":"react-router.js","sources":["../modules/createNameContext.js","../modules/HistoryContext.js","../modules/RouterContext.js","../modules/Router.js","../modules/MemoryRouter.js","../modules/Lifecycle.js","../modules/Prompt.js","../modules/generatePath.js","../modules/Redirect.js","../modules/matchPath.js","../modules/Route.js","../modules/StaticRouter.js","../modules/Switch.js","../modules/withRouter.js","../modules/hooks.js","../modules/index.js"],"sourcesContent":["// TODO: Replace with React.createContext once we can assume React 16+\nimport createContext from \"mini-create-react-context\";\n\nconst createNamedContext = name => {\n const context = createContext();\n context.displayName = name;\n\n return context;\n};\n\nexport default createNamedContext;\n","import createNamedContext from \"./createNameContext\";\n\nconst historyContext = /*#__PURE__*/ createNamedContext(\"Router-History\");\nexport default historyContext;\n","// TODO: Replace with React.createContext once we can assume React 16+\nimport createContext from \"mini-create-react-context\";\n\nconst createNamedContext = name => {\n const context = createContext();\n context.displayName = name;\n\n return context;\n};\n\nconst context = /*#__PURE__*/ createNamedContext(\"Router\");\nexport default context;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport warning from \"tiny-warning\";\n\nimport HistoryContext from \"./HistoryContext.js\";\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * The public API for putting history on context.\n */\nclass Router extends React.Component {\n static computeRootMatch(pathname) {\n return { path: \"/\", url: \"/\", params: {}, isExact: pathname === \"/\" };\n }\n\n constructor(props) {\n super(props);\n\n this.state = {\n location: props.history.location\n };\n\n // This is a bit of a hack. We have to start listening for location\n // changes here in the constructor in case there are any <Redirect>s\n // on the initial render. If there are, they will replace/push when\n // they mount and since cDM fires in children before parents, we may\n // get a new location before the <Router> is mounted.\n this._isMounted = false;\n this._pendingLocation = null;\n\n if (!props.staticContext) {\n this.unlisten = props.history.listen(location => {\n if (this._isMounted) {\n this.setState({ location });\n } else {\n this._pendingLocation = location;\n }\n });\n }\n }\n\n componentDidMount() {\n this._isMounted = true;\n\n if (this._pendingLocation) {\n this.setState({ location: this._pendingLocation });\n }\n }\n\n componentWillUnmount() {\n if (this.unlisten) this.unlisten();\n }\n\n render() {\n return (\n <RouterContext.Provider\n value={{\n history: this.props.history,\n location: this.state.location,\n match: Router.computeRootMatch(this.state.location.pathname),\n staticContext: this.props.staticContext\n }}\n >\n <HistoryContext.Provider\n children={this.props.children || null}\n value={this.props.history}\n />\n </RouterContext.Provider>\n );\n }\n}\n\nif (__DEV__) {\n Router.propTypes = {\n children: PropTypes.node,\n history: PropTypes.object.isRequired,\n staticContext: PropTypes.object\n };\n\n Router.prototype.componentDidUpdate = function(prevProps) {\n warning(\n prevProps.history === this.props.history,\n \"You cannot change <Router history>\"\n );\n };\n}\n\nexport default Router;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createMemoryHistory as createHistory } from \"history\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\n/**\n * The public API for a <Router> that stores location in memory.\n */\nclass MemoryRouter extends React.Component {\n history = createHistory(this.props);\n\n render() {\n return <Router history={this.history} children={this.props.children} />;\n }\n}\n\nif (__DEV__) {\n MemoryRouter.propTypes = {\n initialEntries: PropTypes.array,\n initialIndex: PropTypes.number,\n getUserConfirmation: PropTypes.func,\n keyLength: PropTypes.number,\n children: PropTypes.node\n };\n\n MemoryRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<MemoryRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { MemoryRouter as Router }`.\"\n );\n };\n}\n\nexport default MemoryRouter;\n","import React from \"react\";\n\nclass Lifecycle extends React.Component {\n componentDidMount() {\n if (this.props.onMount) this.props.onMount.call(this, this);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);\n }\n\n componentWillUnmount() {\n if (this.props.onUnmount) this.props.onUnmount.call(this, this);\n }\n\n render() {\n return null;\n }\n}\n\nexport default Lifecycle;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\n\nimport Lifecycle from \"./Lifecycle.js\";\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * The public API for prompting the user before navigating away from a screen.\n */\nfunction Prompt({ message, when = true }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Prompt> outside a <Router>\");\n\n if (!when || context.staticContext) return null;\n\n const method = context.history.block;\n\n return (\n <Lifecycle\n onMount={self => {\n self.release = method(message);\n }}\n onUpdate={(self, prevProps) => {\n if (prevProps.message !== message) {\n self.release();\n self.release = method(message);\n }\n }}\n onUnmount={self => {\n self.release();\n }}\n message={message}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n}\n\nif (__DEV__) {\n const messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);\n\n Prompt.propTypes = {\n when: PropTypes.bool,\n message: messageType.isRequired\n };\n}\n\nexport default Prompt;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path) {\n if (cache[path]) return cache[path];\n\n const generator = pathToRegexp.compile(path);\n\n if (cacheCount < cacheLimit) {\n cache[path] = generator;\n cacheCount++;\n }\n\n return generator;\n}\n\n/**\n * Public API for generating a URL pathname from a path and parameters.\n */\nfunction generatePath(path = \"/\", params = {}) {\n return path === \"/\" ? path : compilePath(path)(params, { pretty: true });\n}\n\nexport default generatePath;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, locationsAreEqual } from \"history\";\nimport invariant from \"tiny-invariant\";\n\nimport Lifecycle from \"./Lifecycle.js\";\nimport RouterContext from \"./RouterContext.js\";\nimport generatePath from \"./generatePath.js\";\n\n/**\n * The public API for navigating programmatically with a component.\n */\nfunction Redirect({ computedMatch, to, push = false }) {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Redirect> outside a <Router>\");\n\n const { history, staticContext } = context;\n\n const method = push ? history.push : history.replace;\n const location = createLocation(\n computedMatch\n ? typeof to === \"string\"\n ? generatePath(to, computedMatch.params)\n : {\n ...to,\n pathname: generatePath(to.pathname, computedMatch.params)\n }\n : to\n );\n\n // When rendering in a static context,\n // set the new location immediately.\n if (staticContext) {\n method(location);\n return null;\n }\n\n return (\n <Lifecycle\n onMount={() => {\n method(location);\n }}\n onUpdate={(self, prevProps) => {\n const prevLocation = createLocation(prevProps.to);\n if (\n !locationsAreEqual(prevLocation, {\n ...location,\n key: prevLocation.key\n })\n ) {\n method(location);\n }\n }}\n to={to}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n}\n\nif (__DEV__) {\n Redirect.propTypes = {\n push: PropTypes.bool,\n from: PropTypes.string,\n to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n };\n}\n\nexport default Redirect;\n","import pathToRegexp from \"path-to-regexp\";\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path, options) {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n const pathCache = cache[cacheKey] || (cache[cacheKey] = {});\n\n if (pathCache[path]) return pathCache[path];\n\n const keys = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache[path] = result;\n cacheCount++;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nfunction matchPath(pathname, options = {}) {\n if (typeof options === \"string\" || Array.isArray(options)) {\n options = { path: options };\n }\n\n const { path, exact = false, strict = false, sensitive = false } = options;\n\n const paths = [].concat(path);\n\n return paths.reduce((matched, path) => {\n if (!path && path !== \"\") return null;\n if (matched) return matched;\n\n const { regexp, keys } = compilePath(path, {\n end: exact,\n strict,\n sensitive\n });\n const match = regexp.exec(pathname);\n\n if (!match) return null;\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path, // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}\n\nexport default matchPath;\n","import React from \"react\";\nimport { isValidElementType } from \"react-is\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nfunction isEmptyChildren(children) {\n return React.Children.count(children) === 0;\n}\n\nfunction evalChildrenDev(children, props, path) {\n const value = children(props);\n\n warning(\n value !== undefined,\n \"You returned `undefined` from the `children` function of \" +\n `<Route${path ? ` path=\"${path}\"` : \"\"}>, but you ` +\n \"should have returned a React element or `null`\"\n );\n\n return value || null;\n}\n\n/**\n * The public API for matching a single path and rendering.\n */\nclass Route extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Route> outside a <Router>\");\n\n const location = this.props.location || context.location;\n const match = this.props.computedMatch\n ? this.props.computedMatch // <Switch> already computed the match for us\n : this.props.path\n ? matchPath(location.pathname, this.props)\n : context.match;\n\n const props = { ...context, location, match };\n\n let { children, component, render } = this.props;\n\n // Preact uses an empty array as children by\n // default, so use null if that's the case.\n if (Array.isArray(children) && children.length === 0) {\n children = null;\n }\n\n return (\n <RouterContext.Provider value={props}>\n {props.match\n ? children\n ? typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : children\n : component\n ? React.createElement(component, props)\n : render\n ? render(props)\n : null\n : typeof children === \"function\"\n ? __DEV__\n ? evalChildrenDev(children, props, this.props.path)\n : children(props)\n : null}\n </RouterContext.Provider>\n );\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Route.propTypes = {\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: (props, propName) => {\n if (props[propName] && !isValidElementType(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to 'Route': the prop is not a valid React component`\n );\n }\n },\n exact: PropTypes.bool,\n location: PropTypes.object,\n path: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string)\n ]),\n render: PropTypes.func,\n sensitive: PropTypes.bool,\n strict: PropTypes.bool\n };\n\n Route.prototype.componentDidMount = function() {\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.component\n ),\n \"You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored\"\n );\n\n warning(\n !(\n this.props.children &&\n !isEmptyChildren(this.props.children) &&\n this.props.render\n ),\n \"You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored\"\n );\n\n warning(\n !(this.props.component && this.props.render),\n \"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored\"\n );\n };\n\n Route.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<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.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<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.'\n );\n };\n}\n\nexport default Route;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { createLocation, createPath } from \"history\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport Router from \"./Router.js\";\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === \"/\" ? path : \"/\" + path;\n}\n\nfunction addBasename(basename, location) {\n if (!basename) return location;\n\n return {\n ...location,\n pathname: addLeadingSlash(basename) + location.pathname\n };\n}\n\nfunction stripBasename(basename, location) {\n if (!basename) return location;\n\n const base = addLeadingSlash(basename);\n\n if (location.pathname.indexOf(base) !== 0) return location;\n\n return {\n ...location,\n pathname: location.pathname.substr(base.length)\n };\n}\n\nfunction createURL(location) {\n return typeof location === \"string\" ? location : createPath(location);\n}\n\nfunction staticHandler(methodName) {\n return () => {\n invariant(false, \"You cannot %s with <StaticRouter>\", methodName);\n };\n}\n\nfunction noop() {}\n\n/**\n * The public top-level API for a \"static\" <Router>, so-called because it\n * can't actually change the current location. Instead, it just records\n * location changes in a context object. Useful mainly in testing and\n * server-rendering scenarios.\n */\nclass StaticRouter extends React.Component {\n navigateTo(location, action) {\n const { basename = \"\", context = {} } = this.props;\n context.action = action;\n context.location = addBasename(basename, createLocation(location));\n context.url = createURL(context.location);\n }\n\n handlePush = location => this.navigateTo(location, \"PUSH\");\n handleReplace = location => this.navigateTo(location, \"REPLACE\");\n handleListen = () => noop;\n handleBlock = () => noop;\n\n render() {\n const { basename = \"\", context = {}, location = \"/\", ...rest } = this.props;\n\n const history = {\n createHref: path => addLeadingSlash(basename + createURL(path)),\n action: \"POP\",\n location: stripBasename(basename, createLocation(location)),\n push: this.handlePush,\n replace: this.handleReplace,\n go: staticHandler(\"go\"),\n goBack: staticHandler(\"goBack\"),\n goForward: staticHandler(\"goForward\"),\n listen: this.handleListen,\n block: this.handleBlock\n };\n\n return <Router {...rest} history={history} staticContext={context} />;\n }\n}\n\nif (__DEV__) {\n StaticRouter.propTypes = {\n basename: PropTypes.string,\n context: PropTypes.object,\n location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n };\n\n StaticRouter.prototype.componentDidMount = function() {\n warning(\n !this.props.history,\n \"<StaticRouter> ignores the history prop. To use a custom history, \" +\n \"use `import { Router }` instead of `import { StaticRouter as Router }`.\"\n );\n };\n}\n\nexport default StaticRouter;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\n\nimport RouterContext from \"./RouterContext.js\";\nimport matchPath from \"./matchPath.js\";\n\n/**\n * The public API for rendering the first <Route> that matches.\n */\nclass Switch extends React.Component {\n render() {\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(context, \"You should not use <Switch> outside a <Router>\");\n\n const location = this.props.location || context.location;\n\n let element, match;\n\n // We use React.Children.forEach instead of React.Children.toArray().find()\n // here because toArray adds keys to all child elements and we do not want\n // to trigger an unmount/remount for two <Route>s that render the same\n // component at different URLs.\n React.Children.forEach(this.props.children, child => {\n if (match == null && React.isValidElement(child)) {\n element = child;\n\n const path = child.props.path || child.props.from;\n\n match = path\n ? matchPath(location.pathname, { ...child.props, path })\n : context.match;\n }\n });\n\n return match\n ? React.cloneElement(element, { location, computedMatch: match })\n : null;\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nif (__DEV__) {\n Switch.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n };\n\n Switch.prototype.componentDidUpdate = function(prevProps) {\n warning(\n !(this.props.location && !prevProps.location),\n '<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.'\n );\n\n warning(\n !(!this.props.location && prevProps.location),\n '<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.'\n );\n };\n}\n\nexport default Switch;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nimport invariant from \"tiny-invariant\";\n\nimport RouterContext from \"./RouterContext.js\";\n\n/**\n * A public higher-order component to access the imperative API\n */\nfunction withRouter(Component) {\n const displayName = `withRouter(${Component.displayName || Component.name})`;\n const C = props => {\n const { wrappedComponentRef, ...remainingProps } = props;\n\n return (\n <RouterContext.Consumer>\n {context => {\n invariant(\n context,\n `You should not use <${displayName} /> outside a <Router>`\n );\n return (\n <Component\n {...remainingProps}\n {...context}\n ref={wrappedComponentRef}\n />\n );\n }}\n </RouterContext.Consumer>\n );\n };\n\n C.displayName = displayName;\n C.WrappedComponent = Component;\n\n if (__DEV__) {\n C.propTypes = {\n wrappedComponentRef: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.func,\n PropTypes.object\n ])\n };\n }\n\n return hoistStatics(C, Component);\n}\n\nexport default withRouter;\n","import React from \"react\";\nimport invariant from \"tiny-invariant\";\n\nimport Context from \"./RouterContext.js\";\nimport HistoryContext from \"./HistoryContext.js\";\nimport matchPath from \"./matchPath.js\";\n\nconst useContext = React.useContext;\n\nexport function useHistory() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useHistory()\"\n );\n }\n\n return useContext(HistoryContext);\n}\n\nexport function useLocation() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useLocation()\"\n );\n }\n\n return useContext(Context).location;\n}\n\nexport function useParams() {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useParams()\"\n );\n }\n\n const match = useContext(Context).match;\n return match ? match.params : {};\n}\n\nexport function useRouteMatch(path) {\n if (__DEV__) {\n invariant(\n typeof useContext === \"function\",\n \"You must use React >= 16.8 in order to use useRouteMatch()\"\n );\n }\n\n const location = useLocation();\n const match = useContext(Context).match;\n\n return path ? matchPath(location.pathname, path) : match;\n}\n","if (__DEV__) {\n if (typeof window !== \"undefined\") {\n const global = window;\n const key = \"__react_router_build__\";\n const buildNames = { cjs: \"CommonJS\", esm: \"ES modules\", umd: \"UMD\" };\n\n if (global[key] && global[key] !== process.env.BUILD_FORMAT) {\n const initialBuildName = buildNames[global[key]];\n const secondaryBuildName = buildNames[process.env.BUILD_FORMAT];\n\n // TODO: Add link to article that explains in detail how to avoid\n // loading 2 different builds.\n throw new Error(\n `You are loading the ${secondaryBuildName} build of React Router ` +\n `on a page that is already running the ${initialBuildName} ` +\n `build, so things won't work right.`\n );\n }\n\n global[key] = process.env.BUILD_FORMAT;\n }\n}\n\nexport { default as MemoryRouter } from \"./MemoryRouter.js\";\nexport { default as Prompt } from \"./Prompt.js\";\nexport { default as Redirect } from \"./Redirect.js\";\nexport { default as Route } from \"./Route.js\";\nexport { default as Router } from \"./Router.js\";\nexport { default as StaticRouter } from \"./StaticRouter.js\";\nexport { default as Switch } from \"./Switch.js\";\nexport { default as generatePath } from \"./generatePath.js\";\nexport { default as matchPath } from \"./matchPath.js\";\nexport { default as withRouter } from \"./withRouter.js\";\n\nimport { useHistory, useLocation, useParams, useRouteMatch } from \"./hooks.js\";\nexport { useHistory, useLocation, useParams, useRouteMatch };\n\nexport { default as __HistoryContext } from \"./HistoryContext.js\";\nexport { default as __RouterContext } from \"./RouterContext.js\";\n"],"names":["createNamedContext","name","context","createContext","displayName","historyContext","Router","computeRootMatch","pathname","path","url","params","isExact","props","state","location","history","_isMounted","_pendingLocation","staticContext","unlisten","listen","setState","componentDidMount","componentWillUnmount","render","RouterContext","match","HistoryContext","children","React","Component","propTypes","PropTypes","node","object","isRequired","prototype","componentDidUpdate","prevProps","warning","MemoryRouter","createHistory","initialEntries","array","initialIndex","number","getUserConfirmation","func","keyLength","Lifecycle","onMount","call","onUpdate","onUnmount","Prompt","message","when","invariant","method","block","self","release","messageType","oneOfType","string","bool","cache","cacheLimit","cacheCount","compilePath","generator","pathToRegexp","compile","generatePath","pretty","Redirect","computedMatch","to","push","replace","createLocation","prevLocation","locationsAreEqual","key","from","options","cacheKey","end","strict","sensitive","pathCache","keys","regexp","result","matchPath","Array","isArray","exact","paths","concat","reduce","matched","exec","values","memo","index","isEmptyChildren","Children","count","evalChildrenDev","value","undefined","Route","component","length","createElement","propName","isValidElementType","Error","arrayOf","addLeadingSlash","charAt","addBasename","basename","stripBasename","base","indexOf","substr","createURL","createPath","staticHandler","methodName","noop","StaticRouter","handlePush","navigateTo","handleReplace","handleListen","handleBlock","action","rest","createHref","go","goBack","goForward","Switch","element","forEach","child","isValidElement","cloneElement","withRouter","C","wrappedComponentRef","remainingProps","WrappedComponent","hoistStatics","useContext","useHistory","useLocation","Context","useParams","useRouteMatch","window","global","buildNames","cjs","esm","umd","process","initialBuildName","secondaryBuildName"],"mappings":"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"}
...\ No newline at end of file ...\ No newline at end of file
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("generatePath");
3 +module.exports = require("./index.js").generatePath;
1 +"use strict";
2 +
3 +if (process.env.NODE_ENV === "production") {
4 + module.exports = require("./cjs/react-router.min.js");
5 +} else {
6 + module.exports = require("./cjs/react-router.js");
7 +}
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("matchPath");
3 +module.exports = require("./index.js").matchPath;
1 +import createNamedContext from "./createNameContext";
2 +
3 +const historyContext = /*#__PURE__*/ createNamedContext("Router-History");
4 +export default historyContext;
1 +import React from "react";
2 +
3 +class Lifecycle extends React.Component {
4 + componentDidMount() {
5 + if (this.props.onMount) this.props.onMount.call(this, this);
6 + }
7 +
8 + componentDidUpdate(prevProps) {
9 + if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
10 + }
11 +
12 + componentWillUnmount() {
13 + if (this.props.onUnmount) this.props.onUnmount.call(this, this);
14 + }
15 +
16 + render() {
17 + return null;
18 + }
19 +}
20 +
21 +export default Lifecycle;
1 +import React from "react";
2 +import PropTypes from "prop-types";
3 +import { createMemoryHistory as createHistory } from "history";
4 +import warning from "tiny-warning";
5 +
6 +import Router from "./Router.js";
7 +
8 +/**
9 + * The public API for a <Router> that stores location in memory.
10 + */
11 +class MemoryRouter extends React.Component {
12 + history = createHistory(this.props);
13 +
14 + render() {
15 + return <Router history={this.history} children={this.props.children} />;
16 + }
17 +}
18 +
19 +if (__DEV__) {
20 + MemoryRouter.propTypes = {
21 + initialEntries: PropTypes.array,
22 + initialIndex: PropTypes.number,
23 + getUserConfirmation: PropTypes.func,
24 + keyLength: PropTypes.number,
25 + children: PropTypes.node
26 + };
27 +
28 + MemoryRouter.prototype.componentDidMount = function() {
29 + warning(
30 + !this.props.history,
31 + "<MemoryRouter> ignores the history prop. To use a custom history, " +
32 + "use `import { Router }` instead of `import { MemoryRouter as Router }`."
33 + );
34 + };
35 +}
36 +
37 +export default MemoryRouter;
1 +import React from "react";
2 +import PropTypes from "prop-types";
3 +import invariant from "tiny-invariant";
4 +
5 +import Lifecycle from "./Lifecycle.js";
6 +import RouterContext from "./RouterContext.js";
7 +
8 +/**
9 + * The public API for prompting the user before navigating away from a screen.
10 + */
11 +function Prompt({ message, when = true }) {
12 + return (
13 + <RouterContext.Consumer>
14 + {context => {
15 + invariant(context, "You should not use <Prompt> outside a <Router>");
16 +
17 + if (!when || context.staticContext) return null;
18 +
19 + const method = context.history.block;
20 +
21 + return (
22 + <Lifecycle
23 + onMount={self => {
24 + self.release = method(message);
25 + }}
26 + onUpdate={(self, prevProps) => {
27 + if (prevProps.message !== message) {
28 + self.release();
29 + self.release = method(message);
30 + }
31 + }}
32 + onUnmount={self => {
33 + self.release();
34 + }}
35 + message={message}
36 + />
37 + );
38 + }}
39 + </RouterContext.Consumer>
40 + );
41 +}
42 +
43 +if (__DEV__) {
44 + const messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
45 +
46 + Prompt.propTypes = {
47 + when: PropTypes.bool,
48 + message: messageType.isRequired
49 + };
50 +}
51 +
52 +export default Prompt;
1 +import React from "react";
2 +import PropTypes from "prop-types";
3 +import { createLocation, locationsAreEqual } from "history";
4 +import invariant from "tiny-invariant";
5 +
6 +import Lifecycle from "./Lifecycle.js";
7 +import RouterContext from "./RouterContext.js";
8 +import generatePath from "./generatePath.js";
9 +
10 +/**
11 + * The public API for navigating programmatically with a component.
12 + */
13 +function Redirect({ computedMatch, to, push = false }) {
14 + return (
15 + <RouterContext.Consumer>
16 + {context => {
17 + invariant(context, "You should not use <Redirect> outside a <Router>");
18 +
19 + const { history, staticContext } = context;
20 +
21 + const method = push ? history.push : history.replace;
22 + const location = createLocation(
23 + computedMatch
24 + ? typeof to === "string"
25 + ? generatePath(to, computedMatch.params)
26 + : {
27 + ...to,
28 + pathname: generatePath(to.pathname, computedMatch.params)
29 + }
30 + : to
31 + );
32 +
33 + // When rendering in a static context,
34 + // set the new location immediately.
35 + if (staticContext) {
36 + method(location);
37 + return null;
38 + }
39 +
40 + return (
41 + <Lifecycle
42 + onMount={() => {
43 + method(location);
44 + }}
45 + onUpdate={(self, prevProps) => {
46 + const prevLocation = createLocation(prevProps.to);
47 + if (
48 + !locationsAreEqual(prevLocation, {
49 + ...location,
50 + key: prevLocation.key
51 + })
52 + ) {
53 + method(location);
54 + }
55 + }}
56 + to={to}
57 + />
58 + );
59 + }}
60 + </RouterContext.Consumer>
61 + );
62 +}
63 +
64 +if (__DEV__) {
65 + Redirect.propTypes = {
66 + push: PropTypes.bool,
67 + from: PropTypes.string,
68 + to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
69 + };
70 +}
71 +
72 +export default Redirect;
1 +import React from "react";
2 +import { isValidElementType } from "react-is";
3 +import PropTypes from "prop-types";
4 +import invariant from "tiny-invariant";
5 +import warning from "tiny-warning";
6 +
7 +import RouterContext from "./RouterContext.js";
8 +import matchPath from "./matchPath.js";
9 +
10 +function isEmptyChildren(children) {
11 + return React.Children.count(children) === 0;
12 +}
13 +
14 +function evalChildrenDev(children, props, path) {
15 + const value = children(props);
16 +
17 + warning(
18 + value !== undefined,
19 + "You returned `undefined` from the `children` function of " +
20 + `<Route${path ? ` path="${path}"` : ""}>, but you ` +
21 + "should have returned a React element or `null`"
22 + );
23 +
24 + return value || null;
25 +}
26 +
27 +/**
28 + * The public API for matching a single path and rendering.
29 + */
30 +class Route extends React.Component {
31 + render() {
32 + return (
33 + <RouterContext.Consumer>
34 + {context => {
35 + invariant(context, "You should not use <Route> outside a <Router>");
36 +
37 + const location = this.props.location || context.location;
38 + const match = this.props.computedMatch
39 + ? this.props.computedMatch // <Switch> already computed the match for us
40 + : this.props.path
41 + ? matchPath(location.pathname, this.props)
42 + : context.match;
43 +
44 + const props = { ...context, location, match };
45 +
46 + let { children, component, render } = this.props;
47 +
48 + // Preact uses an empty array as children by
49 + // default, so use null if that's the case.
50 + if (Array.isArray(children) && children.length === 0) {
51 + children = null;
52 + }
53 +
54 + return (
55 + <RouterContext.Provider value={props}>
56 + {props.match
57 + ? children
58 + ? typeof children === "function"
59 + ? __DEV__
60 + ? evalChildrenDev(children, props, this.props.path)
61 + : children(props)
62 + : children
63 + : component
64 + ? React.createElement(component, props)
65 + : render
66 + ? render(props)
67 + : null
68 + : typeof children === "function"
69 + ? __DEV__
70 + ? evalChildrenDev(children, props, this.props.path)
71 + : children(props)
72 + : null}
73 + </RouterContext.Provider>
74 + );
75 + }}
76 + </RouterContext.Consumer>
77 + );
78 + }
79 +}
80 +
81 +if (__DEV__) {
82 + Route.propTypes = {
83 + children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
84 + component: (props, propName) => {
85 + if (props[propName] && !isValidElementType(props[propName])) {
86 + return new Error(
87 + `Invalid prop 'component' supplied to 'Route': the prop is not a valid React component`
88 + );
89 + }
90 + },
91 + exact: PropTypes.bool,
92 + location: PropTypes.object,
93 + path: PropTypes.oneOfType([
94 + PropTypes.string,
95 + PropTypes.arrayOf(PropTypes.string)
96 + ]),
97 + render: PropTypes.func,
98 + sensitive: PropTypes.bool,
99 + strict: PropTypes.bool
100 + };
101 +
102 + Route.prototype.componentDidMount = function() {
103 + warning(
104 + !(
105 + this.props.children &&
106 + !isEmptyChildren(this.props.children) &&
107 + this.props.component
108 + ),
109 + "You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored"
110 + );
111 +
112 + warning(
113 + !(
114 + this.props.children &&
115 + !isEmptyChildren(this.props.children) &&
116 + this.props.render
117 + ),
118 + "You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored"
119 + );
120 +
121 + warning(
122 + !(this.props.component && this.props.render),
123 + "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored"
124 + );
125 + };
126 +
127 + Route.prototype.componentDidUpdate = function(prevProps) {
128 + warning(
129 + !(this.props.location && !prevProps.location),
130 + '<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.'
131 + );
132 +
133 + warning(
134 + !(!this.props.location && prevProps.location),
135 + '<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.'
136 + );
137 + };
138 +}
139 +
140 +export default Route;
1 +import React from "react";
2 +import PropTypes from "prop-types";
3 +import warning from "tiny-warning";
4 +
5 +import HistoryContext from "./HistoryContext.js";
6 +import RouterContext from "./RouterContext.js";
7 +
8 +/**
9 + * The public API for putting history on context.
10 + */
11 +class Router extends React.Component {
12 + static computeRootMatch(pathname) {
13 + return { path: "/", url: "/", params: {}, isExact: pathname === "/" };
14 + }
15 +
16 + constructor(props) {
17 + super(props);
18 +
19 + this.state = {
20 + location: props.history.location
21 + };
22 +
23 + // This is a bit of a hack. We have to start listening for location
24 + // changes here in the constructor in case there are any <Redirect>s
25 + // on the initial render. If there are, they will replace/push when
26 + // they mount and since cDM fires in children before parents, we may
27 + // get a new location before the <Router> is mounted.
28 + this._isMounted = false;
29 + this._pendingLocation = null;
30 +
31 + if (!props.staticContext) {
32 + this.unlisten = props.history.listen(location => {
33 + if (this._isMounted) {
34 + this.setState({ location });
35 + } else {
36 + this._pendingLocation = location;
37 + }
38 + });
39 + }
40 + }
41 +
42 + componentDidMount() {
43 + this._isMounted = true;
44 +
45 + if (this._pendingLocation) {
46 + this.setState({ location: this._pendingLocation });
47 + }
48 + }
49 +
50 + componentWillUnmount() {
51 + if (this.unlisten) this.unlisten();
52 + }
53 +
54 + render() {
55 + return (
56 + <RouterContext.Provider
57 + value={{
58 + history: this.props.history,
59 + location: this.state.location,
60 + match: Router.computeRootMatch(this.state.location.pathname),
61 + staticContext: this.props.staticContext
62 + }}
63 + >
64 + <HistoryContext.Provider
65 + children={this.props.children || null}
66 + value={this.props.history}
67 + />
68 + </RouterContext.Provider>
69 + );
70 + }
71 +}
72 +
73 +if (__DEV__) {
74 + Router.propTypes = {
75 + children: PropTypes.node,
76 + history: PropTypes.object.isRequired,
77 + staticContext: PropTypes.object
78 + };
79 +
80 + Router.prototype.componentDidUpdate = function(prevProps) {
81 + warning(
82 + prevProps.history === this.props.history,
83 + "You cannot change <Router history>"
84 + );
85 + };
86 +}
87 +
88 +export default Router;
1 +// TODO: Replace with React.createContext once we can assume React 16+
2 +import createContext from "mini-create-react-context";
3 +
4 +const createNamedContext = name => {
5 + const context = createContext();
6 + context.displayName = name;
7 +
8 + return context;
9 +};
10 +
11 +const context = /*#__PURE__*/ createNamedContext("Router");
12 +export default context;
1 +import React from "react";
2 +import PropTypes from "prop-types";
3 +import { createLocation, createPath } from "history";
4 +import invariant from "tiny-invariant";
5 +import warning from "tiny-warning";
6 +
7 +import Router from "./Router.js";
8 +
9 +function addLeadingSlash(path) {
10 + return path.charAt(0) === "/" ? path : "/" + path;
11 +}
12 +
13 +function addBasename(basename, location) {
14 + if (!basename) return location;
15 +
16 + return {
17 + ...location,
18 + pathname: addLeadingSlash(basename) + location.pathname
19 + };
20 +}
21 +
22 +function stripBasename(basename, location) {
23 + if (!basename) return location;
24 +
25 + const base = addLeadingSlash(basename);
26 +
27 + if (location.pathname.indexOf(base) !== 0) return location;
28 +
29 + return {
30 + ...location,
31 + pathname: location.pathname.substr(base.length)
32 + };
33 +}
34 +
35 +function createURL(location) {
36 + return typeof location === "string" ? location : createPath(location);
37 +}
38 +
39 +function staticHandler(methodName) {
40 + return () => {
41 + invariant(false, "You cannot %s with <StaticRouter>", methodName);
42 + };
43 +}
44 +
45 +function noop() {}
46 +
47 +/**
48 + * The public top-level API for a "static" <Router>, so-called because it
49 + * can't actually change the current location. Instead, it just records
50 + * location changes in a context object. Useful mainly in testing and
51 + * server-rendering scenarios.
52 + */
53 +class StaticRouter extends React.Component {
54 + navigateTo(location, action) {
55 + const { basename = "", context = {} } = this.props;
56 + context.action = action;
57 + context.location = addBasename(basename, createLocation(location));
58 + context.url = createURL(context.location);
59 + }
60 +
61 + handlePush = location => this.navigateTo(location, "PUSH");
62 + handleReplace = location => this.navigateTo(location, "REPLACE");
63 + handleListen = () => noop;
64 + handleBlock = () => noop;
65 +
66 + render() {
67 + const { basename = "", context = {}, location = "/", ...rest } = this.props;
68 +
69 + const history = {
70 + createHref: path => addLeadingSlash(basename + createURL(path)),
71 + action: "POP",
72 + location: stripBasename(basename, createLocation(location)),
73 + push: this.handlePush,
74 + replace: this.handleReplace,
75 + go: staticHandler("go"),
76 + goBack: staticHandler("goBack"),
77 + goForward: staticHandler("goForward"),
78 + listen: this.handleListen,
79 + block: this.handleBlock
80 + };
81 +
82 + return <Router {...rest} history={history} staticContext={context} />;
83 + }
84 +}
85 +
86 +if (__DEV__) {
87 + StaticRouter.propTypes = {
88 + basename: PropTypes.string,
89 + context: PropTypes.object,
90 + location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
91 + };
92 +
93 + StaticRouter.prototype.componentDidMount = function() {
94 + warning(
95 + !this.props.history,
96 + "<StaticRouter> ignores the history prop. To use a custom history, " +
97 + "use `import { Router }` instead of `import { StaticRouter as Router }`."
98 + );
99 + };
100 +}
101 +
102 +export default StaticRouter;
1 +import React from "react";
2 +import PropTypes from "prop-types";
3 +import invariant from "tiny-invariant";
4 +import warning from "tiny-warning";
5 +
6 +import RouterContext from "./RouterContext.js";
7 +import matchPath from "./matchPath.js";
8 +
9 +/**
10 + * The public API for rendering the first <Route> that matches.
11 + */
12 +class Switch extends React.Component {
13 + render() {
14 + return (
15 + <RouterContext.Consumer>
16 + {context => {
17 + invariant(context, "You should not use <Switch> outside a <Router>");
18 +
19 + const location = this.props.location || context.location;
20 +
21 + let element, match;
22 +
23 + // We use React.Children.forEach instead of React.Children.toArray().find()
24 + // here because toArray adds keys to all child elements and we do not want
25 + // to trigger an unmount/remount for two <Route>s that render the same
26 + // component at different URLs.
27 + React.Children.forEach(this.props.children, child => {
28 + if (match == null && React.isValidElement(child)) {
29 + element = child;
30 +
31 + const path = child.props.path || child.props.from;
32 +
33 + match = path
34 + ? matchPath(location.pathname, { ...child.props, path })
35 + : context.match;
36 + }
37 + });
38 +
39 + return match
40 + ? React.cloneElement(element, { location, computedMatch: match })
41 + : null;
42 + }}
43 + </RouterContext.Consumer>
44 + );
45 + }
46 +}
47 +
48 +if (__DEV__) {
49 + Switch.propTypes = {
50 + children: PropTypes.node,
51 + location: PropTypes.object
52 + };
53 +
54 + Switch.prototype.componentDidUpdate = function(prevProps) {
55 + warning(
56 + !(this.props.location && !prevProps.location),
57 + '<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.'
58 + );
59 +
60 + warning(
61 + !(!this.props.location && prevProps.location),
62 + '<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.'
63 + );
64 + };
65 +}
66 +
67 +export default Switch;
1 +// TODO: Replace with React.createContext once we can assume React 16+
2 +import createContext from "mini-create-react-context";
3 +
4 +const createNamedContext = name => {
5 + const context = createContext();
6 + context.displayName = name;
7 +
8 + return context;
9 +};
10 +
11 +export default createNamedContext;
1 +import pathToRegexp from "path-to-regexp";
2 +
3 +const cache = {};
4 +const cacheLimit = 10000;
5 +let cacheCount = 0;
6 +
7 +function compilePath(path) {
8 + if (cache[path]) return cache[path];
9 +
10 + const generator = pathToRegexp.compile(path);
11 +
12 + if (cacheCount < cacheLimit) {
13 + cache[path] = generator;
14 + cacheCount++;
15 + }
16 +
17 + return generator;
18 +}
19 +
20 +/**
21 + * Public API for generating a URL pathname from a path and parameters.
22 + */
23 +function generatePath(path = "/", params = {}) {
24 + return path === "/" ? path : compilePath(path)(params, { pretty: true });
25 +}
26 +
27 +export default generatePath;
1 +import React from "react";
2 +import invariant from "tiny-invariant";
3 +
4 +import Context from "./RouterContext.js";
5 +import HistoryContext from "./HistoryContext.js";
6 +import matchPath from "./matchPath.js";
7 +
8 +const useContext = React.useContext;
9 +
10 +export function useHistory() {
11 + if (__DEV__) {
12 + invariant(
13 + typeof useContext === "function",
14 + "You must use React >= 16.8 in order to use useHistory()"
15 + );
16 + }
17 +
18 + return useContext(HistoryContext);
19 +}
20 +
21 +export function useLocation() {
22 + if (__DEV__) {
23 + invariant(
24 + typeof useContext === "function",
25 + "You must use React >= 16.8 in order to use useLocation()"
26 + );
27 + }
28 +
29 + return useContext(Context).location;
30 +}
31 +
32 +export function useParams() {
33 + if (__DEV__) {
34 + invariant(
35 + typeof useContext === "function",
36 + "You must use React >= 16.8 in order to use useParams()"
37 + );
38 + }
39 +
40 + const match = useContext(Context).match;
41 + return match ? match.params : {};
42 +}
43 +
44 +export function useRouteMatch(path) {
45 + if (__DEV__) {
46 + invariant(
47 + typeof useContext === "function",
48 + "You must use React >= 16.8 in order to use useRouteMatch()"
49 + );
50 + }
51 +
52 + const location = useLocation();
53 + const match = useContext(Context).match;
54 +
55 + return path ? matchPath(location.pathname, path) : match;
56 +}
1 +if (__DEV__) {
2 + if (typeof window !== "undefined") {
3 + const global = window;
4 + const key = "__react_router_build__";
5 + const buildNames = { cjs: "CommonJS", esm: "ES modules", umd: "UMD" };
6 +
7 + if (global[key] && global[key] !== process.env.BUILD_FORMAT) {
8 + const initialBuildName = buildNames[global[key]];
9 + const secondaryBuildName = buildNames[process.env.BUILD_FORMAT];
10 +
11 + // TODO: Add link to article that explains in detail how to avoid
12 + // loading 2 different builds.
13 + throw new Error(
14 + `You are loading the ${secondaryBuildName} build of React Router ` +
15 + `on a page that is already running the ${initialBuildName} ` +
16 + `build, so things won't work right.`
17 + );
18 + }
19 +
20 + global[key] = process.env.BUILD_FORMAT;
21 + }
22 +}
23 +
24 +export { default as MemoryRouter } from "./MemoryRouter.js";
25 +export { default as Prompt } from "./Prompt.js";
26 +export { default as Redirect } from "./Redirect.js";
27 +export { default as Route } from "./Route.js";
28 +export { default as Router } from "./Router.js";
29 +export { default as StaticRouter } from "./StaticRouter.js";
30 +export { default as Switch } from "./Switch.js";
31 +export { default as generatePath } from "./generatePath.js";
32 +export { default as matchPath } from "./matchPath.js";
33 +export { default as withRouter } from "./withRouter.js";
34 +
35 +import { useHistory, useLocation, useParams, useRouteMatch } from "./hooks.js";
36 +export { useHistory, useLocation, useParams, useRouteMatch };
37 +
38 +export { default as __HistoryContext } from "./HistoryContext.js";
39 +export { default as __RouterContext } from "./RouterContext.js";
1 +import pathToRegexp from "path-to-regexp";
2 +
3 +const cache = {};
4 +const cacheLimit = 10000;
5 +let cacheCount = 0;
6 +
7 +function compilePath(path, options) {
8 + const cacheKey = `${options.end}${options.strict}${options.sensitive}`;
9 + const pathCache = cache[cacheKey] || (cache[cacheKey] = {});
10 +
11 + if (pathCache[path]) return pathCache[path];
12 +
13 + const keys = [];
14 + const regexp = pathToRegexp(path, keys, options);
15 + const result = { regexp, keys };
16 +
17 + if (cacheCount < cacheLimit) {
18 + pathCache[path] = result;
19 + cacheCount++;
20 + }
21 +
22 + return result;
23 +}
24 +
25 +/**
26 + * Public API for matching a URL pathname to a path.
27 + */
28 +function matchPath(pathname, options = {}) {
29 + if (typeof options === "string" || Array.isArray(options)) {
30 + options = { path: options };
31 + }
32 +
33 + const { path, exact = false, strict = false, sensitive = false } = options;
34 +
35 + const paths = [].concat(path);
36 +
37 + return paths.reduce((matched, path) => {
38 + if (!path && path !== "") return null;
39 + if (matched) return matched;
40 +
41 + const { regexp, keys } = compilePath(path, {
42 + end: exact,
43 + strict,
44 + sensitive
45 + });
46 + const match = regexp.exec(pathname);
47 +
48 + if (!match) return null;
49 +
50 + const [url, ...values] = match;
51 + const isExact = pathname === url;
52 +
53 + if (exact && !isExact) return null;
54 +
55 + return {
56 + path, // the path used to match
57 + url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
58 + isExact, // whether or not we matched exactly
59 + params: keys.reduce((memo, key, index) => {
60 + memo[key.name] = values[index];
61 + return memo;
62 + }, {})
63 + };
64 + }, null);
65 +}
66 +
67 +export default matchPath;
1 +import React from "react";
2 +import PropTypes from "prop-types";
3 +import hoistStatics from "hoist-non-react-statics";
4 +import invariant from "tiny-invariant";
5 +
6 +import RouterContext from "./RouterContext.js";
7 +
8 +/**
9 + * A public higher-order component to access the imperative API
10 + */
11 +function withRouter(Component) {
12 + const displayName = `withRouter(${Component.displayName || Component.name})`;
13 + const C = props => {
14 + const { wrappedComponentRef, ...remainingProps } = props;
15 +
16 + return (
17 + <RouterContext.Consumer>
18 + {context => {
19 + invariant(
20 + context,
21 + `You should not use <${displayName} /> outside a <Router>`
22 + );
23 + return (
24 + <Component
25 + {...remainingProps}
26 + {...context}
27 + ref={wrappedComponentRef}
28 + />
29 + );
30 + }}
31 + </RouterContext.Consumer>
32 + );
33 + };
34 +
35 + C.displayName = displayName;
36 + C.WrappedComponent = Component;
37 +
38 + if (__DEV__) {
39 + C.propTypes = {
40 + wrappedComponentRef: PropTypes.oneOfType([
41 + PropTypes.string,
42 + PropTypes.func,
43 + PropTypes.object
44 + ])
45 + };
46 + }
47 +
48 + return hoistStatics(C, Component);
49 +}
50 +
51 +export default withRouter;
1 +{
2 + "_from": "react-router@5.2.0",
3 + "_id": "react-router@5.2.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==",
6 + "_location": "/react-router",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "version",
10 + "registry": true,
11 + "raw": "react-router@5.2.0",
12 + "name": "react-router",
13 + "escapedName": "react-router",
14 + "rawSpec": "5.2.0",
15 + "saveSpec": null,
16 + "fetchSpec": "5.2.0"
17 + },
18 + "_requiredBy": [
19 + "/react-router-dom"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz",
22 + "_shasum": "424e75641ca8747fbf76e5ecca69781aa37ea293",
23 + "_spec": "react-router@5.2.0",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router-dom",
25 + "author": {
26 + "name": "React Training",
27 + "email": "hello@reacttraining.com"
28 + },
29 + "browserify": {
30 + "transform": [
31 + "loose-envify"
32 + ]
33 + },
34 + "bugs": {
35 + "url": "https://github.com/ReactTraining/react-router/issues"
36 + },
37 + "bundleDependencies": false,
38 + "dependencies": {
39 + "@babel/runtime": "^7.1.2",
40 + "history": "^4.9.0",
41 + "hoist-non-react-statics": "^3.1.0",
42 + "loose-envify": "^1.3.1",
43 + "mini-create-react-context": "^0.4.0",
44 + "path-to-regexp": "^1.7.0",
45 + "prop-types": "^15.6.2",
46 + "react-is": "^16.6.0",
47 + "tiny-invariant": "^1.0.2",
48 + "tiny-warning": "^1.0.0"
49 + },
50 + "deprecated": false,
51 + "description": "Declarative routing for React",
52 + "files": [
53 + "MemoryRouter.js",
54 + "Prompt.js",
55 + "Redirect.js",
56 + "Route.js",
57 + "Router.js",
58 + "StaticRouter.js",
59 + "Switch.js",
60 + "cjs",
61 + "es",
62 + "esm",
63 + "index.js",
64 + "generatePath.js",
65 + "matchPath.js",
66 + "modules/*.js",
67 + "modules/utils/*.js",
68 + "withRouter.js",
69 + "warnAboutDeprecatedCJSRequire.js",
70 + "umd"
71 + ],
72 + "gitHead": "21a62e55c0d6196002bd4ab5b3350514976928cf",
73 + "homepage": "https://github.com/ReactTraining/react-router#readme",
74 + "keywords": [
75 + "react",
76 + "router",
77 + "route",
78 + "routing",
79 + "history",
80 + "link"
81 + ],
82 + "license": "MIT",
83 + "main": "index.js",
84 + "module": "esm/react-router.js",
85 + "name": "react-router",
86 + "peerDependencies": {
87 + "react": ">=15"
88 + },
89 + "repository": {
90 + "type": "git",
91 + "url": "git+https://github.com/ReactTraining/react-router.git"
92 + },
93 + "scripts": {
94 + "build": "rollup -c",
95 + "lint": "eslint modules"
96 + },
97 + "sideEffects": false,
98 + "version": "5.2.0"
99 +}
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
1 +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).ReactRouter={},t.React)}(this,function(t,c){"use strict";var s="default"in c?c.default:c;function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,s=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,l=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118;function b(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case p:case l:case i:case c:case a:case h:return t;default:switch(t=t&&t.$$typeof){case s:case f:case u:return t;default:return e}}case y:case m:case o:return e}}}function x(t){return b(t)===l}e.typeOf=b,e.AsyncMode=p,e.ConcurrentMode=l,e.ContextConsumer=s,e.ContextProvider=u,e.Element=r,e.ForwardRef=f,e.Fragment=i,e.Lazy=y,e.Memo=m,e.Portal=o,e.Profiler=c,e.StrictMode=a,e.Suspense=h,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===l||t===c||t===a||t===h||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===m||t.$$typeof===u||t.$$typeof===s||t.$$typeof===f||t.$$typeof===v||t.$$typeof===g)},e.isAsyncMode=function(t){return x(t)||b(t)===p},e.isConcurrentMode=x,e.isContextConsumer=function(t){return b(t)===s},e.isContextProvider=function(t){return b(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},e.isForwardRef=function(t){return b(t)===f},e.isFragment=function(t){return b(t)===i},e.isLazy=function(t){return b(t)===y},e.isMemo=function(t){return b(t)===m},e.isPortal=function(t){return b(t)===o},e.isProfiler=function(t){return b(t)===c},e.isStrictMode=function(t){return b(t)===a},e.isSuspense=function(t){return b(t)===h}});e(o);o.typeOf,o.AsyncMode,o.ConcurrentMode,o.ContextConsumer,o.ContextProvider,o.Element,o.ForwardRef,o.Fragment,o.Lazy,o.Memo,o.Portal,o.Profiler,o.StrictMode,o.Suspense,o.isValidElementType,o.isAsyncMode,o.isConcurrentMode,o.isContextConsumer,o.isContextProvider,o.isElement,o.isForwardRef,o.isFragment,o.isLazy,o.isMemo,o.isPortal,o.isProfiler,o.isStrictMode,o.isSuspense;var i=n(function(t,e){});e(i);i.typeOf,i.AsyncMode,i.ConcurrentMode,i.ContextConsumer,i.ContextProvider,i.Element,i.ForwardRef,i.Fragment,i.Lazy,i.Memo,i.Portal,i.Profiler,i.StrictMode,i.Suspense,i.isValidElementType,i.isAsyncMode,i.isConcurrentMode,i.isContextConsumer,i.isContextProvider,i.isElement,i.isForwardRef,i.isFragment,i.isLazy,i.isMemo,i.isPortal,i.isProfiler,i.isStrictMode,i.isSuspense;var a=n(function(t){t.exports=o}),u=(a.isValidElementType,Object.getOwnPropertySymbols),p=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()||Object.assign,Function.call.bind(Object.prototype.hasOwnProperty);function f(){}function h(){}h.resetWarningCache=f;var d=n(function(t){t.exports=function(){function t(t,e,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}var n={array:t.isRequired=t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:h,resetWarningCache:f};return n.PropTypes=n}()});function v(){return(v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function m(t){return"/"===t.charAt(0)}function y(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var b="Invariant failed";function x(t){if(!t)throw new Error(b)}function P(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function C(t,e,n,r){var o;"string"==typeof t?(o=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(o=v({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=function(t,e){var n=1<arguments.length&&void 0!==e?e:"",r=t&&t.split("/")||[],o=n&&n.split("/")||[],i=t&&m(t),a=n&&m(n),c=i||a;if(t&&m(t)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";var u=void 0;if(o.length){var s=o[o.length-1];u="."===s||".."===s||""===s}else u=!1;for(var p=0,l=o.length;0<=l;l--){var f=o[l];"."===f?y(o,l):".."===f?(y(o,l),p++):p&&(y(o,l),p--)}if(!c)for(;p--;)o.unshift("..");!c||""===o[0]||o[0]&&m(o[0])||o.unshift("");var h=o.join("/");return u&&"/"!==h.substr(-1)&&(h+="/"),h}(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function w(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&function n(e,r){if(e===r)return!0;if(null==e||null==r)return!1;if(Array.isArray(e))return Array.isArray(r)&&e.length===r.length&&e.every(function(t,e){return n(t,r[e])});var t=void 0===e?"undefined":g(e);if(t!==(void 0===r?"undefined":g(r)))return!1;if("object"!==t)return!1;var o=e.valueOf(),i=r.valueOf();if(o!==e||i!==r)return n(o,i);var a=Object.keys(e),c=Object.keys(r);return a.length===c.length&&a.every(function(t){return n(e[t],r[t])})}(t.state,e.state)}"undefined"!=typeof window&&window.document&&window.document.createElement;function E(t,e,n){return Math.min(Math.max(t,e),n)}function O(t){void 0===t&&(t={});var e=t,o=e.getUserConfirmation,n=e.initialEntries,r=void 0===n?["/"]:n,i=e.initialIndex,a=void 0===i?0:i,c=e.keyLength,u=void 0===c?6:c,s=function(){var i=null,r=[];return{setPrompt:function(t){return i=t,function(){i===t&&(i=null)}},confirmTransitionTo:function(t,e,n,r){if(null!=i){var o="function"==typeof i?i(t,e):i;"string"==typeof o?"function"==typeof n?n(o,r):r(!0):r(!1!==o)}else r(!0)},appendListener:function(t){var e=!0;function n(){e&&t.apply(void 0,arguments)}return r.push(n),function(){e=!1,r=r.filter(function(t){return t!==n})}},notifyListeners:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.forEach(function(t){return t.apply(void 0,e)})}}}();function p(t){v(y,t),y.length=y.entries.length,s.notifyListeners(y.location,y.action)}function l(){return Math.random().toString(36).substr(2,u)}var f=E(a,0,r.length-1),h=r.map(function(t){return C(t,void 0,"string"==typeof t?l():t.key||l())}),d=P;function m(t){var e=E(y.index+t,0,y.entries.length-1),n=y.entries[e];s.confirmTransitionTo(n,"POP",o,function(t){t?p({action:"POP",location:n,index:e}):p()})}var y={length:h.length,action:"POP",location:h[f],index:f,entries:h,createHref:d,push:function(t,e){var r=C(t,e,l(),y.location);s.confirmTransitionTo(r,"PUSH",o,function(t){if(t){var e=y.index+1,n=y.entries.slice(0);n.length>e?n.splice(e,n.length-e,r):n.push(r),p({action:"PUSH",location:r,index:e,entries:n})}})},replace:function(t,e){var n="REPLACE",r=C(t,e,l(),y.location);s.confirmTransitionTo(r,n,o,function(t){t&&(y.entries[y.index]=r,p({action:n,location:r}))})},go:m,goBack:function(){m(-1)},goForward:function(){m(1)},canGo:function(t){var e=y.index+t;return 0<=e&&e<y.entries.length},block:function(t){return void 0===t&&(t=!1),s.setPrompt(t)},listen:function(t){return s.appendListener(t)}};return y}function S(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}var _=1073741823,M="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};var R=s.createContext||function(r,o){var t,e,i="__create-react-context-"+function(){var t="__global_unique_id__";return M[t]=(M[t]||0)+1}()+"__",n=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).emitter=function(n){var r=[];return{on:function(t){r.push(t)},off:function(e){r=r.filter(function(t){return t!==e})},get:function(){return n},set:function(t,e){n=t,r.forEach(function(t){return t(n,e)})}}}(t.props.value),t}S(t,e);var n=t.prototype;return n.getChildContext=function(){var t;return(t={})[i]=this.emitter,t},n.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var e,n=this.props.value,r=t.value;!function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}(n,r)?(e="function"==typeof o?o(n,r):_,0!==(e|=0)&&this.emitter.set(t.value,e)):e=0}},n.render=function(){return this.props.children},t}(c.Component);n.childContextTypes=((t={})[i]=d.object.isRequired,t);var a=function(t){function e(){var n;return(n=t.apply(this,arguments)||this).state={value:n.getValue()},n.onUpdate=function(t,e){0!=((0|n.observedBits)&e)&&n.setState({value:n.getValue()})},n}S(e,t);var n=e.prototype;return n.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?_:e},n.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?_:t},n.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},n.getValue=function(){return this.context[i]?this.context[i].get():r},n.render=function(){return function(t){return Array.isArray(t)?t[0]:t}(this.props.children)(this.state.value)},e}(c.Component);return a.contextTypes=((e={})[i]=d.object,e),{Provider:n,Consumer:a}},j=function(t){var e=R();return e.displayName=t,e}("Router-History"),T=function(t){var e=R();return e.displayName=t,e}("Router"),A=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={location:t.history.location},e._isMounted=!1,e._pendingLocation=null,t.staticContext||(e.unlisten=t.history.listen(function(t){e._isMounted?e.setState({location:t}):e._pendingLocation=t})),e}r(t,n),t.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var e=t.prototype;return e.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},e.componentWillUnmount=function(){this.unlisten&&this.unlisten()},e.render=function(){return s.createElement(T.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},s.createElement(j.Provider,{children:this.props.children||null,value:this.props.history}))},t}(s.Component),$=function(o){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=o.call.apply(o,[this].concat(n))||this).history=O(t.props),t}return r(t,o),t.prototype.render=function(){return s.createElement(A,{history:this.history,children:this.props.children})},t}(s.Component),k=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(t){this.props.onUpdate&&this.props.onUpdate.call(this,this,t)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},e}(s.Component);function U(t,e){return W(H(t,e))}var L=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},F=Y,I=H,N=W,B=G,D=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function H(t,e){for(var n,r,o=[],i=0,a=0,c="",u=e&&e.delimiter||"/";null!=(n=D.exec(t));){var s=n[0],p=n[1],l=n.index;if(c+=t.slice(a,l),a=l+s.length,p)c+=p[1];else{var f=t[a],h=n[2],d=n[3],m=n[4],y=n[5],v=n[6],g=n[7];c&&(o.push(c),c="");var b=null!=h&&null!=f&&f!==h,x="+"===v||"*"===v,P="?"===v||"*"===v,C=n[2]||u,w=m||y;o.push({name:d||i++,prefix:h||"",delimiter:C,optional:P,repeat:x,partial:b,asterisk:!!g,pattern:w?(r=w,r.replace(/([=!:$\/()])/g,"\\$1")):g?".*":"[^"+z(C)+"]+?"})}}return a<t.length&&(c+=t.substr(a)),c&&o.push(c),o}function V(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function W(p){for(var l=new Array(p.length),t=0;t<p.length;t++)"object"==typeof p[t]&&(l[t]=new RegExp("^(?:"+p[t].pattern+")$"));return function(t,e){for(var n="",r=t||{},o=(e||{}).pretty?V:encodeURIComponent,i=0;i<p.length;i++){var a=p[i];if("string"!=typeof a){var c,u=r[a.name];if(null==u){if(a.optional){a.partial&&(n+=a.prefix);continue}throw new TypeError('Expected "'+a.name+'" to be defined')}if(L(u)){if(!a.repeat)throw new TypeError('Expected "'+a.name+'" to not repeat, but received `'+JSON.stringify(u)+"`");if(0===u.length){if(a.optional)continue;throw new TypeError('Expected "'+a.name+'" to not be empty')}for(var s=0;s<u.length;s++){if(c=o(u[s]),!l[i].test(c))throw new TypeError('Expected all "'+a.name+'" to match "'+a.pattern+'", but received `'+JSON.stringify(c)+"`");n+=(0===s?a.prefix:a.delimiter)+c}}else{if(c=a.asterisk?encodeURI(u).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):o(u),!l[i].test(c))throw new TypeError('Expected "'+a.name+'" to match "'+a.pattern+'", but received "'+c+'"');n+=a.prefix+c}}else n+=a}return n}}function z(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function q(t,e){return t.keys=e,t}function J(t){return t.sensitive?"":"i"}function G(t,e,n){L(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",a=0;a<t.length;a++){var c=t[a];if("string"==typeof c)i+=z(c);else{var u=z(c.prefix),s="(?:"+c.pattern+")";e.push(c),c.repeat&&(s+="(?:"+u+s+")*"),i+=s=c.optional?c.partial?u+"("+s+")?":"(?:"+u+"("+s+"))?":u+"("+s+")"}}var p=z(n.delimiter||"/"),l=i.slice(-p.length)===p;return r||(i=(l?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":r&&l?"":"(?="+p+"|$)",q(new RegExp("^"+i,J(n)),e)}function Y(t,e,n){return L(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return q(t,e)}(t,e):L(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(Y(t[o],e,n).source);return q(new RegExp("(?:"+r.join("|")+")",J(n)),e)}(t,e,n):function(t,e,n){return G(H(t,n),e,n)}(t,e,n)}F.parse=I,F.compile=U,F.tokensToFunction=N,F.tokensToRegExp=B;var K={},Q=1e4,X=0;function Z(t,e){return void 0===t&&(t="/"),void 0===e&&(e={}),"/"===t?t:function(t){if(K[t])return K[t];var e=F.compile(t);return X<Q&&(K[t]=e,X++),e}(t)(e,{pretty:!0})}var tt={},et=1e4,nt=0;function rt(s,t){void 0===t&&(t={}),"string"!=typeof t&&!Array.isArray(t)||(t={path:t});var e=t,n=e.path,r=e.exact,p=void 0!==r&&r,o=e.strict,l=void 0!==o&&o,i=e.sensitive,f=void 0!==i&&i;return[].concat(n).reduce(function(t,e){if(!e&&""!==e)return null;if(t)return t;var n=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=tt[n]||(tt[n]={});if(r[t])return r[t];var o=[],i={regexp:F(t,o,e),keys:o};return nt<et&&(r[t]=i,nt++),i}(e,{end:p,strict:l,sensitive:f}),r=n.regexp,o=n.keys,i=r.exec(s);if(!i)return null;var a=i[0],c=i.slice(1),u=s===a;return p&&!u?null:{path:e,url:"/"===e&&""===a?"/":a,isExact:u,params:o.reduce(function(t,e,n){return t[e.name]=c[n],t},{})}},null)}var ot=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var c=this;return s.createElement(T.Consumer,null,function(t){t||x(!1);var e=c.props.location||t.location,n=v({},t,{location:e,match:c.props.computedMatch?c.props.computedMatch:c.props.path?rt(e.pathname,c.props):t.match}),r=c.props,o=r.children,i=r.component,a=r.render;return Array.isArray(o)&&0===o.length&&(o=null),s.createElement(T.Provider,{value:n},n.match?o?"function"==typeof o?o(n):o:i?s.createElement(i,n):a?a(n):null:"function"==typeof o?o(n):null)})},e}(s.Component);function it(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||(o[n]=t[n]);return o}function at(t){return"/"===t.charAt(0)?t:"/"+t}function ct(t){return"string"==typeof t?t:P(t)}function ut(){return function(){x(!1)}}function st(){}var pt=function(o){function t(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=o.call.apply(o,[this].concat(n))||this).handlePush=function(t){return e.navigateTo(t,"PUSH")},e.handleReplace=function(t){return e.navigateTo(t,"REPLACE")},e.handleListen=function(){return st},e.handleBlock=function(){return st},e}r(t,o);var e=t.prototype;return e.navigateTo=function(t,e){var n=this.props,r=n.basename,o=void 0===r?"":r,i=n.context,a=void 0===i?{}:i;a.action=e,a.location=function(t,e){return t?v({},e,{pathname:at(t)+e.pathname}):e}(o,C(t)),a.url=ct(a.location)},e.render=function(){var t=this.props,e=t.basename,n=void 0===e?"":e,r=t.context,o=void 0===r?{}:r,i=t.location,a=void 0===i?"/":i,c=it(t,["basename","context","location"]),u={createHref:function(t){return at(n+ct(t))},action:"POP",location:function(t,e){if(!t)return e;var n=at(t);return 0!==e.pathname.indexOf(n)?e:v({},e,{pathname:e.pathname.substr(n.length)})}(n,C(a)),push:this.handlePush,replace:this.handleReplace,go:ut(),goBack:ut(),goForward:ut(),listen:this.handleListen,block:this.handleBlock};return s.createElement(A,v({},c,{history:u,staticContext:o}))},t}(s.Component),lt=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var t=this;return s.createElement(T.Consumer,null,function(n){n||x(!1);var r,o,i=t.props.location||n.location;return s.Children.forEach(t.props.children,function(t){if(null==o&&s.isValidElement(t)){var e=(r=t).props.path||t.props.from;o=e?rt(i.pathname,v({},t.props,{path:e})):n.match}}),o?s.cloneElement(r,{location:i,computedMatch:o}):null})},e}(s.Component),ft={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ht={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},dt={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mt={};function yt(t){return a.isMemo(t)?dt:mt[t.$$typeof]||ft}mt[a.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var vt=Object.defineProperty,gt=Object.getOwnPropertyNames,bt=Object.getOwnPropertySymbols,xt=Object.getOwnPropertyDescriptor,Pt=Object.getPrototypeOf,Ct=Object.prototype;var wt=function t(e,n,r){if("string"==typeof n)return e;if(Ct){var o=Pt(n);o&&o!==Ct&&t(e,o,r)}var i=gt(n);bt&&(i=i.concat(bt(n)));for(var a=yt(e),c=yt(n),u=0;u<i.length;++u){var s=i[u];if(!(ht[s]||r&&r[s]||c&&c[s]||a&&a[s])){var p=xt(n,s);try{vt(e,s,p)}catch(t){}}}return e};var Et=s.useContext;function Ot(){return Et(T).location}t.MemoryRouter=$,t.Prompt=function(t){var r=t.message,e=t.when,o=void 0===e||e;return s.createElement(T.Consumer,null,function(t){if(t||x(!1),!o||t.staticContext)return null;var n=t.history.block;return s.createElement(k,{onMount:function(t){t.release=n(r)},onUpdate:function(t,e){e.message!==r&&(t.release(),t.release=n(r))},onUnmount:function(t){t.release()},message:r})})},t.Redirect=function(t){var i=t.computedMatch,a=t.to,e=t.push,c=void 0!==e&&e;return s.createElement(T.Consumer,null,function(t){t||x(!1);var e=t.history,n=t.staticContext,r=c?e.push:e.replace,o=C(i?"string"==typeof a?Z(a,i.params):v({},a,{pathname:Z(a.pathname,i.params)}):a);return n?(r(o),null):s.createElement(k,{onMount:function(){r(o)},onUpdate:function(t,e){var n=C(e.to);w(n,v({},o,{key:n.key}))||r(o)},to:a})})},t.Route=ot,t.Router=A,t.StaticRouter=pt,t.Switch=lt,t.__HistoryContext=j,t.__RouterContext=T,t.generatePath=Z,t.matchPath=rt,t.useHistory=function(){return Et(j)},t.useLocation=Ot,t.useParams=function(){var t=Et(T).match;return t?t.params:{}},t.useRouteMatch=function(t){var e=Ot(),n=Et(T).match;return t?rt(e.pathname,t):n},t.withRouter=function(r){function t(t){var e=t.wrappedComponentRef,n=it(t,["wrappedComponentRef"]);return s.createElement(T.Consumer,null,function(t){return t||x(!1),s.createElement(r,v({},n,t,{ref:e}))})}var e="withRouter("+(r.displayName||r.name)+")";return t.displayName=e,t.WrappedComponent=r,wt(t,r)},Object.defineProperty(t,"__esModule",{value:!0})});
2 +//# sourceMappingURL=react-router.min.js.map
This diff could not be displayed because it is too large.
1 +/* eslint-disable prefer-arrow-callback, no-empty */
2 +"use strict";
3 +
4 +var printWarning = function() {};
5 +
6 +if (process.env.NODE_ENV !== "production") {
7 + printWarning = function(format, subs) {
8 + var index = 0;
9 + var message =
10 + "Warning: " +
11 + (subs.length > 0
12 + ? format.replace(/%s/g, function() {
13 + return subs[index++];
14 + })
15 + : format);
16 +
17 + if (typeof console !== "undefined") {
18 + console.error(message);
19 + }
20 +
21 + try {
22 + // --- Welcome to debugging React Router ---
23 + // This error was thrown as a convenience so that you can use the
24 + // stack trace to find the callsite that triggered this warning.
25 + throw new Error(message);
26 + } catch (e) {}
27 + };
28 +}
29 +
30 +module.exports = function(member) {
31 + printWarning(
32 + 'Please use `require("react-router").%s` instead of `require("react-router/%s")`. ' +
33 + "Support for the latter will be removed in the next major release.",
34 + [member, member]
35 + );
36 +};
1 +"use strict";
2 +require("./warnAboutDeprecatedCJSRequire")("withRouter");
3 +module.exports = require("./index.js").withRouter;
1 +MIT License
2 +
3 +Copyright (c) 2014-present, Facebook, Inc.
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +# regenerator-runtime
2 +
3 +Standalone runtime for
4 +[Regenerator](https://github.com/facebook/regenerator)-compiled generator
5 +and `async` functions.
6 +
7 +To import the runtime as a module (recommended), either of the following
8 +import styles will work:
9 +```js
10 +// CommonJS
11 +const regeneratorRuntime = require("regenerator-runtime");
12 +
13 +// ECMAScript 2015
14 +import regeneratorRuntime from "regenerator-runtime";
15 +```
16 +
17 +To ensure that `regeneratorRuntime` is defined globally, either of the
18 +following styles will work:
19 +```js
20 +// CommonJS
21 +require("regenerator-runtime/runtime");
22 +
23 +// ECMAScript 2015
24 +import "regenerator-runtime/runtime.js";
25 +```
26 +
27 +To get the absolute file system path of `runtime.js`, evaluate the
28 +following expression:
29 +```js
30 +require("regenerator-runtime/path").path
31 +```
1 +{
2 + "_from": "regenerator-runtime@^0.13.4",
3 + "_id": "regenerator-runtime@0.13.5",
4 + "_inBundle": false,
5 + "_integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
6 + "_location": "/regenerator-runtime",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "regenerator-runtime@^0.13.4",
12 + "name": "regenerator-runtime",
13 + "escapedName": "regenerator-runtime",
14 + "rawSpec": "^0.13.4",
15 + "saveSpec": null,
16 + "fetchSpec": "^0.13.4"
17 + },
18 + "_requiredBy": [
19 + "/@babel/runtime"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
22 + "_shasum": "d878a1d094b4306d10b9096484b33ebd55e26697",
23 + "_spec": "regenerator-runtime@^0.13.4",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\@babel\\runtime",
25 + "author": {
26 + "name": "Ben Newman",
27 + "email": "bn@cs.stanford.edu"
28 + },
29 + "bundleDependencies": false,
30 + "deprecated": false,
31 + "description": "Runtime for Regenerator-compiled generator and async functions.",
32 + "keywords": [
33 + "regenerator",
34 + "runtime",
35 + "generator",
36 + "async"
37 + ],
38 + "license": "MIT",
39 + "main": "runtime.js",
40 + "name": "regenerator-runtime",
41 + "repository": {
42 + "type": "git",
43 + "url": "https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime"
44 + },
45 + "sideEffects": true,
46 + "version": "0.13.5"
47 +}
1 +/**
2 + * Copyright (c) 2014-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +exports.path = require("path").join(
9 + __dirname,
10 + "runtime.js"
11 +);
1 +/**
2 + * Copyright (c) 2014-present, Facebook, Inc.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 +var runtime = (function (exports) {
9 + "use strict";
10 +
11 + var Op = Object.prototype;
12 + var hasOwn = Op.hasOwnProperty;
13 + var undefined; // More compressible than void 0.
14 + var $Symbol = typeof Symbol === "function" ? Symbol : {};
15 + var iteratorSymbol = $Symbol.iterator || "@@iterator";
16 + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
17 + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
18 +
19 + function wrap(innerFn, outerFn, self, tryLocsList) {
20 + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
21 + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
22 + var generator = Object.create(protoGenerator.prototype);
23 + var context = new Context(tryLocsList || []);
24 +
25 + // The ._invoke method unifies the implementations of the .next,
26 + // .throw, and .return methods.
27 + generator._invoke = makeInvokeMethod(innerFn, self, context);
28 +
29 + return generator;
30 + }
31 + exports.wrap = wrap;
32 +
33 + // Try/catch helper to minimize deoptimizations. Returns a completion
34 + // record like context.tryEntries[i].completion. This interface could
35 + // have been (and was previously) designed to take a closure to be
36 + // invoked without arguments, but in all the cases we care about we
37 + // already have an existing method we want to call, so there's no need
38 + // to create a new function object. We can even get away with assuming
39 + // the method takes exactly one argument, since that happens to be true
40 + // in every case, so we don't have to touch the arguments object. The
41 + // only additional allocation required is the completion record, which
42 + // has a stable shape and so hopefully should be cheap to allocate.
43 + function tryCatch(fn, obj, arg) {
44 + try {
45 + return { type: "normal", arg: fn.call(obj, arg) };
46 + } catch (err) {
47 + return { type: "throw", arg: err };
48 + }
49 + }
50 +
51 + var GenStateSuspendedStart = "suspendedStart";
52 + var GenStateSuspendedYield = "suspendedYield";
53 + var GenStateExecuting = "executing";
54 + var GenStateCompleted = "completed";
55 +
56 + // Returning this object from the innerFn has the same effect as
57 + // breaking out of the dispatch switch statement.
58 + var ContinueSentinel = {};
59 +
60 + // Dummy constructor functions that we use as the .constructor and
61 + // .constructor.prototype properties for functions that return Generator
62 + // objects. For full spec compliance, you may wish to configure your
63 + // minifier not to mangle the names of these two functions.
64 + function Generator() {}
65 + function GeneratorFunction() {}
66 + function GeneratorFunctionPrototype() {}
67 +
68 + // This is a polyfill for %IteratorPrototype% for environments that
69 + // don't natively support it.
70 + var IteratorPrototype = {};
71 + IteratorPrototype[iteratorSymbol] = function () {
72 + return this;
73 + };
74 +
75 + var getProto = Object.getPrototypeOf;
76 + var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
77 + if (NativeIteratorPrototype &&
78 + NativeIteratorPrototype !== Op &&
79 + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
80 + // This environment has a native %IteratorPrototype%; use it instead
81 + // of the polyfill.
82 + IteratorPrototype = NativeIteratorPrototype;
83 + }
84 +
85 + var Gp = GeneratorFunctionPrototype.prototype =
86 + Generator.prototype = Object.create(IteratorPrototype);
87 + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
88 + GeneratorFunctionPrototype.constructor = GeneratorFunction;
89 + GeneratorFunctionPrototype[toStringTagSymbol] =
90 + GeneratorFunction.displayName = "GeneratorFunction";
91 +
92 + // Helper for defining the .next, .throw, and .return methods of the
93 + // Iterator interface in terms of a single ._invoke method.
94 + function defineIteratorMethods(prototype) {
95 + ["next", "throw", "return"].forEach(function(method) {
96 + prototype[method] = function(arg) {
97 + return this._invoke(method, arg);
98 + };
99 + });
100 + }
101 +
102 + exports.isGeneratorFunction = function(genFun) {
103 + var ctor = typeof genFun === "function" && genFun.constructor;
104 + return ctor
105 + ? ctor === GeneratorFunction ||
106 + // For the native GeneratorFunction constructor, the best we can
107 + // do is to check its .name property.
108 + (ctor.displayName || ctor.name) === "GeneratorFunction"
109 + : false;
110 + };
111 +
112 + exports.mark = function(genFun) {
113 + if (Object.setPrototypeOf) {
114 + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
115 + } else {
116 + genFun.__proto__ = GeneratorFunctionPrototype;
117 + if (!(toStringTagSymbol in genFun)) {
118 + genFun[toStringTagSymbol] = "GeneratorFunction";
119 + }
120 + }
121 + genFun.prototype = Object.create(Gp);
122 + return genFun;
123 + };
124 +
125 + // Within the body of any async function, `await x` is transformed to
126 + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
127 + // `hasOwn.call(value, "__await")` to determine if the yielded value is
128 + // meant to be awaited.
129 + exports.awrap = function(arg) {
130 + return { __await: arg };
131 + };
132 +
133 + function AsyncIterator(generator, PromiseImpl) {
134 + function invoke(method, arg, resolve, reject) {
135 + var record = tryCatch(generator[method], generator, arg);
136 + if (record.type === "throw") {
137 + reject(record.arg);
138 + } else {
139 + var result = record.arg;
140 + var value = result.value;
141 + if (value &&
142 + typeof value === "object" &&
143 + hasOwn.call(value, "__await")) {
144 + return PromiseImpl.resolve(value.__await).then(function(value) {
145 + invoke("next", value, resolve, reject);
146 + }, function(err) {
147 + invoke("throw", err, resolve, reject);
148 + });
149 + }
150 +
151 + return PromiseImpl.resolve(value).then(function(unwrapped) {
152 + // When a yielded Promise is resolved, its final value becomes
153 + // the .value of the Promise<{value,done}> result for the
154 + // current iteration.
155 + result.value = unwrapped;
156 + resolve(result);
157 + }, function(error) {
158 + // If a rejected Promise was yielded, throw the rejection back
159 + // into the async generator function so it can be handled there.
160 + return invoke("throw", error, resolve, reject);
161 + });
162 + }
163 + }
164 +
165 + var previousPromise;
166 +
167 + function enqueue(method, arg) {
168 + function callInvokeWithMethodAndArg() {
169 + return new PromiseImpl(function(resolve, reject) {
170 + invoke(method, arg, resolve, reject);
171 + });
172 + }
173 +
174 + return previousPromise =
175 + // If enqueue has been called before, then we want to wait until
176 + // all previous Promises have been resolved before calling invoke,
177 + // so that results are always delivered in the correct order. If
178 + // enqueue has not been called before, then it is important to
179 + // call invoke immediately, without waiting on a callback to fire,
180 + // so that the async generator function has the opportunity to do
181 + // any necessary setup in a predictable way. This predictability
182 + // is why the Promise constructor synchronously invokes its
183 + // executor callback, and why async functions synchronously
184 + // execute code before the first await. Since we implement simple
185 + // async functions in terms of async generators, it is especially
186 + // important to get this right, even though it requires care.
187 + previousPromise ? previousPromise.then(
188 + callInvokeWithMethodAndArg,
189 + // Avoid propagating failures to Promises returned by later
190 + // invocations of the iterator.
191 + callInvokeWithMethodAndArg
192 + ) : callInvokeWithMethodAndArg();
193 + }
194 +
195 + // Define the unified helper method that is used to implement .next,
196 + // .throw, and .return (see defineIteratorMethods).
197 + this._invoke = enqueue;
198 + }
199 +
200 + defineIteratorMethods(AsyncIterator.prototype);
201 + AsyncIterator.prototype[asyncIteratorSymbol] = function () {
202 + return this;
203 + };
204 + exports.AsyncIterator = AsyncIterator;
205 +
206 + // Note that simple async functions are implemented on top of
207 + // AsyncIterator objects; they just return a Promise for the value of
208 + // the final result produced by the iterator.
209 + exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
210 + if (PromiseImpl === void 0) PromiseImpl = Promise;
211 +
212 + var iter = new AsyncIterator(
213 + wrap(innerFn, outerFn, self, tryLocsList),
214 + PromiseImpl
215 + );
216 +
217 + return exports.isGeneratorFunction(outerFn)
218 + ? iter // If outerFn is a generator, return the full iterator.
219 + : iter.next().then(function(result) {
220 + return result.done ? result.value : iter.next();
221 + });
222 + };
223 +
224 + function makeInvokeMethod(innerFn, self, context) {
225 + var state = GenStateSuspendedStart;
226 +
227 + return function invoke(method, arg) {
228 + if (state === GenStateExecuting) {
229 + throw new Error("Generator is already running");
230 + }
231 +
232 + if (state === GenStateCompleted) {
233 + if (method === "throw") {
234 + throw arg;
235 + }
236 +
237 + // Be forgiving, per 25.3.3.3.3 of the spec:
238 + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
239 + return doneResult();
240 + }
241 +
242 + context.method = method;
243 + context.arg = arg;
244 +
245 + while (true) {
246 + var delegate = context.delegate;
247 + if (delegate) {
248 + var delegateResult = maybeInvokeDelegate(delegate, context);
249 + if (delegateResult) {
250 + if (delegateResult === ContinueSentinel) continue;
251 + return delegateResult;
252 + }
253 + }
254 +
255 + if (context.method === "next") {
256 + // Setting context._sent for legacy support of Babel's
257 + // function.sent implementation.
258 + context.sent = context._sent = context.arg;
259 +
260 + } else if (context.method === "throw") {
261 + if (state === GenStateSuspendedStart) {
262 + state = GenStateCompleted;
263 + throw context.arg;
264 + }
265 +
266 + context.dispatchException(context.arg);
267 +
268 + } else if (context.method === "return") {
269 + context.abrupt("return", context.arg);
270 + }
271 +
272 + state = GenStateExecuting;
273 +
274 + var record = tryCatch(innerFn, self, context);
275 + if (record.type === "normal") {
276 + // If an exception is thrown from innerFn, we leave state ===
277 + // GenStateExecuting and loop back for another invocation.
278 + state = context.done
279 + ? GenStateCompleted
280 + : GenStateSuspendedYield;
281 +
282 + if (record.arg === ContinueSentinel) {
283 + continue;
284 + }
285 +
286 + return {
287 + value: record.arg,
288 + done: context.done
289 + };
290 +
291 + } else if (record.type === "throw") {
292 + state = GenStateCompleted;
293 + // Dispatch the exception by looping back around to the
294 + // context.dispatchException(context.arg) call above.
295 + context.method = "throw";
296 + context.arg = record.arg;
297 + }
298 + }
299 + };
300 + }
301 +
302 + // Call delegate.iterator[context.method](context.arg) and handle the
303 + // result, either by returning a { value, done } result from the
304 + // delegate iterator, or by modifying context.method and context.arg,
305 + // setting context.delegate to null, and returning the ContinueSentinel.
306 + function maybeInvokeDelegate(delegate, context) {
307 + var method = delegate.iterator[context.method];
308 + if (method === undefined) {
309 + // A .throw or .return when the delegate iterator has no .throw
310 + // method always terminates the yield* loop.
311 + context.delegate = null;
312 +
313 + if (context.method === "throw") {
314 + // Note: ["return"] must be used for ES3 parsing compatibility.
315 + if (delegate.iterator["return"]) {
316 + // If the delegate iterator has a return method, give it a
317 + // chance to clean up.
318 + context.method = "return";
319 + context.arg = undefined;
320 + maybeInvokeDelegate(delegate, context);
321 +
322 + if (context.method === "throw") {
323 + // If maybeInvokeDelegate(context) changed context.method from
324 + // "return" to "throw", let that override the TypeError below.
325 + return ContinueSentinel;
326 + }
327 + }
328 +
329 + context.method = "throw";
330 + context.arg = new TypeError(
331 + "The iterator does not provide a 'throw' method");
332 + }
333 +
334 + return ContinueSentinel;
335 + }
336 +
337 + var record = tryCatch(method, delegate.iterator, context.arg);
338 +
339 + if (record.type === "throw") {
340 + context.method = "throw";
341 + context.arg = record.arg;
342 + context.delegate = null;
343 + return ContinueSentinel;
344 + }
345 +
346 + var info = record.arg;
347 +
348 + if (! info) {
349 + context.method = "throw";
350 + context.arg = new TypeError("iterator result is not an object");
351 + context.delegate = null;
352 + return ContinueSentinel;
353 + }
354 +
355 + if (info.done) {
356 + // Assign the result of the finished delegate to the temporary
357 + // variable specified by delegate.resultName (see delegateYield).
358 + context[delegate.resultName] = info.value;
359 +
360 + // Resume execution at the desired location (see delegateYield).
361 + context.next = delegate.nextLoc;
362 +
363 + // If context.method was "throw" but the delegate handled the
364 + // exception, let the outer generator proceed normally. If
365 + // context.method was "next", forget context.arg since it has been
366 + // "consumed" by the delegate iterator. If context.method was
367 + // "return", allow the original .return call to continue in the
368 + // outer generator.
369 + if (context.method !== "return") {
370 + context.method = "next";
371 + context.arg = undefined;
372 + }
373 +
374 + } else {
375 + // Re-yield the result returned by the delegate method.
376 + return info;
377 + }
378 +
379 + // The delegate iterator is finished, so forget it and continue with
380 + // the outer generator.
381 + context.delegate = null;
382 + return ContinueSentinel;
383 + }
384 +
385 + // Define Generator.prototype.{next,throw,return} in terms of the
386 + // unified ._invoke helper method.
387 + defineIteratorMethods(Gp);
388 +
389 + Gp[toStringTagSymbol] = "Generator";
390 +
391 + // A Generator should always return itself as the iterator object when the
392 + // @@iterator function is called on it. Some browsers' implementations of the
393 + // iterator prototype chain incorrectly implement this, causing the Generator
394 + // object to not be returned from this call. This ensures that doesn't happen.
395 + // See https://github.com/facebook/regenerator/issues/274 for more details.
396 + Gp[iteratorSymbol] = function() {
397 + return this;
398 + };
399 +
400 + Gp.toString = function() {
401 + return "[object Generator]";
402 + };
403 +
404 + function pushTryEntry(locs) {
405 + var entry = { tryLoc: locs[0] };
406 +
407 + if (1 in locs) {
408 + entry.catchLoc = locs[1];
409 + }
410 +
411 + if (2 in locs) {
412 + entry.finallyLoc = locs[2];
413 + entry.afterLoc = locs[3];
414 + }
415 +
416 + this.tryEntries.push(entry);
417 + }
418 +
419 + function resetTryEntry(entry) {
420 + var record = entry.completion || {};
421 + record.type = "normal";
422 + delete record.arg;
423 + entry.completion = record;
424 + }
425 +
426 + function Context(tryLocsList) {
427 + // The root entry object (effectively a try statement without a catch
428 + // or a finally block) gives us a place to store values thrown from
429 + // locations where there is no enclosing try statement.
430 + this.tryEntries = [{ tryLoc: "root" }];
431 + tryLocsList.forEach(pushTryEntry, this);
432 + this.reset(true);
433 + }
434 +
435 + exports.keys = function(object) {
436 + var keys = [];
437 + for (var key in object) {
438 + keys.push(key);
439 + }
440 + keys.reverse();
441 +
442 + // Rather than returning an object with a next method, we keep
443 + // things simple and return the next function itself.
444 + return function next() {
445 + while (keys.length) {
446 + var key = keys.pop();
447 + if (key in object) {
448 + next.value = key;
449 + next.done = false;
450 + return next;
451 + }
452 + }
453 +
454 + // To avoid creating an additional object, we just hang the .value
455 + // and .done properties off the next function object itself. This
456 + // also ensures that the minifier will not anonymize the function.
457 + next.done = true;
458 + return next;
459 + };
460 + };
461 +
462 + function values(iterable) {
463 + if (iterable) {
464 + var iteratorMethod = iterable[iteratorSymbol];
465 + if (iteratorMethod) {
466 + return iteratorMethod.call(iterable);
467 + }
468 +
469 + if (typeof iterable.next === "function") {
470 + return iterable;
471 + }
472 +
473 + if (!isNaN(iterable.length)) {
474 + var i = -1, next = function next() {
475 + while (++i < iterable.length) {
476 + if (hasOwn.call(iterable, i)) {
477 + next.value = iterable[i];
478 + next.done = false;
479 + return next;
480 + }
481 + }
482 +
483 + next.value = undefined;
484 + next.done = true;
485 +
486 + return next;
487 + };
488 +
489 + return next.next = next;
490 + }
491 + }
492 +
493 + // Return an iterator with no values.
494 + return { next: doneResult };
495 + }
496 + exports.values = values;
497 +
498 + function doneResult() {
499 + return { value: undefined, done: true };
500 + }
501 +
502 + Context.prototype = {
503 + constructor: Context,
504 +
505 + reset: function(skipTempReset) {
506 + this.prev = 0;
507 + this.next = 0;
508 + // Resetting context._sent for legacy support of Babel's
509 + // function.sent implementation.
510 + this.sent = this._sent = undefined;
511 + this.done = false;
512 + this.delegate = null;
513 +
514 + this.method = "next";
515 + this.arg = undefined;
516 +
517 + this.tryEntries.forEach(resetTryEntry);
518 +
519 + if (!skipTempReset) {
520 + for (var name in this) {
521 + // Not sure about the optimal order of these conditions:
522 + if (name.charAt(0) === "t" &&
523 + hasOwn.call(this, name) &&
524 + !isNaN(+name.slice(1))) {
525 + this[name] = undefined;
526 + }
527 + }
528 + }
529 + },
530 +
531 + stop: function() {
532 + this.done = true;
533 +
534 + var rootEntry = this.tryEntries[0];
535 + var rootRecord = rootEntry.completion;
536 + if (rootRecord.type === "throw") {
537 + throw rootRecord.arg;
538 + }
539 +
540 + return this.rval;
541 + },
542 +
543 + dispatchException: function(exception) {
544 + if (this.done) {
545 + throw exception;
546 + }
547 +
548 + var context = this;
549 + function handle(loc, caught) {
550 + record.type = "throw";
551 + record.arg = exception;
552 + context.next = loc;
553 +
554 + if (caught) {
555 + // If the dispatched exception was caught by a catch block,
556 + // then let that catch block handle the exception normally.
557 + context.method = "next";
558 + context.arg = undefined;
559 + }
560 +
561 + return !! caught;
562 + }
563 +
564 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
565 + var entry = this.tryEntries[i];
566 + var record = entry.completion;
567 +
568 + if (entry.tryLoc === "root") {
569 + // Exception thrown outside of any try block that could handle
570 + // it, so set the completion value of the entire function to
571 + // throw the exception.
572 + return handle("end");
573 + }
574 +
575 + if (entry.tryLoc <= this.prev) {
576 + var hasCatch = hasOwn.call(entry, "catchLoc");
577 + var hasFinally = hasOwn.call(entry, "finallyLoc");
578 +
579 + if (hasCatch && hasFinally) {
580 + if (this.prev < entry.catchLoc) {
581 + return handle(entry.catchLoc, true);
582 + } else if (this.prev < entry.finallyLoc) {
583 + return handle(entry.finallyLoc);
584 + }
585 +
586 + } else if (hasCatch) {
587 + if (this.prev < entry.catchLoc) {
588 + return handle(entry.catchLoc, true);
589 + }
590 +
591 + } else if (hasFinally) {
592 + if (this.prev < entry.finallyLoc) {
593 + return handle(entry.finallyLoc);
594 + }
595 +
596 + } else {
597 + throw new Error("try statement without catch or finally");
598 + }
599 + }
600 + }
601 + },
602 +
603 + abrupt: function(type, arg) {
604 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
605 + var entry = this.tryEntries[i];
606 + if (entry.tryLoc <= this.prev &&
607 + hasOwn.call(entry, "finallyLoc") &&
608 + this.prev < entry.finallyLoc) {
609 + var finallyEntry = entry;
610 + break;
611 + }
612 + }
613 +
614 + if (finallyEntry &&
615 + (type === "break" ||
616 + type === "continue") &&
617 + finallyEntry.tryLoc <= arg &&
618 + arg <= finallyEntry.finallyLoc) {
619 + // Ignore the finally entry if control is not jumping to a
620 + // location outside the try/catch block.
621 + finallyEntry = null;
622 + }
623 +
624 + var record = finallyEntry ? finallyEntry.completion : {};
625 + record.type = type;
626 + record.arg = arg;
627 +
628 + if (finallyEntry) {
629 + this.method = "next";
630 + this.next = finallyEntry.finallyLoc;
631 + return ContinueSentinel;
632 + }
633 +
634 + return this.complete(record);
635 + },
636 +
637 + complete: function(record, afterLoc) {
638 + if (record.type === "throw") {
639 + throw record.arg;
640 + }
641 +
642 + if (record.type === "break" ||
643 + record.type === "continue") {
644 + this.next = record.arg;
645 + } else if (record.type === "return") {
646 + this.rval = this.arg = record.arg;
647 + this.method = "return";
648 + this.next = "end";
649 + } else if (record.type === "normal" && afterLoc) {
650 + this.next = afterLoc;
651 + }
652 +
653 + return ContinueSentinel;
654 + },
655 +
656 + finish: function(finallyLoc) {
657 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
658 + var entry = this.tryEntries[i];
659 + if (entry.finallyLoc === finallyLoc) {
660 + this.complete(entry.completion, entry.afterLoc);
661 + resetTryEntry(entry);
662 + return ContinueSentinel;
663 + }
664 + }
665 + },
666 +
667 + "catch": function(tryLoc) {
668 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
669 + var entry = this.tryEntries[i];
670 + if (entry.tryLoc === tryLoc) {
671 + var record = entry.completion;
672 + if (record.type === "throw") {
673 + var thrown = record.arg;
674 + resetTryEntry(entry);
675 + }
676 + return thrown;
677 + }
678 + }
679 +
680 + // The context.catch method must only be called with a location
681 + // argument that corresponds to a known catch block.
682 + throw new Error("illegal catch attempt");
683 + },
684 +
685 + delegateYield: function(iterable, resultName, nextLoc) {
686 + this.delegate = {
687 + iterator: values(iterable),
688 + resultName: resultName,
689 + nextLoc: nextLoc
690 + };
691 +
692 + if (this.method === "next") {
693 + // Deliberately forget the last sent value so that we don't
694 + // accidentally pass it on to the delegate.
695 + this.arg = undefined;
696 + }
697 +
698 + return ContinueSentinel;
699 + }
700 + };
701 +
702 + // Regardless of whether this script is executing as a CommonJS module
703 + // or not, return the runtime object so that we can declare the variable
704 + // regeneratorRuntime in the outer scope, which allows this module to be
705 + // injected easily by `bin/regenerator --include-runtime script.js`.
706 + return exports;
707 +
708 +}(
709 + // If this script is executing as a CommonJS module, use module.exports
710 + // as the regeneratorRuntime namespace. Otherwise create a new empty
711 + // object. Either way, the resulting object will be used to initialize
712 + // the regeneratorRuntime variable at the top of this file.
713 + typeof module === "object" ? module.exports : {}
714 +));
715 +
716 +try {
717 + regeneratorRuntime = runtime;
718 +} catch (accidentalStrictMode) {
719 + // This module should not be running in strict mode, so the above
720 + // assignment should always work unless something is misconfigured. Just
721 + // in case runtime.js accidentally runs in strict mode, we can escape
722 + // strict mode using a global Function call. This could conceivably fail
723 + // if a Content Security Policy forbids using Function, but in that case
724 + // the proper solution is to fix the accidental strict mode problem. If
725 + // you've misconfigured your bundler to force strict mode and applied a
726 + // CSP to forbid Function, and you're not willing to fix either of those
727 + // problems, please detail your unique predicament in a GitHub issue.
728 + Function("r", "regeneratorRuntime = r")(runtime);
729 +}
1 +MIT License
2 +
3 +Copyright (c) Michael Jackson 2016-2018
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +# resolve-pathname [![Travis][build-badge]][build] [![npm package][npm-badge]][npm]
2 +
3 +[build-badge]: https://img.shields.io/travis/mjackson/resolve-pathname/master.svg?style=flat-square
4 +[build]: https://travis-ci.org/mjackson/resolve-pathname
5 +[npm-badge]: https://img.shields.io/npm/v/resolve-pathname.svg?style=flat-square
6 +[npm]: https://www.npmjs.org/package/resolve-pathname
7 +
8 +[resolve-pathname](https://www.npmjs.com/package/resolve-pathname) resolves URL pathnames identical to the way browsers resolve the pathname of an `<a href>` value. The goals are:
9 +
10 +- 100% compatibility with browser pathname resolution
11 +- Pure JavaScript implementation (no DOM dependency)
12 +
13 +## Installation
14 +
15 +Using [npm](https://www.npmjs.com/):
16 +
17 + $ npm install --save resolve-pathname
18 +
19 +Then, use as you would anything else:
20 +
21 +```js
22 +// using ES6 modules
23 +import resolvePathname from 'resolve-pathname';
24 +
25 +// using CommonJS modules
26 +var resolvePathname = require('resolve-pathname');
27 +```
28 +
29 +The UMD build is also available on [unpkg](https://unpkg.com):
30 +
31 +```html
32 +<script src="https://unpkg.com/resolve-pathname"></script>
33 +```
34 +
35 +You can find the library on `window.resolvePathname`.
36 +
37 +## Usage
38 +
39 +```js
40 +import resolvePathname from 'resolve-pathname';
41 +
42 +// Simply pass the pathname you'd like to resolve. Second
43 +// argument is the path we're coming from, or the current
44 +// pathname. It defaults to "/".
45 +resolvePathname('about', '/company/jobs'); // /company/about
46 +resolvePathname('../jobs', '/company/team/ceo'); // /company/jobs
47 +resolvePathname('about'); // /about
48 +resolvePathname('/about'); // /about
49 +
50 +// Index paths (with a trailing slash) are also supported and
51 +// work the same way as browsers.
52 +resolvePathname('about', '/company/info/'); // /company/info/about
53 +
54 +// In browsers, it's easy to resolve a URL pathname relative to
55 +// the current page. Just use window.location! e.g. if
56 +// window.location.pathname == '/company/team/ceo' then
57 +resolvePathname('cto', window.location.pathname); // /company/team/cto
58 +resolvePathname('../jobs', window.location.pathname); // /company/jobs
59 +```
60 +
61 +## Prior Work
62 +
63 +- [url.resolve](https://nodejs.org/api/url.html#url_url_resolve_from_to) - node's `url.resolve` implementation for full URLs
64 +- [resolve-url](https://www.npmjs.com/package/resolve-url) - A DOM-dependent implementation of the same algorithm
1 +'use strict';
2 +
3 +function isAbsolute(pathname) {
4 + return pathname.charAt(0) === '/';
5 +}
6 +
7 +// About 1.5x faster than the two-arg version of Array#splice()
8 +function spliceOne(list, index) {
9 + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
10 + list[i] = list[k];
11 + }
12 +
13 + list.pop();
14 +}
15 +
16 +// This implementation is based heavily on node's url.parse
17 +function resolvePathname(to, from) {
18 + if (from === undefined) from = '';
19 +
20 + var toParts = (to && to.split('/')) || [];
21 + var fromParts = (from && from.split('/')) || [];
22 +
23 + var isToAbs = to && isAbsolute(to);
24 + var isFromAbs = from && isAbsolute(from);
25 + var mustEndAbs = isToAbs || isFromAbs;
26 +
27 + if (to && isAbsolute(to)) {
28 + // to is absolute
29 + fromParts = toParts;
30 + } else if (toParts.length) {
31 + // to is relative, drop the filename
32 + fromParts.pop();
33 + fromParts = fromParts.concat(toParts);
34 + }
35 +
36 + if (!fromParts.length) return '/';
37 +
38 + var hasTrailingSlash;
39 + if (fromParts.length) {
40 + var last = fromParts[fromParts.length - 1];
41 + hasTrailingSlash = last === '.' || last === '..' || last === '';
42 + } else {
43 + hasTrailingSlash = false;
44 + }
45 +
46 + var up = 0;
47 + for (var i = fromParts.length; i >= 0; i--) {
48 + var part = fromParts[i];
49 +
50 + if (part === '.') {
51 + spliceOne(fromParts, i);
52 + } else if (part === '..') {
53 + spliceOne(fromParts, i);
54 + up++;
55 + } else if (up) {
56 + spliceOne(fromParts, i);
57 + up--;
58 + }
59 + }
60 +
61 + if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
62 +
63 + if (
64 + mustEndAbs &&
65 + fromParts[0] !== '' &&
66 + (!fromParts[0] || !isAbsolute(fromParts[0]))
67 + )
68 + fromParts.unshift('');
69 +
70 + var result = fromParts.join('/');
71 +
72 + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
73 +
74 + return result;
75 +}
76 +
77 +module.exports = resolvePathname;
1 +"use strict";function isAbsolute(e){return"/"===e.charAt(0)}function spliceOne(e,t){for(var s=t,n=s+1,i=e.length;n<i;s+=1,n+=1)e[s]=e[n];e.pop()}function resolvePathname(e,t){void 0===t&&(t="");var s,n=e&&e.split("/")||[],i=t&&t.split("/")||[],l=e&&isAbsolute(e),r=t&&isAbsolute(t),o=l||r;if(e&&isAbsolute(e)?i=n:n.length&&(i.pop(),i=i.concat(n)),!i.length)return"/";if(i.length){var u=i[i.length-1];s="."===u||".."===u||""===u}else s=!1;for(var a=0,c=i.length;0<=c;c--){var f=i[c];"."===f?spliceOne(i,c):".."===f?(spliceOne(i,c),a++):a&&(spliceOne(i,c),a--)}if(!o)for(;a--;a)i.unshift("..");!o||""===i[0]||i[0]&&isAbsolute(i[0])||i.unshift("");var h=i.join("/");return s&&"/"!==h.substr(-1)&&(h+="/"),h}module.exports=resolvePathname;
1 +function isAbsolute(pathname) {
2 + return pathname.charAt(0) === '/';
3 +}
4 +
5 +// About 1.5x faster than the two-arg version of Array#splice()
6 +function spliceOne(list, index) {
7 + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
8 + list[i] = list[k];
9 + }
10 +
11 + list.pop();
12 +}
13 +
14 +// This implementation is based heavily on node's url.parse
15 +function resolvePathname(to, from) {
16 + if (from === undefined) from = '';
17 +
18 + var toParts = (to && to.split('/')) || [];
19 + var fromParts = (from && from.split('/')) || [];
20 +
21 + var isToAbs = to && isAbsolute(to);
22 + var isFromAbs = from && isAbsolute(from);
23 + var mustEndAbs = isToAbs || isFromAbs;
24 +
25 + if (to && isAbsolute(to)) {
26 + // to is absolute
27 + fromParts = toParts;
28 + } else if (toParts.length) {
29 + // to is relative, drop the filename
30 + fromParts.pop();
31 + fromParts = fromParts.concat(toParts);
32 + }
33 +
34 + if (!fromParts.length) return '/';
35 +
36 + var hasTrailingSlash;
37 + if (fromParts.length) {
38 + var last = fromParts[fromParts.length - 1];
39 + hasTrailingSlash = last === '.' || last === '..' || last === '';
40 + } else {
41 + hasTrailingSlash = false;
42 + }
43 +
44 + var up = 0;
45 + for (var i = fromParts.length; i >= 0; i--) {
46 + var part = fromParts[i];
47 +
48 + if (part === '.') {
49 + spliceOne(fromParts, i);
50 + } else if (part === '..') {
51 + spliceOne(fromParts, i);
52 + up++;
53 + } else if (up) {
54 + spliceOne(fromParts, i);
55 + up--;
56 + }
57 + }
58 +
59 + if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
60 +
61 + if (
62 + mustEndAbs &&
63 + fromParts[0] !== '' &&
64 + (!fromParts[0] || !isAbsolute(fromParts[0]))
65 + )
66 + fromParts.unshift('');
67 +
68 + var result = fromParts.join('/');
69 +
70 + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
71 +
72 + return result;
73 +}
74 +
75 +export default resolvePathname;
1 +'use strict';
2 +
3 +if (process.env.NODE_ENV === 'production') {
4 + module.exports = require('./cjs/resolve-pathname.min.js');
5 +} else {
6 + module.exports = require('./cjs/resolve-pathname.js');
7 +}
1 +{
2 + "_from": "resolve-pathname@^3.0.0",
3 + "_id": "resolve-pathname@3.0.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==",
6 + "_location": "/resolve-pathname",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "resolve-pathname@^3.0.0",
12 + "name": "resolve-pathname",
13 + "escapedName": "resolve-pathname",
14 + "rawSpec": "^3.0.0",
15 + "saveSpec": null,
16 + "fetchSpec": "^3.0.0"
17 + },
18 + "_requiredBy": [
19 + "/history"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
22 + "_shasum": "99d02224d3cf263689becbb393bc560313025dcd",
23 + "_spec": "resolve-pathname@^3.0.0",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\history",
25 + "author": {
26 + "name": "Michael Jackson"
27 + },
28 + "bugs": {
29 + "url": "https://github.com/mjackson/resolve-pathname/issues"
30 + },
31 + "bundleDependencies": false,
32 + "deprecated": false,
33 + "description": "Resolve URL pathnames using JavaScript",
34 + "devDependencies": {
35 + "@babel/core": "^7.1.6",
36 + "@babel/preset-env": "^7.1.6",
37 + "babel-core": "^7.0.0-bridge.0",
38 + "babel-eslint": "^10.0.1",
39 + "babel-jest": "^23.6.0",
40 + "eslint": "^5.9.0",
41 + "jest": "^23.6.0",
42 + "rollup": "^0.67.3",
43 + "rollup-plugin-replace": "^2.1.0",
44 + "rollup-plugin-size-snapshot": "^0.7.0",
45 + "rollup-plugin-uglify": "^6.0.0"
46 + },
47 + "files": [
48 + "cjs",
49 + "esm",
50 + "index.js",
51 + "umd"
52 + ],
53 + "homepage": "https://github.com/mjackson/resolve-pathname#readme",
54 + "license": "MIT",
55 + "main": "index.js",
56 + "module": "esm/resolve-pathname.js",
57 + "name": "resolve-pathname",
58 + "repository": {
59 + "type": "git",
60 + "url": "git+https://github.com/mjackson/resolve-pathname.git"
61 + },
62 + "scripts": {
63 + "build": "rollup -c",
64 + "clean": "git clean -fdX .",
65 + "lint": "eslint modules",
66 + "prepublishOnly": "npm run build",
67 + "test": "jest"
68 + },
69 + "unpkg": "umd/resolve-pathname.js",
70 + "version": "3.0.0"
71 +}
1 +(function (global, factory) {
2 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 + typeof define === 'function' && define.amd ? define(factory) :
4 + (global.resolvePathname = factory());
5 +}(this, (function () { 'use strict';
6 +
7 + function isAbsolute(pathname) {
8 + return pathname.charAt(0) === '/';
9 + }
10 +
11 + // About 1.5x faster than the two-arg version of Array#splice()
12 + function spliceOne(list, index) {
13 + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
14 + list[i] = list[k];
15 + }
16 +
17 + list.pop();
18 + }
19 +
20 + // This implementation is based heavily on node's url.parse
21 + function resolvePathname(to, from) {
22 + if (from === undefined) from = '';
23 +
24 + var toParts = (to && to.split('/')) || [];
25 + var fromParts = (from && from.split('/')) || [];
26 +
27 + var isToAbs = to && isAbsolute(to);
28 + var isFromAbs = from && isAbsolute(from);
29 + var mustEndAbs = isToAbs || isFromAbs;
30 +
31 + if (to && isAbsolute(to)) {
32 + // to is absolute
33 + fromParts = toParts;
34 + } else if (toParts.length) {
35 + // to is relative, drop the filename
36 + fromParts.pop();
37 + fromParts = fromParts.concat(toParts);
38 + }
39 +
40 + if (!fromParts.length) return '/';
41 +
42 + var hasTrailingSlash;
43 + if (fromParts.length) {
44 + var last = fromParts[fromParts.length - 1];
45 + hasTrailingSlash = last === '.' || last === '..' || last === '';
46 + } else {
47 + hasTrailingSlash = false;
48 + }
49 +
50 + var up = 0;
51 + for (var i = fromParts.length; i >= 0; i--) {
52 + var part = fromParts[i];
53 +
54 + if (part === '.') {
55 + spliceOne(fromParts, i);
56 + } else if (part === '..') {
57 + spliceOne(fromParts, i);
58 + up++;
59 + } else if (up) {
60 + spliceOne(fromParts, i);
61 + up--;
62 + }
63 + }
64 +
65 + if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
66 +
67 + if (
68 + mustEndAbs &&
69 + fromParts[0] !== '' &&
70 + (!fromParts[0] || !isAbsolute(fromParts[0]))
71 + )
72 + fromParts.unshift('');
73 +
74 + var result = fromParts.join('/');
75 +
76 + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
77 +
78 + return result;
79 + }
80 +
81 + return resolvePathname;
82 +
83 +})));
1 +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.resolvePathname=e()}(this,function(){"use strict";function p(t){return"/"===t.charAt(0)}function d(t,e){for(var n=e,o=n+1,r=t.length;o<r;n+=1,o+=1)t[n]=t[o];t.pop()}return function(t,e){void 0===e&&(e="");var n,o=t&&t.split("/")||[],r=e&&e.split("/")||[],f=t&&p(t),i=e&&p(e),u=f||i;if(t&&p(t)?r=o:o.length&&(r.pop(),r=r.concat(o)),!r.length)return"/";if(r.length){var s=r[r.length-1];n="."===s||".."===s||""===s}else n=!1;for(var l=0,a=r.length;0<=a;a--){var c=r[a];"."===c?d(r,a):".."===c?(d(r,a),l++):l&&(d(r,a),l--)}if(!u)for(;l--;l)r.unshift("..");!u||""===r[0]||r[0]&&p(r[0])||r.unshift("");var h=r.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h}});
1 +MIT License
2 +
3 +Copyright (c) 2019 Alexander Reardon
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
...\ No newline at end of file ...\ No newline at end of file
1 +# tiny-invariant 🔬💥
2 +
3 +[![Build Status](https://travis-ci.org/alexreardon/tiny-invariant.svg?branch=master)](https://travis-ci.org/alexreardon/tiny-invariant)
4 +[![npm](https://img.shields.io/npm/v/tiny-invariant.svg)](https://www.npmjs.com/package/tiny-invariant) [![dependencies](https://david-dm.org/alexreardon/tiny-invariant.svg)](https://david-dm.org/alexreardon/tiny-invariant)
5 +![types](https://img.shields.io/badge/types-typescript%20%7C%20flow-blueviolet)
6 +[![minzip](https://img.shields.io/bundlephobia/minzip/tiny-invariant.svg)](https://www.npmjs.com/package/tiny-invariant)
7 +[![Downloads per month](https://img.shields.io/npm/dm/tiny-invariant.svg)](https://www.npmjs.com/package/tiny-invariant)
8 +
9 +A tiny [`invariant`](https://www.npmjs.com/package/invariant) alternative.
10 +
11 +## What is `invariant`?
12 +
13 +An `invariant` function takes a value, and if the value is [falsy](https://github.com/getify/You-Dont-Know-JS/blob/bdbe570600d4e1107d0b131787903ca1c9ec8140/up%20%26%20going/ch2.md#truthy--falsy) then the `invariant` function will throw. If the value is [truthy](https://github.com/getify/You-Dont-Know-JS/blob/bdbe570600d4e1107d0b131787903ca1c9ec8140/up%20%26%20going/ch2.md#truthy--falsy), then the function will not throw.
14 +
15 +```js
16 +import invariant from 'tiny-invariant';
17 +
18 +invariant(truthyValue, 'This should not throw!');
19 +
20 +invariant(falsyValue, 'This will throw!');
21 +// Error('Invariant violation: This will throw!');
22 +```
23 +
24 +## Why `tiny-invariant`?
25 +
26 +The [`library: invariant`](https://www.npmjs.com/package/invariant) supports passing in arguments to the `invariant` function in a sprintf style `(condition, format, a, b, c, d, e, f)`. It has internal logic to execute the sprintf substitutions. The sprintf logic is not removed in production builds. `tiny-invariant` has dropped all of the sprintf logic. `tiny-invariant` allows you to pass a single string message. With [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) there is really no need for a custom message formatter to be built into the library. If you need a multi part message you can just do this: `invariant(condition, 'Hello, ${name} - how are you today?')`
27 +
28 +## Type narrowing
29 +
30 +`tiny-invariant` is useful for correctly narrowing types for `flow` and `typescript`
31 +
32 +```ts
33 +const value: Person | null = { name: 'Alex' }; // type of value == 'Person | null'
34 +invariant(value, 'Expected value to be a person');
35 +// type of value has been narrowed to 'Person'
36 +```
37 +
38 +## API: `(condition: any, message?: string) => void`
39 +
40 +- `condition` is required and can be anything
41 +- `message` is an optional string
42 +
43 +## Installation
44 +
45 +```bash
46 +# yarn
47 +yarn add tiny-invariant
48 +
49 +# npm
50 +npm add tiny-invariant --save
51 +```
52 +
53 +## Dropping your `message` for kb savings!
54 +
55 +Big idea: you will want your compiler to convert this code:
56 +
57 +```js
58 +invariant(condition, 'My cool message that takes up a lot of kbs');
59 +```
60 +
61 +Into this:
62 +
63 +```js
64 +if (!condition) {
65 + if ('production' !== process.env.NODE_ENV) {
66 + invariant(false, 'My cool message that takes up a lot of kbs');
67 + } else {
68 + invariant(false);
69 + }
70 +}
71 +```
72 +
73 +- **Babel**: recommend [`babel-plugin-dev-expression`](https://www.npmjs.com/package/babel-plugin-dev-expression)
74 +- **TypeScript**: recommend [`tsdx`](https://github.com/jaredpalmer/tsdx#invariant) (or you can run `babel-plugin-dev-expression` after TypeScript compiling)
75 +
76 +Your bundler can then drop the code in the `"production" !== process.env.NODE_ENV` block for your production builds to end up with this:
77 +
78 +```js
79 +if (!condition) {
80 + invariant(false);
81 +}
82 +```
83 +
84 +- rollup: use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace) and set `NODE_ENV` to `production` and then `rollup` will treeshake out the unused code
85 +- Webpack: [instructions](https://webpack.js.org/guides/production/#specify-the-mode)
86 +
87 +## Builds
88 +
89 +- We have a `es` (EcmaScript module) build (because you _know_ you want to deduplicate this super heavy library)
90 +- We have a `cjs` (CommonJS) build
91 +- We have a `umd` (Universal module definition) build in case you needed it
92 +
93 +We expect `process.env.NODE_ENV` to be available at module compilation. We cache this value
94 +
95 +## That's it!
96 +
97 +🤘
1 +'use strict';
2 +
3 +Object.defineProperty(exports, "__esModule", { value: true });
4 +var isProduction = process.env.NODE_ENV === 'production';
5 +var prefix = 'Invariant failed';
6 +function invariant(condition, message) {
7 + if (condition) {
8 + return;
9 + }
10 + if (isProduction) {
11 + throw new Error(prefix);
12 + }
13 + throw new Error(prefix + ": " + (message || ''));
14 +}
15 +exports.default = invariant;
1 +export default function invariant(condition: any, message?: string): asserts condition;
1 +var isProduction = process.env.NODE_ENV === 'production';
2 +var prefix = 'Invariant failed';
3 +function invariant(condition, message) {
4 + if (condition) {
5 + return;
6 + }
7 + if (isProduction) {
8 + throw new Error(prefix);
9 + }
10 + throw new Error(prefix + ": " + (message || ''));
11 +}
12 +
13 +export default invariant;
1 +(function (factory) {
2 + typeof define === 'function' && define.amd ? define(factory) :
3 + factory();
4 +}((function () { 'use strict';
5 +
6 + Object.defineProperty(exports, "__esModule", { value: true });
7 + var isProduction = process.env.NODE_ENV === 'production';
8 + var prefix = 'Invariant failed';
9 + function invariant(condition, message) {
10 + if (condition) {
11 + return;
12 + }
13 + if (isProduction) {
14 + throw new Error(prefix);
15 + }
16 + throw new Error(prefix + ": " + (message || ''));
17 + }
18 + exports.default = invariant;
19 +
20 +})));
1 +!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.default=function(e,n){if(!e)throw new Error("Invariant failed")}}));
1 +{
2 + "_from": "tiny-invariant@^1.0.2",
3 + "_id": "tiny-invariant@1.1.0",
4 + "_inBundle": false,
5 + "_integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==",
6 + "_location": "/tiny-invariant",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "tiny-invariant@^1.0.2",
12 + "name": "tiny-invariant",
13 + "escapedName": "tiny-invariant",
14 + "rawSpec": "^1.0.2",
15 + "saveSpec": null,
16 + "fetchSpec": "^1.0.2"
17 + },
18 + "_requiredBy": [
19 + "/history",
20 + "/react-router",
21 + "/react-router-dom"
22 + ],
23 + "_resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz",
24 + "_shasum": "634c5f8efdc27714b7f386c35e6760991d230875",
25 + "_spec": "tiny-invariant@^1.0.2",
26 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router-dom",
27 + "author": {
28 + "name": "Alex Reardon",
29 + "email": "alexreardon@gmail.com"
30 + },
31 + "bugs": {
32 + "url": "https://github.com/alexreardon/tiny-invariant/issues"
33 + },
34 + "bundleDependencies": false,
35 + "deprecated": false,
36 + "description": "A tiny invariant function",
37 + "devDependencies": {
38 + "@rollup/plugin-replace": "^2.3.0",
39 + "@rollup/plugin-typescript": "^3.0.0",
40 + "@types/jest": "^25.1.0",
41 + "jest": "^25.1.0",
42 + "prettier": "^1.19.1",
43 + "rimraf": "^3.0.1",
44 + "rollup": "^1.30.1",
45 + "rollup-plugin-terser": "^5.2.0",
46 + "ts-expect": "^1.1.0",
47 + "ts-jest": "^25.0.0",
48 + "tslib": "^1.10.0",
49 + "typescript": "^3.7.5"
50 + },
51 + "files": [
52 + "/dist",
53 + "/src"
54 + ],
55 + "homepage": "https://github.com/alexreardon/tiny-invariant#readme",
56 + "keywords": [
57 + "invariant",
58 + "error"
59 + ],
60 + "license": "MIT",
61 + "main": "dist/tiny-invariant.cjs.js",
62 + "module": "dist/tiny-invariant.esm.js",
63 + "name": "tiny-invariant",
64 + "repository": {
65 + "type": "git",
66 + "url": "git+https://github.com/alexreardon/tiny-invariant.git"
67 + },
68 + "scripts": {
69 + "build": "yarn build:clean && yarn build:dist && yarn build:typescript",
70 + "build:clean": "rimraf dist",
71 + "build:dist": "yarn rollup --config rollup.config.js",
72 + "build:flow": "cp src/tiny-invariant.js.flow dist/tiny-invariant.cjs.js.flow",
73 + "build:typescript": "tsc ./src/tiny-invariant.ts --emitDeclarationOnly --declaration --outDir ./dist",
74 + "lint": "yarn prettier:check",
75 + "prepublishOnly": "yarn build",
76 + "prettier:check": "yarn prettier --write src/** test/**",
77 + "prettier:write": "yarn prettier --debug-check src/** test/**",
78 + "test": "yarn jest",
79 + "typecheck": "yarn tsc --noEmit src/*.ts test/*.ts",
80 + "validate": "yarn lint && yarn typecheck"
81 + },
82 + "sideEffects": false,
83 + "types": "dist/tiny-invariant.d.ts",
84 + "version": "1.1.0"
85 +}
1 +// @flow
2 +// This file is not actually executed
3 +// It is just used by flow for typing
4 +
5 +const prefix: string = 'Invariant failed';
6 +
7 +export default function invariant(condition: mixed, message?: string) {
8 + if (condition) {
9 + return;
10 + }
11 + throw new Error(`${prefix}: ${message || ''}`);
12 +}
1 +// @flow
2 +const isProduction: boolean = process.env.NODE_ENV === 'production';
3 +const prefix: string = 'Invariant failed';
4 +
5 +// Throw an error if the condition fails
6 +// Strip out error messages for production
7 +// > Not providing an inline default argument for message as the result is smaller
8 +export default function invariant(
9 + condition: any,
10 + message?: string,
11 +): asserts condition {
12 + if (condition) {
13 + return;
14 + }
15 + // Condition not passed
16 +
17 + // In production we strip the message but still throw
18 + if (isProduction) {
19 + throw new Error(prefix);
20 + }
21 +
22 + // When not in production we allow the message to pass through
23 + // *This block will be removed in production builds*
24 + throw new Error(`${prefix}: ${message || ''}`);
25 +}
1 +MIT License
2 +
3 +Copyright (c) 2019 Alexander Reardon
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
...\ No newline at end of file ...\ No newline at end of file
1 +# tiny-warning 🔬⚠️
2 +
3 +[![Build Status](https://travis-ci.org/alexreardon/tiny-warning.svg?branch=master)](https://travis-ci.org/alexreardon/tiny-warning)
4 +[![npm](https://img.shields.io/npm/v/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning) [![Downloads per month](https://img.shields.io/npm/dm/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning) [![dependencies](https://david-dm.org/alexreardon/tiny-warning.svg)](https://david-dm.org/alexreardon/tiny-warning)
5 +[![min](https://img.shields.io/bundlephobia/min/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning)
6 +[![minzip](https://img.shields.io/bundlephobia/minzip/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning)
7 +
8 +A tiny [`warning`](https://www.npmjs.com/package/warning) alternative.
9 +
10 +```js
11 +import warning from 'tiny-warning';
12 +
13 +warning(truthyValue, 'This should not log a warning');
14 +
15 +warning(falsyValue, 'This should log a warning');
16 +// console.warn('Warning: This should log a warning');
17 +```
18 +
19 +## API: `(condition: mixed, message: string) => void`
20 +
21 +- `condition` is required and can be anything
22 +- `message` is an required string that will be passed onto `console.warn`
23 +
24 +## Why `tiny-warning`?
25 +
26 +The [`library: warning`](https://www.npmjs.com/package/warning) supports passing in arguments to the `warning` function in a sprintf style `(condition, format, a, b, c, d, e, f)`. It has internal logic to execute the sprintf substitutions. `tiny-warning` has dropped all of the sprintf logic. `tiny-warning` allows you to pass a single string message. With [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) there is really no need for a custom message formatter to be built into the library. If you need a multi part message you can just do this: `warning(condition, 'Hello, ${name} - how are you today?')`
27 +
28 +## Dropping your `warning` for kb savings!
29 +
30 +We recommend using [`babel-plugin-dev-expression`](https://www.npmjs.com/package/babel-plugin-dev-expression) to remove `warning` calls from your production build. This saves you kb's as well as avoids logging warnings to the console for production.
31 +
32 +What it does it turn your code that looks like this:
33 +
34 +```js
35 +warning(condition, 'My cool message that takes up a lot of kbs');
36 +```
37 +
38 +Into this
39 +
40 +```js
41 +if ('production' !== process.env.NODE_ENV) {
42 + warning(condition, 'My cool message that takes up a lot of kbs');
43 +}
44 +```
45 +
46 +Your bundler can then drop the code in the `"production" !== process.env.NODE_ENV` block for your production builds
47 +
48 +Final result:
49 +
50 +```js
51 +// nothing to see here! 👍
52 +```
53 +
54 +> For `rollup` use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace) and set `NODE_ENV` to `production` and then `rollup` will treeshake out the unused code
55 +>
56 +> [`Webpack` instructions](https://webpack.js.org/guides/production/#specify-the-mode)
57 +
58 +## Builds
59 +
60 +- We have a `es` (EcmaScript module) build (because you _know_ you want to deduplicate this super heavy library)
61 +- We have a `cjs` (CommonJS) build
62 +- We have a `umd` (Universal module definition) build in case you needed it
63 +
64 +We expect `process.env.NODE_ENV` to be available at module compilation. We cache this value
65 +
66 +## That's it!
67 +
68 +🤘
1 +'use strict';
2 +
3 +var isProduction = process.env.NODE_ENV === 'production';
4 +function warning(condition, message) {
5 + if (!isProduction) {
6 + if (condition) {
7 + return;
8 + }
9 +
10 + var text = "Warning: " + message;
11 +
12 + if (typeof console !== 'undefined') {
13 + console.warn(text);
14 + }
15 +
16 + try {
17 + throw Error(text);
18 + } catch (x) {}
19 + }
20 +}
21 +
22 +module.exports = warning;
1 +// @flow
2 +
3 +export * from '../src';
1 +var isProduction = process.env.NODE_ENV === 'production';
2 +function warning(condition, message) {
3 + if (!isProduction) {
4 + if (condition) {
5 + return;
6 + }
7 +
8 + var text = "Warning: " + message;
9 +
10 + if (typeof console !== 'undefined') {
11 + console.warn(text);
12 + }
13 +
14 + try {
15 + throw Error(text);
16 + } catch (x) {}
17 + }
18 +}
19 +
20 +export default warning;
1 +(function (global, factory) {
2 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 + typeof define === 'function' && define.amd ? define(factory) :
4 + (global = global || self, global.warning = factory());
5 +}(this, function () { 'use strict';
6 +
7 + function warning(condition, message) {
8 + {
9 + if (condition) {
10 + return;
11 + }
12 +
13 + var text = "Warning: " + message;
14 +
15 + if (typeof console !== 'undefined') {
16 + console.warn(text);
17 + }
18 +
19 + try {
20 + throw Error(text);
21 + } catch (x) {}
22 + }
23 + }
24 +
25 + return warning;
26 +
27 +}));
1 +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).warning=n()}(this,function(){"use strict";return function(e,n){}});
1 +{
2 + "_from": "tiny-warning@^1.0.0",
3 + "_id": "tiny-warning@1.0.3",
4 + "_inBundle": false,
5 + "_integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
6 + "_location": "/tiny-warning",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "tiny-warning@^1.0.0",
12 + "name": "tiny-warning",
13 + "escapedName": "tiny-warning",
14 + "rawSpec": "^1.0.0",
15 + "saveSpec": null,
16 + "fetchSpec": "^1.0.0"
17 + },
18 + "_requiredBy": [
19 + "/history",
20 + "/mini-create-react-context",
21 + "/react-router",
22 + "/react-router-dom"
23 + ],
24 + "_resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
25 + "_shasum": "94a30db453df4c643d0fd566060d60a875d84754",
26 + "_spec": "tiny-warning@^1.0.0",
27 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\react-router-dom",
28 + "author": {
29 + "name": "Alex Reardon",
30 + "email": "alexreardon@gmail.com"
31 + },
32 + "bugs": {
33 + "url": "https://github.com/alexreardon/tiny-warning/issues"
34 + },
35 + "bundleDependencies": false,
36 + "deprecated": false,
37 + "description": "A tiny warning function",
38 + "devDependencies": {
39 + "@babel/core": "^7.5.0",
40 + "@babel/preset-env": "^7.5.0",
41 + "@babel/preset-flow": "^7.0.0",
42 + "babel-core": "7.0.0-bridge.0",
43 + "babel-jest": "^24.8.0",
44 + "flow-bin": "0.102.0",
45 + "jest": "^24.8.0",
46 + "prettier": "1.18.2",
47 + "regenerator-runtime": "^0.13.2",
48 + "rimraf": "^2.6.3",
49 + "rollup": "^1.16.6",
50 + "rollup-plugin-babel": "^4.3.3",
51 + "rollup-plugin-replace": "^2.2.0",
52 + "rollup-plugin-uglify": "^6.0.2"
53 + },
54 + "files": [
55 + "/dist",
56 + "/src"
57 + ],
58 + "homepage": "https://github.com/alexreardon/tiny-warning#readme",
59 + "keywords": [
60 + "warning",
61 + "warn"
62 + ],
63 + "license": "MIT",
64 + "main": "dist/tiny-warning.cjs.js",
65 + "module": "dist/tiny-warning.esm.js",
66 + "name": "tiny-warning",
67 + "repository": {
68 + "type": "git",
69 + "url": "git+https://github.com/alexreardon/tiny-warning.git"
70 + },
71 + "scripts": {
72 + "build": "yarn build:clean && yarn build:dist && yarn build:flow",
73 + "build:clean": "rimraf dist",
74 + "build:dist": "yarn rollup --config rollup.config.js",
75 + "build:flow": "echo \"// @flow\n\nexport * from '../src';\" > dist/tiny-warning.cjs.js.flow",
76 + "lint": "yarn prettier --debug-check src/** test/**",
77 + "prepublishOnly": "yarn build",
78 + "test": "yarn jest",
79 + "typecheck": "yarn flow",
80 + "validate": "yarn lint && yarn flow"
81 + },
82 + "sideEffects": false,
83 + "types": "src/index.d.ts",
84 + "version": "1.0.3"
85 +}
1 +export default function warning(condition: any, message: string): void
1 +// @flow
2 +const isProduction: boolean = process.env.NODE_ENV === 'production';
3 +
4 +export default function warning(condition: mixed, message: string): void {
5 + // don't do anything in production
6 + // wrapping in production check for better dead code elimination
7 + if (!isProduction) {
8 + // condition passed: do not log
9 + if (condition) {
10 + return;
11 + }
12 +
13 + // Condition not passed
14 + const text: string = `Warning: ${message}`;
15 +
16 + // check console for IE9 support which provides console
17 + // only with open devtools
18 + if (typeof console !== 'undefined') {
19 + console.warn(text);
20 + }
21 +
22 + // Throwing an error and catching it immediately
23 + // to improve debugging
24 + // A consumer can use 'pause on caught exceptions'
25 + // https://github.com/facebook/react/issues/4216
26 + try {
27 + throw Error(text);
28 + } catch (x) {}
29 + }
30 +}
1 +MIT License
2 +
3 +Copyright (c) Michael Jackson 2016-2018
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in all
13 +copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 +SOFTWARE.
1 +# value-equal [![Travis][build-badge]][build] [![npm package][npm-badge]][npm]
2 +
3 +[build-badge]: https://img.shields.io/travis/mjackson/value-equal/master.svg?style=flat-square
4 +[build]: https://travis-ci.org/mjackson/value-equal
5 +[npm-badge]: https://img.shields.io/npm/v/value-equal.svg?style=flat-square
6 +[npm]: https://www.npmjs.org/package/value-equal
7 +
8 +[`value-equal`](https://www.npmjs.com/package/value-equal) determines if two JavaScript values are equal using [`Object.prototype.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf).
9 +
10 +In many instances when I'm checking for object equality, what I really want to know is if their **values** are equal. This is good for:
11 +
12 +- Stuff you keep in `localStorage`
13 +- `window.history.state` values
14 +- Query strings
15 +
16 +## Installation
17 +
18 +Using [npm](https://www.npmjs.com/):
19 +
20 + $ npm install --save value-equal
21 +
22 +Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
23 +
24 +```js
25 +// using ES6 modules
26 +import valueEqual from 'value-equal';
27 +
28 +// using CommonJS modules
29 +var valueEqual = require('value-equal');
30 +```
31 +
32 +The UMD build is also available on [unpkg](https://unpkg.com):
33 +
34 +```html
35 +<script src="https://unpkg.com/value-equal"></script>
36 +```
37 +
38 +You can find the library on `window.valueEqual`.
39 +
40 +## Usage
41 +
42 +```js
43 +valueEqual(1, 1); // true
44 +valueEqual('asdf', 'asdf'); // true
45 +valueEqual('asdf', new String('asdf')); // true
46 +valueEqual(true, true); // true
47 +valueEqual(true, false); // false
48 +valueEqual({ a: 'a' }, { a: 'a' }); // true
49 +valueEqual({ a: 'a' }, { a: 'b' }); // false
50 +valueEqual([1, 2, 3], [1, 2, 3]); // true
51 +valueEqual([1, 2, 3], [2, 3, 4]); // false
52 +```
53 +
54 +That's it. Enjoy!
1 +'use strict';
2 +
3 +function valueOf(obj) {
4 + return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
5 +}
6 +
7 +function valueEqual(a, b) {
8 + // Test for strict equality first.
9 + if (a === b) return true;
10 +
11 + // Otherwise, if either of them == null they are not equal.
12 + if (a == null || b == null) return false;
13 +
14 + if (Array.isArray(a)) {
15 + return (
16 + Array.isArray(b) &&
17 + a.length === b.length &&
18 + a.every(function(item, index) {
19 + return valueEqual(item, b[index]);
20 + })
21 + );
22 + }
23 +
24 + if (typeof a === 'object' || typeof b === 'object') {
25 + var aValue = valueOf(a);
26 + var bValue = valueOf(b);
27 +
28 + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
29 +
30 + return Object.keys(Object.assign({}, a, b)).every(function(key) {
31 + return valueEqual(a[key], b[key]);
32 + });
33 + }
34 +
35 + return false;
36 +}
37 +
38 +module.exports = valueEqual;
1 +"use strict";function valueOf(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}function valueEqual(u,r){if(u===r)return!0;if(null==u||null==r)return!1;if(Array.isArray(u))return Array.isArray(r)&&u.length===r.length&&u.every(function(e,u){return valueEqual(e,r[u])});if("object"!=typeof u&&"object"!=typeof r)return!1;var e=valueOf(u),t=valueOf(r);return e!==u||t!==r?valueEqual(e,t):Object.keys(Object.assign({},u,r)).every(function(e){return valueEqual(u[e],r[e])})}module.exports=valueEqual;
1 +function valueOf(obj) {
2 + return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
3 +}
4 +
5 +function valueEqual(a, b) {
6 + // Test for strict equality first.
7 + if (a === b) return true;
8 +
9 + // Otherwise, if either of them == null they are not equal.
10 + if (a == null || b == null) return false;
11 +
12 + if (Array.isArray(a)) {
13 + return (
14 + Array.isArray(b) &&
15 + a.length === b.length &&
16 + a.every(function(item, index) {
17 + return valueEqual(item, b[index]);
18 + })
19 + );
20 + }
21 +
22 + if (typeof a === 'object' || typeof b === 'object') {
23 + var aValue = valueOf(a);
24 + var bValue = valueOf(b);
25 +
26 + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
27 +
28 + return Object.keys(Object.assign({}, a, b)).every(function(key) {
29 + return valueEqual(a[key], b[key]);
30 + });
31 + }
32 +
33 + return false;
34 +}
35 +
36 +export default valueEqual;
1 +'use strict';
2 +
3 +if (process.env.NODE_ENV === 'production') {
4 + module.exports = require('./cjs/value-equal.min.js');
5 +} else {
6 + module.exports = require('./cjs/value-equal.js');
7 +}
1 +{
2 + "_from": "value-equal@^1.0.1",
3 + "_id": "value-equal@1.0.1",
4 + "_inBundle": false,
5 + "_integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==",
6 + "_location": "/value-equal",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "value-equal@^1.0.1",
12 + "name": "value-equal",
13 + "escapedName": "value-equal",
14 + "rawSpec": "^1.0.1",
15 + "saveSpec": null,
16 + "fetchSpec": "^1.0.1"
17 + },
18 + "_requiredBy": [
19 + "/history"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
22 + "_shasum": "1e0b794c734c5c0cade179c437d356d931a34d6c",
23 + "_spec": "value-equal@^1.0.1",
24 + "_where": "C:\\Users\\WP\\Desktop\\오픈소스 SW개발\\프로젝트\\TermProject\\node_modules\\history",
25 + "author": {
26 + "name": "Michael Jackson"
27 + },
28 + "bugs": {
29 + "url": "https://github.com/mjackson/value-equal/issues"
30 + },
31 + "bundleDependencies": false,
32 + "deprecated": false,
33 + "description": "Are these two JavaScript values equal?",
34 + "devDependencies": {
35 + "@babel/core": "^7.1.6",
36 + "@babel/preset-env": "^7.1.6",
37 + "babel-core": "^7.0.0-bridge.0",
38 + "babel-eslint": "^10.0.1",
39 + "babel-jest": "^23.6.0",
40 + "eslint": "^5.9.0",
41 + "jest": "^23.6.0",
42 + "rollup": "^0.67.3",
43 + "rollup-plugin-replace": "^2.1.0",
44 + "rollup-plugin-size-snapshot": "^0.7.0",
45 + "rollup-plugin-uglify": "^6.0.0"
46 + },
47 + "files": [
48 + "cjs",
49 + "esm",
50 + "index.js",
51 + "umd"
52 + ],
53 + "homepage": "https://github.com/mjackson/value-equal#readme",
54 + "license": "MIT",
55 + "main": "index.js",
56 + "module": "esm/value-equal.js",
57 + "name": "value-equal",
58 + "repository": {
59 + "type": "git",
60 + "url": "git+https://github.com/mjackson/value-equal.git"
61 + },
62 + "scripts": {
63 + "build": "rollup -c",
64 + "clean": "git clean -fdX .",
65 + "lint": "eslint modules",
66 + "prepublishOnly": "npm run build",
67 + "test": "jest"
68 + },
69 + "unpkg": "umd/value-equal.js",
70 + "version": "1.0.1"
71 +}
1 +(function (global, factory) {
2 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 + typeof define === 'function' && define.amd ? define(factory) :
4 + (global.valueEqual = factory());
5 +}(this, (function () { 'use strict';
6 +
7 + function valueOf(obj) {
8 + return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
9 + }
10 +
11 + function valueEqual(a, b) {
12 + // Test for strict equality first.
13 + if (a === b) return true;
14 +
15 + // Otherwise, if either of them == null they are not equal.
16 + if (a == null || b == null) return false;
17 +
18 + if (Array.isArray(a)) {
19 + return (
20 + Array.isArray(b) &&
21 + a.length === b.length &&
22 + a.every(function(item, index) {
23 + return valueEqual(item, b[index]);
24 + })
25 + );
26 + }
27 +
28 + if (typeof a === 'object' || typeof b === 'object') {
29 + var aValue = valueOf(a);
30 + var bValue = valueOf(b);
31 +
32 + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
33 +
34 + return Object.keys(Object.assign({}, a, b)).every(function(key) {
35 + return valueEqual(a[key], b[key]);
36 + });
37 + }
38 +
39 + return false;
40 + }
41 +
42 + return valueEqual;
43 +
44 +})));
1 +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.valueEqual=t()}(this,function(){"use strict";function f(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}return function n(t,r){if(t===r)return!0;if(null==t||null==r)return!1;if(Array.isArray(t))return Array.isArray(r)&&t.length===r.length&&t.every(function(e,t){return n(e,r[t])});if("object"!=typeof t&&"object"!=typeof r)return!1;var e=f(t),u=f(r);return e!==t||u!==r?n(e,u):Object.keys(Object.assign({},t,r)).every(function(e){return n(t[e],r[e])})}});
1 +{
2 + "requires": true,
3 + "lockfileVersion": 1,
4 + "dependencies": {
5 + "@babel/runtime": {
6 + "version": "7.9.6",
7 + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz",
8 + "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==",
9 + "requires": {
10 + "regenerator-runtime": "^0.13.4"
11 + }
12 + },
13 + "history": {
14 + "version": "4.10.1",
15 + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
16 + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
17 + "requires": {
18 + "@babel/runtime": "^7.1.2",
19 + "loose-envify": "^1.2.0",
20 + "resolve-pathname": "^3.0.0",
21 + "tiny-invariant": "^1.0.2",
22 + "tiny-warning": "^1.0.0",
23 + "value-equal": "^1.0.1"
24 + }
25 + },
26 + "hoist-non-react-statics": {
27 + "version": "3.3.2",
28 + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
29 + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
30 + "requires": {
31 + "react-is": "^16.7.0"
32 + }
33 + },
34 + "isarray": {
35 + "version": "0.0.1",
36 + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
37 + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
38 + },
39 + "js-tokens": {
40 + "version": "4.0.0",
41 + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
42 + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
43 + },
44 + "loose-envify": {
45 + "version": "1.4.0",
46 + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
47 + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
48 + "requires": {
49 + "js-tokens": "^3.0.0 || ^4.0.0"
50 + }
51 + },
52 + "mini-create-react-context": {
53 + "version": "0.4.0",
54 + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.0.tgz",
55 + "integrity": "sha512-b0TytUgFSbgFJGzJqXPKCFCBWigAjpjo+Fl7Vf7ZbKRDptszpppKxXH6DRXEABZ/gcEQczeb0iZ7JvL8e8jjCA==",
56 + "requires": {
57 + "@babel/runtime": "^7.5.5",
58 + "tiny-warning": "^1.0.3"
59 + }
60 + },
61 + "object-assign": {
62 + "version": "4.1.1",
63 + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
64 + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
65 + },
66 + "path-to-regexp": {
67 + "version": "1.8.0",
68 + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
69 + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
70 + "requires": {
71 + "isarray": "0.0.1"
72 + }
73 + },
74 + "prop-types": {
75 + "version": "15.7.2",
76 + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
77 + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
78 + "requires": {
79 + "loose-envify": "^1.4.0",
80 + "object-assign": "^4.1.1",
81 + "react-is": "^16.8.1"
82 + }
83 + },
84 + "react-is": {
85 + "version": "16.13.1",
86 + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
87 + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
88 + },
89 + "react-router": {
90 + "version": "5.2.0",
91 + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz",
92 + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==",
93 + "requires": {
94 + "@babel/runtime": "^7.1.2",
95 + "history": "^4.9.0",
96 + "hoist-non-react-statics": "^3.1.0",
97 + "loose-envify": "^1.3.1",
98 + "mini-create-react-context": "^0.4.0",
99 + "path-to-regexp": "^1.7.0",
100 + "prop-types": "^15.6.2",
101 + "react-is": "^16.6.0",
102 + "tiny-invariant": "^1.0.2",
103 + "tiny-warning": "^1.0.0"
104 + }
105 + },
106 + "react-router-dom": {
107 + "version": "5.2.0",
108 + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz",
109 + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==",
110 + "requires": {
111 + "@babel/runtime": "^7.1.2",
112 + "history": "^4.9.0",
113 + "loose-envify": "^1.3.1",
114 + "prop-types": "^15.6.2",
115 + "react-router": "5.2.0",
116 + "tiny-invariant": "^1.0.2",
117 + "tiny-warning": "^1.0.0"
118 + }
119 + },
120 + "regenerator-runtime": {
121 + "version": "0.13.5",
122 + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
123 + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
124 + },
125 + "resolve-pathname": {
126 + "version": "3.0.0",
127 + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
128 + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
129 + },
130 + "tiny-invariant": {
131 + "version": "1.1.0",
132 + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz",
133 + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw=="
134 + },
135 + "tiny-warning": {
136 + "version": "1.0.3",
137 + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
138 + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
139 + },
140 + "value-equal": {
141 + "version": "1.0.1",
142 + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
143 + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
144 + }
145 + }
146 +}