redux-astroglide 0.1.13 → 0.1.14

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.es.js CHANGED
@@ -1,3945 +1 @@
1
- import { bindActionCreators, combineReducers, createDraftSafeSelector, configureStore, createSlice } from '@reduxjs/toolkit';
2
- import { useDispatch, useSelector, shallowEqual } from 'react-redux';
3
- import { injectableMiddleware, injectMiddleware } from 'redux-injectable-middleware';
4
- import { useMemo } from 'react';
5
-
6
- function ownKeys(object, enumerableOnly) {
7
- var keys = Object.keys(object);
8
- if (Object.getOwnPropertySymbols) {
9
- var symbols = Object.getOwnPropertySymbols(object);
10
- enumerableOnly && (symbols = symbols.filter(function (sym) {
11
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
12
- })), keys.push.apply(keys, symbols);
13
- }
14
- return keys;
15
- }
16
- function _objectSpread2(target) {
17
- for (var i = 1; i < arguments.length; i++) {
18
- var source = null != arguments[i] ? arguments[i] : {};
19
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
20
- _defineProperty(target, key, source[key]);
21
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
22
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
23
- });
24
- }
25
- return target;
26
- }
27
- function _typeof(obj) {
28
- "@babel/helpers - typeof";
29
-
30
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
31
- return typeof obj;
32
- } : function (obj) {
33
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
34
- }, _typeof(obj);
35
- }
36
- function _classCallCheck(instance, Constructor) {
37
- if (!(instance instanceof Constructor)) {
38
- throw new TypeError("Cannot call a class as a function");
39
- }
40
- }
41
- function _defineProperties(target, props) {
42
- for (var i = 0; i < props.length; i++) {
43
- var descriptor = props[i];
44
- descriptor.enumerable = descriptor.enumerable || false;
45
- descriptor.configurable = true;
46
- if ("value" in descriptor) descriptor.writable = true;
47
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
48
- }
49
- }
50
- function _createClass(Constructor, protoProps, staticProps) {
51
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
52
- if (staticProps) _defineProperties(Constructor, staticProps);
53
- Object.defineProperty(Constructor, "prototype", {
54
- writable: false
55
- });
56
- return Constructor;
57
- }
58
- function _defineProperty(obj, key, value) {
59
- key = _toPropertyKey(key);
60
- if (key in obj) {
61
- Object.defineProperty(obj, key, {
62
- value: value,
63
- enumerable: true,
64
- configurable: true,
65
- writable: true
66
- });
67
- } else {
68
- obj[key] = value;
69
- }
70
- return obj;
71
- }
72
- function _setPrototypeOf(o, p) {
73
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
74
- o.__proto__ = p;
75
- return o;
76
- };
77
- return _setPrototypeOf(o, p);
78
- }
79
- function _isNativeReflectConstruct() {
80
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
81
- if (Reflect.construct.sham) return false;
82
- if (typeof Proxy === "function") return true;
83
- try {
84
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
85
- return true;
86
- } catch (e) {
87
- return false;
88
- }
89
- }
90
- function _construct(Parent, args, Class) {
91
- if (_isNativeReflectConstruct()) {
92
- _construct = Reflect.construct.bind();
93
- } else {
94
- _construct = function _construct(Parent, args, Class) {
95
- var a = [null];
96
- a.push.apply(a, args);
97
- var Constructor = Function.bind.apply(Parent, a);
98
- var instance = new Constructor();
99
- if (Class) _setPrototypeOf(instance, Class.prototype);
100
- return instance;
101
- };
102
- }
103
- return _construct.apply(null, arguments);
104
- }
105
- function _objectDestructuringEmpty(obj) {
106
- if (obj == null) throw new TypeError("Cannot destructure " + obj);
107
- }
108
- function _objectWithoutPropertiesLoose(source, excluded) {
109
- if (source == null) return {};
110
- var target = {};
111
- var sourceKeys = Object.keys(source);
112
- var key, i;
113
- for (i = 0; i < sourceKeys.length; i++) {
114
- key = sourceKeys[i];
115
- if (excluded.indexOf(key) >= 0) continue;
116
- target[key] = source[key];
117
- }
118
- return target;
119
- }
120
- function _objectWithoutProperties(source, excluded) {
121
- if (source == null) return {};
122
- var target = _objectWithoutPropertiesLoose(source, excluded);
123
- var key, i;
124
- if (Object.getOwnPropertySymbols) {
125
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
126
- for (i = 0; i < sourceSymbolKeys.length; i++) {
127
- key = sourceSymbolKeys[i];
128
- if (excluded.indexOf(key) >= 0) continue;
129
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
130
- target[key] = source[key];
131
- }
132
- }
133
- return target;
134
- }
135
- function _toConsumableArray(arr) {
136
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
137
- }
138
- function _arrayWithoutHoles(arr) {
139
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
140
- }
141
- function _iterableToArray(iter) {
142
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
143
- }
144
- function _unsupportedIterableToArray(o, minLen) {
145
- if (!o) return;
146
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
147
- var n = Object.prototype.toString.call(o).slice(8, -1);
148
- if (n === "Object" && o.constructor) n = o.constructor.name;
149
- if (n === "Map" || n === "Set") return Array.from(o);
150
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
151
- }
152
- function _arrayLikeToArray(arr, len) {
153
- if (len == null || len > arr.length) len = arr.length;
154
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
155
- return arr2;
156
- }
157
- function _nonIterableSpread() {
158
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
159
- }
160
- function _toPrimitive(input, hint) {
161
- if (typeof input !== "object" || input === null) return input;
162
- var prim = input[Symbol.toPrimitive];
163
- if (prim !== undefined) {
164
- var res = prim.call(input, hint || "default");
165
- if (typeof res !== "object") return res;
166
- throw new TypeError("@@toPrimitive must return a primitive value.");
167
- }
168
- return (hint === "string" ? String : Number)(input);
169
- }
170
- function _toPropertyKey(arg) {
171
- var key = _toPrimitive(arg, "string");
172
- return typeof key === "symbol" ? key : String(key);
173
- }
174
-
175
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
176
-
177
- /**
178
- * A specialized version of `_.map` for arrays without support for iteratee
179
- * shorthands.
180
- *
181
- * @private
182
- * @param {Array} [array] The array to iterate over.
183
- * @param {Function} iteratee The function invoked per iteration.
184
- * @returns {Array} Returns the new mapped array.
185
- */
186
- function arrayMap$2(array, iteratee) {
187
- var index = -1,
188
- length = array == null ? 0 : array.length,
189
- result = Array(length);
190
- while (++index < length) {
191
- result[index] = iteratee(array[index], index, array);
192
- }
193
- return result;
194
- }
195
- var _arrayMap = arrayMap$2;
196
-
197
- /**
198
- * Removes all key-value entries from the list cache.
199
- *
200
- * @private
201
- * @name clear
202
- * @memberOf ListCache
203
- */
204
- function listCacheClear$1() {
205
- this.__data__ = [];
206
- this.size = 0;
207
- }
208
- var _listCacheClear = listCacheClear$1;
209
-
210
- /**
211
- * Performs a
212
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
213
- * comparison between two values to determine if they are equivalent.
214
- *
215
- * @static
216
- * @memberOf _
217
- * @since 4.0.0
218
- * @category Lang
219
- * @param {*} value The value to compare.
220
- * @param {*} other The other value to compare.
221
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
222
- * @example
223
- *
224
- * var object = { 'a': 1 };
225
- * var other = { 'a': 1 };
226
- *
227
- * _.eq(object, object);
228
- * // => true
229
- *
230
- * _.eq(object, other);
231
- * // => false
232
- *
233
- * _.eq('a', 'a');
234
- * // => true
235
- *
236
- * _.eq('a', Object('a'));
237
- * // => false
238
- *
239
- * _.eq(NaN, NaN);
240
- * // => true
241
- */
242
- function eq$2(value, other) {
243
- return value === other || value !== value && other !== other;
244
- }
245
- var eq_1 = eq$2;
246
-
247
- var eq$1 = eq_1;
248
-
249
- /**
250
- * Gets the index at which the `key` is found in `array` of key-value pairs.
251
- *
252
- * @private
253
- * @param {Array} array The array to inspect.
254
- * @param {*} key The key to search for.
255
- * @returns {number} Returns the index of the matched value, else `-1`.
256
- */
257
- function assocIndexOf$4(array, key) {
258
- var length = array.length;
259
- while (length--) {
260
- if (eq$1(array[length][0], key)) {
261
- return length;
262
- }
263
- }
264
- return -1;
265
- }
266
- var _assocIndexOf = assocIndexOf$4;
267
-
268
- var assocIndexOf$3 = _assocIndexOf;
269
-
270
- /** Used for built-in method references. */
271
- var arrayProto = Array.prototype;
272
-
273
- /** Built-in value references. */
274
- var splice = arrayProto.splice;
275
-
276
- /**
277
- * Removes `key` and its value from the list cache.
278
- *
279
- * @private
280
- * @name delete
281
- * @memberOf ListCache
282
- * @param {string} key The key of the value to remove.
283
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
284
- */
285
- function listCacheDelete$1(key) {
286
- var data = this.__data__,
287
- index = assocIndexOf$3(data, key);
288
- if (index < 0) {
289
- return false;
290
- }
291
- var lastIndex = data.length - 1;
292
- if (index == lastIndex) {
293
- data.pop();
294
- } else {
295
- splice.call(data, index, 1);
296
- }
297
- --this.size;
298
- return true;
299
- }
300
- var _listCacheDelete = listCacheDelete$1;
301
-
302
- var assocIndexOf$2 = _assocIndexOf;
303
-
304
- /**
305
- * Gets the list cache value for `key`.
306
- *
307
- * @private
308
- * @name get
309
- * @memberOf ListCache
310
- * @param {string} key The key of the value to get.
311
- * @returns {*} Returns the entry value.
312
- */
313
- function listCacheGet$1(key) {
314
- var data = this.__data__,
315
- index = assocIndexOf$2(data, key);
316
- return index < 0 ? undefined : data[index][1];
317
- }
318
- var _listCacheGet = listCacheGet$1;
319
-
320
- var assocIndexOf$1 = _assocIndexOf;
321
-
322
- /**
323
- * Checks if a list cache value for `key` exists.
324
- *
325
- * @private
326
- * @name has
327
- * @memberOf ListCache
328
- * @param {string} key The key of the entry to check.
329
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
330
- */
331
- function listCacheHas$1(key) {
332
- return assocIndexOf$1(this.__data__, key) > -1;
333
- }
334
- var _listCacheHas = listCacheHas$1;
335
-
336
- var assocIndexOf = _assocIndexOf;
337
-
338
- /**
339
- * Sets the list cache `key` to `value`.
340
- *
341
- * @private
342
- * @name set
343
- * @memberOf ListCache
344
- * @param {string} key The key of the value to set.
345
- * @param {*} value The value to set.
346
- * @returns {Object} Returns the list cache instance.
347
- */
348
- function listCacheSet$1(key, value) {
349
- var data = this.__data__,
350
- index = assocIndexOf(data, key);
351
- if (index < 0) {
352
- ++this.size;
353
- data.push([key, value]);
354
- } else {
355
- data[index][1] = value;
356
- }
357
- return this;
358
- }
359
- var _listCacheSet = listCacheSet$1;
360
-
361
- var listCacheClear = _listCacheClear,
362
- listCacheDelete = _listCacheDelete,
363
- listCacheGet = _listCacheGet,
364
- listCacheHas = _listCacheHas,
365
- listCacheSet = _listCacheSet;
366
-
367
- /**
368
- * Creates an list cache object.
369
- *
370
- * @private
371
- * @constructor
372
- * @param {Array} [entries] The key-value pairs to cache.
373
- */
374
- function ListCache$4(entries) {
375
- var index = -1,
376
- length = entries == null ? 0 : entries.length;
377
- this.clear();
378
- while (++index < length) {
379
- var entry = entries[index];
380
- this.set(entry[0], entry[1]);
381
- }
382
- }
383
-
384
- // Add methods to `ListCache`.
385
- ListCache$4.prototype.clear = listCacheClear;
386
- ListCache$4.prototype['delete'] = listCacheDelete;
387
- ListCache$4.prototype.get = listCacheGet;
388
- ListCache$4.prototype.has = listCacheHas;
389
- ListCache$4.prototype.set = listCacheSet;
390
- var _ListCache = ListCache$4;
391
-
392
- var ListCache$3 = _ListCache;
393
-
394
- /**
395
- * Removes all key-value entries from the stack.
396
- *
397
- * @private
398
- * @name clear
399
- * @memberOf Stack
400
- */
401
- function stackClear$1() {
402
- this.__data__ = new ListCache$3();
403
- this.size = 0;
404
- }
405
- var _stackClear = stackClear$1;
406
-
407
- /**
408
- * Removes `key` and its value from the stack.
409
- *
410
- * @private
411
- * @name delete
412
- * @memberOf Stack
413
- * @param {string} key The key of the value to remove.
414
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
415
- */
416
- function stackDelete$1(key) {
417
- var data = this.__data__,
418
- result = data['delete'](key);
419
- this.size = data.size;
420
- return result;
421
- }
422
- var _stackDelete = stackDelete$1;
423
-
424
- /**
425
- * Gets the stack value for `key`.
426
- *
427
- * @private
428
- * @name get
429
- * @memberOf Stack
430
- * @param {string} key The key of the value to get.
431
- * @returns {*} Returns the entry value.
432
- */
433
- function stackGet$1(key) {
434
- return this.__data__.get(key);
435
- }
436
- var _stackGet = stackGet$1;
437
-
438
- /**
439
- * Checks if a stack value for `key` exists.
440
- *
441
- * @private
442
- * @name has
443
- * @memberOf Stack
444
- * @param {string} key The key of the entry to check.
445
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
446
- */
447
- function stackHas$1(key) {
448
- return this.__data__.has(key);
449
- }
450
- var _stackHas = stackHas$1;
451
-
452
- /** Detect free variable `global` from Node.js. */
453
- var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
454
- var _freeGlobal = freeGlobal$1;
455
-
456
- var freeGlobal = _freeGlobal;
457
-
458
- /** Detect free variable `self`. */
459
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
460
-
461
- /** Used as a reference to the global object. */
462
- var root$8 = freeGlobal || freeSelf || Function('return this')();
463
- var _root = root$8;
464
-
465
- var root$7 = _root;
466
-
467
- /** Built-in value references. */
468
- var Symbol$5 = root$7.Symbol;
469
- var _Symbol = Symbol$5;
470
-
471
- var Symbol$4 = _Symbol;
472
-
473
- /** Used for built-in method references. */
474
- var objectProto$b = Object.prototype;
475
-
476
- /** Used to check objects for own properties. */
477
- var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
478
-
479
- /**
480
- * Used to resolve the
481
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
482
- * of values.
483
- */
484
- var nativeObjectToString$1 = objectProto$b.toString;
485
-
486
- /** Built-in value references. */
487
- var symToStringTag$1 = Symbol$4 ? Symbol$4.toStringTag : undefined;
488
-
489
- /**
490
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
491
- *
492
- * @private
493
- * @param {*} value The value to query.
494
- * @returns {string} Returns the raw `toStringTag`.
495
- */
496
- function getRawTag$1(value) {
497
- var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
498
- tag = value[symToStringTag$1];
499
- try {
500
- value[symToStringTag$1] = undefined;
501
- var unmasked = true;
502
- } catch (e) {}
503
- var result = nativeObjectToString$1.call(value);
504
- if (unmasked) {
505
- if (isOwn) {
506
- value[symToStringTag$1] = tag;
507
- } else {
508
- delete value[symToStringTag$1];
509
- }
510
- }
511
- return result;
512
- }
513
- var _getRawTag = getRawTag$1;
514
-
515
- /** Used for built-in method references. */
516
- var objectProto$a = Object.prototype;
517
-
518
- /**
519
- * Used to resolve the
520
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
521
- * of values.
522
- */
523
- var nativeObjectToString = objectProto$a.toString;
524
-
525
- /**
526
- * Converts `value` to a string using `Object.prototype.toString`.
527
- *
528
- * @private
529
- * @param {*} value The value to convert.
530
- * @returns {string} Returns the converted string.
531
- */
532
- function objectToString$1(value) {
533
- return nativeObjectToString.call(value);
534
- }
535
- var _objectToString = objectToString$1;
536
-
537
- var Symbol$3 = _Symbol,
538
- getRawTag = _getRawTag,
539
- objectToString = _objectToString;
540
-
541
- /** `Object#toString` result references. */
542
- var nullTag = '[object Null]',
543
- undefinedTag = '[object Undefined]';
544
-
545
- /** Built-in value references. */
546
- var symToStringTag = Symbol$3 ? Symbol$3.toStringTag : undefined;
547
-
548
- /**
549
- * The base implementation of `getTag` without fallbacks for buggy environments.
550
- *
551
- * @private
552
- * @param {*} value The value to query.
553
- * @returns {string} Returns the `toStringTag`.
554
- */
555
- function baseGetTag$5(value) {
556
- if (value == null) {
557
- return value === undefined ? undefinedTag : nullTag;
558
- }
559
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
560
- }
561
- var _baseGetTag = baseGetTag$5;
562
-
563
- /**
564
- * Checks if `value` is the
565
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
566
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
567
- *
568
- * @static
569
- * @memberOf _
570
- * @since 0.1.0
571
- * @category Lang
572
- * @param {*} value The value to check.
573
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
574
- * @example
575
- *
576
- * _.isObject({});
577
- * // => true
578
- *
579
- * _.isObject([1, 2, 3]);
580
- * // => true
581
- *
582
- * _.isObject(_.noop);
583
- * // => true
584
- *
585
- * _.isObject(null);
586
- * // => false
587
- */
588
- function isObject$3(value) {
589
- var type = typeof value;
590
- return value != null && (type == 'object' || type == 'function');
591
- }
592
- var isObject_1 = isObject$3;
593
-
594
- var baseGetTag$4 = _baseGetTag,
595
- isObject$2 = isObject_1;
596
-
597
- /** `Object#toString` result references. */
598
- var asyncTag = '[object AsyncFunction]',
599
- funcTag$1 = '[object Function]',
600
- genTag = '[object GeneratorFunction]',
601
- proxyTag = '[object Proxy]';
602
-
603
- /**
604
- * Checks if `value` is classified as a `Function` object.
605
- *
606
- * @static
607
- * @memberOf _
608
- * @since 0.1.0
609
- * @category Lang
610
- * @param {*} value The value to check.
611
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
612
- * @example
613
- *
614
- * _.isFunction(_);
615
- * // => true
616
- *
617
- * _.isFunction(/abc/);
618
- * // => false
619
- */
620
- function isFunction$2(value) {
621
- if (!isObject$2(value)) {
622
- return false;
623
- }
624
- // The use of `Object#toString` avoids issues with the `typeof` operator
625
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
626
- var tag = baseGetTag$4(value);
627
- return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
628
- }
629
- var isFunction_1 = isFunction$2;
630
-
631
- var root$6 = _root;
632
-
633
- /** Used to detect overreaching core-js shims. */
634
- var coreJsData$1 = root$6['__core-js_shared__'];
635
- var _coreJsData = coreJsData$1;
636
-
637
- var coreJsData = _coreJsData;
638
-
639
- /** Used to detect methods masquerading as native. */
640
- var maskSrcKey = function () {
641
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
642
- return uid ? 'Symbol(src)_1.' + uid : '';
643
- }();
644
-
645
- /**
646
- * Checks if `func` has its source masked.
647
- *
648
- * @private
649
- * @param {Function} func The function to check.
650
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
651
- */
652
- function isMasked$1(func) {
653
- return !!maskSrcKey && maskSrcKey in func;
654
- }
655
- var _isMasked = isMasked$1;
656
-
657
- /** Used for built-in method references. */
658
- var funcProto$1 = Function.prototype;
659
-
660
- /** Used to resolve the decompiled source of functions. */
661
- var funcToString$1 = funcProto$1.toString;
662
-
663
- /**
664
- * Converts `func` to its source code.
665
- *
666
- * @private
667
- * @param {Function} func The function to convert.
668
- * @returns {string} Returns the source code.
669
- */
670
- function toSource$2(func) {
671
- if (func != null) {
672
- try {
673
- return funcToString$1.call(func);
674
- } catch (e) {}
675
- try {
676
- return func + '';
677
- } catch (e) {}
678
- }
679
- return '';
680
- }
681
- var _toSource = toSource$2;
682
-
683
- var isFunction$1 = isFunction_1,
684
- isMasked = _isMasked,
685
- isObject$1 = isObject_1,
686
- toSource$1 = _toSource;
687
-
688
- /**
689
- * Used to match `RegExp`
690
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
691
- */
692
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
693
-
694
- /** Used to detect host constructors (Safari). */
695
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
696
-
697
- /** Used for built-in method references. */
698
- var funcProto = Function.prototype,
699
- objectProto$9 = Object.prototype;
700
-
701
- /** Used to resolve the decompiled source of functions. */
702
- var funcToString = funcProto.toString;
703
-
704
- /** Used to check objects for own properties. */
705
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
706
-
707
- /** Used to detect if a method is native. */
708
- var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
709
-
710
- /**
711
- * The base implementation of `_.isNative` without bad shim checks.
712
- *
713
- * @private
714
- * @param {*} value The value to check.
715
- * @returns {boolean} Returns `true` if `value` is a native function,
716
- * else `false`.
717
- */
718
- function baseIsNative$1(value) {
719
- if (!isObject$1(value) || isMasked(value)) {
720
- return false;
721
- }
722
- var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
723
- return pattern.test(toSource$1(value));
724
- }
725
- var _baseIsNative = baseIsNative$1;
726
-
727
- /**
728
- * Gets the value at `key` of `object`.
729
- *
730
- * @private
731
- * @param {Object} [object] The object to query.
732
- * @param {string} key The key of the property to get.
733
- * @returns {*} Returns the property value.
734
- */
735
- function getValue$1(object, key) {
736
- return object == null ? undefined : object[key];
737
- }
738
- var _getValue = getValue$1;
739
-
740
- var baseIsNative = _baseIsNative,
741
- getValue = _getValue;
742
-
743
- /**
744
- * Gets the native function at `key` of `object`.
745
- *
746
- * @private
747
- * @param {Object} object The object to query.
748
- * @param {string} key The key of the method to get.
749
- * @returns {*} Returns the function if it's native, else `undefined`.
750
- */
751
- function getNative$6(object, key) {
752
- var value = getValue(object, key);
753
- return baseIsNative(value) ? value : undefined;
754
- }
755
- var _getNative = getNative$6;
756
-
757
- var getNative$5 = _getNative,
758
- root$5 = _root;
759
-
760
- /* Built-in method references that are verified to be native. */
761
- var Map$3 = getNative$5(root$5, 'Map');
762
- var _Map = Map$3;
763
-
764
- var getNative$4 = _getNative;
765
-
766
- /* Built-in method references that are verified to be native. */
767
- var nativeCreate$4 = getNative$4(Object, 'create');
768
- var _nativeCreate = nativeCreate$4;
769
-
770
- var nativeCreate$3 = _nativeCreate;
771
-
772
- /**
773
- * Removes all key-value entries from the hash.
774
- *
775
- * @private
776
- * @name clear
777
- * @memberOf Hash
778
- */
779
- function hashClear$1() {
780
- this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
781
- this.size = 0;
782
- }
783
- var _hashClear = hashClear$1;
784
-
785
- /**
786
- * Removes `key` and its value from the hash.
787
- *
788
- * @private
789
- * @name delete
790
- * @memberOf Hash
791
- * @param {Object} hash The hash to modify.
792
- * @param {string} key The key of the value to remove.
793
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
794
- */
795
- function hashDelete$1(key) {
796
- var result = this.has(key) && delete this.__data__[key];
797
- this.size -= result ? 1 : 0;
798
- return result;
799
- }
800
- var _hashDelete = hashDelete$1;
801
-
802
- var nativeCreate$2 = _nativeCreate;
803
-
804
- /** Used to stand-in for `undefined` hash values. */
805
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
806
-
807
- /** Used for built-in method references. */
808
- var objectProto$8 = Object.prototype;
809
-
810
- /** Used to check objects for own properties. */
811
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
812
-
813
- /**
814
- * Gets the hash value for `key`.
815
- *
816
- * @private
817
- * @name get
818
- * @memberOf Hash
819
- * @param {string} key The key of the value to get.
820
- * @returns {*} Returns the entry value.
821
- */
822
- function hashGet$1(key) {
823
- var data = this.__data__;
824
- if (nativeCreate$2) {
825
- var result = data[key];
826
- return result === HASH_UNDEFINED$2 ? undefined : result;
827
- }
828
- return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
829
- }
830
- var _hashGet = hashGet$1;
831
-
832
- var nativeCreate$1 = _nativeCreate;
833
-
834
- /** Used for built-in method references. */
835
- var objectProto$7 = Object.prototype;
836
-
837
- /** Used to check objects for own properties. */
838
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
839
-
840
- /**
841
- * Checks if a hash value for `key` exists.
842
- *
843
- * @private
844
- * @name has
845
- * @memberOf Hash
846
- * @param {string} key The key of the entry to check.
847
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
848
- */
849
- function hashHas$1(key) {
850
- var data = this.__data__;
851
- return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty$5.call(data, key);
852
- }
853
- var _hashHas = hashHas$1;
854
-
855
- var nativeCreate = _nativeCreate;
856
-
857
- /** Used to stand-in for `undefined` hash values. */
858
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
859
-
860
- /**
861
- * Sets the hash `key` to `value`.
862
- *
863
- * @private
864
- * @name set
865
- * @memberOf Hash
866
- * @param {string} key The key of the value to set.
867
- * @param {*} value The value to set.
868
- * @returns {Object} Returns the hash instance.
869
- */
870
- function hashSet$1(key, value) {
871
- var data = this.__data__;
872
- this.size += this.has(key) ? 0 : 1;
873
- data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
874
- return this;
875
- }
876
- var _hashSet = hashSet$1;
877
-
878
- var hashClear = _hashClear,
879
- hashDelete = _hashDelete,
880
- hashGet = _hashGet,
881
- hashHas = _hashHas,
882
- hashSet = _hashSet;
883
-
884
- /**
885
- * Creates a hash object.
886
- *
887
- * @private
888
- * @constructor
889
- * @param {Array} [entries] The key-value pairs to cache.
890
- */
891
- function Hash$1(entries) {
892
- var index = -1,
893
- length = entries == null ? 0 : entries.length;
894
- this.clear();
895
- while (++index < length) {
896
- var entry = entries[index];
897
- this.set(entry[0], entry[1]);
898
- }
899
- }
900
-
901
- // Add methods to `Hash`.
902
- Hash$1.prototype.clear = hashClear;
903
- Hash$1.prototype['delete'] = hashDelete;
904
- Hash$1.prototype.get = hashGet;
905
- Hash$1.prototype.has = hashHas;
906
- Hash$1.prototype.set = hashSet;
907
- var _Hash = Hash$1;
908
-
909
- var Hash = _Hash,
910
- ListCache$2 = _ListCache,
911
- Map$2 = _Map;
912
-
913
- /**
914
- * Removes all key-value entries from the map.
915
- *
916
- * @private
917
- * @name clear
918
- * @memberOf MapCache
919
- */
920
- function mapCacheClear$1() {
921
- this.size = 0;
922
- this.__data__ = {
923
- 'hash': new Hash(),
924
- 'map': new (Map$2 || ListCache$2)(),
925
- 'string': new Hash()
926
- };
927
- }
928
- var _mapCacheClear = mapCacheClear$1;
929
-
930
- /**
931
- * Checks if `value` is suitable for use as unique object key.
932
- *
933
- * @private
934
- * @param {*} value The value to check.
935
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
936
- */
937
- function isKeyable$1(value) {
938
- var type = typeof value;
939
- return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
940
- }
941
- var _isKeyable = isKeyable$1;
942
-
943
- var isKeyable = _isKeyable;
944
-
945
- /**
946
- * Gets the data for `map`.
947
- *
948
- * @private
949
- * @param {Object} map The map to query.
950
- * @param {string} key The reference key.
951
- * @returns {*} Returns the map data.
952
- */
953
- function getMapData$4(map, key) {
954
- var data = map.__data__;
955
- return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
956
- }
957
- var _getMapData = getMapData$4;
958
-
959
- var getMapData$3 = _getMapData;
960
-
961
- /**
962
- * Removes `key` and its value from the map.
963
- *
964
- * @private
965
- * @name delete
966
- * @memberOf MapCache
967
- * @param {string} key The key of the value to remove.
968
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
969
- */
970
- function mapCacheDelete$1(key) {
971
- var result = getMapData$3(this, key)['delete'](key);
972
- this.size -= result ? 1 : 0;
973
- return result;
974
- }
975
- var _mapCacheDelete = mapCacheDelete$1;
976
-
977
- var getMapData$2 = _getMapData;
978
-
979
- /**
980
- * Gets the map value for `key`.
981
- *
982
- * @private
983
- * @name get
984
- * @memberOf MapCache
985
- * @param {string} key The key of the value to get.
986
- * @returns {*} Returns the entry value.
987
- */
988
- function mapCacheGet$1(key) {
989
- return getMapData$2(this, key).get(key);
990
- }
991
- var _mapCacheGet = mapCacheGet$1;
992
-
993
- var getMapData$1 = _getMapData;
994
-
995
- /**
996
- * Checks if a map value for `key` exists.
997
- *
998
- * @private
999
- * @name has
1000
- * @memberOf MapCache
1001
- * @param {string} key The key of the entry to check.
1002
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1003
- */
1004
- function mapCacheHas$1(key) {
1005
- return getMapData$1(this, key).has(key);
1006
- }
1007
- var _mapCacheHas = mapCacheHas$1;
1008
-
1009
- var getMapData = _getMapData;
1010
-
1011
- /**
1012
- * Sets the map `key` to `value`.
1013
- *
1014
- * @private
1015
- * @name set
1016
- * @memberOf MapCache
1017
- * @param {string} key The key of the value to set.
1018
- * @param {*} value The value to set.
1019
- * @returns {Object} Returns the map cache instance.
1020
- */
1021
- function mapCacheSet$1(key, value) {
1022
- var data = getMapData(this, key),
1023
- size = data.size;
1024
- data.set(key, value);
1025
- this.size += data.size == size ? 0 : 1;
1026
- return this;
1027
- }
1028
- var _mapCacheSet = mapCacheSet$1;
1029
-
1030
- var mapCacheClear = _mapCacheClear,
1031
- mapCacheDelete = _mapCacheDelete,
1032
- mapCacheGet = _mapCacheGet,
1033
- mapCacheHas = _mapCacheHas,
1034
- mapCacheSet = _mapCacheSet;
1035
-
1036
- /**
1037
- * Creates a map cache object to store key-value pairs.
1038
- *
1039
- * @private
1040
- * @constructor
1041
- * @param {Array} [entries] The key-value pairs to cache.
1042
- */
1043
- function MapCache$3(entries) {
1044
- var index = -1,
1045
- length = entries == null ? 0 : entries.length;
1046
- this.clear();
1047
- while (++index < length) {
1048
- var entry = entries[index];
1049
- this.set(entry[0], entry[1]);
1050
- }
1051
- }
1052
-
1053
- // Add methods to `MapCache`.
1054
- MapCache$3.prototype.clear = mapCacheClear;
1055
- MapCache$3.prototype['delete'] = mapCacheDelete;
1056
- MapCache$3.prototype.get = mapCacheGet;
1057
- MapCache$3.prototype.has = mapCacheHas;
1058
- MapCache$3.prototype.set = mapCacheSet;
1059
- var _MapCache = MapCache$3;
1060
-
1061
- var ListCache$1 = _ListCache,
1062
- Map$1 = _Map,
1063
- MapCache$2 = _MapCache;
1064
-
1065
- /** Used as the size to enable large array optimizations. */
1066
- var LARGE_ARRAY_SIZE = 200;
1067
-
1068
- /**
1069
- * Sets the stack `key` to `value`.
1070
- *
1071
- * @private
1072
- * @name set
1073
- * @memberOf Stack
1074
- * @param {string} key The key of the value to set.
1075
- * @param {*} value The value to set.
1076
- * @returns {Object} Returns the stack cache instance.
1077
- */
1078
- function stackSet$1(key, value) {
1079
- var data = this.__data__;
1080
- if (data instanceof ListCache$1) {
1081
- var pairs = data.__data__;
1082
- if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
1083
- pairs.push([key, value]);
1084
- this.size = ++data.size;
1085
- return this;
1086
- }
1087
- data = this.__data__ = new MapCache$2(pairs);
1088
- }
1089
- data.set(key, value);
1090
- this.size = data.size;
1091
- return this;
1092
- }
1093
- var _stackSet = stackSet$1;
1094
-
1095
- var ListCache = _ListCache,
1096
- stackClear = _stackClear,
1097
- stackDelete = _stackDelete,
1098
- stackGet = _stackGet,
1099
- stackHas = _stackHas,
1100
- stackSet = _stackSet;
1101
-
1102
- /**
1103
- * Creates a stack cache object to store key-value pairs.
1104
- *
1105
- * @private
1106
- * @constructor
1107
- * @param {Array} [entries] The key-value pairs to cache.
1108
- */
1109
- function Stack$2(entries) {
1110
- var data = this.__data__ = new ListCache(entries);
1111
- this.size = data.size;
1112
- }
1113
-
1114
- // Add methods to `Stack`.
1115
- Stack$2.prototype.clear = stackClear;
1116
- Stack$2.prototype['delete'] = stackDelete;
1117
- Stack$2.prototype.get = stackGet;
1118
- Stack$2.prototype.has = stackHas;
1119
- Stack$2.prototype.set = stackSet;
1120
- var _Stack = Stack$2;
1121
-
1122
- /** Used to stand-in for `undefined` hash values. */
1123
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1124
-
1125
- /**
1126
- * Adds `value` to the array cache.
1127
- *
1128
- * @private
1129
- * @name add
1130
- * @memberOf SetCache
1131
- * @alias push
1132
- * @param {*} value The value to cache.
1133
- * @returns {Object} Returns the cache instance.
1134
- */
1135
- function setCacheAdd$1(value) {
1136
- this.__data__.set(value, HASH_UNDEFINED);
1137
- return this;
1138
- }
1139
- var _setCacheAdd = setCacheAdd$1;
1140
-
1141
- /**
1142
- * Checks if `value` is in the array cache.
1143
- *
1144
- * @private
1145
- * @name has
1146
- * @memberOf SetCache
1147
- * @param {*} value The value to search for.
1148
- * @returns {number} Returns `true` if `value` is found, else `false`.
1149
- */
1150
- function setCacheHas$1(value) {
1151
- return this.__data__.has(value);
1152
- }
1153
- var _setCacheHas = setCacheHas$1;
1154
-
1155
- var MapCache$1 = _MapCache,
1156
- setCacheAdd = _setCacheAdd,
1157
- setCacheHas = _setCacheHas;
1158
-
1159
- /**
1160
- *
1161
- * Creates an array cache object to store unique values.
1162
- *
1163
- * @private
1164
- * @constructor
1165
- * @param {Array} [values] The values to cache.
1166
- */
1167
- function SetCache$1(values) {
1168
- var index = -1,
1169
- length = values == null ? 0 : values.length;
1170
- this.__data__ = new MapCache$1();
1171
- while (++index < length) {
1172
- this.add(values[index]);
1173
- }
1174
- }
1175
-
1176
- // Add methods to `SetCache`.
1177
- SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
1178
- SetCache$1.prototype.has = setCacheHas;
1179
- var _SetCache = SetCache$1;
1180
-
1181
- /**
1182
- * A specialized version of `_.some` for arrays without support for iteratee
1183
- * shorthands.
1184
- *
1185
- * @private
1186
- * @param {Array} [array] The array to iterate over.
1187
- * @param {Function} predicate The function invoked per iteration.
1188
- * @returns {boolean} Returns `true` if any element passes the predicate check,
1189
- * else `false`.
1190
- */
1191
- function arraySome$1(array, predicate) {
1192
- var index = -1,
1193
- length = array == null ? 0 : array.length;
1194
- while (++index < length) {
1195
- if (predicate(array[index], index, array)) {
1196
- return true;
1197
- }
1198
- }
1199
- return false;
1200
- }
1201
- var _arraySome = arraySome$1;
1202
-
1203
- /**
1204
- * Checks if a `cache` value for `key` exists.
1205
- *
1206
- * @private
1207
- * @param {Object} cache The cache to query.
1208
- * @param {string} key The key of the entry to check.
1209
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1210
- */
1211
- function cacheHas$1(cache, key) {
1212
- return cache.has(key);
1213
- }
1214
- var _cacheHas = cacheHas$1;
1215
-
1216
- var SetCache = _SetCache,
1217
- arraySome = _arraySome,
1218
- cacheHas = _cacheHas;
1219
-
1220
- /** Used to compose bitmasks for value comparisons. */
1221
- var COMPARE_PARTIAL_FLAG$5 = 1,
1222
- COMPARE_UNORDERED_FLAG$3 = 2;
1223
-
1224
- /**
1225
- * A specialized version of `baseIsEqualDeep` for arrays with support for
1226
- * partial deep comparisons.
1227
- *
1228
- * @private
1229
- * @param {Array} array The array to compare.
1230
- * @param {Array} other The other array to compare.
1231
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1232
- * @param {Function} customizer The function to customize comparisons.
1233
- * @param {Function} equalFunc The function to determine equivalents of values.
1234
- * @param {Object} stack Tracks traversed `array` and `other` objects.
1235
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1236
- */
1237
- function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
1238
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
1239
- arrLength = array.length,
1240
- othLength = other.length;
1241
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1242
- return false;
1243
- }
1244
- // Check that cyclic values are equal.
1245
- var arrStacked = stack.get(array);
1246
- var othStacked = stack.get(other);
1247
- if (arrStacked && othStacked) {
1248
- return arrStacked == other && othStacked == array;
1249
- }
1250
- var index = -1,
1251
- result = true,
1252
- seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : undefined;
1253
- stack.set(array, other);
1254
- stack.set(other, array);
1255
-
1256
- // Ignore non-index properties.
1257
- while (++index < arrLength) {
1258
- var arrValue = array[index],
1259
- othValue = other[index];
1260
- if (customizer) {
1261
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
1262
- }
1263
- if (compared !== undefined) {
1264
- if (compared) {
1265
- continue;
1266
- }
1267
- result = false;
1268
- break;
1269
- }
1270
- // Recursively compare arrays (susceptible to call stack limits).
1271
- if (seen) {
1272
- if (!arraySome(other, function (othValue, othIndex) {
1273
- if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1274
- return seen.push(othIndex);
1275
- }
1276
- })) {
1277
- result = false;
1278
- break;
1279
- }
1280
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1281
- result = false;
1282
- break;
1283
- }
1284
- }
1285
- stack['delete'](array);
1286
- stack['delete'](other);
1287
- return result;
1288
- }
1289
- var _equalArrays = equalArrays$2;
1290
-
1291
- var root$4 = _root;
1292
-
1293
- /** Built-in value references. */
1294
- var Uint8Array$1 = root$4.Uint8Array;
1295
- var _Uint8Array = Uint8Array$1;
1296
-
1297
- /**
1298
- * Converts `map` to its key-value pairs.
1299
- *
1300
- * @private
1301
- * @param {Object} map The map to convert.
1302
- * @returns {Array} Returns the key-value pairs.
1303
- */
1304
- function mapToArray$1(map) {
1305
- var index = -1,
1306
- result = Array(map.size);
1307
- map.forEach(function (value, key) {
1308
- result[++index] = [key, value];
1309
- });
1310
- return result;
1311
- }
1312
- var _mapToArray = mapToArray$1;
1313
-
1314
- /**
1315
- * Converts `set` to an array of its values.
1316
- *
1317
- * @private
1318
- * @param {Object} set The set to convert.
1319
- * @returns {Array} Returns the values.
1320
- */
1321
- function setToArray$1(set) {
1322
- var index = -1,
1323
- result = Array(set.size);
1324
- set.forEach(function (value) {
1325
- result[++index] = value;
1326
- });
1327
- return result;
1328
- }
1329
- var _setToArray = setToArray$1;
1330
-
1331
- var Symbol$2 = _Symbol,
1332
- Uint8Array = _Uint8Array,
1333
- eq = eq_1,
1334
- equalArrays$1 = _equalArrays,
1335
- mapToArray = _mapToArray,
1336
- setToArray = _setToArray;
1337
-
1338
- /** Used to compose bitmasks for value comparisons. */
1339
- var COMPARE_PARTIAL_FLAG$4 = 1,
1340
- COMPARE_UNORDERED_FLAG$2 = 2;
1341
-
1342
- /** `Object#toString` result references. */
1343
- var boolTag$1 = '[object Boolean]',
1344
- dateTag$1 = '[object Date]',
1345
- errorTag$1 = '[object Error]',
1346
- mapTag$2 = '[object Map]',
1347
- numberTag$1 = '[object Number]',
1348
- regexpTag$1 = '[object RegExp]',
1349
- setTag$2 = '[object Set]',
1350
- stringTag$1 = '[object String]',
1351
- symbolTag$1 = '[object Symbol]';
1352
- var arrayBufferTag$1 = '[object ArrayBuffer]',
1353
- dataViewTag$2 = '[object DataView]';
1354
-
1355
- /** Used to convert symbols to primitives and strings. */
1356
- var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : undefined,
1357
- symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
1358
-
1359
- /**
1360
- * A specialized version of `baseIsEqualDeep` for comparing objects of
1361
- * the same `toStringTag`.
1362
- *
1363
- * **Note:** This function only supports comparing values with tags of
1364
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1365
- *
1366
- * @private
1367
- * @param {Object} object The object to compare.
1368
- * @param {Object} other The other object to compare.
1369
- * @param {string} tag The `toStringTag` of the objects to compare.
1370
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1371
- * @param {Function} customizer The function to customize comparisons.
1372
- * @param {Function} equalFunc The function to determine equivalents of values.
1373
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1374
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1375
- */
1376
- function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
1377
- switch (tag) {
1378
- case dataViewTag$2:
1379
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
1380
- return false;
1381
- }
1382
- object = object.buffer;
1383
- other = other.buffer;
1384
- case arrayBufferTag$1:
1385
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1386
- return false;
1387
- }
1388
- return true;
1389
- case boolTag$1:
1390
- case dateTag$1:
1391
- case numberTag$1:
1392
- // Coerce booleans to `1` or `0` and dates to milliseconds.
1393
- // Invalid dates are coerced to `NaN`.
1394
- return eq(+object, +other);
1395
- case errorTag$1:
1396
- return object.name == other.name && object.message == other.message;
1397
- case regexpTag$1:
1398
- case stringTag$1:
1399
- // Coerce regexes to strings and treat strings, primitives and objects,
1400
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1401
- // for more details.
1402
- return object == other + '';
1403
- case mapTag$2:
1404
- var convert = mapToArray;
1405
- case setTag$2:
1406
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
1407
- convert || (convert = setToArray);
1408
- if (object.size != other.size && !isPartial) {
1409
- return false;
1410
- }
1411
- // Assume cyclic values are equal.
1412
- var stacked = stack.get(object);
1413
- if (stacked) {
1414
- return stacked == other;
1415
- }
1416
- bitmask |= COMPARE_UNORDERED_FLAG$2;
1417
-
1418
- // Recursively compare objects (susceptible to call stack limits).
1419
- stack.set(object, other);
1420
- var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1421
- stack['delete'](object);
1422
- return result;
1423
- case symbolTag$1:
1424
- if (symbolValueOf) {
1425
- return symbolValueOf.call(object) == symbolValueOf.call(other);
1426
- }
1427
- }
1428
- return false;
1429
- }
1430
- var _equalByTag = equalByTag$1;
1431
-
1432
- /**
1433
- * Appends the elements of `values` to `array`.
1434
- *
1435
- * @private
1436
- * @param {Array} array The array to modify.
1437
- * @param {Array} values The values to append.
1438
- * @returns {Array} Returns `array`.
1439
- */
1440
- function arrayPush$1(array, values) {
1441
- var index = -1,
1442
- length = values.length,
1443
- offset = array.length;
1444
- while (++index < length) {
1445
- array[offset + index] = values[index];
1446
- }
1447
- return array;
1448
- }
1449
- var _arrayPush = arrayPush$1;
1450
-
1451
- /**
1452
- * Checks if `value` is classified as an `Array` object.
1453
- *
1454
- * @static
1455
- * @memberOf _
1456
- * @since 0.1.0
1457
- * @category Lang
1458
- * @param {*} value The value to check.
1459
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1460
- * @example
1461
- *
1462
- * _.isArray([1, 2, 3]);
1463
- * // => true
1464
- *
1465
- * _.isArray(document.body.children);
1466
- * // => false
1467
- *
1468
- * _.isArray('abc');
1469
- * // => false
1470
- *
1471
- * _.isArray(_.noop);
1472
- * // => false
1473
- */
1474
- var isArray$a = Array.isArray;
1475
- var isArray_1 = isArray$a;
1476
-
1477
- var arrayPush = _arrayPush,
1478
- isArray$9 = isArray_1;
1479
-
1480
- /**
1481
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1482
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1483
- * symbols of `object`.
1484
- *
1485
- * @private
1486
- * @param {Object} object The object to query.
1487
- * @param {Function} keysFunc The function to get the keys of `object`.
1488
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1489
- * @returns {Array} Returns the array of property names and symbols.
1490
- */
1491
- function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
1492
- var result = keysFunc(object);
1493
- return isArray$9(object) ? result : arrayPush(result, symbolsFunc(object));
1494
- }
1495
- var _baseGetAllKeys = baseGetAllKeys$1;
1496
-
1497
- /**
1498
- * A specialized version of `_.filter` for arrays without support for
1499
- * iteratee shorthands.
1500
- *
1501
- * @private
1502
- * @param {Array} [array] The array to iterate over.
1503
- * @param {Function} predicate The function invoked per iteration.
1504
- * @returns {Array} Returns the new filtered array.
1505
- */
1506
- function arrayFilter$1(array, predicate) {
1507
- var index = -1,
1508
- length = array == null ? 0 : array.length,
1509
- resIndex = 0,
1510
- result = [];
1511
- while (++index < length) {
1512
- var value = array[index];
1513
- if (predicate(value, index, array)) {
1514
- result[resIndex++] = value;
1515
- }
1516
- }
1517
- return result;
1518
- }
1519
- var _arrayFilter = arrayFilter$1;
1520
-
1521
- /**
1522
- * This method returns a new empty array.
1523
- *
1524
- * @static
1525
- * @memberOf _
1526
- * @since 4.13.0
1527
- * @category Util
1528
- * @returns {Array} Returns the new empty array.
1529
- * @example
1530
- *
1531
- * var arrays = _.times(2, _.stubArray);
1532
- *
1533
- * console.log(arrays);
1534
- * // => [[], []]
1535
- *
1536
- * console.log(arrays[0] === arrays[1]);
1537
- * // => false
1538
- */
1539
- function stubArray$1() {
1540
- return [];
1541
- }
1542
- var stubArray_1 = stubArray$1;
1543
-
1544
- var arrayFilter = _arrayFilter,
1545
- stubArray = stubArray_1;
1546
-
1547
- /** Used for built-in method references. */
1548
- var objectProto$6 = Object.prototype;
1549
-
1550
- /** Built-in value references. */
1551
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
1552
-
1553
- /* Built-in method references for those with the same name as other `lodash` methods. */
1554
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1555
-
1556
- /**
1557
- * Creates an array of the own enumerable symbols of `object`.
1558
- *
1559
- * @private
1560
- * @param {Object} object The object to query.
1561
- * @returns {Array} Returns the array of symbols.
1562
- */
1563
- var getSymbols$1 = !nativeGetSymbols ? stubArray : function (object) {
1564
- if (object == null) {
1565
- return [];
1566
- }
1567
- object = Object(object);
1568
- return arrayFilter(nativeGetSymbols(object), function (symbol) {
1569
- return propertyIsEnumerable$1.call(object, symbol);
1570
- });
1571
- };
1572
- var _getSymbols = getSymbols$1;
1573
-
1574
- /**
1575
- * The base implementation of `_.times` without support for iteratee shorthands
1576
- * or max array length checks.
1577
- *
1578
- * @private
1579
- * @param {number} n The number of times to invoke `iteratee`.
1580
- * @param {Function} iteratee The function invoked per iteration.
1581
- * @returns {Array} Returns the array of results.
1582
- */
1583
- function baseTimes$1(n, iteratee) {
1584
- var index = -1,
1585
- result = Array(n);
1586
- while (++index < n) {
1587
- result[index] = iteratee(index);
1588
- }
1589
- return result;
1590
- }
1591
- var _baseTimes = baseTimes$1;
1592
-
1593
- /**
1594
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1595
- * and has a `typeof` result of "object".
1596
- *
1597
- * @static
1598
- * @memberOf _
1599
- * @since 4.0.0
1600
- * @category Lang
1601
- * @param {*} value The value to check.
1602
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1603
- * @example
1604
- *
1605
- * _.isObjectLike({});
1606
- * // => true
1607
- *
1608
- * _.isObjectLike([1, 2, 3]);
1609
- * // => true
1610
- *
1611
- * _.isObjectLike(_.noop);
1612
- * // => false
1613
- *
1614
- * _.isObjectLike(null);
1615
- * // => false
1616
- */
1617
- function isObjectLike$5(value) {
1618
- return value != null && typeof value == 'object';
1619
- }
1620
- var isObjectLike_1 = isObjectLike$5;
1621
-
1622
- var baseGetTag$3 = _baseGetTag,
1623
- isObjectLike$4 = isObjectLike_1;
1624
-
1625
- /** `Object#toString` result references. */
1626
- var argsTag$2 = '[object Arguments]';
1627
-
1628
- /**
1629
- * The base implementation of `_.isArguments`.
1630
- *
1631
- * @private
1632
- * @param {*} value The value to check.
1633
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1634
- */
1635
- function baseIsArguments$1(value) {
1636
- return isObjectLike$4(value) && baseGetTag$3(value) == argsTag$2;
1637
- }
1638
- var _baseIsArguments = baseIsArguments$1;
1639
-
1640
- var baseIsArguments = _baseIsArguments,
1641
- isObjectLike$3 = isObjectLike_1;
1642
-
1643
- /** Used for built-in method references. */
1644
- var objectProto$5 = Object.prototype;
1645
-
1646
- /** Used to check objects for own properties. */
1647
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1648
-
1649
- /** Built-in value references. */
1650
- var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
1651
-
1652
- /**
1653
- * Checks if `value` is likely an `arguments` object.
1654
- *
1655
- * @static
1656
- * @memberOf _
1657
- * @since 0.1.0
1658
- * @category Lang
1659
- * @param {*} value The value to check.
1660
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1661
- * else `false`.
1662
- * @example
1663
- *
1664
- * _.isArguments(function() { return arguments; }());
1665
- * // => true
1666
- *
1667
- * _.isArguments([1, 2, 3]);
1668
- * // => false
1669
- */
1670
- var isArguments$2 = baseIsArguments(function () {
1671
- return arguments;
1672
- }()) ? baseIsArguments : function (value) {
1673
- return isObjectLike$3(value) && hasOwnProperty$4.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
1674
- };
1675
- var isArguments_1 = isArguments$2;
1676
-
1677
- var isBuffer$2 = {exports: {}};
1678
-
1679
- /**
1680
- * This method returns `false`.
1681
- *
1682
- * @static
1683
- * @memberOf _
1684
- * @since 4.13.0
1685
- * @category Util
1686
- * @returns {boolean} Returns `false`.
1687
- * @example
1688
- *
1689
- * _.times(2, _.stubFalse);
1690
- * // => [false, false]
1691
- */
1692
- function stubFalse() {
1693
- return false;
1694
- }
1695
- var stubFalse_1 = stubFalse;
1696
-
1697
- (function (module, exports) {
1698
- var root = _root,
1699
- stubFalse = stubFalse_1;
1700
-
1701
- /** Detect free variable `exports`. */
1702
- var freeExports = exports && !exports.nodeType && exports;
1703
-
1704
- /** Detect free variable `module`. */
1705
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1706
-
1707
- /** Detect the popular CommonJS extension `module.exports`. */
1708
- var moduleExports = freeModule && freeModule.exports === freeExports;
1709
-
1710
- /** Built-in value references. */
1711
- var Buffer = moduleExports ? root.Buffer : undefined;
1712
-
1713
- /* Built-in method references for those with the same name as other `lodash` methods. */
1714
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1715
-
1716
- /**
1717
- * Checks if `value` is a buffer.
1718
- *
1719
- * @static
1720
- * @memberOf _
1721
- * @since 4.3.0
1722
- * @category Lang
1723
- * @param {*} value The value to check.
1724
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1725
- * @example
1726
- *
1727
- * _.isBuffer(new Buffer(2));
1728
- * // => true
1729
- *
1730
- * _.isBuffer(new Uint8Array(2));
1731
- * // => false
1732
- */
1733
- var isBuffer = nativeIsBuffer || stubFalse;
1734
- module.exports = isBuffer;
1735
- })(isBuffer$2, isBuffer$2.exports);
1736
-
1737
- /** Used as references for various `Number` constants. */
1738
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
1739
-
1740
- /** Used to detect unsigned integer values. */
1741
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1742
-
1743
- /**
1744
- * Checks if `value` is a valid array-like index.
1745
- *
1746
- * @private
1747
- * @param {*} value The value to check.
1748
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1749
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1750
- */
1751
- function isIndex$2(value, length) {
1752
- var type = typeof value;
1753
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
1754
- return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1755
- }
1756
- var _isIndex = isIndex$2;
1757
-
1758
- /** Used as references for various `Number` constants. */
1759
- var MAX_SAFE_INTEGER = 9007199254740991;
1760
-
1761
- /**
1762
- * Checks if `value` is a valid array-like length.
1763
- *
1764
- * **Note:** This method is loosely based on
1765
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1766
- *
1767
- * @static
1768
- * @memberOf _
1769
- * @since 4.0.0
1770
- * @category Lang
1771
- * @param {*} value The value to check.
1772
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1773
- * @example
1774
- *
1775
- * _.isLength(3);
1776
- * // => true
1777
- *
1778
- * _.isLength(Number.MIN_VALUE);
1779
- * // => false
1780
- *
1781
- * _.isLength(Infinity);
1782
- * // => false
1783
- *
1784
- * _.isLength('3');
1785
- * // => false
1786
- */
1787
- function isLength$3(value) {
1788
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1789
- }
1790
- var isLength_1 = isLength$3;
1791
-
1792
- var baseGetTag$2 = _baseGetTag,
1793
- isLength$2 = isLength_1,
1794
- isObjectLike$2 = isObjectLike_1;
1795
-
1796
- /** `Object#toString` result references. */
1797
- var argsTag$1 = '[object Arguments]',
1798
- arrayTag$1 = '[object Array]',
1799
- boolTag = '[object Boolean]',
1800
- dateTag = '[object Date]',
1801
- errorTag = '[object Error]',
1802
- funcTag = '[object Function]',
1803
- mapTag$1 = '[object Map]',
1804
- numberTag = '[object Number]',
1805
- objectTag$2 = '[object Object]',
1806
- regexpTag = '[object RegExp]',
1807
- setTag$1 = '[object Set]',
1808
- stringTag = '[object String]',
1809
- weakMapTag$1 = '[object WeakMap]';
1810
- var arrayBufferTag = '[object ArrayBuffer]',
1811
- dataViewTag$1 = '[object DataView]',
1812
- float32Tag = '[object Float32Array]',
1813
- float64Tag = '[object Float64Array]',
1814
- int8Tag = '[object Int8Array]',
1815
- int16Tag = '[object Int16Array]',
1816
- int32Tag = '[object Int32Array]',
1817
- uint8Tag = '[object Uint8Array]',
1818
- uint8ClampedTag = '[object Uint8ClampedArray]',
1819
- uint16Tag = '[object Uint16Array]',
1820
- uint32Tag = '[object Uint32Array]';
1821
-
1822
- /** Used to identify `toStringTag` values of typed arrays. */
1823
- var typedArrayTags = {};
1824
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
1825
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
1826
-
1827
- /**
1828
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1829
- *
1830
- * @private
1831
- * @param {*} value The value to check.
1832
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1833
- */
1834
- function baseIsTypedArray$1(value) {
1835
- return isObjectLike$2(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$2(value)];
1836
- }
1837
- var _baseIsTypedArray = baseIsTypedArray$1;
1838
-
1839
- /**
1840
- * The base implementation of `_.unary` without support for storing metadata.
1841
- *
1842
- * @private
1843
- * @param {Function} func The function to cap arguments for.
1844
- * @returns {Function} Returns the new capped function.
1845
- */
1846
- function baseUnary$1(func) {
1847
- return function (value) {
1848
- return func(value);
1849
- };
1850
- }
1851
- var _baseUnary = baseUnary$1;
1852
-
1853
- var _nodeUtil = {exports: {}};
1854
-
1855
- (function (module, exports) {
1856
- var freeGlobal = _freeGlobal;
1857
-
1858
- /** Detect free variable `exports`. */
1859
- var freeExports = exports && !exports.nodeType && exports;
1860
-
1861
- /** Detect free variable `module`. */
1862
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1863
-
1864
- /** Detect the popular CommonJS extension `module.exports`. */
1865
- var moduleExports = freeModule && freeModule.exports === freeExports;
1866
-
1867
- /** Detect free variable `process` from Node.js. */
1868
- var freeProcess = moduleExports && freeGlobal.process;
1869
-
1870
- /** Used to access faster Node.js helpers. */
1871
- var nodeUtil = function () {
1872
- try {
1873
- // Use `util.types` for Node.js 10+.
1874
- var types = freeModule && freeModule.require && freeModule.require('util').types;
1875
- if (types) {
1876
- return types;
1877
- }
1878
-
1879
- // Legacy `process.binding('util')` for Node.js < 10.
1880
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
1881
- } catch (e) {}
1882
- }();
1883
- module.exports = nodeUtil;
1884
- })(_nodeUtil, _nodeUtil.exports);
1885
-
1886
- var baseIsTypedArray = _baseIsTypedArray,
1887
- baseUnary = _baseUnary,
1888
- nodeUtil = _nodeUtil.exports;
1889
-
1890
- /* Node.js helper references. */
1891
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1892
-
1893
- /**
1894
- * Checks if `value` is classified as a typed array.
1895
- *
1896
- * @static
1897
- * @memberOf _
1898
- * @since 3.0.0
1899
- * @category Lang
1900
- * @param {*} value The value to check.
1901
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1902
- * @example
1903
- *
1904
- * _.isTypedArray(new Uint8Array);
1905
- * // => true
1906
- *
1907
- * _.isTypedArray([]);
1908
- * // => false
1909
- */
1910
- var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1911
- var isTypedArray_1 = isTypedArray$2;
1912
-
1913
- var baseTimes = _baseTimes,
1914
- isArguments$1 = isArguments_1,
1915
- isArray$8 = isArray_1,
1916
- isBuffer$1 = isBuffer$2.exports,
1917
- isIndex$1 = _isIndex,
1918
- isTypedArray$1 = isTypedArray_1;
1919
-
1920
- /** Used for built-in method references. */
1921
- var objectProto$4 = Object.prototype;
1922
-
1923
- /** Used to check objects for own properties. */
1924
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1925
-
1926
- /**
1927
- * Creates an array of the enumerable property names of the array-like `value`.
1928
- *
1929
- * @private
1930
- * @param {*} value The value to query.
1931
- * @param {boolean} inherited Specify returning inherited property names.
1932
- * @returns {Array} Returns the array of property names.
1933
- */
1934
- function arrayLikeKeys$1(value, inherited) {
1935
- var isArr = isArray$8(value),
1936
- isArg = !isArr && isArguments$1(value),
1937
- isBuff = !isArr && !isArg && isBuffer$1(value),
1938
- isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
1939
- skipIndexes = isArr || isArg || isBuff || isType,
1940
- result = skipIndexes ? baseTimes(value.length, String) : [],
1941
- length = result.length;
1942
- for (var key in value) {
1943
- if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && (
1944
- // Safari 9 has enumerable `arguments.length` in strict mode.
1945
- key == 'length' ||
1946
- // Node.js 0.10 has enumerable non-index properties on buffers.
1947
- isBuff && (key == 'offset' || key == 'parent') ||
1948
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1949
- isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') ||
1950
- // Skip index properties.
1951
- isIndex$1(key, length)))) {
1952
- result.push(key);
1953
- }
1954
- }
1955
- return result;
1956
- }
1957
- var _arrayLikeKeys = arrayLikeKeys$1;
1958
-
1959
- /** Used for built-in method references. */
1960
- var objectProto$3 = Object.prototype;
1961
-
1962
- /**
1963
- * Checks if `value` is likely a prototype object.
1964
- *
1965
- * @private
1966
- * @param {*} value The value to check.
1967
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1968
- */
1969
- function isPrototype$1(value) {
1970
- var Ctor = value && value.constructor,
1971
- proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$3;
1972
- return value === proto;
1973
- }
1974
- var _isPrototype = isPrototype$1;
1975
-
1976
- /**
1977
- * Creates a unary function that invokes `func` with its argument transformed.
1978
- *
1979
- * @private
1980
- * @param {Function} func The function to wrap.
1981
- * @param {Function} transform The argument transform.
1982
- * @returns {Function} Returns the new function.
1983
- */
1984
- function overArg$1(func, transform) {
1985
- return function (arg) {
1986
- return func(transform(arg));
1987
- };
1988
- }
1989
- var _overArg = overArg$1;
1990
-
1991
- var overArg = _overArg;
1992
-
1993
- /* Built-in method references for those with the same name as other `lodash` methods. */
1994
- var nativeKeys$1 = overArg(Object.keys, Object);
1995
- var _nativeKeys = nativeKeys$1;
1996
-
1997
- var isPrototype = _isPrototype,
1998
- nativeKeys = _nativeKeys;
1999
-
2000
- /** Used for built-in method references. */
2001
- var objectProto$2 = Object.prototype;
2002
-
2003
- /** Used to check objects for own properties. */
2004
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2005
-
2006
- /**
2007
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2008
- *
2009
- * @private
2010
- * @param {Object} object The object to query.
2011
- * @returns {Array} Returns the array of property names.
2012
- */
2013
- function baseKeys$1(object) {
2014
- if (!isPrototype(object)) {
2015
- return nativeKeys(object);
2016
- }
2017
- var result = [];
2018
- for (var key in Object(object)) {
2019
- if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
2020
- result.push(key);
2021
- }
2022
- }
2023
- return result;
2024
- }
2025
- var _baseKeys = baseKeys$1;
2026
-
2027
- var isFunction = isFunction_1,
2028
- isLength$1 = isLength_1;
2029
-
2030
- /**
2031
- * Checks if `value` is array-like. A value is considered array-like if it's
2032
- * not a function and has a `value.length` that's an integer greater than or
2033
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2034
- *
2035
- * @static
2036
- * @memberOf _
2037
- * @since 4.0.0
2038
- * @category Lang
2039
- * @param {*} value The value to check.
2040
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2041
- * @example
2042
- *
2043
- * _.isArrayLike([1, 2, 3]);
2044
- * // => true
2045
- *
2046
- * _.isArrayLike(document.body.children);
2047
- * // => true
2048
- *
2049
- * _.isArrayLike('abc');
2050
- * // => true
2051
- *
2052
- * _.isArrayLike(_.noop);
2053
- * // => false
2054
- */
2055
- function isArrayLike$3(value) {
2056
- return value != null && isLength$1(value.length) && !isFunction(value);
2057
- }
2058
- var isArrayLike_1 = isArrayLike$3;
2059
-
2060
- var arrayLikeKeys = _arrayLikeKeys,
2061
- baseKeys = _baseKeys,
2062
- isArrayLike$2 = isArrayLike_1;
2063
-
2064
- /**
2065
- * Creates an array of the own enumerable property names of `object`.
2066
- *
2067
- * **Note:** Non-object values are coerced to objects. See the
2068
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2069
- * for more details.
2070
- *
2071
- * @static
2072
- * @since 0.1.0
2073
- * @memberOf _
2074
- * @category Object
2075
- * @param {Object} object The object to query.
2076
- * @returns {Array} Returns the array of property names.
2077
- * @example
2078
- *
2079
- * function Foo() {
2080
- * this.a = 1;
2081
- * this.b = 2;
2082
- * }
2083
- *
2084
- * Foo.prototype.c = 3;
2085
- *
2086
- * _.keys(new Foo);
2087
- * // => ['a', 'b'] (iteration order is not guaranteed)
2088
- *
2089
- * _.keys('hi');
2090
- * // => ['0', '1']
2091
- */
2092
- function keys$3(object) {
2093
- return isArrayLike$2(object) ? arrayLikeKeys(object) : baseKeys(object);
2094
- }
2095
- var keys_1 = keys$3;
2096
-
2097
- var baseGetAllKeys = _baseGetAllKeys,
2098
- getSymbols = _getSymbols,
2099
- keys$2 = keys_1;
2100
-
2101
- /**
2102
- * Creates an array of own enumerable property names and symbols of `object`.
2103
- *
2104
- * @private
2105
- * @param {Object} object The object to query.
2106
- * @returns {Array} Returns the array of property names and symbols.
2107
- */
2108
- function getAllKeys$1(object) {
2109
- return baseGetAllKeys(object, keys$2, getSymbols);
2110
- }
2111
- var _getAllKeys = getAllKeys$1;
2112
-
2113
- var getAllKeys = _getAllKeys;
2114
-
2115
- /** Used to compose bitmasks for value comparisons. */
2116
- var COMPARE_PARTIAL_FLAG$3 = 1;
2117
-
2118
- /** Used for built-in method references. */
2119
- var objectProto$1 = Object.prototype;
2120
-
2121
- /** Used to check objects for own properties. */
2122
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2123
-
2124
- /**
2125
- * A specialized version of `baseIsEqualDeep` for objects with support for
2126
- * partial deep comparisons.
2127
- *
2128
- * @private
2129
- * @param {Object} object The object to compare.
2130
- * @param {Object} other The other object to compare.
2131
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2132
- * @param {Function} customizer The function to customize comparisons.
2133
- * @param {Function} equalFunc The function to determine equivalents of values.
2134
- * @param {Object} stack Tracks traversed `object` and `other` objects.
2135
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2136
- */
2137
- function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
2138
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
2139
- objProps = getAllKeys(object),
2140
- objLength = objProps.length,
2141
- othProps = getAllKeys(other),
2142
- othLength = othProps.length;
2143
- if (objLength != othLength && !isPartial) {
2144
- return false;
2145
- }
2146
- var index = objLength;
2147
- while (index--) {
2148
- var key = objProps[index];
2149
- if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2150
- return false;
2151
- }
2152
- }
2153
- // Check that cyclic values are equal.
2154
- var objStacked = stack.get(object);
2155
- var othStacked = stack.get(other);
2156
- if (objStacked && othStacked) {
2157
- return objStacked == other && othStacked == object;
2158
- }
2159
- var result = true;
2160
- stack.set(object, other);
2161
- stack.set(other, object);
2162
- var skipCtor = isPartial;
2163
- while (++index < objLength) {
2164
- key = objProps[index];
2165
- var objValue = object[key],
2166
- othValue = other[key];
2167
- if (customizer) {
2168
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
2169
- }
2170
- // Recursively compare objects (susceptible to call stack limits).
2171
- if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
2172
- result = false;
2173
- break;
2174
- }
2175
- skipCtor || (skipCtor = key == 'constructor');
2176
- }
2177
- if (result && !skipCtor) {
2178
- var objCtor = object.constructor,
2179
- othCtor = other.constructor;
2180
-
2181
- // Non `Object` object instances with different constructors are not equal.
2182
- if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2183
- result = false;
2184
- }
2185
- }
2186
- stack['delete'](object);
2187
- stack['delete'](other);
2188
- return result;
2189
- }
2190
- var _equalObjects = equalObjects$1;
2191
-
2192
- var getNative$3 = _getNative,
2193
- root$3 = _root;
2194
-
2195
- /* Built-in method references that are verified to be native. */
2196
- var DataView$1 = getNative$3(root$3, 'DataView');
2197
- var _DataView = DataView$1;
2198
-
2199
- var getNative$2 = _getNative,
2200
- root$2 = _root;
2201
-
2202
- /* Built-in method references that are verified to be native. */
2203
- var Promise$2 = getNative$2(root$2, 'Promise');
2204
- var _Promise = Promise$2;
2205
-
2206
- var getNative$1 = _getNative,
2207
- root$1 = _root;
2208
-
2209
- /* Built-in method references that are verified to be native. */
2210
- var Set$1 = getNative$1(root$1, 'Set');
2211
- var _Set = Set$1;
2212
-
2213
- var getNative = _getNative,
2214
- root = _root;
2215
-
2216
- /* Built-in method references that are verified to be native. */
2217
- var WeakMap$1 = getNative(root, 'WeakMap');
2218
- var _WeakMap = WeakMap$1;
2219
-
2220
- var DataView = _DataView,
2221
- Map = _Map,
2222
- Promise$1 = _Promise,
2223
- Set = _Set,
2224
- WeakMap = _WeakMap,
2225
- baseGetTag$1 = _baseGetTag,
2226
- toSource = _toSource;
2227
-
2228
- /** `Object#toString` result references. */
2229
- var mapTag = '[object Map]',
2230
- objectTag$1 = '[object Object]',
2231
- promiseTag = '[object Promise]',
2232
- setTag = '[object Set]',
2233
- weakMapTag = '[object WeakMap]';
2234
- var dataViewTag = '[object DataView]';
2235
-
2236
- /** Used to detect maps, sets, and weakmaps. */
2237
- var dataViewCtorString = toSource(DataView),
2238
- mapCtorString = toSource(Map),
2239
- promiseCtorString = toSource(Promise$1),
2240
- setCtorString = toSource(Set),
2241
- weakMapCtorString = toSource(WeakMap);
2242
-
2243
- /**
2244
- * Gets the `toStringTag` of `value`.
2245
- *
2246
- * @private
2247
- * @param {*} value The value to query.
2248
- * @returns {string} Returns the `toStringTag`.
2249
- */
2250
- var getTag$1 = baseGetTag$1;
2251
-
2252
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2253
- if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag$1(new Map()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set && getTag$1(new Set()) != setTag || WeakMap && getTag$1(new WeakMap()) != weakMapTag) {
2254
- getTag$1 = function (value) {
2255
- var result = baseGetTag$1(value),
2256
- Ctor = result == objectTag$1 ? value.constructor : undefined,
2257
- ctorString = Ctor ? toSource(Ctor) : '';
2258
- if (ctorString) {
2259
- switch (ctorString) {
2260
- case dataViewCtorString:
2261
- return dataViewTag;
2262
- case mapCtorString:
2263
- return mapTag;
2264
- case promiseCtorString:
2265
- return promiseTag;
2266
- case setCtorString:
2267
- return setTag;
2268
- case weakMapCtorString:
2269
- return weakMapTag;
2270
- }
2271
- }
2272
- return result;
2273
- };
2274
- }
2275
- var _getTag = getTag$1;
2276
-
2277
- var Stack$1 = _Stack,
2278
- equalArrays = _equalArrays,
2279
- equalByTag = _equalByTag,
2280
- equalObjects = _equalObjects,
2281
- getTag = _getTag,
2282
- isArray$7 = isArray_1,
2283
- isBuffer = isBuffer$2.exports,
2284
- isTypedArray = isTypedArray_1;
2285
-
2286
- /** Used to compose bitmasks for value comparisons. */
2287
- var COMPARE_PARTIAL_FLAG$2 = 1;
2288
-
2289
- /** `Object#toString` result references. */
2290
- var argsTag = '[object Arguments]',
2291
- arrayTag = '[object Array]',
2292
- objectTag = '[object Object]';
2293
-
2294
- /** Used for built-in method references. */
2295
- var objectProto = Object.prototype;
2296
-
2297
- /** Used to check objects for own properties. */
2298
- var hasOwnProperty = objectProto.hasOwnProperty;
2299
-
2300
- /**
2301
- * A specialized version of `baseIsEqual` for arrays and objects which performs
2302
- * deep comparisons and tracks traversed objects enabling objects with circular
2303
- * references to be compared.
2304
- *
2305
- * @private
2306
- * @param {Object} object The object to compare.
2307
- * @param {Object} other The other object to compare.
2308
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2309
- * @param {Function} customizer The function to customize comparisons.
2310
- * @param {Function} equalFunc The function to determine equivalents of values.
2311
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2312
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2313
- */
2314
- function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
2315
- var objIsArr = isArray$7(object),
2316
- othIsArr = isArray$7(other),
2317
- objTag = objIsArr ? arrayTag : getTag(object),
2318
- othTag = othIsArr ? arrayTag : getTag(other);
2319
- objTag = objTag == argsTag ? objectTag : objTag;
2320
- othTag = othTag == argsTag ? objectTag : othTag;
2321
- var objIsObj = objTag == objectTag,
2322
- othIsObj = othTag == objectTag,
2323
- isSameTag = objTag == othTag;
2324
- if (isSameTag && isBuffer(object)) {
2325
- if (!isBuffer(other)) {
2326
- return false;
2327
- }
2328
- objIsArr = true;
2329
- objIsObj = false;
2330
- }
2331
- if (isSameTag && !objIsObj) {
2332
- stack || (stack = new Stack$1());
2333
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2334
- }
2335
- if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
2336
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2337
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2338
- if (objIsWrapped || othIsWrapped) {
2339
- var objUnwrapped = objIsWrapped ? object.value() : object,
2340
- othUnwrapped = othIsWrapped ? other.value() : other;
2341
- stack || (stack = new Stack$1());
2342
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2343
- }
2344
- }
2345
- if (!isSameTag) {
2346
- return false;
2347
- }
2348
- stack || (stack = new Stack$1());
2349
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2350
- }
2351
- var _baseIsEqualDeep = baseIsEqualDeep$1;
2352
-
2353
- var baseIsEqualDeep = _baseIsEqualDeep,
2354
- isObjectLike$1 = isObjectLike_1;
2355
-
2356
- /**
2357
- * The base implementation of `_.isEqual` which supports partial comparisons
2358
- * and tracks traversed objects.
2359
- *
2360
- * @private
2361
- * @param {*} value The value to compare.
2362
- * @param {*} other The other value to compare.
2363
- * @param {boolean} bitmask The bitmask flags.
2364
- * 1 - Unordered comparison
2365
- * 2 - Partial comparison
2366
- * @param {Function} [customizer] The function to customize comparisons.
2367
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2368
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2369
- */
2370
- function baseIsEqual$2(value, other, bitmask, customizer, stack) {
2371
- if (value === other) {
2372
- return true;
2373
- }
2374
- if (value == null || other == null || !isObjectLike$1(value) && !isObjectLike$1(other)) {
2375
- return value !== value && other !== other;
2376
- }
2377
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
2378
- }
2379
- var _baseIsEqual = baseIsEqual$2;
2380
-
2381
- var Stack = _Stack,
2382
- baseIsEqual$1 = _baseIsEqual;
2383
-
2384
- /** Used to compose bitmasks for value comparisons. */
2385
- var COMPARE_PARTIAL_FLAG$1 = 1,
2386
- COMPARE_UNORDERED_FLAG$1 = 2;
2387
-
2388
- /**
2389
- * The base implementation of `_.isMatch` without support for iteratee shorthands.
2390
- *
2391
- * @private
2392
- * @param {Object} object The object to inspect.
2393
- * @param {Object} source The object of property values to match.
2394
- * @param {Array} matchData The property names, values, and compare flags to match.
2395
- * @param {Function} [customizer] The function to customize comparisons.
2396
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
2397
- */
2398
- function baseIsMatch$1(object, source, matchData, customizer) {
2399
- var index = matchData.length,
2400
- length = index,
2401
- noCustomizer = !customizer;
2402
- if (object == null) {
2403
- return !length;
2404
- }
2405
- object = Object(object);
2406
- while (index--) {
2407
- var data = matchData[index];
2408
- if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
2409
- return false;
2410
- }
2411
- }
2412
- while (++index < length) {
2413
- data = matchData[index];
2414
- var key = data[0],
2415
- objValue = object[key],
2416
- srcValue = data[1];
2417
- if (noCustomizer && data[2]) {
2418
- if (objValue === undefined && !(key in object)) {
2419
- return false;
2420
- }
2421
- } else {
2422
- var stack = new Stack();
2423
- if (customizer) {
2424
- var result = customizer(objValue, srcValue, key, object, source, stack);
2425
- }
2426
- if (!(result === undefined ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
2427
- return false;
2428
- }
2429
- }
2430
- }
2431
- return true;
2432
- }
2433
- var _baseIsMatch = baseIsMatch$1;
2434
-
2435
- var isObject = isObject_1;
2436
-
2437
- /**
2438
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
2439
- *
2440
- * @private
2441
- * @param {*} value The value to check.
2442
- * @returns {boolean} Returns `true` if `value` if suitable for strict
2443
- * equality comparisons, else `false`.
2444
- */
2445
- function isStrictComparable$2(value) {
2446
- return value === value && !isObject(value);
2447
- }
2448
- var _isStrictComparable = isStrictComparable$2;
2449
-
2450
- var isStrictComparable$1 = _isStrictComparable,
2451
- keys$1 = keys_1;
2452
-
2453
- /**
2454
- * Gets the property names, values, and compare flags of `object`.
2455
- *
2456
- * @private
2457
- * @param {Object} object The object to query.
2458
- * @returns {Array} Returns the match data of `object`.
2459
- */
2460
- function getMatchData$1(object) {
2461
- var result = keys$1(object),
2462
- length = result.length;
2463
- while (length--) {
2464
- var key = result[length],
2465
- value = object[key];
2466
- result[length] = [key, value, isStrictComparable$1(value)];
2467
- }
2468
- return result;
2469
- }
2470
- var _getMatchData = getMatchData$1;
2471
-
2472
- /**
2473
- * A specialized version of `matchesProperty` for source values suitable
2474
- * for strict equality comparisons, i.e. `===`.
2475
- *
2476
- * @private
2477
- * @param {string} key The key of the property to get.
2478
- * @param {*} srcValue The value to match.
2479
- * @returns {Function} Returns the new spec function.
2480
- */
2481
- function matchesStrictComparable$2(key, srcValue) {
2482
- return function (object) {
2483
- if (object == null) {
2484
- return false;
2485
- }
2486
- return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
2487
- };
2488
- }
2489
- var _matchesStrictComparable = matchesStrictComparable$2;
2490
-
2491
- var baseIsMatch = _baseIsMatch,
2492
- getMatchData = _getMatchData,
2493
- matchesStrictComparable$1 = _matchesStrictComparable;
2494
-
2495
- /**
2496
- * The base implementation of `_.matches` which doesn't clone `source`.
2497
- *
2498
- * @private
2499
- * @param {Object} source The object of property values to match.
2500
- * @returns {Function} Returns the new spec function.
2501
- */
2502
- function baseMatches$1(source) {
2503
- var matchData = getMatchData(source);
2504
- if (matchData.length == 1 && matchData[0][2]) {
2505
- return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
2506
- }
2507
- return function (object) {
2508
- return object === source || baseIsMatch(object, source, matchData);
2509
- };
2510
- }
2511
- var _baseMatches = baseMatches$1;
2512
-
2513
- var baseGetTag = _baseGetTag,
2514
- isObjectLike = isObjectLike_1;
2515
-
2516
- /** `Object#toString` result references. */
2517
- var symbolTag = '[object Symbol]';
2518
-
2519
- /**
2520
- * Checks if `value` is classified as a `Symbol` primitive or object.
2521
- *
2522
- * @static
2523
- * @memberOf _
2524
- * @since 4.0.0
2525
- * @category Lang
2526
- * @param {*} value The value to check.
2527
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
2528
- * @example
2529
- *
2530
- * _.isSymbol(Symbol.iterator);
2531
- * // => true
2532
- *
2533
- * _.isSymbol('abc');
2534
- * // => false
2535
- */
2536
- function isSymbol$3(value) {
2537
- return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
2538
- }
2539
- var isSymbol_1 = isSymbol$3;
2540
-
2541
- var isArray$6 = isArray_1,
2542
- isSymbol$2 = isSymbol_1;
2543
-
2544
- /** Used to match property names within property paths. */
2545
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
2546
- reIsPlainProp = /^\w*$/;
2547
-
2548
- /**
2549
- * Checks if `value` is a property name and not a property path.
2550
- *
2551
- * @private
2552
- * @param {*} value The value to check.
2553
- * @param {Object} [object] The object to query keys on.
2554
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
2555
- */
2556
- function isKey$3(value, object) {
2557
- if (isArray$6(value)) {
2558
- return false;
2559
- }
2560
- var type = typeof value;
2561
- if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol$2(value)) {
2562
- return true;
2563
- }
2564
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
2565
- }
2566
- var _isKey = isKey$3;
2567
-
2568
- var MapCache = _MapCache;
2569
-
2570
- /** Error message constants. */
2571
- var FUNC_ERROR_TEXT = 'Expected a function';
2572
-
2573
- /**
2574
- * Creates a function that memoizes the result of `func`. If `resolver` is
2575
- * provided, it determines the cache key for storing the result based on the
2576
- * arguments provided to the memoized function. By default, the first argument
2577
- * provided to the memoized function is used as the map cache key. The `func`
2578
- * is invoked with the `this` binding of the memoized function.
2579
- *
2580
- * **Note:** The cache is exposed as the `cache` property on the memoized
2581
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
2582
- * constructor with one whose instances implement the
2583
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
2584
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
2585
- *
2586
- * @static
2587
- * @memberOf _
2588
- * @since 0.1.0
2589
- * @category Function
2590
- * @param {Function} func The function to have its output memoized.
2591
- * @param {Function} [resolver] The function to resolve the cache key.
2592
- * @returns {Function} Returns the new memoized function.
2593
- * @example
2594
- *
2595
- * var object = { 'a': 1, 'b': 2 };
2596
- * var other = { 'c': 3, 'd': 4 };
2597
- *
2598
- * var values = _.memoize(_.values);
2599
- * values(object);
2600
- * // => [1, 2]
2601
- *
2602
- * values(other);
2603
- * // => [3, 4]
2604
- *
2605
- * object.a = 2;
2606
- * values(object);
2607
- * // => [1, 2]
2608
- *
2609
- * // Modify the result cache.
2610
- * values.cache.set(object, ['a', 'b']);
2611
- * values(object);
2612
- * // => ['a', 'b']
2613
- *
2614
- * // Replace `_.memoize.Cache`.
2615
- * _.memoize.Cache = WeakMap;
2616
- */
2617
- function memoize$1(func, resolver) {
2618
- if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
2619
- throw new TypeError(FUNC_ERROR_TEXT);
2620
- }
2621
- var memoized = function () {
2622
- var args = arguments,
2623
- key = resolver ? resolver.apply(this, args) : args[0],
2624
- cache = memoized.cache;
2625
- if (cache.has(key)) {
2626
- return cache.get(key);
2627
- }
2628
- var result = func.apply(this, args);
2629
- memoized.cache = cache.set(key, result) || cache;
2630
- return result;
2631
- };
2632
- memoized.cache = new (memoize$1.Cache || MapCache)();
2633
- return memoized;
2634
- }
2635
-
2636
- // Expose `MapCache`.
2637
- memoize$1.Cache = MapCache;
2638
- var memoize_1 = memoize$1;
2639
-
2640
- var memoize = memoize_1;
2641
-
2642
- /** Used as the maximum memoize cache size. */
2643
- var MAX_MEMOIZE_SIZE = 500;
2644
-
2645
- /**
2646
- * A specialized version of `_.memoize` which clears the memoized function's
2647
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
2648
- *
2649
- * @private
2650
- * @param {Function} func The function to have its output memoized.
2651
- * @returns {Function} Returns the new memoized function.
2652
- */
2653
- function memoizeCapped$1(func) {
2654
- var result = memoize(func, function (key) {
2655
- if (cache.size === MAX_MEMOIZE_SIZE) {
2656
- cache.clear();
2657
- }
2658
- return key;
2659
- });
2660
- var cache = result.cache;
2661
- return result;
2662
- }
2663
- var _memoizeCapped = memoizeCapped$1;
2664
-
2665
- var memoizeCapped = _memoizeCapped;
2666
-
2667
- /** Used to match property names within property paths. */
2668
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
2669
-
2670
- /** Used to match backslashes in property paths. */
2671
- var reEscapeChar = /\\(\\)?/g;
2672
-
2673
- /**
2674
- * Converts `string` to a property path array.
2675
- *
2676
- * @private
2677
- * @param {string} string The string to convert.
2678
- * @returns {Array} Returns the property path array.
2679
- */
2680
- var stringToPath$1 = memoizeCapped(function (string) {
2681
- var result = [];
2682
- if (string.charCodeAt(0) === 46 /* . */) {
2683
- result.push('');
2684
- }
2685
- string.replace(rePropName, function (match, number, quote, subString) {
2686
- result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
2687
- });
2688
- return result;
2689
- });
2690
- var _stringToPath = stringToPath$1;
2691
-
2692
- var Symbol$1 = _Symbol,
2693
- arrayMap$1 = _arrayMap,
2694
- isArray$5 = isArray_1,
2695
- isSymbol$1 = isSymbol_1;
2696
-
2697
- /** Used as references for various `Number` constants. */
2698
- var INFINITY$1 = 1 / 0;
2699
-
2700
- /** Used to convert symbols to primitives and strings. */
2701
- var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
2702
- symbolToString = symbolProto ? symbolProto.toString : undefined;
2703
-
2704
- /**
2705
- * The base implementation of `_.toString` which doesn't convert nullish
2706
- * values to empty strings.
2707
- *
2708
- * @private
2709
- * @param {*} value The value to process.
2710
- * @returns {string} Returns the string.
2711
- */
2712
- function baseToString$1(value) {
2713
- // Exit early for strings to avoid a performance hit in some environments.
2714
- if (typeof value == 'string') {
2715
- return value;
2716
- }
2717
- if (isArray$5(value)) {
2718
- // Recursively convert values (susceptible to call stack limits).
2719
- return arrayMap$1(value, baseToString$1) + '';
2720
- }
2721
- if (isSymbol$1(value)) {
2722
- return symbolToString ? symbolToString.call(value) : '';
2723
- }
2724
- var result = value + '';
2725
- return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result;
2726
- }
2727
- var _baseToString = baseToString$1;
2728
-
2729
- var baseToString = _baseToString;
2730
-
2731
- /**
2732
- * Converts `value` to a string. An empty string is returned for `null`
2733
- * and `undefined` values. The sign of `-0` is preserved.
2734
- *
2735
- * @static
2736
- * @memberOf _
2737
- * @since 4.0.0
2738
- * @category Lang
2739
- * @param {*} value The value to convert.
2740
- * @returns {string} Returns the converted string.
2741
- * @example
2742
- *
2743
- * _.toString(null);
2744
- * // => ''
2745
- *
2746
- * _.toString(-0);
2747
- * // => '-0'
2748
- *
2749
- * _.toString([1, 2, 3]);
2750
- * // => '1,2,3'
2751
- */
2752
- function toString$2(value) {
2753
- return value == null ? '' : baseToString(value);
2754
- }
2755
- var toString_1 = toString$2;
2756
-
2757
- var isArray$4 = isArray_1,
2758
- isKey$2 = _isKey,
2759
- stringToPath = _stringToPath,
2760
- toString$1 = toString_1;
2761
-
2762
- /**
2763
- * Casts `value` to a path array if it's not one.
2764
- *
2765
- * @private
2766
- * @param {*} value The value to inspect.
2767
- * @param {Object} [object] The object to query keys on.
2768
- * @returns {Array} Returns the cast property path array.
2769
- */
2770
- function castPath$2(value, object) {
2771
- if (isArray$4(value)) {
2772
- return value;
2773
- }
2774
- return isKey$2(value, object) ? [value] : stringToPath(toString$1(value));
2775
- }
2776
- var _castPath = castPath$2;
2777
-
2778
- var isSymbol = isSymbol_1;
2779
-
2780
- /** Used as references for various `Number` constants. */
2781
- var INFINITY = 1 / 0;
2782
-
2783
- /**
2784
- * Converts `value` to a string key if it's not a string or symbol.
2785
- *
2786
- * @private
2787
- * @param {*} value The value to inspect.
2788
- * @returns {string|symbol} Returns the key.
2789
- */
2790
- function toKey$4(value) {
2791
- if (typeof value == 'string' || isSymbol(value)) {
2792
- return value;
2793
- }
2794
- var result = value + '';
2795
- return result == '0' && 1 / value == -INFINITY ? '-0' : result;
2796
- }
2797
- var _toKey = toKey$4;
2798
-
2799
- var castPath$1 = _castPath,
2800
- toKey$3 = _toKey;
2801
-
2802
- /**
2803
- * The base implementation of `_.get` without support for default values.
2804
- *
2805
- * @private
2806
- * @param {Object} object The object to query.
2807
- * @param {Array|string} path The path of the property to get.
2808
- * @returns {*} Returns the resolved value.
2809
- */
2810
- function baseGet$2(object, path) {
2811
- path = castPath$1(path, object);
2812
- var index = 0,
2813
- length = path.length;
2814
- while (object != null && index < length) {
2815
- object = object[toKey$3(path[index++])];
2816
- }
2817
- return index && index == length ? object : undefined;
2818
- }
2819
- var _baseGet = baseGet$2;
2820
-
2821
- var baseGet$1 = _baseGet;
2822
-
2823
- /**
2824
- * Gets the value at `path` of `object`. If the resolved value is
2825
- * `undefined`, the `defaultValue` is returned in its place.
2826
- *
2827
- * @static
2828
- * @memberOf _
2829
- * @since 3.7.0
2830
- * @category Object
2831
- * @param {Object} object The object to query.
2832
- * @param {Array|string} path The path of the property to get.
2833
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
2834
- * @returns {*} Returns the resolved value.
2835
- * @example
2836
- *
2837
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2838
- *
2839
- * _.get(object, 'a[0].b.c');
2840
- * // => 3
2841
- *
2842
- * _.get(object, ['a', '0', 'b', 'c']);
2843
- * // => 3
2844
- *
2845
- * _.get(object, 'a.b.c', 'default');
2846
- * // => 'default'
2847
- */
2848
- function get$1(object, path, defaultValue) {
2849
- var result = object == null ? undefined : baseGet$1(object, path);
2850
- return result === undefined ? defaultValue : result;
2851
- }
2852
- var get_1 = get$1;
2853
-
2854
- /**
2855
- * The base implementation of `_.hasIn` without support for deep paths.
2856
- *
2857
- * @private
2858
- * @param {Object} [object] The object to query.
2859
- * @param {Array|string} key The key to check.
2860
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
2861
- */
2862
- function baseHasIn$1(object, key) {
2863
- return object != null && key in Object(object);
2864
- }
2865
- var _baseHasIn = baseHasIn$1;
2866
-
2867
- var castPath = _castPath,
2868
- isArguments = isArguments_1,
2869
- isArray$3 = isArray_1,
2870
- isIndex = _isIndex,
2871
- isLength = isLength_1,
2872
- toKey$2 = _toKey;
2873
-
2874
- /**
2875
- * Checks if `path` exists on `object`.
2876
- *
2877
- * @private
2878
- * @param {Object} object The object to query.
2879
- * @param {Array|string} path The path to check.
2880
- * @param {Function} hasFunc The function to check properties.
2881
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
2882
- */
2883
- function hasPath$1(object, path, hasFunc) {
2884
- path = castPath(path, object);
2885
- var index = -1,
2886
- length = path.length,
2887
- result = false;
2888
- while (++index < length) {
2889
- var key = toKey$2(path[index]);
2890
- if (!(result = object != null && hasFunc(object, key))) {
2891
- break;
2892
- }
2893
- object = object[key];
2894
- }
2895
- if (result || ++index != length) {
2896
- return result;
2897
- }
2898
- length = object == null ? 0 : object.length;
2899
- return !!length && isLength(length) && isIndex(key, length) && (isArray$3(object) || isArguments(object));
2900
- }
2901
- var _hasPath = hasPath$1;
2902
-
2903
- var baseHasIn = _baseHasIn,
2904
- hasPath = _hasPath;
2905
-
2906
- /**
2907
- * Checks if `path` is a direct or inherited property of `object`.
2908
- *
2909
- * @static
2910
- * @memberOf _
2911
- * @since 4.0.0
2912
- * @category Object
2913
- * @param {Object} object The object to query.
2914
- * @param {Array|string} path The path to check.
2915
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
2916
- * @example
2917
- *
2918
- * var object = _.create({ 'a': _.create({ 'b': 2 }) });
2919
- *
2920
- * _.hasIn(object, 'a');
2921
- * // => true
2922
- *
2923
- * _.hasIn(object, 'a.b');
2924
- * // => true
2925
- *
2926
- * _.hasIn(object, ['a', 'b']);
2927
- * // => true
2928
- *
2929
- * _.hasIn(object, 'b');
2930
- * // => false
2931
- */
2932
- function hasIn$1(object, path) {
2933
- return object != null && hasPath(object, path, baseHasIn);
2934
- }
2935
- var hasIn_1 = hasIn$1;
2936
-
2937
- var baseIsEqual = _baseIsEqual,
2938
- get = get_1,
2939
- hasIn = hasIn_1,
2940
- isKey$1 = _isKey,
2941
- isStrictComparable = _isStrictComparable,
2942
- matchesStrictComparable = _matchesStrictComparable,
2943
- toKey$1 = _toKey;
2944
-
2945
- /** Used to compose bitmasks for value comparisons. */
2946
- var COMPARE_PARTIAL_FLAG = 1,
2947
- COMPARE_UNORDERED_FLAG = 2;
2948
-
2949
- /**
2950
- * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
2951
- *
2952
- * @private
2953
- * @param {string} path The path of the property to get.
2954
- * @param {*} srcValue The value to match.
2955
- * @returns {Function} Returns the new spec function.
2956
- */
2957
- function baseMatchesProperty$1(path, srcValue) {
2958
- if (isKey$1(path) && isStrictComparable(srcValue)) {
2959
- return matchesStrictComparable(toKey$1(path), srcValue);
2960
- }
2961
- return function (object) {
2962
- var objValue = get(object, path);
2963
- return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
2964
- };
2965
- }
2966
- var _baseMatchesProperty = baseMatchesProperty$1;
2967
-
2968
- /**
2969
- * This method returns the first argument it receives.
2970
- *
2971
- * @static
2972
- * @since 0.1.0
2973
- * @memberOf _
2974
- * @category Util
2975
- * @param {*} value Any value.
2976
- * @returns {*} Returns `value`.
2977
- * @example
2978
- *
2979
- * var object = { 'a': 1 };
2980
- *
2981
- * console.log(_.identity(object) === object);
2982
- * // => true
2983
- */
2984
- function identity$1(value) {
2985
- return value;
2986
- }
2987
- var identity_1 = identity$1;
2988
-
2989
- /**
2990
- * The base implementation of `_.property` without support for deep paths.
2991
- *
2992
- * @private
2993
- * @param {string} key The key of the property to get.
2994
- * @returns {Function} Returns the new accessor function.
2995
- */
2996
- function baseProperty$1(key) {
2997
- return function (object) {
2998
- return object == null ? undefined : object[key];
2999
- };
3000
- }
3001
- var _baseProperty = baseProperty$1;
3002
-
3003
- var baseGet = _baseGet;
3004
-
3005
- /**
3006
- * A specialized version of `baseProperty` which supports deep paths.
3007
- *
3008
- * @private
3009
- * @param {Array|string} path The path of the property to get.
3010
- * @returns {Function} Returns the new accessor function.
3011
- */
3012
- function basePropertyDeep$1(path) {
3013
- return function (object) {
3014
- return baseGet(object, path);
3015
- };
3016
- }
3017
- var _basePropertyDeep = basePropertyDeep$1;
3018
-
3019
- var baseProperty = _baseProperty,
3020
- basePropertyDeep = _basePropertyDeep,
3021
- isKey = _isKey,
3022
- toKey = _toKey;
3023
-
3024
- /**
3025
- * Creates a function that returns the value at `path` of a given object.
3026
- *
3027
- * @static
3028
- * @memberOf _
3029
- * @since 2.4.0
3030
- * @category Util
3031
- * @param {Array|string} path The path of the property to get.
3032
- * @returns {Function} Returns the new accessor function.
3033
- * @example
3034
- *
3035
- * var objects = [
3036
- * { 'a': { 'b': 2 } },
3037
- * { 'a': { 'b': 1 } }
3038
- * ];
3039
- *
3040
- * _.map(objects, _.property('a.b'));
3041
- * // => [2, 1]
3042
- *
3043
- * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
3044
- * // => [1, 2]
3045
- */
3046
- function property$1(path) {
3047
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
3048
- }
3049
- var property_1 = property$1;
3050
-
3051
- var baseMatches = _baseMatches,
3052
- baseMatchesProperty = _baseMatchesProperty,
3053
- identity = identity_1,
3054
- isArray$2 = isArray_1,
3055
- property = property_1;
3056
-
3057
- /**
3058
- * The base implementation of `_.iteratee`.
3059
- *
3060
- * @private
3061
- * @param {*} [value=_.identity] The value to convert to an iteratee.
3062
- * @returns {Function} Returns the iteratee.
3063
- */
3064
- function baseIteratee$2(value) {
3065
- // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
3066
- // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
3067
- if (typeof value == 'function') {
3068
- return value;
3069
- }
3070
- if (value == null) {
3071
- return identity;
3072
- }
3073
- if (typeof value == 'object') {
3074
- return isArray$2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
3075
- }
3076
- return property(value);
3077
- }
3078
- var _baseIteratee = baseIteratee$2;
3079
-
3080
- /**
3081
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
3082
- *
3083
- * @private
3084
- * @param {boolean} [fromRight] Specify iterating from right to left.
3085
- * @returns {Function} Returns the new base function.
3086
- */
3087
- function createBaseFor$1(fromRight) {
3088
- return function (object, iteratee, keysFunc) {
3089
- var index = -1,
3090
- iterable = Object(object),
3091
- props = keysFunc(object),
3092
- length = props.length;
3093
- while (length--) {
3094
- var key = props[fromRight ? length : ++index];
3095
- if (iteratee(iterable[key], key, iterable) === false) {
3096
- break;
3097
- }
3098
- }
3099
- return object;
3100
- };
3101
- }
3102
- var _createBaseFor = createBaseFor$1;
3103
-
3104
- var createBaseFor = _createBaseFor;
3105
-
3106
- /**
3107
- * The base implementation of `baseForOwn` which iterates over `object`
3108
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
3109
- * Iteratee functions may exit iteration early by explicitly returning `false`.
3110
- *
3111
- * @private
3112
- * @param {Object} object The object to iterate over.
3113
- * @param {Function} iteratee The function invoked per iteration.
3114
- * @param {Function} keysFunc The function to get the keys of `object`.
3115
- * @returns {Object} Returns `object`.
3116
- */
3117
- var baseFor$1 = createBaseFor();
3118
- var _baseFor = baseFor$1;
3119
-
3120
- var baseFor = _baseFor,
3121
- keys = keys_1;
3122
-
3123
- /**
3124
- * The base implementation of `_.forOwn` without support for iteratee shorthands.
3125
- *
3126
- * @private
3127
- * @param {Object} object The object to iterate over.
3128
- * @param {Function} iteratee The function invoked per iteration.
3129
- * @returns {Object} Returns `object`.
3130
- */
3131
- function baseForOwn$1(object, iteratee) {
3132
- return object && baseFor(object, iteratee, keys);
3133
- }
3134
- var _baseForOwn = baseForOwn$1;
3135
-
3136
- var isArrayLike$1 = isArrayLike_1;
3137
-
3138
- /**
3139
- * Creates a `baseEach` or `baseEachRight` function.
3140
- *
3141
- * @private
3142
- * @param {Function} eachFunc The function to iterate over a collection.
3143
- * @param {boolean} [fromRight] Specify iterating from right to left.
3144
- * @returns {Function} Returns the new base function.
3145
- */
3146
- function createBaseEach$1(eachFunc, fromRight) {
3147
- return function (collection, iteratee) {
3148
- if (collection == null) {
3149
- return collection;
3150
- }
3151
- if (!isArrayLike$1(collection)) {
3152
- return eachFunc(collection, iteratee);
3153
- }
3154
- var length = collection.length,
3155
- index = fromRight ? length : -1,
3156
- iterable = Object(collection);
3157
- while (fromRight ? index-- : ++index < length) {
3158
- if (iteratee(iterable[index], index, iterable) === false) {
3159
- break;
3160
- }
3161
- }
3162
- return collection;
3163
- };
3164
- }
3165
- var _createBaseEach = createBaseEach$1;
3166
-
3167
- var baseForOwn = _baseForOwn,
3168
- createBaseEach = _createBaseEach;
3169
-
3170
- /**
3171
- * The base implementation of `_.forEach` without support for iteratee shorthands.
3172
- *
3173
- * @private
3174
- * @param {Array|Object} collection The collection to iterate over.
3175
- * @param {Function} iteratee The function invoked per iteration.
3176
- * @returns {Array|Object} Returns `collection`.
3177
- */
3178
- var baseEach$2 = createBaseEach(baseForOwn);
3179
- var _baseEach = baseEach$2;
3180
-
3181
- var baseEach$1 = _baseEach,
3182
- isArrayLike = isArrayLike_1;
3183
-
3184
- /**
3185
- * The base implementation of `_.map` without support for iteratee shorthands.
3186
- *
3187
- * @private
3188
- * @param {Array|Object} collection The collection to iterate over.
3189
- * @param {Function} iteratee The function invoked per iteration.
3190
- * @returns {Array} Returns the new mapped array.
3191
- */
3192
- function baseMap$1(collection, iteratee) {
3193
- var index = -1,
3194
- result = isArrayLike(collection) ? Array(collection.length) : [];
3195
- baseEach$1(collection, function (value, key, collection) {
3196
- result[++index] = iteratee(value, key, collection);
3197
- });
3198
- return result;
3199
- }
3200
- var _baseMap = baseMap$1;
3201
-
3202
- var arrayMap = _arrayMap,
3203
- baseIteratee$1 = _baseIteratee,
3204
- baseMap = _baseMap,
3205
- isArray$1 = isArray_1;
3206
-
3207
- /**
3208
- * Creates an array of values by running each element in `collection` thru
3209
- * `iteratee`. The iteratee is invoked with three arguments:
3210
- * (value, index|key, collection).
3211
- *
3212
- * Many lodash methods are guarded to work as iteratees for methods like
3213
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
3214
- *
3215
- * The guarded methods are:
3216
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
3217
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
3218
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
3219
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
3220
- *
3221
- * @static
3222
- * @memberOf _
3223
- * @since 0.1.0
3224
- * @category Collection
3225
- * @param {Array|Object} collection The collection to iterate over.
3226
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
3227
- * @returns {Array} Returns the new mapped array.
3228
- * @example
3229
- *
3230
- * function square(n) {
3231
- * return n * n;
3232
- * }
3233
- *
3234
- * _.map([4, 8], square);
3235
- * // => [16, 64]
3236
- *
3237
- * _.map({ 'a': 4, 'b': 8 }, square);
3238
- * // => [16, 64] (iteration order is not guaranteed)
3239
- *
3240
- * var users = [
3241
- * { 'user': 'barney' },
3242
- * { 'user': 'fred' }
3243
- * ];
3244
- *
3245
- * // The `_.property` iteratee shorthand.
3246
- * _.map(users, 'user');
3247
- * // => ['barney', 'fred']
3248
- */
3249
- function map(collection, iteratee) {
3250
- var func = isArray$1(collection) ? arrayMap : baseMap;
3251
- return func(collection, baseIteratee$1(iteratee));
3252
- }
3253
- var map_1 = map;
3254
-
3255
- /**
3256
- * A specialized version of `_.reduce` for arrays without support for
3257
- * iteratee shorthands.
3258
- *
3259
- * @private
3260
- * @param {Array} [array] The array to iterate over.
3261
- * @param {Function} iteratee The function invoked per iteration.
3262
- * @param {*} [accumulator] The initial value.
3263
- * @param {boolean} [initAccum] Specify using the first element of `array` as
3264
- * the initial value.
3265
- * @returns {*} Returns the accumulated value.
3266
- */
3267
- function arrayReduce$1(array, iteratee, accumulator, initAccum) {
3268
- var index = -1,
3269
- length = array == null ? 0 : array.length;
3270
- if (initAccum && length) {
3271
- accumulator = array[++index];
3272
- }
3273
- while (++index < length) {
3274
- accumulator = iteratee(accumulator, array[index], index, array);
3275
- }
3276
- return accumulator;
3277
- }
3278
- var _arrayReduce = arrayReduce$1;
3279
-
3280
- /**
3281
- * The base implementation of `_.reduce` and `_.reduceRight`, without support
3282
- * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
3283
- *
3284
- * @private
3285
- * @param {Array|Object} collection The collection to iterate over.
3286
- * @param {Function} iteratee The function invoked per iteration.
3287
- * @param {*} accumulator The initial value.
3288
- * @param {boolean} initAccum Specify using the first or last element of
3289
- * `collection` as the initial value.
3290
- * @param {Function} eachFunc The function to iterate over `collection`.
3291
- * @returns {*} Returns the accumulated value.
3292
- */
3293
- function baseReduce$1(collection, iteratee, accumulator, initAccum, eachFunc) {
3294
- eachFunc(collection, function (value, index, collection) {
3295
- accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection);
3296
- });
3297
- return accumulator;
3298
- }
3299
- var _baseReduce = baseReduce$1;
3300
-
3301
- var arrayReduce = _arrayReduce,
3302
- baseEach = _baseEach,
3303
- baseIteratee = _baseIteratee,
3304
- baseReduce = _baseReduce,
3305
- isArray = isArray_1;
3306
-
3307
- /**
3308
- * Reduces `collection` to a value which is the accumulated result of running
3309
- * each element in `collection` thru `iteratee`, where each successive
3310
- * invocation is supplied the return value of the previous. If `accumulator`
3311
- * is not given, the first element of `collection` is used as the initial
3312
- * value. The iteratee is invoked with four arguments:
3313
- * (accumulator, value, index|key, collection).
3314
- *
3315
- * Many lodash methods are guarded to work as iteratees for methods like
3316
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
3317
- *
3318
- * The guarded methods are:
3319
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
3320
- * and `sortBy`
3321
- *
3322
- * @static
3323
- * @memberOf _
3324
- * @since 0.1.0
3325
- * @category Collection
3326
- * @param {Array|Object} collection The collection to iterate over.
3327
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
3328
- * @param {*} [accumulator] The initial value.
3329
- * @returns {*} Returns the accumulated value.
3330
- * @see _.reduceRight
3331
- * @example
3332
- *
3333
- * _.reduce([1, 2], function(sum, n) {
3334
- * return sum + n;
3335
- * }, 0);
3336
- * // => 3
3337
- *
3338
- * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
3339
- * (result[value] || (result[value] = [])).push(key);
3340
- * return result;
3341
- * }, {});
3342
- * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
3343
- */
3344
- function reduce(collection, iteratee, accumulator) {
3345
- var func = isArray(collection) ? arrayReduce : baseReduce,
3346
- initAccum = arguments.length < 3;
3347
- return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach);
3348
- }
3349
- var reduce_1 = reduce;
3350
-
3351
- /**
3352
- * The base implementation of `_.slice` without an iteratee call guard.
3353
- *
3354
- * @private
3355
- * @param {Array} array The array to slice.
3356
- * @param {number} [start=0] The start position.
3357
- * @param {number} [end=array.length] The end position.
3358
- * @returns {Array} Returns the slice of `array`.
3359
- */
3360
- function baseSlice$1(array, start, end) {
3361
- var index = -1,
3362
- length = array.length;
3363
- if (start < 0) {
3364
- start = -start > length ? 0 : length + start;
3365
- }
3366
- end = end > length ? length : end;
3367
- if (end < 0) {
3368
- end += length;
3369
- }
3370
- length = start > end ? 0 : end - start >>> 0;
3371
- start >>>= 0;
3372
- var result = Array(length);
3373
- while (++index < length) {
3374
- result[index] = array[index + start];
3375
- }
3376
- return result;
3377
- }
3378
- var _baseSlice = baseSlice$1;
3379
-
3380
- var baseSlice = _baseSlice;
3381
-
3382
- /**
3383
- * Casts `array` to a slice if it's needed.
3384
- *
3385
- * @private
3386
- * @param {Array} array The array to inspect.
3387
- * @param {number} start The start position.
3388
- * @param {number} [end=array.length] The end position.
3389
- * @returns {Array} Returns the cast slice.
3390
- */
3391
- function castSlice$1(array, start, end) {
3392
- var length = array.length;
3393
- end = end === undefined ? length : end;
3394
- return !start && end >= length ? array : baseSlice(array, start, end);
3395
- }
3396
- var _castSlice = castSlice$1;
3397
-
3398
- /** Used to compose unicode character classes. */
3399
- var rsAstralRange$1 = '\\ud800-\\udfff',
3400
- rsComboMarksRange$1 = '\\u0300-\\u036f',
3401
- reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
3402
- rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
3403
- rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1,
3404
- rsVarRange$1 = '\\ufe0e\\ufe0f';
3405
-
3406
- /** Used to compose unicode capture groups. */
3407
- var rsZWJ$1 = '\\u200d';
3408
-
3409
- /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
3410
- var reHasUnicode = RegExp('[' + rsZWJ$1 + rsAstralRange$1 + rsComboRange$1 + rsVarRange$1 + ']');
3411
-
3412
- /**
3413
- * Checks if `string` contains Unicode symbols.
3414
- *
3415
- * @private
3416
- * @param {string} string The string to inspect.
3417
- * @returns {boolean} Returns `true` if a symbol is found, else `false`.
3418
- */
3419
- function hasUnicode$2(string) {
3420
- return reHasUnicode.test(string);
3421
- }
3422
- var _hasUnicode = hasUnicode$2;
3423
-
3424
- /**
3425
- * Converts an ASCII `string` to an array.
3426
- *
3427
- * @private
3428
- * @param {string} string The string to convert.
3429
- * @returns {Array} Returns the converted array.
3430
- */
3431
- function asciiToArray$1(string) {
3432
- return string.split('');
3433
- }
3434
- var _asciiToArray = asciiToArray$1;
3435
-
3436
- /** Used to compose unicode character classes. */
3437
- var rsAstralRange = '\\ud800-\\udfff',
3438
- rsComboMarksRange = '\\u0300-\\u036f',
3439
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
3440
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
3441
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
3442
- rsVarRange = '\\ufe0e\\ufe0f';
3443
-
3444
- /** Used to compose unicode capture groups. */
3445
- var rsAstral = '[' + rsAstralRange + ']',
3446
- rsCombo = '[' + rsComboRange + ']',
3447
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
3448
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
3449
- rsNonAstral = '[^' + rsAstralRange + ']',
3450
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
3451
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
3452
- rsZWJ = '\\u200d';
3453
-
3454
- /** Used to compose unicode regexes. */
3455
- var reOptMod = rsModifier + '?',
3456
- rsOptVar = '[' + rsVarRange + ']?',
3457
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
3458
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
3459
- rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
3460
-
3461
- /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
3462
- var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
3463
-
3464
- /**
3465
- * Converts a Unicode `string` to an array.
3466
- *
3467
- * @private
3468
- * @param {string} string The string to convert.
3469
- * @returns {Array} Returns the converted array.
3470
- */
3471
- function unicodeToArray$1(string) {
3472
- return string.match(reUnicode) || [];
3473
- }
3474
- var _unicodeToArray = unicodeToArray$1;
3475
-
3476
- var asciiToArray = _asciiToArray,
3477
- hasUnicode$1 = _hasUnicode,
3478
- unicodeToArray = _unicodeToArray;
3479
-
3480
- /**
3481
- * Converts `string` to an array.
3482
- *
3483
- * @private
3484
- * @param {string} string The string to convert.
3485
- * @returns {Array} Returns the converted array.
3486
- */
3487
- function stringToArray$1(string) {
3488
- return hasUnicode$1(string) ? unicodeToArray(string) : asciiToArray(string);
3489
- }
3490
- var _stringToArray = stringToArray$1;
3491
-
3492
- var castSlice = _castSlice,
3493
- hasUnicode = _hasUnicode,
3494
- stringToArray = _stringToArray,
3495
- toString = toString_1;
3496
-
3497
- /**
3498
- * Creates a function like `_.lowerFirst`.
3499
- *
3500
- * @private
3501
- * @param {string} methodName The name of the `String` case method to use.
3502
- * @returns {Function} Returns the new case function.
3503
- */
3504
- function createCaseFirst$1(methodName) {
3505
- return function (string) {
3506
- string = toString(string);
3507
- var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined;
3508
- var chr = strSymbols ? strSymbols[0] : string.charAt(0);
3509
- var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1);
3510
- return chr[methodName]() + trailing;
3511
- };
3512
- }
3513
- var _createCaseFirst = createCaseFirst$1;
3514
-
3515
- var createCaseFirst = _createCaseFirst;
3516
-
3517
- /**
3518
- * Converts the first character of `string` to upper case.
3519
- *
3520
- * @static
3521
- * @memberOf _
3522
- * @since 4.0.0
3523
- * @category String
3524
- * @param {string} [string=''] The string to convert.
3525
- * @returns {string} Returns the converted string.
3526
- * @example
3527
- *
3528
- * _.upperFirst('fred');
3529
- * // => 'Fred'
3530
- *
3531
- * _.upperFirst('FRED');
3532
- * // => 'FRED'
3533
- */
3534
- var upperFirst = createCaseFirst('toUpperCase');
3535
- var upperFirst_1 = upperFirst;
3536
-
3537
- var useAction = function useAction(action, deps) {
3538
- return useActions([action], deps)[0];
3539
- };
3540
- var useActions = function useActions(actions, deps) {
3541
- var dispatch = useDispatch();
3542
- return useMemo(function () {
3543
- if (Array.isArray(actions)) {
3544
- return actions.map(function (a) {
3545
- return bindActionCreators(a, dispatch);
3546
- });
3547
- }
3548
- return bindActionCreators(actions, dispatch);
3549
- }, /* eslint-disable-next-line react-hooks/exhaustive-deps */
3550
- deps ? [dispatch].concat(_toConsumableArray(deps)) : [dispatch]);
3551
- };
3552
-
3553
- var asyncReducers = {}; // placeholder for injected reducers
3554
-
3555
- var injectReducer = function injectReducer(store) {
3556
- var staticReducers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3557
- var key = arguments.length > 2 ? arguments[2] : undefined;
3558
- var asyncReducer = arguments.length > 3 ? arguments[3] : undefined;
3559
- if (!asyncReducers[key]) {
3560
- asyncReducers[key] = asyncReducer;
3561
- store.replaceReducer(combineReducers(_objectSpread2(_objectSpread2({}, staticReducers), asyncReducers)));
3562
- }
3563
- };
3564
- var injectSlice = function injectSlice(store, staticReducers, slice) {
3565
- return injectReducer(store, staticReducers, slice.name, slice.reducer);
3566
- };
3567
- var getSetterActionName = function getSetterActionName(name) {
3568
- return "set".concat(upperFirst_1(name));
3569
- };
3570
- var makeSetterReducersFromInitialState = function makeSetterReducersFromInitialState(initialState, config, pluginsData) {
3571
- var reducer = {};
3572
- Object.keys(initialState).forEach(function (name) {
3573
- var key = getSetterActionName(name);
3574
- reducer[key] = function (state, action) {
3575
- var value = action.payload;
3576
- pluginsData[name].forEach(function (_ref) {
3577
- var data = _ref.data,
3578
- plugin = _ref.plugin;
3579
- value = plugin.update(value, _objectSpread2({
3580
- state: state,
3581
- config: plugin.config,
3582
- draft: state
3583
- }, data)); // provide both state. and draft. apis so fewer users complain
3584
- });
3585
-
3586
- state[name] = value;
3587
- };
3588
- });
3589
- return reducer;
3590
- };
3591
-
3592
- /* eslint-enable react/forbid-foreign-prop-types */
3593
-
3594
- var plugin = function plugin(_ref) {
3595
- var constructorFn = _ref.constructor,
3596
- setup = _ref.setup,
3597
- getInitialValue = _ref.getInitialValue,
3598
- update = _ref.update,
3599
- _ref$config = _ref.config,
3600
- config = _ref$config === void 0 ? {} : _ref$config;
3601
- return /*#__PURE__*/function () {
3602
- function _class(value) {
3603
- _classCallCheck(this, _class);
3604
- this.value = value;
3605
- this.setup = setup || this.setup;
3606
- this.getInitialValue = getInitialValue || this.getInitialValue;
3607
- this.update = update || this.update;
3608
- this.config = config;
3609
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3610
- args[_key - 1] = arguments[_key];
3611
- }
3612
- constructorFn === null || constructorFn === void 0 ? void 0 : constructorFn.call.apply(constructorFn, [this, value].concat(args));
3613
- }
3614
-
3615
- // either the initial state value or the next plugin
3616
- _createClass(_class, [{
3617
- key: "getValue",
3618
- value: function getValue() {
3619
- return this.value;
3620
- }
3621
- }, {
3622
- key: "setValue",
3623
- value: function setValue(value) {
3624
- this.value = value;
3625
- }
3626
- }, {
3627
- key: "setConfig",
3628
- value: function setConfig(config) {
3629
- this.config = _objectSpread2(_objectSpread2({}, this.config), config);
3630
- }
3631
- }, {
3632
- key: "setup",
3633
- value: function setup(item, _ref2) {
3634
- _objectDestructuringEmpty(_ref2);
3635
- return {
3636
- plugin: item
3637
- };
3638
- }
3639
- }, {
3640
- key: "getInitialValue",
3641
- value: function getInitialValue(value, _ref3) {
3642
- _objectDestructuringEmpty(_ref3);
3643
- return value;
3644
- }
3645
- }, {
3646
- key: "update",
3647
- value: function update(value, _ref4) {
3648
- _objectDestructuringEmpty(_ref4);
3649
- return value;
3650
- }
3651
- }]);
3652
- return _class;
3653
- }();
3654
- };
3655
- var addPlugin = function addPlugin(config) {
3656
- var Class = plugin(config);
3657
- plugins.push(Class);
3658
- return function () {
3659
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3660
- args[_key2] = arguments[_key2];
3661
- }
3662
- return _construct(Class, args);
3663
- };
3664
- };
3665
- var addPlugins = function addPlugins() {
3666
- for (var _len3 = arguments.length, configs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
3667
- configs[_key3] = arguments[_key3];
3668
- }
3669
- return configs.map(addPlugin);
3670
- };
3671
- var plugins = [];
3672
-
3673
- var makeSelectorHook = function makeSelectorHook(selector) {
3674
- return function () {
3675
- return useSelector(selector, shallowEqual);
3676
- };
3677
- };
3678
- var createSelectorUpdateHook = function createSelectorUpdateHook(selector, action) {
3679
- return function () {
3680
- return [useSelector(selector), useAction(action, undefined)];
3681
- };
3682
- };
3683
- var createSelectorHook = function createSelectorHook() {
3684
- // creates a redux selector and a react hook that produce identical results
3685
- var selector = createDraftSafeSelector.apply(void 0, arguments);
3686
- var hook = makeSelectorHook(selector);
3687
- hook.select = selector;
3688
- return hook;
3689
- };
3690
- var configure$1 = function configure(store) {
3691
- var makeDomainSelector = function makeDomainSelector(name, initialState) {
3692
- return function (state) {
3693
- return (state === null || state === void 0 ? void 0 : state[name]) || initialState;
3694
- };
3695
- };
3696
- var makeDomainSelectorFromSlice = function makeDomainSelectorFromSlice(slice) {
3697
- return makeDomainSelector(slice.name, slice.getInitialState());
3698
- };
3699
- var selectProp = function selectProp(name, defaultValue) {
3700
- return function (substate) {
3701
- return get_1(substate, name, defaultValue);
3702
- };
3703
- };
3704
- var makePropertySelectorHookFactory = function makePropertySelectorHookFactory(baseSelector, slice) {
3705
- return function (names) {
3706
- // to be used in conjunction with singlePropReducer to mimic the useState api,
3707
- // but for individual pieces of redux state rather than component state
3708
- // usage:
3709
- // selector.js:
3710
- // const selectDomain = state => state?.[domain] || initialState;
3711
- // const createUseState = makePropertySelectorHookFactory(baseSelector, slice);
3712
- // const [selectMyData, useMyData] = createUseState("myData");
3713
- // index.js:
3714
- // const [data, setData] = useMyData();
3715
- if (Array.isArray(names)) {
3716
- return names.map(function (name) {
3717
- return makeReduxStateHook(name, baseSelector, slice);
3718
- });
3719
- }
3720
- names = [names];
3721
- return makeReduxStateHook(names, baseSelector, slice);
3722
- };
3723
- };
3724
- var makeReduxStateHook = function makeReduxStateHook(name, baseSelector, slice) {
3725
- var selector = createDraftSafeSelector(baseSelector, selectProp(name));
3726
- var actionName = getSetterActionName(name);
3727
- var updateAction = function updateAction() {
3728
- var _slice$actions;
3729
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3730
- args[_key] = arguments[_key];
3731
- }
3732
- var params = args;
3733
- if (args.length === 1 && typeof args[0] === "function") {
3734
- params = [args[0](selector(store.getState()))];
3735
- }
3736
- return (_slice$actions = slice.actions)[actionName].apply(_slice$actions, _toConsumableArray(params));
3737
- };
3738
- updateAction.toString = function () {
3739
- return slice.actions[actionName].toString();
3740
- };
3741
- if (!updateAction) {
3742
- throw Error("Action ".concat(slice.name, "/").concat(actionName, " not defined"));
3743
- }
3744
- var useState = function useState() {
3745
- var setterCb = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (value) {
3746
- return value;
3747
- };
3748
- return [useSelector(selector), useAction(function (value) {
3749
- return updateAction(setterCb(value));
3750
- }, undefined)];
3751
- };
3752
- useState.select = selector;
3753
- useState.update = updateAction;
3754
- return useState;
3755
- };
3756
- var getHookName = function getHookName(key) {
3757
- return "use".concat(upperFirst_1(key));
3758
- };
3759
- var makePropertySelectorHooksFromInitialState = function makePropertySelectorHooksFromInitialState(baseSelector, slice, initialState) {
3760
- var selectorHooksFactory = makePropertySelectorHookFactory(baseSelector, slice);
3761
- var selectorHooksObject = {};
3762
- Object.keys(initialState).forEach(function (key, i) {
3763
- selectorHooksObject[getHookName(key)] = selectorHooksFactory(key);
3764
- });
3765
- return selectorHooksObject;
3766
- };
3767
- var makePropertySelectorsFromSlice = function makePropertySelectorsFromSlice(slice) {
3768
- var selectDomain = makeDomainSelectorFromSlice(slice);
3769
- return _objectSpread2({
3770
- selectDomain: selectDomain
3771
- }, makePropertySelectorHooksFromInitialState(selectDomain, slice, slice.getInitialState()));
3772
- };
3773
- return {
3774
- makePropertySelectorsFromSlice: makePropertySelectorsFromSlice
3775
- };
3776
- };
3777
-
3778
- var _excluded = ["middleware", "devTools", "preloadedState", "enhancers"],
3779
- _excluded2 = ["selectDomain"];
3780
- var configure = function configure(_ref) {
3781
- var _middleware = _ref.middleware,
3782
- devTools = _ref.devTools,
3783
- preloadedState = _ref.preloadedState,
3784
- enhancers = _ref.enhancers,
3785
- staticReducers = _objectWithoutProperties(_ref, _excluded);
3786
- var store = configureStore({
3787
- // @ts-ignore-next-line
3788
- reducer: combineReducers(staticReducers),
3789
- middleware: function middleware(getDefaultMiddleware) {
3790
- return [].concat(_toConsumableArray(typeof _middleware === "function" ? _middleware(getDefaultMiddleware) : _middleware || []), [injectableMiddleware]);
3791
- },
3792
- devTools: devTools,
3793
- preloadedState: preloadedState,
3794
- enhancers: enhancers
3795
- });
3796
- var _configureSelectors = configure$1(store),
3797
- makePropertySelectorsFromSlice = _configureSelectors.makePropertySelectorsFromSlice;
3798
- var injectSlice$1 = function injectSlice$1(slice) {
3799
- return injectSlice(store, staticReducers, slice);
3800
- };
3801
- var injectReducer$1 = function injectReducer$1(key, asyncReducer) {
3802
- return injectReducer(store, staticReducers, key, asyncReducer);
3803
- };
3804
- var createAutomatedSlice = function createAutomatedSlice(sliceConfig, rtkConfig) {
3805
- var pluginData = {};
3806
- map_1(sliceConfig.initialState, function (_item, key) {
3807
- var item = _item; // cache it here to pull item -> value -> value -> value if multiple plugins are used...
3808
-
3809
- var foundIndex;
3810
- var findPlugin = function findPlugin() {
3811
- foundIndex = plugins.findIndex(function (type) {
3812
- return item instanceof type;
3813
- });
3814
- };
3815
- findPlugin();
3816
- var activePlugins = [];
3817
- while (foundIndex != -1) {
3818
- activePlugins.push({
3819
- data: _objectSpread2({
3820
- sliceConfig: sliceConfig,
3821
- key: key,
3822
- plugin: item
3823
- }, item.setup(item, {
3824
- key: key,
3825
- sliceConfig: sliceConfig,
3826
- config: item.config
3827
- })),
3828
- plugin: item
3829
- });
3830
- item = item.value; // pull the next value or plugin off the stack
3831
-
3832
- findPlugin();
3833
- }
3834
- var value = item;
3835
- for (var _i = 0, _activePlugins = activePlugins; _i < _activePlugins.length; _i++) {
3836
- var _activePlugins$_i = _activePlugins[_i],
3837
- data = _activePlugins$_i.data,
3838
- plugin = _activePlugins$_i.plugin;
3839
- value = plugin.getInitialValue(value, _objectSpread2({
3840
- config: plugin.config,
3841
- plugin: plugin,
3842
- key: key
3843
- }, data));
3844
- }
3845
- sliceConfig.initialState[key] = value;
3846
- pluginData[key] = activePlugins;
3847
- });
3848
- var setterReducers = makeSetterReducersFromInitialState(sliceConfig.initialState, rtkConfig, pluginData);
3849
- var sliceSetterKey = "setSlice";
3850
- while (setterReducers[sliceSetterKey]) {
3851
- // avoid naming conflicts if initialState has a "slice" property
3852
- sliceSetterKey = "_".concat(sliceSetterKey);
3853
- }
3854
- var slice = createSlice(_objectSpread2(_objectSpread2({}, sliceConfig), {}, {
3855
- reducers: _objectSpread2(_objectSpread2({}, setterReducers), {}, _defineProperty({
3856
- __override__slice__caution: function __override__slice__caution(state, action) {
3857
- return action.payload;
3858
- }
3859
- }, sliceSetterKey, function (state, action) {
3860
- var _loop = function _loop(key) {
3861
- var actionType = "set".concat(upperFirst_1(key));
3862
- var setter = setterReducers[actionType] || function (_state, _action) {
3863
- _state[key] = _action.payload;
3864
- };
3865
- setter(state, {
3866
- type: actionType,
3867
- payload: action.payload[key]
3868
- });
3869
- };
3870
- for (var key in action.payload) {
3871
- _loop(key);
3872
- }
3873
- }), sliceConfig.reducers || {})
3874
- }));
3875
- var _makePropertySelector = makePropertySelectorsFromSlice(slice),
3876
- selectDomain = _makePropertySelector.selectDomain,
3877
- hooks = _objectWithoutProperties(_makePropertySelector, _excluded2);
3878
- var domainHookKey = "useSlice";
3879
- while (!!hooks[domainHookKey]) {
3880
- // avoid naming conflicts in case initialState contains a "domain" property
3881
- domainHookKey = domainHookKey.replace(/(^use)(.*)(Slice$)/, "$1$2_$3");
3882
- }
3883
- var getParams = function getParams() {
3884
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3885
- args[_key] = arguments[_key];
3886
- }
3887
- var params = args;
3888
- if (args.length === 1 && typeof args[0] === "function") {
3889
- // if the first and only arg is a function, call it with the current state
3890
- params = [args[0](selectDomain(store.getState()))];
3891
- }
3892
- return params;
3893
- };
3894
- var updateFn = function updateFn() {
3895
- var _slice$actions;
3896
- return (_slice$actions = slice.actions)[sliceSetterKey].apply(_slice$actions, _toConsumableArray(getParams.apply(void 0, arguments)));
3897
- };
3898
- updateFn.toString = function () {
3899
- return slice.actions[sliceSetterKey].toString();
3900
- };
3901
-
3902
- /* eslint-disable react-hooks/rules-of-hooks */
3903
- hooks[domainHookKey] = function () {
3904
- return [useSelector(selectDomain), useAction(slice.actions[sliceSetterKey], undefined).apply(void 0, _toConsumableArray(getParams())),
3905
- // prop updater
3906
- useAction(slice.actions.__override__slice__caution, undefined) // state overwriter
3907
- ];
3908
- };
3909
-
3910
- hooks[domainHookKey].select = selectDomain;
3911
- hooks[domainHookKey].update = updateFn;
3912
- /* eslint-enable react-hooks/rules-of-hooks */
3913
-
3914
- slice.hooks = hooks;
3915
- slice.selectors = _objectSpread2({
3916
- selectDomain: selectDomain
3917
- }, reduce_1(map_1(slice.hooks, function (hook, key) {
3918
- return _defineProperty({}, key.replace(/^use/, "select"), hook.select);
3919
- }), function (a, b) {
3920
- return _objectSpread2(_objectSpread2({}, a), b);
3921
- }));
3922
- injectSlice$1(slice);
3923
- return slice;
3924
- };
3925
- var astroglide = function astroglide(name, initialState) {
3926
- var rtkConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3927
- var astroglideConfigOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3928
- var shorthandParams = _typeof(name) === "object";
3929
- var params = [].concat(_toConsumableArray(shorthandParams ? [name, initialState, rtkConfig] : [_objectSpread2(_objectSpread2({}, rtkConfig), {}, {
3930
- name: name,
3931
- initialState: initialState
3932
- })]), [shorthandParams ? astroglideConfigOverrides : initialState]);
3933
- return createAutomatedSlice.apply(void 0, _toConsumableArray(params));
3934
- };
3935
- return {
3936
- createSlice: astroglide,
3937
- astroglide: astroglide,
3938
- injectReducer: injectReducer$1,
3939
- injectSlice: injectSlice$1,
3940
- injectMiddleware: injectMiddleware,
3941
- store: store
3942
- };
3943
- };
3944
-
3945
- export { addPlugin, addPlugins, configure, createSelectorHook, createSelectorUpdateHook, configure as default, plugins };
1
+ import{bindActionCreators as t,combineReducers as r,createDraftSafeSelector as e,configureStore as n,createSlice as o}from"@reduxjs/toolkit";import{useDispatch as u,useSelector as i,shallowEqual as a}from"react-redux";import{injectableMiddleware as c,injectMiddleware as f}from"redux-injectable-middleware";import{useMemo as l}from"react";function s(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function v(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?s(Object(e),!0).forEach((function(r){d(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function y(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,O(n.key),n)}}function d(t,r,e){return(r=O(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function h(t,r){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},h(t,r)}function b(t,r,e){return b=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,r,e){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(t,n));return e&&h(o,e.prototype),o},b.apply(null,arguments)}function g(t){if(null==t)throw new TypeError("Cannot destructure "+t)}function _(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},u=Object.keys(t);for(n=0;n<u.length;n++)e=u[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(n=0;n<u.length;n++)e=u[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function j(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(!t)return;if("string"==typeof t)return m(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return m(t,r)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function O(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}var w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var S=function(t,r){for(var e=-1,n=null==t?0:t.length,o=Array(n);++e<n;)o[e]=r(t[e],e,t);return o};var A=function(){this.__data__=[],this.size=0};var P=function(t,r){return t===r||t!=t&&r!=r},k=P;var x=function(t,r){for(var e=t.length;e--;)if(k(t[e][0],r))return e;return-1},z=x,E=Array.prototype.splice;var I=x;var T=x;var $=x;var D=A,R=function(t){var r=this.__data__,e=z(r,t);return!(e<0)&&(e==r.length-1?r.pop():E.call(r,e,1),--this.size,!0)},C=function(t){var r=this.__data__,e=I(r,t);return e<0?void 0:r[e][1]},F=function(t){return T(this.__data__,t)>-1},V=function(t,r){var e=this.__data__,n=$(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function B(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}B.prototype.clear=D,B.prototype.delete=R,B.prototype.get=C,B.prototype.has=F,B.prototype.set=V;var M=B,U=M;var L=function(){this.__data__=new U,this.size=0};var N=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e};var W=function(t){return this.__data__.get(t)};var q=function(t){return this.__data__.has(t)},G="object"==typeof w&&w&&w.Object===Object&&w,H=G,J="object"==typeof self&&self&&self.Object===Object&&self,K=H||J||Function("return this")(),Q=K.Symbol,X=Q,Y=Object.prototype,Z=Y.hasOwnProperty,tt=Y.toString,rt=X?X.toStringTag:void 0;var et=function(t){var r=Z.call(t,rt),e=t[rt];try{t[rt]=void 0;var n=!0}catch(t){}var o=tt.call(t);return n&&(r?t[rt]=e:delete t[rt]),o},nt=Object.prototype.toString;var ot=et,ut=function(t){return nt.call(t)},it=Q?Q.toStringTag:void 0;var at=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":it&&it in Object(t)?ot(t):ut(t)};var ct=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)},ft=at,lt=ct;var st,vt=function(t){if(!lt(t))return!1;var r=ft(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},pt=K["__core-js_shared__"],yt=(st=/[^.]+$/.exec(pt&&pt.keys&&pt.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"";var dt=function(t){return!!yt&&yt in t},ht=Function.prototype.toString;var bt=function(t){if(null!=t){try{return ht.call(t)}catch(t){}try{return t+""}catch(t){}}return""},gt=vt,_t=dt,jt=ct,mt=bt,Ot=/^\[object .+?Constructor\]$/,wt=Function.prototype,St=Object.prototype,At=wt.toString,Pt=St.hasOwnProperty,kt=RegExp("^"+At.call(Pt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var xt=function(t){return!(!jt(t)||_t(t))&&(gt(t)?kt:Ot).test(mt(t))},zt=function(t,r){return null==t?void 0:t[r]};var Et=function(t,r){var e=zt(t,r);return xt(e)?e:void 0},It=Et(K,"Map"),Tt=Et(Object,"create"),$t=Tt;var Dt=function(){this.__data__=$t?$t(null):{},this.size=0};var Rt=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},Ct=Tt,Ft=Object.prototype.hasOwnProperty;var Vt=function(t){var r=this.__data__;if(Ct){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return Ft.call(r,t)?r[t]:void 0},Bt=Tt,Mt=Object.prototype.hasOwnProperty;var Ut=Tt;var Lt=Dt,Nt=Rt,Wt=Vt,qt=function(t){var r=this.__data__;return Bt?void 0!==r[t]:Mt.call(r,t)},Gt=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=Ut&&void 0===r?"__lodash_hash_undefined__":r,this};function Ht(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}Ht.prototype.clear=Lt,Ht.prototype.delete=Nt,Ht.prototype.get=Wt,Ht.prototype.has=qt,Ht.prototype.set=Gt;var Jt=Ht,Kt=M,Qt=It;var Xt=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t};var Yt=function(t,r){var e=t.__data__;return Xt(r)?e["string"==typeof r?"string":"hash"]:e.map},Zt=Yt;var tr=Yt;var rr=Yt;var er=Yt;var nr=function(){this.size=0,this.__data__={hash:new Jt,map:new(Qt||Kt),string:new Jt}},or=function(t){var r=Zt(this,t).delete(t);return this.size-=r?1:0,r},ur=function(t){return tr(this,t).get(t)},ir=function(t){return rr(this,t).has(t)},ar=function(t,r){var e=er(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this};function cr(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}cr.prototype.clear=nr,cr.prototype.delete=or,cr.prototype.get=ur,cr.prototype.has=ir,cr.prototype.set=ar;var fr=cr,lr=M,sr=It,vr=fr;var pr=M,yr=L,dr=N,hr=W,br=q,gr=function(t,r){var e=this.__data__;if(e instanceof lr){var n=e.__data__;if(!sr||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new vr(n)}return e.set(t,r),this.size=e.size,this};function _r(t){var r=this.__data__=new pr(t);this.size=r.size}_r.prototype.clear=yr,_r.prototype.delete=dr,_r.prototype.get=hr,_r.prototype.has=br,_r.prototype.set=gr;var jr=_r;var mr=fr,Or=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},wr=function(t){return this.__data__.has(t)};function Sr(t){var r=-1,e=null==t?0:t.length;for(this.__data__=new mr;++r<e;)this.add(t[r])}Sr.prototype.add=Sr.prototype.push=Or,Sr.prototype.has=wr;var Ar=Sr,Pr=function(t,r){for(var e=-1,n=null==t?0:t.length;++e<n;)if(r(t[e],e,t))return!0;return!1},kr=function(t,r){return t.has(r)};var xr=function(t,r,e,n,o,u){var i=1&e,a=t.length,c=r.length;if(a!=c&&!(i&&c>a))return!1;var f=u.get(t),l=u.get(r);if(f&&l)return f==r&&l==t;var s=-1,v=!0,p=2&e?new Ar:void 0;for(u.set(t,r),u.set(r,t);++s<a;){var y=t[s],d=r[s];if(n)var h=i?n(d,y,s,r,t,u):n(y,d,s,t,r,u);if(void 0!==h){if(h)continue;v=!1;break}if(p){if(!Pr(r,(function(t,r){if(!kr(p,r)&&(y===t||o(y,t,e,n,u)))return p.push(r)}))){v=!1;break}}else if(y!==d&&!o(y,d,e,n,u)){v=!1;break}}return u.delete(t),u.delete(r),v};var zr=function(t){var r=-1,e=Array(t.size);return t.forEach((function(t,n){e[++r]=[n,t]})),e};var Er=K.Uint8Array,Ir=P,Tr=xr,$r=zr,Dr=function(t){var r=-1,e=Array(t.size);return t.forEach((function(t){e[++r]=t})),e},Rr=Q?Q.prototype:void 0,Cr=Rr?Rr.valueOf:void 0;var Fr=function(t,r,e,n,o,u,i){switch(e){case"[object DataView]":if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=r.byteLength||!u(new Er(t),new Er(r)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ir(+t,+r);case"[object Error]":return t.name==r.name&&t.message==r.message;case"[object RegExp]":case"[object String]":return t==r+"";case"[object Map]":var a=$r;case"[object Set]":var c=1&n;if(a||(a=Dr),t.size!=r.size&&!c)return!1;var f=i.get(t);if(f)return f==r;n|=2,i.set(t,r);var l=Tr(a(t),a(r),n,o,u,i);return i.delete(t),l;case"[object Symbol]":if(Cr)return Cr.call(t)==Cr.call(r)}return!1};var Vr=function(t,r){for(var e=-1,n=r.length,o=t.length;++e<n;)t[o+e]=r[e];return t},Br=Array.isArray,Mr=Vr,Ur=Br;var Lr=function(t,r,e){var n=r(t);return Ur(t)?n:Mr(n,e(t))};var Nr=function(t,r){for(var e=-1,n=null==t?0:t.length,o=0,u=[];++e<n;){var i=t[e];r(i,e,t)&&(u[o++]=i)}return u},Wr=function(){return[]},qr=Object.prototype.propertyIsEnumerable,Gr=Object.getOwnPropertySymbols,Hr=Gr?function(t){return null==t?[]:(t=Object(t),Nr(Gr(t),(function(r){return qr.call(t,r)})))}:Wr;var Jr=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n};var Kr=function(t){return null!=t&&"object"==typeof t},Qr=at,Xr=Kr;var Yr=function(t){return Xr(t)&&"[object Arguments]"==Qr(t)},Zr=Kr,te=Object.prototype,re=te.hasOwnProperty,ee=te.propertyIsEnumerable,ne=Yr(function(){return arguments}())?Yr:function(t){return Zr(t)&&re.call(t,"callee")&&!ee.call(t,"callee")},oe={exports:{}};var ue=function(){return!1};!function(t,r){var e=K,n=ue,o=r&&!r.nodeType&&r,u=o&&t&&!t.nodeType&&t,i=u&&u.exports===o?e.Buffer:void 0,a=(i?i.isBuffer:void 0)||n;t.exports=a}(oe,oe.exports);var ie=/^(?:0|[1-9]\d*)$/;var ae=function(t,r){var e=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&ie.test(t))&&t>-1&&t%1==0&&t<r};var ce=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},fe=at,le=ce,se=Kr,ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;var pe=function(t){return se(t)&&le(t.length)&&!!ve[fe(t)]};var ye=function(t){return function(r){return t(r)}},de={exports:{}};!function(t,r){var e=G,n=r&&!r.nodeType&&r,o=n&&t&&!t.nodeType&&t,u=o&&o.exports===n&&e.process,i=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=i}(de,de.exports);var he=pe,be=ye,ge=de.exports,_e=ge&&ge.isTypedArray,je=_e?be(_e):he,me=Jr,Oe=ne,we=Br,Se=oe.exports,Ae=ae,Pe=je,ke=Object.prototype.hasOwnProperty;var xe=function(t,r){var e=we(t),n=!e&&Oe(t),o=!e&&!n&&Se(t),u=!e&&!n&&!o&&Pe(t),i=e||n||o||u,a=i?me(t.length,String):[],c=a.length;for(var f in t)!r&&!ke.call(t,f)||i&&("length"==f||o&&("offset"==f||"parent"==f)||u&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||Ae(f,c))||a.push(f);return a},ze=Object.prototype;var Ee=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||ze)};var Ie=function(t,r){return function(e){return t(r(e))}}(Object.keys,Object),Te=Ee,$e=Ie,De=Object.prototype.hasOwnProperty;var Re=vt,Ce=ce;var Fe=function(t){return null!=t&&Ce(t.length)&&!Re(t)},Ve=xe,Be=function(t){if(!Te(t))return $e(t);var r=[];for(var e in Object(t))De.call(t,e)&&"constructor"!=e&&r.push(e);return r},Me=Fe;var Ue=function(t){return Me(t)?Ve(t):Be(t)},Le=Lr,Ne=Hr,We=Ue;var qe=function(t){return Le(t,We,Ne)},Ge=Object.prototype.hasOwnProperty;var He=function(t,r,e,n,o,u){var i=1&e,a=qe(t),c=a.length;if(c!=qe(r).length&&!i)return!1;for(var f=c;f--;){var l=a[f];if(!(i?l in r:Ge.call(r,l)))return!1}var s=u.get(t),v=u.get(r);if(s&&v)return s==r&&v==t;var p=!0;u.set(t,r),u.set(r,t);for(var y=i;++f<c;){var d=t[l=a[f]],h=r[l];if(n)var b=i?n(h,d,l,r,t,u):n(d,h,l,t,r,u);if(!(void 0===b?d===h||o(d,h,e,n,u):b)){p=!1;break}y||(y="constructor"==l)}if(p&&!y){var g=t.constructor,_=r.constructor;g==_||!("constructor"in t)||!("constructor"in r)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(p=!1)}return u.delete(t),u.delete(r),p},Je=Et(K,"DataView"),Ke=It,Qe=Et(K,"Promise"),Xe=Et(K,"Set"),Ye=Et(K,"WeakMap"),Ze=at,tn=bt,rn="[object Map]",en="[object Promise]",nn="[object Set]",on="[object WeakMap]",un="[object DataView]",an=tn(Je),cn=tn(Ke),fn=tn(Qe),ln=tn(Xe),sn=tn(Ye),vn=Ze;(Je&&vn(new Je(new ArrayBuffer(1)))!=un||Ke&&vn(new Ke)!=rn||Qe&&vn(Qe.resolve())!=en||Xe&&vn(new Xe)!=nn||Ye&&vn(new Ye)!=on)&&(vn=function(t){var r=Ze(t),e="[object Object]"==r?t.constructor:void 0,n=e?tn(e):"";if(n)switch(n){case an:return un;case cn:return rn;case fn:return en;case ln:return nn;case sn:return on}return r});var pn=jr,yn=xr,dn=Fr,hn=He,bn=vn,gn=Br,_n=oe.exports,jn=je,mn="[object Arguments]",On="[object Array]",wn="[object Object]",Sn=Object.prototype.hasOwnProperty;var An=function(t,r,e,n,o,u){var i=gn(t),a=gn(r),c=i?On:bn(t),f=a?On:bn(r),l=(c=c==mn?wn:c)==wn,s=(f=f==mn?wn:f)==wn,v=c==f;if(v&&_n(t)){if(!_n(r))return!1;i=!0,l=!1}if(v&&!l)return u||(u=new pn),i||jn(t)?yn(t,r,e,n,o,u):dn(t,r,c,e,n,o,u);if(!(1&e)){var p=l&&Sn.call(t,"__wrapped__"),y=s&&Sn.call(r,"__wrapped__");if(p||y){var d=p?t.value():t,h=y?r.value():r;return u||(u=new pn),o(d,h,e,n,u)}}return!!v&&(u||(u=new pn),hn(t,r,e,n,o,u))},Pn=Kr;var kn=function t(r,e,n,o,u){return r===e||(null==r||null==e||!Pn(r)&&!Pn(e)?r!=r&&e!=e:An(r,e,n,o,t,u))},xn=jr,zn=kn;var En=ct;var In=function(t){return t==t&&!En(t)},Tn=In,$n=Ue;var Dn=function(t,r){return function(e){return null!=e&&(e[t]===r&&(void 0!==r||t in Object(e)))}},Rn=function(t,r,e,n){var o=e.length,u=o,i=!n;if(null==t)return!u;for(t=Object(t);o--;){var a=e[o];if(i&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<u;){var c=(a=e[o])[0],f=t[c],l=a[1];if(i&&a[2]){if(void 0===f&&!(c in t))return!1}else{var s=new xn;if(n)var v=n(f,l,c,t,r,s);if(!(void 0===v?zn(l,f,3,n,s):v))return!1}}return!0},Cn=function(t){for(var r=$n(t),e=r.length;e--;){var n=r[e],o=t[n];r[e]=[n,o,Tn(o)]}return r},Fn=Dn;var Vn=function(t){var r=Cn(t);return 1==r.length&&r[0][2]?Fn(r[0][0],r[0][1]):function(e){return e===t||Rn(e,t,r)}},Bn=at,Mn=Kr;var Un=function(t){return"symbol"==typeof t||Mn(t)&&"[object Symbol]"==Bn(t)},Ln=Br,Nn=Un,Wn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qn=/^\w*$/;var Gn=function(t,r){if(Ln(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!Nn(t))||(qn.test(t)||!Wn.test(t)||null!=r&&t in Object(r))},Hn=fr;function Jn(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var e=function(){var n=arguments,o=r?r.apply(this,n):n[0],u=e.cache;if(u.has(o))return u.get(o);var i=t.apply(this,n);return e.cache=u.set(o,i)||u,i};return e.cache=new(Jn.Cache||Hn),e}Jn.Cache=Hn;var Kn=Jn;var Qn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xn=/\\(\\)?/g,Yn=function(t){var r=Kn(t,(function(t){return 500===e.size&&e.clear(),t})),e=r.cache;return r}((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(Qn,(function(t,e,n,o){r.push(n?o.replace(Xn,"$1"):e||t)})),r})),Zn=S,to=Br,ro=Un,eo=Q?Q.prototype:void 0,no=eo?eo.toString:void 0;var oo=function t(r){if("string"==typeof r)return r;if(to(r))return Zn(r,t)+"";if(ro(r))return no?no.call(r):"";var e=r+"";return"0"==e&&1/r==-Infinity?"-0":e},uo=oo;var io=function(t){return null==t?"":uo(t)},ao=Br,co=Gn,fo=Yn,lo=io;var so=function(t,r){return ao(t)?t:co(t,r)?[t]:fo(lo(t))},vo=Un;var po=function(t){if("string"==typeof t||vo(t))return t;var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r},yo=so,ho=po;var bo=function(t,r){for(var e=0,n=(r=yo(r,t)).length;null!=t&&e<n;)t=t[ho(r[e++])];return e&&e==n?t:void 0},go=bo;var _o=function(t,r,e){var n=null==t?void 0:go(t,r);return void 0===n?e:n};var jo=so,mo=ne,Oo=Br,wo=ae,So=ce,Ao=po;var Po=function(t,r){return null!=t&&r in Object(t)},ko=function(t,r,e){for(var n=-1,o=(r=jo(r,t)).length,u=!1;++n<o;){var i=Ao(r[n]);if(!(u=null!=t&&e(t,i)))break;t=t[i]}return u||++n!=o?u:!!(o=null==t?0:t.length)&&So(o)&&wo(i,o)&&(Oo(t)||mo(t))};var xo=kn,zo=_o,Eo=function(t,r){return null!=t&&ko(t,r,Po)},Io=Gn,To=In,$o=Dn,Do=po;var Ro=bo;var Co=function(t){return function(r){return null==r?void 0:r[t]}},Fo=function(t){return function(r){return Ro(r,t)}},Vo=Gn,Bo=po;var Mo=Vn,Uo=function(t,r){return Io(t)&&To(r)?$o(Do(t),r):function(e){var n=zo(e,t);return void 0===n&&n===r?Eo(e,t):xo(r,n,3)}},Lo=function(t){return t},No=Br,Wo=function(t){return Vo(t)?Co(Bo(t)):Fo(t)};var qo=function(t){return"function"==typeof t?t:null==t?Lo:"object"==typeof t?No(t)?Uo(t[0],t[1]):Mo(t):Wo(t)};var Go=function(t){return function(r,e,n){for(var o=-1,u=Object(r),i=n(r),a=i.length;a--;){var c=i[t?a:++o];if(!1===e(u[c],c,u))break}return r}}(),Ho=Ue;var Jo=Fe;var Ko=function(t,r){return function(e,n){if(null==e)return e;if(!Jo(e))return t(e,n);for(var o=e.length,u=r?o:-1,i=Object(e);(r?u--:++u<o)&&!1!==n(i[u],u,i););return e}}((function(t,r){return t&&Go(t,r,Ho)})),Qo=Ko,Xo=Fe;var Yo=S,Zo=qo,tu=function(t,r){var e=-1,n=Xo(t)?Array(t.length):[];return Qo(t,(function(t,o,u){n[++e]=r(t,o,u)})),n},ru=Br;var eu=function(t,r){return(ru(t)?Yo:tu)(t,Zo(r))};var nu=function(t,r,e,n){var o=-1,u=null==t?0:t.length;for(n&&u&&(e=t[++o]);++o<u;)e=r(e,t[o],o,t);return e},ou=Ko,uu=qo,iu=function(t,r,e,n,o){return o(t,(function(t,o,u){e=n?(n=!1,t):r(e,t,o,u)})),e},au=Br;var cu=function(t,r,e){var n=au(t)?nu:iu,o=arguments.length<3;return n(t,uu(r),e,o,ou)};var fu=function(t,r,e){var n=-1,o=t.length;r<0&&(r=-r>o?0:o+r),(e=e>o?o:e)<0&&(e+=o),o=r>e?0:e-r>>>0,r>>>=0;for(var u=Array(o);++n<o;)u[n]=t[n+r];return u};var lu=function(t,r,e){var n=t.length;return e=void 0===e?n:e,!r&&e>=n?t:fu(t,r,e)},su=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var vu=function(t){return su.test(t)};var pu=function(t){return t.split("")},yu="\\ud800-\\udfff",du="["+yu+"]",hu="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",bu="\\ud83c[\\udffb-\\udfff]",gu="[^"+yu+"]",_u="(?:\\ud83c[\\udde6-\\uddff]){2}",ju="[\\ud800-\\udbff][\\udc00-\\udfff]",mu="(?:"+hu+"|"+bu+")"+"?",Ou="[\\ufe0e\\ufe0f]?",wu=Ou+mu+("(?:\\u200d(?:"+[gu,_u,ju].join("|")+")"+Ou+mu+")*"),Su="(?:"+[gu+hu+"?",hu,_u,ju,du].join("|")+")",Au=RegExp(bu+"(?="+bu+")|"+Su+wu,"g");var Pu=pu,ku=vu,xu=function(t){return t.match(Au)||[]};var zu=lu,Eu=vu,Iu=function(t){return ku(t)?xu(t):Pu(t)},Tu=io;var $u=function(t){return function(r){r=Tu(r);var e=Eu(r)?Iu(r):void 0,n=e?e[0]:r.charAt(0),o=e?zu(e,1).join(""):r.slice(1);return n[t]()+o}}("toUpperCase"),Du=function(t,r){return Ru([t],r)[0]},Ru=function(r,e){var n=u();return l((function(){return Array.isArray(r)?r.map((function(r){return t(r,n)})):t(r,n)}),e?[n].concat(j(e)):[n])},Cu={},Fu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;Cu[n]||(Cu[n]=o,t.replaceReducer(r(v(v({},e),Cu))))},Vu=function(t){return"set".concat($u(t))},Bu=function(t){var r=t.constructor,e=t.setup,n=t.getInitialValue,o=t.update,u=t.config,i=void 0===u?{}:u;return function(){function t(u){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.value=u,this.setup=e||this.setup,this.getInitialValue=n||this.getInitialValue,this.update=o||this.update,this.config=i;for(var a=arguments.length,c=new Array(a>1?a-1:0),f=1;f<a;f++)c[f-1]=arguments[f];null==r||r.call.apply(r,[this,u].concat(c))}var u,a,c;return u=t,a=[{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(t){this.value=t}},{key:"setConfig",value:function(t){this.config=v(v({},this.config),t)}},{key:"setup",value:function(t,r){return g(r),{plugin:t}}},{key:"getInitialValue",value:function(t,r){return g(r),t}},{key:"update",value:function(t,r){return g(r),t}}],a&&y(u.prototype,a),c&&y(u,c),Object.defineProperty(u,"prototype",{writable:!1}),t}()},Mu=function(t){var r=Bu(t);return Lu.push(r),function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return b(r,e)}},Uu=function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];return r.map(Mu)},Lu=[],Nu=function(t,r){return function(){return[i(t),Du(r,void 0)]}},Wu=function(){var t=e.apply(void 0,arguments),r=function(t){return function(){return i(t,a)}}(t);return r.select=t,r},qu=function(t){var r=function(r,n,o){var u=e(n,function(t,r){return function(e){return _o(e,t,r)}}(r)),a=Vu(r),c=function(){for(var r,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var c=n;return 1===n.length&&"function"==typeof n[0]&&(c=[n[0](u(t.getState()))]),(r=o.actions)[a].apply(r,j(c))};if(c.toString=function(){return o.actions[a].toString()},!c)throw Error("Action ".concat(o.name,"/").concat(a," not defined"));var f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return[i(u),Du((function(r){return c(t(r))}),void 0)]};return f.select=u,f.update=c,f},n=function(t,e,n){var o=function(t,e){return function(n){return Array.isArray(n)?n.map((function(n){return r(n,t,e)})):r(n=[n],t,e)}}(t,e),u={};return Object.keys(n).forEach((function(t,r){u[function(t){return"use".concat($u(t))}(t)]=o(t)})),u};return{makePropertySelectorsFromSlice:function(t){var r=function(t){return r=t.name,e=t.getInitialState(),function(t){return(null==t?void 0:t[r])||e};var r,e}(t);return v({selectDomain:r},n(r,t,t.getInitialState()))}}},Gu=["middleware","devTools","preloadedState","enhancers"],Hu=["selectDomain"],Ju=function(t){var e=t.middleware,u=t.devTools,a=t.preloadedState,l=t.enhancers,s=_(t,Gu),y=n({reducer:r(s),middleware:function(t){return[].concat(j("function"==typeof e?e(t):e||[]),[c])},devTools:u,preloadedState:a,enhancers:l}),h=qu(y).makePropertySelectorsFromSlice,b=function(t){return function(t,r,e){return Fu(t,r,e.name,e.reducer)}(y,s,t)},g=function(t,r){var e={};eu(t.initialState,(function(r,n){var o,u=r,i=function(){o=Lu.findIndex((function(t){return u instanceof t}))};i();for(var a=[];-1!=o;)a.push({data:v({sliceConfig:t,key:n,plugin:u},u.setup(u,{key:n,sliceConfig:t,config:u.config})),plugin:u}),u=u.value,i();for(var c=u,f=0,l=a;f<l.length;f++){var s=l[f],p=s.data,y=s.plugin;c=y.getInitialValue(c,v({config:y.config,plugin:y,key:n},p))}t.initialState[n]=c,e[n]=a}));for(var n,u,a,c=(n=t.initialState,u=e,a={},Object.keys(n).forEach((function(t){var r=Vu(t);a[r]=function(r,e){var n=e.payload;u[t].forEach((function(t){var e=t.data,o=t.plugin;n=o.update(n,v({state:r,config:o.config,draft:r},e))})),r[t]=n}})),a),f="setSlice";c[f];)f="_".concat(f);for(var l=o(v(v({},t),{},{reducers:v(v({},c),{},d({__override__slice__caution:function(t,r){return r.payload}},f,(function(t,r){var e=function(e){var n="set".concat($u(e));(c[n]||function(t,r){t[e]=r.payload})(t,{type:n,payload:r.payload[e]})};for(var n in r.payload)e(n)})),t.reducers||{})})),s=h(l),p=s.selectDomain,g=_(s,Hu),m="useSlice";g[m];)m=m.replace(/(^use)(.*)(Slice$)/,"$1$2_$3");var O=function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];var n=r;return 1===r.length&&"function"==typeof r[0]&&(n=[r[0](p(y.getState()))]),n},w=function(){var t;return(t=l.actions)[f].apply(t,j(O.apply(void 0,arguments)))};return w.toString=function(){return l.actions[f].toString()},g[m]=function(){return[i(p),Du(l.actions[f],void 0).apply(void 0,j(O())),Du(l.actions.__override__slice__caution,void 0)]},g[m].select=p,g[m].update=w,l.hooks=g,l.selectors=v(v({selectDomain:p},cu(eu(l.hooks,(function(t,r){return d({},r.replace(/^use/,"select"),t.select)})),(function(t,r){return v(v({},t),r)}))),l.selectors||{}),b(l),l},m=function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o="object"===p(t),u=[].concat(j(o?[t,r,e]:[v(v({},e),{},{name:t,initialState:r})]),[o?n:r]);return g.apply(void 0,j(u))};return{createSlice:m,astroglide:m,injectReducer:function(t,r){return Fu(y,s,t,r)},injectSlice:b,injectMiddleware:f,store:y}};export{Mu as addPlugin,Uu as addPlugins,Ju as configure,Wu as createSelectorHook,Nu as createSelectorUpdateHook,Ju as default,Lu as plugins};