kritzel-stencil 0.0.104 → 0.0.105

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 (50) hide show
  1. package/dist/cjs/index-D62tBCuq.js.map +1 -1
  2. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js +22 -2050
  3. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js.map +1 -1
  4. package/dist/cjs/stencil.cjs.js.map +1 -1
  5. package/dist/collection/classes/handlers/rotation.handler.js +1 -0
  6. package/dist/collection/classes/handlers/rotation.handler.js.map +1 -1
  7. package/dist/collection/classes/objects/image.class.js +2 -4
  8. package/dist/collection/classes/objects/image.class.js.map +1 -1
  9. package/dist/collection/classes/objects/selection-group.class.js +8 -7
  10. package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
  11. package/dist/collection/classes/reviver.class.js +1 -1
  12. package/dist/collection/classes/reviver.class.js.map +1 -1
  13. package/dist/collection/classes/structures/octree.structure.js +2 -2
  14. package/dist/collection/classes/structures/octree.structure.js.map +1 -1
  15. package/dist/collection/classes/tools/image-tool.class.js +2 -1
  16. package/dist/collection/classes/tools/image-tool.class.js.map +1 -1
  17. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +4 -4
  18. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
  19. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +1 -1
  20. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +1 -1
  21. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +1 -1
  22. package/dist/collection/helpers/object.helper.js +2 -15
  23. package/dist/collection/helpers/object.helper.js.map +1 -1
  24. package/dist/components/kritzel-controls.js +1 -1
  25. package/dist/components/kritzel-editor.js +3 -3
  26. package/dist/components/kritzel-engine.js +1 -1
  27. package/dist/components/{p-DMSOfO6k.js → p-C3vo4rx8.js} +23 -22
  28. package/dist/components/p-C3vo4rx8.js.map +1 -0
  29. package/dist/components/{p-DJUnTtGg.js → p-D31-QJwi.js} +3 -3
  30. package/dist/components/{p-DJUnTtGg.js.map → p-D31-QJwi.js.map} +1 -1
  31. package/dist/components/p-DC8SDK2U.js.map +1 -1
  32. package/dist/components/p-DT8_Rz-o.js +785 -0
  33. package/dist/components/p-DT8_Rz-o.js.map +1 -0
  34. package/dist/esm/index-BOJOOWaP.js.map +1 -1
  35. package/dist/esm/kritzel-brush-style_18.entry.js +22 -2050
  36. package/dist/esm/kritzel-brush-style_18.entry.js.map +1 -1
  37. package/dist/esm/stencil.js.map +1 -1
  38. package/dist/stencil/p-BOJOOWaP.js.map +1 -1
  39. package/dist/stencil/p-d0394bb5.entry.js +2 -0
  40. package/dist/stencil/p-d0394bb5.entry.js.map +1 -0
  41. package/dist/stencil/stencil.esm.js +1 -1
  42. package/dist/stencil/stencil.esm.js.map +1 -1
  43. package/dist/types/classes/objects/image.class.d.ts +2 -2
  44. package/dist/types/helpers/object.helper.d.ts +0 -1
  45. package/package.json +3 -5
  46. package/dist/components/p-CFkDfXW4.js +0 -2814
  47. package/dist/components/p-CFkDfXW4.js.map +0 -1
  48. package/dist/components/p-DMSOfO6k.js.map +0 -1
  49. package/dist/stencil/p-f059fbff.entry.js +0 -2
  50. package/dist/stencil/p-f059fbff.entry.js.map +0 -1
@@ -316,2023 +316,6 @@ class KritzelMathHelper {
316
316
  }
317
317
  }
318
318
 
319
- /** Detect free variable `global` from Node.js. */
320
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
321
-
322
- /** Detect free variable `self`. */
323
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
324
-
325
- /** Used as a reference to the global object. */
326
- var root = freeGlobal || freeSelf || Function('return this')();
327
-
328
- /** Built-in value references. */
329
- var Symbol = root.Symbol;
330
-
331
- /** Used for built-in method references. */
332
- var objectProto$b = Object.prototype;
333
-
334
- /** Used to check objects for own properties. */
335
- var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
336
-
337
- /**
338
- * Used to resolve the
339
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
340
- * of values.
341
- */
342
- var nativeObjectToString$1 = objectProto$b.toString;
343
-
344
- /** Built-in value references. */
345
- var symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;
346
-
347
- /**
348
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
349
- *
350
- * @private
351
- * @param {*} value The value to query.
352
- * @returns {string} Returns the raw `toStringTag`.
353
- */
354
- function getRawTag(value) {
355
- var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
356
- tag = value[symToStringTag$1];
357
-
358
- try {
359
- value[symToStringTag$1] = undefined;
360
- var unmasked = true;
361
- } catch (e) {}
362
-
363
- var result = nativeObjectToString$1.call(value);
364
- if (unmasked) {
365
- if (isOwn) {
366
- value[symToStringTag$1] = tag;
367
- } else {
368
- delete value[symToStringTag$1];
369
- }
370
- }
371
- return result;
372
- }
373
-
374
- /** Used for built-in method references. */
375
- var objectProto$a = Object.prototype;
376
-
377
- /**
378
- * Used to resolve the
379
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
380
- * of values.
381
- */
382
- var nativeObjectToString = objectProto$a.toString;
383
-
384
- /**
385
- * Converts `value` to a string using `Object.prototype.toString`.
386
- *
387
- * @private
388
- * @param {*} value The value to convert.
389
- * @returns {string} Returns the converted string.
390
- */
391
- function objectToString(value) {
392
- return nativeObjectToString.call(value);
393
- }
394
-
395
- /** `Object#toString` result references. */
396
- var nullTag = '[object Null]',
397
- undefinedTag = '[object Undefined]';
398
-
399
- /** Built-in value references. */
400
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
401
-
402
- /**
403
- * The base implementation of `getTag` without fallbacks for buggy environments.
404
- *
405
- * @private
406
- * @param {*} value The value to query.
407
- * @returns {string} Returns the `toStringTag`.
408
- */
409
- function baseGetTag(value) {
410
- if (value == null) {
411
- return value === undefined ? undefinedTag : nullTag;
412
- }
413
- return (symToStringTag && symToStringTag in Object(value))
414
- ? getRawTag(value)
415
- : objectToString(value);
416
- }
417
-
418
- /**
419
- * Checks if `value` is object-like. A value is object-like if it's not `null`
420
- * and has a `typeof` result of "object".
421
- *
422
- * @static
423
- * @memberOf _
424
- * @since 4.0.0
425
- * @category Lang
426
- * @param {*} value The value to check.
427
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
428
- * @example
429
- *
430
- * _.isObjectLike({});
431
- * // => true
432
- *
433
- * _.isObjectLike([1, 2, 3]);
434
- * // => true
435
- *
436
- * _.isObjectLike(_.noop);
437
- * // => false
438
- *
439
- * _.isObjectLike(null);
440
- * // => false
441
- */
442
- function isObjectLike(value) {
443
- return value != null && typeof value == 'object';
444
- }
445
-
446
- /**
447
- * Checks if `value` is classified as an `Array` object.
448
- *
449
- * @static
450
- * @memberOf _
451
- * @since 0.1.0
452
- * @category Lang
453
- * @param {*} value The value to check.
454
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
455
- * @example
456
- *
457
- * _.isArray([1, 2, 3]);
458
- * // => true
459
- *
460
- * _.isArray(document.body.children);
461
- * // => false
462
- *
463
- * _.isArray('abc');
464
- * // => false
465
- *
466
- * _.isArray(_.noop);
467
- * // => false
468
- */
469
- var isArray = Array.isArray;
470
-
471
- /**
472
- * Checks if `value` is the
473
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
474
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
475
- *
476
- * @static
477
- * @memberOf _
478
- * @since 0.1.0
479
- * @category Lang
480
- * @param {*} value The value to check.
481
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
482
- * @example
483
- *
484
- * _.isObject({});
485
- * // => true
486
- *
487
- * _.isObject([1, 2, 3]);
488
- * // => true
489
- *
490
- * _.isObject(_.noop);
491
- * // => true
492
- *
493
- * _.isObject(null);
494
- * // => false
495
- */
496
- function isObject(value) {
497
- var type = typeof value;
498
- return value != null && (type == 'object' || type == 'function');
499
- }
500
-
501
- /** `Object#toString` result references. */
502
- var asyncTag = '[object AsyncFunction]',
503
- funcTag$2 = '[object Function]',
504
- genTag$1 = '[object GeneratorFunction]',
505
- proxyTag = '[object Proxy]';
506
-
507
- /**
508
- * Checks if `value` is classified as a `Function` object.
509
- *
510
- * @static
511
- * @memberOf _
512
- * @since 0.1.0
513
- * @category Lang
514
- * @param {*} value The value to check.
515
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
516
- * @example
517
- *
518
- * _.isFunction(_);
519
- * // => true
520
- *
521
- * _.isFunction(/abc/);
522
- * // => false
523
- */
524
- function isFunction(value) {
525
- if (!isObject(value)) {
526
- return false;
527
- }
528
- // The use of `Object#toString` avoids issues with the `typeof` operator
529
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
530
- var tag = baseGetTag(value);
531
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
532
- }
533
-
534
- /** Used to detect overreaching core-js shims. */
535
- var coreJsData = root['__core-js_shared__'];
536
-
537
- /** Used to detect methods masquerading as native. */
538
- var maskSrcKey = (function() {
539
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
540
- return uid ? ('Symbol(src)_1.' + uid) : '';
541
- }());
542
-
543
- /**
544
- * Checks if `func` has its source masked.
545
- *
546
- * @private
547
- * @param {Function} func The function to check.
548
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
549
- */
550
- function isMasked(func) {
551
- return !!maskSrcKey && (maskSrcKey in func);
552
- }
553
-
554
- /** Used for built-in method references. */
555
- var funcProto$1 = Function.prototype;
556
-
557
- /** Used to resolve the decompiled source of functions. */
558
- var funcToString$1 = funcProto$1.toString;
559
-
560
- /**
561
- * Converts `func` to its source code.
562
- *
563
- * @private
564
- * @param {Function} func The function to convert.
565
- * @returns {string} Returns the source code.
566
- */
567
- function toSource(func) {
568
- if (func != null) {
569
- try {
570
- return funcToString$1.call(func);
571
- } catch (e) {}
572
- try {
573
- return (func + '');
574
- } catch (e) {}
575
- }
576
- return '';
577
- }
578
-
579
- /**
580
- * Used to match `RegExp`
581
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
582
- */
583
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
584
-
585
- /** Used to detect host constructors (Safari). */
586
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
587
-
588
- /** Used for built-in method references. */
589
- var funcProto = Function.prototype,
590
- objectProto$9 = Object.prototype;
591
-
592
- /** Used to resolve the decompiled source of functions. */
593
- var funcToString = funcProto.toString;
594
-
595
- /** Used to check objects for own properties. */
596
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
597
-
598
- /** Used to detect if a method is native. */
599
- var reIsNative = RegExp('^' +
600
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
601
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
602
- );
603
-
604
- /**
605
- * The base implementation of `_.isNative` without bad shim checks.
606
- *
607
- * @private
608
- * @param {*} value The value to check.
609
- * @returns {boolean} Returns `true` if `value` is a native function,
610
- * else `false`.
611
- */
612
- function baseIsNative(value) {
613
- if (!isObject(value) || isMasked(value)) {
614
- return false;
615
- }
616
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
617
- return pattern.test(toSource(value));
618
- }
619
-
620
- /**
621
- * Gets the value at `key` of `object`.
622
- *
623
- * @private
624
- * @param {Object} [object] The object to query.
625
- * @param {string} key The key of the property to get.
626
- * @returns {*} Returns the property value.
627
- */
628
- function getValue(object, key) {
629
- return object == null ? undefined : object[key];
630
- }
631
-
632
- /**
633
- * Gets the native function at `key` of `object`.
634
- *
635
- * @private
636
- * @param {Object} object The object to query.
637
- * @param {string} key The key of the method to get.
638
- * @returns {*} Returns the function if it's native, else `undefined`.
639
- */
640
- function getNative(object, key) {
641
- var value = getValue(object, key);
642
- return baseIsNative(value) ? value : undefined;
643
- }
644
-
645
- /* Built-in method references that are verified to be native. */
646
- var WeakMap = getNative(root, 'WeakMap');
647
-
648
- /** Built-in value references. */
649
- var objectCreate = Object.create;
650
-
651
- /**
652
- * The base implementation of `_.create` without support for assigning
653
- * properties to the created object.
654
- *
655
- * @private
656
- * @param {Object} proto The object to inherit from.
657
- * @returns {Object} Returns the new object.
658
- */
659
- var baseCreate = (function() {
660
- function object() {}
661
- return function(proto) {
662
- if (!isObject(proto)) {
663
- return {};
664
- }
665
- if (objectCreate) {
666
- return objectCreate(proto);
667
- }
668
- object.prototype = proto;
669
- var result = new object;
670
- object.prototype = undefined;
671
- return result;
672
- };
673
- }());
674
-
675
- var defineProperty = (function() {
676
- try {
677
- var func = getNative(Object, 'defineProperty');
678
- func({}, '', {});
679
- return func;
680
- } catch (e) {}
681
- }());
682
-
683
- /**
684
- * A specialized version of `_.forEach` for arrays without support for
685
- * iteratee shorthands.
686
- *
687
- * @private
688
- * @param {Array} [array] The array to iterate over.
689
- * @param {Function} iteratee The function invoked per iteration.
690
- * @returns {Array} Returns `array`.
691
- */
692
- function arrayEach(array, iteratee) {
693
- var index = -1,
694
- length = array == null ? 0 : array.length;
695
-
696
- while (++index < length) {
697
- if (iteratee(array[index], index, array) === false) {
698
- break;
699
- }
700
- }
701
- return array;
702
- }
703
-
704
- /** Used as references for various `Number` constants. */
705
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
706
-
707
- /** Used to detect unsigned integer values. */
708
- var reIsUint = /^(?:0|[1-9]\d*)$/;
709
-
710
- /**
711
- * Checks if `value` is a valid array-like index.
712
- *
713
- * @private
714
- * @param {*} value The value to check.
715
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
716
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
717
- */
718
- function isIndex(value, length) {
719
- var type = typeof value;
720
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
721
-
722
- return !!length &&
723
- (type == 'number' ||
724
- (type != 'symbol' && reIsUint.test(value))) &&
725
- (value > -1 && value % 1 == 0 && value < length);
726
- }
727
-
728
- /**
729
- * The base implementation of `assignValue` and `assignMergeValue` without
730
- * value checks.
731
- *
732
- * @private
733
- * @param {Object} object The object to modify.
734
- * @param {string} key The key of the property to assign.
735
- * @param {*} value The value to assign.
736
- */
737
- function baseAssignValue(object, key, value) {
738
- if (key == '__proto__' && defineProperty) {
739
- defineProperty(object, key, {
740
- 'configurable': true,
741
- 'enumerable': true,
742
- 'value': value,
743
- 'writable': true
744
- });
745
- } else {
746
- object[key] = value;
747
- }
748
- }
749
-
750
- /**
751
- * Performs a
752
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
753
- * comparison between two values to determine if they are equivalent.
754
- *
755
- * @static
756
- * @memberOf _
757
- * @since 4.0.0
758
- * @category Lang
759
- * @param {*} value The value to compare.
760
- * @param {*} other The other value to compare.
761
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
762
- * @example
763
- *
764
- * var object = { 'a': 1 };
765
- * var other = { 'a': 1 };
766
- *
767
- * _.eq(object, object);
768
- * // => true
769
- *
770
- * _.eq(object, other);
771
- * // => false
772
- *
773
- * _.eq('a', 'a');
774
- * // => true
775
- *
776
- * _.eq('a', Object('a'));
777
- * // => false
778
- *
779
- * _.eq(NaN, NaN);
780
- * // => true
781
- */
782
- function eq(value, other) {
783
- return value === other || (value !== value && other !== other);
784
- }
785
-
786
- /** Used for built-in method references. */
787
- var objectProto$8 = Object.prototype;
788
-
789
- /** Used to check objects for own properties. */
790
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
791
-
792
- /**
793
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
794
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
795
- * for equality comparisons.
796
- *
797
- * @private
798
- * @param {Object} object The object to modify.
799
- * @param {string} key The key of the property to assign.
800
- * @param {*} value The value to assign.
801
- */
802
- function assignValue(object, key, value) {
803
- var objValue = object[key];
804
- if (!(hasOwnProperty$6.call(object, key) && eq(objValue, value)) ||
805
- (value === undefined && !(key in object))) {
806
- baseAssignValue(object, key, value);
807
- }
808
- }
809
-
810
- /** Used as references for various `Number` constants. */
811
- var MAX_SAFE_INTEGER = 9007199254740991;
812
-
813
- /**
814
- * Checks if `value` is a valid array-like length.
815
- *
816
- * **Note:** This method is loosely based on
817
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
818
- *
819
- * @static
820
- * @memberOf _
821
- * @since 4.0.0
822
- * @category Lang
823
- * @param {*} value The value to check.
824
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
825
- * @example
826
- *
827
- * _.isLength(3);
828
- * // => true
829
- *
830
- * _.isLength(Number.MIN_VALUE);
831
- * // => false
832
- *
833
- * _.isLength(Infinity);
834
- * // => false
835
- *
836
- * _.isLength('3');
837
- * // => false
838
- */
839
- function isLength(value) {
840
- return typeof value == 'number' &&
841
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
842
- }
843
-
844
- /**
845
- * Checks if `value` is array-like. A value is considered array-like if it's
846
- * not a function and has a `value.length` that's an integer greater than or
847
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
848
- *
849
- * @static
850
- * @memberOf _
851
- * @since 4.0.0
852
- * @category Lang
853
- * @param {*} value The value to check.
854
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
855
- * @example
856
- *
857
- * _.isArrayLike([1, 2, 3]);
858
- * // => true
859
- *
860
- * _.isArrayLike(document.body.children);
861
- * // => true
862
- *
863
- * _.isArrayLike('abc');
864
- * // => true
865
- *
866
- * _.isArrayLike(_.noop);
867
- * // => false
868
- */
869
- function isArrayLike(value) {
870
- return value != null && isLength(value.length) && !isFunction(value);
871
- }
872
-
873
- /** Used for built-in method references. */
874
- var objectProto$7 = Object.prototype;
875
-
876
- /**
877
- * Checks if `value` is likely a prototype object.
878
- *
879
- * @private
880
- * @param {*} value The value to check.
881
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
882
- */
883
- function isPrototype(value) {
884
- var Ctor = value && value.constructor,
885
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7;
886
-
887
- return value === proto;
888
- }
889
-
890
- /**
891
- * The base implementation of `_.times` without support for iteratee shorthands
892
- * or max array length checks.
893
- *
894
- * @private
895
- * @param {number} n The number of times to invoke `iteratee`.
896
- * @param {Function} iteratee The function invoked per iteration.
897
- * @returns {Array} Returns the array of results.
898
- */
899
- function baseTimes(n, iteratee) {
900
- var index = -1,
901
- result = Array(n);
902
-
903
- while (++index < n) {
904
- result[index] = iteratee(index);
905
- }
906
- return result;
907
- }
908
-
909
- /** `Object#toString` result references. */
910
- var argsTag$2 = '[object Arguments]';
911
-
912
- /**
913
- * The base implementation of `_.isArguments`.
914
- *
915
- * @private
916
- * @param {*} value The value to check.
917
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
918
- */
919
- function baseIsArguments(value) {
920
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
921
- }
922
-
923
- /** Used for built-in method references. */
924
- var objectProto$6 = Object.prototype;
925
-
926
- /** Used to check objects for own properties. */
927
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
928
-
929
- /** Built-in value references. */
930
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
931
-
932
- /**
933
- * Checks if `value` is likely an `arguments` object.
934
- *
935
- * @static
936
- * @memberOf _
937
- * @since 0.1.0
938
- * @category Lang
939
- * @param {*} value The value to check.
940
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
941
- * else `false`.
942
- * @example
943
- *
944
- * _.isArguments(function() { return arguments; }());
945
- * // => true
946
- *
947
- * _.isArguments([1, 2, 3]);
948
- * // => false
949
- */
950
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
951
- return isObjectLike(value) && hasOwnProperty$5.call(value, 'callee') &&
952
- !propertyIsEnumerable$1.call(value, 'callee');
953
- };
954
-
955
- /**
956
- * This method returns `false`.
957
- *
958
- * @static
959
- * @memberOf _
960
- * @since 4.13.0
961
- * @category Util
962
- * @returns {boolean} Returns `false`.
963
- * @example
964
- *
965
- * _.times(2, _.stubFalse);
966
- * // => [false, false]
967
- */
968
- function stubFalse() {
969
- return false;
970
- }
971
-
972
- /** Detect free variable `exports`. */
973
- var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
974
-
975
- /** Detect free variable `module`. */
976
- var freeModule$1 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
977
-
978
- /** Detect the popular CommonJS extension `module.exports`. */
979
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$2;
980
-
981
- /** Built-in value references. */
982
- var Buffer = moduleExports$1 ? root.Buffer : undefined;
983
-
984
- /* Built-in method references for those with the same name as other `lodash` methods. */
985
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
986
-
987
- /**
988
- * Checks if `value` is a buffer.
989
- *
990
- * @static
991
- * @memberOf _
992
- * @since 4.3.0
993
- * @category Lang
994
- * @param {*} value The value to check.
995
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
996
- * @example
997
- *
998
- * _.isBuffer(new Buffer(2));
999
- * // => true
1000
- *
1001
- * _.isBuffer(new Uint8Array(2));
1002
- * // => false
1003
- */
1004
- var isBuffer = nativeIsBuffer || stubFalse;
1005
-
1006
- /** `Object#toString` result references. */
1007
- var argsTag$1 = '[object Arguments]',
1008
- arrayTag$1 = '[object Array]',
1009
- boolTag$2 = '[object Boolean]',
1010
- dateTag$2 = '[object Date]',
1011
- errorTag$1 = '[object Error]',
1012
- funcTag$1 = '[object Function]',
1013
- mapTag$4 = '[object Map]',
1014
- numberTag$2 = '[object Number]',
1015
- objectTag$2 = '[object Object]',
1016
- regexpTag$2 = '[object RegExp]',
1017
- setTag$4 = '[object Set]',
1018
- stringTag$2 = '[object String]',
1019
- weakMapTag$2 = '[object WeakMap]';
1020
-
1021
- var arrayBufferTag$2 = '[object ArrayBuffer]',
1022
- dataViewTag$3 = '[object DataView]',
1023
- float32Tag$2 = '[object Float32Array]',
1024
- float64Tag$2 = '[object Float64Array]',
1025
- int8Tag$2 = '[object Int8Array]',
1026
- int16Tag$2 = '[object Int16Array]',
1027
- int32Tag$2 = '[object Int32Array]',
1028
- uint8Tag$2 = '[object Uint8Array]',
1029
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1030
- uint16Tag$2 = '[object Uint16Array]',
1031
- uint32Tag$2 = '[object Uint32Array]';
1032
-
1033
- /** Used to identify `toStringTag` values of typed arrays. */
1034
- var typedArrayTags = {};
1035
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1036
- typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1037
- typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1038
- typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1039
- typedArrayTags[uint32Tag$2] = true;
1040
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1041
- typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1042
- typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1043
- typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1044
- typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
1045
- typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
1046
- typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
1047
- typedArrayTags[weakMapTag$2] = false;
1048
-
1049
- /**
1050
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1051
- *
1052
- * @private
1053
- * @param {*} value The value to check.
1054
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1055
- */
1056
- function baseIsTypedArray(value) {
1057
- return isObjectLike(value) &&
1058
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1059
- }
1060
-
1061
- /**
1062
- * The base implementation of `_.unary` without support for storing metadata.
1063
- *
1064
- * @private
1065
- * @param {Function} func The function to cap arguments for.
1066
- * @returns {Function} Returns the new capped function.
1067
- */
1068
- function baseUnary(func) {
1069
- return function(value) {
1070
- return func(value);
1071
- };
1072
- }
1073
-
1074
- /** Detect free variable `exports`. */
1075
- var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
1076
-
1077
- /** Detect free variable `module`. */
1078
- var freeModule = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
1079
-
1080
- /** Detect the popular CommonJS extension `module.exports`. */
1081
- var moduleExports = freeModule && freeModule.exports === freeExports$1;
1082
-
1083
- /** Detect free variable `process` from Node.js. */
1084
- var freeProcess = moduleExports && freeGlobal.process;
1085
-
1086
- /** Used to access faster Node.js helpers. */
1087
- var nodeUtil = (function() {
1088
- try {
1089
- // Use `util.types` for Node.js 10+.
1090
- var types = freeModule && freeModule.require && freeModule.require('util').types;
1091
-
1092
- if (types) {
1093
- return types;
1094
- }
1095
-
1096
- // Legacy `process.binding('util')` for Node.js < 10.
1097
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
1098
- } catch (e) {}
1099
- }());
1100
-
1101
- /* Node.js helper references. */
1102
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1103
-
1104
- /**
1105
- * Checks if `value` is classified as a typed array.
1106
- *
1107
- * @static
1108
- * @memberOf _
1109
- * @since 3.0.0
1110
- * @category Lang
1111
- * @param {*} value The value to check.
1112
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1113
- * @example
1114
- *
1115
- * _.isTypedArray(new Uint8Array);
1116
- * // => true
1117
- *
1118
- * _.isTypedArray([]);
1119
- * // => false
1120
- */
1121
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1122
-
1123
- /** Used for built-in method references. */
1124
- var objectProto$5 = Object.prototype;
1125
-
1126
- /** Used to check objects for own properties. */
1127
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1128
-
1129
- /**
1130
- * Creates an array of the enumerable property names of the array-like `value`.
1131
- *
1132
- * @private
1133
- * @param {*} value The value to query.
1134
- * @param {boolean} inherited Specify returning inherited property names.
1135
- * @returns {Array} Returns the array of property names.
1136
- */
1137
- function arrayLikeKeys(value, inherited) {
1138
- var isArr = isArray(value),
1139
- isArg = !isArr && isArguments(value),
1140
- isBuff = !isArr && !isArg && isBuffer(value),
1141
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1142
- skipIndexes = isArr || isArg || isBuff || isType,
1143
- result = skipIndexes ? baseTimes(value.length, String) : [],
1144
- length = result.length;
1145
-
1146
- for (var key in value) {
1147
- if ((hasOwnProperty$4.call(value, key)) &&
1148
- !(skipIndexes && (
1149
- // Safari 9 has enumerable `arguments.length` in strict mode.
1150
- key == 'length' ||
1151
- // Node.js 0.10 has enumerable non-index properties on buffers.
1152
- (isBuff && (key == 'offset' || key == 'parent')) ||
1153
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1154
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1155
- // Skip index properties.
1156
- isIndex(key, length)
1157
- ))) {
1158
- result.push(key);
1159
- }
1160
- }
1161
- return result;
1162
- }
1163
-
1164
- /**
1165
- * Creates a unary function that invokes `func` with its argument transformed.
1166
- *
1167
- * @private
1168
- * @param {Function} func The function to wrap.
1169
- * @param {Function} transform The argument transform.
1170
- * @returns {Function} Returns the new function.
1171
- */
1172
- function overArg(func, transform) {
1173
- return function(arg) {
1174
- return func(transform(arg));
1175
- };
1176
- }
1177
-
1178
- /* Built-in method references for those with the same name as other `lodash` methods. */
1179
- var nativeKeys = overArg(Object.keys, Object);
1180
-
1181
- /** Used for built-in method references. */
1182
- var objectProto$4 = Object.prototype;
1183
-
1184
- /** Used to check objects for own properties. */
1185
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1186
-
1187
- /**
1188
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1189
- *
1190
- * @private
1191
- * @param {Object} object The object to query.
1192
- * @returns {Array} Returns the array of property names.
1193
- */
1194
- function baseKeys(object) {
1195
- if (!isPrototype(object)) {
1196
- return nativeKeys(object);
1197
- }
1198
- var result = [];
1199
- for (var key in Object(object)) {
1200
- if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
1201
- result.push(key);
1202
- }
1203
- }
1204
- return result;
1205
- }
1206
-
1207
- /**
1208
- * Creates an array of the own enumerable property names of `object`.
1209
- *
1210
- * **Note:** Non-object values are coerced to objects. See the
1211
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1212
- * for more details.
1213
- *
1214
- * @static
1215
- * @since 0.1.0
1216
- * @memberOf _
1217
- * @category Object
1218
- * @param {Object} object The object to query.
1219
- * @returns {Array} Returns the array of property names.
1220
- * @example
1221
- *
1222
- * function Foo() {
1223
- * this.a = 1;
1224
- * this.b = 2;
1225
- * }
1226
- *
1227
- * Foo.prototype.c = 3;
1228
- *
1229
- * _.keys(new Foo);
1230
- * // => ['a', 'b'] (iteration order is not guaranteed)
1231
- *
1232
- * _.keys('hi');
1233
- * // => ['0', '1']
1234
- */
1235
- function keys(object) {
1236
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1237
- }
1238
-
1239
- /* Built-in method references that are verified to be native. */
1240
- var nativeCreate = getNative(Object, 'create');
1241
-
1242
- /**
1243
- * Removes all key-value entries from the hash.
1244
- *
1245
- * @private
1246
- * @name clear
1247
- * @memberOf Hash
1248
- */
1249
- function hashClear() {
1250
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
1251
- this.size = 0;
1252
- }
1253
-
1254
- /**
1255
- * Removes `key` and its value from the hash.
1256
- *
1257
- * @private
1258
- * @name delete
1259
- * @memberOf Hash
1260
- * @param {Object} hash The hash to modify.
1261
- * @param {string} key The key of the value to remove.
1262
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1263
- */
1264
- function hashDelete(key) {
1265
- var result = this.has(key) && delete this.__data__[key];
1266
- this.size -= result ? 1 : 0;
1267
- return result;
1268
- }
1269
-
1270
- /** Used to stand-in for `undefined` hash values. */
1271
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1272
-
1273
- /** Used for built-in method references. */
1274
- var objectProto$3 = Object.prototype;
1275
-
1276
- /** Used to check objects for own properties. */
1277
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1278
-
1279
- /**
1280
- * Gets the hash value for `key`.
1281
- *
1282
- * @private
1283
- * @name get
1284
- * @memberOf Hash
1285
- * @param {string} key The key of the value to get.
1286
- * @returns {*} Returns the entry value.
1287
- */
1288
- function hashGet(key) {
1289
- var data = this.__data__;
1290
- if (nativeCreate) {
1291
- var result = data[key];
1292
- return result === HASH_UNDEFINED$1 ? undefined : result;
1293
- }
1294
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
1295
- }
1296
-
1297
- /** Used for built-in method references. */
1298
- var objectProto$2 = Object.prototype;
1299
-
1300
- /** Used to check objects for own properties. */
1301
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1302
-
1303
- /**
1304
- * Checks if a hash value for `key` exists.
1305
- *
1306
- * @private
1307
- * @name has
1308
- * @memberOf Hash
1309
- * @param {string} key The key of the entry to check.
1310
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1311
- */
1312
- function hashHas(key) {
1313
- var data = this.__data__;
1314
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$1.call(data, key);
1315
- }
1316
-
1317
- /** Used to stand-in for `undefined` hash values. */
1318
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1319
-
1320
- /**
1321
- * Sets the hash `key` to `value`.
1322
- *
1323
- * @private
1324
- * @name set
1325
- * @memberOf Hash
1326
- * @param {string} key The key of the value to set.
1327
- * @param {*} value The value to set.
1328
- * @returns {Object} Returns the hash instance.
1329
- */
1330
- function hashSet(key, value) {
1331
- var data = this.__data__;
1332
- this.size += this.has(key) ? 0 : 1;
1333
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1334
- return this;
1335
- }
1336
-
1337
- /**
1338
- * Creates a hash object.
1339
- *
1340
- * @private
1341
- * @constructor
1342
- * @param {Array} [entries] The key-value pairs to cache.
1343
- */
1344
- function Hash(entries) {
1345
- var index = -1,
1346
- length = entries == null ? 0 : entries.length;
1347
-
1348
- this.clear();
1349
- while (++index < length) {
1350
- var entry = entries[index];
1351
- this.set(entry[0], entry[1]);
1352
- }
1353
- }
1354
-
1355
- // Add methods to `Hash`.
1356
- Hash.prototype.clear = hashClear;
1357
- Hash.prototype['delete'] = hashDelete;
1358
- Hash.prototype.get = hashGet;
1359
- Hash.prototype.has = hashHas;
1360
- Hash.prototype.set = hashSet;
1361
-
1362
- /**
1363
- * Removes all key-value entries from the list cache.
1364
- *
1365
- * @private
1366
- * @name clear
1367
- * @memberOf ListCache
1368
- */
1369
- function listCacheClear() {
1370
- this.__data__ = [];
1371
- this.size = 0;
1372
- }
1373
-
1374
- /**
1375
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1376
- *
1377
- * @private
1378
- * @param {Array} array The array to inspect.
1379
- * @param {*} key The key to search for.
1380
- * @returns {number} Returns the index of the matched value, else `-1`.
1381
- */
1382
- function assocIndexOf(array, key) {
1383
- var length = array.length;
1384
- while (length--) {
1385
- if (eq(array[length][0], key)) {
1386
- return length;
1387
- }
1388
- }
1389
- return -1;
1390
- }
1391
-
1392
- /** Used for built-in method references. */
1393
- var arrayProto = Array.prototype;
1394
-
1395
- /** Built-in value references. */
1396
- var splice = arrayProto.splice;
1397
-
1398
- /**
1399
- * Removes `key` and its value from the list cache.
1400
- *
1401
- * @private
1402
- * @name delete
1403
- * @memberOf ListCache
1404
- * @param {string} key The key of the value to remove.
1405
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1406
- */
1407
- function listCacheDelete(key) {
1408
- var data = this.__data__,
1409
- index = assocIndexOf(data, key);
1410
-
1411
- if (index < 0) {
1412
- return false;
1413
- }
1414
- var lastIndex = data.length - 1;
1415
- if (index == lastIndex) {
1416
- data.pop();
1417
- } else {
1418
- splice.call(data, index, 1);
1419
- }
1420
- --this.size;
1421
- return true;
1422
- }
1423
-
1424
- /**
1425
- * Gets the list cache value for `key`.
1426
- *
1427
- * @private
1428
- * @name get
1429
- * @memberOf ListCache
1430
- * @param {string} key The key of the value to get.
1431
- * @returns {*} Returns the entry value.
1432
- */
1433
- function listCacheGet(key) {
1434
- var data = this.__data__,
1435
- index = assocIndexOf(data, key);
1436
-
1437
- return index < 0 ? undefined : data[index][1];
1438
- }
1439
-
1440
- /**
1441
- * Checks if a list cache value for `key` exists.
1442
- *
1443
- * @private
1444
- * @name has
1445
- * @memberOf ListCache
1446
- * @param {string} key The key of the entry to check.
1447
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1448
- */
1449
- function listCacheHas(key) {
1450
- return assocIndexOf(this.__data__, key) > -1;
1451
- }
1452
-
1453
- /**
1454
- * Sets the list cache `key` to `value`.
1455
- *
1456
- * @private
1457
- * @name set
1458
- * @memberOf ListCache
1459
- * @param {string} key The key of the value to set.
1460
- * @param {*} value The value to set.
1461
- * @returns {Object} Returns the list cache instance.
1462
- */
1463
- function listCacheSet(key, value) {
1464
- var data = this.__data__,
1465
- index = assocIndexOf(data, key);
1466
-
1467
- if (index < 0) {
1468
- ++this.size;
1469
- data.push([key, value]);
1470
- } else {
1471
- data[index][1] = value;
1472
- }
1473
- return this;
1474
- }
1475
-
1476
- /**
1477
- * Creates an list cache object.
1478
- *
1479
- * @private
1480
- * @constructor
1481
- * @param {Array} [entries] The key-value pairs to cache.
1482
- */
1483
- function ListCache(entries) {
1484
- var index = -1,
1485
- length = entries == null ? 0 : entries.length;
1486
-
1487
- this.clear();
1488
- while (++index < length) {
1489
- var entry = entries[index];
1490
- this.set(entry[0], entry[1]);
1491
- }
1492
- }
1493
-
1494
- // Add methods to `ListCache`.
1495
- ListCache.prototype.clear = listCacheClear;
1496
- ListCache.prototype['delete'] = listCacheDelete;
1497
- ListCache.prototype.get = listCacheGet;
1498
- ListCache.prototype.has = listCacheHas;
1499
- ListCache.prototype.set = listCacheSet;
1500
-
1501
- /* Built-in method references that are verified to be native. */
1502
- var Map$1 = getNative(root, 'Map');
1503
-
1504
- /**
1505
- * Removes all key-value entries from the map.
1506
- *
1507
- * @private
1508
- * @name clear
1509
- * @memberOf MapCache
1510
- */
1511
- function mapCacheClear() {
1512
- this.size = 0;
1513
- this.__data__ = {
1514
- 'hash': new Hash,
1515
- 'map': new (Map$1 || ListCache),
1516
- 'string': new Hash
1517
- };
1518
- }
1519
-
1520
- /**
1521
- * Checks if `value` is suitable for use as unique object key.
1522
- *
1523
- * @private
1524
- * @param {*} value The value to check.
1525
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1526
- */
1527
- function isKeyable(value) {
1528
- var type = typeof value;
1529
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1530
- ? (value !== '__proto__')
1531
- : (value === null);
1532
- }
1533
-
1534
- /**
1535
- * Gets the data for `map`.
1536
- *
1537
- * @private
1538
- * @param {Object} map The map to query.
1539
- * @param {string} key The reference key.
1540
- * @returns {*} Returns the map data.
1541
- */
1542
- function getMapData(map, key) {
1543
- var data = map.__data__;
1544
- return isKeyable(key)
1545
- ? data[typeof key == 'string' ? 'string' : 'hash']
1546
- : data.map;
1547
- }
1548
-
1549
- /**
1550
- * Removes `key` and its value from the map.
1551
- *
1552
- * @private
1553
- * @name delete
1554
- * @memberOf MapCache
1555
- * @param {string} key The key of the value to remove.
1556
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1557
- */
1558
- function mapCacheDelete(key) {
1559
- var result = getMapData(this, key)['delete'](key);
1560
- this.size -= result ? 1 : 0;
1561
- return result;
1562
- }
1563
-
1564
- /**
1565
- * Gets the map value for `key`.
1566
- *
1567
- * @private
1568
- * @name get
1569
- * @memberOf MapCache
1570
- * @param {string} key The key of the value to get.
1571
- * @returns {*} Returns the entry value.
1572
- */
1573
- function mapCacheGet(key) {
1574
- return getMapData(this, key).get(key);
1575
- }
1576
-
1577
- /**
1578
- * Checks if a map value for `key` exists.
1579
- *
1580
- * @private
1581
- * @name has
1582
- * @memberOf MapCache
1583
- * @param {string} key The key of the entry to check.
1584
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1585
- */
1586
- function mapCacheHas(key) {
1587
- return getMapData(this, key).has(key);
1588
- }
1589
-
1590
- /**
1591
- * Sets the map `key` to `value`.
1592
- *
1593
- * @private
1594
- * @name set
1595
- * @memberOf MapCache
1596
- * @param {string} key The key of the value to set.
1597
- * @param {*} value The value to set.
1598
- * @returns {Object} Returns the map cache instance.
1599
- */
1600
- function mapCacheSet(key, value) {
1601
- var data = getMapData(this, key),
1602
- size = data.size;
1603
-
1604
- data.set(key, value);
1605
- this.size += data.size == size ? 0 : 1;
1606
- return this;
1607
- }
1608
-
1609
- /**
1610
- * Creates a map cache object to store key-value pairs.
1611
- *
1612
- * @private
1613
- * @constructor
1614
- * @param {Array} [entries] The key-value pairs to cache.
1615
- */
1616
- function MapCache(entries) {
1617
- var index = -1,
1618
- length = entries == null ? 0 : entries.length;
1619
-
1620
- this.clear();
1621
- while (++index < length) {
1622
- var entry = entries[index];
1623
- this.set(entry[0], entry[1]);
1624
- }
1625
- }
1626
-
1627
- // Add methods to `MapCache`.
1628
- MapCache.prototype.clear = mapCacheClear;
1629
- MapCache.prototype['delete'] = mapCacheDelete;
1630
- MapCache.prototype.get = mapCacheGet;
1631
- MapCache.prototype.has = mapCacheHas;
1632
- MapCache.prototype.set = mapCacheSet;
1633
-
1634
- /**
1635
- * Appends the elements of `values` to `array`.
1636
- *
1637
- * @private
1638
- * @param {Array} array The array to modify.
1639
- * @param {Array} values The values to append.
1640
- * @returns {Array} Returns `array`.
1641
- */
1642
- function arrayPush(array, values) {
1643
- var index = -1,
1644
- length = values.length,
1645
- offset = array.length;
1646
-
1647
- while (++index < length) {
1648
- array[offset + index] = values[index];
1649
- }
1650
- return array;
1651
- }
1652
-
1653
- /** Built-in value references. */
1654
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1655
-
1656
- /**
1657
- * Removes all key-value entries from the stack.
1658
- *
1659
- * @private
1660
- * @name clear
1661
- * @memberOf Stack
1662
- */
1663
- function stackClear() {
1664
- this.__data__ = new ListCache;
1665
- this.size = 0;
1666
- }
1667
-
1668
- /**
1669
- * Removes `key` and its value from the stack.
1670
- *
1671
- * @private
1672
- * @name delete
1673
- * @memberOf Stack
1674
- * @param {string} key The key of the value to remove.
1675
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1676
- */
1677
- function stackDelete(key) {
1678
- var data = this.__data__,
1679
- result = data['delete'](key);
1680
-
1681
- this.size = data.size;
1682
- return result;
1683
- }
1684
-
1685
- /**
1686
- * Gets the stack value for `key`.
1687
- *
1688
- * @private
1689
- * @name get
1690
- * @memberOf Stack
1691
- * @param {string} key The key of the value to get.
1692
- * @returns {*} Returns the entry value.
1693
- */
1694
- function stackGet(key) {
1695
- return this.__data__.get(key);
1696
- }
1697
-
1698
- /**
1699
- * Checks if a stack value for `key` exists.
1700
- *
1701
- * @private
1702
- * @name has
1703
- * @memberOf Stack
1704
- * @param {string} key The key of the entry to check.
1705
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1706
- */
1707
- function stackHas(key) {
1708
- return this.__data__.has(key);
1709
- }
1710
-
1711
- /** Used as the size to enable large array optimizations. */
1712
- var LARGE_ARRAY_SIZE = 200;
1713
-
1714
- /**
1715
- * Sets the stack `key` to `value`.
1716
- *
1717
- * @private
1718
- * @name set
1719
- * @memberOf Stack
1720
- * @param {string} key The key of the value to set.
1721
- * @param {*} value The value to set.
1722
- * @returns {Object} Returns the stack cache instance.
1723
- */
1724
- function stackSet(key, value) {
1725
- var data = this.__data__;
1726
- if (data instanceof ListCache) {
1727
- var pairs = data.__data__;
1728
- if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1729
- pairs.push([key, value]);
1730
- this.size = ++data.size;
1731
- return this;
1732
- }
1733
- data = this.__data__ = new MapCache(pairs);
1734
- }
1735
- data.set(key, value);
1736
- this.size = data.size;
1737
- return this;
1738
- }
1739
-
1740
- /**
1741
- * Creates a stack cache object to store key-value pairs.
1742
- *
1743
- * @private
1744
- * @constructor
1745
- * @param {Array} [entries] The key-value pairs to cache.
1746
- */
1747
- function Stack(entries) {
1748
- var data = this.__data__ = new ListCache(entries);
1749
- this.size = data.size;
1750
- }
1751
-
1752
- // Add methods to `Stack`.
1753
- Stack.prototype.clear = stackClear;
1754
- Stack.prototype['delete'] = stackDelete;
1755
- Stack.prototype.get = stackGet;
1756
- Stack.prototype.has = stackHas;
1757
- Stack.prototype.set = stackSet;
1758
-
1759
- /** Detect free variable `exports`. */
1760
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1761
-
1762
- /** Detect free variable `module`. */
1763
- freeExports && typeof module == 'object' && module && !module.nodeType && module;
1764
-
1765
- /**
1766
- * Creates a clone of `buffer`.
1767
- *
1768
- * @private
1769
- * @param {Buffer} buffer The buffer to clone.
1770
- * @param {boolean} [isDeep] Specify a deep clone.
1771
- * @returns {Buffer} Returns the cloned buffer.
1772
- */
1773
- function cloneBuffer(buffer, isDeep) {
1774
- {
1775
- return buffer.slice();
1776
- }
1777
- }
1778
-
1779
- /**
1780
- * A specialized version of `_.filter` for arrays without support for
1781
- * iteratee shorthands.
1782
- *
1783
- * @private
1784
- * @param {Array} [array] The array to iterate over.
1785
- * @param {Function} predicate The function invoked per iteration.
1786
- * @returns {Array} Returns the new filtered array.
1787
- */
1788
- function arrayFilter(array, predicate) {
1789
- var index = -1,
1790
- length = array == null ? 0 : array.length,
1791
- resIndex = 0,
1792
- result = [];
1793
-
1794
- while (++index < length) {
1795
- var value = array[index];
1796
- if (predicate(value, index, array)) {
1797
- result[resIndex++] = value;
1798
- }
1799
- }
1800
- return result;
1801
- }
1802
-
1803
- /**
1804
- * This method returns a new empty array.
1805
- *
1806
- * @static
1807
- * @memberOf _
1808
- * @since 4.13.0
1809
- * @category Util
1810
- * @returns {Array} Returns the new empty array.
1811
- * @example
1812
- *
1813
- * var arrays = _.times(2, _.stubArray);
1814
- *
1815
- * console.log(arrays);
1816
- * // => [[], []]
1817
- *
1818
- * console.log(arrays[0] === arrays[1]);
1819
- * // => false
1820
- */
1821
- function stubArray() {
1822
- return [];
1823
- }
1824
-
1825
- /** Used for built-in method references. */
1826
- var objectProto$1 = Object.prototype;
1827
-
1828
- /** Built-in value references. */
1829
- var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1830
-
1831
- /* Built-in method references for those with the same name as other `lodash` methods. */
1832
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1833
-
1834
- /**
1835
- * Creates an array of the own enumerable symbols of `object`.
1836
- *
1837
- * @private
1838
- * @param {Object} object The object to query.
1839
- * @returns {Array} Returns the array of symbols.
1840
- */
1841
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1842
- if (object == null) {
1843
- return [];
1844
- }
1845
- object = Object(object);
1846
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
1847
- return propertyIsEnumerable.call(object, symbol);
1848
- });
1849
- };
1850
-
1851
- /**
1852
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1853
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1854
- * symbols of `object`.
1855
- *
1856
- * @private
1857
- * @param {Object} object The object to query.
1858
- * @param {Function} keysFunc The function to get the keys of `object`.
1859
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1860
- * @returns {Array} Returns the array of property names and symbols.
1861
- */
1862
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1863
- var result = keysFunc(object);
1864
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1865
- }
1866
-
1867
- /**
1868
- * Creates an array of own enumerable property names and symbols of `object`.
1869
- *
1870
- * @private
1871
- * @param {Object} object The object to query.
1872
- * @returns {Array} Returns the array of property names and symbols.
1873
- */
1874
- function getAllKeys(object) {
1875
- return baseGetAllKeys(object, keys, getSymbols);
1876
- }
1877
-
1878
- /* Built-in method references that are verified to be native. */
1879
- var DataView$1 = getNative(root, 'DataView');
1880
-
1881
- /* Built-in method references that are verified to be native. */
1882
- var Promise$1 = getNative(root, 'Promise');
1883
-
1884
- /* Built-in method references that are verified to be native. */
1885
- var Set$1 = getNative(root, 'Set');
1886
-
1887
- /** `Object#toString` result references. */
1888
- var mapTag$3 = '[object Map]',
1889
- objectTag$1 = '[object Object]',
1890
- promiseTag = '[object Promise]',
1891
- setTag$3 = '[object Set]',
1892
- weakMapTag$1 = '[object WeakMap]';
1893
-
1894
- var dataViewTag$2 = '[object DataView]';
1895
-
1896
- /** Used to detect maps, sets, and weakmaps. */
1897
- var dataViewCtorString = toSource(DataView$1),
1898
- mapCtorString = toSource(Map$1),
1899
- promiseCtorString = toSource(Promise$1),
1900
- setCtorString = toSource(Set$1),
1901
- weakMapCtorString = toSource(WeakMap);
1902
-
1903
- /**
1904
- * Gets the `toStringTag` of `value`.
1905
- *
1906
- * @private
1907
- * @param {*} value The value to query.
1908
- * @returns {string} Returns the `toStringTag`.
1909
- */
1910
- var getTag = baseGetTag;
1911
-
1912
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1913
- if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2) ||
1914
- (Map$1 && getTag(new Map$1) != mapTag$3) ||
1915
- (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
1916
- (Set$1 && getTag(new Set$1) != setTag$3) ||
1917
- (WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
1918
- getTag = function(value) {
1919
- var result = baseGetTag(value),
1920
- Ctor = result == objectTag$1 ? value.constructor : undefined,
1921
- ctorString = Ctor ? toSource(Ctor) : '';
1922
-
1923
- if (ctorString) {
1924
- switch (ctorString) {
1925
- case dataViewCtorString: return dataViewTag$2;
1926
- case mapCtorString: return mapTag$3;
1927
- case promiseCtorString: return promiseTag;
1928
- case setCtorString: return setTag$3;
1929
- case weakMapCtorString: return weakMapTag$1;
1930
- }
1931
- }
1932
- return result;
1933
- };
1934
- }
1935
-
1936
- /** Used for built-in method references. */
1937
- var objectProto = Object.prototype;
1938
-
1939
- /** Used to check objects for own properties. */
1940
- var hasOwnProperty = objectProto.hasOwnProperty;
1941
-
1942
- /**
1943
- * Initializes an array clone.
1944
- *
1945
- * @private
1946
- * @param {Array} array The array to clone.
1947
- * @returns {Array} Returns the initialized clone.
1948
- */
1949
- function initCloneArray(array) {
1950
- var length = array.length,
1951
- result = new array.constructor(length);
1952
-
1953
- // Add properties assigned by `RegExp#exec`.
1954
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
1955
- result.index = array.index;
1956
- result.input = array.input;
1957
- }
1958
- return result;
1959
- }
1960
-
1961
- /** Built-in value references. */
1962
- var Uint8Array$1 = root.Uint8Array;
1963
-
1964
- /**
1965
- * Creates a clone of `arrayBuffer`.
1966
- *
1967
- * @private
1968
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1969
- * @returns {ArrayBuffer} Returns the cloned array buffer.
1970
- */
1971
- function cloneArrayBuffer(arrayBuffer) {
1972
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1973
- new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
1974
- return result;
1975
- }
1976
-
1977
- /**
1978
- * Creates a clone of `dataView`.
1979
- *
1980
- * @private
1981
- * @param {Object} dataView The data view to clone.
1982
- * @param {boolean} [isDeep] Specify a deep clone.
1983
- * @returns {Object} Returns the cloned data view.
1984
- */
1985
- function cloneDataView(dataView, isDeep) {
1986
- var buffer = cloneArrayBuffer(dataView.buffer) ;
1987
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
1988
- }
1989
-
1990
- /** Used to match `RegExp` flags from their coerced string values. */
1991
- var reFlags = /\w*$/;
1992
-
1993
- /**
1994
- * Creates a clone of `regexp`.
1995
- *
1996
- * @private
1997
- * @param {Object} regexp The regexp to clone.
1998
- * @returns {Object} Returns the cloned regexp.
1999
- */
2000
- function cloneRegExp(regexp) {
2001
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2002
- result.lastIndex = regexp.lastIndex;
2003
- return result;
2004
- }
2005
-
2006
- /** Used to convert symbols to primitives and strings. */
2007
- var symbolProto = Symbol ? Symbol.prototype : undefined,
2008
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2009
-
2010
- /**
2011
- * Creates a clone of the `symbol` object.
2012
- *
2013
- * @private
2014
- * @param {Object} symbol The symbol object to clone.
2015
- * @returns {Object} Returns the cloned symbol object.
2016
- */
2017
- function cloneSymbol(symbol) {
2018
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2019
- }
2020
-
2021
- /**
2022
- * Creates a clone of `typedArray`.
2023
- *
2024
- * @private
2025
- * @param {Object} typedArray The typed array to clone.
2026
- * @param {boolean} [isDeep] Specify a deep clone.
2027
- * @returns {Object} Returns the cloned typed array.
2028
- */
2029
- function cloneTypedArray(typedArray, isDeep) {
2030
- var buffer = cloneArrayBuffer(typedArray.buffer) ;
2031
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2032
- }
2033
-
2034
- /** `Object#toString` result references. */
2035
- var boolTag$1 = '[object Boolean]',
2036
- dateTag$1 = '[object Date]',
2037
- mapTag$2 = '[object Map]',
2038
- numberTag$1 = '[object Number]',
2039
- regexpTag$1 = '[object RegExp]',
2040
- setTag$2 = '[object Set]',
2041
- stringTag$1 = '[object String]',
2042
- symbolTag$1 = '[object Symbol]';
2043
-
2044
- var arrayBufferTag$1 = '[object ArrayBuffer]',
2045
- dataViewTag$1 = '[object DataView]',
2046
- float32Tag$1 = '[object Float32Array]',
2047
- float64Tag$1 = '[object Float64Array]',
2048
- int8Tag$1 = '[object Int8Array]',
2049
- int16Tag$1 = '[object Int16Array]',
2050
- int32Tag$1 = '[object Int32Array]',
2051
- uint8Tag$1 = '[object Uint8Array]',
2052
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2053
- uint16Tag$1 = '[object Uint16Array]',
2054
- uint32Tag$1 = '[object Uint32Array]';
2055
-
2056
- /**
2057
- * Initializes an object clone based on its `toStringTag`.
2058
- *
2059
- * **Note:** This function only supports cloning values with tags of
2060
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2061
- *
2062
- * @private
2063
- * @param {Object} object The object to clone.
2064
- * @param {string} tag The `toStringTag` of the object to clone.
2065
- * @param {boolean} [isDeep] Specify a deep clone.
2066
- * @returns {Object} Returns the initialized clone.
2067
- */
2068
- function initCloneByTag(object, tag, isDeep) {
2069
- var Ctor = object.constructor;
2070
- switch (tag) {
2071
- case arrayBufferTag$1:
2072
- return cloneArrayBuffer(object);
2073
-
2074
- case boolTag$1:
2075
- case dateTag$1:
2076
- return new Ctor(+object);
2077
-
2078
- case dataViewTag$1:
2079
- return cloneDataView(object);
2080
-
2081
- case float32Tag$1: case float64Tag$1:
2082
- case int8Tag$1: case int16Tag$1: case int32Tag$1:
2083
- case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2084
- return cloneTypedArray(object);
2085
-
2086
- case mapTag$2:
2087
- return new Ctor;
2088
-
2089
- case numberTag$1:
2090
- case stringTag$1:
2091
- return new Ctor(object);
2092
-
2093
- case regexpTag$1:
2094
- return cloneRegExp(object);
2095
-
2096
- case setTag$2:
2097
- return new Ctor;
2098
-
2099
- case symbolTag$1:
2100
- return cloneSymbol(object);
2101
- }
2102
- }
2103
-
2104
- /**
2105
- * Initializes an object clone.
2106
- *
2107
- * @private
2108
- * @param {Object} object The object to clone.
2109
- * @returns {Object} Returns the initialized clone.
2110
- */
2111
- function initCloneObject(object) {
2112
- return (typeof object.constructor == 'function' && !isPrototype(object))
2113
- ? baseCreate(getPrototype(object))
2114
- : {};
2115
- }
2116
-
2117
- /** `Object#toString` result references. */
2118
- var mapTag$1 = '[object Map]';
2119
-
2120
- /**
2121
- * The base implementation of `_.isMap` without Node.js optimizations.
2122
- *
2123
- * @private
2124
- * @param {*} value The value to check.
2125
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2126
- */
2127
- function baseIsMap(value) {
2128
- return isObjectLike(value) && getTag(value) == mapTag$1;
2129
- }
2130
-
2131
- /* Node.js helper references. */
2132
- var nodeIsMap = nodeUtil && nodeUtil.isMap;
2133
-
2134
- /**
2135
- * Checks if `value` is classified as a `Map` object.
2136
- *
2137
- * @static
2138
- * @memberOf _
2139
- * @since 4.3.0
2140
- * @category Lang
2141
- * @param {*} value The value to check.
2142
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2143
- * @example
2144
- *
2145
- * _.isMap(new Map);
2146
- * // => true
2147
- *
2148
- * _.isMap(new WeakMap);
2149
- * // => false
2150
- */
2151
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
2152
-
2153
- /** `Object#toString` result references. */
2154
- var setTag$1 = '[object Set]';
2155
-
2156
- /**
2157
- * The base implementation of `_.isSet` without Node.js optimizations.
2158
- *
2159
- * @private
2160
- * @param {*} value The value to check.
2161
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2162
- */
2163
- function baseIsSet(value) {
2164
- return isObjectLike(value) && getTag(value) == setTag$1;
2165
- }
2166
-
2167
- /* Node.js helper references. */
2168
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
2169
-
2170
- /**
2171
- * Checks if `value` is classified as a `Set` object.
2172
- *
2173
- * @static
2174
- * @memberOf _
2175
- * @since 4.3.0
2176
- * @category Lang
2177
- * @param {*} value The value to check.
2178
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2179
- * @example
2180
- *
2181
- * _.isSet(new Set);
2182
- * // => true
2183
- *
2184
- * _.isSet(new WeakSet);
2185
- * // => false
2186
- */
2187
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2188
-
2189
- /** `Object#toString` result references. */
2190
- var argsTag = '[object Arguments]',
2191
- arrayTag = '[object Array]',
2192
- boolTag = '[object Boolean]',
2193
- dateTag = '[object Date]',
2194
- errorTag = '[object Error]',
2195
- funcTag = '[object Function]',
2196
- genTag = '[object GeneratorFunction]',
2197
- mapTag = '[object Map]',
2198
- numberTag = '[object Number]',
2199
- objectTag = '[object Object]',
2200
- regexpTag = '[object RegExp]',
2201
- setTag = '[object Set]',
2202
- stringTag = '[object String]',
2203
- symbolTag = '[object Symbol]',
2204
- weakMapTag = '[object WeakMap]';
2205
-
2206
- var arrayBufferTag = '[object ArrayBuffer]',
2207
- dataViewTag = '[object DataView]',
2208
- float32Tag = '[object Float32Array]',
2209
- float64Tag = '[object Float64Array]',
2210
- int8Tag = '[object Int8Array]',
2211
- int16Tag = '[object Int16Array]',
2212
- int32Tag = '[object Int32Array]',
2213
- uint8Tag = '[object Uint8Array]',
2214
- uint8ClampedTag = '[object Uint8ClampedArray]',
2215
- uint16Tag = '[object Uint16Array]',
2216
- uint32Tag = '[object Uint32Array]';
2217
-
2218
- /** Used to identify `toStringTag` values supported by `_.clone`. */
2219
- var cloneableTags = {};
2220
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
2221
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2222
- cloneableTags[boolTag] = cloneableTags[dateTag] =
2223
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2224
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2225
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
2226
- cloneableTags[numberTag] = cloneableTags[objectTag] =
2227
- cloneableTags[regexpTag] = cloneableTags[setTag] =
2228
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
2229
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2230
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2231
- cloneableTags[errorTag] = cloneableTags[funcTag] =
2232
- cloneableTags[weakMapTag] = false;
2233
-
2234
- /**
2235
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2236
- * traversed objects.
2237
- *
2238
- * @private
2239
- * @param {*} value The value to clone.
2240
- * @param {boolean} bitmask The bitmask flags.
2241
- * 1 - Deep clone
2242
- * 2 - Flatten inherited properties
2243
- * 4 - Clone symbols
2244
- * @param {Function} [customizer] The function to customize cloning.
2245
- * @param {string} [key] The key of `value`.
2246
- * @param {Object} [object] The parent object of `value`.
2247
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2248
- * @returns {*} Returns the cloned value.
2249
- */
2250
- function baseClone(value, bitmask, customizer, key, object, stack) {
2251
- var result;
2252
- if (result !== undefined) {
2253
- return result;
2254
- }
2255
- if (!isObject(value)) {
2256
- return value;
2257
- }
2258
- var isArr = isArray(value);
2259
- if (isArr) {
2260
- result = initCloneArray(value);
2261
- } else {
2262
- var tag = getTag(value),
2263
- isFunc = tag == funcTag || tag == genTag;
2264
-
2265
- if (isBuffer(value)) {
2266
- return cloneBuffer(value);
2267
- }
2268
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2269
- result = (isFunc) ? {} : initCloneObject(value);
2270
- } else {
2271
- if (!cloneableTags[tag]) {
2272
- return object ? value : {};
2273
- }
2274
- result = initCloneByTag(value, tag);
2275
- }
2276
- }
2277
- // Check for circular references and return its corresponding clone.
2278
- stack || (stack = new Stack);
2279
- var stacked = stack.get(value);
2280
- if (stacked) {
2281
- return stacked;
2282
- }
2283
- stack.set(value, result);
2284
-
2285
- if (isSet(value)) {
2286
- value.forEach(function(subValue) {
2287
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2288
- });
2289
- } else if (isMap(value)) {
2290
- value.forEach(function(subValue, key) {
2291
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2292
- });
2293
- }
2294
-
2295
- var keysFunc = (getAllKeys)
2296
- ;
2297
-
2298
- var props = isArr ? undefined : keysFunc(value);
2299
- arrayEach(props || value, function(subValue, key) {
2300
- if (props) {
2301
- key = subValue;
2302
- subValue = value[key];
2303
- }
2304
- // Recursively populate clone (susceptible to call stack limits).
2305
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2306
- });
2307
- return result;
2308
- }
2309
-
2310
- /** Used to compose bitmasks for cloning. */
2311
- var CLONE_DEEP_FLAG = 1,
2312
- CLONE_SYMBOLS_FLAG = 4;
2313
-
2314
- /**
2315
- * This method is like `_.clone` except that it recursively clones `value`.
2316
- *
2317
- * @static
2318
- * @memberOf _
2319
- * @since 1.0.0
2320
- * @category Lang
2321
- * @param {*} value The value to recursively clone.
2322
- * @returns {*} Returns the deep cloned value.
2323
- * @see _.clone
2324
- * @example
2325
- *
2326
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
2327
- *
2328
- * var deep = _.cloneDeep(objects);
2329
- * console.log(deep[0] === objects[0]);
2330
- * // => false
2331
- */
2332
- function cloneDeep(value) {
2333
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2334
- }
2335
-
2336
319
  var __rest = (undefined && undefined.__rest) || function (s, e) {
2337
320
  var t = {};
2338
321
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -2345,25 +328,13 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
2345
328
  return t;
2346
329
  };
2347
330
  class ObjectHelper {
2348
- static safeStringify(obj, indent = 2) {
2349
- const seen = new WeakSet();
2350
- return JSON.stringify(obj, (_key, value) => {
2351
- if (typeof value === 'object' && value !== null) {
2352
- if (seen.has(value)) {
2353
- return undefined;
2354
- }
2355
- seen.add(value);
2356
- }
2357
- return value;
2358
- }, indent);
2359
- }
2360
331
  static generateUUID() {
2361
332
  return Math.random().toString(36).substr(2, 9);
2362
333
  }
2363
334
  static clone(objOrObjs) {
2364
335
  const cloneObject = (obj) => {
2365
- const rest = __rest(obj, ["_store", "_elementRef", "totalWidth", "totalHeight"]);
2366
- return cloneDeep(rest);
336
+ const remainingProps = __rest(obj, ["_store", "_elementRef", "totalWidth", "totalHeight"]);
337
+ return structuredClone(remainingProps);
2367
338
  };
2368
339
  if (Array.isArray(objOrObjs)) {
2369
340
  return objOrObjs.map(cloneObject);
@@ -3490,17 +1461,15 @@ class KritzelEraserTool extends KritzelBaseTool {
3490
1461
  }
3491
1462
 
3492
1463
  class KritzelImage extends KritzelBaseObject {
3493
- constructor(store, img) {
1464
+ constructor(store) {
3494
1465
  super(store);
3495
1466
  this.__class__ = 'KritzelImage';
1467
+ this.src = '';
3496
1468
  this.debugInfoVisible = true;
3497
- this.img = img;
3498
1469
  this.x = 0;
3499
1470
  this.y = 0;
3500
1471
  this.translateX = 0;
3501
1472
  this.translateY = 0;
3502
- this.width = img.width;
3503
- this.height = img.height;
3504
1473
  this.scale = this._store.state.scale;
3505
1474
  }
3506
1475
  resize(x, y, width, height) {
@@ -3897,6 +1866,7 @@ class KritzelRotationHandler extends KritzelBaseHandler {
3897
1866
  const currentRotation = Math.atan2(groupCenterY - cursorY, groupCenterX - cursorX);
3898
1867
  this.rotation = currentRotation - this.initialRotation;
3899
1868
  this._store.state.selectionGroup.rotate(this.rotation);
1869
+ this._store.rerender();
3900
1870
  clearTimeout(this._store.state.longTouchTimeout);
3901
1871
  }
3902
1872
  }
@@ -4359,7 +2329,7 @@ class KritzelReviver {
4359
2329
  revivedObj = new KritzelText(this._store, obj.fontSize, obj.fontFamily).revive(obj);
4360
2330
  break;
4361
2331
  case 'KritzelImage':
4362
- revivedObj = new KritzelImage(this._store, obj.img).revive(obj);
2332
+ revivedObj = new KritzelImage(this._store).revive(obj);
4363
2333
  break;
4364
2334
  case 'KritzelSelectionGroup':
4365
2335
  revivedObj = new KritzelSelectionGroup(this._store).revive(obj);
@@ -4461,13 +2431,13 @@ class KritzelSelectionGroup extends KritzelBaseObject {
4461
2431
  const heightScaleFactor = height / this.height;
4462
2432
  const deltaX = x - this.translateX;
4463
2433
  const deltaY = y - this.translateY;
4464
- this.objects.forEach(obj => {
4465
- const updatedWidth = obj.width * widthScaleFactor;
4466
- const updatedHeight = obj.height * heightScaleFactor;
4467
- const updatedX = obj.translateX + deltaX + (obj.translateX - this.translateX) * (widthScaleFactor - 1);
4468
- const updatedY = obj.translateY + deltaY + (obj.translateY - this.translateY) * (heightScaleFactor - 1);
4469
- obj.resize(updatedX, updatedY, updatedWidth, updatedHeight);
4470
- this._store.state.objectsOctree.update(obj);
2434
+ this.objects.forEach(child => {
2435
+ const updatedWidth = child.width * widthScaleFactor;
2436
+ const updatedHeight = child.height * heightScaleFactor;
2437
+ const updatedX = child.translateX + deltaX + (child.translateX - this.translateX) * (widthScaleFactor - 1);
2438
+ const updatedY = child.translateY + deltaY + (child.translateY - this.translateY) * (heightScaleFactor - 1);
2439
+ child.resize(updatedX, updatedY, updatedWidth, updatedHeight);
2440
+ this._store.state.objectsOctree.update(child);
4471
2441
  });
4472
2442
  this.refreshObjectDimensions();
4473
2443
  this.unchangedObjects = ObjectHelper.clone(this.objects);
@@ -4488,6 +2458,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
4488
2458
  child.translateX = centerX + rotatedX - child.totalWidth / 2 / child.scale;
4489
2459
  child.translateY = centerY + rotatedY - child.totalHeight / 2 / child.scale;
4490
2460
  child.rotation = this.objects.length === 1 ? value : value + unchangedChild.rotation;
2461
+ this._store.state.objectsOctree.update(child);
4491
2462
  });
4492
2463
  }
4493
2464
  copy() {
@@ -4630,7 +2601,8 @@ class KritzelImageTool extends KritzelBaseTool {
4630
2601
  return { scaledWidth, scaledHeight };
4631
2602
  }
4632
2603
  createKritzelImage(img, width, height) {
4633
- const image = new KritzelImage(this._store, img);
2604
+ const image = new KritzelImage(this._store);
2605
+ image.src = img.src;
4634
2606
  image.width = width;
4635
2607
  image.height = height;
4636
2608
  image.zIndex = this._store.currentZIndex;
@@ -5183,11 +3155,11 @@ class KritzelOctree {
5183
3155
  ];
5184
3156
  }
5185
3157
  intersects(a, b) {
5186
- return !((a.x >= b.x + b.width || // a is completely to the right of b
3158
+ return !(a.x >= b.x + b.width || // a is completely to the right of b
5187
3159
  a.x + a.width <= b.x || // a is completely to the left of b
5188
3160
  a.y >= b.y + b.height || // a is completely below b
5189
3161
  a.y + a.height <= b.y // a is completely above b
5190
- ));
3162
+ );
5191
3163
  }
5192
3164
  }
5193
3165
 
@@ -5960,7 +3932,7 @@ const KritzelEngine = class {
5960
3932
  width: object === null || object === void 0 ? void 0 : object.width.toString(),
5961
3933
  position: 'absolute',
5962
3934
  overflow: 'visible',
5963
- }, viewBox: object === null || object === void 0 ? void 0 : object.viewBox }, index.h("path", { d: object === null || object === void 0 ? void 0 : object.d, fill: object.fill, stroke: object === null || object === void 0 ? void 0 : object.stroke }))), object instanceof KritzelImage && (index.h("img", { ref: el => object.mount(el), src: object.img.src, style: {
3935
+ }, viewBox: object === null || object === void 0 ? void 0 : object.viewBox }, index.h("path", { d: object === null || object === void 0 ? void 0 : object.d, fill: object.fill, stroke: object === null || object === void 0 ? void 0 : object.stroke }))), object instanceof KritzelImage && (index.h("img", { ref: el => object.mount(el), src: object.src, style: {
5964
3936
  width: '100%',
5965
3937
  height: '100%',
5966
3938
  userSelect: 'none',
@@ -6027,7 +3999,7 @@ const KritzelEngine = class {
6027
3999
  fill: 'transparent',
6028
4000
  cursor: 'grab',
6029
4001
  }, visibility: object.selected && !this.isSelecting ? 'visible' : 'hidden' }), index.h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, index.h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.debugInfoVisible ? 'block' : 'none' } }, index.h("div", { style: { width: '100%', height: '100%' } }, index.h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), index.h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), index.h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), index.h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), index.h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), index.h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), index.h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation)))))));
6030
- }), index.h("svg", { key: '76788f88c63996a85778fac600f568e651f2604f', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
4002
+ }), index.h("svg", { key: '9f862215ce2de4cc0745942bc946897f5f5e24b7', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
6031
4003
  height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
6032
4004
  width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
6033
4005
  left: '0',
@@ -6037,12 +4009,12 @@ const KritzelEngine = class {
6037
4009
  transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
6038
4010
  transformOrigin: 'top left',
6039
4011
  overflow: 'visible',
6040
- }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: 'e0356205729f20a61f5bbac14393d4d607a7c865', d: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.d, fill: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.fill, stroke: (_1 = this.store.state.currentPath) === null || _1 === void 0 ? void 0 : _1.stroke }))), this.store.state.isContextMenuVisible && (index.h("kritzel-context-menu", { key: '23ab721c25518e6c6a6e6e163fa0753e054cb5e7', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
4012
+ }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, index.h("path", { key: 'e1f0ea5ee56c8fb753438c978750151c688e9330', d: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.d, fill: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.fill, stroke: (_1 = this.store.state.currentPath) === null || _1 === void 0 ? void 0 : _1.stroke }))), this.store.state.isContextMenuVisible && (index.h("kritzel-context-menu", { key: '89184b62326fcfde61ee4922ec5d640b16a191a7', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
6041
4013
  position: 'fixed',
6042
4014
  left: `${this.store.state.contextMenuX}px`,
6043
4015
  top: `${this.store.state.contextMenuY}px`,
6044
4016
  zIndex: '10000',
6045
- }, onActionSelected: event => this.handleContextMenuAction(event) })), ((_2 = this.store.state) === null || _2 === void 0 ? void 0 : _2.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && index.h("kritzel-cursor-trail", { key: '01f90ff856d6a3b0812ce47796fd59dbbf0cd52d' })));
4017
+ }, onActionSelected: event => this.handleContextMenuAction(event) })), ((_2 = this.store.state) === null || _2 === void 0 ? void 0 : _2.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && index.h("kritzel-cursor-trail", { key: '8797da3afce7d97e0f94ec9f90522b9ad35bb71b' })));
6046
4018
  }
6047
4019
  get host() { return index.getElement(this); }
6048
4020
  };