1 | import ReactFiberReconciler from 'react-reconciler';
|
2 |
|
3 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
4 |
|
5 | function createCommonjsModule(fn, module) {
|
6 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
7 | }
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
16 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
17 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
18 |
|
19 | function toObject(val) {
|
20 | if (val === null || val === undefined) {
|
21 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
22 | }
|
23 |
|
24 | return Object(val);
|
25 | }
|
26 |
|
27 | function shouldUseNative() {
|
28 | try {
|
29 | if (!Object.assign) {
|
30 | return false;
|
31 | }
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | var test1 = new String('abc');
|
37 | test1[5] = 'de';
|
38 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
39 | return false;
|
40 | }
|
41 |
|
42 |
|
43 | var test2 = {};
|
44 | for (var i = 0; i < 10; i++) {
|
45 | test2['_' + String.fromCharCode(i)] = i;
|
46 | }
|
47 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
48 | return test2[n];
|
49 | });
|
50 | if (order2.join('') !== '0123456789') {
|
51 | return false;
|
52 | }
|
53 |
|
54 |
|
55 | var test3 = {};
|
56 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
57 | test3[letter] = letter;
|
58 | });
|
59 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
60 | 'abcdefghijklmnopqrst') {
|
61 | return false;
|
62 | }
|
63 |
|
64 | return true;
|
65 | } catch (err) {
|
66 |
|
67 | return false;
|
68 | }
|
69 | }
|
70 |
|
71 | var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
72 | var from;
|
73 | var to = toObject(target);
|
74 | var symbols;
|
75 |
|
76 | for (var s = 1; s < arguments.length; s++) {
|
77 | from = Object(arguments[s]);
|
78 |
|
79 | for (var key in from) {
|
80 | if (hasOwnProperty.call(from, key)) {
|
81 | to[key] = from[key];
|
82 | }
|
83 | }
|
84 |
|
85 | if (getOwnPropertySymbols) {
|
86 | symbols = getOwnPropertySymbols(from);
|
87 | for (var i = 0; i < symbols.length; i++) {
|
88 | if (propIsEnumerable.call(from, symbols[i])) {
|
89 | to[symbols[i]] = from[symbols[i]];
|
90 | }
|
91 | }
|
92 | }
|
93 | }
|
94 |
|
95 | return to;
|
96 | };
|
97 |
|
98 | var react_production_min = createCommonjsModule(function (module, exports) {
|
99 | var n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;
|
100 | if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;
|
101 | function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
102 | var A={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState");};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
|
103 | function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}var F=E.prototype=new D;F.constructor=E;objectAssign(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
|
104 | function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f;}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return {$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
|
105 | function K(a,b){return {$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return "object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
106 | function O(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case n:case p:h=!0;}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
|
107 | 0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d);}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
|
108 | function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b);},function(b){0===a._status&&(a._status=2,a._result=b);});}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:objectAssign};
|
109 | exports.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments);},c);},count:function(a){var b=0;P(a,function(){b++;});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};exports.Component=C;exports.PureComponent=E;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
|
110 | exports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=objectAssign({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g;}return {$$typeof:n,type:a.type,
|
111 | key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=J;exports.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};exports.createRef=function(){return {current:null}};exports.forwardRef=function(a){return {$$typeof:t,render:a}};exports.isValidElement=L;
|
112 | exports.lazy=function(a){return {$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};exports.memo=function(a,b){return {$$typeof:u,type:a,compare:void 0===b?null:b}};exports.useCallback=function(a,b){return S().useCallback(a,b)};exports.useContext=function(a,b){return S().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return S().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
|
113 | exports.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S().useMemo(a,b)};exports.useReducer=function(a,b,c){return S().useReducer(a,b,c)};exports.useRef=function(a){return S().useRef(a)};exports.useState=function(a){return S().useState(a)};exports.version="17.0.1";
|
114 | });
|
115 | react_production_min.Fragment;
|
116 | react_production_min.StrictMode;
|
117 | react_production_min.Profiler;
|
118 | react_production_min.Suspense;
|
119 | react_production_min.Children;
|
120 | react_production_min.Component;
|
121 | react_production_min.PureComponent;
|
122 | react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
123 | react_production_min.cloneElement;
|
124 | react_production_min.createContext;
|
125 | react_production_min.createElement;
|
126 | react_production_min.createFactory;
|
127 | react_production_min.createRef;
|
128 | react_production_min.forwardRef;
|
129 | react_production_min.isValidElement;
|
130 | react_production_min.lazy;
|
131 | react_production_min.memo;
|
132 | react_production_min.useCallback;
|
133 | react_production_min.useContext;
|
134 | react_production_min.useDebugValue;
|
135 | react_production_min.useEffect;
|
136 | react_production_min.useImperativeHandle;
|
137 | react_production_min.useLayoutEffect;
|
138 | react_production_min.useMemo;
|
139 | react_production_min.useReducer;
|
140 | react_production_min.useRef;
|
141 | react_production_min.useState;
|
142 | react_production_min.version;
|
143 |
|
144 | var react_development = createCommonjsModule(function (module, exports) {
|
145 |
|
146 | if (process.env.NODE_ENV !== "production") {
|
147 | (function() {
|
148 |
|
149 | var _assign = objectAssign;
|
150 |
|
151 |
|
152 | var ReactVersion = '17.0.1';
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 | var REACT_ELEMENT_TYPE = 0xeac7;
|
160 | var REACT_PORTAL_TYPE = 0xeaca;
|
161 | exports.Fragment = 0xeacb;
|
162 | exports.StrictMode = 0xeacc;
|
163 | exports.Profiler = 0xead2;
|
164 | var REACT_PROVIDER_TYPE = 0xeacd;
|
165 | var REACT_CONTEXT_TYPE = 0xeace;
|
166 | var REACT_FORWARD_REF_TYPE = 0xead0;
|
167 | exports.Suspense = 0xead1;
|
168 | var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
169 | var REACT_MEMO_TYPE = 0xead3;
|
170 | var REACT_LAZY_TYPE = 0xead4;
|
171 | var REACT_BLOCK_TYPE = 0xead9;
|
172 | var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
173 | var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
174 | var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
175 | var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
176 |
|
177 | if (typeof Symbol === 'function' && Symbol.for) {
|
178 | var symbolFor = Symbol.for;
|
179 | REACT_ELEMENT_TYPE = symbolFor('react.element');
|
180 | REACT_PORTAL_TYPE = symbolFor('react.portal');
|
181 | exports.Fragment = symbolFor('react.fragment');
|
182 | exports.StrictMode = symbolFor('react.strict_mode');
|
183 | exports.Profiler = symbolFor('react.profiler');
|
184 | REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
185 | REACT_CONTEXT_TYPE = symbolFor('react.context');
|
186 | REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
187 | exports.Suspense = symbolFor('react.suspense');
|
188 | REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
189 | REACT_MEMO_TYPE = symbolFor('react.memo');
|
190 | REACT_LAZY_TYPE = symbolFor('react.lazy');
|
191 | REACT_BLOCK_TYPE = symbolFor('react.block');
|
192 | REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
193 | REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
194 | symbolFor('react.scope');
|
195 | symbolFor('react.opaque.id');
|
196 | REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
197 | symbolFor('react.offscreen');
|
198 | REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
199 | }
|
200 |
|
201 | var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
202 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
203 | function getIteratorFn(maybeIterable) {
|
204 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
205 | return null;
|
206 | }
|
207 |
|
208 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
209 |
|
210 | if (typeof maybeIterator === 'function') {
|
211 | return maybeIterator;
|
212 | }
|
213 |
|
214 | return null;
|
215 | }
|
216 |
|
217 |
|
218 |
|
219 |
|
220 | var ReactCurrentDispatcher = {
|
221 | |
222 |
|
223 |
|
224 |
|
225 | current: null
|
226 | };
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 | var ReactCurrentBatchConfig = {
|
233 | transition: 0
|
234 | };
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 | var ReactCurrentOwner = {
|
243 | |
244 |
|
245 |
|
246 |
|
247 | current: null
|
248 | };
|
249 |
|
250 | var ReactDebugCurrentFrame = {};
|
251 | var currentExtraStackFrame = null;
|
252 | function setExtraStackFrame(stack) {
|
253 | {
|
254 | currentExtraStackFrame = stack;
|
255 | }
|
256 | }
|
257 |
|
258 | {
|
259 | ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
|
260 | {
|
261 | currentExtraStackFrame = stack;
|
262 | }
|
263 | };
|
264 |
|
265 |
|
266 | ReactDebugCurrentFrame.getCurrentStack = null;
|
267 |
|
268 | ReactDebugCurrentFrame.getStackAddendum = function () {
|
269 | var stack = '';
|
270 |
|
271 | if (currentExtraStackFrame) {
|
272 | stack += currentExtraStackFrame;
|
273 | }
|
274 |
|
275 |
|
276 | var impl = ReactDebugCurrentFrame.getCurrentStack;
|
277 |
|
278 | if (impl) {
|
279 | stack += impl() || '';
|
280 | }
|
281 |
|
282 | return stack;
|
283 | };
|
284 | }
|
285 |
|
286 |
|
287 |
|
288 |
|
289 | var IsSomeRendererActing = {
|
290 | current: false
|
291 | };
|
292 |
|
293 | var ReactSharedInternals = {
|
294 | ReactCurrentDispatcher: ReactCurrentDispatcher,
|
295 | ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
296 | ReactCurrentOwner: ReactCurrentOwner,
|
297 | IsSomeRendererActing: IsSomeRendererActing,
|
298 |
|
299 | assign: _assign
|
300 | };
|
301 |
|
302 | {
|
303 | ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
304 | }
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 | function warn(format) {
|
312 | {
|
313 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
314 | args[_key - 1] = arguments[_key];
|
315 | }
|
316 |
|
317 | printWarning('warn', format, args);
|
318 | }
|
319 | }
|
320 | function error(format) {
|
321 | {
|
322 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
323 | args[_key2 - 1] = arguments[_key2];
|
324 | }
|
325 |
|
326 | printWarning('error', format, args);
|
327 | }
|
328 | }
|
329 |
|
330 | function printWarning(level, format, args) {
|
331 |
|
332 |
|
333 | {
|
334 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
335 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
336 |
|
337 | if (stack !== '') {
|
338 | format += '%s';
|
339 | args = args.concat([stack]);
|
340 | }
|
341 |
|
342 | var argsWithFormat = args.map(function (item) {
|
343 | return '' + item;
|
344 | });
|
345 |
|
346 | argsWithFormat.unshift('Warning: ' + format);
|
347 |
|
348 |
|
349 |
|
350 | Function.prototype.apply.call(console[level], console, argsWithFormat);
|
351 | }
|
352 | }
|
353 |
|
354 | var didWarnStateUpdateForUnmountedComponent = {};
|
355 |
|
356 | function warnNoop(publicInstance, callerName) {
|
357 | {
|
358 | var _constructor = publicInstance.constructor;
|
359 | var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
360 | var warningKey = componentName + "." + callerName;
|
361 |
|
362 | if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
363 | return;
|
364 | }
|
365 |
|
366 | error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
367 |
|
368 | didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
369 | }
|
370 | }
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 | var ReactNoopUpdateQueue = {
|
377 | |
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 | isMounted: function (publicInstance) {
|
385 | return false;
|
386 | },
|
387 |
|
388 | |
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 | enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
404 | warnNoop(publicInstance, 'forceUpdate');
|
405 | },
|
406 |
|
407 | |
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 | enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
421 | warnNoop(publicInstance, 'replaceState');
|
422 | },
|
423 |
|
424 | |
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 | enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
437 | warnNoop(publicInstance, 'setState');
|
438 | }
|
439 | };
|
440 |
|
441 | var emptyObject = {};
|
442 |
|
443 | {
|
444 | Object.freeze(emptyObject);
|
445 | }
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 | function Component(props, context, updater) {
|
452 | this.props = props;
|
453 | this.context = context;
|
454 |
|
455 | this.refs = emptyObject;
|
456 |
|
457 |
|
458 | this.updater = updater || ReactNoopUpdateQueue;
|
459 | }
|
460 |
|
461 | Component.prototype.isReactComponent = {};
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 | Component.prototype.setState = function (partialState, callback) {
|
489 | if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
490 | {
|
491 | throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
|
492 | }
|
493 | }
|
494 |
|
495 | this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
496 | };
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 | Component.prototype.forceUpdate = function (callback) {
|
514 | this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
515 | };
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 | {
|
524 | var deprecatedAPIs = {
|
525 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
526 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
527 | };
|
528 |
|
529 | var defineDeprecationWarning = function (methodName, info) {
|
530 | Object.defineProperty(Component.prototype, methodName, {
|
531 | get: function () {
|
532 | warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
533 |
|
534 | return undefined;
|
535 | }
|
536 | });
|
537 | };
|
538 |
|
539 | for (var fnName in deprecatedAPIs) {
|
540 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
541 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
542 | }
|
543 | }
|
544 | }
|
545 |
|
546 | function ComponentDummy() {}
|
547 |
|
548 | ComponentDummy.prototype = Component.prototype;
|
549 |
|
550 |
|
551 |
|
552 |
|
553 | function PureComponent(props, context, updater) {
|
554 | this.props = props;
|
555 | this.context = context;
|
556 |
|
557 | this.refs = emptyObject;
|
558 | this.updater = updater || ReactNoopUpdateQueue;
|
559 | }
|
560 |
|
561 | var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
562 | pureComponentPrototype.constructor = PureComponent;
|
563 |
|
564 | _assign(pureComponentPrototype, Component.prototype);
|
565 |
|
566 | pureComponentPrototype.isPureReactComponent = true;
|
567 |
|
568 |
|
569 | function createRef() {
|
570 | var refObject = {
|
571 | current: null
|
572 | };
|
573 |
|
574 | {
|
575 | Object.seal(refObject);
|
576 | }
|
577 |
|
578 | return refObject;
|
579 | }
|
580 |
|
581 | function getWrappedName(outerType, innerType, wrapperName) {
|
582 | var functionName = innerType.displayName || innerType.name || '';
|
583 | return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
584 | }
|
585 |
|
586 | function getContextName(type) {
|
587 | return type.displayName || 'Context';
|
588 | }
|
589 |
|
590 | function getComponentName(type) {
|
591 | if (type == null) {
|
592 |
|
593 | return null;
|
594 | }
|
595 |
|
596 | {
|
597 | if (typeof type.tag === 'number') {
|
598 | error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
599 | }
|
600 | }
|
601 |
|
602 | if (typeof type === 'function') {
|
603 | return type.displayName || type.name || null;
|
604 | }
|
605 |
|
606 | if (typeof type === 'string') {
|
607 | return type;
|
608 | }
|
609 |
|
610 | switch (type) {
|
611 | case exports.Fragment:
|
612 | return 'Fragment';
|
613 |
|
614 | case REACT_PORTAL_TYPE:
|
615 | return 'Portal';
|
616 |
|
617 | case exports.Profiler:
|
618 | return 'Profiler';
|
619 |
|
620 | case exports.StrictMode:
|
621 | return 'StrictMode';
|
622 |
|
623 | case exports.Suspense:
|
624 | return 'Suspense';
|
625 |
|
626 | case REACT_SUSPENSE_LIST_TYPE:
|
627 | return 'SuspenseList';
|
628 | }
|
629 |
|
630 | if (typeof type === 'object') {
|
631 | switch (type.$$typeof) {
|
632 | case REACT_CONTEXT_TYPE:
|
633 | var context = type;
|
634 | return getContextName(context) + '.Consumer';
|
635 |
|
636 | case REACT_PROVIDER_TYPE:
|
637 | var provider = type;
|
638 | return getContextName(provider._context) + '.Provider';
|
639 |
|
640 | case REACT_FORWARD_REF_TYPE:
|
641 | return getWrappedName(type, type.render, 'ForwardRef');
|
642 |
|
643 | case REACT_MEMO_TYPE:
|
644 | return getComponentName(type.type);
|
645 |
|
646 | case REACT_BLOCK_TYPE:
|
647 | return getComponentName(type._render);
|
648 |
|
649 | case REACT_LAZY_TYPE:
|
650 | {
|
651 | var lazyComponent = type;
|
652 | var payload = lazyComponent._payload;
|
653 | var init = lazyComponent._init;
|
654 |
|
655 | try {
|
656 | return getComponentName(init(payload));
|
657 | } catch (x) {
|
658 | return null;
|
659 | }
|
660 | }
|
661 | }
|
662 | }
|
663 |
|
664 | return null;
|
665 | }
|
666 |
|
667 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
668 | var RESERVED_PROPS = {
|
669 | key: true,
|
670 | ref: true,
|
671 | __self: true,
|
672 | __source: true
|
673 | };
|
674 | var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
675 |
|
676 | {
|
677 | didWarnAboutStringRefs = {};
|
678 | }
|
679 |
|
680 | function hasValidRef(config) {
|
681 | {
|
682 | if (hasOwnProperty.call(config, 'ref')) {
|
683 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
684 |
|
685 | if (getter && getter.isReactWarning) {
|
686 | return false;
|
687 | }
|
688 | }
|
689 | }
|
690 |
|
691 | return config.ref !== undefined;
|
692 | }
|
693 |
|
694 | function hasValidKey(config) {
|
695 | {
|
696 | if (hasOwnProperty.call(config, 'key')) {
|
697 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
698 |
|
699 | if (getter && getter.isReactWarning) {
|
700 | return false;
|
701 | }
|
702 | }
|
703 | }
|
704 |
|
705 | return config.key !== undefined;
|
706 | }
|
707 |
|
708 | function defineKeyPropWarningGetter(props, displayName) {
|
709 | var warnAboutAccessingKey = function () {
|
710 | {
|
711 | if (!specialPropKeyWarningShown) {
|
712 | specialPropKeyWarningShown = true;
|
713 |
|
714 | 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);
|
715 | }
|
716 | }
|
717 | };
|
718 |
|
719 | warnAboutAccessingKey.isReactWarning = true;
|
720 | Object.defineProperty(props, 'key', {
|
721 | get: warnAboutAccessingKey,
|
722 | configurable: true
|
723 | });
|
724 | }
|
725 |
|
726 | function defineRefPropWarningGetter(props, displayName) {
|
727 | var warnAboutAccessingRef = function () {
|
728 | {
|
729 | if (!specialPropRefWarningShown) {
|
730 | specialPropRefWarningShown = true;
|
731 |
|
732 | 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);
|
733 | }
|
734 | }
|
735 | };
|
736 |
|
737 | warnAboutAccessingRef.isReactWarning = true;
|
738 | Object.defineProperty(props, 'ref', {
|
739 | get: warnAboutAccessingRef,
|
740 | configurable: true
|
741 | });
|
742 | }
|
743 |
|
744 | function warnIfStringRefCannotBeAutoConverted(config) {
|
745 | {
|
746 | if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
747 | var componentName = getComponentName(ReactCurrentOwner.current.type);
|
748 |
|
749 | if (!didWarnAboutStringRefs[componentName]) {
|
750 | error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
751 |
|
752 | didWarnAboutStringRefs[componentName] = true;
|
753 | }
|
754 | }
|
755 | }
|
756 | }
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
780 | var element = {
|
781 |
|
782 | $$typeof: REACT_ELEMENT_TYPE,
|
783 |
|
784 | type: type,
|
785 | key: key,
|
786 | ref: ref,
|
787 | props: props,
|
788 |
|
789 | _owner: owner
|
790 | };
|
791 |
|
792 | {
|
793 |
|
794 |
|
795 |
|
796 |
|
797 | element._store = {};
|
798 |
|
799 |
|
800 |
|
801 |
|
802 | Object.defineProperty(element._store, 'validated', {
|
803 | configurable: false,
|
804 | enumerable: false,
|
805 | writable: true,
|
806 | value: false
|
807 | });
|
808 |
|
809 | Object.defineProperty(element, '_self', {
|
810 | configurable: false,
|
811 | enumerable: false,
|
812 | writable: false,
|
813 | value: self
|
814 | });
|
815 |
|
816 |
|
817 | Object.defineProperty(element, '_source', {
|
818 | configurable: false,
|
819 | enumerable: false,
|
820 | writable: false,
|
821 | value: source
|
822 | });
|
823 |
|
824 | if (Object.freeze) {
|
825 | Object.freeze(element.props);
|
826 | Object.freeze(element);
|
827 | }
|
828 | }
|
829 |
|
830 | return element;
|
831 | };
|
832 |
|
833 |
|
834 |
|
835 |
|
836 |
|
837 | function createElement(type, config, children) {
|
838 | var propName;
|
839 |
|
840 | var props = {};
|
841 | var key = null;
|
842 | var ref = null;
|
843 | var self = null;
|
844 | var source = null;
|
845 |
|
846 | if (config != null) {
|
847 | if (hasValidRef(config)) {
|
848 | ref = config.ref;
|
849 |
|
850 | {
|
851 | warnIfStringRefCannotBeAutoConverted(config);
|
852 | }
|
853 | }
|
854 |
|
855 | if (hasValidKey(config)) {
|
856 | key = '' + config.key;
|
857 | }
|
858 |
|
859 | self = config.__self === undefined ? null : config.__self;
|
860 | source = config.__source === undefined ? null : config.__source;
|
861 |
|
862 | for (propName in config) {
|
863 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
864 | props[propName] = config[propName];
|
865 | }
|
866 | }
|
867 | }
|
868 |
|
869 |
|
870 |
|
871 | var childrenLength = arguments.length - 2;
|
872 |
|
873 | if (childrenLength === 1) {
|
874 | props.children = children;
|
875 | } else if (childrenLength > 1) {
|
876 | var childArray = Array(childrenLength);
|
877 |
|
878 | for (var i = 0; i < childrenLength; i++) {
|
879 | childArray[i] = arguments[i + 2];
|
880 | }
|
881 |
|
882 | {
|
883 | if (Object.freeze) {
|
884 | Object.freeze(childArray);
|
885 | }
|
886 | }
|
887 |
|
888 | props.children = childArray;
|
889 | }
|
890 |
|
891 |
|
892 | if (type && type.defaultProps) {
|
893 | var defaultProps = type.defaultProps;
|
894 |
|
895 | for (propName in defaultProps) {
|
896 | if (props[propName] === undefined) {
|
897 | props[propName] = defaultProps[propName];
|
898 | }
|
899 | }
|
900 | }
|
901 |
|
902 | {
|
903 | if (key || ref) {
|
904 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
905 |
|
906 | if (key) {
|
907 | defineKeyPropWarningGetter(props, displayName);
|
908 | }
|
909 |
|
910 | if (ref) {
|
911 | defineRefPropWarningGetter(props, displayName);
|
912 | }
|
913 | }
|
914 | }
|
915 |
|
916 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
917 | }
|
918 | function cloneAndReplaceKey(oldElement, newKey) {
|
919 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
920 | return newElement;
|
921 | }
|
922 |
|
923 |
|
924 |
|
925 |
|
926 |
|
927 | function cloneElement(element, config, children) {
|
928 | if (!!(element === null || element === undefined)) {
|
929 | {
|
930 | throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
|
931 | }
|
932 | }
|
933 |
|
934 | var propName;
|
935 |
|
936 | var props = _assign({}, element.props);
|
937 |
|
938 |
|
939 | var key = element.key;
|
940 | var ref = element.ref;
|
941 |
|
942 | var self = element._self;
|
943 |
|
944 |
|
945 |
|
946 | var source = element._source;
|
947 |
|
948 | var owner = element._owner;
|
949 |
|
950 | if (config != null) {
|
951 | if (hasValidRef(config)) {
|
952 |
|
953 | ref = config.ref;
|
954 | owner = ReactCurrentOwner.current;
|
955 | }
|
956 |
|
957 | if (hasValidKey(config)) {
|
958 | key = '' + config.key;
|
959 | }
|
960 |
|
961 |
|
962 | var defaultProps;
|
963 |
|
964 | if (element.type && element.type.defaultProps) {
|
965 | defaultProps = element.type.defaultProps;
|
966 | }
|
967 |
|
968 | for (propName in config) {
|
969 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
970 | if (config[propName] === undefined && defaultProps !== undefined) {
|
971 |
|
972 | props[propName] = defaultProps[propName];
|
973 | } else {
|
974 | props[propName] = config[propName];
|
975 | }
|
976 | }
|
977 | }
|
978 | }
|
979 |
|
980 |
|
981 |
|
982 | var childrenLength = arguments.length - 2;
|
983 |
|
984 | if (childrenLength === 1) {
|
985 | props.children = children;
|
986 | } else if (childrenLength > 1) {
|
987 | var childArray = Array(childrenLength);
|
988 |
|
989 | for (var i = 0; i < childrenLength; i++) {
|
990 | childArray[i] = arguments[i + 2];
|
991 | }
|
992 |
|
993 | props.children = childArray;
|
994 | }
|
995 |
|
996 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
997 | }
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 | function isValidElement(object) {
|
1007 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
1008 | }
|
1009 |
|
1010 | var SEPARATOR = '.';
|
1011 | var SUBSEPARATOR = ':';
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 | function escape(key) {
|
1020 | var escapeRegex = /[=:]/g;
|
1021 | var escaperLookup = {
|
1022 | '=': '=0',
|
1023 | ':': '=2'
|
1024 | };
|
1025 | var escapedString = key.replace(escapeRegex, function (match) {
|
1026 | return escaperLookup[match];
|
1027 | });
|
1028 | return '$' + escapedString;
|
1029 | }
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 | var didWarnAboutMaps = false;
|
1037 | var userProvidedKeyEscapeRegex = /\/+/g;
|
1038 |
|
1039 | function escapeUserProvidedKey(text) {
|
1040 | return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
1041 | }
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 |
|
1050 |
|
1051 | function getElementKey(element, index) {
|
1052 |
|
1053 |
|
1054 | if (typeof element === 'object' && element !== null && element.key != null) {
|
1055 |
|
1056 | return escape('' + element.key);
|
1057 | }
|
1058 |
|
1059 |
|
1060 | return index.toString(36);
|
1061 | }
|
1062 |
|
1063 | function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
1064 | var type = typeof children;
|
1065 |
|
1066 | if (type === 'undefined' || type === 'boolean') {
|
1067 |
|
1068 | children = null;
|
1069 | }
|
1070 |
|
1071 | var invokeCallback = false;
|
1072 |
|
1073 | if (children === null) {
|
1074 | invokeCallback = true;
|
1075 | } else {
|
1076 | switch (type) {
|
1077 | case 'string':
|
1078 | case 'number':
|
1079 | invokeCallback = true;
|
1080 | break;
|
1081 |
|
1082 | case 'object':
|
1083 | switch (children.$$typeof) {
|
1084 | case REACT_ELEMENT_TYPE:
|
1085 | case REACT_PORTAL_TYPE:
|
1086 | invokeCallback = true;
|
1087 | }
|
1088 |
|
1089 | }
|
1090 | }
|
1091 |
|
1092 | if (invokeCallback) {
|
1093 | var _child = children;
|
1094 | var mappedChild = callback(_child);
|
1095 |
|
1096 |
|
1097 | var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
1098 |
|
1099 | if (Array.isArray(mappedChild)) {
|
1100 | var escapedChildKey = '';
|
1101 |
|
1102 | if (childKey != null) {
|
1103 | escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
1104 | }
|
1105 |
|
1106 | mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
|
1107 | return c;
|
1108 | });
|
1109 | } else if (mappedChild != null) {
|
1110 | if (isValidElement(mappedChild)) {
|
1111 | mappedChild = cloneAndReplaceKey(mappedChild,
|
1112 |
|
1113 | escapedPrefix + (
|
1114 | mappedChild.key && (!_child || _child.key !== mappedChild.key) ?
|
1115 | escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
1116 | }
|
1117 |
|
1118 | array.push(mappedChild);
|
1119 | }
|
1120 |
|
1121 | return 1;
|
1122 | }
|
1123 |
|
1124 | var child;
|
1125 | var nextName;
|
1126 | var subtreeCount = 0;
|
1127 |
|
1128 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
1129 |
|
1130 | if (Array.isArray(children)) {
|
1131 | for (var i = 0; i < children.length; i++) {
|
1132 | child = children[i];
|
1133 | nextName = nextNamePrefix + getElementKey(child, i);
|
1134 | subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
1135 | }
|
1136 | } else {
|
1137 | var iteratorFn = getIteratorFn(children);
|
1138 |
|
1139 | if (typeof iteratorFn === 'function') {
|
1140 | var iterableChildren = children;
|
1141 |
|
1142 | {
|
1143 |
|
1144 | if (iteratorFn === iterableChildren.entries) {
|
1145 | if (!didWarnAboutMaps) {
|
1146 | warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
|
1147 | }
|
1148 |
|
1149 | didWarnAboutMaps = true;
|
1150 | }
|
1151 | }
|
1152 |
|
1153 | var iterator = iteratorFn.call(iterableChildren);
|
1154 | var step;
|
1155 | var ii = 0;
|
1156 |
|
1157 | while (!(step = iterator.next()).done) {
|
1158 | child = step.value;
|
1159 | nextName = nextNamePrefix + getElementKey(child, ii++);
|
1160 | subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
1161 | }
|
1162 | } else if (type === 'object') {
|
1163 | var childrenString = '' + children;
|
1164 |
|
1165 | {
|
1166 | {
|
1167 | throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
|
1168 | }
|
1169 | }
|
1170 | }
|
1171 | }
|
1172 |
|
1173 | return subtreeCount;
|
1174 | }
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 | function mapChildren(children, func, context) {
|
1190 | if (children == null) {
|
1191 | return children;
|
1192 | }
|
1193 |
|
1194 | var result = [];
|
1195 | var count = 0;
|
1196 | mapIntoArray(children, result, '', '', function (child) {
|
1197 | return func.call(context, child, count++);
|
1198 | });
|
1199 | return result;
|
1200 | }
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 | function countChildren(children) {
|
1213 | var n = 0;
|
1214 | mapChildren(children, function () {
|
1215 | n++;
|
1216 | });
|
1217 | return n;
|
1218 | }
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 | function forEachChildren(children, forEachFunc, forEachContext) {
|
1233 | mapChildren(children, function () {
|
1234 | forEachFunc.apply(this, arguments);
|
1235 | }, forEachContext);
|
1236 | }
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 | function toArray(children) {
|
1246 | return mapChildren(children, function (child) {
|
1247 | return child;
|
1248 | }) || [];
|
1249 | }
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 | function onlyChild(children) {
|
1267 | if (!isValidElement(children)) {
|
1268 | {
|
1269 | throw Error( "React.Children.only expected to receive a single React element child." );
|
1270 | }
|
1271 | }
|
1272 |
|
1273 | return children;
|
1274 | }
|
1275 |
|
1276 | function createContext(defaultValue, calculateChangedBits) {
|
1277 | if (calculateChangedBits === undefined) {
|
1278 | calculateChangedBits = null;
|
1279 | } else {
|
1280 | {
|
1281 | if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
|
1282 | error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
1283 | }
|
1284 | }
|
1285 | }
|
1286 |
|
1287 | var context = {
|
1288 | $$typeof: REACT_CONTEXT_TYPE,
|
1289 | _calculateChangedBits: calculateChangedBits,
|
1290 |
|
1291 |
|
1292 |
|
1293 |
|
1294 |
|
1295 | _currentValue: defaultValue,
|
1296 | _currentValue2: defaultValue,
|
1297 |
|
1298 |
|
1299 | _threadCount: 0,
|
1300 |
|
1301 | Provider: null,
|
1302 | Consumer: null
|
1303 | };
|
1304 | context.Provider = {
|
1305 | $$typeof: REACT_PROVIDER_TYPE,
|
1306 | _context: context
|
1307 | };
|
1308 | var hasWarnedAboutUsingNestedContextConsumers = false;
|
1309 | var hasWarnedAboutUsingConsumerProvider = false;
|
1310 | var hasWarnedAboutDisplayNameOnConsumer = false;
|
1311 |
|
1312 | {
|
1313 |
|
1314 |
|
1315 |
|
1316 | var Consumer = {
|
1317 | $$typeof: REACT_CONTEXT_TYPE,
|
1318 | _context: context,
|
1319 | _calculateChangedBits: context._calculateChangedBits
|
1320 | };
|
1321 |
|
1322 | Object.defineProperties(Consumer, {
|
1323 | Provider: {
|
1324 | get: function () {
|
1325 | if (!hasWarnedAboutUsingConsumerProvider) {
|
1326 | hasWarnedAboutUsingConsumerProvider = true;
|
1327 |
|
1328 | error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
1329 | }
|
1330 |
|
1331 | return context.Provider;
|
1332 | },
|
1333 | set: function (_Provider) {
|
1334 | context.Provider = _Provider;
|
1335 | }
|
1336 | },
|
1337 | _currentValue: {
|
1338 | get: function () {
|
1339 | return context._currentValue;
|
1340 | },
|
1341 | set: function (_currentValue) {
|
1342 | context._currentValue = _currentValue;
|
1343 | }
|
1344 | },
|
1345 | _currentValue2: {
|
1346 | get: function () {
|
1347 | return context._currentValue2;
|
1348 | },
|
1349 | set: function (_currentValue2) {
|
1350 | context._currentValue2 = _currentValue2;
|
1351 | }
|
1352 | },
|
1353 | _threadCount: {
|
1354 | get: function () {
|
1355 | return context._threadCount;
|
1356 | },
|
1357 | set: function (_threadCount) {
|
1358 | context._threadCount = _threadCount;
|
1359 | }
|
1360 | },
|
1361 | Consumer: {
|
1362 | get: function () {
|
1363 | if (!hasWarnedAboutUsingNestedContextConsumers) {
|
1364 | hasWarnedAboutUsingNestedContextConsumers = true;
|
1365 |
|
1366 | error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
1367 | }
|
1368 |
|
1369 | return context.Consumer;
|
1370 | }
|
1371 | },
|
1372 | displayName: {
|
1373 | get: function () {
|
1374 | return context.displayName;
|
1375 | },
|
1376 | set: function (displayName) {
|
1377 | if (!hasWarnedAboutDisplayNameOnConsumer) {
|
1378 | warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
1379 |
|
1380 | hasWarnedAboutDisplayNameOnConsumer = true;
|
1381 | }
|
1382 | }
|
1383 | }
|
1384 | });
|
1385 |
|
1386 | context.Consumer = Consumer;
|
1387 | }
|
1388 |
|
1389 | {
|
1390 | context._currentRenderer = null;
|
1391 | context._currentRenderer2 = null;
|
1392 | }
|
1393 |
|
1394 | return context;
|
1395 | }
|
1396 |
|
1397 | var Uninitialized = -1;
|
1398 | var Pending = 0;
|
1399 | var Resolved = 1;
|
1400 | var Rejected = 2;
|
1401 |
|
1402 | function lazyInitializer(payload) {
|
1403 | if (payload._status === Uninitialized) {
|
1404 | var ctor = payload._result;
|
1405 | var thenable = ctor();
|
1406 |
|
1407 | var pending = payload;
|
1408 | pending._status = Pending;
|
1409 | pending._result = thenable;
|
1410 | thenable.then(function (moduleObject) {
|
1411 | if (payload._status === Pending) {
|
1412 | var defaultExport = moduleObject.default;
|
1413 |
|
1414 | {
|
1415 | if (defaultExport === undefined) {
|
1416 | error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' +
|
1417 | 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
1418 | }
|
1419 | }
|
1420 |
|
1421 |
|
1422 | var resolved = payload;
|
1423 | resolved._status = Resolved;
|
1424 | resolved._result = defaultExport;
|
1425 | }
|
1426 | }, function (error) {
|
1427 | if (payload._status === Pending) {
|
1428 |
|
1429 | var rejected = payload;
|
1430 | rejected._status = Rejected;
|
1431 | rejected._result = error;
|
1432 | }
|
1433 | });
|
1434 | }
|
1435 |
|
1436 | if (payload._status === Resolved) {
|
1437 | return payload._result;
|
1438 | } else {
|
1439 | throw payload._result;
|
1440 | }
|
1441 | }
|
1442 |
|
1443 | function lazy(ctor) {
|
1444 | var payload = {
|
1445 |
|
1446 | _status: -1,
|
1447 | _result: ctor
|
1448 | };
|
1449 | var lazyType = {
|
1450 | $$typeof: REACT_LAZY_TYPE,
|
1451 | _payload: payload,
|
1452 | _init: lazyInitializer
|
1453 | };
|
1454 |
|
1455 | {
|
1456 |
|
1457 | var defaultProps;
|
1458 | var propTypes;
|
1459 |
|
1460 | Object.defineProperties(lazyType, {
|
1461 | defaultProps: {
|
1462 | configurable: true,
|
1463 | get: function () {
|
1464 | return defaultProps;
|
1465 | },
|
1466 | set: function (newDefaultProps) {
|
1467 | error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
1468 |
|
1469 | defaultProps = newDefaultProps;
|
1470 |
|
1471 |
|
1472 | Object.defineProperty(lazyType, 'defaultProps', {
|
1473 | enumerable: true
|
1474 | });
|
1475 | }
|
1476 | },
|
1477 | propTypes: {
|
1478 | configurable: true,
|
1479 | get: function () {
|
1480 | return propTypes;
|
1481 | },
|
1482 | set: function (newPropTypes) {
|
1483 | error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
1484 |
|
1485 | propTypes = newPropTypes;
|
1486 |
|
1487 |
|
1488 | Object.defineProperty(lazyType, 'propTypes', {
|
1489 | enumerable: true
|
1490 | });
|
1491 | }
|
1492 | }
|
1493 | });
|
1494 | }
|
1495 |
|
1496 | return lazyType;
|
1497 | }
|
1498 |
|
1499 | function forwardRef(render) {
|
1500 | {
|
1501 | if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
1502 | error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
1503 | } else if (typeof render !== 'function') {
|
1504 | error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
1505 | } else {
|
1506 | if (render.length !== 0 && render.length !== 2) {
|
1507 | error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
|
1508 | }
|
1509 | }
|
1510 |
|
1511 | if (render != null) {
|
1512 | if (render.defaultProps != null || render.propTypes != null) {
|
1513 | error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
1514 | }
|
1515 | }
|
1516 | }
|
1517 |
|
1518 | var elementType = {
|
1519 | $$typeof: REACT_FORWARD_REF_TYPE,
|
1520 | render: render
|
1521 | };
|
1522 |
|
1523 | {
|
1524 | var ownName;
|
1525 | Object.defineProperty(elementType, 'displayName', {
|
1526 | enumerable: false,
|
1527 | configurable: true,
|
1528 | get: function () {
|
1529 | return ownName;
|
1530 | },
|
1531 | set: function (name) {
|
1532 | ownName = name;
|
1533 |
|
1534 | if (render.displayName == null) {
|
1535 | render.displayName = name;
|
1536 | }
|
1537 | }
|
1538 | });
|
1539 | }
|
1540 |
|
1541 | return elementType;
|
1542 | }
|
1543 |
|
1544 |
|
1545 |
|
1546 | var enableScopeAPI = false;
|
1547 |
|
1548 | function isValidElementType(type) {
|
1549 | if (typeof type === 'string' || typeof type === 'function') {
|
1550 | return true;
|
1551 | }
|
1552 |
|
1553 |
|
1554 | if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
1555 | return true;
|
1556 | }
|
1557 |
|
1558 | if (typeof type === 'object' && type !== null) {
|
1559 | 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) {
|
1560 | return true;
|
1561 | }
|
1562 | }
|
1563 |
|
1564 | return false;
|
1565 | }
|
1566 |
|
1567 | function memo(type, compare) {
|
1568 | {
|
1569 | if (!isValidElementType(type)) {
|
1570 | error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
1571 | }
|
1572 | }
|
1573 |
|
1574 | var elementType = {
|
1575 | $$typeof: REACT_MEMO_TYPE,
|
1576 | type: type,
|
1577 | compare: compare === undefined ? null : compare
|
1578 | };
|
1579 |
|
1580 | {
|
1581 | var ownName;
|
1582 | Object.defineProperty(elementType, 'displayName', {
|
1583 | enumerable: false,
|
1584 | configurable: true,
|
1585 | get: function () {
|
1586 | return ownName;
|
1587 | },
|
1588 | set: function (name) {
|
1589 | ownName = name;
|
1590 |
|
1591 | if (type.displayName == null) {
|
1592 | type.displayName = name;
|
1593 | }
|
1594 | }
|
1595 | });
|
1596 | }
|
1597 |
|
1598 | return elementType;
|
1599 | }
|
1600 |
|
1601 | function resolveDispatcher() {
|
1602 | var dispatcher = ReactCurrentDispatcher.current;
|
1603 |
|
1604 | if (!(dispatcher !== null)) {
|
1605 | {
|
1606 | throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
|
1607 | }
|
1608 | }
|
1609 |
|
1610 | return dispatcher;
|
1611 | }
|
1612 |
|
1613 | function useContext(Context, unstable_observedBits) {
|
1614 | var dispatcher = resolveDispatcher();
|
1615 |
|
1616 | {
|
1617 | if (unstable_observedBits !== undefined) {
|
1618 | error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : '');
|
1619 | }
|
1620 |
|
1621 |
|
1622 | if (Context._context !== undefined) {
|
1623 | var realContext = Context._context;
|
1624 |
|
1625 |
|
1626 | if (realContext.Consumer === Context) {
|
1627 | error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
1628 | } else if (realContext.Provider === Context) {
|
1629 | error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
1630 | }
|
1631 | }
|
1632 | }
|
1633 |
|
1634 | return dispatcher.useContext(Context, unstable_observedBits);
|
1635 | }
|
1636 | function useState(initialState) {
|
1637 | var dispatcher = resolveDispatcher();
|
1638 | return dispatcher.useState(initialState);
|
1639 | }
|
1640 | function useReducer(reducer, initialArg, init) {
|
1641 | var dispatcher = resolveDispatcher();
|
1642 | return dispatcher.useReducer(reducer, initialArg, init);
|
1643 | }
|
1644 | function useRef(initialValue) {
|
1645 | var dispatcher = resolveDispatcher();
|
1646 | return dispatcher.useRef(initialValue);
|
1647 | }
|
1648 | function useEffect(create, deps) {
|
1649 | var dispatcher = resolveDispatcher();
|
1650 | return dispatcher.useEffect(create, deps);
|
1651 | }
|
1652 | function useLayoutEffect(create, deps) {
|
1653 | var dispatcher = resolveDispatcher();
|
1654 | return dispatcher.useLayoutEffect(create, deps);
|
1655 | }
|
1656 | function useCallback(callback, deps) {
|
1657 | var dispatcher = resolveDispatcher();
|
1658 | return dispatcher.useCallback(callback, deps);
|
1659 | }
|
1660 | function useMemo(create, deps) {
|
1661 | var dispatcher = resolveDispatcher();
|
1662 | return dispatcher.useMemo(create, deps);
|
1663 | }
|
1664 | function useImperativeHandle(ref, create, deps) {
|
1665 | var dispatcher = resolveDispatcher();
|
1666 | return dispatcher.useImperativeHandle(ref, create, deps);
|
1667 | }
|
1668 | function useDebugValue(value, formatterFn) {
|
1669 | {
|
1670 | var dispatcher = resolveDispatcher();
|
1671 | return dispatcher.useDebugValue(value, formatterFn);
|
1672 | }
|
1673 | }
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 | var disabledDepth = 0;
|
1680 | var prevLog;
|
1681 | var prevInfo;
|
1682 | var prevWarn;
|
1683 | var prevError;
|
1684 | var prevGroup;
|
1685 | var prevGroupCollapsed;
|
1686 | var prevGroupEnd;
|
1687 |
|
1688 | function disabledLog() {}
|
1689 |
|
1690 | disabledLog.__reactDisabledLog = true;
|
1691 | function disableLogs() {
|
1692 | {
|
1693 | if (disabledDepth === 0) {
|
1694 |
|
1695 | prevLog = console.log;
|
1696 | prevInfo = console.info;
|
1697 | prevWarn = console.warn;
|
1698 | prevError = console.error;
|
1699 | prevGroup = console.group;
|
1700 | prevGroupCollapsed = console.groupCollapsed;
|
1701 | prevGroupEnd = console.groupEnd;
|
1702 |
|
1703 | var props = {
|
1704 | configurable: true,
|
1705 | enumerable: true,
|
1706 | value: disabledLog,
|
1707 | writable: true
|
1708 | };
|
1709 |
|
1710 | Object.defineProperties(console, {
|
1711 | info: props,
|
1712 | log: props,
|
1713 | warn: props,
|
1714 | error: props,
|
1715 | group: props,
|
1716 | groupCollapsed: props,
|
1717 | groupEnd: props
|
1718 | });
|
1719 |
|
1720 | }
|
1721 |
|
1722 | disabledDepth++;
|
1723 | }
|
1724 | }
|
1725 | function reenableLogs() {
|
1726 | {
|
1727 | disabledDepth--;
|
1728 |
|
1729 | if (disabledDepth === 0) {
|
1730 |
|
1731 | var props = {
|
1732 | configurable: true,
|
1733 | enumerable: true,
|
1734 | writable: true
|
1735 | };
|
1736 |
|
1737 | Object.defineProperties(console, {
|
1738 | log: _assign({}, props, {
|
1739 | value: prevLog
|
1740 | }),
|
1741 | info: _assign({}, props, {
|
1742 | value: prevInfo
|
1743 | }),
|
1744 | warn: _assign({}, props, {
|
1745 | value: prevWarn
|
1746 | }),
|
1747 | error: _assign({}, props, {
|
1748 | value: prevError
|
1749 | }),
|
1750 | group: _assign({}, props, {
|
1751 | value: prevGroup
|
1752 | }),
|
1753 | groupCollapsed: _assign({}, props, {
|
1754 | value: prevGroupCollapsed
|
1755 | }),
|
1756 | groupEnd: _assign({}, props, {
|
1757 | value: prevGroupEnd
|
1758 | })
|
1759 | });
|
1760 |
|
1761 | }
|
1762 |
|
1763 | if (disabledDepth < 0) {
|
1764 | error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
1765 | }
|
1766 | }
|
1767 | }
|
1768 |
|
1769 | var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
1770 | var prefix;
|
1771 | function describeBuiltInComponentFrame(name, source, ownerFn) {
|
1772 | {
|
1773 | if (prefix === undefined) {
|
1774 |
|
1775 | try {
|
1776 | throw Error();
|
1777 | } catch (x) {
|
1778 | var match = x.stack.trim().match(/\n( *(at )?)/);
|
1779 | prefix = match && match[1] || '';
|
1780 | }
|
1781 | }
|
1782 |
|
1783 |
|
1784 | return '\n' + prefix + name;
|
1785 | }
|
1786 | }
|
1787 | var reentry = false;
|
1788 | var componentFrameCache;
|
1789 |
|
1790 | {
|
1791 | var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
1792 | componentFrameCache = new PossiblyWeakMap();
|
1793 | }
|
1794 |
|
1795 | function describeNativeComponentFrame(fn, construct) {
|
1796 |
|
1797 | if (!fn || reentry) {
|
1798 | return '';
|
1799 | }
|
1800 |
|
1801 | {
|
1802 | var frame = componentFrameCache.get(fn);
|
1803 |
|
1804 | if (frame !== undefined) {
|
1805 | return frame;
|
1806 | }
|
1807 | }
|
1808 |
|
1809 | var control;
|
1810 | reentry = true;
|
1811 | var previousPrepareStackTrace = Error.prepareStackTrace;
|
1812 |
|
1813 | Error.prepareStackTrace = undefined;
|
1814 | var previousDispatcher;
|
1815 |
|
1816 | {
|
1817 | previousDispatcher = ReactCurrentDispatcher$1.current;
|
1818 |
|
1819 |
|
1820 | ReactCurrentDispatcher$1.current = null;
|
1821 | disableLogs();
|
1822 | }
|
1823 |
|
1824 | try {
|
1825 |
|
1826 | if (construct) {
|
1827 |
|
1828 | var Fake = function () {
|
1829 | throw Error();
|
1830 | };
|
1831 |
|
1832 |
|
1833 | Object.defineProperty(Fake.prototype, 'props', {
|
1834 | set: function () {
|
1835 |
|
1836 |
|
1837 | throw Error();
|
1838 | }
|
1839 | });
|
1840 |
|
1841 | if (typeof Reflect === 'object' && Reflect.construct) {
|
1842 |
|
1843 |
|
1844 | try {
|
1845 | Reflect.construct(Fake, []);
|
1846 | } catch (x) {
|
1847 | control = x;
|
1848 | }
|
1849 |
|
1850 | Reflect.construct(fn, [], Fake);
|
1851 | } else {
|
1852 | try {
|
1853 | Fake.call();
|
1854 | } catch (x) {
|
1855 | control = x;
|
1856 | }
|
1857 |
|
1858 | fn.call(Fake.prototype);
|
1859 | }
|
1860 | } else {
|
1861 | try {
|
1862 | throw Error();
|
1863 | } catch (x) {
|
1864 | control = x;
|
1865 | }
|
1866 |
|
1867 | fn();
|
1868 | }
|
1869 | } catch (sample) {
|
1870 |
|
1871 | if (sample && control && typeof sample.stack === 'string') {
|
1872 |
|
1873 |
|
1874 | var sampleLines = sample.stack.split('\n');
|
1875 | var controlLines = control.stack.split('\n');
|
1876 | var s = sampleLines.length - 1;
|
1877 | var c = controlLines.length - 1;
|
1878 |
|
1879 | while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 | c--;
|
1887 | }
|
1888 |
|
1889 | for (; s >= 1 && c >= 0; s--, c--) {
|
1890 |
|
1891 |
|
1892 | if (sampleLines[s] !== controlLines[c]) {
|
1893 |
|
1894 |
|
1895 |
|
1896 |
|
1897 |
|
1898 | if (s !== 1 || c !== 1) {
|
1899 | do {
|
1900 | s--;
|
1901 | c--;
|
1902 |
|
1903 |
|
1904 | if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
1905 |
|
1906 | var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
1907 |
|
1908 | {
|
1909 | if (typeof fn === 'function') {
|
1910 | componentFrameCache.set(fn, _frame);
|
1911 | }
|
1912 | }
|
1913 |
|
1914 |
|
1915 | return _frame;
|
1916 | }
|
1917 | } while (s >= 1 && c >= 0);
|
1918 | }
|
1919 |
|
1920 | break;
|
1921 | }
|
1922 | }
|
1923 | }
|
1924 | } finally {
|
1925 | reentry = false;
|
1926 |
|
1927 | {
|
1928 | ReactCurrentDispatcher$1.current = previousDispatcher;
|
1929 | reenableLogs();
|
1930 | }
|
1931 |
|
1932 | Error.prepareStackTrace = previousPrepareStackTrace;
|
1933 | }
|
1934 |
|
1935 |
|
1936 | var name = fn ? fn.displayName || fn.name : '';
|
1937 | var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
1938 |
|
1939 | {
|
1940 | if (typeof fn === 'function') {
|
1941 | componentFrameCache.set(fn, syntheticFrame);
|
1942 | }
|
1943 | }
|
1944 |
|
1945 | return syntheticFrame;
|
1946 | }
|
1947 | function describeFunctionComponentFrame(fn, source, ownerFn) {
|
1948 | {
|
1949 | return describeNativeComponentFrame(fn, false);
|
1950 | }
|
1951 | }
|
1952 |
|
1953 | function shouldConstruct(Component) {
|
1954 | var prototype = Component.prototype;
|
1955 | return !!(prototype && prototype.isReactComponent);
|
1956 | }
|
1957 |
|
1958 | function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
1959 |
|
1960 | if (type == null) {
|
1961 | return '';
|
1962 | }
|
1963 |
|
1964 | if (typeof type === 'function') {
|
1965 | {
|
1966 | return describeNativeComponentFrame(type, shouldConstruct(type));
|
1967 | }
|
1968 | }
|
1969 |
|
1970 | if (typeof type === 'string') {
|
1971 | return describeBuiltInComponentFrame(type);
|
1972 | }
|
1973 |
|
1974 | switch (type) {
|
1975 | case exports.Suspense:
|
1976 | return describeBuiltInComponentFrame('Suspense');
|
1977 |
|
1978 | case REACT_SUSPENSE_LIST_TYPE:
|
1979 | return describeBuiltInComponentFrame('SuspenseList');
|
1980 | }
|
1981 |
|
1982 | if (typeof type === 'object') {
|
1983 | switch (type.$$typeof) {
|
1984 | case REACT_FORWARD_REF_TYPE:
|
1985 | return describeFunctionComponentFrame(type.render);
|
1986 |
|
1987 | case REACT_MEMO_TYPE:
|
1988 |
|
1989 | return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
1990 |
|
1991 | case REACT_BLOCK_TYPE:
|
1992 | return describeFunctionComponentFrame(type._render);
|
1993 |
|
1994 | case REACT_LAZY_TYPE:
|
1995 | {
|
1996 | var lazyComponent = type;
|
1997 | var payload = lazyComponent._payload;
|
1998 | var init = lazyComponent._init;
|
1999 |
|
2000 | try {
|
2001 |
|
2002 | return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
2003 | } catch (x) {}
|
2004 | }
|
2005 | }
|
2006 | }
|
2007 |
|
2008 | return '';
|
2009 | }
|
2010 |
|
2011 | var loggedTypeFailures = {};
|
2012 | var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
2013 |
|
2014 | function setCurrentlyValidatingElement(element) {
|
2015 | {
|
2016 | if (element) {
|
2017 | var owner = element._owner;
|
2018 | var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2019 | ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
2020 | } else {
|
2021 | ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
2022 | }
|
2023 | }
|
2024 | }
|
2025 |
|
2026 | function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
2027 | {
|
2028 |
|
2029 | var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
2030 |
|
2031 | for (var typeSpecName in typeSpecs) {
|
2032 | if (has(typeSpecs, typeSpecName)) {
|
2033 | var error$1 = void 0;
|
2034 |
|
2035 |
|
2036 |
|
2037 | try {
|
2038 |
|
2039 |
|
2040 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
2041 | 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`.');
|
2042 | err.name = 'Invariant Violation';
|
2043 | throw err;
|
2044 | }
|
2045 |
|
2046 | error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
2047 | } catch (ex) {
|
2048 | error$1 = ex;
|
2049 | }
|
2050 |
|
2051 | if (error$1 && !(error$1 instanceof Error)) {
|
2052 | setCurrentlyValidatingElement(element);
|
2053 |
|
2054 | 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);
|
2055 |
|
2056 | setCurrentlyValidatingElement(null);
|
2057 | }
|
2058 |
|
2059 | if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
2060 |
|
2061 |
|
2062 | loggedTypeFailures[error$1.message] = true;
|
2063 | setCurrentlyValidatingElement(element);
|
2064 |
|
2065 | error('Failed %s type: %s', location, error$1.message);
|
2066 |
|
2067 | setCurrentlyValidatingElement(null);
|
2068 | }
|
2069 | }
|
2070 | }
|
2071 | }
|
2072 | }
|
2073 |
|
2074 | function setCurrentlyValidatingElement$1(element) {
|
2075 | {
|
2076 | if (element) {
|
2077 | var owner = element._owner;
|
2078 | var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2079 | setExtraStackFrame(stack);
|
2080 | } else {
|
2081 | setExtraStackFrame(null);
|
2082 | }
|
2083 | }
|
2084 | }
|
2085 |
|
2086 | var propTypesMisspellWarningShown;
|
2087 |
|
2088 | {
|
2089 | propTypesMisspellWarningShown = false;
|
2090 | }
|
2091 |
|
2092 | function getDeclarationErrorAddendum() {
|
2093 | if (ReactCurrentOwner.current) {
|
2094 | var name = getComponentName(ReactCurrentOwner.current.type);
|
2095 |
|
2096 | if (name) {
|
2097 | return '\n\nCheck the render method of `' + name + '`.';
|
2098 | }
|
2099 | }
|
2100 |
|
2101 | return '';
|
2102 | }
|
2103 |
|
2104 | function getSourceInfoErrorAddendum(source) {
|
2105 | if (source !== undefined) {
|
2106 | var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
2107 | var lineNumber = source.lineNumber;
|
2108 | return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
2109 | }
|
2110 |
|
2111 | return '';
|
2112 | }
|
2113 |
|
2114 | function getSourceInfoErrorAddendumForProps(elementProps) {
|
2115 | if (elementProps !== null && elementProps !== undefined) {
|
2116 | return getSourceInfoErrorAddendum(elementProps.__source);
|
2117 | }
|
2118 |
|
2119 | return '';
|
2120 | }
|
2121 |
|
2122 |
|
2123 |
|
2124 |
|
2125 |
|
2126 |
|
2127 |
|
2128 | var ownerHasKeyUseWarning = {};
|
2129 |
|
2130 | function getCurrentComponentErrorInfo(parentType) {
|
2131 | var info = getDeclarationErrorAddendum();
|
2132 |
|
2133 | if (!info) {
|
2134 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
2135 |
|
2136 | if (parentName) {
|
2137 | info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
2138 | }
|
2139 | }
|
2140 |
|
2141 | return info;
|
2142 | }
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 | function validateExplicitKey(element, parentType) {
|
2157 | if (!element._store || element._store.validated || element.key != null) {
|
2158 | return;
|
2159 | }
|
2160 |
|
2161 | element._store.validated = true;
|
2162 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
2163 |
|
2164 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
2165 | return;
|
2166 | }
|
2167 |
|
2168 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
2169 |
|
2170 |
|
2171 |
|
2172 | var childOwner = '';
|
2173 |
|
2174 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
2175 |
|
2176 | childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
2177 | }
|
2178 |
|
2179 | {
|
2180 | setCurrentlyValidatingElement$1(element);
|
2181 |
|
2182 | 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);
|
2183 |
|
2184 | setCurrentlyValidatingElement$1(null);
|
2185 | }
|
2186 | }
|
2187 |
|
2188 |
|
2189 |
|
2190 |
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 |
|
2196 |
|
2197 |
|
2198 | function validateChildKeys(node, parentType) {
|
2199 | if (typeof node !== 'object') {
|
2200 | return;
|
2201 | }
|
2202 |
|
2203 | if (Array.isArray(node)) {
|
2204 | for (var i = 0; i < node.length; i++) {
|
2205 | var child = node[i];
|
2206 |
|
2207 | if (isValidElement(child)) {
|
2208 | validateExplicitKey(child, parentType);
|
2209 | }
|
2210 | }
|
2211 | } else if (isValidElement(node)) {
|
2212 |
|
2213 | if (node._store) {
|
2214 | node._store.validated = true;
|
2215 | }
|
2216 | } else if (node) {
|
2217 | var iteratorFn = getIteratorFn(node);
|
2218 |
|
2219 | if (typeof iteratorFn === 'function') {
|
2220 |
|
2221 |
|
2222 | if (iteratorFn !== node.entries) {
|
2223 | var iterator = iteratorFn.call(node);
|
2224 | var step;
|
2225 |
|
2226 | while (!(step = iterator.next()).done) {
|
2227 | if (isValidElement(step.value)) {
|
2228 | validateExplicitKey(step.value, parentType);
|
2229 | }
|
2230 | }
|
2231 | }
|
2232 | }
|
2233 | }
|
2234 | }
|
2235 |
|
2236 |
|
2237 |
|
2238 |
|
2239 |
|
2240 |
|
2241 |
|
2242 |
|
2243 | function validatePropTypes(element) {
|
2244 | {
|
2245 | var type = element.type;
|
2246 |
|
2247 | if (type === null || type === undefined || typeof type === 'string') {
|
2248 | return;
|
2249 | }
|
2250 |
|
2251 | var propTypes;
|
2252 |
|
2253 | if (typeof type === 'function') {
|
2254 | propTypes = type.propTypes;
|
2255 | } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
2256 |
|
2257 | type.$$typeof === REACT_MEMO_TYPE)) {
|
2258 | propTypes = type.propTypes;
|
2259 | } else {
|
2260 | return;
|
2261 | }
|
2262 |
|
2263 | if (propTypes) {
|
2264 |
|
2265 | var name = getComponentName(type);
|
2266 | checkPropTypes(propTypes, element.props, 'prop', name, element);
|
2267 | } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
2268 | propTypesMisspellWarningShown = true;
|
2269 |
|
2270 | var _name = getComponentName(type);
|
2271 |
|
2272 | error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
2273 | }
|
2274 |
|
2275 | if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
2276 | error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
2277 | }
|
2278 | }
|
2279 | }
|
2280 |
|
2281 |
|
2282 |
|
2283 |
|
2284 |
|
2285 |
|
2286 | function validateFragmentProps(fragment) {
|
2287 | {
|
2288 | var keys = Object.keys(fragment.props);
|
2289 |
|
2290 | for (var i = 0; i < keys.length; i++) {
|
2291 | var key = keys[i];
|
2292 |
|
2293 | if (key !== 'children' && key !== 'key') {
|
2294 | setCurrentlyValidatingElement$1(fragment);
|
2295 |
|
2296 | error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
2297 |
|
2298 | setCurrentlyValidatingElement$1(null);
|
2299 | break;
|
2300 | }
|
2301 | }
|
2302 |
|
2303 | if (fragment.ref !== null) {
|
2304 | setCurrentlyValidatingElement$1(fragment);
|
2305 |
|
2306 | error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
2307 |
|
2308 | setCurrentlyValidatingElement$1(null);
|
2309 | }
|
2310 | }
|
2311 | }
|
2312 | function createElementWithValidation(type, props, children) {
|
2313 | var validType = isValidElementType(type);
|
2314 |
|
2315 |
|
2316 | if (!validType) {
|
2317 | var info = '';
|
2318 |
|
2319 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
2320 | 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.";
|
2321 | }
|
2322 |
|
2323 | var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
2324 |
|
2325 | if (sourceInfo) {
|
2326 | info += sourceInfo;
|
2327 | } else {
|
2328 | info += getDeclarationErrorAddendum();
|
2329 | }
|
2330 |
|
2331 | var typeString;
|
2332 |
|
2333 | if (type === null) {
|
2334 | typeString = 'null';
|
2335 | } else if (Array.isArray(type)) {
|
2336 | typeString = 'array';
|
2337 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
2338 | typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
2339 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
2340 | } else {
|
2341 | typeString = typeof type;
|
2342 | }
|
2343 |
|
2344 | {
|
2345 | error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
2346 | }
|
2347 | }
|
2348 |
|
2349 | var element = createElement.apply(this, arguments);
|
2350 |
|
2351 |
|
2352 | if (element == null) {
|
2353 | return element;
|
2354 | }
|
2355 |
|
2356 |
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 | if (validType) {
|
2362 | for (var i = 2; i < arguments.length; i++) {
|
2363 | validateChildKeys(arguments[i], type);
|
2364 | }
|
2365 | }
|
2366 |
|
2367 | if (type === exports.Fragment) {
|
2368 | validateFragmentProps(element);
|
2369 | } else {
|
2370 | validatePropTypes(element);
|
2371 | }
|
2372 |
|
2373 | return element;
|
2374 | }
|
2375 | var didWarnAboutDeprecatedCreateFactory = false;
|
2376 | function createFactoryWithValidation(type) {
|
2377 | var validatedFactory = createElementWithValidation.bind(null, type);
|
2378 | validatedFactory.type = type;
|
2379 |
|
2380 | {
|
2381 | if (!didWarnAboutDeprecatedCreateFactory) {
|
2382 | didWarnAboutDeprecatedCreateFactory = true;
|
2383 |
|
2384 | warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
2385 | }
|
2386 |
|
2387 |
|
2388 | Object.defineProperty(validatedFactory, 'type', {
|
2389 | enumerable: false,
|
2390 | get: function () {
|
2391 | warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
2392 |
|
2393 | Object.defineProperty(this, 'type', {
|
2394 | value: type
|
2395 | });
|
2396 | return type;
|
2397 | }
|
2398 | });
|
2399 | }
|
2400 |
|
2401 | return validatedFactory;
|
2402 | }
|
2403 | function cloneElementWithValidation(element, props, children) {
|
2404 | var newElement = cloneElement.apply(this, arguments);
|
2405 |
|
2406 | for (var i = 2; i < arguments.length; i++) {
|
2407 | validateChildKeys(arguments[i], newElement.type);
|
2408 | }
|
2409 |
|
2410 | validatePropTypes(newElement);
|
2411 | return newElement;
|
2412 | }
|
2413 |
|
2414 | {
|
2415 |
|
2416 | try {
|
2417 | var frozenObject = Object.freeze({});
|
2418 |
|
2419 |
|
2420 | new Map([[frozenObject, null]]);
|
2421 | new Set([frozenObject]);
|
2422 |
|
2423 | } catch (e) {
|
2424 | }
|
2425 | }
|
2426 |
|
2427 | var createElement$1 = createElementWithValidation ;
|
2428 | var cloneElement$1 = cloneElementWithValidation ;
|
2429 | var createFactory = createFactoryWithValidation ;
|
2430 | var Children = {
|
2431 | map: mapChildren,
|
2432 | forEach: forEachChildren,
|
2433 | count: countChildren,
|
2434 | toArray: toArray,
|
2435 | only: onlyChild
|
2436 | };
|
2437 |
|
2438 | exports.Children = Children;
|
2439 | exports.Component = Component;
|
2440 | exports.PureComponent = PureComponent;
|
2441 | exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
2442 | exports.cloneElement = cloneElement$1;
|
2443 | exports.createContext = createContext;
|
2444 | exports.createElement = createElement$1;
|
2445 | exports.createFactory = createFactory;
|
2446 | exports.createRef = createRef;
|
2447 | exports.forwardRef = forwardRef;
|
2448 | exports.isValidElement = isValidElement;
|
2449 | exports.lazy = lazy;
|
2450 | exports.memo = memo;
|
2451 | exports.useCallback = useCallback;
|
2452 | exports.useContext = useContext;
|
2453 | exports.useDebugValue = useDebugValue;
|
2454 | exports.useEffect = useEffect;
|
2455 | exports.useImperativeHandle = useImperativeHandle;
|
2456 | exports.useLayoutEffect = useLayoutEffect;
|
2457 | exports.useMemo = useMemo;
|
2458 | exports.useReducer = useReducer;
|
2459 | exports.useRef = useRef;
|
2460 | exports.useState = useState;
|
2461 | exports.version = ReactVersion;
|
2462 | })();
|
2463 | }
|
2464 | });
|
2465 | react_development.Fragment;
|
2466 | react_development.StrictMode;
|
2467 | react_development.Profiler;
|
2468 | react_development.Suspense;
|
2469 | react_development.Children;
|
2470 | react_development.Component;
|
2471 | react_development.PureComponent;
|
2472 | react_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
2473 | react_development.cloneElement;
|
2474 | react_development.createContext;
|
2475 | react_development.createElement;
|
2476 | react_development.createFactory;
|
2477 | react_development.createRef;
|
2478 | react_development.forwardRef;
|
2479 | react_development.isValidElement;
|
2480 | react_development.lazy;
|
2481 | react_development.memo;
|
2482 | react_development.useCallback;
|
2483 | react_development.useContext;
|
2484 | react_development.useDebugValue;
|
2485 | react_development.useEffect;
|
2486 | react_development.useImperativeHandle;
|
2487 | react_development.useLayoutEffect;
|
2488 | react_development.useMemo;
|
2489 | react_development.useReducer;
|
2490 | react_development.useRef;
|
2491 | react_development.useState;
|
2492 | react_development.version;
|
2493 |
|
2494 | var react = createCommonjsModule(function (module) {
|
2495 |
|
2496 | if (process.env.NODE_ENV === 'production') {
|
2497 | module.exports = react_production_min;
|
2498 | } else {
|
2499 | module.exports = react_development;
|
2500 | }
|
2501 | });
|
2502 |
|
2503 |
|
2504 | var devtools = {
|
2505 | version: react.version
|
2506 | };
|
2507 |
|
2508 | try {
|
2509 | require.resolve('react-devtools-core');
|
2510 |
|
2511 | const defineProperty = Object.defineProperty;
|
2512 | defineProperty(commonjsGlobal, 'WebSocket', {
|
2513 | value: require('ws')
|
2514 | });
|
2515 | defineProperty(commonjsGlobal, 'window', {
|
2516 | value: commonjsGlobal
|
2517 | });
|
2518 |
|
2519 | const {
|
2520 | connectToDevTools
|
2521 | } = require('react-devtools-core');
|
2522 |
|
2523 | connectToDevTools({
|
2524 | isAppActive() {
|
2525 |
|
2526 | return true;
|
2527 | },
|
2528 |
|
2529 | host: 'localhost',
|
2530 | port: 8097,
|
2531 | resolveRNStyle: null
|
2532 |
|
2533 | });
|
2534 | } catch (err) {
|
2535 | }
|
2536 |
|
2537 | function _defineProperty(obj, key, value) {
|
2538 | if (key in obj) {
|
2539 | Object.defineProperty(obj, key, {
|
2540 | value: value,
|
2541 | enumerable: true,
|
2542 | configurable: true,
|
2543 | writable: true
|
2544 | });
|
2545 | } else {
|
2546 | obj[key] = value;
|
2547 | }
|
2548 |
|
2549 | return obj;
|
2550 | }
|
2551 |
|
2552 | function ownKeys(object, enumerableOnly) {
|
2553 | var keys = Object.keys(object);
|
2554 |
|
2555 | if (Object.getOwnPropertySymbols) {
|
2556 | var symbols = Object.getOwnPropertySymbols(object);
|
2557 | if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
2558 | return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
2559 | });
|
2560 | keys.push.apply(keys, symbols);
|
2561 | }
|
2562 |
|
2563 | return keys;
|
2564 | }
|
2565 |
|
2566 | function _objectSpread2(target) {
|
2567 | for (var i = 1; i < arguments.length; i++) {
|
2568 | var source = arguments[i] != null ? arguments[i] : {};
|
2569 |
|
2570 | if (i % 2) {
|
2571 | ownKeys(Object(source), true).forEach(function (key) {
|
2572 | _defineProperty(target, key, source[key]);
|
2573 | });
|
2574 | } else if (Object.getOwnPropertyDescriptors) {
|
2575 | Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
2576 | } else {
|
2577 | ownKeys(Object(source)).forEach(function (key) {
|
2578 | Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
2579 | });
|
2580 | }
|
2581 | }
|
2582 |
|
2583 | return target;
|
2584 | }
|
2585 |
|
2586 | function _objectWithoutPropertiesLoose(source, excluded) {
|
2587 | if (source == null) return {};
|
2588 | var target = {};
|
2589 | var sourceKeys = Object.keys(source);
|
2590 | var key, i;
|
2591 |
|
2592 | for (i = 0; i < sourceKeys.length; i++) {
|
2593 | key = sourceKeys[i];
|
2594 | if (excluded.indexOf(key) >= 0) continue;
|
2595 | target[key] = source[key];
|
2596 | }
|
2597 |
|
2598 | return target;
|
2599 | }
|
2600 |
|
2601 | function _objectWithoutProperties(source, excluded) {
|
2602 | if (source == null) return {};
|
2603 |
|
2604 | var target = _objectWithoutPropertiesLoose(source, excluded);
|
2605 |
|
2606 | var key, i;
|
2607 |
|
2608 | if (Object.getOwnPropertySymbols) {
|
2609 | var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
2610 |
|
2611 | for (i = 0; i < sourceSymbolKeys.length; i++) {
|
2612 | key = sourceSymbolKeys[i];
|
2613 | if (excluded.indexOf(key) >= 0) continue;
|
2614 | if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
2615 | target[key] = source[key];
|
2616 | }
|
2617 | }
|
2618 |
|
2619 | return target;
|
2620 | }
|
2621 |
|
2622 | const startCase = string => string.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (match) {
|
2623 | return +match === 0 ? '' : match.toUpperCase();
|
2624 | }).replace(/[^A-Za-z0-9 ]+/, '');
|
2625 |
|
2626 | const eventName = event => `on${startCase(event)}`;
|
2627 |
|
2628 | const eventListener = (node, event, ...args) => {
|
2629 | if (node._updating) return;
|
2630 | const handler = node.props[eventName(event)];
|
2631 | |
2632 |
|
2633 |
|
2634 |
|
2635 |
|
2636 |
|
2637 |
|
2638 |
|
2639 | if (typeof handler === 'function') {
|
2640 | if (event === 'focus' || event === 'blur') {
|
2641 | args[0] = node;
|
2642 | }
|
2643 |
|
2644 | handler(...args);
|
2645 | }
|
2646 | };
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 | function listCacheClear() {
|
2656 | this.__data__ = [];
|
2657 | this.size = 0;
|
2658 | }
|
2659 |
|
2660 | var _listCacheClear = listCacheClear;
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 |
|
2675 |
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 |
|
2692 |
|
2693 |
|
2694 | function eq(value, other) {
|
2695 | return value === other || (value !== value && other !== other);
|
2696 | }
|
2697 |
|
2698 | var eq_1 = eq;
|
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 | function assocIndexOf(array, key) {
|
2709 | var length = array.length;
|
2710 | while (length--) {
|
2711 | if (eq_1(array[length][0], key)) {
|
2712 | return length;
|
2713 | }
|
2714 | }
|
2715 | return -1;
|
2716 | }
|
2717 |
|
2718 | var _assocIndexOf = assocIndexOf;
|
2719 |
|
2720 |
|
2721 | var arrayProto = Array.prototype;
|
2722 |
|
2723 |
|
2724 | var splice = arrayProto.splice;
|
2725 |
|
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 | function listCacheDelete(key) {
|
2736 | var data = this.__data__,
|
2737 | index = _assocIndexOf(data, key);
|
2738 |
|
2739 | if (index < 0) {
|
2740 | return false;
|
2741 | }
|
2742 | var lastIndex = data.length - 1;
|
2743 | if (index == lastIndex) {
|
2744 | data.pop();
|
2745 | } else {
|
2746 | splice.call(data, index, 1);
|
2747 | }
|
2748 | --this.size;
|
2749 | return true;
|
2750 | }
|
2751 |
|
2752 | var _listCacheDelete = listCacheDelete;
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 | function listCacheGet(key) {
|
2764 | var data = this.__data__,
|
2765 | index = _assocIndexOf(data, key);
|
2766 |
|
2767 | return index < 0 ? undefined : data[index][1];
|
2768 | }
|
2769 |
|
2770 | var _listCacheGet = listCacheGet;
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 | function listCacheHas(key) {
|
2782 | return _assocIndexOf(this.__data__, key) > -1;
|
2783 | }
|
2784 |
|
2785 | var _listCacheHas = listCacheHas;
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 |
|
2797 | function listCacheSet(key, value) {
|
2798 | var data = this.__data__,
|
2799 | index = _assocIndexOf(data, key);
|
2800 |
|
2801 | if (index < 0) {
|
2802 | ++this.size;
|
2803 | data.push([key, value]);
|
2804 | } else {
|
2805 | data[index][1] = value;
|
2806 | }
|
2807 | return this;
|
2808 | }
|
2809 |
|
2810 | var _listCacheSet = listCacheSet;
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 | function ListCache(entries) {
|
2820 | var index = -1,
|
2821 | length = entries == null ? 0 : entries.length;
|
2822 |
|
2823 | this.clear();
|
2824 | while (++index < length) {
|
2825 | var entry = entries[index];
|
2826 | this.set(entry[0], entry[1]);
|
2827 | }
|
2828 | }
|
2829 |
|
2830 |
|
2831 | ListCache.prototype.clear = _listCacheClear;
|
2832 | ListCache.prototype['delete'] = _listCacheDelete;
|
2833 | ListCache.prototype.get = _listCacheGet;
|
2834 | ListCache.prototype.has = _listCacheHas;
|
2835 | ListCache.prototype.set = _listCacheSet;
|
2836 |
|
2837 | var _ListCache = ListCache;
|
2838 |
|
2839 |
|
2840 |
|
2841 |
|
2842 |
|
2843 |
|
2844 |
|
2845 |
|
2846 | function stackClear() {
|
2847 | this.__data__ = new _ListCache;
|
2848 | this.size = 0;
|
2849 | }
|
2850 |
|
2851 | var _stackClear = stackClear;
|
2852 |
|
2853 |
|
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 | function stackDelete(key) {
|
2863 | var data = this.__data__,
|
2864 | result = data['delete'](key);
|
2865 |
|
2866 | this.size = data.size;
|
2867 | return result;
|
2868 | }
|
2869 |
|
2870 | var _stackDelete = stackDelete;
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 |
|
2876 |
|
2877 |
|
2878 |
|
2879 |
|
2880 |
|
2881 | function stackGet(key) {
|
2882 | return this.__data__.get(key);
|
2883 | }
|
2884 |
|
2885 | var _stackGet = stackGet;
|
2886 |
|
2887 |
|
2888 |
|
2889 |
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 | function stackHas(key) {
|
2897 | return this.__data__.has(key);
|
2898 | }
|
2899 |
|
2900 | var _stackHas = stackHas;
|
2901 |
|
2902 |
|
2903 | var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
2904 |
|
2905 | var _freeGlobal = freeGlobal;
|
2906 |
|
2907 |
|
2908 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
2909 |
|
2910 |
|
2911 | var root = _freeGlobal || freeSelf || Function('return this')();
|
2912 |
|
2913 | var _root = root;
|
2914 |
|
2915 |
|
2916 | var Symbol$1 = _root.Symbol;
|
2917 |
|
2918 | var _Symbol = Symbol$1;
|
2919 |
|
2920 |
|
2921 | var objectProto = Object.prototype;
|
2922 |
|
2923 |
|
2924 | var hasOwnProperty$1 = objectProto.hasOwnProperty;
|
2925 |
|
2926 |
|
2927 |
|
2928 |
|
2929 |
|
2930 |
|
2931 | var nativeObjectToString = objectProto.toString;
|
2932 |
|
2933 |
|
2934 | var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
2935 |
|
2936 |
|
2937 |
|
2938 |
|
2939 |
|
2940 |
|
2941 |
|
2942 |
|
2943 | function getRawTag(value) {
|
2944 | var isOwn = hasOwnProperty$1.call(value, symToStringTag),
|
2945 | tag = value[symToStringTag];
|
2946 |
|
2947 | try {
|
2948 | value[symToStringTag] = undefined;
|
2949 | var unmasked = true;
|
2950 | } catch (e) {}
|
2951 |
|
2952 | var result = nativeObjectToString.call(value);
|
2953 | if (unmasked) {
|
2954 | if (isOwn) {
|
2955 | value[symToStringTag] = tag;
|
2956 | } else {
|
2957 | delete value[symToStringTag];
|
2958 | }
|
2959 | }
|
2960 | return result;
|
2961 | }
|
2962 |
|
2963 | var _getRawTag = getRawTag;
|
2964 |
|
2965 |
|
2966 | var objectProto$1 = Object.prototype;
|
2967 |
|
2968 |
|
2969 |
|
2970 |
|
2971 |
|
2972 |
|
2973 | var nativeObjectToString$1 = objectProto$1.toString;
|
2974 |
|
2975 |
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 |
|
2982 | function objectToString(value) {
|
2983 | return nativeObjectToString$1.call(value);
|
2984 | }
|
2985 |
|
2986 | var _objectToString = objectToString;
|
2987 |
|
2988 |
|
2989 | var nullTag = '[object Null]',
|
2990 | undefinedTag = '[object Undefined]';
|
2991 |
|
2992 |
|
2993 | var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
2994 |
|
2995 |
|
2996 |
|
2997 |
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 | function baseGetTag(value) {
|
3003 | if (value == null) {
|
3004 | return value === undefined ? undefinedTag : nullTag;
|
3005 | }
|
3006 | return (symToStringTag$1 && symToStringTag$1 in Object(value))
|
3007 | ? _getRawTag(value)
|
3008 | : _objectToString(value);
|
3009 | }
|
3010 |
|
3011 | var _baseGetTag = baseGetTag;
|
3012 |
|
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 |
|
3035 |
|
3036 |
|
3037 |
|
3038 | function isObject(value) {
|
3039 | var type = typeof value;
|
3040 | return value != null && (type == 'object' || type == 'function');
|
3041 | }
|
3042 |
|
3043 | var isObject_1 = isObject;
|
3044 |
|
3045 |
|
3046 | var asyncTag = '[object AsyncFunction]',
|
3047 | funcTag = '[object Function]',
|
3048 | genTag = '[object GeneratorFunction]',
|
3049 | proxyTag = '[object Proxy]';
|
3050 |
|
3051 |
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 |
|
3059 |
|
3060 |
|
3061 |
|
3062 |
|
3063 |
|
3064 |
|
3065 |
|
3066 |
|
3067 |
|
3068 | function isFunction(value) {
|
3069 | if (!isObject_1(value)) {
|
3070 | return false;
|
3071 | }
|
3072 |
|
3073 |
|
3074 | var tag = _baseGetTag(value);
|
3075 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
3076 | }
|
3077 |
|
3078 | var isFunction_1 = isFunction;
|
3079 |
|
3080 |
|
3081 | var coreJsData = _root['__core-js_shared__'];
|
3082 |
|
3083 | var _coreJsData = coreJsData;
|
3084 |
|
3085 |
|
3086 | var maskSrcKey = (function() {
|
3087 | var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
3088 | return uid ? ('Symbol(src)_1.' + uid) : '';
|
3089 | }());
|
3090 |
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 |
|
3098 | function isMasked(func) {
|
3099 | return !!maskSrcKey && (maskSrcKey in func);
|
3100 | }
|
3101 |
|
3102 | var _isMasked = isMasked;
|
3103 |
|
3104 |
|
3105 | var funcProto = Function.prototype;
|
3106 |
|
3107 |
|
3108 | var funcToString = funcProto.toString;
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 |
|
3117 | function toSource(func) {
|
3118 | if (func != null) {
|
3119 | try {
|
3120 | return funcToString.call(func);
|
3121 | } catch (e) {}
|
3122 | try {
|
3123 | return (func + '');
|
3124 | } catch (e) {}
|
3125 | }
|
3126 | return '';
|
3127 | }
|
3128 |
|
3129 | var _toSource = toSource;
|
3130 |
|
3131 |
|
3132 |
|
3133 |
|
3134 |
|
3135 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
3136 |
|
3137 |
|
3138 | var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
3139 |
|
3140 |
|
3141 | var funcProto$1 = Function.prototype,
|
3142 | objectProto$2 = Object.prototype;
|
3143 |
|
3144 |
|
3145 | var funcToString$1 = funcProto$1.toString;
|
3146 |
|
3147 |
|
3148 | var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
3149 |
|
3150 |
|
3151 | var reIsNative = RegExp('^' +
|
3152 | funcToString$1.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
3153 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
3154 | );
|
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 | function baseIsNative(value) {
|
3165 | if (!isObject_1(value) || _isMasked(value)) {
|
3166 | return false;
|
3167 | }
|
3168 | var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
3169 | return pattern.test(_toSource(value));
|
3170 | }
|
3171 |
|
3172 | var _baseIsNative = baseIsNative;
|
3173 |
|
3174 |
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 | function getValue(object, key) {
|
3183 | return object == null ? undefined : object[key];
|
3184 | }
|
3185 |
|
3186 | var _getValue = getValue;
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 | function getNative(object, key) {
|
3197 | var value = _getValue(object, key);
|
3198 | return _baseIsNative(value) ? value : undefined;
|
3199 | }
|
3200 |
|
3201 | var _getNative = getNative;
|
3202 |
|
3203 |
|
3204 | var Map$1 = _getNative(_root, 'Map');
|
3205 |
|
3206 | var _Map = Map$1;
|
3207 |
|
3208 |
|
3209 | var nativeCreate = _getNative(Object, 'create');
|
3210 |
|
3211 | var _nativeCreate = nativeCreate;
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 | function hashClear() {
|
3221 | this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
3222 | this.size = 0;
|
3223 | }
|
3224 |
|
3225 | var _hashClear = hashClear;
|
3226 |
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 | function hashDelete(key) {
|
3238 | var result = this.has(key) && delete this.__data__[key];
|
3239 | this.size -= result ? 1 : 0;
|
3240 | return result;
|
3241 | }
|
3242 |
|
3243 | var _hashDelete = hashDelete;
|
3244 |
|
3245 |
|
3246 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
3247 |
|
3248 |
|
3249 | var objectProto$3 = Object.prototype;
|
3250 |
|
3251 |
|
3252 | var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 | function hashGet(key) {
|
3264 | var data = this.__data__;
|
3265 | if (_nativeCreate) {
|
3266 | var result = data[key];
|
3267 | return result === HASH_UNDEFINED ? undefined : result;
|
3268 | }
|
3269 | return hasOwnProperty$3.call(data, key) ? data[key] : undefined;
|
3270 | }
|
3271 |
|
3272 | var _hashGet = hashGet;
|
3273 |
|
3274 |
|
3275 | var objectProto$4 = Object.prototype;
|
3276 |
|
3277 |
|
3278 | var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
|
3279 |
|
3280 |
|
3281 |
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 | function hashHas(key) {
|
3290 | var data = this.__data__;
|
3291 | return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key);
|
3292 | }
|
3293 |
|
3294 | var _hashHas = hashHas;
|
3295 |
|
3296 |
|
3297 | var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
3298 |
|
3299 |
|
3300 |
|
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 |
|
3307 |
|
3308 |
|
3309 | function hashSet(key, value) {
|
3310 | var data = this.__data__;
|
3311 | this.size += this.has(key) ? 0 : 1;
|
3312 | data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
|
3313 | return this;
|
3314 | }
|
3315 |
|
3316 | var _hashSet = hashSet;
|
3317 |
|
3318 |
|
3319 |
|
3320 |
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 | function Hash(entries) {
|
3326 | var index = -1,
|
3327 | length = entries == null ? 0 : entries.length;
|
3328 |
|
3329 | this.clear();
|
3330 | while (++index < length) {
|
3331 | var entry = entries[index];
|
3332 | this.set(entry[0], entry[1]);
|
3333 | }
|
3334 | }
|
3335 |
|
3336 |
|
3337 | Hash.prototype.clear = _hashClear;
|
3338 | Hash.prototype['delete'] = _hashDelete;
|
3339 | Hash.prototype.get = _hashGet;
|
3340 | Hash.prototype.has = _hashHas;
|
3341 | Hash.prototype.set = _hashSet;
|
3342 |
|
3343 | var _Hash = Hash;
|
3344 |
|
3345 |
|
3346 |
|
3347 |
|
3348 |
|
3349 |
|
3350 |
|
3351 |
|
3352 | function mapCacheClear() {
|
3353 | this.size = 0;
|
3354 | this.__data__ = {
|
3355 | 'hash': new _Hash,
|
3356 | 'map': new (_Map || _ListCache),
|
3357 | 'string': new _Hash
|
3358 | };
|
3359 | }
|
3360 |
|
3361 | var _mapCacheClear = mapCacheClear;
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 |
|
3369 |
|
3370 | function isKeyable(value) {
|
3371 | var type = typeof value;
|
3372 | return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
3373 | ? (value !== '__proto__')
|
3374 | : (value === null);
|
3375 | }
|
3376 |
|
3377 | var _isKeyable = isKeyable;
|
3378 |
|
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 | function getMapData(map, key) {
|
3388 | var data = map.__data__;
|
3389 | return _isKeyable(key)
|
3390 | ? data[typeof key == 'string' ? 'string' : 'hash']
|
3391 | : data.map;
|
3392 | }
|
3393 |
|
3394 | var _getMapData = getMapData;
|
3395 |
|
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 |
|
3402 |
|
3403 |
|
3404 |
|
3405 | function mapCacheDelete(key) {
|
3406 | var result = _getMapData(this, key)['delete'](key);
|
3407 | this.size -= result ? 1 : 0;
|
3408 | return result;
|
3409 | }
|
3410 |
|
3411 | var _mapCacheDelete = mapCacheDelete;
|
3412 |
|
3413 |
|
3414 |
|
3415 |
|
3416 |
|
3417 |
|
3418 |
|
3419 |
|
3420 |
|
3421 |
|
3422 | function mapCacheGet(key) {
|
3423 | return _getMapData(this, key).get(key);
|
3424 | }
|
3425 |
|
3426 | var _mapCacheGet = mapCacheGet;
|
3427 |
|
3428 |
|
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 |
|
3437 | function mapCacheHas(key) {
|
3438 | return _getMapData(this, key).has(key);
|
3439 | }
|
3440 |
|
3441 | var _mapCacheHas = mapCacheHas;
|
3442 |
|
3443 |
|
3444 |
|
3445 |
|
3446 |
|
3447 |
|
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 |
|
3453 | function mapCacheSet(key, value) {
|
3454 | var data = _getMapData(this, key),
|
3455 | size = data.size;
|
3456 |
|
3457 | data.set(key, value);
|
3458 | this.size += data.size == size ? 0 : 1;
|
3459 | return this;
|
3460 | }
|
3461 |
|
3462 | var _mapCacheSet = mapCacheSet;
|
3463 |
|
3464 |
|
3465 |
|
3466 |
|
3467 |
|
3468 |
|
3469 |
|
3470 |
|
3471 | function MapCache(entries) {
|
3472 | var index = -1,
|
3473 | length = entries == null ? 0 : entries.length;
|
3474 |
|
3475 | this.clear();
|
3476 | while (++index < length) {
|
3477 | var entry = entries[index];
|
3478 | this.set(entry[0], entry[1]);
|
3479 | }
|
3480 | }
|
3481 |
|
3482 |
|
3483 | MapCache.prototype.clear = _mapCacheClear;
|
3484 | MapCache.prototype['delete'] = _mapCacheDelete;
|
3485 | MapCache.prototype.get = _mapCacheGet;
|
3486 | MapCache.prototype.has = _mapCacheHas;
|
3487 | MapCache.prototype.set = _mapCacheSet;
|
3488 |
|
3489 | var _MapCache = MapCache;
|
3490 |
|
3491 |
|
3492 | var LARGE_ARRAY_SIZE = 200;
|
3493 |
|
3494 |
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 |
|
3502 |
|
3503 |
|
3504 | function stackSet(key, value) {
|
3505 | var data = this.__data__;
|
3506 | if (data instanceof _ListCache) {
|
3507 | var pairs = data.__data__;
|
3508 | if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
3509 | pairs.push([key, value]);
|
3510 | this.size = ++data.size;
|
3511 | return this;
|
3512 | }
|
3513 | data = this.__data__ = new _MapCache(pairs);
|
3514 | }
|
3515 | data.set(key, value);
|
3516 | this.size = data.size;
|
3517 | return this;
|
3518 | }
|
3519 |
|
3520 | var _stackSet = stackSet;
|
3521 |
|
3522 |
|
3523 |
|
3524 |
|
3525 |
|
3526 |
|
3527 |
|
3528 |
|
3529 | function Stack(entries) {
|
3530 | var data = this.__data__ = new _ListCache(entries);
|
3531 | this.size = data.size;
|
3532 | }
|
3533 |
|
3534 |
|
3535 | Stack.prototype.clear = _stackClear;
|
3536 | Stack.prototype['delete'] = _stackDelete;
|
3537 | Stack.prototype.get = _stackGet;
|
3538 | Stack.prototype.has = _stackHas;
|
3539 | Stack.prototype.set = _stackSet;
|
3540 |
|
3541 | var _Stack = Stack;
|
3542 |
|
3543 | var defineProperty = (function() {
|
3544 | try {
|
3545 | var func = _getNative(Object, 'defineProperty');
|
3546 | func({}, '', {});
|
3547 | return func;
|
3548 | } catch (e) {}
|
3549 | }());
|
3550 |
|
3551 | var _defineProperty$1 = defineProperty;
|
3552 |
|
3553 |
|
3554 |
|
3555 |
|
3556 |
|
3557 |
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 | function baseAssignValue(object, key, value) {
|
3563 | if (key == '__proto__' && _defineProperty$1) {
|
3564 | _defineProperty$1(object, key, {
|
3565 | 'configurable': true,
|
3566 | 'enumerable': true,
|
3567 | 'value': value,
|
3568 | 'writable': true
|
3569 | });
|
3570 | } else {
|
3571 | object[key] = value;
|
3572 | }
|
3573 | }
|
3574 |
|
3575 | var _baseAssignValue = baseAssignValue;
|
3576 |
|
3577 |
|
3578 |
|
3579 |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 | function assignMergeValue(object, key, value) {
|
3587 | if ((value !== undefined && !eq_1(object[key], value)) ||
|
3588 | (value === undefined && !(key in object))) {
|
3589 | _baseAssignValue(object, key, value);
|
3590 | }
|
3591 | }
|
3592 |
|
3593 | var _assignMergeValue = assignMergeValue;
|
3594 |
|
3595 |
|
3596 |
|
3597 |
|
3598 |
|
3599 |
|
3600 |
|
3601 |
|
3602 | function createBaseFor(fromRight) {
|
3603 | return function(object, iteratee, keysFunc) {
|
3604 | var index = -1,
|
3605 | iterable = Object(object),
|
3606 | props = keysFunc(object),
|
3607 | length = props.length;
|
3608 |
|
3609 | while (length--) {
|
3610 | var key = props[fromRight ? length : ++index];
|
3611 | if (iteratee(iterable[key], key, iterable) === false) {
|
3612 | break;
|
3613 | }
|
3614 | }
|
3615 | return object;
|
3616 | };
|
3617 | }
|
3618 |
|
3619 | var _createBaseFor = createBaseFor;
|
3620 |
|
3621 |
|
3622 |
|
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 |
|
3629 |
|
3630 |
|
3631 |
|
3632 | var baseFor = _createBaseFor();
|
3633 |
|
3634 | var _baseFor = baseFor;
|
3635 |
|
3636 | var _cloneBuffer = createCommonjsModule(function (module, exports) {
|
3637 |
|
3638 | var freeExports = exports && !exports.nodeType && exports;
|
3639 |
|
3640 |
|
3641 | var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
3642 |
|
3643 |
|
3644 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
3645 |
|
3646 |
|
3647 | var Buffer = moduleExports ? _root.Buffer : undefined,
|
3648 | allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 |
|
3655 |
|
3656 |
|
3657 |
|
3658 | function cloneBuffer(buffer, isDeep) {
|
3659 | if (isDeep) {
|
3660 | return buffer.slice();
|
3661 | }
|
3662 | var length = buffer.length,
|
3663 | result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
3664 |
|
3665 | buffer.copy(result);
|
3666 | return result;
|
3667 | }
|
3668 |
|
3669 | module.exports = cloneBuffer;
|
3670 | });
|
3671 |
|
3672 |
|
3673 | var Uint8Array = _root.Uint8Array;
|
3674 |
|
3675 | var _Uint8Array = Uint8Array;
|
3676 |
|
3677 |
|
3678 |
|
3679 |
|
3680 |
|
3681 |
|
3682 |
|
3683 |
|
3684 | function cloneArrayBuffer(arrayBuffer) {
|
3685 | var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
3686 | new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
|
3687 | return result;
|
3688 | }
|
3689 |
|
3690 | var _cloneArrayBuffer = cloneArrayBuffer;
|
3691 |
|
3692 |
|
3693 |
|
3694 |
|
3695 |
|
3696 |
|
3697 |
|
3698 |
|
3699 |
|
3700 | function cloneTypedArray(typedArray, isDeep) {
|
3701 | var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
3702 | return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
3703 | }
|
3704 |
|
3705 | var _cloneTypedArray = cloneTypedArray;
|
3706 |
|
3707 |
|
3708 |
|
3709 |
|
3710 |
|
3711 |
|
3712 |
|
3713 |
|
3714 |
|
3715 | function copyArray(source, array) {
|
3716 | var index = -1,
|
3717 | length = source.length;
|
3718 |
|
3719 | array || (array = Array(length));
|
3720 | while (++index < length) {
|
3721 | array[index] = source[index];
|
3722 | }
|
3723 | return array;
|
3724 | }
|
3725 |
|
3726 | var _copyArray = copyArray;
|
3727 |
|
3728 |
|
3729 | var objectCreate = Object.create;
|
3730 |
|
3731 |
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 |
|
3738 |
|
3739 | var baseCreate = (function() {
|
3740 | function object() {}
|
3741 | return function(proto) {
|
3742 | if (!isObject_1(proto)) {
|
3743 | return {};
|
3744 | }
|
3745 | if (objectCreate) {
|
3746 | return objectCreate(proto);
|
3747 | }
|
3748 | object.prototype = proto;
|
3749 | var result = new object;
|
3750 | object.prototype = undefined;
|
3751 | return result;
|
3752 | };
|
3753 | }());
|
3754 |
|
3755 | var _baseCreate = baseCreate;
|
3756 |
|
3757 |
|
3758 |
|
3759 |
|
3760 |
|
3761 |
|
3762 |
|
3763 |
|
3764 |
|
3765 | function overArg(func, transform) {
|
3766 | return function(arg) {
|
3767 | return func(transform(arg));
|
3768 | };
|
3769 | }
|
3770 |
|
3771 | var _overArg = overArg;
|
3772 |
|
3773 |
|
3774 | var getPrototype = _overArg(Object.getPrototypeOf, Object);
|
3775 |
|
3776 | var _getPrototype = getPrototype;
|
3777 |
|
3778 |
|
3779 | var objectProto$5 = Object.prototype;
|
3780 |
|
3781 |
|
3782 |
|
3783 |
|
3784 |
|
3785 |
|
3786 |
|
3787 |
|
3788 | function isPrototype(value) {
|
3789 | var Ctor = value && value.constructor,
|
3790 | proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
|
3791 |
|
3792 | return value === proto;
|
3793 | }
|
3794 |
|
3795 | var _isPrototype = isPrototype;
|
3796 |
|
3797 |
|
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 |
|
3803 |
|
3804 | function initCloneObject(object) {
|
3805 | return (typeof object.constructor == 'function' && !_isPrototype(object))
|
3806 | ? _baseCreate(_getPrototype(object))
|
3807 | : {};
|
3808 | }
|
3809 |
|
3810 | var _initCloneObject = initCloneObject;
|
3811 |
|
3812 |
|
3813 |
|
3814 |
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 |
|
3820 |
|
3821 |
|
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 |
|
3828 |
|
3829 |
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 | function isObjectLike(value) {
|
3837 | return value != null && typeof value == 'object';
|
3838 | }
|
3839 |
|
3840 | var isObjectLike_1 = isObjectLike;
|
3841 |
|
3842 |
|
3843 | var argsTag = '[object Arguments]';
|
3844 |
|
3845 |
|
3846 |
|
3847 |
|
3848 |
|
3849 |
|
3850 |
|
3851 |
|
3852 | function baseIsArguments(value) {
|
3853 | return isObjectLike_1(value) && _baseGetTag(value) == argsTag;
|
3854 | }
|
3855 |
|
3856 | var _baseIsArguments = baseIsArguments;
|
3857 |
|
3858 |
|
3859 | var objectProto$6 = Object.prototype;
|
3860 |
|
3861 |
|
3862 | var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
3863 |
|
3864 |
|
3865 | var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
|
3866 |
|
3867 |
|
3868 |
|
3869 |
|
3870 |
|
3871 |
|
3872 |
|
3873 |
|
3874 |
|
3875 |
|
3876 |
|
3877 |
|
3878 |
|
3879 |
|
3880 |
|
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 | var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
|
3886 | return isObjectLike_1(value) && hasOwnProperty$5.call(value, 'callee') &&
|
3887 | !propertyIsEnumerable.call(value, 'callee');
|
3888 | };
|
3889 |
|
3890 | var isArguments_1 = isArguments;
|
3891 |
|
3892 |
|
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 |
|
3903 |
|
3904 |
|
3905 |
|
3906 |
|
3907 |
|
3908 |
|
3909 |
|
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 |
|
3915 | var isArray = Array.isArray;
|
3916 |
|
3917 | var isArray_1 = isArray;
|
3918 |
|
3919 |
|
3920 | var MAX_SAFE_INTEGER = 9007199254740991;
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 |
|
3930 |
|
3931 |
|
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 |
|
3939 |
|
3940 |
|
3941 |
|
3942 |
|
3943 |
|
3944 |
|
3945 |
|
3946 |
|
3947 |
|
3948 | function isLength(value) {
|
3949 | return typeof value == 'number' &&
|
3950 | value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
3951 | }
|
3952 |
|
3953 | var isLength_1 = isLength;
|
3954 |
|
3955 |
|
3956 |
|
3957 |
|
3958 |
|
3959 |
|
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 |
|
3967 |
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 |
|
3974 |
|
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 |
|
3980 | function isArrayLike(value) {
|
3981 | return value != null && isLength_1(value.length) && !isFunction_1(value);
|
3982 | }
|
3983 |
|
3984 | var isArrayLike_1 = isArrayLike;
|
3985 |
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 |
|
3991 |
|
3992 |
|
3993 |
|
3994 |
|
3995 |
|
3996 |
|
3997 |
|
3998 |
|
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 |
|
4005 |
|
4006 |
|
4007 |
|
4008 |
|
4009 |
|
4010 |
|
4011 | function isArrayLikeObject(value) {
|
4012 | return isObjectLike_1(value) && isArrayLike_1(value);
|
4013 | }
|
4014 |
|
4015 | var isArrayLikeObject_1 = isArrayLikeObject;
|
4016 |
|
4017 |
|
4018 |
|
4019 |
|
4020 |
|
4021 |
|
4022 |
|
4023 |
|
4024 |
|
4025 |
|
4026 |
|
4027 |
|
4028 |
|
4029 |
|
4030 | function stubFalse() {
|
4031 | return false;
|
4032 | }
|
4033 |
|
4034 | var stubFalse_1 = stubFalse;
|
4035 |
|
4036 | var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
4037 |
|
4038 | var freeExports = exports && !exports.nodeType && exports;
|
4039 |
|
4040 |
|
4041 | var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
4042 |
|
4043 |
|
4044 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
4045 |
|
4046 |
|
4047 | var Buffer = moduleExports ? _root.Buffer : undefined;
|
4048 |
|
4049 |
|
4050 | var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 |
|
4057 |
|
4058 |
|
4059 |
|
4060 |
|
4061 |
|
4062 |
|
4063 |
|
4064 |
|
4065 |
|
4066 |
|
4067 |
|
4068 |
|
4069 | var isBuffer = nativeIsBuffer || stubFalse_1;
|
4070 |
|
4071 | module.exports = isBuffer;
|
4072 | });
|
4073 |
|
4074 |
|
4075 | var objectTag = '[object Object]';
|
4076 |
|
4077 |
|
4078 | var funcProto$2 = Function.prototype,
|
4079 | objectProto$7 = Object.prototype;
|
4080 |
|
4081 |
|
4082 | var funcToString$2 = funcProto$2.toString;
|
4083 |
|
4084 |
|
4085 | var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
4086 |
|
4087 |
|
4088 | var objectCtorString = funcToString$2.call(Object);
|
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 |
|
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 |
|
4111 |
|
4112 |
|
4113 |
|
4114 |
|
4115 |
|
4116 |
|
4117 |
|
4118 | function isPlainObject(value) {
|
4119 | if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) {
|
4120 | return false;
|
4121 | }
|
4122 | var proto = _getPrototype(value);
|
4123 | if (proto === null) {
|
4124 | return true;
|
4125 | }
|
4126 | var Ctor = hasOwnProperty$6.call(proto, 'constructor') && proto.constructor;
|
4127 | return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
4128 | funcToString$2.call(Ctor) == objectCtorString;
|
4129 | }
|
4130 |
|
4131 | var isPlainObject_1 = isPlainObject;
|
4132 |
|
4133 |
|
4134 | var argsTag$1 = '[object Arguments]',
|
4135 | arrayTag = '[object Array]',
|
4136 | boolTag = '[object Boolean]',
|
4137 | dateTag = '[object Date]',
|
4138 | errorTag = '[object Error]',
|
4139 | funcTag$1 = '[object Function]',
|
4140 | mapTag = '[object Map]',
|
4141 | numberTag = '[object Number]',
|
4142 | objectTag$1 = '[object Object]',
|
4143 | regexpTag = '[object RegExp]',
|
4144 | setTag = '[object Set]',
|
4145 | stringTag = '[object String]',
|
4146 | weakMapTag = '[object WeakMap]';
|
4147 |
|
4148 | var arrayBufferTag = '[object ArrayBuffer]',
|
4149 | dataViewTag = '[object DataView]',
|
4150 | float32Tag = '[object Float32Array]',
|
4151 | float64Tag = '[object Float64Array]',
|
4152 | int8Tag = '[object Int8Array]',
|
4153 | int16Tag = '[object Int16Array]',
|
4154 | int32Tag = '[object Int32Array]',
|
4155 | uint8Tag = '[object Uint8Array]',
|
4156 | uint8ClampedTag = '[object Uint8ClampedArray]',
|
4157 | uint16Tag = '[object Uint16Array]',
|
4158 | uint32Tag = '[object Uint32Array]';
|
4159 |
|
4160 |
|
4161 | var typedArrayTags = {};
|
4162 | typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
4163 | typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
4164 | typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
4165 | typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
4166 | typedArrayTags[uint32Tag] = true;
|
4167 | typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
|
4168 | typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
4169 | typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
4170 | typedArrayTags[errorTag] = typedArrayTags[funcTag$1] =
|
4171 | typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
4172 | typedArrayTags[objectTag$1] = typedArrayTags[regexpTag] =
|
4173 | typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
4174 | typedArrayTags[weakMapTag] = false;
|
4175 |
|
4176 |
|
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 |
|
4182 |
|
4183 | function baseIsTypedArray(value) {
|
4184 | return isObjectLike_1(value) &&
|
4185 | isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
4186 | }
|
4187 |
|
4188 | var _baseIsTypedArray = baseIsTypedArray;
|
4189 |
|
4190 |
|
4191 |
|
4192 |
|
4193 |
|
4194 |
|
4195 |
|
4196 |
|
4197 | function baseUnary(func) {
|
4198 | return function(value) {
|
4199 | return func(value);
|
4200 | };
|
4201 | }
|
4202 |
|
4203 | var _baseUnary = baseUnary;
|
4204 |
|
4205 | var _nodeUtil = createCommonjsModule(function (module, exports) {
|
4206 |
|
4207 | var freeExports = exports && !exports.nodeType && exports;
|
4208 |
|
4209 |
|
4210 | var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
4211 |
|
4212 |
|
4213 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
4214 |
|
4215 |
|
4216 | var freeProcess = moduleExports && _freeGlobal.process;
|
4217 |
|
4218 |
|
4219 | var nodeUtil = (function() {
|
4220 | try {
|
4221 |
|
4222 | var types = freeModule && freeModule.require && freeModule.require('util').types;
|
4223 |
|
4224 | if (types) {
|
4225 | return types;
|
4226 | }
|
4227 |
|
4228 |
|
4229 | return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
4230 | } catch (e) {}
|
4231 | }());
|
4232 |
|
4233 | module.exports = nodeUtil;
|
4234 | });
|
4235 |
|
4236 |
|
4237 | var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
4238 |
|
4239 |
|
4240 |
|
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 |
|
4246 |
|
4247 |
|
4248 |
|
4249 |
|
4250 |
|
4251 |
|
4252 |
|
4253 |
|
4254 |
|
4255 |
|
4256 | var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
4257 |
|
4258 | var isTypedArray_1 = isTypedArray;
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 | function safeGet(object, key) {
|
4269 | if (key === 'constructor' && typeof object[key] === 'function') {
|
4270 | return;
|
4271 | }
|
4272 |
|
4273 | if (key == '__proto__') {
|
4274 | return;
|
4275 | }
|
4276 |
|
4277 | return object[key];
|
4278 | }
|
4279 |
|
4280 | var _safeGet = safeGet;
|
4281 |
|
4282 |
|
4283 | var objectProto$8 = Object.prototype;
|
4284 |
|
4285 |
|
4286 | var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 |
|
4293 |
|
4294 |
|
4295 |
|
4296 |
|
4297 |
|
4298 | function assignValue(object, key, value) {
|
4299 | var objValue = object[key];
|
4300 | if (!(hasOwnProperty$7.call(object, key) && eq_1(objValue, value)) ||
|
4301 | (value === undefined && !(key in object))) {
|
4302 | _baseAssignValue(object, key, value);
|
4303 | }
|
4304 | }
|
4305 |
|
4306 | var _assignValue = assignValue;
|
4307 |
|
4308 |
|
4309 |
|
4310 |
|
4311 |
|
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 |
|
4317 |
|
4318 | function copyObject(source, props, object, customizer) {
|
4319 | var isNew = !object;
|
4320 | object || (object = {});
|
4321 |
|
4322 | var index = -1,
|
4323 | length = props.length;
|
4324 |
|
4325 | while (++index < length) {
|
4326 | var key = props[index];
|
4327 |
|
4328 | var newValue = customizer
|
4329 | ? customizer(object[key], source[key], key, object, source)
|
4330 | : undefined;
|
4331 |
|
4332 | if (newValue === undefined) {
|
4333 | newValue = source[key];
|
4334 | }
|
4335 | if (isNew) {
|
4336 | _baseAssignValue(object, key, newValue);
|
4337 | } else {
|
4338 | _assignValue(object, key, newValue);
|
4339 | }
|
4340 | }
|
4341 | return object;
|
4342 | }
|
4343 |
|
4344 | var _copyObject = copyObject;
|
4345 |
|
4346 |
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 | function baseTimes(n, iteratee) {
|
4356 | var index = -1,
|
4357 | result = Array(n);
|
4358 |
|
4359 | while (++index < n) {
|
4360 | result[index] = iteratee(index);
|
4361 | }
|
4362 | return result;
|
4363 | }
|
4364 |
|
4365 | var _baseTimes = baseTimes;
|
4366 |
|
4367 |
|
4368 | var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
4369 |
|
4370 |
|
4371 | var reIsUint = /^(?:0|[1-9]\d*)$/;
|
4372 |
|
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 |
|
4378 |
|
4379 |
|
4380 |
|
4381 | function isIndex(value, length) {
|
4382 | var type = typeof value;
|
4383 | length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
4384 |
|
4385 | return !!length &&
|
4386 | (type == 'number' ||
|
4387 | (type != 'symbol' && reIsUint.test(value))) &&
|
4388 | (value > -1 && value % 1 == 0 && value < length);
|
4389 | }
|
4390 |
|
4391 | var _isIndex = isIndex;
|
4392 |
|
4393 |
|
4394 | var objectProto$9 = Object.prototype;
|
4395 |
|
4396 |
|
4397 | var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
4398 |
|
4399 |
|
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 |
|
4405 |
|
4406 |
|
4407 | function arrayLikeKeys(value, inherited) {
|
4408 | var isArr = isArray_1(value),
|
4409 | isArg = !isArr && isArguments_1(value),
|
4410 | isBuff = !isArr && !isArg && isBuffer_1(value),
|
4411 | isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
4412 | skipIndexes = isArr || isArg || isBuff || isType,
|
4413 | result = skipIndexes ? _baseTimes(value.length, String) : [],
|
4414 | length = result.length;
|
4415 |
|
4416 | for (var key in value) {
|
4417 | if ((inherited || hasOwnProperty$8.call(value, key)) &&
|
4418 | !(skipIndexes && (
|
4419 |
|
4420 | key == 'length' ||
|
4421 |
|
4422 | (isBuff && (key == 'offset' || key == 'parent')) ||
|
4423 |
|
4424 | (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
4425 |
|
4426 | _isIndex(key, length)
|
4427 | ))) {
|
4428 | result.push(key);
|
4429 | }
|
4430 | }
|
4431 | return result;
|
4432 | }
|
4433 |
|
4434 | var _arrayLikeKeys = arrayLikeKeys;
|
4435 |
|
4436 |
|
4437 |
|
4438 |
|
4439 |
|
4440 |
|
4441 |
|
4442 |
|
4443 |
|
4444 |
|
4445 | function nativeKeysIn(object) {
|
4446 | var result = [];
|
4447 | if (object != null) {
|
4448 | for (var key in Object(object)) {
|
4449 | result.push(key);
|
4450 | }
|
4451 | }
|
4452 | return result;
|
4453 | }
|
4454 |
|
4455 | var _nativeKeysIn = nativeKeysIn;
|
4456 |
|
4457 |
|
4458 | var objectProto$a = Object.prototype;
|
4459 |
|
4460 |
|
4461 | var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
|
4462 |
|
4463 |
|
4464 |
|
4465 |
|
4466 |
|
4467 |
|
4468 |
|
4469 |
|
4470 | function baseKeysIn(object) {
|
4471 | if (!isObject_1(object)) {
|
4472 | return _nativeKeysIn(object);
|
4473 | }
|
4474 | var isProto = _isPrototype(object),
|
4475 | result = [];
|
4476 |
|
4477 | for (var key in object) {
|
4478 | if (!(key == 'constructor' && (isProto || !hasOwnProperty$9.call(object, key)))) {
|
4479 | result.push(key);
|
4480 | }
|
4481 | }
|
4482 | return result;
|
4483 | }
|
4484 |
|
4485 | var _baseKeysIn = baseKeysIn;
|
4486 |
|
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 |
|
4495 |
|
4496 |
|
4497 |
|
4498 |
|
4499 |
|
4500 |
|
4501 |
|
4502 |
|
4503 |
|
4504 |
|
4505 |
|
4506 |
|
4507 |
|
4508 |
|
4509 |
|
4510 | function keysIn(object) {
|
4511 | return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
|
4512 | }
|
4513 |
|
4514 | var keysIn_1 = keysIn;
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 |
|
4522 |
|
4523 |
|
4524 |
|
4525 |
|
4526 |
|
4527 |
|
4528 |
|
4529 |
|
4530 |
|
4531 |
|
4532 |
|
4533 |
|
4534 |
|
4535 |
|
4536 |
|
4537 |
|
4538 |
|
4539 |
|
4540 | function toPlainObject(value) {
|
4541 | return _copyObject(value, keysIn_1(value));
|
4542 | }
|
4543 |
|
4544 | var toPlainObject_1 = toPlainObject;
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 |
|
4553 |
|
4554 |
|
4555 |
|
4556 |
|
4557 |
|
4558 |
|
4559 |
|
4560 |
|
4561 | function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
4562 | var objValue = _safeGet(object, key),
|
4563 | srcValue = _safeGet(source, key),
|
4564 | stacked = stack.get(srcValue);
|
4565 |
|
4566 | if (stacked) {
|
4567 | _assignMergeValue(object, key, stacked);
|
4568 | return;
|
4569 | }
|
4570 | var newValue = customizer
|
4571 | ? customizer(objValue, srcValue, (key + ''), object, source, stack)
|
4572 | : undefined;
|
4573 |
|
4574 | var isCommon = newValue === undefined;
|
4575 |
|
4576 | if (isCommon) {
|
4577 | var isArr = isArray_1(srcValue),
|
4578 | isBuff = !isArr && isBuffer_1(srcValue),
|
4579 | isTyped = !isArr && !isBuff && isTypedArray_1(srcValue);
|
4580 |
|
4581 | newValue = srcValue;
|
4582 | if (isArr || isBuff || isTyped) {
|
4583 | if (isArray_1(objValue)) {
|
4584 | newValue = objValue;
|
4585 | }
|
4586 | else if (isArrayLikeObject_1(objValue)) {
|
4587 | newValue = _copyArray(objValue);
|
4588 | }
|
4589 | else if (isBuff) {
|
4590 | isCommon = false;
|
4591 | newValue = _cloneBuffer(srcValue, true);
|
4592 | }
|
4593 | else if (isTyped) {
|
4594 | isCommon = false;
|
4595 | newValue = _cloneTypedArray(srcValue, true);
|
4596 | }
|
4597 | else {
|
4598 | newValue = [];
|
4599 | }
|
4600 | }
|
4601 | else if (isPlainObject_1(srcValue) || isArguments_1(srcValue)) {
|
4602 | newValue = objValue;
|
4603 | if (isArguments_1(objValue)) {
|
4604 | newValue = toPlainObject_1(objValue);
|
4605 | }
|
4606 | else if (!isObject_1(objValue) || isFunction_1(objValue)) {
|
4607 | newValue = _initCloneObject(srcValue);
|
4608 | }
|
4609 | }
|
4610 | else {
|
4611 | isCommon = false;
|
4612 | }
|
4613 | }
|
4614 | if (isCommon) {
|
4615 |
|
4616 | stack.set(srcValue, newValue);
|
4617 | mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
4618 | stack['delete'](srcValue);
|
4619 | }
|
4620 | _assignMergeValue(object, key, newValue);
|
4621 | }
|
4622 |
|
4623 | var _baseMergeDeep = baseMergeDeep;
|
4624 |
|
4625 |
|
4626 |
|
4627 |
|
4628 |
|
4629 |
|
4630 |
|
4631 |
|
4632 |
|
4633 |
|
4634 |
|
4635 |
|
4636 | function baseMerge(object, source, srcIndex, customizer, stack) {
|
4637 | if (object === source) {
|
4638 | return;
|
4639 | }
|
4640 | _baseFor(source, function(srcValue, key) {
|
4641 | stack || (stack = new _Stack);
|
4642 | if (isObject_1(srcValue)) {
|
4643 | _baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
4644 | }
|
4645 | else {
|
4646 | var newValue = customizer
|
4647 | ? customizer(_safeGet(object, key), srcValue, (key + ''), object, source, stack)
|
4648 | : undefined;
|
4649 |
|
4650 | if (newValue === undefined) {
|
4651 | newValue = srcValue;
|
4652 | }
|
4653 | _assignMergeValue(object, key, newValue);
|
4654 | }
|
4655 | }, keysIn_1);
|
4656 | }
|
4657 |
|
4658 | var _baseMerge = baseMerge;
|
4659 |
|
4660 |
|
4661 |
|
4662 |
|
4663 |
|
4664 |
|
4665 |
|
4666 |
|
4667 |
|
4668 |
|
4669 |
|
4670 |
|
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 | function identity(value) {
|
4677 | return value;
|
4678 | }
|
4679 |
|
4680 | var identity_1 = identity;
|
4681 |
|
4682 |
|
4683 |
|
4684 |
|
4685 |
|
4686 |
|
4687 |
|
4688 |
|
4689 |
|
4690 |
|
4691 |
|
4692 | function apply(func, thisArg, args) {
|
4693 | switch (args.length) {
|
4694 | case 0: return func.call(thisArg);
|
4695 | case 1: return func.call(thisArg, args[0]);
|
4696 | case 2: return func.call(thisArg, args[0], args[1]);
|
4697 | case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
4698 | }
|
4699 | return func.apply(thisArg, args);
|
4700 | }
|
4701 |
|
4702 | var _apply = apply;
|
4703 |
|
4704 |
|
4705 | var nativeMax = Math.max;
|
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 |
|
4712 |
|
4713 |
|
4714 |
|
4715 |
|
4716 | function overRest(func, start, transform) {
|
4717 | start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
4718 | return function() {
|
4719 | var args = arguments,
|
4720 | index = -1,
|
4721 | length = nativeMax(args.length - start, 0),
|
4722 | array = Array(length);
|
4723 |
|
4724 | while (++index < length) {
|
4725 | array[index] = args[start + index];
|
4726 | }
|
4727 | index = -1;
|
4728 | var otherArgs = Array(start + 1);
|
4729 | while (++index < start) {
|
4730 | otherArgs[index] = args[index];
|
4731 | }
|
4732 | otherArgs[start] = transform(array);
|
4733 | return _apply(func, this, otherArgs);
|
4734 | };
|
4735 | }
|
4736 |
|
4737 | var _overRest = overRest;
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 |
|
4747 |
|
4748 |
|
4749 |
|
4750 |
|
4751 |
|
4752 |
|
4753 |
|
4754 |
|
4755 |
|
4756 |
|
4757 |
|
4758 | function constant(value) {
|
4759 | return function() {
|
4760 | return value;
|
4761 | };
|
4762 | }
|
4763 |
|
4764 | var constant_1 = constant;
|
4765 |
|
4766 |
|
4767 |
|
4768 |
|
4769 |
|
4770 |
|
4771 |
|
4772 |
|
4773 |
|
4774 | var baseSetToString = !_defineProperty$1 ? identity_1 : function(func, string) {
|
4775 | return _defineProperty$1(func, 'toString', {
|
4776 | 'configurable': true,
|
4777 | 'enumerable': false,
|
4778 | 'value': constant_1(string),
|
4779 | 'writable': true
|
4780 | });
|
4781 | };
|
4782 |
|
4783 | var _baseSetToString = baseSetToString;
|
4784 |
|
4785 |
|
4786 | var HOT_COUNT = 800,
|
4787 | HOT_SPAN = 16;
|
4788 |
|
4789 |
|
4790 | var nativeNow = Date.now;
|
4791 |
|
4792 |
|
4793 |
|
4794 |
|
4795 |
|
4796 |
|
4797 |
|
4798 |
|
4799 |
|
4800 |
|
4801 | function shortOut(func) {
|
4802 | var count = 0,
|
4803 | lastCalled = 0;
|
4804 |
|
4805 | return function() {
|
4806 | var stamp = nativeNow(),
|
4807 | remaining = HOT_SPAN - (stamp - lastCalled);
|
4808 |
|
4809 | lastCalled = stamp;
|
4810 | if (remaining > 0) {
|
4811 | if (++count >= HOT_COUNT) {
|
4812 | return arguments[0];
|
4813 | }
|
4814 | } else {
|
4815 | count = 0;
|
4816 | }
|
4817 | return func.apply(undefined, arguments);
|
4818 | };
|
4819 | }
|
4820 |
|
4821 | var _shortOut = shortOut;
|
4822 |
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 | var setToString = _shortOut(_baseSetToString);
|
4832 |
|
4833 | var _setToString = setToString;
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 |
|
4839 |
|
4840 |
|
4841 |
|
4842 |
|
4843 | function baseRest(func, start) {
|
4844 | return _setToString(_overRest(func, start, identity_1), func + '');
|
4845 | }
|
4846 |
|
4847 | var _baseRest = baseRest;
|
4848 |
|
4849 |
|
4850 |
|
4851 |
|
4852 |
|
4853 |
|
4854 |
|
4855 |
|
4856 |
|
4857 |
|
4858 |
|
4859 | function isIterateeCall(value, index, object) {
|
4860 | if (!isObject_1(object)) {
|
4861 | return false;
|
4862 | }
|
4863 | var type = typeof index;
|
4864 | if (type == 'number'
|
4865 | ? (isArrayLike_1(object) && _isIndex(index, object.length))
|
4866 | : (type == 'string' && index in object)
|
4867 | ) {
|
4868 | return eq_1(object[index], value);
|
4869 | }
|
4870 | return false;
|
4871 | }
|
4872 |
|
4873 | var _isIterateeCall = isIterateeCall;
|
4874 |
|
4875 |
|
4876 |
|
4877 |
|
4878 |
|
4879 |
|
4880 |
|
4881 |
|
4882 | function createAssigner(assigner) {
|
4883 | return _baseRest(function(object, sources) {
|
4884 | var index = -1,
|
4885 | length = sources.length,
|
4886 | customizer = length > 1 ? sources[length - 1] : undefined,
|
4887 | guard = length > 2 ? sources[2] : undefined;
|
4888 |
|
4889 | customizer = (assigner.length > 3 && typeof customizer == 'function')
|
4890 | ? (length--, customizer)
|
4891 | : undefined;
|
4892 |
|
4893 | if (guard && _isIterateeCall(sources[0], sources[1], guard)) {
|
4894 | customizer = length < 3 ? undefined : customizer;
|
4895 | length = 1;
|
4896 | }
|
4897 | object = Object(object);
|
4898 | while (++index < length) {
|
4899 | var source = sources[index];
|
4900 | if (source) {
|
4901 | assigner(object, source, index, customizer);
|
4902 | }
|
4903 | }
|
4904 | return object;
|
4905 | });
|
4906 | }
|
4907 |
|
4908 | var _createAssigner = createAssigner;
|
4909 |
|
4910 |
|
4911 |
|
4912 |
|
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 |
|
4918 |
|
4919 |
|
4920 |
|
4921 |
|
4922 |
|
4923 |
|
4924 |
|
4925 |
|
4926 |
|
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 |
|
4932 |
|
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 |
|
4938 |
|
4939 |
|
4940 |
|
4941 | var merge = _createAssigner(function(object, source, srcIndex) {
|
4942 | _baseMerge(object, source, srcIndex);
|
4943 | });
|
4944 |
|
4945 | var merge_1 = merge;
|
4946 |
|
4947 |
|
4948 |
|
4949 |
|
4950 |
|
4951 |
|
4952 |
|
4953 | const RAW_ATTRIBUTES = new Set([
|
4954 | 'align', 'valign', 'orientation', 'shrink', 'padding', 'tags', 'shadow',
|
4955 | 'font', 'fontBold', 'fch', 'ch', 'bold', 'underline',
|
4956 | 'clickable', 'input', 'keyable', 'hidden', 'visible', 'scrollable', 'draggable', 'interactive',
|
4957 | 'left', 'right', 'top', 'bottom', 'aleft', 'aright', 'atop', 'abottom',
|
4958 | 'width', 'height',
|
4959 | 'checked',
|
4960 | 'name']);
|
4961 |
|
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 |
|
4967 |
|
4968 | function update(node, options) {
|
4969 |
|
4970 |
|
4971 | const selectQue = [];
|
4972 |
|
4973 | for (let key in options) {
|
4974 | let value = options[key];
|
4975 | if (key === 'selected' && node.select) selectQue.push({
|
4976 | node,
|
4977 | value: typeof value === 'string' ? +value : value
|
4978 | });
|
4979 | else if (key === 'label') node.setLabel(value);
|
4980 | else if (key === 'hoverText' && !value) node.removeHover();
|
4981 | else if (key === 'hoverText' && value) node.setHover(value);
|
4982 | else if (key === 'content') node.setContent(value);
|
4983 | else if (key === 'style') node.style = merge_1({}, node.style, value);
|
4984 | else if (key === 'items') node.setItems(value);
|
4985 | else if (key === 'border') node.border = merge_1({}, node.border, value);
|
4986 | else if (key === 'value' && node.setValue) node.setValue(value);
|
4987 | else if (key === 'filled' && node.filled !== value) node.setProgress(value);
|
4988 | else if ((key === 'rows' || key === 'data') && node.setData) node.setData(value);else if (key === 'focused' && value && !node[key]) node.focus();
|
4989 | else if (RAW_ATTRIBUTES.has(key)) node[key] = value;
|
4990 | }
|
4991 |
|
4992 | selectQue.forEach(({
|
4993 | node,
|
4994 | value
|
4995 | }) => node.select(value));
|
4996 | }
|
4997 |
|
4998 | const emptyArray = [];
|
4999 |
|
5000 |
|
5001 |
|
5002 |
|
5003 |
|
5004 |
|
5005 |
|
5006 | function solveClass(props) {
|
5007 | let {
|
5008 | class: classes
|
5009 | } = props,
|
5010 | rest = _objectWithoutProperties(props, ["class"]);
|
5011 |
|
5012 | const args = [{}];
|
5013 | if (classes) args.push.apply(args, emptyArray.concat(classes));
|
5014 | args.push(rest);
|
5015 | return merge_1.apply(null, args);
|
5016 | }
|
5017 |
|
5018 |
|
5019 |
|
5020 |
|
5021 |
|
5022 |
|
5023 |
|
5024 |
|
5025 |
|
5026 |
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 |
|
5032 |
|
5033 |
|
5034 | var now = function() {
|
5035 | return _root.Date.now();
|
5036 | };
|
5037 |
|
5038 | var now_1 = now;
|
5039 |
|
5040 |
|
5041 | var symbolTag = '[object Symbol]';
|
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 |
|
5047 |
|
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 |
|
5053 |
|
5054 |
|
5055 |
|
5056 |
|
5057 |
|
5058 |
|
5059 |
|
5060 | function isSymbol(value) {
|
5061 | return typeof value == 'symbol' ||
|
5062 | (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
5063 | }
|
5064 |
|
5065 | var isSymbol_1 = isSymbol;
|
5066 |
|
5067 |
|
5068 | var NAN = 0 / 0;
|
5069 |
|
5070 |
|
5071 | var reTrim = /^\s+|\s+$/g;
|
5072 |
|
5073 |
|
5074 | var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
5075 |
|
5076 |
|
5077 | var reIsBinary = /^0b[01]+$/i;
|
5078 |
|
5079 |
|
5080 | var reIsOctal = /^0o[0-7]+$/i;
|
5081 |
|
5082 |
|
5083 | var freeParseInt = parseInt;
|
5084 |
|
5085 |
|
5086 |
|
5087 |
|
5088 |
|
5089 |
|
5090 |
|
5091 |
|
5092 |
|
5093 |
|
5094 |
|
5095 |
|
5096 |
|
5097 |
|
5098 |
|
5099 |
|
5100 |
|
5101 |
|
5102 |
|
5103 |
|
5104 |
|
5105 |
|
5106 |
|
5107 |
|
5108 | function toNumber(value) {
|
5109 | if (typeof value == 'number') {
|
5110 | return value;
|
5111 | }
|
5112 | if (isSymbol_1(value)) {
|
5113 | return NAN;
|
5114 | }
|
5115 | if (isObject_1(value)) {
|
5116 | var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
5117 | value = isObject_1(other) ? (other + '') : other;
|
5118 | }
|
5119 | if (typeof value != 'string') {
|
5120 | return value === 0 ? value : +value;
|
5121 | }
|
5122 | value = value.replace(reTrim, '');
|
5123 | var isBinary = reIsBinary.test(value);
|
5124 | return (isBinary || reIsOctal.test(value))
|
5125 | ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
5126 | : (reIsBadHex.test(value) ? NAN : +value);
|
5127 | }
|
5128 |
|
5129 | var toNumber_1 = toNumber;
|
5130 |
|
5131 |
|
5132 | var FUNC_ERROR_TEXT = 'Expected a function';
|
5133 |
|
5134 |
|
5135 | var nativeMax$1 = Math.max,
|
5136 | nativeMin = Math.min;
|
5137 |
|
5138 |
|
5139 |
|
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 |
|
5147 |
|
5148 |
|
5149 |
|
5150 |
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 |
|
5163 |
|
5164 |
|
5165 |
|
5166 |
|
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 |
|
5178 |
|
5179 |
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 |
|
5191 |
|
5192 | function debounce(func, wait, options) {
|
5193 | var lastArgs,
|
5194 | lastThis,
|
5195 | maxWait,
|
5196 | result,
|
5197 | timerId,
|
5198 | lastCallTime,
|
5199 | lastInvokeTime = 0,
|
5200 | leading = false,
|
5201 | maxing = false,
|
5202 | trailing = true;
|
5203 |
|
5204 | if (typeof func != 'function') {
|
5205 | throw new TypeError(FUNC_ERROR_TEXT);
|
5206 | }
|
5207 | wait = toNumber_1(wait) || 0;
|
5208 | if (isObject_1(options)) {
|
5209 | leading = !!options.leading;
|
5210 | maxing = 'maxWait' in options;
|
5211 | maxWait = maxing ? nativeMax$1(toNumber_1(options.maxWait) || 0, wait) : maxWait;
|
5212 | trailing = 'trailing' in options ? !!options.trailing : trailing;
|
5213 | }
|
5214 |
|
5215 | function invokeFunc(time) {
|
5216 | var args = lastArgs,
|
5217 | thisArg = lastThis;
|
5218 |
|
5219 | lastArgs = lastThis = undefined;
|
5220 | lastInvokeTime = time;
|
5221 | result = func.apply(thisArg, args);
|
5222 | return result;
|
5223 | }
|
5224 |
|
5225 | function leadingEdge(time) {
|
5226 |
|
5227 | lastInvokeTime = time;
|
5228 |
|
5229 | timerId = setTimeout(timerExpired, wait);
|
5230 |
|
5231 | return leading ? invokeFunc(time) : result;
|
5232 | }
|
5233 |
|
5234 | function remainingWait(time) {
|
5235 | var timeSinceLastCall = time - lastCallTime,
|
5236 | timeSinceLastInvoke = time - lastInvokeTime,
|
5237 | timeWaiting = wait - timeSinceLastCall;
|
5238 |
|
5239 | return maxing
|
5240 | ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
5241 | : timeWaiting;
|
5242 | }
|
5243 |
|
5244 | function shouldInvoke(time) {
|
5245 | var timeSinceLastCall = time - lastCallTime,
|
5246 | timeSinceLastInvoke = time - lastInvokeTime;
|
5247 |
|
5248 |
|
5249 |
|
5250 |
|
5251 | return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
5252 | (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
5253 | }
|
5254 |
|
5255 | function timerExpired() {
|
5256 | var time = now_1();
|
5257 | if (shouldInvoke(time)) {
|
5258 | return trailingEdge(time);
|
5259 | }
|
5260 |
|
5261 | timerId = setTimeout(timerExpired, remainingWait(time));
|
5262 | }
|
5263 |
|
5264 | function trailingEdge(time) {
|
5265 | timerId = undefined;
|
5266 |
|
5267 |
|
5268 |
|
5269 | if (trailing && lastArgs) {
|
5270 | return invokeFunc(time);
|
5271 | }
|
5272 | lastArgs = lastThis = undefined;
|
5273 | return result;
|
5274 | }
|
5275 |
|
5276 | function cancel() {
|
5277 | if (timerId !== undefined) {
|
5278 | clearTimeout(timerId);
|
5279 | }
|
5280 | lastInvokeTime = 0;
|
5281 | lastArgs = lastCallTime = lastThis = timerId = undefined;
|
5282 | }
|
5283 |
|
5284 | function flush() {
|
5285 | return timerId === undefined ? result : trailingEdge(now_1());
|
5286 | }
|
5287 |
|
5288 | function debounced() {
|
5289 | var time = now_1(),
|
5290 | isInvoking = shouldInvoke(time);
|
5291 |
|
5292 | lastArgs = arguments;
|
5293 | lastThis = this;
|
5294 | lastCallTime = time;
|
5295 |
|
5296 | if (isInvoking) {
|
5297 | if (timerId === undefined) {
|
5298 | return leadingEdge(lastCallTime);
|
5299 | }
|
5300 | if (maxing) {
|
5301 |
|
5302 | clearTimeout(timerId);
|
5303 | timerId = setTimeout(timerExpired, wait);
|
5304 | return invokeFunc(lastCallTime);
|
5305 | }
|
5306 | }
|
5307 | if (timerId === undefined) {
|
5308 | timerId = setTimeout(timerExpired, wait);
|
5309 | }
|
5310 | return result;
|
5311 | }
|
5312 | debounced.cancel = cancel;
|
5313 | debounced.flush = flush;
|
5314 | return debounced;
|
5315 | }
|
5316 |
|
5317 | var debounce_1 = debounce;
|
5318 |
|
5319 | const emptyObject = {};
|
5320 |
|
5321 | const createBlessedRenderer = function (blessed) {
|
5322 | let screenRef = null;
|
5323 | const BlessedReconciler = ReactFiberReconciler({
|
5324 | supportsMutation: true,
|
5325 | supportsPersistence: false,
|
5326 |
|
5327 | getRootHostContext(rootContainerInstance) {
|
5328 | return emptyObject;
|
5329 | },
|
5330 |
|
5331 | getChildHostContext(parentHostContext, type) {
|
5332 | return emptyObject;
|
5333 | },
|
5334 |
|
5335 | getPublicInstance(instance) {
|
5336 | return instance;
|
5337 | },
|
5338 |
|
5339 | createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
|
5340 | const _solveClass = solveClass(props),
|
5341 | appliedProps = _objectWithoutProperties(_solveClass, ["children"]);
|
5342 |
|
5343 | const blessedTypePrefix = 'blessed-';
|
5344 |
|
5345 | if (type.startsWith(blessedTypePrefix)) {
|
5346 | type = type.slice(blessedTypePrefix.length);
|
5347 | }
|
5348 |
|
5349 | const instance = blessed[type](_objectSpread2(_objectSpread2({}, appliedProps), {}, {
|
5350 | screen: screenRef
|
5351 | }));
|
5352 | instance.props = props;
|
5353 |
|
5354 | instance._eventListener = (...args) => eventListener(instance, ...args);
|
5355 |
|
5356 | instance.on('event', instance._eventListener);
|
5357 | return instance;
|
5358 | },
|
5359 |
|
5360 | appendInitialChild(parentInstance, child) {
|
5361 | parentInstance.append(child);
|
5362 | },
|
5363 |
|
5364 | finalizeInitialChildren(instance, type, props, rootContainerInstance) {
|
5365 | const _solveClass2 = solveClass(props),
|
5366 | appliedProps = _objectWithoutProperties(_solveClass2, ["children"]);
|
5367 |
|
5368 | update(instance, appliedProps);
|
5369 | instance.props = props;
|
5370 | return false;
|
5371 | },
|
5372 |
|
5373 | prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, hostContext) {
|
5374 | return solveClass(newProps);
|
5375 | },
|
5376 |
|
5377 | shouldSetTextContent(props) {
|
5378 | return false;
|
5379 | },
|
5380 |
|
5381 | now: Date.now,
|
5382 |
|
5383 | createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
|
5384 | return blessed.text({
|
5385 | content: text,
|
5386 | screen: screenRef
|
5387 | });
|
5388 | },
|
5389 |
|
5390 | prepareForCommit() {
|
5391 |
|
5392 | return null;
|
5393 | },
|
5394 |
|
5395 | resetAfterCommit() {
|
5396 | },
|
5397 |
|
5398 | commitMount(instance, type, newProps, internalInstanceHandle) {
|
5399 | throw new Error('commitMount not implemented. Please post a reproducible use case that calls this method at https://github.com/Yomguithereal/react-blessed/issues/new');
|
5400 | },
|
5401 |
|
5402 | commitUpdate(instance, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
|
5403 | instance._updating = true;
|
5404 | update(instance, updatePayload);
|
5405 |
|
5406 | instance.props = newProps;
|
5407 | instance._updating = false;
|
5408 | instance.screen.debouncedRender();
|
5409 | },
|
5410 |
|
5411 | commitTextUpdate(textInstance, oldText, newText) {
|
5412 | textInstance.setContent(newText);
|
5413 | textInstance.screen.debouncedRender();
|
5414 | },
|
5415 |
|
5416 | appendChild(parentInstance, child) {
|
5417 | parentInstance.append(child);
|
5418 | },
|
5419 |
|
5420 | appendChildToContainer(parentInstance, child) {
|
5421 | parentInstance.append(child);
|
5422 | },
|
5423 |
|
5424 | insertBefore(parentInstance, child, beforeChild) {
|
5425 |
|
5426 | parentInstance.append(child);
|
5427 | },
|
5428 |
|
5429 | insertInContainerBefore(parentInstance, child, beforeChild) {
|
5430 |
|
5431 | parentInstance.append(child);
|
5432 | },
|
5433 |
|
5434 | removeChild(parentInstance, child) {
|
5435 | parentInstance.remove(child);
|
5436 | child.off('event', child._eventListener);
|
5437 | child.forDescendants(function (el) {
|
5438 | el.off('event', child._eventListener);
|
5439 | });
|
5440 | child.destroy();
|
5441 | },
|
5442 |
|
5443 | removeChildFromContainer(parentInstance, child) {
|
5444 | parentInstance.remove(child);
|
5445 | child.off('event', child._eventListener);
|
5446 | child.forDescendants(function (el) {
|
5447 | el.off('event', child._eventListener);
|
5448 | });
|
5449 | child.destroy();
|
5450 | },
|
5451 |
|
5452 | resetTextContent(instance) {
|
5453 | instance.setContent('');
|
5454 | },
|
5455 |
|
5456 | clearContainer(container) {
|
5457 | container.render();
|
5458 | }
|
5459 |
|
5460 | });
|
5461 | BlessedReconciler.injectIntoDevTools(devtools);
|
5462 | const roots = new Map();
|
5463 | return function render(element, screen, callback) {
|
5464 | screenRef = screen;
|
5465 | let root = roots.get(screen);
|
5466 |
|
5467 | if (!root) {
|
5468 | root = BlessedReconciler.createContainer(screen);
|
5469 | roots.set(screen, root);
|
5470 | }
|
5471 |
|
5472 | screen.once('destroy', () => {
|
5473 | console.log('screen was destroyed!');
|
5474 | });
|
5475 |
|
5476 |
|
5477 | screen.debouncedRender = debounce_1(() => screen.render(), 16);
|
5478 | BlessedReconciler.updateContainer(element, root, null, callback);
|
5479 | screen.debouncedRender();
|
5480 | return BlessedReconciler.getPublicRootInstance(root);
|
5481 | };
|
5482 | };
|
5483 |
|
5484 | module.exports = {
|
5485 | render: function render(element, screen, callback) {
|
5486 | const blessed = require('blessed');
|
5487 |
|
5488 | const renderer = createBlessedRenderer(blessed);
|
5489 | return renderer(element, screen, callback);
|
5490 | },
|
5491 | createBlessedRenderer: createBlessedRenderer
|
5492 | };
|
5493 |
|