@reactuses/core 2.2.6 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import React, { useRef, useEffect, useLayoutEffect, useCallback, useMemo, useState, useReducer } from 'react';
2
- import lodash from 'lodash';
3
2
 
4
3
  function usePrevious(state) {
5
4
  const ref = useRef();
@@ -40,7 +39,7 @@ var useUpdateEffect = createUpdateEffect(useEffect);
40
39
  var index$4 = createUpdateEffect(useLayoutEffect);
41
40
 
42
41
  var _a;
43
- const isFunction = (val) => typeof val === "function";
42
+ const isFunction$1 = (val) => typeof val === "function";
44
43
  const isDev = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
45
44
  const isBrowser = typeof window !== "undefined";
46
45
  const isNavigator = typeof navigator !== "undefined";
@@ -57,7 +56,7 @@ const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
57
56
 
58
57
  function useEvent(fn) {
59
58
  if (isDev) {
60
- if (!isFunction(fn)) {
59
+ if (!isFunction$1(fn)) {
61
60
  console.error(
62
61
  `useEvent expected parameter is a function, got ${typeof fn}`
63
62
  );
@@ -73,6 +72,2412 @@ function useEvent(fn) {
73
72
  }, []);
74
73
  }
75
74
 
75
+ /** Detect free variable `global` from Node.js. */
76
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
77
+
78
+ /** Detect free variable `self`. */
79
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
80
+
81
+ /** Used as a reference to the global object. */
82
+ var root = freeGlobal || freeSelf || Function('return this')();
83
+
84
+ /** Built-in value references. */
85
+ var Symbol = root.Symbol;
86
+
87
+ /** Used for built-in method references. */
88
+ var objectProto$b = Object.prototype;
89
+
90
+ /** Used to check objects for own properties. */
91
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
92
+
93
+ /**
94
+ * Used to resolve the
95
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
96
+ * of values.
97
+ */
98
+ var nativeObjectToString$1 = objectProto$b.toString;
99
+
100
+ /** Built-in value references. */
101
+ var symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;
102
+
103
+ /**
104
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
105
+ *
106
+ * @private
107
+ * @param {*} value The value to query.
108
+ * @returns {string} Returns the raw `toStringTag`.
109
+ */
110
+ function getRawTag(value) {
111
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
112
+ tag = value[symToStringTag$1];
113
+
114
+ try {
115
+ value[symToStringTag$1] = undefined;
116
+ var unmasked = true;
117
+ } catch (e) {}
118
+
119
+ var result = nativeObjectToString$1.call(value);
120
+ if (unmasked) {
121
+ if (isOwn) {
122
+ value[symToStringTag$1] = tag;
123
+ } else {
124
+ delete value[symToStringTag$1];
125
+ }
126
+ }
127
+ return result;
128
+ }
129
+
130
+ /** Used for built-in method references. */
131
+ var objectProto$a = Object.prototype;
132
+
133
+ /**
134
+ * Used to resolve the
135
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
136
+ * of values.
137
+ */
138
+ var nativeObjectToString = objectProto$a.toString;
139
+
140
+ /**
141
+ * Converts `value` to a string using `Object.prototype.toString`.
142
+ *
143
+ * @private
144
+ * @param {*} value The value to convert.
145
+ * @returns {string} Returns the converted string.
146
+ */
147
+ function objectToString(value) {
148
+ return nativeObjectToString.call(value);
149
+ }
150
+
151
+ /** `Object#toString` result references. */
152
+ var nullTag = '[object Null]',
153
+ undefinedTag = '[object Undefined]';
154
+
155
+ /** Built-in value references. */
156
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
157
+
158
+ /**
159
+ * The base implementation of `getTag` without fallbacks for buggy environments.
160
+ *
161
+ * @private
162
+ * @param {*} value The value to query.
163
+ * @returns {string} Returns the `toStringTag`.
164
+ */
165
+ function baseGetTag(value) {
166
+ if (value == null) {
167
+ return value === undefined ? undefinedTag : nullTag;
168
+ }
169
+ return (symToStringTag && symToStringTag in Object(value))
170
+ ? getRawTag(value)
171
+ : objectToString(value);
172
+ }
173
+
174
+ /**
175
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
176
+ * and has a `typeof` result of "object".
177
+ *
178
+ * @static
179
+ * @memberOf _
180
+ * @since 4.0.0
181
+ * @category Lang
182
+ * @param {*} value The value to check.
183
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
184
+ * @example
185
+ *
186
+ * _.isObjectLike({});
187
+ * // => true
188
+ *
189
+ * _.isObjectLike([1, 2, 3]);
190
+ * // => true
191
+ *
192
+ * _.isObjectLike(_.noop);
193
+ * // => false
194
+ *
195
+ * _.isObjectLike(null);
196
+ * // => false
197
+ */
198
+ function isObjectLike(value) {
199
+ return value != null && typeof value == 'object';
200
+ }
201
+
202
+ /** `Object#toString` result references. */
203
+ var symbolTag$1 = '[object Symbol]';
204
+
205
+ /**
206
+ * Checks if `value` is classified as a `Symbol` primitive or object.
207
+ *
208
+ * @static
209
+ * @memberOf _
210
+ * @since 4.0.0
211
+ * @category Lang
212
+ * @param {*} value The value to check.
213
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
214
+ * @example
215
+ *
216
+ * _.isSymbol(Symbol.iterator);
217
+ * // => true
218
+ *
219
+ * _.isSymbol('abc');
220
+ * // => false
221
+ */
222
+ function isSymbol(value) {
223
+ return typeof value == 'symbol' ||
224
+ (isObjectLike(value) && baseGetTag(value) == symbolTag$1);
225
+ }
226
+
227
+ /**
228
+ * Checks if `value` is classified as an `Array` object.
229
+ *
230
+ * @static
231
+ * @memberOf _
232
+ * @since 0.1.0
233
+ * @category Lang
234
+ * @param {*} value The value to check.
235
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
236
+ * @example
237
+ *
238
+ * _.isArray([1, 2, 3]);
239
+ * // => true
240
+ *
241
+ * _.isArray(document.body.children);
242
+ * // => false
243
+ *
244
+ * _.isArray('abc');
245
+ * // => false
246
+ *
247
+ * _.isArray(_.noop);
248
+ * // => false
249
+ */
250
+ var isArray = Array.isArray;
251
+
252
+ /** Used to match a single whitespace character. */
253
+ var reWhitespace = /\s/;
254
+
255
+ /**
256
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
257
+ * character of `string`.
258
+ *
259
+ * @private
260
+ * @param {string} string The string to inspect.
261
+ * @returns {number} Returns the index of the last non-whitespace character.
262
+ */
263
+ function trimmedEndIndex(string) {
264
+ var index = string.length;
265
+
266
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
267
+ return index;
268
+ }
269
+
270
+ /** Used to match leading whitespace. */
271
+ var reTrimStart = /^\s+/;
272
+
273
+ /**
274
+ * The base implementation of `_.trim`.
275
+ *
276
+ * @private
277
+ * @param {string} string The string to trim.
278
+ * @returns {string} Returns the trimmed string.
279
+ */
280
+ function baseTrim(string) {
281
+ return string
282
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
283
+ : string;
284
+ }
285
+
286
+ /**
287
+ * Checks if `value` is the
288
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
289
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
290
+ *
291
+ * @static
292
+ * @memberOf _
293
+ * @since 0.1.0
294
+ * @category Lang
295
+ * @param {*} value The value to check.
296
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
297
+ * @example
298
+ *
299
+ * _.isObject({});
300
+ * // => true
301
+ *
302
+ * _.isObject([1, 2, 3]);
303
+ * // => true
304
+ *
305
+ * _.isObject(_.noop);
306
+ * // => true
307
+ *
308
+ * _.isObject(null);
309
+ * // => false
310
+ */
311
+ function isObject(value) {
312
+ var type = typeof value;
313
+ return value != null && (type == 'object' || type == 'function');
314
+ }
315
+
316
+ /** Used as references for various `Number` constants. */
317
+ var NAN = 0 / 0;
318
+
319
+ /** Used to detect bad signed hexadecimal string values. */
320
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
321
+
322
+ /** Used to detect binary string values. */
323
+ var reIsBinary = /^0b[01]+$/i;
324
+
325
+ /** Used to detect octal string values. */
326
+ var reIsOctal = /^0o[0-7]+$/i;
327
+
328
+ /** Built-in method references without a dependency on `root`. */
329
+ var freeParseInt = parseInt;
330
+
331
+ /**
332
+ * Converts `value` to a number.
333
+ *
334
+ * @static
335
+ * @memberOf _
336
+ * @since 4.0.0
337
+ * @category Lang
338
+ * @param {*} value The value to process.
339
+ * @returns {number} Returns the number.
340
+ * @example
341
+ *
342
+ * _.toNumber(3.2);
343
+ * // => 3.2
344
+ *
345
+ * _.toNumber(Number.MIN_VALUE);
346
+ * // => 5e-324
347
+ *
348
+ * _.toNumber(Infinity);
349
+ * // => Infinity
350
+ *
351
+ * _.toNumber('3.2');
352
+ * // => 3.2
353
+ */
354
+ function toNumber(value) {
355
+ if (typeof value == 'number') {
356
+ return value;
357
+ }
358
+ if (isSymbol(value)) {
359
+ return NAN;
360
+ }
361
+ if (isObject(value)) {
362
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
363
+ value = isObject(other) ? (other + '') : other;
364
+ }
365
+ if (typeof value != 'string') {
366
+ return value === 0 ? value : +value;
367
+ }
368
+ value = baseTrim(value);
369
+ var isBinary = reIsBinary.test(value);
370
+ return (isBinary || reIsOctal.test(value))
371
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
372
+ : (reIsBadHex.test(value) ? NAN : +value);
373
+ }
374
+
375
+ /** `Object#toString` result references. */
376
+ var asyncTag = '[object AsyncFunction]',
377
+ funcTag$1 = '[object Function]',
378
+ genTag = '[object GeneratorFunction]',
379
+ proxyTag = '[object Proxy]';
380
+
381
+ /**
382
+ * Checks if `value` is classified as a `Function` object.
383
+ *
384
+ * @static
385
+ * @memberOf _
386
+ * @since 0.1.0
387
+ * @category Lang
388
+ * @param {*} value The value to check.
389
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
390
+ * @example
391
+ *
392
+ * _.isFunction(_);
393
+ * // => true
394
+ *
395
+ * _.isFunction(/abc/);
396
+ * // => false
397
+ */
398
+ function isFunction(value) {
399
+ if (!isObject(value)) {
400
+ return false;
401
+ }
402
+ // The use of `Object#toString` avoids issues with the `typeof` operator
403
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
404
+ var tag = baseGetTag(value);
405
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
406
+ }
407
+
408
+ /** Used to detect overreaching core-js shims. */
409
+ var coreJsData = root['__core-js_shared__'];
410
+
411
+ /** Used to detect methods masquerading as native. */
412
+ var maskSrcKey = (function() {
413
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
414
+ return uid ? ('Symbol(src)_1.' + uid) : '';
415
+ }());
416
+
417
+ /**
418
+ * Checks if `func` has its source masked.
419
+ *
420
+ * @private
421
+ * @param {Function} func The function to check.
422
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
423
+ */
424
+ function isMasked(func) {
425
+ return !!maskSrcKey && (maskSrcKey in func);
426
+ }
427
+
428
+ /** Used for built-in method references. */
429
+ var funcProto$1 = Function.prototype;
430
+
431
+ /** Used to resolve the decompiled source of functions. */
432
+ var funcToString$1 = funcProto$1.toString;
433
+
434
+ /**
435
+ * Converts `func` to its source code.
436
+ *
437
+ * @private
438
+ * @param {Function} func The function to convert.
439
+ * @returns {string} Returns the source code.
440
+ */
441
+ function toSource(func) {
442
+ if (func != null) {
443
+ try {
444
+ return funcToString$1.call(func);
445
+ } catch (e) {}
446
+ try {
447
+ return (func + '');
448
+ } catch (e) {}
449
+ }
450
+ return '';
451
+ }
452
+
453
+ /**
454
+ * Used to match `RegExp`
455
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
456
+ */
457
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
458
+
459
+ /** Used to detect host constructors (Safari). */
460
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
461
+
462
+ /** Used for built-in method references. */
463
+ var funcProto = Function.prototype,
464
+ objectProto$9 = Object.prototype;
465
+
466
+ /** Used to resolve the decompiled source of functions. */
467
+ var funcToString = funcProto.toString;
468
+
469
+ /** Used to check objects for own properties. */
470
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
471
+
472
+ /** Used to detect if a method is native. */
473
+ var reIsNative = RegExp('^' +
474
+ funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
475
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
476
+ );
477
+
478
+ /**
479
+ * The base implementation of `_.isNative` without bad shim checks.
480
+ *
481
+ * @private
482
+ * @param {*} value The value to check.
483
+ * @returns {boolean} Returns `true` if `value` is a native function,
484
+ * else `false`.
485
+ */
486
+ function baseIsNative(value) {
487
+ if (!isObject(value) || isMasked(value)) {
488
+ return false;
489
+ }
490
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
491
+ return pattern.test(toSource(value));
492
+ }
493
+
494
+ /**
495
+ * Gets the value at `key` of `object`.
496
+ *
497
+ * @private
498
+ * @param {Object} [object] The object to query.
499
+ * @param {string} key The key of the property to get.
500
+ * @returns {*} Returns the property value.
501
+ */
502
+ function getValue(object, key) {
503
+ return object == null ? undefined : object[key];
504
+ }
505
+
506
+ /**
507
+ * Gets the native function at `key` of `object`.
508
+ *
509
+ * @private
510
+ * @param {Object} object The object to query.
511
+ * @param {string} key The key of the method to get.
512
+ * @returns {*} Returns the function if it's native, else `undefined`.
513
+ */
514
+ function getNative(object, key) {
515
+ var value = getValue(object, key);
516
+ return baseIsNative(value) ? value : undefined;
517
+ }
518
+
519
+ /* Built-in method references that are verified to be native. */
520
+ var WeakMap = getNative(root, 'WeakMap');
521
+
522
+ /** Used as references for various `Number` constants. */
523
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
524
+
525
+ /** Used to detect unsigned integer values. */
526
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
527
+
528
+ /**
529
+ * Checks if `value` is a valid array-like index.
530
+ *
531
+ * @private
532
+ * @param {*} value The value to check.
533
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
534
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
535
+ */
536
+ function isIndex(value, length) {
537
+ var type = typeof value;
538
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
539
+
540
+ return !!length &&
541
+ (type == 'number' ||
542
+ (type != 'symbol' && reIsUint.test(value))) &&
543
+ (value > -1 && value % 1 == 0 && value < length);
544
+ }
545
+
546
+ /**
547
+ * Performs a
548
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
549
+ * comparison between two values to determine if they are equivalent.
550
+ *
551
+ * @static
552
+ * @memberOf _
553
+ * @since 4.0.0
554
+ * @category Lang
555
+ * @param {*} value The value to compare.
556
+ * @param {*} other The other value to compare.
557
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
558
+ * @example
559
+ *
560
+ * var object = { 'a': 1 };
561
+ * var other = { 'a': 1 };
562
+ *
563
+ * _.eq(object, object);
564
+ * // => true
565
+ *
566
+ * _.eq(object, other);
567
+ * // => false
568
+ *
569
+ * _.eq('a', 'a');
570
+ * // => true
571
+ *
572
+ * _.eq('a', Object('a'));
573
+ * // => false
574
+ *
575
+ * _.eq(NaN, NaN);
576
+ * // => true
577
+ */
578
+ function eq(value, other) {
579
+ return value === other || (value !== value && other !== other);
580
+ }
581
+
582
+ /** Used as references for various `Number` constants. */
583
+ var MAX_SAFE_INTEGER = 9007199254740991;
584
+
585
+ /**
586
+ * Checks if `value` is a valid array-like length.
587
+ *
588
+ * **Note:** This method is loosely based on
589
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
590
+ *
591
+ * @static
592
+ * @memberOf _
593
+ * @since 4.0.0
594
+ * @category Lang
595
+ * @param {*} value The value to check.
596
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
597
+ * @example
598
+ *
599
+ * _.isLength(3);
600
+ * // => true
601
+ *
602
+ * _.isLength(Number.MIN_VALUE);
603
+ * // => false
604
+ *
605
+ * _.isLength(Infinity);
606
+ * // => false
607
+ *
608
+ * _.isLength('3');
609
+ * // => false
610
+ */
611
+ function isLength(value) {
612
+ return typeof value == 'number' &&
613
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
614
+ }
615
+
616
+ /**
617
+ * Checks if `value` is array-like. A value is considered array-like if it's
618
+ * not a function and has a `value.length` that's an integer greater than or
619
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
620
+ *
621
+ * @static
622
+ * @memberOf _
623
+ * @since 4.0.0
624
+ * @category Lang
625
+ * @param {*} value The value to check.
626
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
627
+ * @example
628
+ *
629
+ * _.isArrayLike([1, 2, 3]);
630
+ * // => true
631
+ *
632
+ * _.isArrayLike(document.body.children);
633
+ * // => true
634
+ *
635
+ * _.isArrayLike('abc');
636
+ * // => true
637
+ *
638
+ * _.isArrayLike(_.noop);
639
+ * // => false
640
+ */
641
+ function isArrayLike(value) {
642
+ return value != null && isLength(value.length) && !isFunction(value);
643
+ }
644
+
645
+ /** Used for built-in method references. */
646
+ var objectProto$8 = Object.prototype;
647
+
648
+ /**
649
+ * Checks if `value` is likely a prototype object.
650
+ *
651
+ * @private
652
+ * @param {*} value The value to check.
653
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
654
+ */
655
+ function isPrototype(value) {
656
+ var Ctor = value && value.constructor,
657
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
658
+
659
+ return value === proto;
660
+ }
661
+
662
+ /**
663
+ * The base implementation of `_.times` without support for iteratee shorthands
664
+ * or max array length checks.
665
+ *
666
+ * @private
667
+ * @param {number} n The number of times to invoke `iteratee`.
668
+ * @param {Function} iteratee The function invoked per iteration.
669
+ * @returns {Array} Returns the array of results.
670
+ */
671
+ function baseTimes(n, iteratee) {
672
+ var index = -1,
673
+ result = Array(n);
674
+
675
+ while (++index < n) {
676
+ result[index] = iteratee(index);
677
+ }
678
+ return result;
679
+ }
680
+
681
+ /** `Object#toString` result references. */
682
+ var argsTag$2 = '[object Arguments]';
683
+
684
+ /**
685
+ * The base implementation of `_.isArguments`.
686
+ *
687
+ * @private
688
+ * @param {*} value The value to check.
689
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
690
+ */
691
+ function baseIsArguments(value) {
692
+ return isObjectLike(value) && baseGetTag(value) == argsTag$2;
693
+ }
694
+
695
+ /** Used for built-in method references. */
696
+ var objectProto$7 = Object.prototype;
697
+
698
+ /** Used to check objects for own properties. */
699
+ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
700
+
701
+ /** Built-in value references. */
702
+ var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
703
+
704
+ /**
705
+ * Checks if `value` is likely an `arguments` object.
706
+ *
707
+ * @static
708
+ * @memberOf _
709
+ * @since 0.1.0
710
+ * @category Lang
711
+ * @param {*} value The value to check.
712
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
713
+ * else `false`.
714
+ * @example
715
+ *
716
+ * _.isArguments(function() { return arguments; }());
717
+ * // => true
718
+ *
719
+ * _.isArguments([1, 2, 3]);
720
+ * // => false
721
+ */
722
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
723
+ return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') &&
724
+ !propertyIsEnumerable$1.call(value, 'callee');
725
+ };
726
+
727
+ /**
728
+ * This method returns `false`.
729
+ *
730
+ * @static
731
+ * @memberOf _
732
+ * @since 4.13.0
733
+ * @category Util
734
+ * @returns {boolean} Returns `false`.
735
+ * @example
736
+ *
737
+ * _.times(2, _.stubFalse);
738
+ * // => [false, false]
739
+ */
740
+ function stubFalse() {
741
+ return false;
742
+ }
743
+
744
+ /** Detect free variable `exports`. */
745
+ var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
746
+
747
+ /** Detect free variable `module`. */
748
+ var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
749
+
750
+ /** Detect the popular CommonJS extension `module.exports`. */
751
+ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
752
+
753
+ /** Built-in value references. */
754
+ var Buffer = moduleExports$1 ? root.Buffer : undefined;
755
+
756
+ /* Built-in method references for those with the same name as other `lodash` methods. */
757
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
758
+
759
+ /**
760
+ * Checks if `value` is a buffer.
761
+ *
762
+ * @static
763
+ * @memberOf _
764
+ * @since 4.3.0
765
+ * @category Lang
766
+ * @param {*} value The value to check.
767
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
768
+ * @example
769
+ *
770
+ * _.isBuffer(new Buffer(2));
771
+ * // => true
772
+ *
773
+ * _.isBuffer(new Uint8Array(2));
774
+ * // => false
775
+ */
776
+ var isBuffer = nativeIsBuffer || stubFalse;
777
+
778
+ /** `Object#toString` result references. */
779
+ var argsTag$1 = '[object Arguments]',
780
+ arrayTag$1 = '[object Array]',
781
+ boolTag$1 = '[object Boolean]',
782
+ dateTag$1 = '[object Date]',
783
+ errorTag$1 = '[object Error]',
784
+ funcTag = '[object Function]',
785
+ mapTag$2 = '[object Map]',
786
+ numberTag$1 = '[object Number]',
787
+ objectTag$2 = '[object Object]',
788
+ regexpTag$1 = '[object RegExp]',
789
+ setTag$2 = '[object Set]',
790
+ stringTag$1 = '[object String]',
791
+ weakMapTag$1 = '[object WeakMap]';
792
+
793
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
794
+ dataViewTag$2 = '[object DataView]',
795
+ float32Tag = '[object Float32Array]',
796
+ float64Tag = '[object Float64Array]',
797
+ int8Tag = '[object Int8Array]',
798
+ int16Tag = '[object Int16Array]',
799
+ int32Tag = '[object Int32Array]',
800
+ uint8Tag = '[object Uint8Array]',
801
+ uint8ClampedTag = '[object Uint8ClampedArray]',
802
+ uint16Tag = '[object Uint16Array]',
803
+ uint32Tag = '[object Uint32Array]';
804
+
805
+ /** Used to identify `toStringTag` values of typed arrays. */
806
+ var typedArrayTags = {};
807
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
808
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
809
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
810
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
811
+ typedArrayTags[uint32Tag] = true;
812
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
813
+ typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] =
814
+ typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] =
815
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag] =
816
+ typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] =
817
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] =
818
+ typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] =
819
+ typedArrayTags[weakMapTag$1] = false;
820
+
821
+ /**
822
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
823
+ *
824
+ * @private
825
+ * @param {*} value The value to check.
826
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
827
+ */
828
+ function baseIsTypedArray(value) {
829
+ return isObjectLike(value) &&
830
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
831
+ }
832
+
833
+ /**
834
+ * The base implementation of `_.unary` without support for storing metadata.
835
+ *
836
+ * @private
837
+ * @param {Function} func The function to cap arguments for.
838
+ * @returns {Function} Returns the new capped function.
839
+ */
840
+ function baseUnary(func) {
841
+ return function(value) {
842
+ return func(value);
843
+ };
844
+ }
845
+
846
+ /** Detect free variable `exports`. */
847
+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
848
+
849
+ /** Detect free variable `module`. */
850
+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
851
+
852
+ /** Detect the popular CommonJS extension `module.exports`. */
853
+ var moduleExports = freeModule && freeModule.exports === freeExports;
854
+
855
+ /** Detect free variable `process` from Node.js. */
856
+ var freeProcess = moduleExports && freeGlobal.process;
857
+
858
+ /** Used to access faster Node.js helpers. */
859
+ var nodeUtil = (function() {
860
+ try {
861
+ // Use `util.types` for Node.js 10+.
862
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
863
+
864
+ if (types) {
865
+ return types;
866
+ }
867
+
868
+ // Legacy `process.binding('util')` for Node.js < 10.
869
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
870
+ } catch (e) {}
871
+ }());
872
+
873
+ /* Node.js helper references. */
874
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
875
+
876
+ /**
877
+ * Checks if `value` is classified as a typed array.
878
+ *
879
+ * @static
880
+ * @memberOf _
881
+ * @since 3.0.0
882
+ * @category Lang
883
+ * @param {*} value The value to check.
884
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
885
+ * @example
886
+ *
887
+ * _.isTypedArray(new Uint8Array);
888
+ * // => true
889
+ *
890
+ * _.isTypedArray([]);
891
+ * // => false
892
+ */
893
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
894
+
895
+ /** Used for built-in method references. */
896
+ var objectProto$6 = Object.prototype;
897
+
898
+ /** Used to check objects for own properties. */
899
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
900
+
901
+ /**
902
+ * Creates an array of the enumerable property names of the array-like `value`.
903
+ *
904
+ * @private
905
+ * @param {*} value The value to query.
906
+ * @param {boolean} inherited Specify returning inherited property names.
907
+ * @returns {Array} Returns the array of property names.
908
+ */
909
+ function arrayLikeKeys(value, inherited) {
910
+ var isArr = isArray(value),
911
+ isArg = !isArr && isArguments(value),
912
+ isBuff = !isArr && !isArg && isBuffer(value),
913
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
914
+ skipIndexes = isArr || isArg || isBuff || isType,
915
+ result = skipIndexes ? baseTimes(value.length, String) : [],
916
+ length = result.length;
917
+
918
+ for (var key in value) {
919
+ if ((inherited || hasOwnProperty$5.call(value, key)) &&
920
+ !(skipIndexes && (
921
+ // Safari 9 has enumerable `arguments.length` in strict mode.
922
+ key == 'length' ||
923
+ // Node.js 0.10 has enumerable non-index properties on buffers.
924
+ (isBuff && (key == 'offset' || key == 'parent')) ||
925
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
926
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
927
+ // Skip index properties.
928
+ isIndex(key, length)
929
+ ))) {
930
+ result.push(key);
931
+ }
932
+ }
933
+ return result;
934
+ }
935
+
936
+ /**
937
+ * Creates a unary function that invokes `func` with its argument transformed.
938
+ *
939
+ * @private
940
+ * @param {Function} func The function to wrap.
941
+ * @param {Function} transform The argument transform.
942
+ * @returns {Function} Returns the new function.
943
+ */
944
+ function overArg(func, transform) {
945
+ return function(arg) {
946
+ return func(transform(arg));
947
+ };
948
+ }
949
+
950
+ /* Built-in method references for those with the same name as other `lodash` methods. */
951
+ var nativeKeys = overArg(Object.keys, Object);
952
+
953
+ /** Used for built-in method references. */
954
+ var objectProto$5 = Object.prototype;
955
+
956
+ /** Used to check objects for own properties. */
957
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
958
+
959
+ /**
960
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
961
+ *
962
+ * @private
963
+ * @param {Object} object The object to query.
964
+ * @returns {Array} Returns the array of property names.
965
+ */
966
+ function baseKeys(object) {
967
+ if (!isPrototype(object)) {
968
+ return nativeKeys(object);
969
+ }
970
+ var result = [];
971
+ for (var key in Object(object)) {
972
+ if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
973
+ result.push(key);
974
+ }
975
+ }
976
+ return result;
977
+ }
978
+
979
+ /**
980
+ * Creates an array of the own enumerable property names of `object`.
981
+ *
982
+ * **Note:** Non-object values are coerced to objects. See the
983
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
984
+ * for more details.
985
+ *
986
+ * @static
987
+ * @since 0.1.0
988
+ * @memberOf _
989
+ * @category Object
990
+ * @param {Object} object The object to query.
991
+ * @returns {Array} Returns the array of property names.
992
+ * @example
993
+ *
994
+ * function Foo() {
995
+ * this.a = 1;
996
+ * this.b = 2;
997
+ * }
998
+ *
999
+ * Foo.prototype.c = 3;
1000
+ *
1001
+ * _.keys(new Foo);
1002
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1003
+ *
1004
+ * _.keys('hi');
1005
+ * // => ['0', '1']
1006
+ */
1007
+ function keys(object) {
1008
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1009
+ }
1010
+
1011
+ /* Built-in method references that are verified to be native. */
1012
+ var nativeCreate = getNative(Object, 'create');
1013
+
1014
+ /**
1015
+ * Removes all key-value entries from the hash.
1016
+ *
1017
+ * @private
1018
+ * @name clear
1019
+ * @memberOf Hash
1020
+ */
1021
+ function hashClear() {
1022
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
1023
+ this.size = 0;
1024
+ }
1025
+
1026
+ /**
1027
+ * Removes `key` and its value from the hash.
1028
+ *
1029
+ * @private
1030
+ * @name delete
1031
+ * @memberOf Hash
1032
+ * @param {Object} hash The hash to modify.
1033
+ * @param {string} key The key of the value to remove.
1034
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1035
+ */
1036
+ function hashDelete(key) {
1037
+ var result = this.has(key) && delete this.__data__[key];
1038
+ this.size -= result ? 1 : 0;
1039
+ return result;
1040
+ }
1041
+
1042
+ /** Used to stand-in for `undefined` hash values. */
1043
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
1044
+
1045
+ /** Used for built-in method references. */
1046
+ var objectProto$4 = Object.prototype;
1047
+
1048
+ /** Used to check objects for own properties. */
1049
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1050
+
1051
+ /**
1052
+ * Gets the hash value for `key`.
1053
+ *
1054
+ * @private
1055
+ * @name get
1056
+ * @memberOf Hash
1057
+ * @param {string} key The key of the value to get.
1058
+ * @returns {*} Returns the entry value.
1059
+ */
1060
+ function hashGet(key) {
1061
+ var data = this.__data__;
1062
+ if (nativeCreate) {
1063
+ var result = data[key];
1064
+ return result === HASH_UNDEFINED$2 ? undefined : result;
1065
+ }
1066
+ return hasOwnProperty$3.call(data, key) ? data[key] : undefined;
1067
+ }
1068
+
1069
+ /** Used for built-in method references. */
1070
+ var objectProto$3 = Object.prototype;
1071
+
1072
+ /** Used to check objects for own properties. */
1073
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1074
+
1075
+ /**
1076
+ * Checks if a hash value for `key` exists.
1077
+ *
1078
+ * @private
1079
+ * @name has
1080
+ * @memberOf Hash
1081
+ * @param {string} key The key of the entry to check.
1082
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1083
+ */
1084
+ function hashHas(key) {
1085
+ var data = this.__data__;
1086
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$2.call(data, key);
1087
+ }
1088
+
1089
+ /** Used to stand-in for `undefined` hash values. */
1090
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1091
+
1092
+ /**
1093
+ * Sets the hash `key` to `value`.
1094
+ *
1095
+ * @private
1096
+ * @name set
1097
+ * @memberOf Hash
1098
+ * @param {string} key The key of the value to set.
1099
+ * @param {*} value The value to set.
1100
+ * @returns {Object} Returns the hash instance.
1101
+ */
1102
+ function hashSet(key, value) {
1103
+ var data = this.__data__;
1104
+ this.size += this.has(key) ? 0 : 1;
1105
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
1106
+ return this;
1107
+ }
1108
+
1109
+ /**
1110
+ * Creates a hash object.
1111
+ *
1112
+ * @private
1113
+ * @constructor
1114
+ * @param {Array} [entries] The key-value pairs to cache.
1115
+ */
1116
+ function Hash(entries) {
1117
+ var index = -1,
1118
+ length = entries == null ? 0 : entries.length;
1119
+
1120
+ this.clear();
1121
+ while (++index < length) {
1122
+ var entry = entries[index];
1123
+ this.set(entry[0], entry[1]);
1124
+ }
1125
+ }
1126
+
1127
+ // Add methods to `Hash`.
1128
+ Hash.prototype.clear = hashClear;
1129
+ Hash.prototype['delete'] = hashDelete;
1130
+ Hash.prototype.get = hashGet;
1131
+ Hash.prototype.has = hashHas;
1132
+ Hash.prototype.set = hashSet;
1133
+
1134
+ /**
1135
+ * Removes all key-value entries from the list cache.
1136
+ *
1137
+ * @private
1138
+ * @name clear
1139
+ * @memberOf ListCache
1140
+ */
1141
+ function listCacheClear() {
1142
+ this.__data__ = [];
1143
+ this.size = 0;
1144
+ }
1145
+
1146
+ /**
1147
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
1148
+ *
1149
+ * @private
1150
+ * @param {Array} array The array to inspect.
1151
+ * @param {*} key The key to search for.
1152
+ * @returns {number} Returns the index of the matched value, else `-1`.
1153
+ */
1154
+ function assocIndexOf(array, key) {
1155
+ var length = array.length;
1156
+ while (length--) {
1157
+ if (eq(array[length][0], key)) {
1158
+ return length;
1159
+ }
1160
+ }
1161
+ return -1;
1162
+ }
1163
+
1164
+ /** Used for built-in method references. */
1165
+ var arrayProto = Array.prototype;
1166
+
1167
+ /** Built-in value references. */
1168
+ var splice = arrayProto.splice;
1169
+
1170
+ /**
1171
+ * Removes `key` and its value from the list cache.
1172
+ *
1173
+ * @private
1174
+ * @name delete
1175
+ * @memberOf ListCache
1176
+ * @param {string} key The key of the value to remove.
1177
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1178
+ */
1179
+ function listCacheDelete(key) {
1180
+ var data = this.__data__,
1181
+ index = assocIndexOf(data, key);
1182
+
1183
+ if (index < 0) {
1184
+ return false;
1185
+ }
1186
+ var lastIndex = data.length - 1;
1187
+ if (index == lastIndex) {
1188
+ data.pop();
1189
+ } else {
1190
+ splice.call(data, index, 1);
1191
+ }
1192
+ --this.size;
1193
+ return true;
1194
+ }
1195
+
1196
+ /**
1197
+ * Gets the list cache value for `key`.
1198
+ *
1199
+ * @private
1200
+ * @name get
1201
+ * @memberOf ListCache
1202
+ * @param {string} key The key of the value to get.
1203
+ * @returns {*} Returns the entry value.
1204
+ */
1205
+ function listCacheGet(key) {
1206
+ var data = this.__data__,
1207
+ index = assocIndexOf(data, key);
1208
+
1209
+ return index < 0 ? undefined : data[index][1];
1210
+ }
1211
+
1212
+ /**
1213
+ * Checks if a list cache value for `key` exists.
1214
+ *
1215
+ * @private
1216
+ * @name has
1217
+ * @memberOf ListCache
1218
+ * @param {string} key The key of the entry to check.
1219
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1220
+ */
1221
+ function listCacheHas(key) {
1222
+ return assocIndexOf(this.__data__, key) > -1;
1223
+ }
1224
+
1225
+ /**
1226
+ * Sets the list cache `key` to `value`.
1227
+ *
1228
+ * @private
1229
+ * @name set
1230
+ * @memberOf ListCache
1231
+ * @param {string} key The key of the value to set.
1232
+ * @param {*} value The value to set.
1233
+ * @returns {Object} Returns the list cache instance.
1234
+ */
1235
+ function listCacheSet(key, value) {
1236
+ var data = this.__data__,
1237
+ index = assocIndexOf(data, key);
1238
+
1239
+ if (index < 0) {
1240
+ ++this.size;
1241
+ data.push([key, value]);
1242
+ } else {
1243
+ data[index][1] = value;
1244
+ }
1245
+ return this;
1246
+ }
1247
+
1248
+ /**
1249
+ * Creates an list cache object.
1250
+ *
1251
+ * @private
1252
+ * @constructor
1253
+ * @param {Array} [entries] The key-value pairs to cache.
1254
+ */
1255
+ function ListCache(entries) {
1256
+ var index = -1,
1257
+ length = entries == null ? 0 : entries.length;
1258
+
1259
+ this.clear();
1260
+ while (++index < length) {
1261
+ var entry = entries[index];
1262
+ this.set(entry[0], entry[1]);
1263
+ }
1264
+ }
1265
+
1266
+ // Add methods to `ListCache`.
1267
+ ListCache.prototype.clear = listCacheClear;
1268
+ ListCache.prototype['delete'] = listCacheDelete;
1269
+ ListCache.prototype.get = listCacheGet;
1270
+ ListCache.prototype.has = listCacheHas;
1271
+ ListCache.prototype.set = listCacheSet;
1272
+
1273
+ /* Built-in method references that are verified to be native. */
1274
+ var Map$1 = getNative(root, 'Map');
1275
+
1276
+ /**
1277
+ * Removes all key-value entries from the map.
1278
+ *
1279
+ * @private
1280
+ * @name clear
1281
+ * @memberOf MapCache
1282
+ */
1283
+ function mapCacheClear() {
1284
+ this.size = 0;
1285
+ this.__data__ = {
1286
+ 'hash': new Hash,
1287
+ 'map': new (Map$1 || ListCache),
1288
+ 'string': new Hash
1289
+ };
1290
+ }
1291
+
1292
+ /**
1293
+ * Checks if `value` is suitable for use as unique object key.
1294
+ *
1295
+ * @private
1296
+ * @param {*} value The value to check.
1297
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1298
+ */
1299
+ function isKeyable(value) {
1300
+ var type = typeof value;
1301
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1302
+ ? (value !== '__proto__')
1303
+ : (value === null);
1304
+ }
1305
+
1306
+ /**
1307
+ * Gets the data for `map`.
1308
+ *
1309
+ * @private
1310
+ * @param {Object} map The map to query.
1311
+ * @param {string} key The reference key.
1312
+ * @returns {*} Returns the map data.
1313
+ */
1314
+ function getMapData(map, key) {
1315
+ var data = map.__data__;
1316
+ return isKeyable(key)
1317
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1318
+ : data.map;
1319
+ }
1320
+
1321
+ /**
1322
+ * Removes `key` and its value from the map.
1323
+ *
1324
+ * @private
1325
+ * @name delete
1326
+ * @memberOf MapCache
1327
+ * @param {string} key The key of the value to remove.
1328
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1329
+ */
1330
+ function mapCacheDelete(key) {
1331
+ var result = getMapData(this, key)['delete'](key);
1332
+ this.size -= result ? 1 : 0;
1333
+ return result;
1334
+ }
1335
+
1336
+ /**
1337
+ * Gets the map value for `key`.
1338
+ *
1339
+ * @private
1340
+ * @name get
1341
+ * @memberOf MapCache
1342
+ * @param {string} key The key of the value to get.
1343
+ * @returns {*} Returns the entry value.
1344
+ */
1345
+ function mapCacheGet(key) {
1346
+ return getMapData(this, key).get(key);
1347
+ }
1348
+
1349
+ /**
1350
+ * Checks if a map value for `key` exists.
1351
+ *
1352
+ * @private
1353
+ * @name has
1354
+ * @memberOf MapCache
1355
+ * @param {string} key The key of the entry to check.
1356
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1357
+ */
1358
+ function mapCacheHas(key) {
1359
+ return getMapData(this, key).has(key);
1360
+ }
1361
+
1362
+ /**
1363
+ * Sets the map `key` to `value`.
1364
+ *
1365
+ * @private
1366
+ * @name set
1367
+ * @memberOf MapCache
1368
+ * @param {string} key The key of the value to set.
1369
+ * @param {*} value The value to set.
1370
+ * @returns {Object} Returns the map cache instance.
1371
+ */
1372
+ function mapCacheSet(key, value) {
1373
+ var data = getMapData(this, key),
1374
+ size = data.size;
1375
+
1376
+ data.set(key, value);
1377
+ this.size += data.size == size ? 0 : 1;
1378
+ return this;
1379
+ }
1380
+
1381
+ /**
1382
+ * Creates a map cache object to store key-value pairs.
1383
+ *
1384
+ * @private
1385
+ * @constructor
1386
+ * @param {Array} [entries] The key-value pairs to cache.
1387
+ */
1388
+ function MapCache(entries) {
1389
+ var index = -1,
1390
+ length = entries == null ? 0 : entries.length;
1391
+
1392
+ this.clear();
1393
+ while (++index < length) {
1394
+ var entry = entries[index];
1395
+ this.set(entry[0], entry[1]);
1396
+ }
1397
+ }
1398
+
1399
+ // Add methods to `MapCache`.
1400
+ MapCache.prototype.clear = mapCacheClear;
1401
+ MapCache.prototype['delete'] = mapCacheDelete;
1402
+ MapCache.prototype.get = mapCacheGet;
1403
+ MapCache.prototype.has = mapCacheHas;
1404
+ MapCache.prototype.set = mapCacheSet;
1405
+
1406
+ /**
1407
+ * Appends the elements of `values` to `array`.
1408
+ *
1409
+ * @private
1410
+ * @param {Array} array The array to modify.
1411
+ * @param {Array} values The values to append.
1412
+ * @returns {Array} Returns `array`.
1413
+ */
1414
+ function arrayPush(array, values) {
1415
+ var index = -1,
1416
+ length = values.length,
1417
+ offset = array.length;
1418
+
1419
+ while (++index < length) {
1420
+ array[offset + index] = values[index];
1421
+ }
1422
+ return array;
1423
+ }
1424
+
1425
+ /**
1426
+ * Removes all key-value entries from the stack.
1427
+ *
1428
+ * @private
1429
+ * @name clear
1430
+ * @memberOf Stack
1431
+ */
1432
+ function stackClear() {
1433
+ this.__data__ = new ListCache;
1434
+ this.size = 0;
1435
+ }
1436
+
1437
+ /**
1438
+ * Removes `key` and its value from the stack.
1439
+ *
1440
+ * @private
1441
+ * @name delete
1442
+ * @memberOf Stack
1443
+ * @param {string} key The key of the value to remove.
1444
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1445
+ */
1446
+ function stackDelete(key) {
1447
+ var data = this.__data__,
1448
+ result = data['delete'](key);
1449
+
1450
+ this.size = data.size;
1451
+ return result;
1452
+ }
1453
+
1454
+ /**
1455
+ * Gets the stack value for `key`.
1456
+ *
1457
+ * @private
1458
+ * @name get
1459
+ * @memberOf Stack
1460
+ * @param {string} key The key of the value to get.
1461
+ * @returns {*} Returns the entry value.
1462
+ */
1463
+ function stackGet(key) {
1464
+ return this.__data__.get(key);
1465
+ }
1466
+
1467
+ /**
1468
+ * Checks if a stack value for `key` exists.
1469
+ *
1470
+ * @private
1471
+ * @name has
1472
+ * @memberOf Stack
1473
+ * @param {string} key The key of the entry to check.
1474
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1475
+ */
1476
+ function stackHas(key) {
1477
+ return this.__data__.has(key);
1478
+ }
1479
+
1480
+ /** Used as the size to enable large array optimizations. */
1481
+ var LARGE_ARRAY_SIZE = 200;
1482
+
1483
+ /**
1484
+ * Sets the stack `key` to `value`.
1485
+ *
1486
+ * @private
1487
+ * @name set
1488
+ * @memberOf Stack
1489
+ * @param {string} key The key of the value to set.
1490
+ * @param {*} value The value to set.
1491
+ * @returns {Object} Returns the stack cache instance.
1492
+ */
1493
+ function stackSet(key, value) {
1494
+ var data = this.__data__;
1495
+ if (data instanceof ListCache) {
1496
+ var pairs = data.__data__;
1497
+ if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1498
+ pairs.push([key, value]);
1499
+ this.size = ++data.size;
1500
+ return this;
1501
+ }
1502
+ data = this.__data__ = new MapCache(pairs);
1503
+ }
1504
+ data.set(key, value);
1505
+ this.size = data.size;
1506
+ return this;
1507
+ }
1508
+
1509
+ /**
1510
+ * Creates a stack cache object to store key-value pairs.
1511
+ *
1512
+ * @private
1513
+ * @constructor
1514
+ * @param {Array} [entries] The key-value pairs to cache.
1515
+ */
1516
+ function Stack(entries) {
1517
+ var data = this.__data__ = new ListCache(entries);
1518
+ this.size = data.size;
1519
+ }
1520
+
1521
+ // Add methods to `Stack`.
1522
+ Stack.prototype.clear = stackClear;
1523
+ Stack.prototype['delete'] = stackDelete;
1524
+ Stack.prototype.get = stackGet;
1525
+ Stack.prototype.has = stackHas;
1526
+ Stack.prototype.set = stackSet;
1527
+
1528
+ /**
1529
+ * A specialized version of `_.filter` for arrays without support for
1530
+ * iteratee shorthands.
1531
+ *
1532
+ * @private
1533
+ * @param {Array} [array] The array to iterate over.
1534
+ * @param {Function} predicate The function invoked per iteration.
1535
+ * @returns {Array} Returns the new filtered array.
1536
+ */
1537
+ function arrayFilter(array, predicate) {
1538
+ var index = -1,
1539
+ length = array == null ? 0 : array.length,
1540
+ resIndex = 0,
1541
+ result = [];
1542
+
1543
+ while (++index < length) {
1544
+ var value = array[index];
1545
+ if (predicate(value, index, array)) {
1546
+ result[resIndex++] = value;
1547
+ }
1548
+ }
1549
+ return result;
1550
+ }
1551
+
1552
+ /**
1553
+ * This method returns a new empty array.
1554
+ *
1555
+ * @static
1556
+ * @memberOf _
1557
+ * @since 4.13.0
1558
+ * @category Util
1559
+ * @returns {Array} Returns the new empty array.
1560
+ * @example
1561
+ *
1562
+ * var arrays = _.times(2, _.stubArray);
1563
+ *
1564
+ * console.log(arrays);
1565
+ * // => [[], []]
1566
+ *
1567
+ * console.log(arrays[0] === arrays[1]);
1568
+ * // => false
1569
+ */
1570
+ function stubArray() {
1571
+ return [];
1572
+ }
1573
+
1574
+ /** Used for built-in method references. */
1575
+ var objectProto$2 = Object.prototype;
1576
+
1577
+ /** Built-in value references. */
1578
+ var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
1579
+
1580
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1581
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1582
+
1583
+ /**
1584
+ * Creates an array of the own enumerable symbols of `object`.
1585
+ *
1586
+ * @private
1587
+ * @param {Object} object The object to query.
1588
+ * @returns {Array} Returns the array of symbols.
1589
+ */
1590
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1591
+ if (object == null) {
1592
+ return [];
1593
+ }
1594
+ object = Object(object);
1595
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1596
+ return propertyIsEnumerable.call(object, symbol);
1597
+ });
1598
+ };
1599
+
1600
+ /**
1601
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1602
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1603
+ * symbols of `object`.
1604
+ *
1605
+ * @private
1606
+ * @param {Object} object The object to query.
1607
+ * @param {Function} keysFunc The function to get the keys of `object`.
1608
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1609
+ * @returns {Array} Returns the array of property names and symbols.
1610
+ */
1611
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1612
+ var result = keysFunc(object);
1613
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1614
+ }
1615
+
1616
+ /**
1617
+ * Creates an array of own enumerable property names and symbols of `object`.
1618
+ *
1619
+ * @private
1620
+ * @param {Object} object The object to query.
1621
+ * @returns {Array} Returns the array of property names and symbols.
1622
+ */
1623
+ function getAllKeys(object) {
1624
+ return baseGetAllKeys(object, keys, getSymbols);
1625
+ }
1626
+
1627
+ /* Built-in method references that are verified to be native. */
1628
+ var DataView = getNative(root, 'DataView');
1629
+
1630
+ /* Built-in method references that are verified to be native. */
1631
+ var Promise$1 = getNative(root, 'Promise');
1632
+
1633
+ /* Built-in method references that are verified to be native. */
1634
+ var Set$1 = getNative(root, 'Set');
1635
+
1636
+ /** `Object#toString` result references. */
1637
+ var mapTag$1 = '[object Map]',
1638
+ objectTag$1 = '[object Object]',
1639
+ promiseTag = '[object Promise]',
1640
+ setTag$1 = '[object Set]',
1641
+ weakMapTag = '[object WeakMap]';
1642
+
1643
+ var dataViewTag$1 = '[object DataView]';
1644
+
1645
+ /** Used to detect maps, sets, and weakmaps. */
1646
+ var dataViewCtorString = toSource(DataView),
1647
+ mapCtorString = toSource(Map$1),
1648
+ promiseCtorString = toSource(Promise$1),
1649
+ setCtorString = toSource(Set$1),
1650
+ weakMapCtorString = toSource(WeakMap);
1651
+
1652
+ /**
1653
+ * Gets the `toStringTag` of `value`.
1654
+ *
1655
+ * @private
1656
+ * @param {*} value The value to query.
1657
+ * @returns {string} Returns the `toStringTag`.
1658
+ */
1659
+ var getTag = baseGetTag;
1660
+
1661
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1662
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$1) ||
1663
+ (Map$1 && getTag(new Map$1) != mapTag$1) ||
1664
+ (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
1665
+ (Set$1 && getTag(new Set$1) != setTag$1) ||
1666
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
1667
+ getTag = function(value) {
1668
+ var result = baseGetTag(value),
1669
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
1670
+ ctorString = Ctor ? toSource(Ctor) : '';
1671
+
1672
+ if (ctorString) {
1673
+ switch (ctorString) {
1674
+ case dataViewCtorString: return dataViewTag$1;
1675
+ case mapCtorString: return mapTag$1;
1676
+ case promiseCtorString: return promiseTag;
1677
+ case setCtorString: return setTag$1;
1678
+ case weakMapCtorString: return weakMapTag;
1679
+ }
1680
+ }
1681
+ return result;
1682
+ };
1683
+ }
1684
+
1685
+ var getTag$1 = getTag;
1686
+
1687
+ /** Built-in value references. */
1688
+ var Uint8Array = root.Uint8Array;
1689
+
1690
+ /** Used to stand-in for `undefined` hash values. */
1691
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1692
+
1693
+ /**
1694
+ * Adds `value` to the array cache.
1695
+ *
1696
+ * @private
1697
+ * @name add
1698
+ * @memberOf SetCache
1699
+ * @alias push
1700
+ * @param {*} value The value to cache.
1701
+ * @returns {Object} Returns the cache instance.
1702
+ */
1703
+ function setCacheAdd(value) {
1704
+ this.__data__.set(value, HASH_UNDEFINED);
1705
+ return this;
1706
+ }
1707
+
1708
+ /**
1709
+ * Checks if `value` is in the array cache.
1710
+ *
1711
+ * @private
1712
+ * @name has
1713
+ * @memberOf SetCache
1714
+ * @param {*} value The value to search for.
1715
+ * @returns {number} Returns `true` if `value` is found, else `false`.
1716
+ */
1717
+ function setCacheHas(value) {
1718
+ return this.__data__.has(value);
1719
+ }
1720
+
1721
+ /**
1722
+ *
1723
+ * Creates an array cache object to store unique values.
1724
+ *
1725
+ * @private
1726
+ * @constructor
1727
+ * @param {Array} [values] The values to cache.
1728
+ */
1729
+ function SetCache(values) {
1730
+ var index = -1,
1731
+ length = values == null ? 0 : values.length;
1732
+
1733
+ this.__data__ = new MapCache;
1734
+ while (++index < length) {
1735
+ this.add(values[index]);
1736
+ }
1737
+ }
1738
+
1739
+ // Add methods to `SetCache`.
1740
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
1741
+ SetCache.prototype.has = setCacheHas;
1742
+
1743
+ /**
1744
+ * A specialized version of `_.some` for arrays without support for iteratee
1745
+ * shorthands.
1746
+ *
1747
+ * @private
1748
+ * @param {Array} [array] The array to iterate over.
1749
+ * @param {Function} predicate The function invoked per iteration.
1750
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
1751
+ * else `false`.
1752
+ */
1753
+ function arraySome(array, predicate) {
1754
+ var index = -1,
1755
+ length = array == null ? 0 : array.length;
1756
+
1757
+ while (++index < length) {
1758
+ if (predicate(array[index], index, array)) {
1759
+ return true;
1760
+ }
1761
+ }
1762
+ return false;
1763
+ }
1764
+
1765
+ /**
1766
+ * Checks if a `cache` value for `key` exists.
1767
+ *
1768
+ * @private
1769
+ * @param {Object} cache The cache to query.
1770
+ * @param {string} key The key of the entry to check.
1771
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1772
+ */
1773
+ function cacheHas(cache, key) {
1774
+ return cache.has(key);
1775
+ }
1776
+
1777
+ /** Used to compose bitmasks for value comparisons. */
1778
+ var COMPARE_PARTIAL_FLAG$3 = 1,
1779
+ COMPARE_UNORDERED_FLAG$1 = 2;
1780
+
1781
+ /**
1782
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
1783
+ * partial deep comparisons.
1784
+ *
1785
+ * @private
1786
+ * @param {Array} array The array to compare.
1787
+ * @param {Array} other The other array to compare.
1788
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1789
+ * @param {Function} customizer The function to customize comparisons.
1790
+ * @param {Function} equalFunc The function to determine equivalents of values.
1791
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
1792
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1793
+ */
1794
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1795
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
1796
+ arrLength = array.length,
1797
+ othLength = other.length;
1798
+
1799
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1800
+ return false;
1801
+ }
1802
+ // Check that cyclic values are equal.
1803
+ var arrStacked = stack.get(array);
1804
+ var othStacked = stack.get(other);
1805
+ if (arrStacked && othStacked) {
1806
+ return arrStacked == other && othStacked == array;
1807
+ }
1808
+ var index = -1,
1809
+ result = true,
1810
+ seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new SetCache : undefined;
1811
+
1812
+ stack.set(array, other);
1813
+ stack.set(other, array);
1814
+
1815
+ // Ignore non-index properties.
1816
+ while (++index < arrLength) {
1817
+ var arrValue = array[index],
1818
+ othValue = other[index];
1819
+
1820
+ if (customizer) {
1821
+ var compared = isPartial
1822
+ ? customizer(othValue, arrValue, index, other, array, stack)
1823
+ : customizer(arrValue, othValue, index, array, other, stack);
1824
+ }
1825
+ if (compared !== undefined) {
1826
+ if (compared) {
1827
+ continue;
1828
+ }
1829
+ result = false;
1830
+ break;
1831
+ }
1832
+ // Recursively compare arrays (susceptible to call stack limits).
1833
+ if (seen) {
1834
+ if (!arraySome(other, function(othValue, othIndex) {
1835
+ if (!cacheHas(seen, othIndex) &&
1836
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1837
+ return seen.push(othIndex);
1838
+ }
1839
+ })) {
1840
+ result = false;
1841
+ break;
1842
+ }
1843
+ } else if (!(
1844
+ arrValue === othValue ||
1845
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
1846
+ )) {
1847
+ result = false;
1848
+ break;
1849
+ }
1850
+ }
1851
+ stack['delete'](array);
1852
+ stack['delete'](other);
1853
+ return result;
1854
+ }
1855
+
1856
+ /**
1857
+ * Converts `map` to its key-value pairs.
1858
+ *
1859
+ * @private
1860
+ * @param {Object} map The map to convert.
1861
+ * @returns {Array} Returns the key-value pairs.
1862
+ */
1863
+ function mapToArray(map) {
1864
+ var index = -1,
1865
+ result = Array(map.size);
1866
+
1867
+ map.forEach(function(value, key) {
1868
+ result[++index] = [key, value];
1869
+ });
1870
+ return result;
1871
+ }
1872
+
1873
+ /**
1874
+ * Converts `set` to an array of its values.
1875
+ *
1876
+ * @private
1877
+ * @param {Object} set The set to convert.
1878
+ * @returns {Array} Returns the values.
1879
+ */
1880
+ function setToArray(set) {
1881
+ var index = -1,
1882
+ result = Array(set.size);
1883
+
1884
+ set.forEach(function(value) {
1885
+ result[++index] = value;
1886
+ });
1887
+ return result;
1888
+ }
1889
+
1890
+ /** Used to compose bitmasks for value comparisons. */
1891
+ var COMPARE_PARTIAL_FLAG$2 = 1,
1892
+ COMPARE_UNORDERED_FLAG = 2;
1893
+
1894
+ /** `Object#toString` result references. */
1895
+ var boolTag = '[object Boolean]',
1896
+ dateTag = '[object Date]',
1897
+ errorTag = '[object Error]',
1898
+ mapTag = '[object Map]',
1899
+ numberTag = '[object Number]',
1900
+ regexpTag = '[object RegExp]',
1901
+ setTag = '[object Set]',
1902
+ stringTag = '[object String]',
1903
+ symbolTag = '[object Symbol]';
1904
+
1905
+ var arrayBufferTag = '[object ArrayBuffer]',
1906
+ dataViewTag = '[object DataView]';
1907
+
1908
+ /** Used to convert symbols to primitives and strings. */
1909
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
1910
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1911
+
1912
+ /**
1913
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
1914
+ * the same `toStringTag`.
1915
+ *
1916
+ * **Note:** This function only supports comparing values with tags of
1917
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1918
+ *
1919
+ * @private
1920
+ * @param {Object} object The object to compare.
1921
+ * @param {Object} other The other object to compare.
1922
+ * @param {string} tag The `toStringTag` of the objects to compare.
1923
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1924
+ * @param {Function} customizer The function to customize comparisons.
1925
+ * @param {Function} equalFunc The function to determine equivalents of values.
1926
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1927
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1928
+ */
1929
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1930
+ switch (tag) {
1931
+ case dataViewTag:
1932
+ if ((object.byteLength != other.byteLength) ||
1933
+ (object.byteOffset != other.byteOffset)) {
1934
+ return false;
1935
+ }
1936
+ object = object.buffer;
1937
+ other = other.buffer;
1938
+
1939
+ case arrayBufferTag:
1940
+ if ((object.byteLength != other.byteLength) ||
1941
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1942
+ return false;
1943
+ }
1944
+ return true;
1945
+
1946
+ case boolTag:
1947
+ case dateTag:
1948
+ case numberTag:
1949
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
1950
+ // Invalid dates are coerced to `NaN`.
1951
+ return eq(+object, +other);
1952
+
1953
+ case errorTag:
1954
+ return object.name == other.name && object.message == other.message;
1955
+
1956
+ case regexpTag:
1957
+ case stringTag:
1958
+ // Coerce regexes to strings and treat strings, primitives and objects,
1959
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1960
+ // for more details.
1961
+ return object == (other + '');
1962
+
1963
+ case mapTag:
1964
+ var convert = mapToArray;
1965
+
1966
+ case setTag:
1967
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1968
+ convert || (convert = setToArray);
1969
+
1970
+ if (object.size != other.size && !isPartial) {
1971
+ return false;
1972
+ }
1973
+ // Assume cyclic values are equal.
1974
+ var stacked = stack.get(object);
1975
+ if (stacked) {
1976
+ return stacked == other;
1977
+ }
1978
+ bitmask |= COMPARE_UNORDERED_FLAG;
1979
+
1980
+ // Recursively compare objects (susceptible to call stack limits).
1981
+ stack.set(object, other);
1982
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1983
+ stack['delete'](object);
1984
+ return result;
1985
+
1986
+ case symbolTag:
1987
+ if (symbolValueOf) {
1988
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1989
+ }
1990
+ }
1991
+ return false;
1992
+ }
1993
+
1994
+ /** Used to compose bitmasks for value comparisons. */
1995
+ var COMPARE_PARTIAL_FLAG$1 = 1;
1996
+
1997
+ /** Used for built-in method references. */
1998
+ var objectProto$1 = Object.prototype;
1999
+
2000
+ /** Used to check objects for own properties. */
2001
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2002
+
2003
+ /**
2004
+ * A specialized version of `baseIsEqualDeep` for objects with support for
2005
+ * partial deep comparisons.
2006
+ *
2007
+ * @private
2008
+ * @param {Object} object The object to compare.
2009
+ * @param {Object} other The other object to compare.
2010
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2011
+ * @param {Function} customizer The function to customize comparisons.
2012
+ * @param {Function} equalFunc The function to determine equivalents of values.
2013
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
2014
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2015
+ */
2016
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2017
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
2018
+ objProps = getAllKeys(object),
2019
+ objLength = objProps.length,
2020
+ othProps = getAllKeys(other),
2021
+ othLength = othProps.length;
2022
+
2023
+ if (objLength != othLength && !isPartial) {
2024
+ return false;
2025
+ }
2026
+ var index = objLength;
2027
+ while (index--) {
2028
+ var key = objProps[index];
2029
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2030
+ return false;
2031
+ }
2032
+ }
2033
+ // Check that cyclic values are equal.
2034
+ var objStacked = stack.get(object);
2035
+ var othStacked = stack.get(other);
2036
+ if (objStacked && othStacked) {
2037
+ return objStacked == other && othStacked == object;
2038
+ }
2039
+ var result = true;
2040
+ stack.set(object, other);
2041
+ stack.set(other, object);
2042
+
2043
+ var skipCtor = isPartial;
2044
+ while (++index < objLength) {
2045
+ key = objProps[index];
2046
+ var objValue = object[key],
2047
+ othValue = other[key];
2048
+
2049
+ if (customizer) {
2050
+ var compared = isPartial
2051
+ ? customizer(othValue, objValue, key, other, object, stack)
2052
+ : customizer(objValue, othValue, key, object, other, stack);
2053
+ }
2054
+ // Recursively compare objects (susceptible to call stack limits).
2055
+ if (!(compared === undefined
2056
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
2057
+ : compared
2058
+ )) {
2059
+ result = false;
2060
+ break;
2061
+ }
2062
+ skipCtor || (skipCtor = key == 'constructor');
2063
+ }
2064
+ if (result && !skipCtor) {
2065
+ var objCtor = object.constructor,
2066
+ othCtor = other.constructor;
2067
+
2068
+ // Non `Object` object instances with different constructors are not equal.
2069
+ if (objCtor != othCtor &&
2070
+ ('constructor' in object && 'constructor' in other) &&
2071
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
2072
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2073
+ result = false;
2074
+ }
2075
+ }
2076
+ stack['delete'](object);
2077
+ stack['delete'](other);
2078
+ return result;
2079
+ }
2080
+
2081
+ /** Used to compose bitmasks for value comparisons. */
2082
+ var COMPARE_PARTIAL_FLAG = 1;
2083
+
2084
+ /** `Object#toString` result references. */
2085
+ var argsTag = '[object Arguments]',
2086
+ arrayTag = '[object Array]',
2087
+ objectTag = '[object Object]';
2088
+
2089
+ /** Used for built-in method references. */
2090
+ var objectProto = Object.prototype;
2091
+
2092
+ /** Used to check objects for own properties. */
2093
+ var hasOwnProperty = objectProto.hasOwnProperty;
2094
+
2095
+ /**
2096
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
2097
+ * deep comparisons and tracks traversed objects enabling objects with circular
2098
+ * references to be compared.
2099
+ *
2100
+ * @private
2101
+ * @param {Object} object The object to compare.
2102
+ * @param {Object} other The other object to compare.
2103
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2104
+ * @param {Function} customizer The function to customize comparisons.
2105
+ * @param {Function} equalFunc The function to determine equivalents of values.
2106
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2107
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2108
+ */
2109
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2110
+ var objIsArr = isArray(object),
2111
+ othIsArr = isArray(other),
2112
+ objTag = objIsArr ? arrayTag : getTag$1(object),
2113
+ othTag = othIsArr ? arrayTag : getTag$1(other);
2114
+
2115
+ objTag = objTag == argsTag ? objectTag : objTag;
2116
+ othTag = othTag == argsTag ? objectTag : othTag;
2117
+
2118
+ var objIsObj = objTag == objectTag,
2119
+ othIsObj = othTag == objectTag,
2120
+ isSameTag = objTag == othTag;
2121
+
2122
+ if (isSameTag && isBuffer(object)) {
2123
+ if (!isBuffer(other)) {
2124
+ return false;
2125
+ }
2126
+ objIsArr = true;
2127
+ objIsObj = false;
2128
+ }
2129
+ if (isSameTag && !objIsObj) {
2130
+ stack || (stack = new Stack);
2131
+ return (objIsArr || isTypedArray(object))
2132
+ ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
2133
+ : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2134
+ }
2135
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2136
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2137
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2138
+
2139
+ if (objIsWrapped || othIsWrapped) {
2140
+ var objUnwrapped = objIsWrapped ? object.value() : object,
2141
+ othUnwrapped = othIsWrapped ? other.value() : other;
2142
+
2143
+ stack || (stack = new Stack);
2144
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2145
+ }
2146
+ }
2147
+ if (!isSameTag) {
2148
+ return false;
2149
+ }
2150
+ stack || (stack = new Stack);
2151
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2152
+ }
2153
+
2154
+ /**
2155
+ * The base implementation of `_.isEqual` which supports partial comparisons
2156
+ * and tracks traversed objects.
2157
+ *
2158
+ * @private
2159
+ * @param {*} value The value to compare.
2160
+ * @param {*} other The other value to compare.
2161
+ * @param {boolean} bitmask The bitmask flags.
2162
+ * 1 - Unordered comparison
2163
+ * 2 - Partial comparison
2164
+ * @param {Function} [customizer] The function to customize comparisons.
2165
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2166
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2167
+ */
2168
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
2169
+ if (value === other) {
2170
+ return true;
2171
+ }
2172
+ if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
2173
+ return value !== value && other !== other;
2174
+ }
2175
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2176
+ }
2177
+
2178
+ /**
2179
+ * Gets the timestamp of the number of milliseconds that have elapsed since
2180
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
2181
+ *
2182
+ * @static
2183
+ * @memberOf _
2184
+ * @since 2.4.0
2185
+ * @category Date
2186
+ * @returns {number} Returns the timestamp.
2187
+ * @example
2188
+ *
2189
+ * _.defer(function(stamp) {
2190
+ * console.log(_.now() - stamp);
2191
+ * }, _.now());
2192
+ * // => Logs the number of milliseconds it took for the deferred invocation.
2193
+ */
2194
+ var now = function() {
2195
+ return root.Date.now();
2196
+ };
2197
+
2198
+ /** Error message constants. */
2199
+ var FUNC_ERROR_TEXT$1 = 'Expected a function';
2200
+
2201
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2202
+ var nativeMax = Math.max,
2203
+ nativeMin = Math.min;
2204
+
2205
+ /**
2206
+ * Creates a debounced function that delays invoking `func` until after `wait`
2207
+ * milliseconds have elapsed since the last time the debounced function was
2208
+ * invoked. The debounced function comes with a `cancel` method to cancel
2209
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
2210
+ * Provide `options` to indicate whether `func` should be invoked on the
2211
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
2212
+ * with the last arguments provided to the debounced function. Subsequent
2213
+ * calls to the debounced function return the result of the last `func`
2214
+ * invocation.
2215
+ *
2216
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2217
+ * invoked on the trailing edge of the timeout only if the debounced function
2218
+ * is invoked more than once during the `wait` timeout.
2219
+ *
2220
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2221
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2222
+ *
2223
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2224
+ * for details over the differences between `_.debounce` and `_.throttle`.
2225
+ *
2226
+ * @static
2227
+ * @memberOf _
2228
+ * @since 0.1.0
2229
+ * @category Function
2230
+ * @param {Function} func The function to debounce.
2231
+ * @param {number} [wait=0] The number of milliseconds to delay.
2232
+ * @param {Object} [options={}] The options object.
2233
+ * @param {boolean} [options.leading=false]
2234
+ * Specify invoking on the leading edge of the timeout.
2235
+ * @param {number} [options.maxWait]
2236
+ * The maximum time `func` is allowed to be delayed before it's invoked.
2237
+ * @param {boolean} [options.trailing=true]
2238
+ * Specify invoking on the trailing edge of the timeout.
2239
+ * @returns {Function} Returns the new debounced function.
2240
+ * @example
2241
+ *
2242
+ * // Avoid costly calculations while the window size is in flux.
2243
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
2244
+ *
2245
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
2246
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
2247
+ * 'leading': true,
2248
+ * 'trailing': false
2249
+ * }));
2250
+ *
2251
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
2252
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
2253
+ * var source = new EventSource('/stream');
2254
+ * jQuery(source).on('message', debounced);
2255
+ *
2256
+ * // Cancel the trailing debounced invocation.
2257
+ * jQuery(window).on('popstate', debounced.cancel);
2258
+ */
2259
+ function debounce(func, wait, options) {
2260
+ var lastArgs,
2261
+ lastThis,
2262
+ maxWait,
2263
+ result,
2264
+ timerId,
2265
+ lastCallTime,
2266
+ lastInvokeTime = 0,
2267
+ leading = false,
2268
+ maxing = false,
2269
+ trailing = true;
2270
+
2271
+ if (typeof func != 'function') {
2272
+ throw new TypeError(FUNC_ERROR_TEXT$1);
2273
+ }
2274
+ wait = toNumber(wait) || 0;
2275
+ if (isObject(options)) {
2276
+ leading = !!options.leading;
2277
+ maxing = 'maxWait' in options;
2278
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
2279
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2280
+ }
2281
+
2282
+ function invokeFunc(time) {
2283
+ var args = lastArgs,
2284
+ thisArg = lastThis;
2285
+
2286
+ lastArgs = lastThis = undefined;
2287
+ lastInvokeTime = time;
2288
+ result = func.apply(thisArg, args);
2289
+ return result;
2290
+ }
2291
+
2292
+ function leadingEdge(time) {
2293
+ // Reset any `maxWait` timer.
2294
+ lastInvokeTime = time;
2295
+ // Start the timer for the trailing edge.
2296
+ timerId = setTimeout(timerExpired, wait);
2297
+ // Invoke the leading edge.
2298
+ return leading ? invokeFunc(time) : result;
2299
+ }
2300
+
2301
+ function remainingWait(time) {
2302
+ var timeSinceLastCall = time - lastCallTime,
2303
+ timeSinceLastInvoke = time - lastInvokeTime,
2304
+ timeWaiting = wait - timeSinceLastCall;
2305
+
2306
+ return maxing
2307
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
2308
+ : timeWaiting;
2309
+ }
2310
+
2311
+ function shouldInvoke(time) {
2312
+ var timeSinceLastCall = time - lastCallTime,
2313
+ timeSinceLastInvoke = time - lastInvokeTime;
2314
+
2315
+ // Either this is the first call, activity has stopped and we're at the
2316
+ // trailing edge, the system time has gone backwards and we're treating
2317
+ // it as the trailing edge, or we've hit the `maxWait` limit.
2318
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
2319
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
2320
+ }
2321
+
2322
+ function timerExpired() {
2323
+ var time = now();
2324
+ if (shouldInvoke(time)) {
2325
+ return trailingEdge(time);
2326
+ }
2327
+ // Restart the timer.
2328
+ timerId = setTimeout(timerExpired, remainingWait(time));
2329
+ }
2330
+
2331
+ function trailingEdge(time) {
2332
+ timerId = undefined;
2333
+
2334
+ // Only invoke if we have `lastArgs` which means `func` has been
2335
+ // debounced at least once.
2336
+ if (trailing && lastArgs) {
2337
+ return invokeFunc(time);
2338
+ }
2339
+ lastArgs = lastThis = undefined;
2340
+ return result;
2341
+ }
2342
+
2343
+ function cancel() {
2344
+ if (timerId !== undefined) {
2345
+ clearTimeout(timerId);
2346
+ }
2347
+ lastInvokeTime = 0;
2348
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
2349
+ }
2350
+
2351
+ function flush() {
2352
+ return timerId === undefined ? result : trailingEdge(now());
2353
+ }
2354
+
2355
+ function debounced() {
2356
+ var time = now(),
2357
+ isInvoking = shouldInvoke(time);
2358
+
2359
+ lastArgs = arguments;
2360
+ lastThis = this;
2361
+ lastCallTime = time;
2362
+
2363
+ if (isInvoking) {
2364
+ if (timerId === undefined) {
2365
+ return leadingEdge(lastCallTime);
2366
+ }
2367
+ if (maxing) {
2368
+ // Handle invocations in a tight loop.
2369
+ clearTimeout(timerId);
2370
+ timerId = setTimeout(timerExpired, wait);
2371
+ return invokeFunc(lastCallTime);
2372
+ }
2373
+ }
2374
+ if (timerId === undefined) {
2375
+ timerId = setTimeout(timerExpired, wait);
2376
+ }
2377
+ return result;
2378
+ }
2379
+ debounced.cancel = cancel;
2380
+ debounced.flush = flush;
2381
+ return debounced;
2382
+ }
2383
+
2384
+ /**
2385
+ * Performs a deep comparison between two values to determine if they are
2386
+ * equivalent.
2387
+ *
2388
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
2389
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
2390
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
2391
+ * by their own, not inherited, enumerable properties. Functions and DOM
2392
+ * nodes are compared by strict equality, i.e. `===`.
2393
+ *
2394
+ * @static
2395
+ * @memberOf _
2396
+ * @since 0.1.0
2397
+ * @category Lang
2398
+ * @param {*} value The value to compare.
2399
+ * @param {*} other The other value to compare.
2400
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2401
+ * @example
2402
+ *
2403
+ * var object = { 'a': 1 };
2404
+ * var other = { 'a': 1 };
2405
+ *
2406
+ * _.isEqual(object, other);
2407
+ * // => true
2408
+ *
2409
+ * object === other;
2410
+ * // => false
2411
+ */
2412
+ function isEqual(value, other) {
2413
+ return baseIsEqual(value, other);
2414
+ }
2415
+
2416
+ /** Error message constants. */
2417
+ var FUNC_ERROR_TEXT = 'Expected a function';
2418
+
2419
+ /**
2420
+ * Creates a throttled function that only invokes `func` at most once per
2421
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
2422
+ * method to cancel delayed `func` invocations and a `flush` method to
2423
+ * immediately invoke them. Provide `options` to indicate whether `func`
2424
+ * should be invoked on the leading and/or trailing edge of the `wait`
2425
+ * timeout. The `func` is invoked with the last arguments provided to the
2426
+ * throttled function. Subsequent calls to the throttled function return the
2427
+ * result of the last `func` invocation.
2428
+ *
2429
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2430
+ * invoked on the trailing edge of the timeout only if the throttled function
2431
+ * is invoked more than once during the `wait` timeout.
2432
+ *
2433
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2434
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2435
+ *
2436
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2437
+ * for details over the differences between `_.throttle` and `_.debounce`.
2438
+ *
2439
+ * @static
2440
+ * @memberOf _
2441
+ * @since 0.1.0
2442
+ * @category Function
2443
+ * @param {Function} func The function to throttle.
2444
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
2445
+ * @param {Object} [options={}] The options object.
2446
+ * @param {boolean} [options.leading=true]
2447
+ * Specify invoking on the leading edge of the timeout.
2448
+ * @param {boolean} [options.trailing=true]
2449
+ * Specify invoking on the trailing edge of the timeout.
2450
+ * @returns {Function} Returns the new throttled function.
2451
+ * @example
2452
+ *
2453
+ * // Avoid excessively updating the position while scrolling.
2454
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
2455
+ *
2456
+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
2457
+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
2458
+ * jQuery(element).on('click', throttled);
2459
+ *
2460
+ * // Cancel the trailing throttled invocation.
2461
+ * jQuery(window).on('popstate', throttled.cancel);
2462
+ */
2463
+ function throttle(func, wait, options) {
2464
+ var leading = true,
2465
+ trailing = true;
2466
+
2467
+ if (typeof func != 'function') {
2468
+ throw new TypeError(FUNC_ERROR_TEXT);
2469
+ }
2470
+ if (isObject(options)) {
2471
+ leading = 'leading' in options ? !!options.leading : leading;
2472
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2473
+ }
2474
+ return debounce(func, wait, {
2475
+ 'leading': leading,
2476
+ 'maxWait': wait,
2477
+ 'trailing': trailing
2478
+ });
2479
+ }
2480
+
76
2481
  const isPrimitive$1 = (val) => val !== Object(val);
77
2482
  function useCustomCompareEffect(effect, deps, depsEqual) {
78
2483
  if (process.env.NODE_ENV !== "production") {
@@ -100,7 +2505,6 @@ function useCustomCompareEffect(effect, deps, depsEqual) {
100
2505
  }
101
2506
 
102
2507
  const isPrimitive = (val) => val !== Object(val);
103
- const { isEqual } = lodash;
104
2508
  function useDeepCompareEffect(effect, deps) {
105
2509
  if (process.env.NODE_ENV !== "production") {
106
2510
  if (!Array.isArray(deps) || !deps.length) {
@@ -169,7 +2573,7 @@ function useStorage(key, defaults, getStorage, options = {}) {
169
2573
  }, [options.serializer, type]);
170
2574
  const [state, setState] = useState(defaults);
171
2575
  useDeepCompareEffect(() => {
172
- const data = csrData ? isFunction(csrData) ? csrData() : csrData : defaults;
2576
+ const data = csrData ? isFunction$1(csrData) ? csrData() : csrData : defaults;
173
2577
  const getStoredValue = () => {
174
2578
  try {
175
2579
  const raw = storage == null ? void 0 : storage.getItem(key);
@@ -187,7 +2591,7 @@ function useStorage(key, defaults, getStorage, options = {}) {
187
2591
  }, [key, defaults, serializer, storage, onError]);
188
2592
  const updateState = useEvent(
189
2593
  (valOrFunc) => {
190
- const currentState = isFunction(valOrFunc) ? valOrFunc(state) : valOrFunc;
2594
+ const currentState = isFunction$1(valOrFunc) ? valOrFunc(state) : valOrFunc;
191
2595
  setState(currentState);
192
2596
  if (currentState === null) {
193
2597
  storage == null ? void 0 : storage.removeItem(key);
@@ -341,7 +2745,7 @@ function usePreferredDark(defaultState) {
341
2745
 
342
2746
  function useMount(fn) {
343
2747
  if (isDev) {
344
- if (!isFunction(fn)) {
2748
+ if (!isFunction$1(fn)) {
345
2749
  console.error(
346
2750
  `useMount: parameter \`fn\` expected to be a function, but got "${typeof fn}".`
347
2751
  );
@@ -354,7 +2758,7 @@ function useMount(fn) {
354
2758
 
355
2759
  function useUnmount(fn) {
356
2760
  if (isDev) {
357
- if (!isFunction(fn)) {
2761
+ if (!isFunction$1(fn)) {
358
2762
  console.error(
359
2763
  `useUnmount expected parameter is a function, got ${typeof fn}`
360
2764
  );
@@ -369,10 +2773,9 @@ function useUnmount(fn) {
369
2773
  );
370
2774
  }
371
2775
 
372
- const { throttle: throttle$1 } = lodash;
373
2776
  function useThrottleFn(fn, wait, options) {
374
2777
  if (isDev) {
375
- if (!isFunction(fn)) {
2778
+ if (!isFunction$1(fn)) {
376
2779
  console.error(
377
2780
  `useThrottleFn expected parameter is a function, got ${typeof fn}`
378
2781
  );
@@ -380,7 +2783,7 @@ function useThrottleFn(fn, wait, options) {
380
2783
  }
381
2784
  const fnRef = useLatest(fn);
382
2785
  const throttled = useMemo(
383
- () => throttle$1(
2786
+ () => throttle(
384
2787
  (...args) => {
385
2788
  return fnRef.current(...args);
386
2789
  },
@@ -415,10 +2818,9 @@ function useThrottle(value, wait, options) {
415
2818
  return throttled;
416
2819
  }
417
2820
 
418
- const { debounce } = lodash;
419
2821
  function useDebounceFn(fn, wait, options) {
420
2822
  if (isDev) {
421
- if (!isFunction(fn)) {
2823
+ if (!isFunction$1(fn)) {
422
2824
  console.error(
423
2825
  `useDebounceFn expected parameter is a function, got ${typeof fn}`
424
2826
  );
@@ -553,7 +2955,7 @@ function getTargetElement(target, defaultElement) {
553
2955
  return defaultElement;
554
2956
  }
555
2957
  let targetElement;
556
- if (isFunction(target)) {
2958
+ if (isFunction$1(target)) {
557
2959
  targetElement = target();
558
2960
  } else if ("current" in target) {
559
2961
  targetElement = target.current;
@@ -960,7 +3362,6 @@ const defaultEvents$1 = [
960
3362
  "wheel"
961
3363
  ];
962
3364
  const oneMinute = 6e4;
963
- const { throttle } = lodash;
964
3365
  function useIdle(ms = oneMinute, initialState = false, events = defaultEvents$1) {
965
3366
  const [state, setState] = useState(initialState);
966
3367
  useEffect(() => {