@imtf/icons 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{src/components → components}/IconSVG.d.ts +9 -9
- package/lib/components/IconSVG.js +38 -0
- package/lib/{src/components → components}/index.d.ts +2 -2
- package/lib/components/index.js +2 -0
- package/lib/icons/AccountIcon.js +0 -1
- package/lib/icons/AddCircleIcon.js +0 -1
- package/lib/icons/AddIcon.js +0 -1
- package/lib/icons/AdminIcon.js +0 -1
- package/lib/icons/AlertCircleIcon.js +0 -1
- package/lib/icons/AlertCircleOutlinedIcon.js +0 -1
- package/lib/icons/AlertIcon.js +0 -1
- package/lib/icons/AlertLightIcon.js +0 -1
- package/lib/icons/AnnotationsIcon.js +0 -1
- package/lib/icons/AppIcon.js +0 -1
- package/lib/icons/ArrowDropDownIcon.js +0 -1
- package/lib/icons/BackIcon.js +0 -1
- package/lib/icons/BaseDefaultIcon.js +0 -1
- package/lib/icons/BindersIcon.js +0 -1
- package/lib/icons/BinocularsIcon.js +0 -1
- package/lib/icons/BookmarksIcon.js +0 -1
- package/lib/icons/BusinessIcon.js +0 -1
- package/lib/icons/CalendarIcon.js +0 -1
- package/lib/icons/CancelIcon.js +0 -1
- package/lib/icons/CaseManagerIcon.js +0 -1
- package/lib/icons/CheckIcon.js +0 -1
- package/lib/icons/ChevronDownIcon.js +0 -1
- package/lib/icons/ChevronLeftIcon.js +0 -1
- package/lib/icons/ChevronRightIcon.js +0 -1
- package/lib/icons/ChevronUpIcon.js +0 -1
- package/lib/icons/CircleIcon.js +0 -1
- package/lib/icons/CollapseAllIcon.js +0 -1
- package/lib/icons/CommentIcon.js +0 -1
- package/lib/icons/CommentResolvedIcon.js +0 -1
- package/lib/icons/CommentUnresolvedIcon.js +0 -1
- package/lib/icons/CompareIcon.js +0 -1
- package/lib/icons/ComposeFilled1Icon.js +0 -1
- package/lib/icons/ComposeFilled2Icon.js +0 -1
- package/lib/icons/ComposeIcon.js +0 -1
- package/lib/icons/ConfigurationIcon.js +0 -1
- package/lib/icons/CustomerIcon.js +0 -1
- package/lib/icons/DashboardIcon.js +0 -1
- package/lib/icons/DefaultIcon.js +0 -1
- package/lib/icons/DeleteIcon.js +0 -1
- package/lib/icons/DetailsIcon.js +0 -1
- package/lib/icons/DocIcon.js +0 -1
- package/lib/icons/DocLinkIcon.js +0 -1
- package/lib/icons/DocumentIcon.js +0 -1
- package/lib/icons/DossierIcon.js +0 -1
- package/lib/icons/DownloadIcon.js +0 -1
- package/lib/icons/DragHandleIcon.js +0 -1
- package/lib/icons/DragIcon.js +0 -1
- package/lib/icons/DropZoneIcon.js +0 -1
- package/lib/icons/DuplicateIcon.js +0 -1
- package/lib/icons/EditIcon.js +0 -1
- package/lib/icons/EditedIcon.js +0 -1
- package/lib/icons/EmptyNotificationIcon.js +0 -1
- package/lib/icons/EntityIcon.js +0 -1
- package/lib/icons/EraseIcon.js +0 -1
- package/lib/icons/ExpandContentIcon.js +0 -1
- package/lib/icons/ExternalLinkIcon.js +0 -1
- package/lib/icons/EyeIcon.js +0 -1
- package/lib/icons/FileArchiveIcon.js +0 -1
- package/lib/icons/FileIcon.js +0 -1
- package/lib/icons/FileImageIcon.js +0 -1
- package/lib/icons/FileImageLinkIcon.js +0 -1
- package/lib/icons/FileLinkIcon.js +0 -1
- package/lib/icons/FilePdfIcon.js +0 -1
- package/lib/icons/FilePdfLinkIcon.js +0 -1
- package/lib/icons/FileStackIcon.js +0 -1
- package/lib/icons/FlagIcon.js +0 -1
- package/lib/icons/FloppyFilledIcon.js +0 -1
- package/lib/icons/FloppyIcon.js +0 -1
- package/lib/icons/FolderAddIcon.js +0 -1
- package/lib/icons/FolderIcon.js +0 -1
- package/lib/icons/FolderOpenIcon.js +0 -1
- package/lib/icons/FolderTemplateIcon.js +0 -1
- package/lib/icons/FormIcon.js +0 -1
- package/lib/icons/FullscreenIcon.js +0 -1
- package/lib/icons/GaugeIcon.js +0 -1
- package/lib/icons/GaugeLightIcon.js +0 -1
- package/lib/icons/GenerateFileIcon.js +0 -1
- package/lib/icons/GraphIcon.js +0 -1
- package/lib/icons/GroupIcon.js +0 -1
- package/lib/icons/HistoryIcon.js +0 -1
- package/lib/icons/HomeIcon.js +0 -1
- package/lib/icons/HorseIcon.js +0 -1
- package/lib/icons/InboxIcon.js +0 -1
- package/lib/icons/InfoIcon.js +0 -1
- package/lib/icons/InheritableIcon.js +0 -1
- package/lib/icons/InkIcon.js +0 -1
- package/lib/icons/LinkIcon.js +0 -1
- package/lib/icons/LockIcon.js +0 -1
- package/lib/icons/LogoIcon.js +0 -1
- package/lib/icons/LogoutIcon.js +0 -1
- package/lib/icons/MarkerIcon.js +0 -1
- package/lib/icons/MenuIcon.js +0 -1
- package/lib/icons/MinusIcon.js +0 -1
- package/lib/icons/MoreIcon.js +0 -1
- package/lib/icons/NewIcon.js +0 -1
- package/lib/icons/NotFoundIcon.js +0 -1
- package/lib/icons/NotificationsOutlineIcon.js +0 -1
- package/lib/icons/OpenIcon.js +0 -1
- package/lib/icons/PermissionsIcon.js +0 -1
- package/lib/icons/PersonIcon.js +0 -1
- package/lib/icons/PinFilledIcon.js +0 -1
- package/lib/icons/PinOutlinedIcon.js +0 -1
- package/lib/icons/PlayIcon.js +0 -1
- package/lib/icons/PptIcon.js +0 -1
- package/lib/icons/PptLinkIcon.js +0 -1
- package/lib/icons/PreviewIcon.js +0 -1
- package/lib/icons/PrintIcon.js +0 -1
- package/lib/icons/QuestionnaireErrorIcon.js +0 -1
- package/lib/icons/QuestionnaireIcon.js +0 -1
- package/lib/icons/RemoveIcon.js +0 -1
- package/lib/icons/RotateRightIcon.js +0 -1
- package/lib/icons/SafeOkIcon.js +0 -1
- package/lib/icons/SafePassiveIcon.js +0 -1
- package/lib/icons/SafeProgressIcon.js +0 -1
- package/lib/icons/ScissorsIcon.js +0 -1
- package/lib/icons/SearchIcon.js +0 -1
- package/lib/icons/SendIcon.js +0 -1
- package/lib/icons/ShieldWarningIcon.js +0 -1
- package/lib/icons/SidebarCollapsedIcon.js +0 -1
- package/lib/icons/SidebarExpandedIcon.js +0 -1
- package/lib/icons/SidebarIcon.js +0 -1
- package/lib/icons/SquareIcon.js +0 -1
- package/lib/icons/StarBorderIcon.js +0 -1
- package/lib/icons/StarIcon.js +0 -1
- package/lib/icons/SystemBotIcon.js +0 -1
- package/lib/icons/TableIcon.js +0 -1
- package/lib/icons/TaskIcon.js +0 -1
- package/lib/icons/ThumbnailsIcon.js +0 -1
- package/lib/icons/TimelapsIcon.js +0 -1
- package/lib/icons/TimelineIcon.js +0 -1
- package/lib/icons/ToolsIcon.js +0 -1
- package/lib/icons/TypesIcon.js +0 -1
- package/lib/icons/UploadIcon.js +0 -1
- package/lib/icons/ViewTreeIcon.js +0 -1
- package/lib/icons/WarningIcon.js +0 -1
- package/lib/icons/WatermarkIcon.js +0 -1
- package/lib/icons/XlsIcon.js +0 -1
- package/lib/icons/XlsLinkIcon.js +0 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.js +3 -2
- package/lib/{src/providers → providers}/IconProvider/Context.d.ts +13 -13
- package/lib/providers/IconProvider/Context.js +12 -0
- package/lib/{src/providers → providers}/IconProvider/IconProvider.d.ts +9 -9
- package/lib/providers/IconProvider/IconProvider.js +27 -0
- package/lib/{src/providers → providers}/index.d.ts +4 -4
- package/lib/providers/index.js +4 -0
- package/package.json +5 -5
- package/lib/src/index.d.ts +0 -2
- package/lib/src/index.js +0 -2357
package/lib/src/index.js
DELETED
|
@@ -1,2357 +0,0 @@
|
|
|
1
|
-
import require$$0, { createContext, useMemo, useContext, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
/*! *****************************************************************************
|
|
4
|
-
Copyright (c) Microsoft Corporation.
|
|
5
|
-
|
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
-
purpose with or without fee is hereby granted.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */
|
|
17
|
-
|
|
18
|
-
var __assign = function() {
|
|
19
|
-
__assign = Object.assign || function __assign(t) {
|
|
20
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
-
s = arguments[i];
|
|
22
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
function __rest(s, e) {
|
|
30
|
-
var t = {};
|
|
31
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
32
|
-
t[p] = s[p];
|
|
33
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
34
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
35
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
36
|
-
t[p[i]] = s[p[i]];
|
|
37
|
-
}
|
|
38
|
-
return t;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
42
|
-
|
|
43
|
-
var jsxRuntime = {exports: {}};
|
|
44
|
-
|
|
45
|
-
var reactJsxRuntime_production_min = {};
|
|
46
|
-
|
|
47
|
-
/*
|
|
48
|
-
object-assign
|
|
49
|
-
(c) Sindre Sorhus
|
|
50
|
-
@license MIT
|
|
51
|
-
*/
|
|
52
|
-
/* eslint-disable no-unused-vars */
|
|
53
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
54
|
-
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
55
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
56
|
-
|
|
57
|
-
function toObject(val) {
|
|
58
|
-
if (val === null || val === undefined) {
|
|
59
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return Object(val);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function shouldUseNative() {
|
|
66
|
-
try {
|
|
67
|
-
if (!Object.assign) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Detect buggy property enumeration order in older V8 versions.
|
|
72
|
-
|
|
73
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
74
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
75
|
-
test1[5] = 'de';
|
|
76
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
81
|
-
var test2 = {};
|
|
82
|
-
for (var i = 0; i < 10; i++) {
|
|
83
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
84
|
-
}
|
|
85
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
86
|
-
return test2[n];
|
|
87
|
-
});
|
|
88
|
-
if (order2.join('') !== '0123456789') {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
93
|
-
var test3 = {};
|
|
94
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
95
|
-
test3[letter] = letter;
|
|
96
|
-
});
|
|
97
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
98
|
-
'abcdefghijklmnopqrst') {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return true;
|
|
103
|
-
} catch (err) {
|
|
104
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
110
|
-
var from;
|
|
111
|
-
var to = toObject(target);
|
|
112
|
-
var symbols;
|
|
113
|
-
|
|
114
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
115
|
-
from = Object(arguments[s]);
|
|
116
|
-
|
|
117
|
-
for (var key in from) {
|
|
118
|
-
if (hasOwnProperty$1.call(from, key)) {
|
|
119
|
-
to[key] = from[key];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (getOwnPropertySymbols) {
|
|
124
|
-
symbols = getOwnPropertySymbols(from);
|
|
125
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
126
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
127
|
-
to[symbols[i]] = from[symbols[i]];
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return to;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
/** @license React v17.0.2
|
|
137
|
-
* react-jsx-runtime.production.min.js
|
|
138
|
-
*
|
|
139
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the MIT license found in the
|
|
142
|
-
* LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/
|
|
144
|
-
var f=require$$0,g=60103;reactJsxRuntime_production_min.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");reactJsxRuntime_production_min.Fragment=h("react.fragment");}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
145
|
-
function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
146
|
-
|
|
147
|
-
var reactJsxRuntime_development = {};
|
|
148
|
-
|
|
149
|
-
/** @license React v17.0.2
|
|
150
|
-
* react-jsx-runtime.development.js
|
|
151
|
-
*
|
|
152
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the MIT license found in the
|
|
155
|
-
* LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
(function (exports) {
|
|
159
|
-
|
|
160
|
-
if (process.env.NODE_ENV !== "production") {
|
|
161
|
-
(function() {
|
|
162
|
-
|
|
163
|
-
var React = require$$0;
|
|
164
|
-
var _assign = objectAssign;
|
|
165
|
-
|
|
166
|
-
// ATTENTION
|
|
167
|
-
// When adding new symbols to this file,
|
|
168
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
169
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
170
|
-
// nor polyfill, then a plain number is used for performance.
|
|
171
|
-
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
172
|
-
var REACT_PORTAL_TYPE = 0xeaca;
|
|
173
|
-
exports.Fragment = 0xeacb;
|
|
174
|
-
var REACT_STRICT_MODE_TYPE = 0xeacc;
|
|
175
|
-
var REACT_PROFILER_TYPE = 0xead2;
|
|
176
|
-
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
177
|
-
var REACT_CONTEXT_TYPE = 0xeace;
|
|
178
|
-
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
179
|
-
var REACT_SUSPENSE_TYPE = 0xead1;
|
|
180
|
-
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
181
|
-
var REACT_MEMO_TYPE = 0xead3;
|
|
182
|
-
var REACT_LAZY_TYPE = 0xead4;
|
|
183
|
-
var REACT_BLOCK_TYPE = 0xead9;
|
|
184
|
-
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
185
|
-
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
186
|
-
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
187
|
-
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
188
|
-
|
|
189
|
-
if (typeof Symbol === 'function' && Symbol.for) {
|
|
190
|
-
var symbolFor = Symbol.for;
|
|
191
|
-
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
192
|
-
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
193
|
-
exports.Fragment = symbolFor('react.fragment');
|
|
194
|
-
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
|
|
195
|
-
REACT_PROFILER_TYPE = symbolFor('react.profiler');
|
|
196
|
-
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
197
|
-
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
198
|
-
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
199
|
-
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
|
|
200
|
-
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
201
|
-
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
202
|
-
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
203
|
-
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
204
|
-
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
205
|
-
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
206
|
-
symbolFor('react.scope');
|
|
207
|
-
symbolFor('react.opaque.id');
|
|
208
|
-
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
209
|
-
symbolFor('react.offscreen');
|
|
210
|
-
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
214
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
215
|
-
function getIteratorFn(maybeIterable) {
|
|
216
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
221
|
-
|
|
222
|
-
if (typeof maybeIterator === 'function') {
|
|
223
|
-
return maybeIterator;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return null;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
230
|
-
|
|
231
|
-
function error(format) {
|
|
232
|
-
{
|
|
233
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
234
|
-
args[_key2 - 1] = arguments[_key2];
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
printWarning('error', format, args);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function printWarning(level, format, args) {
|
|
242
|
-
// When changing this logic, you might want to also
|
|
243
|
-
// update consoleWithStackDev.www.js as well.
|
|
244
|
-
{
|
|
245
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
246
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
247
|
-
|
|
248
|
-
if (stack !== '') {
|
|
249
|
-
format += '%s';
|
|
250
|
-
args = args.concat([stack]);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
var argsWithFormat = args.map(function (item) {
|
|
254
|
-
return '' + item;
|
|
255
|
-
}); // Careful: RN currently depends on this prefix
|
|
256
|
-
|
|
257
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
258
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
259
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
260
|
-
|
|
261
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
266
|
-
|
|
267
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
268
|
-
|
|
269
|
-
function isValidElementType(type) {
|
|
270
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
271
|
-
return true;
|
|
272
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
|
276
|
-
return true;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (typeof type === 'object' && type !== null) {
|
|
280
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
return false;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
289
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
290
|
-
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function getContextName(type) {
|
|
294
|
-
return type.displayName || 'Context';
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function getComponentName(type) {
|
|
298
|
-
if (type == null) {
|
|
299
|
-
// Host root, text node or just invalid type.
|
|
300
|
-
return null;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
if (typeof type.tag === 'number') {
|
|
305
|
-
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
if (typeof type === 'function') {
|
|
310
|
-
return type.displayName || type.name || null;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
if (typeof type === 'string') {
|
|
314
|
-
return type;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
switch (type) {
|
|
318
|
-
case exports.Fragment:
|
|
319
|
-
return 'Fragment';
|
|
320
|
-
|
|
321
|
-
case REACT_PORTAL_TYPE:
|
|
322
|
-
return 'Portal';
|
|
323
|
-
|
|
324
|
-
case REACT_PROFILER_TYPE:
|
|
325
|
-
return 'Profiler';
|
|
326
|
-
|
|
327
|
-
case REACT_STRICT_MODE_TYPE:
|
|
328
|
-
return 'StrictMode';
|
|
329
|
-
|
|
330
|
-
case REACT_SUSPENSE_TYPE:
|
|
331
|
-
return 'Suspense';
|
|
332
|
-
|
|
333
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
334
|
-
return 'SuspenseList';
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
if (typeof type === 'object') {
|
|
338
|
-
switch (type.$$typeof) {
|
|
339
|
-
case REACT_CONTEXT_TYPE:
|
|
340
|
-
var context = type;
|
|
341
|
-
return getContextName(context) + '.Consumer';
|
|
342
|
-
|
|
343
|
-
case REACT_PROVIDER_TYPE:
|
|
344
|
-
var provider = type;
|
|
345
|
-
return getContextName(provider._context) + '.Provider';
|
|
346
|
-
|
|
347
|
-
case REACT_FORWARD_REF_TYPE:
|
|
348
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
349
|
-
|
|
350
|
-
case REACT_MEMO_TYPE:
|
|
351
|
-
return getComponentName(type.type);
|
|
352
|
-
|
|
353
|
-
case REACT_BLOCK_TYPE:
|
|
354
|
-
return getComponentName(type._render);
|
|
355
|
-
|
|
356
|
-
case REACT_LAZY_TYPE:
|
|
357
|
-
{
|
|
358
|
-
var lazyComponent = type;
|
|
359
|
-
var payload = lazyComponent._payload;
|
|
360
|
-
var init = lazyComponent._init;
|
|
361
|
-
|
|
362
|
-
try {
|
|
363
|
-
return getComponentName(init(payload));
|
|
364
|
-
} catch (x) {
|
|
365
|
-
return null;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
return null;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
375
|
-
// replaying on render function. This currently only patches the object
|
|
376
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
377
|
-
// We could also eagerly patch the method.
|
|
378
|
-
var disabledDepth = 0;
|
|
379
|
-
var prevLog;
|
|
380
|
-
var prevInfo;
|
|
381
|
-
var prevWarn;
|
|
382
|
-
var prevError;
|
|
383
|
-
var prevGroup;
|
|
384
|
-
var prevGroupCollapsed;
|
|
385
|
-
var prevGroupEnd;
|
|
386
|
-
|
|
387
|
-
function disabledLog() {}
|
|
388
|
-
|
|
389
|
-
disabledLog.__reactDisabledLog = true;
|
|
390
|
-
function disableLogs() {
|
|
391
|
-
{
|
|
392
|
-
if (disabledDepth === 0) {
|
|
393
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
394
|
-
prevLog = console.log;
|
|
395
|
-
prevInfo = console.info;
|
|
396
|
-
prevWarn = console.warn;
|
|
397
|
-
prevError = console.error;
|
|
398
|
-
prevGroup = console.group;
|
|
399
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
400
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
401
|
-
|
|
402
|
-
var props = {
|
|
403
|
-
configurable: true,
|
|
404
|
-
enumerable: true,
|
|
405
|
-
value: disabledLog,
|
|
406
|
-
writable: true
|
|
407
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
408
|
-
|
|
409
|
-
Object.defineProperties(console, {
|
|
410
|
-
info: props,
|
|
411
|
-
log: props,
|
|
412
|
-
warn: props,
|
|
413
|
-
error: props,
|
|
414
|
-
group: props,
|
|
415
|
-
groupCollapsed: props,
|
|
416
|
-
groupEnd: props
|
|
417
|
-
});
|
|
418
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
disabledDepth++;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
function reenableLogs() {
|
|
425
|
-
{
|
|
426
|
-
disabledDepth--;
|
|
427
|
-
|
|
428
|
-
if (disabledDepth === 0) {
|
|
429
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
430
|
-
var props = {
|
|
431
|
-
configurable: true,
|
|
432
|
-
enumerable: true,
|
|
433
|
-
writable: true
|
|
434
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
435
|
-
|
|
436
|
-
Object.defineProperties(console, {
|
|
437
|
-
log: _assign({}, props, {
|
|
438
|
-
value: prevLog
|
|
439
|
-
}),
|
|
440
|
-
info: _assign({}, props, {
|
|
441
|
-
value: prevInfo
|
|
442
|
-
}),
|
|
443
|
-
warn: _assign({}, props, {
|
|
444
|
-
value: prevWarn
|
|
445
|
-
}),
|
|
446
|
-
error: _assign({}, props, {
|
|
447
|
-
value: prevError
|
|
448
|
-
}),
|
|
449
|
-
group: _assign({}, props, {
|
|
450
|
-
value: prevGroup
|
|
451
|
-
}),
|
|
452
|
-
groupCollapsed: _assign({}, props, {
|
|
453
|
-
value: prevGroupCollapsed
|
|
454
|
-
}),
|
|
455
|
-
groupEnd: _assign({}, props, {
|
|
456
|
-
value: prevGroupEnd
|
|
457
|
-
})
|
|
458
|
-
});
|
|
459
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
if (disabledDepth < 0) {
|
|
463
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
469
|
-
var prefix;
|
|
470
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
471
|
-
{
|
|
472
|
-
if (prefix === undefined) {
|
|
473
|
-
// Extract the VM specific prefix used by each line.
|
|
474
|
-
try {
|
|
475
|
-
throw Error();
|
|
476
|
-
} catch (x) {
|
|
477
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
478
|
-
prefix = match && match[1] || '';
|
|
479
|
-
}
|
|
480
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
return '\n' + prefix + name;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
var reentry = false;
|
|
487
|
-
var componentFrameCache;
|
|
488
|
-
|
|
489
|
-
{
|
|
490
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
491
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
495
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
496
|
-
if (!fn || reentry) {
|
|
497
|
-
return '';
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
{
|
|
501
|
-
var frame = componentFrameCache.get(fn);
|
|
502
|
-
|
|
503
|
-
if (frame !== undefined) {
|
|
504
|
-
return frame;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
var control;
|
|
509
|
-
reentry = true;
|
|
510
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
511
|
-
|
|
512
|
-
Error.prepareStackTrace = undefined;
|
|
513
|
-
var previousDispatcher;
|
|
514
|
-
|
|
515
|
-
{
|
|
516
|
-
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
517
|
-
// for warnings.
|
|
518
|
-
|
|
519
|
-
ReactCurrentDispatcher.current = null;
|
|
520
|
-
disableLogs();
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
try {
|
|
524
|
-
// This should throw.
|
|
525
|
-
if (construct) {
|
|
526
|
-
// Something should be setting the props in the constructor.
|
|
527
|
-
var Fake = function () {
|
|
528
|
-
throw Error();
|
|
529
|
-
}; // $FlowFixMe
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
533
|
-
set: function () {
|
|
534
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
535
|
-
// because that won't throw in a non-strict mode function.
|
|
536
|
-
throw Error();
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
|
|
540
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
541
|
-
// We construct a different control for this case to include any extra
|
|
542
|
-
// frames added by the construct call.
|
|
543
|
-
try {
|
|
544
|
-
Reflect.construct(Fake, []);
|
|
545
|
-
} catch (x) {
|
|
546
|
-
control = x;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
Reflect.construct(fn, [], Fake);
|
|
550
|
-
} else {
|
|
551
|
-
try {
|
|
552
|
-
Fake.call();
|
|
553
|
-
} catch (x) {
|
|
554
|
-
control = x;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
fn.call(Fake.prototype);
|
|
558
|
-
}
|
|
559
|
-
} else {
|
|
560
|
-
try {
|
|
561
|
-
throw Error();
|
|
562
|
-
} catch (x) {
|
|
563
|
-
control = x;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
fn();
|
|
567
|
-
}
|
|
568
|
-
} catch (sample) {
|
|
569
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
570
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
571
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
572
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
573
|
-
var sampleLines = sample.stack.split('\n');
|
|
574
|
-
var controlLines = control.stack.split('\n');
|
|
575
|
-
var s = sampleLines.length - 1;
|
|
576
|
-
var c = controlLines.length - 1;
|
|
577
|
-
|
|
578
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
579
|
-
// We expect at least one stack frame to be shared.
|
|
580
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
581
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
582
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
583
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
584
|
-
// the sample somewhere in the control.
|
|
585
|
-
c--;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
589
|
-
// Next we find the first one that isn't the same which should be the
|
|
590
|
-
// frame that called our sample function and the control.
|
|
591
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
592
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
593
|
-
// If we're about to return the first line, and the control is also on the same
|
|
594
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
595
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
596
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
597
|
-
if (s !== 1 || c !== 1) {
|
|
598
|
-
do {
|
|
599
|
-
s--;
|
|
600
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
601
|
-
// The next one that isn't the same should be our match though.
|
|
602
|
-
|
|
603
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
604
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
605
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
606
|
-
|
|
607
|
-
{
|
|
608
|
-
if (typeof fn === 'function') {
|
|
609
|
-
componentFrameCache.set(fn, _frame);
|
|
610
|
-
}
|
|
611
|
-
} // Return the line we found.
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
return _frame;
|
|
615
|
-
}
|
|
616
|
-
} while (s >= 1 && c >= 0);
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
break;
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
} finally {
|
|
624
|
-
reentry = false;
|
|
625
|
-
|
|
626
|
-
{
|
|
627
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
628
|
-
reenableLogs();
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
632
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
636
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
637
|
-
|
|
638
|
-
{
|
|
639
|
-
if (typeof fn === 'function') {
|
|
640
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
return syntheticFrame;
|
|
645
|
-
}
|
|
646
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
647
|
-
{
|
|
648
|
-
return describeNativeComponentFrame(fn, false);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
function shouldConstruct(Component) {
|
|
653
|
-
var prototype = Component.prototype;
|
|
654
|
-
return !!(prototype && prototype.isReactComponent);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
658
|
-
|
|
659
|
-
if (type == null) {
|
|
660
|
-
return '';
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
if (typeof type === 'function') {
|
|
664
|
-
{
|
|
665
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
if (typeof type === 'string') {
|
|
670
|
-
return describeBuiltInComponentFrame(type);
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
switch (type) {
|
|
674
|
-
case REACT_SUSPENSE_TYPE:
|
|
675
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
676
|
-
|
|
677
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
678
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
if (typeof type === 'object') {
|
|
682
|
-
switch (type.$$typeof) {
|
|
683
|
-
case REACT_FORWARD_REF_TYPE:
|
|
684
|
-
return describeFunctionComponentFrame(type.render);
|
|
685
|
-
|
|
686
|
-
case REACT_MEMO_TYPE:
|
|
687
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
688
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
689
|
-
|
|
690
|
-
case REACT_BLOCK_TYPE:
|
|
691
|
-
return describeFunctionComponentFrame(type._render);
|
|
692
|
-
|
|
693
|
-
case REACT_LAZY_TYPE:
|
|
694
|
-
{
|
|
695
|
-
var lazyComponent = type;
|
|
696
|
-
var payload = lazyComponent._payload;
|
|
697
|
-
var init = lazyComponent._init;
|
|
698
|
-
|
|
699
|
-
try {
|
|
700
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
701
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
702
|
-
} catch (x) {}
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
return '';
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
var loggedTypeFailures = {};
|
|
711
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
712
|
-
|
|
713
|
-
function setCurrentlyValidatingElement(element) {
|
|
714
|
-
{
|
|
715
|
-
if (element) {
|
|
716
|
-
var owner = element._owner;
|
|
717
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
718
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
719
|
-
} else {
|
|
720
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
726
|
-
{
|
|
727
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
728
|
-
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
729
|
-
|
|
730
|
-
for (var typeSpecName in typeSpecs) {
|
|
731
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
732
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
733
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
734
|
-
// After these have been cleaned up, we'll let them throw.
|
|
735
|
-
|
|
736
|
-
try {
|
|
737
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
738
|
-
// behavior as without this statement except with a better message.
|
|
739
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
740
|
-
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
741
|
-
err.name = 'Invariant Violation';
|
|
742
|
-
throw err;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
746
|
-
} catch (ex) {
|
|
747
|
-
error$1 = ex;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
751
|
-
setCurrentlyValidatingElement(element);
|
|
752
|
-
|
|
753
|
-
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
754
|
-
|
|
755
|
-
setCurrentlyValidatingElement(null);
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
759
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
760
|
-
// same error.
|
|
761
|
-
loggedTypeFailures[error$1.message] = true;
|
|
762
|
-
setCurrentlyValidatingElement(element);
|
|
763
|
-
|
|
764
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
765
|
-
|
|
766
|
-
setCurrentlyValidatingElement(null);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
774
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
775
|
-
var RESERVED_PROPS = {
|
|
776
|
-
key: true,
|
|
777
|
-
ref: true,
|
|
778
|
-
__self: true,
|
|
779
|
-
__source: true
|
|
780
|
-
};
|
|
781
|
-
var specialPropKeyWarningShown;
|
|
782
|
-
var specialPropRefWarningShown;
|
|
783
|
-
var didWarnAboutStringRefs;
|
|
784
|
-
|
|
785
|
-
{
|
|
786
|
-
didWarnAboutStringRefs = {};
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
function hasValidRef(config) {
|
|
790
|
-
{
|
|
791
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
792
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
793
|
-
|
|
794
|
-
if (getter && getter.isReactWarning) {
|
|
795
|
-
return false;
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
return config.ref !== undefined;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
function hasValidKey(config) {
|
|
804
|
-
{
|
|
805
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
806
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
807
|
-
|
|
808
|
-
if (getter && getter.isReactWarning) {
|
|
809
|
-
return false;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
return config.key !== undefined;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
818
|
-
{
|
|
819
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
820
|
-
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
821
|
-
|
|
822
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
823
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
824
|
-
|
|
825
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
832
|
-
{
|
|
833
|
-
var warnAboutAccessingKey = function () {
|
|
834
|
-
if (!specialPropKeyWarningShown) {
|
|
835
|
-
specialPropKeyWarningShown = true;
|
|
836
|
-
|
|
837
|
-
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
838
|
-
}
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
842
|
-
Object.defineProperty(props, 'key', {
|
|
843
|
-
get: warnAboutAccessingKey,
|
|
844
|
-
configurable: true
|
|
845
|
-
});
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
850
|
-
{
|
|
851
|
-
var warnAboutAccessingRef = function () {
|
|
852
|
-
if (!specialPropRefWarningShown) {
|
|
853
|
-
specialPropRefWarningShown = true;
|
|
854
|
-
|
|
855
|
-
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
860
|
-
Object.defineProperty(props, 'ref', {
|
|
861
|
-
get: warnAboutAccessingRef,
|
|
862
|
-
configurable: true
|
|
863
|
-
});
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
868
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
869
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
870
|
-
* if something is a React Element.
|
|
871
|
-
*
|
|
872
|
-
* @param {*} type
|
|
873
|
-
* @param {*} props
|
|
874
|
-
* @param {*} key
|
|
875
|
-
* @param {string|object} ref
|
|
876
|
-
* @param {*} owner
|
|
877
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
878
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
879
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
880
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
881
|
-
* change in behavior.
|
|
882
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
883
|
-
* indicating filename, line number, and/or other information.
|
|
884
|
-
* @internal
|
|
885
|
-
*/
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
889
|
-
var element = {
|
|
890
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
891
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
892
|
-
// Built-in properties that belong on the element
|
|
893
|
-
type: type,
|
|
894
|
-
key: key,
|
|
895
|
-
ref: ref,
|
|
896
|
-
props: props,
|
|
897
|
-
// Record the component responsible for creating this element.
|
|
898
|
-
_owner: owner
|
|
899
|
-
};
|
|
900
|
-
|
|
901
|
-
{
|
|
902
|
-
// The validation flag is currently mutative. We put it on
|
|
903
|
-
// an external backing store so that we can freeze the whole object.
|
|
904
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
905
|
-
// commonly used development environments.
|
|
906
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
907
|
-
// the validation flag non-enumerable (where possible, which should
|
|
908
|
-
// include every environment we run tests in), so the test framework
|
|
909
|
-
// ignores it.
|
|
910
|
-
|
|
911
|
-
Object.defineProperty(element._store, 'validated', {
|
|
912
|
-
configurable: false,
|
|
913
|
-
enumerable: false,
|
|
914
|
-
writable: true,
|
|
915
|
-
value: false
|
|
916
|
-
}); // self and source are DEV only properties.
|
|
917
|
-
|
|
918
|
-
Object.defineProperty(element, '_self', {
|
|
919
|
-
configurable: false,
|
|
920
|
-
enumerable: false,
|
|
921
|
-
writable: false,
|
|
922
|
-
value: self
|
|
923
|
-
}); // Two elements created in two different places should be considered
|
|
924
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
925
|
-
|
|
926
|
-
Object.defineProperty(element, '_source', {
|
|
927
|
-
configurable: false,
|
|
928
|
-
enumerable: false,
|
|
929
|
-
writable: false,
|
|
930
|
-
value: source
|
|
931
|
-
});
|
|
932
|
-
|
|
933
|
-
if (Object.freeze) {
|
|
934
|
-
Object.freeze(element.props);
|
|
935
|
-
Object.freeze(element);
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
return element;
|
|
940
|
-
};
|
|
941
|
-
/**
|
|
942
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
943
|
-
* @param {*} type
|
|
944
|
-
* @param {object} props
|
|
945
|
-
* @param {string} key
|
|
946
|
-
*/
|
|
947
|
-
|
|
948
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
949
|
-
{
|
|
950
|
-
var propName; // Reserved names are extracted
|
|
951
|
-
|
|
952
|
-
var props = {};
|
|
953
|
-
var key = null;
|
|
954
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
955
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
956
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
957
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
958
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
959
|
-
// key is explicitly declared to be undefined or not.
|
|
960
|
-
|
|
961
|
-
if (maybeKey !== undefined) {
|
|
962
|
-
key = '' + maybeKey;
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
if (hasValidKey(config)) {
|
|
966
|
-
key = '' + config.key;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
if (hasValidRef(config)) {
|
|
970
|
-
ref = config.ref;
|
|
971
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
972
|
-
} // Remaining properties are added to a new props object
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
for (propName in config) {
|
|
976
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
977
|
-
props[propName] = config[propName];
|
|
978
|
-
}
|
|
979
|
-
} // Resolve default props
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
if (type && type.defaultProps) {
|
|
983
|
-
var defaultProps = type.defaultProps;
|
|
984
|
-
|
|
985
|
-
for (propName in defaultProps) {
|
|
986
|
-
if (props[propName] === undefined) {
|
|
987
|
-
props[propName] = defaultProps[propName];
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
if (key || ref) {
|
|
993
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
994
|
-
|
|
995
|
-
if (key) {
|
|
996
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
if (ref) {
|
|
1000
|
-
defineRefPropWarningGetter(props, displayName);
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
1009
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1010
|
-
|
|
1011
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
1012
|
-
{
|
|
1013
|
-
if (element) {
|
|
1014
|
-
var owner = element._owner;
|
|
1015
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1016
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1017
|
-
} else {
|
|
1018
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
var propTypesMisspellWarningShown;
|
|
1024
|
-
|
|
1025
|
-
{
|
|
1026
|
-
propTypesMisspellWarningShown = false;
|
|
1027
|
-
}
|
|
1028
|
-
/**
|
|
1029
|
-
* Verifies the object is a ReactElement.
|
|
1030
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1031
|
-
* @param {?object} object
|
|
1032
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
1033
|
-
* @final
|
|
1034
|
-
*/
|
|
1035
|
-
|
|
1036
|
-
function isValidElement(object) {
|
|
1037
|
-
{
|
|
1038
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
function getDeclarationErrorAddendum() {
|
|
1043
|
-
{
|
|
1044
|
-
if (ReactCurrentOwner$1.current) {
|
|
1045
|
-
var name = getComponentName(ReactCurrentOwner$1.current.type);
|
|
1046
|
-
|
|
1047
|
-
if (name) {
|
|
1048
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
return '';
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1057
|
-
{
|
|
1058
|
-
if (source !== undefined) {
|
|
1059
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1060
|
-
var lineNumber = source.lineNumber;
|
|
1061
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
return '';
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1069
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
1070
|
-
* updates.
|
|
1071
|
-
*/
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
var ownerHasKeyUseWarning = {};
|
|
1075
|
-
|
|
1076
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1077
|
-
{
|
|
1078
|
-
var info = getDeclarationErrorAddendum();
|
|
1079
|
-
|
|
1080
|
-
if (!info) {
|
|
1081
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1082
|
-
|
|
1083
|
-
if (parentName) {
|
|
1084
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
return info;
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
/**
|
|
1092
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1093
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1094
|
-
* reordered. All children that haven't already been validated are required to
|
|
1095
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1096
|
-
* will only be shown once.
|
|
1097
|
-
*
|
|
1098
|
-
* @internal
|
|
1099
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1100
|
-
* @param {*} parentType element's parent's type.
|
|
1101
|
-
*/
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
function validateExplicitKey(element, parentType) {
|
|
1105
|
-
{
|
|
1106
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1107
|
-
return;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
element._store.validated = true;
|
|
1111
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1112
|
-
|
|
1113
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1114
|
-
return;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1118
|
-
// property, it may be the creator of the child that's responsible for
|
|
1119
|
-
// assigning it a key.
|
|
1120
|
-
|
|
1121
|
-
var childOwner = '';
|
|
1122
|
-
|
|
1123
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1124
|
-
// Give the component that originally created this child.
|
|
1125
|
-
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
setCurrentlyValidatingElement$1(element);
|
|
1129
|
-
|
|
1130
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1131
|
-
|
|
1132
|
-
setCurrentlyValidatingElement$1(null);
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
/**
|
|
1136
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1137
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1138
|
-
* with valid key property.
|
|
1139
|
-
*
|
|
1140
|
-
* @internal
|
|
1141
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1142
|
-
* @param {*} parentType node's parent's type.
|
|
1143
|
-
*/
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
function validateChildKeys(node, parentType) {
|
|
1147
|
-
{
|
|
1148
|
-
if (typeof node !== 'object') {
|
|
1149
|
-
return;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
if (Array.isArray(node)) {
|
|
1153
|
-
for (var i = 0; i < node.length; i++) {
|
|
1154
|
-
var child = node[i];
|
|
1155
|
-
|
|
1156
|
-
if (isValidElement(child)) {
|
|
1157
|
-
validateExplicitKey(child, parentType);
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
} else if (isValidElement(node)) {
|
|
1161
|
-
// This element was passed in a valid location.
|
|
1162
|
-
if (node._store) {
|
|
1163
|
-
node._store.validated = true;
|
|
1164
|
-
}
|
|
1165
|
-
} else if (node) {
|
|
1166
|
-
var iteratorFn = getIteratorFn(node);
|
|
1167
|
-
|
|
1168
|
-
if (typeof iteratorFn === 'function') {
|
|
1169
|
-
// Entry iterators used to provide implicit keys,
|
|
1170
|
-
// but now we print a separate warning for them later.
|
|
1171
|
-
if (iteratorFn !== node.entries) {
|
|
1172
|
-
var iterator = iteratorFn.call(node);
|
|
1173
|
-
var step;
|
|
1174
|
-
|
|
1175
|
-
while (!(step = iterator.next()).done) {
|
|
1176
|
-
if (isValidElement(step.value)) {
|
|
1177
|
-
validateExplicitKey(step.value, parentType);
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
/**
|
|
1186
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
1187
|
-
* provided by the type.
|
|
1188
|
-
*
|
|
1189
|
-
* @param {ReactElement} element
|
|
1190
|
-
*/
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
function validatePropTypes(element) {
|
|
1194
|
-
{
|
|
1195
|
-
var type = element.type;
|
|
1196
|
-
|
|
1197
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
1198
|
-
return;
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
var propTypes;
|
|
1202
|
-
|
|
1203
|
-
if (typeof type === 'function') {
|
|
1204
|
-
propTypes = type.propTypes;
|
|
1205
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1206
|
-
// Inner props are checked in the reconciler.
|
|
1207
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1208
|
-
propTypes = type.propTypes;
|
|
1209
|
-
} else {
|
|
1210
|
-
return;
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
if (propTypes) {
|
|
1214
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
1215
|
-
var name = getComponentName(type);
|
|
1216
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1217
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1218
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1219
|
-
|
|
1220
|
-
var _name = getComponentName(type);
|
|
1221
|
-
|
|
1222
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1226
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
/**
|
|
1231
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
1232
|
-
* @param {ReactElement} fragment
|
|
1233
|
-
*/
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
function validateFragmentProps(fragment) {
|
|
1237
|
-
{
|
|
1238
|
-
var keys = Object.keys(fragment.props);
|
|
1239
|
-
|
|
1240
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1241
|
-
var key = keys[i];
|
|
1242
|
-
|
|
1243
|
-
if (key !== 'children' && key !== 'key') {
|
|
1244
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1245
|
-
|
|
1246
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1247
|
-
|
|
1248
|
-
setCurrentlyValidatingElement$1(null);
|
|
1249
|
-
break;
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
if (fragment.ref !== null) {
|
|
1254
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1255
|
-
|
|
1256
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1257
|
-
|
|
1258
|
-
setCurrentlyValidatingElement$1(null);
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1264
|
-
{
|
|
1265
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1266
|
-
// succeed and there will likely be errors in render.
|
|
1267
|
-
|
|
1268
|
-
if (!validType) {
|
|
1269
|
-
var info = '';
|
|
1270
|
-
|
|
1271
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1272
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1276
|
-
|
|
1277
|
-
if (sourceInfo) {
|
|
1278
|
-
info += sourceInfo;
|
|
1279
|
-
} else {
|
|
1280
|
-
info += getDeclarationErrorAddendum();
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
var typeString;
|
|
1284
|
-
|
|
1285
|
-
if (type === null) {
|
|
1286
|
-
typeString = 'null';
|
|
1287
|
-
} else if (Array.isArray(type)) {
|
|
1288
|
-
typeString = 'array';
|
|
1289
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1290
|
-
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
1291
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1292
|
-
} else {
|
|
1293
|
-
typeString = typeof type;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1300
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1301
|
-
|
|
1302
|
-
if (element == null) {
|
|
1303
|
-
return element;
|
|
1304
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1305
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1306
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
1307
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1308
|
-
// fixed, the key warnings will appear.)
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
if (validType) {
|
|
1312
|
-
var children = props.children;
|
|
1313
|
-
|
|
1314
|
-
if (children !== undefined) {
|
|
1315
|
-
if (isStaticChildren) {
|
|
1316
|
-
if (Array.isArray(children)) {
|
|
1317
|
-
for (var i = 0; i < children.length; i++) {
|
|
1318
|
-
validateChildKeys(children[i], type);
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
if (Object.freeze) {
|
|
1322
|
-
Object.freeze(children);
|
|
1323
|
-
}
|
|
1324
|
-
} else {
|
|
1325
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1326
|
-
}
|
|
1327
|
-
} else {
|
|
1328
|
-
validateChildKeys(children, type);
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
if (type === exports.Fragment) {
|
|
1334
|
-
validateFragmentProps(element);
|
|
1335
|
-
} else {
|
|
1336
|
-
validatePropTypes(element);
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
return element;
|
|
1340
|
-
}
|
|
1341
|
-
} // These two functions exist to still get child warnings in dev
|
|
1342
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
1343
|
-
// opt-in behavior for better messages but that we won't stop
|
|
1344
|
-
// giving you warnings if you use production apis.
|
|
1345
|
-
|
|
1346
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
1347
|
-
{
|
|
1348
|
-
return jsxWithValidation(type, props, key, true);
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
1352
|
-
{
|
|
1353
|
-
return jsxWithValidation(type, props, key, false);
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1358
|
-
// for now we can ship identical prod functions
|
|
1359
|
-
|
|
1360
|
-
var jsxs = jsxWithValidationStatic ;
|
|
1361
|
-
|
|
1362
|
-
exports.jsx = jsx;
|
|
1363
|
-
exports.jsxs = jsxs;
|
|
1364
|
-
})();
|
|
1365
|
-
}
|
|
1366
|
-
}(reactJsxRuntime_development));
|
|
1367
|
-
|
|
1368
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1369
|
-
jsxRuntime.exports = reactJsxRuntime_production_min;
|
|
1370
|
-
} else {
|
|
1371
|
-
jsxRuntime.exports = reactJsxRuntime_development;
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
/**
|
|
1375
|
-
* lodash (Custom Build) <https://lodash.com/>
|
|
1376
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
|
1377
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
1378
|
-
* Released under MIT license <https://lodash.com/license>
|
|
1379
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
1380
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
1381
|
-
*/
|
|
1382
|
-
|
|
1383
|
-
/** Used as the `TypeError` message for "Functions" methods. */
|
|
1384
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
1385
|
-
|
|
1386
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1387
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1388
|
-
|
|
1389
|
-
/** Used as references for various `Number` constants. */
|
|
1390
|
-
var INFINITY = 1 / 0;
|
|
1391
|
-
|
|
1392
|
-
/** `Object#toString` result references. */
|
|
1393
|
-
var funcTag = '[object Function]',
|
|
1394
|
-
genTag = '[object GeneratorFunction]',
|
|
1395
|
-
symbolTag = '[object Symbol]';
|
|
1396
|
-
|
|
1397
|
-
/** Used to match property names within property paths. */
|
|
1398
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
1399
|
-
reIsPlainProp = /^\w*$/,
|
|
1400
|
-
reLeadingDot = /^\./,
|
|
1401
|
-
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
1402
|
-
|
|
1403
|
-
/**
|
|
1404
|
-
* Used to match `RegExp`
|
|
1405
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
1406
|
-
*/
|
|
1407
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
1408
|
-
|
|
1409
|
-
/** Used to match backslashes in property paths. */
|
|
1410
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
1411
|
-
|
|
1412
|
-
/** Used to detect host constructors (Safari). */
|
|
1413
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
1414
|
-
|
|
1415
|
-
/** Detect free variable `global` from Node.js. */
|
|
1416
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1417
|
-
|
|
1418
|
-
/** Detect free variable `self`. */
|
|
1419
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
1420
|
-
|
|
1421
|
-
/** Used as a reference to the global object. */
|
|
1422
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
|
1423
|
-
|
|
1424
|
-
/**
|
|
1425
|
-
* Gets the value at `key` of `object`.
|
|
1426
|
-
*
|
|
1427
|
-
* @private
|
|
1428
|
-
* @param {Object} [object] The object to query.
|
|
1429
|
-
* @param {string} key The key of the property to get.
|
|
1430
|
-
* @returns {*} Returns the property value.
|
|
1431
|
-
*/
|
|
1432
|
-
function getValue(object, key) {
|
|
1433
|
-
return object == null ? undefined : object[key];
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
/**
|
|
1437
|
-
* Checks if `value` is a host object in IE < 9.
|
|
1438
|
-
*
|
|
1439
|
-
* @private
|
|
1440
|
-
* @param {*} value The value to check.
|
|
1441
|
-
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
1442
|
-
*/
|
|
1443
|
-
function isHostObject(value) {
|
|
1444
|
-
// Many host objects are `Object` objects that can coerce to strings
|
|
1445
|
-
// despite having improperly defined `toString` methods.
|
|
1446
|
-
var result = false;
|
|
1447
|
-
if (value != null && typeof value.toString != 'function') {
|
|
1448
|
-
try {
|
|
1449
|
-
result = !!(value + '');
|
|
1450
|
-
} catch (e) {}
|
|
1451
|
-
}
|
|
1452
|
-
return result;
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
/** Used for built-in method references. */
|
|
1456
|
-
var arrayProto = Array.prototype,
|
|
1457
|
-
funcProto = Function.prototype,
|
|
1458
|
-
objectProto = Object.prototype;
|
|
1459
|
-
|
|
1460
|
-
/** Used to detect overreaching core-js shims. */
|
|
1461
|
-
var coreJsData = root['__core-js_shared__'];
|
|
1462
|
-
|
|
1463
|
-
/** Used to detect methods masquerading as native. */
|
|
1464
|
-
var maskSrcKey = (function() {
|
|
1465
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
1466
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
1467
|
-
}());
|
|
1468
|
-
|
|
1469
|
-
/** Used to resolve the decompiled source of functions. */
|
|
1470
|
-
var funcToString = funcProto.toString;
|
|
1471
|
-
|
|
1472
|
-
/** Used to check objects for own properties. */
|
|
1473
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1474
|
-
|
|
1475
|
-
/**
|
|
1476
|
-
* Used to resolve the
|
|
1477
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1478
|
-
* of values.
|
|
1479
|
-
*/
|
|
1480
|
-
var objectToString = objectProto.toString;
|
|
1481
|
-
|
|
1482
|
-
/** Used to detect if a method is native. */
|
|
1483
|
-
var reIsNative = RegExp('^' +
|
|
1484
|
-
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
1485
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
1486
|
-
);
|
|
1487
|
-
|
|
1488
|
-
/** Built-in value references. */
|
|
1489
|
-
var Symbol$1 = root.Symbol,
|
|
1490
|
-
splice = arrayProto.splice;
|
|
1491
|
-
|
|
1492
|
-
/* Built-in method references that are verified to be native. */
|
|
1493
|
-
var Map$1 = getNative(root, 'Map'),
|
|
1494
|
-
nativeCreate = getNative(Object, 'create');
|
|
1495
|
-
|
|
1496
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1497
|
-
var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
|
|
1498
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
1499
|
-
|
|
1500
|
-
/**
|
|
1501
|
-
* Creates a hash object.
|
|
1502
|
-
*
|
|
1503
|
-
* @private
|
|
1504
|
-
* @constructor
|
|
1505
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1506
|
-
*/
|
|
1507
|
-
function Hash(entries) {
|
|
1508
|
-
var index = -1,
|
|
1509
|
-
length = entries ? entries.length : 0;
|
|
1510
|
-
|
|
1511
|
-
this.clear();
|
|
1512
|
-
while (++index < length) {
|
|
1513
|
-
var entry = entries[index];
|
|
1514
|
-
this.set(entry[0], entry[1]);
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
/**
|
|
1519
|
-
* Removes all key-value entries from the hash.
|
|
1520
|
-
*
|
|
1521
|
-
* @private
|
|
1522
|
-
* @name clear
|
|
1523
|
-
* @memberOf Hash
|
|
1524
|
-
*/
|
|
1525
|
-
function hashClear() {
|
|
1526
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
/**
|
|
1530
|
-
* Removes `key` and its value from the hash.
|
|
1531
|
-
*
|
|
1532
|
-
* @private
|
|
1533
|
-
* @name delete
|
|
1534
|
-
* @memberOf Hash
|
|
1535
|
-
* @param {Object} hash The hash to modify.
|
|
1536
|
-
* @param {string} key The key of the value to remove.
|
|
1537
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1538
|
-
*/
|
|
1539
|
-
function hashDelete(key) {
|
|
1540
|
-
return this.has(key) && delete this.__data__[key];
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
/**
|
|
1544
|
-
* Gets the hash value for `key`.
|
|
1545
|
-
*
|
|
1546
|
-
* @private
|
|
1547
|
-
* @name get
|
|
1548
|
-
* @memberOf Hash
|
|
1549
|
-
* @param {string} key The key of the value to get.
|
|
1550
|
-
* @returns {*} Returns the entry value.
|
|
1551
|
-
*/
|
|
1552
|
-
function hashGet(key) {
|
|
1553
|
-
var data = this.__data__;
|
|
1554
|
-
if (nativeCreate) {
|
|
1555
|
-
var result = data[key];
|
|
1556
|
-
return result === HASH_UNDEFINED ? undefined : result;
|
|
1557
|
-
}
|
|
1558
|
-
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
/**
|
|
1562
|
-
* Checks if a hash value for `key` exists.
|
|
1563
|
-
*
|
|
1564
|
-
* @private
|
|
1565
|
-
* @name has
|
|
1566
|
-
* @memberOf Hash
|
|
1567
|
-
* @param {string} key The key of the entry to check.
|
|
1568
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1569
|
-
*/
|
|
1570
|
-
function hashHas(key) {
|
|
1571
|
-
var data = this.__data__;
|
|
1572
|
-
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
/**
|
|
1576
|
-
* Sets the hash `key` to `value`.
|
|
1577
|
-
*
|
|
1578
|
-
* @private
|
|
1579
|
-
* @name set
|
|
1580
|
-
* @memberOf Hash
|
|
1581
|
-
* @param {string} key The key of the value to set.
|
|
1582
|
-
* @param {*} value The value to set.
|
|
1583
|
-
* @returns {Object} Returns the hash instance.
|
|
1584
|
-
*/
|
|
1585
|
-
function hashSet(key, value) {
|
|
1586
|
-
var data = this.__data__;
|
|
1587
|
-
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
1588
|
-
return this;
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
// Add methods to `Hash`.
|
|
1592
|
-
Hash.prototype.clear = hashClear;
|
|
1593
|
-
Hash.prototype['delete'] = hashDelete;
|
|
1594
|
-
Hash.prototype.get = hashGet;
|
|
1595
|
-
Hash.prototype.has = hashHas;
|
|
1596
|
-
Hash.prototype.set = hashSet;
|
|
1597
|
-
|
|
1598
|
-
/**
|
|
1599
|
-
* Creates an list cache object.
|
|
1600
|
-
*
|
|
1601
|
-
* @private
|
|
1602
|
-
* @constructor
|
|
1603
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1604
|
-
*/
|
|
1605
|
-
function ListCache(entries) {
|
|
1606
|
-
var index = -1,
|
|
1607
|
-
length = entries ? entries.length : 0;
|
|
1608
|
-
|
|
1609
|
-
this.clear();
|
|
1610
|
-
while (++index < length) {
|
|
1611
|
-
var entry = entries[index];
|
|
1612
|
-
this.set(entry[0], entry[1]);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
/**
|
|
1617
|
-
* Removes all key-value entries from the list cache.
|
|
1618
|
-
*
|
|
1619
|
-
* @private
|
|
1620
|
-
* @name clear
|
|
1621
|
-
* @memberOf ListCache
|
|
1622
|
-
*/
|
|
1623
|
-
function listCacheClear() {
|
|
1624
|
-
this.__data__ = [];
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
/**
|
|
1628
|
-
* Removes `key` and its value from the list cache.
|
|
1629
|
-
*
|
|
1630
|
-
* @private
|
|
1631
|
-
* @name delete
|
|
1632
|
-
* @memberOf ListCache
|
|
1633
|
-
* @param {string} key The key of the value to remove.
|
|
1634
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1635
|
-
*/
|
|
1636
|
-
function listCacheDelete(key) {
|
|
1637
|
-
var data = this.__data__,
|
|
1638
|
-
index = assocIndexOf(data, key);
|
|
1639
|
-
|
|
1640
|
-
if (index < 0) {
|
|
1641
|
-
return false;
|
|
1642
|
-
}
|
|
1643
|
-
var lastIndex = data.length - 1;
|
|
1644
|
-
if (index == lastIndex) {
|
|
1645
|
-
data.pop();
|
|
1646
|
-
} else {
|
|
1647
|
-
splice.call(data, index, 1);
|
|
1648
|
-
}
|
|
1649
|
-
return true;
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
/**
|
|
1653
|
-
* Gets the list cache value for `key`.
|
|
1654
|
-
*
|
|
1655
|
-
* @private
|
|
1656
|
-
* @name get
|
|
1657
|
-
* @memberOf ListCache
|
|
1658
|
-
* @param {string} key The key of the value to get.
|
|
1659
|
-
* @returns {*} Returns the entry value.
|
|
1660
|
-
*/
|
|
1661
|
-
function listCacheGet(key) {
|
|
1662
|
-
var data = this.__data__,
|
|
1663
|
-
index = assocIndexOf(data, key);
|
|
1664
|
-
|
|
1665
|
-
return index < 0 ? undefined : data[index][1];
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
/**
|
|
1669
|
-
* Checks if a list cache value for `key` exists.
|
|
1670
|
-
*
|
|
1671
|
-
* @private
|
|
1672
|
-
* @name has
|
|
1673
|
-
* @memberOf ListCache
|
|
1674
|
-
* @param {string} key The key of the entry to check.
|
|
1675
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1676
|
-
*/
|
|
1677
|
-
function listCacheHas(key) {
|
|
1678
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
/**
|
|
1682
|
-
* Sets the list cache `key` to `value`.
|
|
1683
|
-
*
|
|
1684
|
-
* @private
|
|
1685
|
-
* @name set
|
|
1686
|
-
* @memberOf ListCache
|
|
1687
|
-
* @param {string} key The key of the value to set.
|
|
1688
|
-
* @param {*} value The value to set.
|
|
1689
|
-
* @returns {Object} Returns the list cache instance.
|
|
1690
|
-
*/
|
|
1691
|
-
function listCacheSet(key, value) {
|
|
1692
|
-
var data = this.__data__,
|
|
1693
|
-
index = assocIndexOf(data, key);
|
|
1694
|
-
|
|
1695
|
-
if (index < 0) {
|
|
1696
|
-
data.push([key, value]);
|
|
1697
|
-
} else {
|
|
1698
|
-
data[index][1] = value;
|
|
1699
|
-
}
|
|
1700
|
-
return this;
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
// Add methods to `ListCache`.
|
|
1704
|
-
ListCache.prototype.clear = listCacheClear;
|
|
1705
|
-
ListCache.prototype['delete'] = listCacheDelete;
|
|
1706
|
-
ListCache.prototype.get = listCacheGet;
|
|
1707
|
-
ListCache.prototype.has = listCacheHas;
|
|
1708
|
-
ListCache.prototype.set = listCacheSet;
|
|
1709
|
-
|
|
1710
|
-
/**
|
|
1711
|
-
* Creates a map cache object to store key-value pairs.
|
|
1712
|
-
*
|
|
1713
|
-
* @private
|
|
1714
|
-
* @constructor
|
|
1715
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1716
|
-
*/
|
|
1717
|
-
function MapCache(entries) {
|
|
1718
|
-
var index = -1,
|
|
1719
|
-
length = entries ? entries.length : 0;
|
|
1720
|
-
|
|
1721
|
-
this.clear();
|
|
1722
|
-
while (++index < length) {
|
|
1723
|
-
var entry = entries[index];
|
|
1724
|
-
this.set(entry[0], entry[1]);
|
|
1725
|
-
}
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
/**
|
|
1729
|
-
* Removes all key-value entries from the map.
|
|
1730
|
-
*
|
|
1731
|
-
* @private
|
|
1732
|
-
* @name clear
|
|
1733
|
-
* @memberOf MapCache
|
|
1734
|
-
*/
|
|
1735
|
-
function mapCacheClear() {
|
|
1736
|
-
this.__data__ = {
|
|
1737
|
-
'hash': new Hash,
|
|
1738
|
-
'map': new (Map$1 || ListCache),
|
|
1739
|
-
'string': new Hash
|
|
1740
|
-
};
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
/**
|
|
1744
|
-
* Removes `key` and its value from the map.
|
|
1745
|
-
*
|
|
1746
|
-
* @private
|
|
1747
|
-
* @name delete
|
|
1748
|
-
* @memberOf MapCache
|
|
1749
|
-
* @param {string} key The key of the value to remove.
|
|
1750
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1751
|
-
*/
|
|
1752
|
-
function mapCacheDelete(key) {
|
|
1753
|
-
return getMapData(this, key)['delete'](key);
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
/**
|
|
1757
|
-
* Gets the map value for `key`.
|
|
1758
|
-
*
|
|
1759
|
-
* @private
|
|
1760
|
-
* @name get
|
|
1761
|
-
* @memberOf MapCache
|
|
1762
|
-
* @param {string} key The key of the value to get.
|
|
1763
|
-
* @returns {*} Returns the entry value.
|
|
1764
|
-
*/
|
|
1765
|
-
function mapCacheGet(key) {
|
|
1766
|
-
return getMapData(this, key).get(key);
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
/**
|
|
1770
|
-
* Checks if a map value for `key` exists.
|
|
1771
|
-
*
|
|
1772
|
-
* @private
|
|
1773
|
-
* @name has
|
|
1774
|
-
* @memberOf MapCache
|
|
1775
|
-
* @param {string} key The key of the entry to check.
|
|
1776
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1777
|
-
*/
|
|
1778
|
-
function mapCacheHas(key) {
|
|
1779
|
-
return getMapData(this, key).has(key);
|
|
1780
|
-
}
|
|
1781
|
-
|
|
1782
|
-
/**
|
|
1783
|
-
* Sets the map `key` to `value`.
|
|
1784
|
-
*
|
|
1785
|
-
* @private
|
|
1786
|
-
* @name set
|
|
1787
|
-
* @memberOf MapCache
|
|
1788
|
-
* @param {string} key The key of the value to set.
|
|
1789
|
-
* @param {*} value The value to set.
|
|
1790
|
-
* @returns {Object} Returns the map cache instance.
|
|
1791
|
-
*/
|
|
1792
|
-
function mapCacheSet(key, value) {
|
|
1793
|
-
getMapData(this, key).set(key, value);
|
|
1794
|
-
return this;
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
// Add methods to `MapCache`.
|
|
1798
|
-
MapCache.prototype.clear = mapCacheClear;
|
|
1799
|
-
MapCache.prototype['delete'] = mapCacheDelete;
|
|
1800
|
-
MapCache.prototype.get = mapCacheGet;
|
|
1801
|
-
MapCache.prototype.has = mapCacheHas;
|
|
1802
|
-
MapCache.prototype.set = mapCacheSet;
|
|
1803
|
-
|
|
1804
|
-
/**
|
|
1805
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
1806
|
-
*
|
|
1807
|
-
* @private
|
|
1808
|
-
* @param {Array} array The array to inspect.
|
|
1809
|
-
* @param {*} key The key to search for.
|
|
1810
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
1811
|
-
*/
|
|
1812
|
-
function assocIndexOf(array, key) {
|
|
1813
|
-
var length = array.length;
|
|
1814
|
-
while (length--) {
|
|
1815
|
-
if (eq(array[length][0], key)) {
|
|
1816
|
-
return length;
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
return -1;
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
/**
|
|
1823
|
-
* The base implementation of `_.get` without support for default values.
|
|
1824
|
-
*
|
|
1825
|
-
* @private
|
|
1826
|
-
* @param {Object} object The object to query.
|
|
1827
|
-
* @param {Array|string} path The path of the property to get.
|
|
1828
|
-
* @returns {*} Returns the resolved value.
|
|
1829
|
-
*/
|
|
1830
|
-
function baseGet(object, path) {
|
|
1831
|
-
path = isKey(path, object) ? [path] : castPath(path);
|
|
1832
|
-
|
|
1833
|
-
var index = 0,
|
|
1834
|
-
length = path.length;
|
|
1835
|
-
|
|
1836
|
-
while (object != null && index < length) {
|
|
1837
|
-
object = object[toKey(path[index++])];
|
|
1838
|
-
}
|
|
1839
|
-
return (index && index == length) ? object : undefined;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
/**
|
|
1843
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
1844
|
-
*
|
|
1845
|
-
* @private
|
|
1846
|
-
* @param {*} value The value to check.
|
|
1847
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
1848
|
-
* else `false`.
|
|
1849
|
-
*/
|
|
1850
|
-
function baseIsNative(value) {
|
|
1851
|
-
if (!isObject(value) || isMasked(value)) {
|
|
1852
|
-
return false;
|
|
1853
|
-
}
|
|
1854
|
-
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
|
1855
|
-
return pattern.test(toSource(value));
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
/**
|
|
1859
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1860
|
-
* values to empty strings.
|
|
1861
|
-
*
|
|
1862
|
-
* @private
|
|
1863
|
-
* @param {*} value The value to process.
|
|
1864
|
-
* @returns {string} Returns the string.
|
|
1865
|
-
*/
|
|
1866
|
-
function baseToString(value) {
|
|
1867
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
1868
|
-
if (typeof value == 'string') {
|
|
1869
|
-
return value;
|
|
1870
|
-
}
|
|
1871
|
-
if (isSymbol(value)) {
|
|
1872
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
1873
|
-
}
|
|
1874
|
-
var result = (value + '');
|
|
1875
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
/**
|
|
1879
|
-
* Casts `value` to a path array if it's not one.
|
|
1880
|
-
*
|
|
1881
|
-
* @private
|
|
1882
|
-
* @param {*} value The value to inspect.
|
|
1883
|
-
* @returns {Array} Returns the cast property path array.
|
|
1884
|
-
*/
|
|
1885
|
-
function castPath(value) {
|
|
1886
|
-
return isArray(value) ? value : stringToPath(value);
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
/**
|
|
1890
|
-
* Gets the data for `map`.
|
|
1891
|
-
*
|
|
1892
|
-
* @private
|
|
1893
|
-
* @param {Object} map The map to query.
|
|
1894
|
-
* @param {string} key The reference key.
|
|
1895
|
-
* @returns {*} Returns the map data.
|
|
1896
|
-
*/
|
|
1897
|
-
function getMapData(map, key) {
|
|
1898
|
-
var data = map.__data__;
|
|
1899
|
-
return isKeyable(key)
|
|
1900
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
1901
|
-
: data.map;
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
/**
|
|
1905
|
-
* Gets the native function at `key` of `object`.
|
|
1906
|
-
*
|
|
1907
|
-
* @private
|
|
1908
|
-
* @param {Object} object The object to query.
|
|
1909
|
-
* @param {string} key The key of the method to get.
|
|
1910
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
1911
|
-
*/
|
|
1912
|
-
function getNative(object, key) {
|
|
1913
|
-
var value = getValue(object, key);
|
|
1914
|
-
return baseIsNative(value) ? value : undefined;
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
/**
|
|
1918
|
-
* Checks if `value` is a property name and not a property path.
|
|
1919
|
-
*
|
|
1920
|
-
* @private
|
|
1921
|
-
* @param {*} value The value to check.
|
|
1922
|
-
* @param {Object} [object] The object to query keys on.
|
|
1923
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
1924
|
-
*/
|
|
1925
|
-
function isKey(value, object) {
|
|
1926
|
-
if (isArray(value)) {
|
|
1927
|
-
return false;
|
|
1928
|
-
}
|
|
1929
|
-
var type = typeof value;
|
|
1930
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
1931
|
-
value == null || isSymbol(value)) {
|
|
1932
|
-
return true;
|
|
1933
|
-
}
|
|
1934
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
1935
|
-
(object != null && value in Object(object));
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
/**
|
|
1939
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
1940
|
-
*
|
|
1941
|
-
* @private
|
|
1942
|
-
* @param {*} value The value to check.
|
|
1943
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
1944
|
-
*/
|
|
1945
|
-
function isKeyable(value) {
|
|
1946
|
-
var type = typeof value;
|
|
1947
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
1948
|
-
? (value !== '__proto__')
|
|
1949
|
-
: (value === null);
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
/**
|
|
1953
|
-
* Checks if `func` has its source masked.
|
|
1954
|
-
*
|
|
1955
|
-
* @private
|
|
1956
|
-
* @param {Function} func The function to check.
|
|
1957
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
1958
|
-
*/
|
|
1959
|
-
function isMasked(func) {
|
|
1960
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
/**
|
|
1964
|
-
* Converts `string` to a property path array.
|
|
1965
|
-
*
|
|
1966
|
-
* @private
|
|
1967
|
-
* @param {string} string The string to convert.
|
|
1968
|
-
* @returns {Array} Returns the property path array.
|
|
1969
|
-
*/
|
|
1970
|
-
var stringToPath = memoize(function(string) {
|
|
1971
|
-
string = toString(string);
|
|
1972
|
-
|
|
1973
|
-
var result = [];
|
|
1974
|
-
if (reLeadingDot.test(string)) {
|
|
1975
|
-
result.push('');
|
|
1976
|
-
}
|
|
1977
|
-
string.replace(rePropName, function(match, number, quote, string) {
|
|
1978
|
-
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
|
|
1979
|
-
});
|
|
1980
|
-
return result;
|
|
1981
|
-
});
|
|
1982
|
-
|
|
1983
|
-
/**
|
|
1984
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
1985
|
-
*
|
|
1986
|
-
* @private
|
|
1987
|
-
* @param {*} value The value to inspect.
|
|
1988
|
-
* @returns {string|symbol} Returns the key.
|
|
1989
|
-
*/
|
|
1990
|
-
function toKey(value) {
|
|
1991
|
-
if (typeof value == 'string' || isSymbol(value)) {
|
|
1992
|
-
return value;
|
|
1993
|
-
}
|
|
1994
|
-
var result = (value + '');
|
|
1995
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
1996
|
-
}
|
|
1997
|
-
|
|
1998
|
-
/**
|
|
1999
|
-
* Converts `func` to its source code.
|
|
2000
|
-
*
|
|
2001
|
-
* @private
|
|
2002
|
-
* @param {Function} func The function to process.
|
|
2003
|
-
* @returns {string} Returns the source code.
|
|
2004
|
-
*/
|
|
2005
|
-
function toSource(func) {
|
|
2006
|
-
if (func != null) {
|
|
2007
|
-
try {
|
|
2008
|
-
return funcToString.call(func);
|
|
2009
|
-
} catch (e) {}
|
|
2010
|
-
try {
|
|
2011
|
-
return (func + '');
|
|
2012
|
-
} catch (e) {}
|
|
2013
|
-
}
|
|
2014
|
-
return '';
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
/**
|
|
2018
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
2019
|
-
* provided, it determines the cache key for storing the result based on the
|
|
2020
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
2021
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
2022
|
-
* is invoked with the `this` binding of the memoized function.
|
|
2023
|
-
*
|
|
2024
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
2025
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
2026
|
-
* constructor with one whose instances implement the
|
|
2027
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
2028
|
-
* method interface of `delete`, `get`, `has`, and `set`.
|
|
2029
|
-
*
|
|
2030
|
-
* @static
|
|
2031
|
-
* @memberOf _
|
|
2032
|
-
* @since 0.1.0
|
|
2033
|
-
* @category Function
|
|
2034
|
-
* @param {Function} func The function to have its output memoized.
|
|
2035
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
2036
|
-
* @returns {Function} Returns the new memoized function.
|
|
2037
|
-
* @example
|
|
2038
|
-
*
|
|
2039
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
2040
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
2041
|
-
*
|
|
2042
|
-
* var values = _.memoize(_.values);
|
|
2043
|
-
* values(object);
|
|
2044
|
-
* // => [1, 2]
|
|
2045
|
-
*
|
|
2046
|
-
* values(other);
|
|
2047
|
-
* // => [3, 4]
|
|
2048
|
-
*
|
|
2049
|
-
* object.a = 2;
|
|
2050
|
-
* values(object);
|
|
2051
|
-
* // => [1, 2]
|
|
2052
|
-
*
|
|
2053
|
-
* // Modify the result cache.
|
|
2054
|
-
* values.cache.set(object, ['a', 'b']);
|
|
2055
|
-
* values(object);
|
|
2056
|
-
* // => ['a', 'b']
|
|
2057
|
-
*
|
|
2058
|
-
* // Replace `_.memoize.Cache`.
|
|
2059
|
-
* _.memoize.Cache = WeakMap;
|
|
2060
|
-
*/
|
|
2061
|
-
function memoize(func, resolver) {
|
|
2062
|
-
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
|
2063
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
2064
|
-
}
|
|
2065
|
-
var memoized = function() {
|
|
2066
|
-
var args = arguments,
|
|
2067
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
2068
|
-
cache = memoized.cache;
|
|
2069
|
-
|
|
2070
|
-
if (cache.has(key)) {
|
|
2071
|
-
return cache.get(key);
|
|
2072
|
-
}
|
|
2073
|
-
var result = func.apply(this, args);
|
|
2074
|
-
memoized.cache = cache.set(key, result);
|
|
2075
|
-
return result;
|
|
2076
|
-
};
|
|
2077
|
-
memoized.cache = new (memoize.Cache || MapCache);
|
|
2078
|
-
return memoized;
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
// Assign cache to `_.memoize`.
|
|
2082
|
-
memoize.Cache = MapCache;
|
|
2083
|
-
|
|
2084
|
-
/**
|
|
2085
|
-
* Performs a
|
|
2086
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
2087
|
-
* comparison between two values to determine if they are equivalent.
|
|
2088
|
-
*
|
|
2089
|
-
* @static
|
|
2090
|
-
* @memberOf _
|
|
2091
|
-
* @since 4.0.0
|
|
2092
|
-
* @category Lang
|
|
2093
|
-
* @param {*} value The value to compare.
|
|
2094
|
-
* @param {*} other The other value to compare.
|
|
2095
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
2096
|
-
* @example
|
|
2097
|
-
*
|
|
2098
|
-
* var object = { 'a': 1 };
|
|
2099
|
-
* var other = { 'a': 1 };
|
|
2100
|
-
*
|
|
2101
|
-
* _.eq(object, object);
|
|
2102
|
-
* // => true
|
|
2103
|
-
*
|
|
2104
|
-
* _.eq(object, other);
|
|
2105
|
-
* // => false
|
|
2106
|
-
*
|
|
2107
|
-
* _.eq('a', 'a');
|
|
2108
|
-
* // => true
|
|
2109
|
-
*
|
|
2110
|
-
* _.eq('a', Object('a'));
|
|
2111
|
-
* // => false
|
|
2112
|
-
*
|
|
2113
|
-
* _.eq(NaN, NaN);
|
|
2114
|
-
* // => true
|
|
2115
|
-
*/
|
|
2116
|
-
function eq(value, other) {
|
|
2117
|
-
return value === other || (value !== value && other !== other);
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
/**
|
|
2121
|
-
* Checks if `value` is classified as an `Array` object.
|
|
2122
|
-
*
|
|
2123
|
-
* @static
|
|
2124
|
-
* @memberOf _
|
|
2125
|
-
* @since 0.1.0
|
|
2126
|
-
* @category Lang
|
|
2127
|
-
* @param {*} value The value to check.
|
|
2128
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
2129
|
-
* @example
|
|
2130
|
-
*
|
|
2131
|
-
* _.isArray([1, 2, 3]);
|
|
2132
|
-
* // => true
|
|
2133
|
-
*
|
|
2134
|
-
* _.isArray(document.body.children);
|
|
2135
|
-
* // => false
|
|
2136
|
-
*
|
|
2137
|
-
* _.isArray('abc');
|
|
2138
|
-
* // => false
|
|
2139
|
-
*
|
|
2140
|
-
* _.isArray(_.noop);
|
|
2141
|
-
* // => false
|
|
2142
|
-
*/
|
|
2143
|
-
var isArray = Array.isArray;
|
|
2144
|
-
|
|
2145
|
-
/**
|
|
2146
|
-
* Checks if `value` is classified as a `Function` object.
|
|
2147
|
-
*
|
|
2148
|
-
* @static
|
|
2149
|
-
* @memberOf _
|
|
2150
|
-
* @since 0.1.0
|
|
2151
|
-
* @category Lang
|
|
2152
|
-
* @param {*} value The value to check.
|
|
2153
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
2154
|
-
* @example
|
|
2155
|
-
*
|
|
2156
|
-
* _.isFunction(_);
|
|
2157
|
-
* // => true
|
|
2158
|
-
*
|
|
2159
|
-
* _.isFunction(/abc/);
|
|
2160
|
-
* // => false
|
|
2161
|
-
*/
|
|
2162
|
-
function isFunction(value) {
|
|
2163
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
2164
|
-
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
2165
|
-
var tag = isObject(value) ? objectToString.call(value) : '';
|
|
2166
|
-
return tag == funcTag || tag == genTag;
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
/**
|
|
2170
|
-
* Checks if `value` is the
|
|
2171
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
2172
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
2173
|
-
*
|
|
2174
|
-
* @static
|
|
2175
|
-
* @memberOf _
|
|
2176
|
-
* @since 0.1.0
|
|
2177
|
-
* @category Lang
|
|
2178
|
-
* @param {*} value The value to check.
|
|
2179
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
2180
|
-
* @example
|
|
2181
|
-
*
|
|
2182
|
-
* _.isObject({});
|
|
2183
|
-
* // => true
|
|
2184
|
-
*
|
|
2185
|
-
* _.isObject([1, 2, 3]);
|
|
2186
|
-
* // => true
|
|
2187
|
-
*
|
|
2188
|
-
* _.isObject(_.noop);
|
|
2189
|
-
* // => true
|
|
2190
|
-
*
|
|
2191
|
-
* _.isObject(null);
|
|
2192
|
-
* // => false
|
|
2193
|
-
*/
|
|
2194
|
-
function isObject(value) {
|
|
2195
|
-
var type = typeof value;
|
|
2196
|
-
return !!value && (type == 'object' || type == 'function');
|
|
2197
|
-
}
|
|
2198
|
-
|
|
2199
|
-
/**
|
|
2200
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
2201
|
-
* and has a `typeof` result of "object".
|
|
2202
|
-
*
|
|
2203
|
-
* @static
|
|
2204
|
-
* @memberOf _
|
|
2205
|
-
* @since 4.0.0
|
|
2206
|
-
* @category Lang
|
|
2207
|
-
* @param {*} value The value to check.
|
|
2208
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
2209
|
-
* @example
|
|
2210
|
-
*
|
|
2211
|
-
* _.isObjectLike({});
|
|
2212
|
-
* // => true
|
|
2213
|
-
*
|
|
2214
|
-
* _.isObjectLike([1, 2, 3]);
|
|
2215
|
-
* // => true
|
|
2216
|
-
*
|
|
2217
|
-
* _.isObjectLike(_.noop);
|
|
2218
|
-
* // => false
|
|
2219
|
-
*
|
|
2220
|
-
* _.isObjectLike(null);
|
|
2221
|
-
* // => false
|
|
2222
|
-
*/
|
|
2223
|
-
function isObjectLike(value) {
|
|
2224
|
-
return !!value && typeof value == 'object';
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
/**
|
|
2228
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
2229
|
-
*
|
|
2230
|
-
* @static
|
|
2231
|
-
* @memberOf _
|
|
2232
|
-
* @since 4.0.0
|
|
2233
|
-
* @category Lang
|
|
2234
|
-
* @param {*} value The value to check.
|
|
2235
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
2236
|
-
* @example
|
|
2237
|
-
*
|
|
2238
|
-
* _.isSymbol(Symbol.iterator);
|
|
2239
|
-
* // => true
|
|
2240
|
-
*
|
|
2241
|
-
* _.isSymbol('abc');
|
|
2242
|
-
* // => false
|
|
2243
|
-
*/
|
|
2244
|
-
function isSymbol(value) {
|
|
2245
|
-
return typeof value == 'symbol' ||
|
|
2246
|
-
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
2247
|
-
}
|
|
2248
|
-
|
|
2249
|
-
/**
|
|
2250
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
2251
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
2252
|
-
*
|
|
2253
|
-
* @static
|
|
2254
|
-
* @memberOf _
|
|
2255
|
-
* @since 4.0.0
|
|
2256
|
-
* @category Lang
|
|
2257
|
-
* @param {*} value The value to process.
|
|
2258
|
-
* @returns {string} Returns the string.
|
|
2259
|
-
* @example
|
|
2260
|
-
*
|
|
2261
|
-
* _.toString(null);
|
|
2262
|
-
* // => ''
|
|
2263
|
-
*
|
|
2264
|
-
* _.toString(-0);
|
|
2265
|
-
* // => '-0'
|
|
2266
|
-
*
|
|
2267
|
-
* _.toString([1, 2, 3]);
|
|
2268
|
-
* // => '1,2,3'
|
|
2269
|
-
*/
|
|
2270
|
-
function toString(value) {
|
|
2271
|
-
return value == null ? '' : baseToString(value);
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
/**
|
|
2275
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
2276
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
2277
|
-
*
|
|
2278
|
-
* @static
|
|
2279
|
-
* @memberOf _
|
|
2280
|
-
* @since 3.7.0
|
|
2281
|
-
* @category Object
|
|
2282
|
-
* @param {Object} object The object to query.
|
|
2283
|
-
* @param {Array|string} path The path of the property to get.
|
|
2284
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
2285
|
-
* @returns {*} Returns the resolved value.
|
|
2286
|
-
* @example
|
|
2287
|
-
*
|
|
2288
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2289
|
-
*
|
|
2290
|
-
* _.get(object, 'a[0].b.c');
|
|
2291
|
-
* // => 3
|
|
2292
|
-
*
|
|
2293
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
2294
|
-
* // => 3
|
|
2295
|
-
*
|
|
2296
|
-
* _.get(object, 'a.b.c', 'default');
|
|
2297
|
-
* // => 'default'
|
|
2298
|
-
*/
|
|
2299
|
-
function get(object, path, defaultValue) {
|
|
2300
|
-
var result = object == null ? undefined : baseGet(object, path);
|
|
2301
|
-
return result === undefined ? defaultValue : result;
|
|
2302
|
-
}
|
|
2303
|
-
|
|
2304
|
-
var lodash_get = get;
|
|
2305
|
-
|
|
2306
|
-
var defaultContext = {
|
|
2307
|
-
color: 'currentColor',
|
|
2308
|
-
size: 24,
|
|
2309
|
-
palette: {},
|
|
2310
|
-
};
|
|
2311
|
-
var IconContext = createContext(defaultContext);
|
|
2312
|
-
function withIconContext(Comp) {
|
|
2313
|
-
return function (props) { return (jsxRuntime.exports.jsx(IconContext.Consumer, { children: function (contextValue) { return jsxRuntime.exports.jsx(Comp, __assign({}, props, contextValue), void 0); } }, void 0)); };
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
var IconProvider = function (_a) {
|
|
2317
|
-
var palette = _a.palette, defaultColor = _a.defaultColor, defaultSize = _a.defaultSize, children = _a.children, props = __rest(_a, ["palette", "defaultColor", "defaultSize", "children"]);
|
|
2318
|
-
// Checks if default color comes from the palette, else we take default color value
|
|
2319
|
-
var color = useMemo(function () { return lodash_get(palette, defaultColor || '', defaultColor); }, [defaultColor, palette]);
|
|
2320
|
-
var defaultValue = useMemo(function () {
|
|
2321
|
-
return Object.entries({
|
|
2322
|
-
size: defaultSize,
|
|
2323
|
-
color: color,
|
|
2324
|
-
palette: palette,
|
|
2325
|
-
}).reduce(function (acc, _a) {
|
|
2326
|
-
var _b;
|
|
2327
|
-
var key = _a[0], value = _a[1];
|
|
2328
|
-
return (!!value ? __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b)) : acc);
|
|
2329
|
-
}, {});
|
|
2330
|
-
}, [defaultSize, color, palette]);
|
|
2331
|
-
return (jsxRuntime.exports.jsx(IconContext.Provider, __assign({ value: __assign(__assign(__assign({}, defaultContext), props), defaultValue) }, { children: children }), void 0));
|
|
2332
|
-
};
|
|
2333
|
-
|
|
2334
|
-
var IconSVG = function (_a) {
|
|
2335
|
-
var defaultColor = _a.color, size = _a.size, src = _a.src, children = _a.children, props = __rest(_a, ["color", "size", "src", "children"]);
|
|
2336
|
-
var defaultContextValues = useContext(IconContext);
|
|
2337
|
-
var defaultValues = __assign(__assign(__assign({}, defaultContextValues), { color: defaultColor || defaultContextValues.color, size: size || defaultContextValues.size }), props);
|
|
2338
|
-
var color = useMemo(function () { return lodash_get(defaultValues.palette, defaultValues.color, defaultValues.color); }, [defaultValues.color, defaultValues.palette]);
|
|
2339
|
-
useEffect(function () {
|
|
2340
|
-
if (src && !children) {
|
|
2341
|
-
var wrapper = document.getElementById('SVGWrapper');
|
|
2342
|
-
wrapper.innerHTML = atob(src);
|
|
2343
|
-
var svg = wrapper === null || wrapper === void 0 ? void 0 : wrapper.children;
|
|
2344
|
-
var path = svg === null || svg === void 0 ? void 0 : svg[0].firstElementChild;
|
|
2345
|
-
svg === null || svg === void 0 ? void 0 : svg[0].setAttribute('width', typeof defaultValues.size === 'number'
|
|
2346
|
-
? defaultValues.size + 'px'
|
|
2347
|
-
: defaultValues.size);
|
|
2348
|
-
svg === null || svg === void 0 ? void 0 : svg[0].setAttribute('height', typeof defaultValues.size === 'number'
|
|
2349
|
-
? defaultValues.size + 'px'
|
|
2350
|
-
: defaultValues.size);
|
|
2351
|
-
path === null || path === void 0 ? void 0 : path.setAttribute('fill', color);
|
|
2352
|
-
}
|
|
2353
|
-
}, [color, src, children, size]);
|
|
2354
|
-
return children ? (require$$0.cloneElement(children, __assign({ fill: color, width: size, height: size }, props))) : src ? (jsxRuntime.exports.jsx("div", { id: "SVGWrapper" }, void 0)) : null;
|
|
2355
|
-
};
|
|
2356
|
-
|
|
2357
|
-
export { IconContext, IconProvider, IconSVG, defaultContext, withIconContext };
|