@tmagic/utils 1.3.9-hotfix → 1.3.9

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.
@@ -1,2722 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('dayjs'), require('dayjs/plugin/utc'), require('@tmagic/schema')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'dayjs', 'dayjs/plugin/utc', '@tmagic/schema'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicUtils = {}, global.dayjs, global.utc, global.schema));
5
- })(this, (function (exports, dayjs, utc, schema) { 'use strict';
6
-
7
- /** Detect free variable `global` from Node.js. */
8
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
9
-
10
- const freeGlobal$1 = freeGlobal;
11
-
12
- /** Detect free variable `self`. */
13
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
14
-
15
- /** Used as a reference to the global object. */
16
- var root = freeGlobal$1 || freeSelf || Function('return this')();
17
-
18
- const root$1 = root;
19
-
20
- /** Built-in value references. */
21
- var Symbol$1 = root$1.Symbol;
22
-
23
- const Symbol$2 = Symbol$1;
24
-
25
- /** Used for built-in method references. */
26
- var objectProto$c = Object.prototype;
27
-
28
- /** Used to check objects for own properties. */
29
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
30
-
31
- /**
32
- * Used to resolve the
33
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
34
- * of values.
35
- */
36
- var nativeObjectToString$1 = objectProto$c.toString;
37
-
38
- /** Built-in value references. */
39
- var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
40
-
41
- /**
42
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
43
- *
44
- * @private
45
- * @param {*} value The value to query.
46
- * @returns {string} Returns the raw `toStringTag`.
47
- */
48
- function getRawTag(value) {
49
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
50
- tag = value[symToStringTag$1];
51
-
52
- try {
53
- value[symToStringTag$1] = undefined;
54
- var unmasked = true;
55
- } catch (e) {}
56
-
57
- var result = nativeObjectToString$1.call(value);
58
- if (unmasked) {
59
- if (isOwn) {
60
- value[symToStringTag$1] = tag;
61
- } else {
62
- delete value[symToStringTag$1];
63
- }
64
- }
65
- return result;
66
- }
67
-
68
- /** Used for built-in method references. */
69
- var objectProto$b = Object.prototype;
70
-
71
- /**
72
- * Used to resolve the
73
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
74
- * of values.
75
- */
76
- var nativeObjectToString = objectProto$b.toString;
77
-
78
- /**
79
- * Converts `value` to a string using `Object.prototype.toString`.
80
- *
81
- * @private
82
- * @param {*} value The value to convert.
83
- * @returns {string} Returns the converted string.
84
- */
85
- function objectToString(value) {
86
- return nativeObjectToString.call(value);
87
- }
88
-
89
- /** `Object#toString` result references. */
90
- var nullTag = '[object Null]',
91
- undefinedTag = '[object Undefined]';
92
-
93
- /** Built-in value references. */
94
- var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
95
-
96
- /**
97
- * The base implementation of `getTag` without fallbacks for buggy environments.
98
- *
99
- * @private
100
- * @param {*} value The value to query.
101
- * @returns {string} Returns the `toStringTag`.
102
- */
103
- function baseGetTag(value) {
104
- if (value == null) {
105
- return value === undefined ? undefinedTag : nullTag;
106
- }
107
- return (symToStringTag && symToStringTag in Object(value))
108
- ? getRawTag(value)
109
- : objectToString(value);
110
- }
111
-
112
- /**
113
- * Checks if `value` is object-like. A value is object-like if it's not `null`
114
- * and has a `typeof` result of "object".
115
- *
116
- * @static
117
- * @memberOf _
118
- * @since 4.0.0
119
- * @category Lang
120
- * @param {*} value The value to check.
121
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
122
- * @example
123
- *
124
- * _.isObjectLike({});
125
- * // => true
126
- *
127
- * _.isObjectLike([1, 2, 3]);
128
- * // => true
129
- *
130
- * _.isObjectLike(_.noop);
131
- * // => false
132
- *
133
- * _.isObjectLike(null);
134
- * // => false
135
- */
136
- function isObjectLike(value) {
137
- return value != null && typeof value == 'object';
138
- }
139
-
140
- /** `Object#toString` result references. */
141
- var symbolTag$2 = '[object Symbol]';
142
-
143
- /**
144
- * Checks if `value` is classified as a `Symbol` primitive or object.
145
- *
146
- * @static
147
- * @memberOf _
148
- * @since 4.0.0
149
- * @category Lang
150
- * @param {*} value The value to check.
151
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
152
- * @example
153
- *
154
- * _.isSymbol(Symbol.iterator);
155
- * // => true
156
- *
157
- * _.isSymbol('abc');
158
- * // => false
159
- */
160
- function isSymbol(value) {
161
- return typeof value == 'symbol' ||
162
- (isObjectLike(value) && baseGetTag(value) == symbolTag$2);
163
- }
164
-
165
- /**
166
- * A specialized version of `_.map` for arrays without support for iteratee
167
- * shorthands.
168
- *
169
- * @private
170
- * @param {Array} [array] The array to iterate over.
171
- * @param {Function} iteratee The function invoked per iteration.
172
- * @returns {Array} Returns the new mapped array.
173
- */
174
- function arrayMap(array, iteratee) {
175
- var index = -1,
176
- length = array == null ? 0 : array.length,
177
- result = Array(length);
178
-
179
- while (++index < length) {
180
- result[index] = iteratee(array[index], index, array);
181
- }
182
- return result;
183
- }
184
-
185
- /**
186
- * Checks if `value` is classified as an `Array` object.
187
- *
188
- * @static
189
- * @memberOf _
190
- * @since 0.1.0
191
- * @category Lang
192
- * @param {*} value The value to check.
193
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
194
- * @example
195
- *
196
- * _.isArray([1, 2, 3]);
197
- * // => true
198
- *
199
- * _.isArray(document.body.children);
200
- * // => false
201
- *
202
- * _.isArray('abc');
203
- * // => false
204
- *
205
- * _.isArray(_.noop);
206
- * // => false
207
- */
208
- var isArray = Array.isArray;
209
-
210
- const isArray$1 = isArray;
211
-
212
- /** Used as references for various `Number` constants. */
213
- var INFINITY$1 = 1 / 0;
214
-
215
- /** Used to convert symbols to primitives and strings. */
216
- var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined,
217
- symbolToString = symbolProto$1 ? symbolProto$1.toString : undefined;
218
-
219
- /**
220
- * The base implementation of `_.toString` which doesn't convert nullish
221
- * values to empty strings.
222
- *
223
- * @private
224
- * @param {*} value The value to process.
225
- * @returns {string} Returns the string.
226
- */
227
- function baseToString(value) {
228
- // Exit early for strings to avoid a performance hit in some environments.
229
- if (typeof value == 'string') {
230
- return value;
231
- }
232
- if (isArray$1(value)) {
233
- // Recursively convert values (susceptible to call stack limits).
234
- return arrayMap(value, baseToString) + '';
235
- }
236
- if (isSymbol(value)) {
237
- return symbolToString ? symbolToString.call(value) : '';
238
- }
239
- var result = (value + '');
240
- return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
241
- }
242
-
243
- /**
244
- * Checks if `value` is the
245
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
246
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
247
- *
248
- * @static
249
- * @memberOf _
250
- * @since 0.1.0
251
- * @category Lang
252
- * @param {*} value The value to check.
253
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
254
- * @example
255
- *
256
- * _.isObject({});
257
- * // => true
258
- *
259
- * _.isObject([1, 2, 3]);
260
- * // => true
261
- *
262
- * _.isObject(_.noop);
263
- * // => true
264
- *
265
- * _.isObject(null);
266
- * // => false
267
- */
268
- function isObject$1(value) {
269
- var type = typeof value;
270
- return value != null && (type == 'object' || type == 'function');
271
- }
272
-
273
- /** `Object#toString` result references. */
274
- var asyncTag = '[object AsyncFunction]',
275
- funcTag$2 = '[object Function]',
276
- genTag$1 = '[object GeneratorFunction]',
277
- proxyTag = '[object Proxy]';
278
-
279
- /**
280
- * Checks if `value` is classified as a `Function` object.
281
- *
282
- * @static
283
- * @memberOf _
284
- * @since 0.1.0
285
- * @category Lang
286
- * @param {*} value The value to check.
287
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
288
- * @example
289
- *
290
- * _.isFunction(_);
291
- * // => true
292
- *
293
- * _.isFunction(/abc/);
294
- * // => false
295
- */
296
- function isFunction(value) {
297
- if (!isObject$1(value)) {
298
- return false;
299
- }
300
- // The use of `Object#toString` avoids issues with the `typeof` operator
301
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
302
- var tag = baseGetTag(value);
303
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
304
- }
305
-
306
- /** Used to detect overreaching core-js shims. */
307
- var coreJsData = root$1['__core-js_shared__'];
308
-
309
- const coreJsData$1 = coreJsData;
310
-
311
- /** Used to detect methods masquerading as native. */
312
- var maskSrcKey = (function() {
313
- var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
314
- return uid ? ('Symbol(src)_1.' + uid) : '';
315
- }());
316
-
317
- /**
318
- * Checks if `func` has its source masked.
319
- *
320
- * @private
321
- * @param {Function} func The function to check.
322
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
323
- */
324
- function isMasked(func) {
325
- return !!maskSrcKey && (maskSrcKey in func);
326
- }
327
-
328
- /** Used for built-in method references. */
329
- var funcProto$1 = Function.prototype;
330
-
331
- /** Used to resolve the decompiled source of functions. */
332
- var funcToString$1 = funcProto$1.toString;
333
-
334
- /**
335
- * Converts `func` to its source code.
336
- *
337
- * @private
338
- * @param {Function} func The function to convert.
339
- * @returns {string} Returns the source code.
340
- */
341
- function toSource(func) {
342
- if (func != null) {
343
- try {
344
- return funcToString$1.call(func);
345
- } catch (e) {}
346
- try {
347
- return (func + '');
348
- } catch (e) {}
349
- }
350
- return '';
351
- }
352
-
353
- /**
354
- * Used to match `RegExp`
355
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
356
- */
357
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
358
-
359
- /** Used to detect host constructors (Safari). */
360
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
361
-
362
- /** Used for built-in method references. */
363
- var funcProto = Function.prototype,
364
- objectProto$a = Object.prototype;
365
-
366
- /** Used to resolve the decompiled source of functions. */
367
- var funcToString = funcProto.toString;
368
-
369
- /** Used to check objects for own properties. */
370
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
371
-
372
- /** Used to detect if a method is native. */
373
- var reIsNative = RegExp('^' +
374
- funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
375
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
376
- );
377
-
378
- /**
379
- * The base implementation of `_.isNative` without bad shim checks.
380
- *
381
- * @private
382
- * @param {*} value The value to check.
383
- * @returns {boolean} Returns `true` if `value` is a native function,
384
- * else `false`.
385
- */
386
- function baseIsNative(value) {
387
- if (!isObject$1(value) || isMasked(value)) {
388
- return false;
389
- }
390
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
391
- return pattern.test(toSource(value));
392
- }
393
-
394
- /**
395
- * Gets the value at `key` of `object`.
396
- *
397
- * @private
398
- * @param {Object} [object] The object to query.
399
- * @param {string} key The key of the property to get.
400
- * @returns {*} Returns the property value.
401
- */
402
- function getValue(object, key) {
403
- return object == null ? undefined : object[key];
404
- }
405
-
406
- /**
407
- * Gets the native function at `key` of `object`.
408
- *
409
- * @private
410
- * @param {Object} object The object to query.
411
- * @param {string} key The key of the method to get.
412
- * @returns {*} Returns the function if it's native, else `undefined`.
413
- */
414
- function getNative(object, key) {
415
- var value = getValue(object, key);
416
- return baseIsNative(value) ? value : undefined;
417
- }
418
-
419
- /* Built-in method references that are verified to be native. */
420
- var WeakMap = getNative(root$1, 'WeakMap');
421
-
422
- const WeakMap$1 = WeakMap;
423
-
424
- /** Built-in value references. */
425
- var objectCreate = Object.create;
426
-
427
- /**
428
- * The base implementation of `_.create` without support for assigning
429
- * properties to the created object.
430
- *
431
- * @private
432
- * @param {Object} proto The object to inherit from.
433
- * @returns {Object} Returns the new object.
434
- */
435
- var baseCreate = (function() {
436
- function object() {}
437
- return function(proto) {
438
- if (!isObject$1(proto)) {
439
- return {};
440
- }
441
- if (objectCreate) {
442
- return objectCreate(proto);
443
- }
444
- object.prototype = proto;
445
- var result = new object;
446
- object.prototype = undefined;
447
- return result;
448
- };
449
- }());
450
-
451
- const baseCreate$1 = baseCreate;
452
-
453
- /**
454
- * Copies the values of `source` to `array`.
455
- *
456
- * @private
457
- * @param {Array} source The array to copy values from.
458
- * @param {Array} [array=[]] The array to copy values to.
459
- * @returns {Array} Returns `array`.
460
- */
461
- function copyArray(source, array) {
462
- var index = -1,
463
- length = source.length;
464
-
465
- array || (array = Array(length));
466
- while (++index < length) {
467
- array[index] = source[index];
468
- }
469
- return array;
470
- }
471
-
472
- var defineProperty = (function() {
473
- try {
474
- var func = getNative(Object, 'defineProperty');
475
- func({}, '', {});
476
- return func;
477
- } catch (e) {}
478
- }());
479
-
480
- const defineProperty$1 = defineProperty;
481
-
482
- /**
483
- * A specialized version of `_.forEach` for arrays without support for
484
- * iteratee shorthands.
485
- *
486
- * @private
487
- * @param {Array} [array] The array to iterate over.
488
- * @param {Function} iteratee The function invoked per iteration.
489
- * @returns {Array} Returns `array`.
490
- */
491
- function arrayEach(array, iteratee) {
492
- var index = -1,
493
- length = array == null ? 0 : array.length;
494
-
495
- while (++index < length) {
496
- if (iteratee(array[index], index, array) === false) {
497
- break;
498
- }
499
- }
500
- return array;
501
- }
502
-
503
- /** Used as references for various `Number` constants. */
504
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
505
-
506
- /** Used to detect unsigned integer values. */
507
- var reIsUint = /^(?:0|[1-9]\d*)$/;
508
-
509
- /**
510
- * Checks if `value` is a valid array-like index.
511
- *
512
- * @private
513
- * @param {*} value The value to check.
514
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
515
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
516
- */
517
- function isIndex(value, length) {
518
- var type = typeof value;
519
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
520
-
521
- return !!length &&
522
- (type == 'number' ||
523
- (type != 'symbol' && reIsUint.test(value))) &&
524
- (value > -1 && value % 1 == 0 && value < length);
525
- }
526
-
527
- /**
528
- * The base implementation of `assignValue` and `assignMergeValue` without
529
- * value checks.
530
- *
531
- * @private
532
- * @param {Object} object The object to modify.
533
- * @param {string} key The key of the property to assign.
534
- * @param {*} value The value to assign.
535
- */
536
- function baseAssignValue(object, key, value) {
537
- if (key == '__proto__' && defineProperty$1) {
538
- defineProperty$1(object, key, {
539
- 'configurable': true,
540
- 'enumerable': true,
541
- 'value': value,
542
- 'writable': true
543
- });
544
- } else {
545
- object[key] = value;
546
- }
547
- }
548
-
549
- /**
550
- * Performs a
551
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
552
- * comparison between two values to determine if they are equivalent.
553
- *
554
- * @static
555
- * @memberOf _
556
- * @since 4.0.0
557
- * @category Lang
558
- * @param {*} value The value to compare.
559
- * @param {*} other The other value to compare.
560
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
561
- * @example
562
- *
563
- * var object = { 'a': 1 };
564
- * var other = { 'a': 1 };
565
- *
566
- * _.eq(object, object);
567
- * // => true
568
- *
569
- * _.eq(object, other);
570
- * // => false
571
- *
572
- * _.eq('a', 'a');
573
- * // => true
574
- *
575
- * _.eq('a', Object('a'));
576
- * // => false
577
- *
578
- * _.eq(NaN, NaN);
579
- * // => true
580
- */
581
- function eq(value, other) {
582
- return value === other || (value !== value && other !== other);
583
- }
584
-
585
- /** Used for built-in method references. */
586
- var objectProto$9 = Object.prototype;
587
-
588
- /** Used to check objects for own properties. */
589
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
590
-
591
- /**
592
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
593
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
594
- * for equality comparisons.
595
- *
596
- * @private
597
- * @param {Object} object The object to modify.
598
- * @param {string} key The key of the property to assign.
599
- * @param {*} value The value to assign.
600
- */
601
- function assignValue(object, key, value) {
602
- var objValue = object[key];
603
- if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) ||
604
- (value === undefined && !(key in object))) {
605
- baseAssignValue(object, key, value);
606
- }
607
- }
608
-
609
- /**
610
- * Copies properties of `source` to `object`.
611
- *
612
- * @private
613
- * @param {Object} source The object to copy properties from.
614
- * @param {Array} props The property identifiers to copy.
615
- * @param {Object} [object={}] The object to copy properties to.
616
- * @param {Function} [customizer] The function to customize copied values.
617
- * @returns {Object} Returns `object`.
618
- */
619
- function copyObject(source, props, object, customizer) {
620
- var isNew = !object;
621
- object || (object = {});
622
-
623
- var index = -1,
624
- length = props.length;
625
-
626
- while (++index < length) {
627
- var key = props[index];
628
-
629
- var newValue = customizer
630
- ? customizer(object[key], source[key], key, object, source)
631
- : undefined;
632
-
633
- if (newValue === undefined) {
634
- newValue = source[key];
635
- }
636
- if (isNew) {
637
- baseAssignValue(object, key, newValue);
638
- } else {
639
- assignValue(object, key, newValue);
640
- }
641
- }
642
- return object;
643
- }
644
-
645
- /** Used as references for various `Number` constants. */
646
- var MAX_SAFE_INTEGER = 9007199254740991;
647
-
648
- /**
649
- * Checks if `value` is a valid array-like length.
650
- *
651
- * **Note:** This method is loosely based on
652
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
653
- *
654
- * @static
655
- * @memberOf _
656
- * @since 4.0.0
657
- * @category Lang
658
- * @param {*} value The value to check.
659
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
660
- * @example
661
- *
662
- * _.isLength(3);
663
- * // => true
664
- *
665
- * _.isLength(Number.MIN_VALUE);
666
- * // => false
667
- *
668
- * _.isLength(Infinity);
669
- * // => false
670
- *
671
- * _.isLength('3');
672
- * // => false
673
- */
674
- function isLength(value) {
675
- return typeof value == 'number' &&
676
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
677
- }
678
-
679
- /**
680
- * Checks if `value` is array-like. A value is considered array-like if it's
681
- * not a function and has a `value.length` that's an integer greater than or
682
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
683
- *
684
- * @static
685
- * @memberOf _
686
- * @since 4.0.0
687
- * @category Lang
688
- * @param {*} value The value to check.
689
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
690
- * @example
691
- *
692
- * _.isArrayLike([1, 2, 3]);
693
- * // => true
694
- *
695
- * _.isArrayLike(document.body.children);
696
- * // => true
697
- *
698
- * _.isArrayLike('abc');
699
- * // => true
700
- *
701
- * _.isArrayLike(_.noop);
702
- * // => false
703
- */
704
- function isArrayLike(value) {
705
- return value != null && isLength(value.length) && !isFunction(value);
706
- }
707
-
708
- /** Used for built-in method references. */
709
- var objectProto$8 = Object.prototype;
710
-
711
- /**
712
- * Checks if `value` is likely a prototype object.
713
- *
714
- * @private
715
- * @param {*} value The value to check.
716
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
717
- */
718
- function isPrototype(value) {
719
- var Ctor = value && value.constructor,
720
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
721
-
722
- return value === proto;
723
- }
724
-
725
- /**
726
- * The base implementation of `_.times` without support for iteratee shorthands
727
- * or max array length checks.
728
- *
729
- * @private
730
- * @param {number} n The number of times to invoke `iteratee`.
731
- * @param {Function} iteratee The function invoked per iteration.
732
- * @returns {Array} Returns the array of results.
733
- */
734
- function baseTimes(n, iteratee) {
735
- var index = -1,
736
- result = Array(n);
737
-
738
- while (++index < n) {
739
- result[index] = iteratee(index);
740
- }
741
- return result;
742
- }
743
-
744
- /** `Object#toString` result references. */
745
- var argsTag$2 = '[object Arguments]';
746
-
747
- /**
748
- * The base implementation of `_.isArguments`.
749
- *
750
- * @private
751
- * @param {*} value The value to check.
752
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
753
- */
754
- function baseIsArguments(value) {
755
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
756
- }
757
-
758
- /** Used for built-in method references. */
759
- var objectProto$7 = Object.prototype;
760
-
761
- /** Used to check objects for own properties. */
762
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
763
-
764
- /** Built-in value references. */
765
- var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
766
-
767
- /**
768
- * Checks if `value` is likely an `arguments` object.
769
- *
770
- * @static
771
- * @memberOf _
772
- * @since 0.1.0
773
- * @category Lang
774
- * @param {*} value The value to check.
775
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
776
- * else `false`.
777
- * @example
778
- *
779
- * _.isArguments(function() { return arguments; }());
780
- * // => true
781
- *
782
- * _.isArguments([1, 2, 3]);
783
- * // => false
784
- */
785
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
786
- return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') &&
787
- !propertyIsEnumerable$1.call(value, 'callee');
788
- };
789
-
790
- const isArguments$1 = isArguments;
791
-
792
- /**
793
- * This method returns `false`.
794
- *
795
- * @static
796
- * @memberOf _
797
- * @since 4.13.0
798
- * @category Util
799
- * @returns {boolean} Returns `false`.
800
- * @example
801
- *
802
- * _.times(2, _.stubFalse);
803
- * // => [false, false]
804
- */
805
- function stubFalse() {
806
- return false;
807
- }
808
-
809
- /** Detect free variable `exports`. */
810
- var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
811
-
812
- /** Detect free variable `module`. */
813
- var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
814
-
815
- /** Detect the popular CommonJS extension `module.exports`. */
816
- var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
817
-
818
- /** Built-in value references. */
819
- var Buffer$1 = moduleExports$2 ? root$1.Buffer : undefined;
820
-
821
- /* Built-in method references for those with the same name as other `lodash` methods. */
822
- var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
823
-
824
- /**
825
- * Checks if `value` is a buffer.
826
- *
827
- * @static
828
- * @memberOf _
829
- * @since 4.3.0
830
- * @category Lang
831
- * @param {*} value The value to check.
832
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
833
- * @example
834
- *
835
- * _.isBuffer(new Buffer(2));
836
- * // => true
837
- *
838
- * _.isBuffer(new Uint8Array(2));
839
- * // => false
840
- */
841
- var isBuffer = nativeIsBuffer || stubFalse;
842
-
843
- const isBuffer$1 = isBuffer;
844
-
845
- /** `Object#toString` result references. */
846
- var argsTag$1 = '[object Arguments]',
847
- arrayTag$1 = '[object Array]',
848
- boolTag$2 = '[object Boolean]',
849
- dateTag$2 = '[object Date]',
850
- errorTag$1 = '[object Error]',
851
- funcTag$1 = '[object Function]',
852
- mapTag$4 = '[object Map]',
853
- numberTag$2 = '[object Number]',
854
- objectTag$2 = '[object Object]',
855
- regexpTag$2 = '[object RegExp]',
856
- setTag$4 = '[object Set]',
857
- stringTag$2 = '[object String]',
858
- weakMapTag$2 = '[object WeakMap]';
859
-
860
- var arrayBufferTag$2 = '[object ArrayBuffer]',
861
- dataViewTag$3 = '[object DataView]',
862
- float32Tag$2 = '[object Float32Array]',
863
- float64Tag$2 = '[object Float64Array]',
864
- int8Tag$2 = '[object Int8Array]',
865
- int16Tag$2 = '[object Int16Array]',
866
- int32Tag$2 = '[object Int32Array]',
867
- uint8Tag$2 = '[object Uint8Array]',
868
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
869
- uint16Tag$2 = '[object Uint16Array]',
870
- uint32Tag$2 = '[object Uint32Array]';
871
-
872
- /** Used to identify `toStringTag` values of typed arrays. */
873
- var typedArrayTags = {};
874
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
875
- typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
876
- typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
877
- typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
878
- typedArrayTags[uint32Tag$2] = true;
879
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
880
- typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
881
- typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
882
- typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
883
- typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
884
- typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
885
- typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
886
- typedArrayTags[weakMapTag$2] = false;
887
-
888
- /**
889
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
890
- *
891
- * @private
892
- * @param {*} value The value to check.
893
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
894
- */
895
- function baseIsTypedArray(value) {
896
- return isObjectLike(value) &&
897
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
898
- }
899
-
900
- /**
901
- * The base implementation of `_.unary` without support for storing metadata.
902
- *
903
- * @private
904
- * @param {Function} func The function to cap arguments for.
905
- * @returns {Function} Returns the new capped function.
906
- */
907
- function baseUnary(func) {
908
- return function(value) {
909
- return func(value);
910
- };
911
- }
912
-
913
- /** Detect free variable `exports`. */
914
- var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
915
-
916
- /** Detect free variable `module`. */
917
- var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
918
-
919
- /** Detect the popular CommonJS extension `module.exports`. */
920
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
921
-
922
- /** Detect free variable `process` from Node.js. */
923
- var freeProcess = moduleExports$1 && freeGlobal$1.process;
924
-
925
- /** Used to access faster Node.js helpers. */
926
- var nodeUtil = (function() {
927
- try {
928
- // Use `util.types` for Node.js 10+.
929
- var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
930
-
931
- if (types) {
932
- return types;
933
- }
934
-
935
- // Legacy `process.binding('util')` for Node.js < 10.
936
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
937
- } catch (e) {}
938
- }());
939
-
940
- const nodeUtil$1 = nodeUtil;
941
-
942
- /* Node.js helper references. */
943
- var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
944
-
945
- /**
946
- * Checks if `value` is classified as a typed array.
947
- *
948
- * @static
949
- * @memberOf _
950
- * @since 3.0.0
951
- * @category Lang
952
- * @param {*} value The value to check.
953
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
954
- * @example
955
- *
956
- * _.isTypedArray(new Uint8Array);
957
- * // => true
958
- *
959
- * _.isTypedArray([]);
960
- * // => false
961
- */
962
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
963
-
964
- const isTypedArray$1 = isTypedArray;
965
-
966
- /** Used for built-in method references. */
967
- var objectProto$6 = Object.prototype;
968
-
969
- /** Used to check objects for own properties. */
970
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
971
-
972
- /**
973
- * Creates an array of the enumerable property names of the array-like `value`.
974
- *
975
- * @private
976
- * @param {*} value The value to query.
977
- * @param {boolean} inherited Specify returning inherited property names.
978
- * @returns {Array} Returns the array of property names.
979
- */
980
- function arrayLikeKeys(value, inherited) {
981
- var isArr = isArray$1(value),
982
- isArg = !isArr && isArguments$1(value),
983
- isBuff = !isArr && !isArg && isBuffer$1(value),
984
- isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
985
- skipIndexes = isArr || isArg || isBuff || isType,
986
- result = skipIndexes ? baseTimes(value.length, String) : [],
987
- length = result.length;
988
-
989
- for (var key in value) {
990
- if ((inherited || hasOwnProperty$5.call(value, key)) &&
991
- !(skipIndexes && (
992
- // Safari 9 has enumerable `arguments.length` in strict mode.
993
- key == 'length' ||
994
- // Node.js 0.10 has enumerable non-index properties on buffers.
995
- (isBuff && (key == 'offset' || key == 'parent')) ||
996
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
997
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
998
- // Skip index properties.
999
- isIndex(key, length)
1000
- ))) {
1001
- result.push(key);
1002
- }
1003
- }
1004
- return result;
1005
- }
1006
-
1007
- /**
1008
- * Creates a unary function that invokes `func` with its argument transformed.
1009
- *
1010
- * @private
1011
- * @param {Function} func The function to wrap.
1012
- * @param {Function} transform The argument transform.
1013
- * @returns {Function} Returns the new function.
1014
- */
1015
- function overArg(func, transform) {
1016
- return function(arg) {
1017
- return func(transform(arg));
1018
- };
1019
- }
1020
-
1021
- /* Built-in method references for those with the same name as other `lodash` methods. */
1022
- var nativeKeys = overArg(Object.keys, Object);
1023
-
1024
- const nativeKeys$1 = nativeKeys;
1025
-
1026
- /** Used for built-in method references. */
1027
- var objectProto$5 = Object.prototype;
1028
-
1029
- /** Used to check objects for own properties. */
1030
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1031
-
1032
- /**
1033
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1034
- *
1035
- * @private
1036
- * @param {Object} object The object to query.
1037
- * @returns {Array} Returns the array of property names.
1038
- */
1039
- function baseKeys(object) {
1040
- if (!isPrototype(object)) {
1041
- return nativeKeys$1(object);
1042
- }
1043
- var result = [];
1044
- for (var key in Object(object)) {
1045
- if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
1046
- result.push(key);
1047
- }
1048
- }
1049
- return result;
1050
- }
1051
-
1052
- /**
1053
- * Creates an array of the own enumerable property names of `object`.
1054
- *
1055
- * **Note:** Non-object values are coerced to objects. See the
1056
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1057
- * for more details.
1058
- *
1059
- * @static
1060
- * @since 0.1.0
1061
- * @memberOf _
1062
- * @category Object
1063
- * @param {Object} object The object to query.
1064
- * @returns {Array} Returns the array of property names.
1065
- * @example
1066
- *
1067
- * function Foo() {
1068
- * this.a = 1;
1069
- * this.b = 2;
1070
- * }
1071
- *
1072
- * Foo.prototype.c = 3;
1073
- *
1074
- * _.keys(new Foo);
1075
- * // => ['a', 'b'] (iteration order is not guaranteed)
1076
- *
1077
- * _.keys('hi');
1078
- * // => ['0', '1']
1079
- */
1080
- function keys(object) {
1081
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1082
- }
1083
-
1084
- /**
1085
- * This function is like
1086
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1087
- * except that it includes inherited enumerable properties.
1088
- *
1089
- * @private
1090
- * @param {Object} object The object to query.
1091
- * @returns {Array} Returns the array of property names.
1092
- */
1093
- function nativeKeysIn(object) {
1094
- var result = [];
1095
- if (object != null) {
1096
- for (var key in Object(object)) {
1097
- result.push(key);
1098
- }
1099
- }
1100
- return result;
1101
- }
1102
-
1103
- /** Used for built-in method references. */
1104
- var objectProto$4 = Object.prototype;
1105
-
1106
- /** Used to check objects for own properties. */
1107
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1108
-
1109
- /**
1110
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1111
- *
1112
- * @private
1113
- * @param {Object} object The object to query.
1114
- * @returns {Array} Returns the array of property names.
1115
- */
1116
- function baseKeysIn(object) {
1117
- if (!isObject$1(object)) {
1118
- return nativeKeysIn(object);
1119
- }
1120
- var isProto = isPrototype(object),
1121
- result = [];
1122
-
1123
- for (var key in object) {
1124
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$3.call(object, key)))) {
1125
- result.push(key);
1126
- }
1127
- }
1128
- return result;
1129
- }
1130
-
1131
- /**
1132
- * Creates an array of the own and inherited enumerable property names of `object`.
1133
- *
1134
- * **Note:** Non-object values are coerced to objects.
1135
- *
1136
- * @static
1137
- * @memberOf _
1138
- * @since 3.0.0
1139
- * @category Object
1140
- * @param {Object} object The object to query.
1141
- * @returns {Array} Returns the array of property names.
1142
- * @example
1143
- *
1144
- * function Foo() {
1145
- * this.a = 1;
1146
- * this.b = 2;
1147
- * }
1148
- *
1149
- * Foo.prototype.c = 3;
1150
- *
1151
- * _.keysIn(new Foo);
1152
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1153
- */
1154
- function keysIn(object) {
1155
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1156
- }
1157
-
1158
- /** Used to match property names within property paths. */
1159
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
1160
- reIsPlainProp = /^\w*$/;
1161
-
1162
- /**
1163
- * Checks if `value` is a property name and not a property path.
1164
- *
1165
- * @private
1166
- * @param {*} value The value to check.
1167
- * @param {Object} [object] The object to query keys on.
1168
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
1169
- */
1170
- function isKey(value, object) {
1171
- if (isArray$1(value)) {
1172
- return false;
1173
- }
1174
- var type = typeof value;
1175
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
1176
- value == null || isSymbol(value)) {
1177
- return true;
1178
- }
1179
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
1180
- (object != null && value in Object(object));
1181
- }
1182
-
1183
- /* Built-in method references that are verified to be native. */
1184
- var nativeCreate = getNative(Object, 'create');
1185
-
1186
- const nativeCreate$1 = nativeCreate;
1187
-
1188
- /**
1189
- * Removes all key-value entries from the hash.
1190
- *
1191
- * @private
1192
- * @name clear
1193
- * @memberOf Hash
1194
- */
1195
- function hashClear() {
1196
- this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
1197
- this.size = 0;
1198
- }
1199
-
1200
- /**
1201
- * Removes `key` and its value from the hash.
1202
- *
1203
- * @private
1204
- * @name delete
1205
- * @memberOf Hash
1206
- * @param {Object} hash The hash to modify.
1207
- * @param {string} key The key of the value to remove.
1208
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1209
- */
1210
- function hashDelete(key) {
1211
- var result = this.has(key) && delete this.__data__[key];
1212
- this.size -= result ? 1 : 0;
1213
- return result;
1214
- }
1215
-
1216
- /** Used to stand-in for `undefined` hash values. */
1217
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1218
-
1219
- /** Used for built-in method references. */
1220
- var objectProto$3 = Object.prototype;
1221
-
1222
- /** Used to check objects for own properties. */
1223
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1224
-
1225
- /**
1226
- * Gets the hash value for `key`.
1227
- *
1228
- * @private
1229
- * @name get
1230
- * @memberOf Hash
1231
- * @param {string} key The key of the value to get.
1232
- * @returns {*} Returns the entry value.
1233
- */
1234
- function hashGet(key) {
1235
- var data = this.__data__;
1236
- if (nativeCreate$1) {
1237
- var result = data[key];
1238
- return result === HASH_UNDEFINED$1 ? undefined : result;
1239
- }
1240
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
1241
- }
1242
-
1243
- /** Used for built-in method references. */
1244
- var objectProto$2 = Object.prototype;
1245
-
1246
- /** Used to check objects for own properties. */
1247
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1248
-
1249
- /**
1250
- * Checks if a hash value for `key` exists.
1251
- *
1252
- * @private
1253
- * @name has
1254
- * @memberOf Hash
1255
- * @param {string} key The key of the entry to check.
1256
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1257
- */
1258
- function hashHas(key) {
1259
- var data = this.__data__;
1260
- return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$1.call(data, key);
1261
- }
1262
-
1263
- /** Used to stand-in for `undefined` hash values. */
1264
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1265
-
1266
- /**
1267
- * Sets the hash `key` to `value`.
1268
- *
1269
- * @private
1270
- * @name set
1271
- * @memberOf Hash
1272
- * @param {string} key The key of the value to set.
1273
- * @param {*} value The value to set.
1274
- * @returns {Object} Returns the hash instance.
1275
- */
1276
- function hashSet(key, value) {
1277
- var data = this.__data__;
1278
- this.size += this.has(key) ? 0 : 1;
1279
- data[key] = (nativeCreate$1 && value === undefined) ? HASH_UNDEFINED : value;
1280
- return this;
1281
- }
1282
-
1283
- /**
1284
- * Creates a hash object.
1285
- *
1286
- * @private
1287
- * @constructor
1288
- * @param {Array} [entries] The key-value pairs to cache.
1289
- */
1290
- function Hash(entries) {
1291
- var index = -1,
1292
- length = entries == null ? 0 : entries.length;
1293
-
1294
- this.clear();
1295
- while (++index < length) {
1296
- var entry = entries[index];
1297
- this.set(entry[0], entry[1]);
1298
- }
1299
- }
1300
-
1301
- // Add methods to `Hash`.
1302
- Hash.prototype.clear = hashClear;
1303
- Hash.prototype['delete'] = hashDelete;
1304
- Hash.prototype.get = hashGet;
1305
- Hash.prototype.has = hashHas;
1306
- Hash.prototype.set = hashSet;
1307
-
1308
- /**
1309
- * Removes all key-value entries from the list cache.
1310
- *
1311
- * @private
1312
- * @name clear
1313
- * @memberOf ListCache
1314
- */
1315
- function listCacheClear() {
1316
- this.__data__ = [];
1317
- this.size = 0;
1318
- }
1319
-
1320
- /**
1321
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1322
- *
1323
- * @private
1324
- * @param {Array} array The array to inspect.
1325
- * @param {*} key The key to search for.
1326
- * @returns {number} Returns the index of the matched value, else `-1`.
1327
- */
1328
- function assocIndexOf(array, key) {
1329
- var length = array.length;
1330
- while (length--) {
1331
- if (eq(array[length][0], key)) {
1332
- return length;
1333
- }
1334
- }
1335
- return -1;
1336
- }
1337
-
1338
- /** Used for built-in method references. */
1339
- var arrayProto = Array.prototype;
1340
-
1341
- /** Built-in value references. */
1342
- var splice = arrayProto.splice;
1343
-
1344
- /**
1345
- * Removes `key` and its value from the list cache.
1346
- *
1347
- * @private
1348
- * @name delete
1349
- * @memberOf ListCache
1350
- * @param {string} key The key of the value to remove.
1351
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1352
- */
1353
- function listCacheDelete(key) {
1354
- var data = this.__data__,
1355
- index = assocIndexOf(data, key);
1356
-
1357
- if (index < 0) {
1358
- return false;
1359
- }
1360
- var lastIndex = data.length - 1;
1361
- if (index == lastIndex) {
1362
- data.pop();
1363
- } else {
1364
- splice.call(data, index, 1);
1365
- }
1366
- --this.size;
1367
- return true;
1368
- }
1369
-
1370
- /**
1371
- * Gets the list cache value for `key`.
1372
- *
1373
- * @private
1374
- * @name get
1375
- * @memberOf ListCache
1376
- * @param {string} key The key of the value to get.
1377
- * @returns {*} Returns the entry value.
1378
- */
1379
- function listCacheGet(key) {
1380
- var data = this.__data__,
1381
- index = assocIndexOf(data, key);
1382
-
1383
- return index < 0 ? undefined : data[index][1];
1384
- }
1385
-
1386
- /**
1387
- * Checks if a list cache value for `key` exists.
1388
- *
1389
- * @private
1390
- * @name has
1391
- * @memberOf ListCache
1392
- * @param {string} key The key of the entry to check.
1393
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1394
- */
1395
- function listCacheHas(key) {
1396
- return assocIndexOf(this.__data__, key) > -1;
1397
- }
1398
-
1399
- /**
1400
- * Sets the list cache `key` to `value`.
1401
- *
1402
- * @private
1403
- * @name set
1404
- * @memberOf ListCache
1405
- * @param {string} key The key of the value to set.
1406
- * @param {*} value The value to set.
1407
- * @returns {Object} Returns the list cache instance.
1408
- */
1409
- function listCacheSet(key, value) {
1410
- var data = this.__data__,
1411
- index = assocIndexOf(data, key);
1412
-
1413
- if (index < 0) {
1414
- ++this.size;
1415
- data.push([key, value]);
1416
- } else {
1417
- data[index][1] = value;
1418
- }
1419
- return this;
1420
- }
1421
-
1422
- /**
1423
- * Creates an list cache object.
1424
- *
1425
- * @private
1426
- * @constructor
1427
- * @param {Array} [entries] The key-value pairs to cache.
1428
- */
1429
- function ListCache(entries) {
1430
- var index = -1,
1431
- length = entries == null ? 0 : entries.length;
1432
-
1433
- this.clear();
1434
- while (++index < length) {
1435
- var entry = entries[index];
1436
- this.set(entry[0], entry[1]);
1437
- }
1438
- }
1439
-
1440
- // Add methods to `ListCache`.
1441
- ListCache.prototype.clear = listCacheClear;
1442
- ListCache.prototype['delete'] = listCacheDelete;
1443
- ListCache.prototype.get = listCacheGet;
1444
- ListCache.prototype.has = listCacheHas;
1445
- ListCache.prototype.set = listCacheSet;
1446
-
1447
- /* Built-in method references that are verified to be native. */
1448
- var Map$1 = getNative(root$1, 'Map');
1449
-
1450
- const Map$2 = Map$1;
1451
-
1452
- /**
1453
- * Removes all key-value entries from the map.
1454
- *
1455
- * @private
1456
- * @name clear
1457
- * @memberOf MapCache
1458
- */
1459
- function mapCacheClear() {
1460
- this.size = 0;
1461
- this.__data__ = {
1462
- 'hash': new Hash,
1463
- 'map': new (Map$2 || ListCache),
1464
- 'string': new Hash
1465
- };
1466
- }
1467
-
1468
- /**
1469
- * Checks if `value` is suitable for use as unique object key.
1470
- *
1471
- * @private
1472
- * @param {*} value The value to check.
1473
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1474
- */
1475
- function isKeyable(value) {
1476
- var type = typeof value;
1477
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1478
- ? (value !== '__proto__')
1479
- : (value === null);
1480
- }
1481
-
1482
- /**
1483
- * Gets the data for `map`.
1484
- *
1485
- * @private
1486
- * @param {Object} map The map to query.
1487
- * @param {string} key The reference key.
1488
- * @returns {*} Returns the map data.
1489
- */
1490
- function getMapData(map, key) {
1491
- var data = map.__data__;
1492
- return isKeyable(key)
1493
- ? data[typeof key == 'string' ? 'string' : 'hash']
1494
- : data.map;
1495
- }
1496
-
1497
- /**
1498
- * Removes `key` and its value from the map.
1499
- *
1500
- * @private
1501
- * @name delete
1502
- * @memberOf MapCache
1503
- * @param {string} key The key of the value to remove.
1504
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1505
- */
1506
- function mapCacheDelete(key) {
1507
- var result = getMapData(this, key)['delete'](key);
1508
- this.size -= result ? 1 : 0;
1509
- return result;
1510
- }
1511
-
1512
- /**
1513
- * Gets the map value for `key`.
1514
- *
1515
- * @private
1516
- * @name get
1517
- * @memberOf MapCache
1518
- * @param {string} key The key of the value to get.
1519
- * @returns {*} Returns the entry value.
1520
- */
1521
- function mapCacheGet(key) {
1522
- return getMapData(this, key).get(key);
1523
- }
1524
-
1525
- /**
1526
- * Checks if a map value for `key` exists.
1527
- *
1528
- * @private
1529
- * @name has
1530
- * @memberOf MapCache
1531
- * @param {string} key The key of the entry to check.
1532
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1533
- */
1534
- function mapCacheHas(key) {
1535
- return getMapData(this, key).has(key);
1536
- }
1537
-
1538
- /**
1539
- * Sets the map `key` to `value`.
1540
- *
1541
- * @private
1542
- * @name set
1543
- * @memberOf MapCache
1544
- * @param {string} key The key of the value to set.
1545
- * @param {*} value The value to set.
1546
- * @returns {Object} Returns the map cache instance.
1547
- */
1548
- function mapCacheSet(key, value) {
1549
- var data = getMapData(this, key),
1550
- size = data.size;
1551
-
1552
- data.set(key, value);
1553
- this.size += data.size == size ? 0 : 1;
1554
- return this;
1555
- }
1556
-
1557
- /**
1558
- * Creates a map cache object to store key-value pairs.
1559
- *
1560
- * @private
1561
- * @constructor
1562
- * @param {Array} [entries] The key-value pairs to cache.
1563
- */
1564
- function MapCache(entries) {
1565
- var index = -1,
1566
- length = entries == null ? 0 : entries.length;
1567
-
1568
- this.clear();
1569
- while (++index < length) {
1570
- var entry = entries[index];
1571
- this.set(entry[0], entry[1]);
1572
- }
1573
- }
1574
-
1575
- // Add methods to `MapCache`.
1576
- MapCache.prototype.clear = mapCacheClear;
1577
- MapCache.prototype['delete'] = mapCacheDelete;
1578
- MapCache.prototype.get = mapCacheGet;
1579
- MapCache.prototype.has = mapCacheHas;
1580
- MapCache.prototype.set = mapCacheSet;
1581
-
1582
- /** Error message constants. */
1583
- var FUNC_ERROR_TEXT = 'Expected a function';
1584
-
1585
- /**
1586
- * Creates a function that memoizes the result of `func`. If `resolver` is
1587
- * provided, it determines the cache key for storing the result based on the
1588
- * arguments provided to the memoized function. By default, the first argument
1589
- * provided to the memoized function is used as the map cache key. The `func`
1590
- * is invoked with the `this` binding of the memoized function.
1591
- *
1592
- * **Note:** The cache is exposed as the `cache` property on the memoized
1593
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
1594
- * constructor with one whose instances implement the
1595
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1596
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1597
- *
1598
- * @static
1599
- * @memberOf _
1600
- * @since 0.1.0
1601
- * @category Function
1602
- * @param {Function} func The function to have its output memoized.
1603
- * @param {Function} [resolver] The function to resolve the cache key.
1604
- * @returns {Function} Returns the new memoized function.
1605
- * @example
1606
- *
1607
- * var object = { 'a': 1, 'b': 2 };
1608
- * var other = { 'c': 3, 'd': 4 };
1609
- *
1610
- * var values = _.memoize(_.values);
1611
- * values(object);
1612
- * // => [1, 2]
1613
- *
1614
- * values(other);
1615
- * // => [3, 4]
1616
- *
1617
- * object.a = 2;
1618
- * values(object);
1619
- * // => [1, 2]
1620
- *
1621
- * // Modify the result cache.
1622
- * values.cache.set(object, ['a', 'b']);
1623
- * values(object);
1624
- * // => ['a', 'b']
1625
- *
1626
- * // Replace `_.memoize.Cache`.
1627
- * _.memoize.Cache = WeakMap;
1628
- */
1629
- function memoize(func, resolver) {
1630
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1631
- throw new TypeError(FUNC_ERROR_TEXT);
1632
- }
1633
- var memoized = function() {
1634
- var args = arguments,
1635
- key = resolver ? resolver.apply(this, args) : args[0],
1636
- cache = memoized.cache;
1637
-
1638
- if (cache.has(key)) {
1639
- return cache.get(key);
1640
- }
1641
- var result = func.apply(this, args);
1642
- memoized.cache = cache.set(key, result) || cache;
1643
- return result;
1644
- };
1645
- memoized.cache = new (memoize.Cache || MapCache);
1646
- return memoized;
1647
- }
1648
-
1649
- // Expose `MapCache`.
1650
- memoize.Cache = MapCache;
1651
-
1652
- /** Used as the maximum memoize cache size. */
1653
- var MAX_MEMOIZE_SIZE = 500;
1654
-
1655
- /**
1656
- * A specialized version of `_.memoize` which clears the memoized function's
1657
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1658
- *
1659
- * @private
1660
- * @param {Function} func The function to have its output memoized.
1661
- * @returns {Function} Returns the new memoized function.
1662
- */
1663
- function memoizeCapped(func) {
1664
- var result = memoize(func, function(key) {
1665
- if (cache.size === MAX_MEMOIZE_SIZE) {
1666
- cache.clear();
1667
- }
1668
- return key;
1669
- });
1670
-
1671
- var cache = result.cache;
1672
- return result;
1673
- }
1674
-
1675
- /** Used to match property names within property paths. */
1676
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1677
-
1678
- /** Used to match backslashes in property paths. */
1679
- var reEscapeChar = /\\(\\)?/g;
1680
-
1681
- /**
1682
- * Converts `string` to a property path array.
1683
- *
1684
- * @private
1685
- * @param {string} string The string to convert.
1686
- * @returns {Array} Returns the property path array.
1687
- */
1688
- var stringToPath = memoizeCapped(function(string) {
1689
- var result = [];
1690
- if (string.charCodeAt(0) === 46 /* . */) {
1691
- result.push('');
1692
- }
1693
- string.replace(rePropName, function(match, number, quote, subString) {
1694
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1695
- });
1696
- return result;
1697
- });
1698
-
1699
- const stringToPath$1 = stringToPath;
1700
-
1701
- /**
1702
- * Converts `value` to a string. An empty string is returned for `null`
1703
- * and `undefined` values. The sign of `-0` is preserved.
1704
- *
1705
- * @static
1706
- * @memberOf _
1707
- * @since 4.0.0
1708
- * @category Lang
1709
- * @param {*} value The value to convert.
1710
- * @returns {string} Returns the converted string.
1711
- * @example
1712
- *
1713
- * _.toString(null);
1714
- * // => ''
1715
- *
1716
- * _.toString(-0);
1717
- * // => '-0'
1718
- *
1719
- * _.toString([1, 2, 3]);
1720
- * // => '1,2,3'
1721
- */
1722
- function toString(value) {
1723
- return value == null ? '' : baseToString(value);
1724
- }
1725
-
1726
- /**
1727
- * Casts `value` to a path array if it's not one.
1728
- *
1729
- * @private
1730
- * @param {*} value The value to inspect.
1731
- * @param {Object} [object] The object to query keys on.
1732
- * @returns {Array} Returns the cast property path array.
1733
- */
1734
- function castPath(value, object) {
1735
- if (isArray$1(value)) {
1736
- return value;
1737
- }
1738
- return isKey(value, object) ? [value] : stringToPath$1(toString(value));
1739
- }
1740
-
1741
- /** Used as references for various `Number` constants. */
1742
- var INFINITY = 1 / 0;
1743
-
1744
- /**
1745
- * Converts `value` to a string key if it's not a string or symbol.
1746
- *
1747
- * @private
1748
- * @param {*} value The value to inspect.
1749
- * @returns {string|symbol} Returns the key.
1750
- */
1751
- function toKey(value) {
1752
- if (typeof value == 'string' || isSymbol(value)) {
1753
- return value;
1754
- }
1755
- var result = (value + '');
1756
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1757
- }
1758
-
1759
- /**
1760
- * The base implementation of `_.get` without support for default values.
1761
- *
1762
- * @private
1763
- * @param {Object} object The object to query.
1764
- * @param {Array|string} path The path of the property to get.
1765
- * @returns {*} Returns the resolved value.
1766
- */
1767
- function baseGet(object, path) {
1768
- path = castPath(path, object);
1769
-
1770
- var index = 0,
1771
- length = path.length;
1772
-
1773
- while (object != null && index < length) {
1774
- object = object[toKey(path[index++])];
1775
- }
1776
- return (index && index == length) ? object : undefined;
1777
- }
1778
-
1779
- /**
1780
- * Gets the value at `path` of `object`. If the resolved value is
1781
- * `undefined`, the `defaultValue` is returned in its place.
1782
- *
1783
- * @static
1784
- * @memberOf _
1785
- * @since 3.7.0
1786
- * @category Object
1787
- * @param {Object} object The object to query.
1788
- * @param {Array|string} path The path of the property to get.
1789
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1790
- * @returns {*} Returns the resolved value.
1791
- * @example
1792
- *
1793
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1794
- *
1795
- * _.get(object, 'a[0].b.c');
1796
- * // => 3
1797
- *
1798
- * _.get(object, ['a', '0', 'b', 'c']);
1799
- * // => 3
1800
- *
1801
- * _.get(object, 'a.b.c', 'default');
1802
- * // => 'default'
1803
- */
1804
- function get(object, path, defaultValue) {
1805
- var result = object == null ? undefined : baseGet(object, path);
1806
- return result === undefined ? defaultValue : result;
1807
- }
1808
-
1809
- /**
1810
- * Appends the elements of `values` to `array`.
1811
- *
1812
- * @private
1813
- * @param {Array} array The array to modify.
1814
- * @param {Array} values The values to append.
1815
- * @returns {Array} Returns `array`.
1816
- */
1817
- function arrayPush(array, values) {
1818
- var index = -1,
1819
- length = values.length,
1820
- offset = array.length;
1821
-
1822
- while (++index < length) {
1823
- array[offset + index] = values[index];
1824
- }
1825
- return array;
1826
- }
1827
-
1828
- /** Built-in value references. */
1829
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1830
-
1831
- const getPrototype$1 = getPrototype;
1832
-
1833
- /**
1834
- * Removes all key-value entries from the stack.
1835
- *
1836
- * @private
1837
- * @name clear
1838
- * @memberOf Stack
1839
- */
1840
- function stackClear() {
1841
- this.__data__ = new ListCache;
1842
- this.size = 0;
1843
- }
1844
-
1845
- /**
1846
- * Removes `key` and its value from the stack.
1847
- *
1848
- * @private
1849
- * @name delete
1850
- * @memberOf Stack
1851
- * @param {string} key The key of the value to remove.
1852
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1853
- */
1854
- function stackDelete(key) {
1855
- var data = this.__data__,
1856
- result = data['delete'](key);
1857
-
1858
- this.size = data.size;
1859
- return result;
1860
- }
1861
-
1862
- /**
1863
- * Gets the stack value for `key`.
1864
- *
1865
- * @private
1866
- * @name get
1867
- * @memberOf Stack
1868
- * @param {string} key The key of the value to get.
1869
- * @returns {*} Returns the entry value.
1870
- */
1871
- function stackGet(key) {
1872
- return this.__data__.get(key);
1873
- }
1874
-
1875
- /**
1876
- * Checks if a stack value for `key` exists.
1877
- *
1878
- * @private
1879
- * @name has
1880
- * @memberOf Stack
1881
- * @param {string} key The key of the entry to check.
1882
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1883
- */
1884
- function stackHas(key) {
1885
- return this.__data__.has(key);
1886
- }
1887
-
1888
- /** Used as the size to enable large array optimizations. */
1889
- var LARGE_ARRAY_SIZE = 200;
1890
-
1891
- /**
1892
- * Sets the stack `key` to `value`.
1893
- *
1894
- * @private
1895
- * @name set
1896
- * @memberOf Stack
1897
- * @param {string} key The key of the value to set.
1898
- * @param {*} value The value to set.
1899
- * @returns {Object} Returns the stack cache instance.
1900
- */
1901
- function stackSet(key, value) {
1902
- var data = this.__data__;
1903
- if (data instanceof ListCache) {
1904
- var pairs = data.__data__;
1905
- if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1906
- pairs.push([key, value]);
1907
- this.size = ++data.size;
1908
- return this;
1909
- }
1910
- data = this.__data__ = new MapCache(pairs);
1911
- }
1912
- data.set(key, value);
1913
- this.size = data.size;
1914
- return this;
1915
- }
1916
-
1917
- /**
1918
- * Creates a stack cache object to store key-value pairs.
1919
- *
1920
- * @private
1921
- * @constructor
1922
- * @param {Array} [entries] The key-value pairs to cache.
1923
- */
1924
- function Stack(entries) {
1925
- var data = this.__data__ = new ListCache(entries);
1926
- this.size = data.size;
1927
- }
1928
-
1929
- // Add methods to `Stack`.
1930
- Stack.prototype.clear = stackClear;
1931
- Stack.prototype['delete'] = stackDelete;
1932
- Stack.prototype.get = stackGet;
1933
- Stack.prototype.has = stackHas;
1934
- Stack.prototype.set = stackSet;
1935
-
1936
- /**
1937
- * The base implementation of `_.assign` without support for multiple sources
1938
- * or `customizer` functions.
1939
- *
1940
- * @private
1941
- * @param {Object} object The destination object.
1942
- * @param {Object} source The source object.
1943
- * @returns {Object} Returns `object`.
1944
- */
1945
- function baseAssign(object, source) {
1946
- return object && copyObject(source, keys(source), object);
1947
- }
1948
-
1949
- /**
1950
- * The base implementation of `_.assignIn` without support for multiple sources
1951
- * or `customizer` functions.
1952
- *
1953
- * @private
1954
- * @param {Object} object The destination object.
1955
- * @param {Object} source The source object.
1956
- * @returns {Object} Returns `object`.
1957
- */
1958
- function baseAssignIn(object, source) {
1959
- return object && copyObject(source, keysIn(source), object);
1960
- }
1961
-
1962
- /** Detect free variable `exports`. */
1963
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1964
-
1965
- /** Detect free variable `module`. */
1966
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
1967
-
1968
- /** Detect the popular CommonJS extension `module.exports`. */
1969
- var moduleExports = freeModule && freeModule.exports === freeExports;
1970
-
1971
- /** Built-in value references. */
1972
- var Buffer = moduleExports ? root$1.Buffer : undefined,
1973
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1974
-
1975
- /**
1976
- * Creates a clone of `buffer`.
1977
- *
1978
- * @private
1979
- * @param {Buffer} buffer The buffer to clone.
1980
- * @param {boolean} [isDeep] Specify a deep clone.
1981
- * @returns {Buffer} Returns the cloned buffer.
1982
- */
1983
- function cloneBuffer(buffer, isDeep) {
1984
- if (isDeep) {
1985
- return buffer.slice();
1986
- }
1987
- var length = buffer.length,
1988
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1989
-
1990
- buffer.copy(result);
1991
- return result;
1992
- }
1993
-
1994
- /**
1995
- * A specialized version of `_.filter` for arrays without support for
1996
- * iteratee shorthands.
1997
- *
1998
- * @private
1999
- * @param {Array} [array] The array to iterate over.
2000
- * @param {Function} predicate The function invoked per iteration.
2001
- * @returns {Array} Returns the new filtered array.
2002
- */
2003
- function arrayFilter(array, predicate) {
2004
- var index = -1,
2005
- length = array == null ? 0 : array.length,
2006
- resIndex = 0,
2007
- result = [];
2008
-
2009
- while (++index < length) {
2010
- var value = array[index];
2011
- if (predicate(value, index, array)) {
2012
- result[resIndex++] = value;
2013
- }
2014
- }
2015
- return result;
2016
- }
2017
-
2018
- /**
2019
- * This method returns a new empty array.
2020
- *
2021
- * @static
2022
- * @memberOf _
2023
- * @since 4.13.0
2024
- * @category Util
2025
- * @returns {Array} Returns the new empty array.
2026
- * @example
2027
- *
2028
- * var arrays = _.times(2, _.stubArray);
2029
- *
2030
- * console.log(arrays);
2031
- * // => [[], []]
2032
- *
2033
- * console.log(arrays[0] === arrays[1]);
2034
- * // => false
2035
- */
2036
- function stubArray() {
2037
- return [];
2038
- }
2039
-
2040
- /** Used for built-in method references. */
2041
- var objectProto$1 = Object.prototype;
2042
-
2043
- /** Built-in value references. */
2044
- var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
2045
-
2046
- /* Built-in method references for those with the same name as other `lodash` methods. */
2047
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
2048
-
2049
- /**
2050
- * Creates an array of the own enumerable symbols of `object`.
2051
- *
2052
- * @private
2053
- * @param {Object} object The object to query.
2054
- * @returns {Array} Returns the array of symbols.
2055
- */
2056
- var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
2057
- if (object == null) {
2058
- return [];
2059
- }
2060
- object = Object(object);
2061
- return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
2062
- return propertyIsEnumerable.call(object, symbol);
2063
- });
2064
- };
2065
-
2066
- const getSymbols$1 = getSymbols;
2067
-
2068
- /**
2069
- * Copies own symbols of `source` to `object`.
2070
- *
2071
- * @private
2072
- * @param {Object} source The object to copy symbols from.
2073
- * @param {Object} [object={}] The object to copy symbols to.
2074
- * @returns {Object} Returns `object`.
2075
- */
2076
- function copySymbols(source, object) {
2077
- return copyObject(source, getSymbols$1(source), object);
2078
- }
2079
-
2080
- /* Built-in method references for those with the same name as other `lodash` methods. */
2081
- var nativeGetSymbols = Object.getOwnPropertySymbols;
2082
-
2083
- /**
2084
- * Creates an array of the own and inherited enumerable symbols of `object`.
2085
- *
2086
- * @private
2087
- * @param {Object} object The object to query.
2088
- * @returns {Array} Returns the array of symbols.
2089
- */
2090
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
2091
- var result = [];
2092
- while (object) {
2093
- arrayPush(result, getSymbols$1(object));
2094
- object = getPrototype$1(object);
2095
- }
2096
- return result;
2097
- };
2098
-
2099
- const getSymbolsIn$1 = getSymbolsIn;
2100
-
2101
- /**
2102
- * Copies own and inherited symbols of `source` to `object`.
2103
- *
2104
- * @private
2105
- * @param {Object} source The object to copy symbols from.
2106
- * @param {Object} [object={}] The object to copy symbols to.
2107
- * @returns {Object} Returns `object`.
2108
- */
2109
- function copySymbolsIn(source, object) {
2110
- return copyObject(source, getSymbolsIn$1(source), object);
2111
- }
2112
-
2113
- /**
2114
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
2115
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
2116
- * symbols of `object`.
2117
- *
2118
- * @private
2119
- * @param {Object} object The object to query.
2120
- * @param {Function} keysFunc The function to get the keys of `object`.
2121
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
2122
- * @returns {Array} Returns the array of property names and symbols.
2123
- */
2124
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2125
- var result = keysFunc(object);
2126
- return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
2127
- }
2128
-
2129
- /**
2130
- * Creates an array of own enumerable property names and symbols of `object`.
2131
- *
2132
- * @private
2133
- * @param {Object} object The object to query.
2134
- * @returns {Array} Returns the array of property names and symbols.
2135
- */
2136
- function getAllKeys(object) {
2137
- return baseGetAllKeys(object, keys, getSymbols$1);
2138
- }
2139
-
2140
- /**
2141
- * Creates an array of own and inherited enumerable property names and
2142
- * symbols of `object`.
2143
- *
2144
- * @private
2145
- * @param {Object} object The object to query.
2146
- * @returns {Array} Returns the array of property names and symbols.
2147
- */
2148
- function getAllKeysIn(object) {
2149
- return baseGetAllKeys(object, keysIn, getSymbolsIn$1);
2150
- }
2151
-
2152
- /* Built-in method references that are verified to be native. */
2153
- var DataView = getNative(root$1, 'DataView');
2154
-
2155
- const DataView$1 = DataView;
2156
-
2157
- /* Built-in method references that are verified to be native. */
2158
- var Promise$1 = getNative(root$1, 'Promise');
2159
-
2160
- const Promise$2 = Promise$1;
2161
-
2162
- /* Built-in method references that are verified to be native. */
2163
- var Set$1 = getNative(root$1, 'Set');
2164
-
2165
- const Set$2 = Set$1;
2166
-
2167
- /** `Object#toString` result references. */
2168
- var mapTag$3 = '[object Map]',
2169
- objectTag$1 = '[object Object]',
2170
- promiseTag = '[object Promise]',
2171
- setTag$3 = '[object Set]',
2172
- weakMapTag$1 = '[object WeakMap]';
2173
-
2174
- var dataViewTag$2 = '[object DataView]';
2175
-
2176
- /** Used to detect maps, sets, and weakmaps. */
2177
- var dataViewCtorString = toSource(DataView$1),
2178
- mapCtorString = toSource(Map$2),
2179
- promiseCtorString = toSource(Promise$2),
2180
- setCtorString = toSource(Set$2),
2181
- weakMapCtorString = toSource(WeakMap$1);
2182
-
2183
- /**
2184
- * Gets the `toStringTag` of `value`.
2185
- *
2186
- * @private
2187
- * @param {*} value The value to query.
2188
- * @returns {string} Returns the `toStringTag`.
2189
- */
2190
- var getTag = baseGetTag;
2191
-
2192
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2193
- if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2) ||
2194
- (Map$2 && getTag(new Map$2) != mapTag$3) ||
2195
- (Promise$2 && getTag(Promise$2.resolve()) != promiseTag) ||
2196
- (Set$2 && getTag(new Set$2) != setTag$3) ||
2197
- (WeakMap$1 && getTag(new WeakMap$1) != weakMapTag$1)) {
2198
- getTag = function(value) {
2199
- var result = baseGetTag(value),
2200
- Ctor = result == objectTag$1 ? value.constructor : undefined,
2201
- ctorString = Ctor ? toSource(Ctor) : '';
2202
-
2203
- if (ctorString) {
2204
- switch (ctorString) {
2205
- case dataViewCtorString: return dataViewTag$2;
2206
- case mapCtorString: return mapTag$3;
2207
- case promiseCtorString: return promiseTag;
2208
- case setCtorString: return setTag$3;
2209
- case weakMapCtorString: return weakMapTag$1;
2210
- }
2211
- }
2212
- return result;
2213
- };
2214
- }
2215
-
2216
- const getTag$1 = getTag;
2217
-
2218
- /** Used for built-in method references. */
2219
- var objectProto = Object.prototype;
2220
-
2221
- /** Used to check objects for own properties. */
2222
- var hasOwnProperty = objectProto.hasOwnProperty;
2223
-
2224
- /**
2225
- * Initializes an array clone.
2226
- *
2227
- * @private
2228
- * @param {Array} array The array to clone.
2229
- * @returns {Array} Returns the initialized clone.
2230
- */
2231
- function initCloneArray(array) {
2232
- var length = array.length,
2233
- result = new array.constructor(length);
2234
-
2235
- // Add properties assigned by `RegExp#exec`.
2236
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2237
- result.index = array.index;
2238
- result.input = array.input;
2239
- }
2240
- return result;
2241
- }
2242
-
2243
- /** Built-in value references. */
2244
- var Uint8Array = root$1.Uint8Array;
2245
-
2246
- const Uint8Array$1 = Uint8Array;
2247
-
2248
- /**
2249
- * Creates a clone of `arrayBuffer`.
2250
- *
2251
- * @private
2252
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2253
- * @returns {ArrayBuffer} Returns the cloned array buffer.
2254
- */
2255
- function cloneArrayBuffer(arrayBuffer) {
2256
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2257
- new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
2258
- return result;
2259
- }
2260
-
2261
- /**
2262
- * Creates a clone of `dataView`.
2263
- *
2264
- * @private
2265
- * @param {Object} dataView The data view to clone.
2266
- * @param {boolean} [isDeep] Specify a deep clone.
2267
- * @returns {Object} Returns the cloned data view.
2268
- */
2269
- function cloneDataView(dataView, isDeep) {
2270
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2271
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2272
- }
2273
-
2274
- /** Used to match `RegExp` flags from their coerced string values. */
2275
- var reFlags = /\w*$/;
2276
-
2277
- /**
2278
- * Creates a clone of `regexp`.
2279
- *
2280
- * @private
2281
- * @param {Object} regexp The regexp to clone.
2282
- * @returns {Object} Returns the cloned regexp.
2283
- */
2284
- function cloneRegExp(regexp) {
2285
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2286
- result.lastIndex = regexp.lastIndex;
2287
- return result;
2288
- }
2289
-
2290
- /** Used to convert symbols to primitives and strings. */
2291
- var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
2292
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2293
-
2294
- /**
2295
- * Creates a clone of the `symbol` object.
2296
- *
2297
- * @private
2298
- * @param {Object} symbol The symbol object to clone.
2299
- * @returns {Object} Returns the cloned symbol object.
2300
- */
2301
- function cloneSymbol(symbol) {
2302
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2303
- }
2304
-
2305
- /**
2306
- * Creates a clone of `typedArray`.
2307
- *
2308
- * @private
2309
- * @param {Object} typedArray The typed array to clone.
2310
- * @param {boolean} [isDeep] Specify a deep clone.
2311
- * @returns {Object} Returns the cloned typed array.
2312
- */
2313
- function cloneTypedArray(typedArray, isDeep) {
2314
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2315
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2316
- }
2317
-
2318
- /** `Object#toString` result references. */
2319
- var boolTag$1 = '[object Boolean]',
2320
- dateTag$1 = '[object Date]',
2321
- mapTag$2 = '[object Map]',
2322
- numberTag$1 = '[object Number]',
2323
- regexpTag$1 = '[object RegExp]',
2324
- setTag$2 = '[object Set]',
2325
- stringTag$1 = '[object String]',
2326
- symbolTag$1 = '[object Symbol]';
2327
-
2328
- var arrayBufferTag$1 = '[object ArrayBuffer]',
2329
- dataViewTag$1 = '[object DataView]',
2330
- float32Tag$1 = '[object Float32Array]',
2331
- float64Tag$1 = '[object Float64Array]',
2332
- int8Tag$1 = '[object Int8Array]',
2333
- int16Tag$1 = '[object Int16Array]',
2334
- int32Tag$1 = '[object Int32Array]',
2335
- uint8Tag$1 = '[object Uint8Array]',
2336
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2337
- uint16Tag$1 = '[object Uint16Array]',
2338
- uint32Tag$1 = '[object Uint32Array]';
2339
-
2340
- /**
2341
- * Initializes an object clone based on its `toStringTag`.
2342
- *
2343
- * **Note:** This function only supports cloning values with tags of
2344
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2345
- *
2346
- * @private
2347
- * @param {Object} object The object to clone.
2348
- * @param {string} tag The `toStringTag` of the object to clone.
2349
- * @param {boolean} [isDeep] Specify a deep clone.
2350
- * @returns {Object} Returns the initialized clone.
2351
- */
2352
- function initCloneByTag(object, tag, isDeep) {
2353
- var Ctor = object.constructor;
2354
- switch (tag) {
2355
- case arrayBufferTag$1:
2356
- return cloneArrayBuffer(object);
2357
-
2358
- case boolTag$1:
2359
- case dateTag$1:
2360
- return new Ctor(+object);
2361
-
2362
- case dataViewTag$1:
2363
- return cloneDataView(object, isDeep);
2364
-
2365
- case float32Tag$1: case float64Tag$1:
2366
- case int8Tag$1: case int16Tag$1: case int32Tag$1:
2367
- case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2368
- return cloneTypedArray(object, isDeep);
2369
-
2370
- case mapTag$2:
2371
- return new Ctor;
2372
-
2373
- case numberTag$1:
2374
- case stringTag$1:
2375
- return new Ctor(object);
2376
-
2377
- case regexpTag$1:
2378
- return cloneRegExp(object);
2379
-
2380
- case setTag$2:
2381
- return new Ctor;
2382
-
2383
- case symbolTag$1:
2384
- return cloneSymbol(object);
2385
- }
2386
- }
2387
-
2388
- /**
2389
- * Initializes an object clone.
2390
- *
2391
- * @private
2392
- * @param {Object} object The object to clone.
2393
- * @returns {Object} Returns the initialized clone.
2394
- */
2395
- function initCloneObject(object) {
2396
- return (typeof object.constructor == 'function' && !isPrototype(object))
2397
- ? baseCreate$1(getPrototype$1(object))
2398
- : {};
2399
- }
2400
-
2401
- /** `Object#toString` result references. */
2402
- var mapTag$1 = '[object Map]';
2403
-
2404
- /**
2405
- * The base implementation of `_.isMap` without Node.js optimizations.
2406
- *
2407
- * @private
2408
- * @param {*} value The value to check.
2409
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2410
- */
2411
- function baseIsMap(value) {
2412
- return isObjectLike(value) && getTag$1(value) == mapTag$1;
2413
- }
2414
-
2415
- /* Node.js helper references. */
2416
- var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
2417
-
2418
- /**
2419
- * Checks if `value` is classified as a `Map` object.
2420
- *
2421
- * @static
2422
- * @memberOf _
2423
- * @since 4.3.0
2424
- * @category Lang
2425
- * @param {*} value The value to check.
2426
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2427
- * @example
2428
- *
2429
- * _.isMap(new Map);
2430
- * // => true
2431
- *
2432
- * _.isMap(new WeakMap);
2433
- * // => false
2434
- */
2435
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
2436
-
2437
- const isMap$1 = isMap;
2438
-
2439
- /** `Object#toString` result references. */
2440
- var setTag$1 = '[object Set]';
2441
-
2442
- /**
2443
- * The base implementation of `_.isSet` without Node.js optimizations.
2444
- *
2445
- * @private
2446
- * @param {*} value The value to check.
2447
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2448
- */
2449
- function baseIsSet(value) {
2450
- return isObjectLike(value) && getTag$1(value) == setTag$1;
2451
- }
2452
-
2453
- /* Node.js helper references. */
2454
- var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
2455
-
2456
- /**
2457
- * Checks if `value` is classified as a `Set` object.
2458
- *
2459
- * @static
2460
- * @memberOf _
2461
- * @since 4.3.0
2462
- * @category Lang
2463
- * @param {*} value The value to check.
2464
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2465
- * @example
2466
- *
2467
- * _.isSet(new Set);
2468
- * // => true
2469
- *
2470
- * _.isSet(new WeakSet);
2471
- * // => false
2472
- */
2473
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2474
-
2475
- const isSet$1 = isSet;
2476
-
2477
- /** Used to compose bitmasks for cloning. */
2478
- var CLONE_DEEP_FLAG$1 = 1,
2479
- CLONE_FLAT_FLAG = 2,
2480
- CLONE_SYMBOLS_FLAG$1 = 4;
2481
-
2482
- /** `Object#toString` result references. */
2483
- var argsTag = '[object Arguments]',
2484
- arrayTag = '[object Array]',
2485
- boolTag = '[object Boolean]',
2486
- dateTag = '[object Date]',
2487
- errorTag = '[object Error]',
2488
- funcTag = '[object Function]',
2489
- genTag = '[object GeneratorFunction]',
2490
- mapTag = '[object Map]',
2491
- numberTag = '[object Number]',
2492
- objectTag = '[object Object]',
2493
- regexpTag = '[object RegExp]',
2494
- setTag = '[object Set]',
2495
- stringTag = '[object String]',
2496
- symbolTag = '[object Symbol]',
2497
- weakMapTag = '[object WeakMap]';
2498
-
2499
- var arrayBufferTag = '[object ArrayBuffer]',
2500
- dataViewTag = '[object DataView]',
2501
- float32Tag = '[object Float32Array]',
2502
- float64Tag = '[object Float64Array]',
2503
- int8Tag = '[object Int8Array]',
2504
- int16Tag = '[object Int16Array]',
2505
- int32Tag = '[object Int32Array]',
2506
- uint8Tag = '[object Uint8Array]',
2507
- uint8ClampedTag = '[object Uint8ClampedArray]',
2508
- uint16Tag = '[object Uint16Array]',
2509
- uint32Tag = '[object Uint32Array]';
2510
-
2511
- /** Used to identify `toStringTag` values supported by `_.clone`. */
2512
- var cloneableTags = {};
2513
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
2514
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2515
- cloneableTags[boolTag] = cloneableTags[dateTag] =
2516
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2517
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2518
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
2519
- cloneableTags[numberTag] = cloneableTags[objectTag] =
2520
- cloneableTags[regexpTag] = cloneableTags[setTag] =
2521
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
2522
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2523
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2524
- cloneableTags[errorTag] = cloneableTags[funcTag] =
2525
- cloneableTags[weakMapTag] = false;
2526
-
2527
- /**
2528
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2529
- * traversed objects.
2530
- *
2531
- * @private
2532
- * @param {*} value The value to clone.
2533
- * @param {boolean} bitmask The bitmask flags.
2534
- * 1 - Deep clone
2535
- * 2 - Flatten inherited properties
2536
- * 4 - Clone symbols
2537
- * @param {Function} [customizer] The function to customize cloning.
2538
- * @param {string} [key] The key of `value`.
2539
- * @param {Object} [object] The parent object of `value`.
2540
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2541
- * @returns {*} Returns the cloned value.
2542
- */
2543
- function baseClone(value, bitmask, customizer, key, object, stack) {
2544
- var result,
2545
- isDeep = bitmask & CLONE_DEEP_FLAG$1,
2546
- isFlat = bitmask & CLONE_FLAT_FLAG,
2547
- isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2548
-
2549
- if (customizer) {
2550
- result = object ? customizer(value, key, object, stack) : customizer(value);
2551
- }
2552
- if (result !== undefined) {
2553
- return result;
2554
- }
2555
- if (!isObject$1(value)) {
2556
- return value;
2557
- }
2558
- var isArr = isArray$1(value);
2559
- if (isArr) {
2560
- result = initCloneArray(value);
2561
- if (!isDeep) {
2562
- return copyArray(value, result);
2563
- }
2564
- } else {
2565
- var tag = getTag$1(value),
2566
- isFunc = tag == funcTag || tag == genTag;
2567
-
2568
- if (isBuffer$1(value)) {
2569
- return cloneBuffer(value, isDeep);
2570
- }
2571
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2572
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
2573
- if (!isDeep) {
2574
- return isFlat
2575
- ? copySymbolsIn(value, baseAssignIn(result, value))
2576
- : copySymbols(value, baseAssign(result, value));
2577
- }
2578
- } else {
2579
- if (!cloneableTags[tag]) {
2580
- return object ? value : {};
2581
- }
2582
- result = initCloneByTag(value, tag, isDeep);
2583
- }
2584
- }
2585
- // Check for circular references and return its corresponding clone.
2586
- stack || (stack = new Stack);
2587
- var stacked = stack.get(value);
2588
- if (stacked) {
2589
- return stacked;
2590
- }
2591
- stack.set(value, result);
2592
-
2593
- if (isSet$1(value)) {
2594
- value.forEach(function(subValue) {
2595
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2596
- });
2597
- } else if (isMap$1(value)) {
2598
- value.forEach(function(subValue, key) {
2599
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2600
- });
2601
- }
2602
-
2603
- var keysFunc = isFull
2604
- ? (isFlat ? getAllKeysIn : getAllKeys)
2605
- : (isFlat ? keysIn : keys);
2606
-
2607
- var props = isArr ? undefined : keysFunc(value);
2608
- arrayEach(props || value, function(subValue, key) {
2609
- if (props) {
2610
- key = subValue;
2611
- subValue = value[key];
2612
- }
2613
- // Recursively populate clone (susceptible to call stack limits).
2614
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2615
- });
2616
- return result;
2617
- }
2618
-
2619
- /** Used to compose bitmasks for cloning. */
2620
- var CLONE_DEEP_FLAG = 1,
2621
- CLONE_SYMBOLS_FLAG = 4;
2622
-
2623
- /**
2624
- * This method is like `_.clone` except that it recursively clones `value`.
2625
- *
2626
- * @static
2627
- * @memberOf _
2628
- * @since 1.0.0
2629
- * @category Lang
2630
- * @param {*} value The value to recursively clone.
2631
- * @returns {*} Returns the deep cloned value.
2632
- * @see _.clone
2633
- * @example
2634
- *
2635
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
2636
- *
2637
- * var deep = _.cloneDeep(objects);
2638
- * console.log(deep[0] === objects[0]);
2639
- * // => false
2640
- */
2641
- function cloneDeep(value) {
2642
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2643
- }
2644
-
2645
- /**
2646
- * The base implementation of `_.set`.
2647
- *
2648
- * @private
2649
- * @param {Object} object The object to modify.
2650
- * @param {Array|string} path The path of the property to set.
2651
- * @param {*} value The value to set.
2652
- * @param {Function} [customizer] The function to customize path creation.
2653
- * @returns {Object} Returns `object`.
2654
- */
2655
- function baseSet(object, path, value, customizer) {
2656
- if (!isObject$1(object)) {
2657
- return object;
2658
- }
2659
- path = castPath(path, object);
2660
-
2661
- var index = -1,
2662
- length = path.length,
2663
- lastIndex = length - 1,
2664
- nested = object;
2665
-
2666
- while (nested != null && ++index < length) {
2667
- var key = toKey(path[index]),
2668
- newValue = value;
2669
-
2670
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
2671
- return object;
2672
- }
2673
-
2674
- if (index != lastIndex) {
2675
- var objValue = nested[key];
2676
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
2677
- if (newValue === undefined) {
2678
- newValue = isObject$1(objValue)
2679
- ? objValue
2680
- : (isIndex(path[index + 1]) ? [] : {});
2681
- }
2682
- }
2683
- assignValue(nested, key, newValue);
2684
- nested = nested[key];
2685
- }
2686
- return object;
2687
- }
2688
-
2689
- /**
2690
- * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
2691
- * it's created. Arrays are created for missing index properties while objects
2692
- * are created for all other missing properties. Use `_.setWith` to customize
2693
- * `path` creation.
2694
- *
2695
- * **Note:** This method mutates `object`.
2696
- *
2697
- * @static
2698
- * @memberOf _
2699
- * @since 3.7.0
2700
- * @category Object
2701
- * @param {Object} object The object to modify.
2702
- * @param {Array|string} path The path of the property to set.
2703
- * @param {*} value The value to set.
2704
- * @returns {Object} Returns `object`.
2705
- * @example
2706
- *
2707
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2708
- *
2709
- * _.set(object, 'a[0].b.c', 4);
2710
- * console.log(object.a[0].b.c);
2711
- * // => 4
2712
- *
2713
- * _.set(object, ['x', '0', 'y', 'z'], 5);
2714
- * console.log(object.x[0].y.z);
2715
- * // => 5
2716
- */
2717
- function set(object, path, value) {
2718
- return object == null ? object : baseSet(object, path, value);
2719
- }
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('dayjs'), require('dayjs/plugin/utc'), require('lodash-es'), require('@tmagic/schema')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'dayjs', 'dayjs/plugin/utc', 'lodash-es', '@tmagic/schema'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicUtils = {}, global.dayjs, global.utc, global.lodashEs, global.schema));
5
+ })(this, (function (exports, dayjs, utc, lodashEs, schema) { 'use strict';
2720
6
 
2721
7
  const asyncLoadJs = /* @__PURE__ */ (() => {
2722
8
  const documentMap = /* @__PURE__ */ new Map();
@@ -2906,8 +192,8 @@
2906
192
  const v = c === "x" ? r : r & 3 | 8;
2907
193
  return v.toString(16);
2908
194
  });
2909
- const getValueByKeyPath = (keys, data = {}) => get(data, keys);
2910
- const setValueByKeyPath = (keys, value, data = {}) => set(data, keys, value);
195
+ const getValueByKeyPath = (keys, data = {}) => lodashEs.get(data, keys);
196
+ const setValueByKeyPath = (keys, value, data = {}) => lodashEs.set(data, keys, value);
2911
197
  const getNodes = (ids, data = []) => {
2912
198
  const nodes = [];
2913
199
  const get = function(ids2, data2) {
@@ -3046,7 +332,7 @@
3046
332
  data[field.name] = defaultValue.object;
3047
333
  return;
3048
334
  }
3049
- data[field.name] = cloneDeep(field.defaultValue);
335
+ data[field.name] = lodashEs.cloneDeep(field.defaultValue);
3050
336
  return;
3051
337
  }
3052
338
  if (field.type === "object") {