@pie-element/hotspot 10.0.0-next.42 → 10.1.0-next.0

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