@pie-element/inline-dropdown 8.3.4-next.0 → 8.3.4-next.3

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