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