@reactuses/core 2.2.6 → 2.2.8

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