@kne/react-pdf-sign 1.0.3 → 1.0.4

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.
@@ -291,260 +291,6 @@ const LocationLayer = withLocale(p => {
291
291
  });
292
292
  });
293
293
 
294
- /**
295
- * Removes all key-value entries from the list cache.
296
- *
297
- * @private
298
- * @name clear
299
- * @memberOf ListCache
300
- */
301
- function listCacheClear() {
302
- this.__data__ = [];
303
- this.size = 0;
304
- }
305
-
306
- var _listCacheClear = listCacheClear;
307
-
308
- /**
309
- * Performs a
310
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
311
- * comparison between two values to determine if they are equivalent.
312
- *
313
- * @static
314
- * @memberOf _
315
- * @since 4.0.0
316
- * @category Lang
317
- * @param {*} value The value to compare.
318
- * @param {*} other The other value to compare.
319
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
320
- * @example
321
- *
322
- * var object = { 'a': 1 };
323
- * var other = { 'a': 1 };
324
- *
325
- * _.eq(object, object);
326
- * // => true
327
- *
328
- * _.eq(object, other);
329
- * // => false
330
- *
331
- * _.eq('a', 'a');
332
- * // => true
333
- *
334
- * _.eq('a', Object('a'));
335
- * // => false
336
- *
337
- * _.eq(NaN, NaN);
338
- * // => true
339
- */
340
- function eq(value, other) {
341
- return value === other || (value !== value && other !== other);
342
- }
343
-
344
- var eq_1 = eq;
345
-
346
- /**
347
- * Gets the index at which the `key` is found in `array` of key-value pairs.
348
- *
349
- * @private
350
- * @param {Array} array The array to inspect.
351
- * @param {*} key The key to search for.
352
- * @returns {number} Returns the index of the matched value, else `-1`.
353
- */
354
- function assocIndexOf(array, key) {
355
- var length = array.length;
356
- while (length--) {
357
- if (eq_1(array[length][0], key)) {
358
- return length;
359
- }
360
- }
361
- return -1;
362
- }
363
-
364
- var _assocIndexOf = assocIndexOf;
365
-
366
- /** Used for built-in method references. */
367
- var arrayProto = Array.prototype;
368
-
369
- /** Built-in value references. */
370
- var splice = arrayProto.splice;
371
-
372
- /**
373
- * Removes `key` and its value from the list cache.
374
- *
375
- * @private
376
- * @name delete
377
- * @memberOf ListCache
378
- * @param {string} key The key of the value to remove.
379
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
380
- */
381
- function listCacheDelete(key) {
382
- var data = this.__data__,
383
- index = _assocIndexOf(data, key);
384
-
385
- if (index < 0) {
386
- return false;
387
- }
388
- var lastIndex = data.length - 1;
389
- if (index == lastIndex) {
390
- data.pop();
391
- } else {
392
- splice.call(data, index, 1);
393
- }
394
- --this.size;
395
- return true;
396
- }
397
-
398
- var _listCacheDelete = listCacheDelete;
399
-
400
- /**
401
- * Gets the list cache value for `key`.
402
- *
403
- * @private
404
- * @name get
405
- * @memberOf ListCache
406
- * @param {string} key The key of the value to get.
407
- * @returns {*} Returns the entry value.
408
- */
409
- function listCacheGet(key) {
410
- var data = this.__data__,
411
- index = _assocIndexOf(data, key);
412
-
413
- return index < 0 ? undefined : data[index][1];
414
- }
415
-
416
- var _listCacheGet = listCacheGet;
417
-
418
- /**
419
- * Checks if a list cache value for `key` exists.
420
- *
421
- * @private
422
- * @name has
423
- * @memberOf ListCache
424
- * @param {string} key The key of the entry to check.
425
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
426
- */
427
- function listCacheHas(key) {
428
- return _assocIndexOf(this.__data__, key) > -1;
429
- }
430
-
431
- var _listCacheHas = listCacheHas;
432
-
433
- /**
434
- * Sets the list cache `key` to `value`.
435
- *
436
- * @private
437
- * @name set
438
- * @memberOf ListCache
439
- * @param {string} key The key of the value to set.
440
- * @param {*} value The value to set.
441
- * @returns {Object} Returns the list cache instance.
442
- */
443
- function listCacheSet(key, value) {
444
- var data = this.__data__,
445
- index = _assocIndexOf(data, key);
446
-
447
- if (index < 0) {
448
- ++this.size;
449
- data.push([key, value]);
450
- } else {
451
- data[index][1] = value;
452
- }
453
- return this;
454
- }
455
-
456
- var _listCacheSet = listCacheSet;
457
-
458
- /**
459
- * Creates an list cache object.
460
- *
461
- * @private
462
- * @constructor
463
- * @param {Array} [entries] The key-value pairs to cache.
464
- */
465
- function ListCache(entries) {
466
- var index = -1,
467
- length = entries == null ? 0 : entries.length;
468
-
469
- this.clear();
470
- while (++index < length) {
471
- var entry = entries[index];
472
- this.set(entry[0], entry[1]);
473
- }
474
- }
475
-
476
- // Add methods to `ListCache`.
477
- ListCache.prototype.clear = _listCacheClear;
478
- ListCache.prototype['delete'] = _listCacheDelete;
479
- ListCache.prototype.get = _listCacheGet;
480
- ListCache.prototype.has = _listCacheHas;
481
- ListCache.prototype.set = _listCacheSet;
482
-
483
- var _ListCache = ListCache;
484
-
485
- /**
486
- * Removes all key-value entries from the stack.
487
- *
488
- * @private
489
- * @name clear
490
- * @memberOf Stack
491
- */
492
- function stackClear() {
493
- this.__data__ = new _ListCache;
494
- this.size = 0;
495
- }
496
-
497
- var _stackClear = stackClear;
498
-
499
- /**
500
- * Removes `key` and its value from the stack.
501
- *
502
- * @private
503
- * @name delete
504
- * @memberOf Stack
505
- * @param {string} key The key of the value to remove.
506
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
507
- */
508
- function stackDelete(key) {
509
- var data = this.__data__,
510
- result = data['delete'](key);
511
-
512
- this.size = data.size;
513
- return result;
514
- }
515
-
516
- var _stackDelete = stackDelete;
517
-
518
- /**
519
- * Gets the stack value for `key`.
520
- *
521
- * @private
522
- * @name get
523
- * @memberOf Stack
524
- * @param {string} key The key of the value to get.
525
- * @returns {*} Returns the entry value.
526
- */
527
- function stackGet(key) {
528
- return this.__data__.get(key);
529
- }
530
-
531
- var _stackGet = stackGet;
532
-
533
- /**
534
- * Checks if a stack value for `key` exists.
535
- *
536
- * @private
537
- * @name has
538
- * @memberOf Stack
539
- * @param {string} key The key of the entry to check.
540
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
541
- */
542
- function stackHas(key) {
543
- return this.__data__.has(key);
544
- }
545
-
546
- var _stackHas = stackHas;
547
-
548
294
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
549
295
 
550
296
  function createCommonjsModule(fn) {
@@ -572,17 +318,17 @@ var Symbol = _root.Symbol;
572
318
  var _Symbol = Symbol;
573
319
 
574
320
  /** Used for built-in method references. */
575
- var objectProto$b = Object.prototype;
321
+ var objectProto$3 = Object.prototype;
576
322
 
577
323
  /** Used to check objects for own properties. */
578
- var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
324
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
579
325
 
580
326
  /**
581
327
  * Used to resolve the
582
328
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
583
329
  * of values.
584
330
  */
585
- var nativeObjectToString$1 = objectProto$b.toString;
331
+ var nativeObjectToString$1 = objectProto$3.toString;
586
332
 
587
333
  /** Built-in value references. */
588
334
  var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
@@ -595,7 +341,7 @@ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
595
341
  * @returns {string} Returns the raw `toStringTag`.
596
342
  */
597
343
  function getRawTag(value) {
598
- var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
344
+ var isOwn = hasOwnProperty$2.call(value, symToStringTag$1),
599
345
  tag = value[symToStringTag$1];
600
346
 
601
347
  try {
@@ -617,14 +363,14 @@ function getRawTag(value) {
617
363
  var _getRawTag = getRawTag;
618
364
 
619
365
  /** Used for built-in method references. */
620
- var objectProto$a = Object.prototype;
366
+ var objectProto$2 = Object.prototype;
621
367
 
622
368
  /**
623
369
  * Used to resolve the
624
370
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
625
371
  * of values.
626
372
  */
627
- var nativeObjectToString = objectProto$a.toString;
373
+ var nativeObjectToString = objectProto$2.toString;
628
374
 
629
375
  /**
630
376
  * Converts `value` to a string using `Object.prototype.toString`.
@@ -698,7 +444,7 @@ var isObject_1 = isObject;
698
444
 
699
445
  /** `Object#toString` result references. */
700
446
  var asyncTag = '[object AsyncFunction]',
701
- funcTag$1 = '[object Function]',
447
+ funcTag = '[object Function]',
702
448
  genTag = '[object GeneratorFunction]',
703
449
  proxyTag = '[object Proxy]';
704
450
 
@@ -726,7 +472,7 @@ function isFunction(value) {
726
472
  // The use of `Object#toString` avoids issues with the `typeof` operator
727
473
  // in Safari 9 which returns 'object' for typed arrays and other constructors.
728
474
  var tag = _baseGetTag(value);
729
- return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
475
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
730
476
  }
731
477
 
732
478
  var isFunction_1 = isFunction;
@@ -793,17 +539,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
793
539
 
794
540
  /** Used for built-in method references. */
795
541
  var funcProto = Function.prototype,
796
- objectProto$9 = Object.prototype;
542
+ objectProto$1 = Object.prototype;
797
543
 
798
544
  /** Used to resolve the decompiled source of functions. */
799
545
  var funcToString = funcProto.toString;
800
546
 
801
547
  /** Used to check objects for own properties. */
802
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
548
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
803
549
 
804
550
  /** Used to detect if a method is native. */
805
551
  var reIsNative = RegExp('^' +
806
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
552
+ funcToString.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&')
807
553
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
808
554
  );
809
555
 
@@ -860,1104 +606,144 @@ var Map = _getNative(_root, 'Map');
860
606
  var _Map = Map;
861
607
 
862
608
  /* Built-in method references that are verified to be native. */
863
- var nativeCreate = _getNative(Object, 'create');
864
-
865
- var _nativeCreate = nativeCreate;
609
+ _getNative(Object, 'create');
866
610
 
867
611
  /**
868
- * Removes all key-value entries from the hash.
612
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
613
+ * and has a `typeof` result of "object".
869
614
  *
870
- * @private
871
- * @name clear
872
- * @memberOf Hash
873
- */
874
- function hashClear() {
875
- this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
876
- this.size = 0;
877
- }
878
-
879
- var _hashClear = hashClear;
880
-
881
- /**
882
- * Removes `key` and its value from the hash.
615
+ * @static
616
+ * @memberOf _
617
+ * @since 4.0.0
618
+ * @category Lang
619
+ * @param {*} value The value to check.
620
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
621
+ * @example
883
622
  *
884
- * @private
885
- * @name delete
886
- * @memberOf Hash
887
- * @param {Object} hash The hash to modify.
888
- * @param {string} key The key of the value to remove.
889
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
623
+ * _.isObjectLike({});
624
+ * // => true
625
+ *
626
+ * _.isObjectLike([1, 2, 3]);
627
+ * // => true
628
+ *
629
+ * _.isObjectLike(_.noop);
630
+ * // => false
631
+ *
632
+ * _.isObjectLike(null);
633
+ * // => false
890
634
  */
891
- function hashDelete(key) {
892
- var result = this.has(key) && delete this.__data__[key];
893
- this.size -= result ? 1 : 0;
894
- return result;
635
+ function isObjectLike(value) {
636
+ return value != null && typeof value == 'object';
895
637
  }
896
638
 
897
- var _hashDelete = hashDelete;
898
-
899
- /** Used to stand-in for `undefined` hash values. */
900
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
901
-
902
- /** Used for built-in method references. */
903
- var objectProto$8 = Object.prototype;
639
+ var isObjectLike_1 = isObjectLike;
904
640
 
905
- /** Used to check objects for own properties. */
906
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
641
+ /** `Object#toString` result references. */
642
+ var argsTag = '[object Arguments]';
907
643
 
908
644
  /**
909
- * Gets the hash value for `key`.
645
+ * The base implementation of `_.isArguments`.
910
646
  *
911
647
  * @private
912
- * @name get
913
- * @memberOf Hash
914
- * @param {string} key The key of the value to get.
915
- * @returns {*} Returns the entry value.
648
+ * @param {*} value The value to check.
649
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
916
650
  */
917
- function hashGet(key) {
918
- var data = this.__data__;
919
- if (_nativeCreate) {
920
- var result = data[key];
921
- return result === HASH_UNDEFINED$2 ? undefined : result;
922
- }
923
- return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
651
+ function baseIsArguments(value) {
652
+ return isObjectLike_1(value) && _baseGetTag(value) == argsTag;
924
653
  }
925
654
 
926
- var _hashGet = hashGet;
655
+ var _baseIsArguments = baseIsArguments;
927
656
 
928
657
  /** Used for built-in method references. */
929
- var objectProto$7 = Object.prototype;
658
+ var objectProto = Object.prototype;
930
659
 
931
660
  /** Used to check objects for own properties. */
932
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
661
+ var hasOwnProperty = objectProto.hasOwnProperty;
662
+
663
+ /** Built-in value references. */
664
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
933
665
 
934
666
  /**
935
- * Checks if a hash value for `key` exists.
667
+ * Checks if `value` is likely an `arguments` object.
936
668
  *
937
- * @private
938
- * @name has
939
- * @memberOf Hash
940
- * @param {string} key The key of the entry to check.
941
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
669
+ * @static
670
+ * @memberOf _
671
+ * @since 0.1.0
672
+ * @category Lang
673
+ * @param {*} value The value to check.
674
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
675
+ * else `false`.
676
+ * @example
677
+ *
678
+ * _.isArguments(function() { return arguments; }());
679
+ * // => true
680
+ *
681
+ * _.isArguments([1, 2, 3]);
682
+ * // => false
942
683
  */
943
- function hashHas(key) {
944
- var data = this.__data__;
945
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
946
- }
947
-
948
- var _hashHas = hashHas;
949
-
950
- /** Used to stand-in for `undefined` hash values. */
951
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
684
+ _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
685
+ return isObjectLike_1(value) && hasOwnProperty.call(value, 'callee') &&
686
+ !propertyIsEnumerable.call(value, 'callee');
687
+ };
952
688
 
953
689
  /**
954
- * Sets the hash `key` to `value`.
690
+ * This method returns `false`.
955
691
  *
956
- * @private
957
- * @name set
958
- * @memberOf Hash
959
- * @param {string} key The key of the value to set.
960
- * @param {*} value The value to set.
961
- * @returns {Object} Returns the hash instance.
692
+ * @static
693
+ * @memberOf _
694
+ * @since 4.13.0
695
+ * @category Util
696
+ * @returns {boolean} Returns `false`.
697
+ * @example
698
+ *
699
+ * _.times(2, _.stubFalse);
700
+ * // => [false, false]
962
701
  */
963
- function hashSet(key, value) {
964
- var data = this.__data__;
965
- this.size += this.has(key) ? 0 : 1;
966
- data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
967
- return this;
702
+ function stubFalse() {
703
+ return false;
968
704
  }
969
705
 
970
- var _hashSet = hashSet;
706
+ var stubFalse_1 = stubFalse;
971
707
 
972
- /**
973
- * Creates a hash object.
974
- *
975
- * @private
976
- * @constructor
977
- * @param {Array} [entries] The key-value pairs to cache.
978
- */
979
- function Hash(entries) {
980
- var index = -1,
981
- length = entries == null ? 0 : entries.length;
982
-
983
- this.clear();
984
- while (++index < length) {
985
- var entry = entries[index];
986
- this.set(entry[0], entry[1]);
987
- }
988
- }
708
+ createCommonjsModule(function (module, exports) {
709
+ /** Detect free variable `exports`. */
710
+ var freeExports = exports && !exports.nodeType && exports;
989
711
 
990
- // Add methods to `Hash`.
991
- Hash.prototype.clear = _hashClear;
992
- Hash.prototype['delete'] = _hashDelete;
993
- Hash.prototype.get = _hashGet;
994
- Hash.prototype.has = _hashHas;
995
- Hash.prototype.set = _hashSet;
712
+ /** Detect free variable `module`. */
713
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
996
714
 
997
- var _Hash = Hash;
715
+ /** Detect the popular CommonJS extension `module.exports`. */
716
+ var moduleExports = freeModule && freeModule.exports === freeExports;
998
717
 
999
- /**
1000
- * Removes all key-value entries from the map.
1001
- *
1002
- * @private
1003
- * @name clear
1004
- * @memberOf MapCache
1005
- */
1006
- function mapCacheClear() {
1007
- this.size = 0;
1008
- this.__data__ = {
1009
- 'hash': new _Hash,
1010
- 'map': new (_Map || _ListCache),
1011
- 'string': new _Hash
1012
- };
1013
- }
718
+ /** Built-in value references. */
719
+ var Buffer = moduleExports ? _root.Buffer : undefined;
1014
720
 
1015
- var _mapCacheClear = mapCacheClear;
721
+ /* Built-in method references for those with the same name as other `lodash` methods. */
722
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1016
723
 
1017
724
  /**
1018
- * Checks if `value` is suitable for use as unique object key.
725
+ * Checks if `value` is a buffer.
1019
726
  *
1020
- * @private
727
+ * @static
728
+ * @memberOf _
729
+ * @since 4.3.0
730
+ * @category Lang
1021
731
  * @param {*} value The value to check.
1022
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1023
- */
1024
- function isKeyable(value) {
1025
- var type = typeof value;
1026
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1027
- ? (value !== '__proto__')
1028
- : (value === null);
1029
- }
1030
-
1031
- var _isKeyable = isKeyable;
1032
-
1033
- /**
1034
- * Gets the data for `map`.
732
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
733
+ * @example
1035
734
  *
1036
- * @private
1037
- * @param {Object} map The map to query.
1038
- * @param {string} key The reference key.
1039
- * @returns {*} Returns the map data.
1040
- */
1041
- function getMapData(map, key) {
1042
- var data = map.__data__;
1043
- return _isKeyable(key)
1044
- ? data[typeof key == 'string' ? 'string' : 'hash']
1045
- : data.map;
1046
- }
1047
-
1048
- var _getMapData = getMapData;
1049
-
1050
- /**
1051
- * Removes `key` and its value from the map.
735
+ * _.isBuffer(new Buffer(2));
736
+ * // => true
1052
737
  *
1053
- * @private
1054
- * @name delete
1055
- * @memberOf MapCache
1056
- * @param {string} key The key of the value to remove.
1057
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
738
+ * _.isBuffer(new Uint8Array(2));
739
+ * // => false
1058
740
  */
1059
- function mapCacheDelete(key) {
1060
- var result = _getMapData(this, key)['delete'](key);
1061
- this.size -= result ? 1 : 0;
1062
- return result;
1063
- }
741
+ var isBuffer = nativeIsBuffer || stubFalse_1;
1064
742
 
1065
- var _mapCacheDelete = mapCacheDelete;
743
+ module.exports = isBuffer;
744
+ });
1066
745
 
1067
- /**
1068
- * Gets the map value for `key`.
1069
- *
1070
- * @private
1071
- * @name get
1072
- * @memberOf MapCache
1073
- * @param {string} key The key of the value to get.
1074
- * @returns {*} Returns the entry value.
1075
- */
1076
- function mapCacheGet(key) {
1077
- return _getMapData(this, key).get(key);
1078
- }
1079
-
1080
- var _mapCacheGet = mapCacheGet;
1081
-
1082
- /**
1083
- * Checks if a map value for `key` exists.
1084
- *
1085
- * @private
1086
- * @name has
1087
- * @memberOf MapCache
1088
- * @param {string} key The key of the entry to check.
1089
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1090
- */
1091
- function mapCacheHas(key) {
1092
- return _getMapData(this, key).has(key);
1093
- }
1094
-
1095
- var _mapCacheHas = mapCacheHas;
1096
-
1097
- /**
1098
- * Sets the map `key` to `value`.
1099
- *
1100
- * @private
1101
- * @name set
1102
- * @memberOf MapCache
1103
- * @param {string} key The key of the value to set.
1104
- * @param {*} value The value to set.
1105
- * @returns {Object} Returns the map cache instance.
1106
- */
1107
- function mapCacheSet(key, value) {
1108
- var data = _getMapData(this, key),
1109
- size = data.size;
1110
-
1111
- data.set(key, value);
1112
- this.size += data.size == size ? 0 : 1;
1113
- return this;
1114
- }
1115
-
1116
- var _mapCacheSet = mapCacheSet;
1117
-
1118
- /**
1119
- * Creates a map cache object to store key-value pairs.
1120
- *
1121
- * @private
1122
- * @constructor
1123
- * @param {Array} [entries] The key-value pairs to cache.
1124
- */
1125
- function MapCache(entries) {
1126
- var index = -1,
1127
- length = entries == null ? 0 : entries.length;
1128
-
1129
- this.clear();
1130
- while (++index < length) {
1131
- var entry = entries[index];
1132
- this.set(entry[0], entry[1]);
1133
- }
1134
- }
1135
-
1136
- // Add methods to `MapCache`.
1137
- MapCache.prototype.clear = _mapCacheClear;
1138
- MapCache.prototype['delete'] = _mapCacheDelete;
1139
- MapCache.prototype.get = _mapCacheGet;
1140
- MapCache.prototype.has = _mapCacheHas;
1141
- MapCache.prototype.set = _mapCacheSet;
1142
-
1143
- var _MapCache = MapCache;
1144
-
1145
- /** Used as the size to enable large array optimizations. */
1146
- var LARGE_ARRAY_SIZE = 200;
1147
-
1148
- /**
1149
- * Sets the stack `key` to `value`.
1150
- *
1151
- * @private
1152
- * @name set
1153
- * @memberOf Stack
1154
- * @param {string} key The key of the value to set.
1155
- * @param {*} value The value to set.
1156
- * @returns {Object} Returns the stack cache instance.
1157
- */
1158
- function stackSet(key, value) {
1159
- var data = this.__data__;
1160
- if (data instanceof _ListCache) {
1161
- var pairs = data.__data__;
1162
- if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1163
- pairs.push([key, value]);
1164
- this.size = ++data.size;
1165
- return this;
1166
- }
1167
- data = this.__data__ = new _MapCache(pairs);
1168
- }
1169
- data.set(key, value);
1170
- this.size = data.size;
1171
- return this;
1172
- }
1173
-
1174
- var _stackSet = stackSet;
1175
-
1176
- /**
1177
- * Creates a stack cache object to store key-value pairs.
1178
- *
1179
- * @private
1180
- * @constructor
1181
- * @param {Array} [entries] The key-value pairs to cache.
1182
- */
1183
- function Stack(entries) {
1184
- var data = this.__data__ = new _ListCache(entries);
1185
- this.size = data.size;
1186
- }
1187
-
1188
- // Add methods to `Stack`.
1189
- Stack.prototype.clear = _stackClear;
1190
- Stack.prototype['delete'] = _stackDelete;
1191
- Stack.prototype.get = _stackGet;
1192
- Stack.prototype.has = _stackHas;
1193
- Stack.prototype.set = _stackSet;
1194
-
1195
- var _Stack = Stack;
1196
-
1197
- /** Used to stand-in for `undefined` hash values. */
1198
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1199
-
1200
- /**
1201
- * Adds `value` to the array cache.
1202
- *
1203
- * @private
1204
- * @name add
1205
- * @memberOf SetCache
1206
- * @alias push
1207
- * @param {*} value The value to cache.
1208
- * @returns {Object} Returns the cache instance.
1209
- */
1210
- function setCacheAdd(value) {
1211
- this.__data__.set(value, HASH_UNDEFINED);
1212
- return this;
1213
- }
1214
-
1215
- var _setCacheAdd = setCacheAdd;
1216
-
1217
- /**
1218
- * Checks if `value` is in the array cache.
1219
- *
1220
- * @private
1221
- * @name has
1222
- * @memberOf SetCache
1223
- * @param {*} value The value to search for.
1224
- * @returns {number} Returns `true` if `value` is found, else `false`.
1225
- */
1226
- function setCacheHas(value) {
1227
- return this.__data__.has(value);
1228
- }
1229
-
1230
- var _setCacheHas = setCacheHas;
1231
-
1232
- /**
1233
- *
1234
- * Creates an array cache object to store unique values.
1235
- *
1236
- * @private
1237
- * @constructor
1238
- * @param {Array} [values] The values to cache.
1239
- */
1240
- function SetCache(values) {
1241
- var index = -1,
1242
- length = values == null ? 0 : values.length;
1243
-
1244
- this.__data__ = new _MapCache;
1245
- while (++index < length) {
1246
- this.add(values[index]);
1247
- }
1248
- }
1249
-
1250
- // Add methods to `SetCache`.
1251
- SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
1252
- SetCache.prototype.has = _setCacheHas;
1253
-
1254
- var _SetCache = SetCache;
1255
-
1256
- /**
1257
- * A specialized version of `_.some` for arrays without support for iteratee
1258
- * shorthands.
1259
- *
1260
- * @private
1261
- * @param {Array} [array] The array to iterate over.
1262
- * @param {Function} predicate The function invoked per iteration.
1263
- * @returns {boolean} Returns `true` if any element passes the predicate check,
1264
- * else `false`.
1265
- */
1266
- function arraySome(array, predicate) {
1267
- var index = -1,
1268
- length = array == null ? 0 : array.length;
1269
-
1270
- while (++index < length) {
1271
- if (predicate(array[index], index, array)) {
1272
- return true;
1273
- }
1274
- }
1275
- return false;
1276
- }
1277
-
1278
- var _arraySome = arraySome;
1279
-
1280
- /**
1281
- * Checks if a `cache` value for `key` exists.
1282
- *
1283
- * @private
1284
- * @param {Object} cache The cache to query.
1285
- * @param {string} key The key of the entry to check.
1286
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1287
- */
1288
- function cacheHas(cache, key) {
1289
- return cache.has(key);
1290
- }
1291
-
1292
- var _cacheHas = cacheHas;
1293
-
1294
- /** Used to compose bitmasks for value comparisons. */
1295
- var COMPARE_PARTIAL_FLAG$3 = 1,
1296
- COMPARE_UNORDERED_FLAG$1 = 2;
1297
-
1298
- /**
1299
- * A specialized version of `baseIsEqualDeep` for arrays with support for
1300
- * partial deep comparisons.
1301
- *
1302
- * @private
1303
- * @param {Array} array The array to compare.
1304
- * @param {Array} other The other array to compare.
1305
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1306
- * @param {Function} customizer The function to customize comparisons.
1307
- * @param {Function} equalFunc The function to determine equivalents of values.
1308
- * @param {Object} stack Tracks traversed `array` and `other` objects.
1309
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1310
- */
1311
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1312
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
1313
- arrLength = array.length,
1314
- othLength = other.length;
1315
-
1316
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1317
- return false;
1318
- }
1319
- // Check that cyclic values are equal.
1320
- var arrStacked = stack.get(array);
1321
- var othStacked = stack.get(other);
1322
- if (arrStacked && othStacked) {
1323
- return arrStacked == other && othStacked == array;
1324
- }
1325
- var index = -1,
1326
- result = true,
1327
- seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new _SetCache : undefined;
1328
-
1329
- stack.set(array, other);
1330
- stack.set(other, array);
1331
-
1332
- // Ignore non-index properties.
1333
- while (++index < arrLength) {
1334
- var arrValue = array[index],
1335
- othValue = other[index];
1336
-
1337
- if (customizer) {
1338
- var compared = isPartial
1339
- ? customizer(othValue, arrValue, index, other, array, stack)
1340
- : customizer(arrValue, othValue, index, array, other, stack);
1341
- }
1342
- if (compared !== undefined) {
1343
- if (compared) {
1344
- continue;
1345
- }
1346
- result = false;
1347
- break;
1348
- }
1349
- // Recursively compare arrays (susceptible to call stack limits).
1350
- if (seen) {
1351
- if (!_arraySome(other, function(othValue, othIndex) {
1352
- if (!_cacheHas(seen, othIndex) &&
1353
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1354
- return seen.push(othIndex);
1355
- }
1356
- })) {
1357
- result = false;
1358
- break;
1359
- }
1360
- } else if (!(
1361
- arrValue === othValue ||
1362
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
1363
- )) {
1364
- result = false;
1365
- break;
1366
- }
1367
- }
1368
- stack['delete'](array);
1369
- stack['delete'](other);
1370
- return result;
1371
- }
1372
-
1373
- var _equalArrays = equalArrays;
1374
-
1375
- /** Built-in value references. */
1376
- var Uint8Array$1 = _root.Uint8Array;
1377
-
1378
- var _Uint8Array = Uint8Array$1;
1379
-
1380
- /**
1381
- * Converts `map` to its key-value pairs.
1382
- *
1383
- * @private
1384
- * @param {Object} map The map to convert.
1385
- * @returns {Array} Returns the key-value pairs.
1386
- */
1387
- function mapToArray(map) {
1388
- var index = -1,
1389
- result = Array(map.size);
1390
-
1391
- map.forEach(function(value, key) {
1392
- result[++index] = [key, value];
1393
- });
1394
- return result;
1395
- }
1396
-
1397
- var _mapToArray = mapToArray;
1398
-
1399
- /**
1400
- * Converts `set` to an array of its values.
1401
- *
1402
- * @private
1403
- * @param {Object} set The set to convert.
1404
- * @returns {Array} Returns the values.
1405
- */
1406
- function setToArray(set) {
1407
- var index = -1,
1408
- result = Array(set.size);
1409
-
1410
- set.forEach(function(value) {
1411
- result[++index] = value;
1412
- });
1413
- return result;
1414
- }
1415
-
1416
- var _setToArray = setToArray;
1417
-
1418
- /** Used to compose bitmasks for value comparisons. */
1419
- var COMPARE_PARTIAL_FLAG$2 = 1,
1420
- COMPARE_UNORDERED_FLAG = 2;
1421
-
1422
- /** `Object#toString` result references. */
1423
- var boolTag$1 = '[object Boolean]',
1424
- dateTag$1 = '[object Date]',
1425
- errorTag$1 = '[object Error]',
1426
- mapTag$2 = '[object Map]',
1427
- numberTag$1 = '[object Number]',
1428
- regexpTag$1 = '[object RegExp]',
1429
- setTag$2 = '[object Set]',
1430
- stringTag$1 = '[object String]',
1431
- symbolTag = '[object Symbol]';
1432
-
1433
- var arrayBufferTag$1 = '[object ArrayBuffer]',
1434
- dataViewTag$2 = '[object DataView]';
1435
-
1436
- /** Used to convert symbols to primitives and strings. */
1437
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1438
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1439
-
1440
- /**
1441
- * A specialized version of `baseIsEqualDeep` for comparing objects of
1442
- * the same `toStringTag`.
1443
- *
1444
- * **Note:** This function only supports comparing values with tags of
1445
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1446
- *
1447
- * @private
1448
- * @param {Object} object The object to compare.
1449
- * @param {Object} other The other object to compare.
1450
- * @param {string} tag The `toStringTag` of the objects to compare.
1451
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1452
- * @param {Function} customizer The function to customize comparisons.
1453
- * @param {Function} equalFunc The function to determine equivalents of values.
1454
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1455
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1456
- */
1457
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1458
- switch (tag) {
1459
- case dataViewTag$2:
1460
- if ((object.byteLength != other.byteLength) ||
1461
- (object.byteOffset != other.byteOffset)) {
1462
- return false;
1463
- }
1464
- object = object.buffer;
1465
- other = other.buffer;
1466
-
1467
- case arrayBufferTag$1:
1468
- if ((object.byteLength != other.byteLength) ||
1469
- !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
1470
- return false;
1471
- }
1472
- return true;
1473
-
1474
- case boolTag$1:
1475
- case dateTag$1:
1476
- case numberTag$1:
1477
- // Coerce booleans to `1` or `0` and dates to milliseconds.
1478
- // Invalid dates are coerced to `NaN`.
1479
- return eq_1(+object, +other);
1480
-
1481
- case errorTag$1:
1482
- return object.name == other.name && object.message == other.message;
1483
-
1484
- case regexpTag$1:
1485
- case stringTag$1:
1486
- // Coerce regexes to strings and treat strings, primitives and objects,
1487
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1488
- // for more details.
1489
- return object == (other + '');
1490
-
1491
- case mapTag$2:
1492
- var convert = _mapToArray;
1493
-
1494
- case setTag$2:
1495
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1496
- convert || (convert = _setToArray);
1497
-
1498
- if (object.size != other.size && !isPartial) {
1499
- return false;
1500
- }
1501
- // Assume cyclic values are equal.
1502
- var stacked = stack.get(object);
1503
- if (stacked) {
1504
- return stacked == other;
1505
- }
1506
- bitmask |= COMPARE_UNORDERED_FLAG;
1507
-
1508
- // Recursively compare objects (susceptible to call stack limits).
1509
- stack.set(object, other);
1510
- var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1511
- stack['delete'](object);
1512
- return result;
1513
-
1514
- case symbolTag:
1515
- if (symbolValueOf) {
1516
- return symbolValueOf.call(object) == symbolValueOf.call(other);
1517
- }
1518
- }
1519
- return false;
1520
- }
1521
-
1522
- var _equalByTag = equalByTag;
1523
-
1524
- /**
1525
- * Appends the elements of `values` to `array`.
1526
- *
1527
- * @private
1528
- * @param {Array} array The array to modify.
1529
- * @param {Array} values The values to append.
1530
- * @returns {Array} Returns `array`.
1531
- */
1532
- function arrayPush(array, values) {
1533
- var index = -1,
1534
- length = values.length,
1535
- offset = array.length;
1536
-
1537
- while (++index < length) {
1538
- array[offset + index] = values[index];
1539
- }
1540
- return array;
1541
- }
1542
-
1543
- var _arrayPush = arrayPush;
1544
-
1545
- /**
1546
- * Checks if `value` is classified as an `Array` object.
1547
- *
1548
- * @static
1549
- * @memberOf _
1550
- * @since 0.1.0
1551
- * @category Lang
1552
- * @param {*} value The value to check.
1553
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1554
- * @example
1555
- *
1556
- * _.isArray([1, 2, 3]);
1557
- * // => true
1558
- *
1559
- * _.isArray(document.body.children);
1560
- * // => false
1561
- *
1562
- * _.isArray('abc');
1563
- * // => false
1564
- *
1565
- * _.isArray(_.noop);
1566
- * // => false
1567
- */
1568
- var isArray = Array.isArray;
1569
-
1570
- var isArray_1 = isArray;
1571
-
1572
- /**
1573
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1574
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1575
- * symbols of `object`.
1576
- *
1577
- * @private
1578
- * @param {Object} object The object to query.
1579
- * @param {Function} keysFunc The function to get the keys of `object`.
1580
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1581
- * @returns {Array} Returns the array of property names and symbols.
1582
- */
1583
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1584
- var result = keysFunc(object);
1585
- return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
1586
- }
1587
-
1588
- var _baseGetAllKeys = baseGetAllKeys;
1589
-
1590
- /**
1591
- * A specialized version of `_.filter` for arrays without support for
1592
- * iteratee shorthands.
1593
- *
1594
- * @private
1595
- * @param {Array} [array] The array to iterate over.
1596
- * @param {Function} predicate The function invoked per iteration.
1597
- * @returns {Array} Returns the new filtered array.
1598
- */
1599
- function arrayFilter(array, predicate) {
1600
- var index = -1,
1601
- length = array == null ? 0 : array.length,
1602
- resIndex = 0,
1603
- result = [];
1604
-
1605
- while (++index < length) {
1606
- var value = array[index];
1607
- if (predicate(value, index, array)) {
1608
- result[resIndex++] = value;
1609
- }
1610
- }
1611
- return result;
1612
- }
1613
-
1614
- var _arrayFilter = arrayFilter;
1615
-
1616
- /**
1617
- * This method returns a new empty array.
1618
- *
1619
- * @static
1620
- * @memberOf _
1621
- * @since 4.13.0
1622
- * @category Util
1623
- * @returns {Array} Returns the new empty array.
1624
- * @example
1625
- *
1626
- * var arrays = _.times(2, _.stubArray);
1627
- *
1628
- * console.log(arrays);
1629
- * // => [[], []]
1630
- *
1631
- * console.log(arrays[0] === arrays[1]);
1632
- * // => false
1633
- */
1634
- function stubArray() {
1635
- return [];
1636
- }
1637
-
1638
- var stubArray_1 = stubArray;
1639
-
1640
- /** Used for built-in method references. */
1641
- var objectProto$6 = Object.prototype;
1642
-
1643
- /** Built-in value references. */
1644
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
1645
-
1646
- /* Built-in method references for those with the same name as other `lodash` methods. */
1647
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1648
-
1649
- /**
1650
- * Creates an array of the own enumerable symbols of `object`.
1651
- *
1652
- * @private
1653
- * @param {Object} object The object to query.
1654
- * @returns {Array} Returns the array of symbols.
1655
- */
1656
- var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) {
1657
- if (object == null) {
1658
- return [];
1659
- }
1660
- object = Object(object);
1661
- return _arrayFilter(nativeGetSymbols(object), function(symbol) {
1662
- return propertyIsEnumerable$1.call(object, symbol);
1663
- });
1664
- };
1665
-
1666
- var _getSymbols = getSymbols;
1667
-
1668
- /**
1669
- * The base implementation of `_.times` without support for iteratee shorthands
1670
- * or max array length checks.
1671
- *
1672
- * @private
1673
- * @param {number} n The number of times to invoke `iteratee`.
1674
- * @param {Function} iteratee The function invoked per iteration.
1675
- * @returns {Array} Returns the array of results.
1676
- */
1677
- function baseTimes(n, iteratee) {
1678
- var index = -1,
1679
- result = Array(n);
1680
-
1681
- while (++index < n) {
1682
- result[index] = iteratee(index);
1683
- }
1684
- return result;
1685
- }
1686
-
1687
- var _baseTimes = baseTimes;
1688
-
1689
- /**
1690
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1691
- * and has a `typeof` result of "object".
1692
- *
1693
- * @static
1694
- * @memberOf _
1695
- * @since 4.0.0
1696
- * @category Lang
1697
- * @param {*} value The value to check.
1698
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1699
- * @example
1700
- *
1701
- * _.isObjectLike({});
1702
- * // => true
1703
- *
1704
- * _.isObjectLike([1, 2, 3]);
1705
- * // => true
1706
- *
1707
- * _.isObjectLike(_.noop);
1708
- * // => false
1709
- *
1710
- * _.isObjectLike(null);
1711
- * // => false
1712
- */
1713
- function isObjectLike(value) {
1714
- return value != null && typeof value == 'object';
1715
- }
1716
-
1717
- var isObjectLike_1 = isObjectLike;
1718
-
1719
- /** `Object#toString` result references. */
1720
- var argsTag$2 = '[object Arguments]';
1721
-
1722
- /**
1723
- * The base implementation of `_.isArguments`.
1724
- *
1725
- * @private
1726
- * @param {*} value The value to check.
1727
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1728
- */
1729
- function baseIsArguments(value) {
1730
- return isObjectLike_1(value) && _baseGetTag(value) == argsTag$2;
1731
- }
1732
-
1733
- var _baseIsArguments = baseIsArguments;
1734
-
1735
- /** Used for built-in method references. */
1736
- var objectProto$5 = Object.prototype;
1737
-
1738
- /** Used to check objects for own properties. */
1739
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1740
-
1741
- /** Built-in value references. */
1742
- var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
1743
-
1744
- /**
1745
- * Checks if `value` is likely an `arguments` object.
1746
- *
1747
- * @static
1748
- * @memberOf _
1749
- * @since 0.1.0
1750
- * @category Lang
1751
- * @param {*} value The value to check.
1752
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1753
- * else `false`.
1754
- * @example
1755
- *
1756
- * _.isArguments(function() { return arguments; }());
1757
- * // => true
1758
- *
1759
- * _.isArguments([1, 2, 3]);
1760
- * // => false
1761
- */
1762
- var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
1763
- return isObjectLike_1(value) && hasOwnProperty$4.call(value, 'callee') &&
1764
- !propertyIsEnumerable.call(value, 'callee');
1765
- };
1766
-
1767
- var isArguments_1 = isArguments;
1768
-
1769
- /**
1770
- * This method returns `false`.
1771
- *
1772
- * @static
1773
- * @memberOf _
1774
- * @since 4.13.0
1775
- * @category Util
1776
- * @returns {boolean} Returns `false`.
1777
- * @example
1778
- *
1779
- * _.times(2, _.stubFalse);
1780
- * // => [false, false]
1781
- */
1782
- function stubFalse() {
1783
- return false;
1784
- }
1785
-
1786
- var stubFalse_1 = stubFalse;
1787
-
1788
- var isBuffer_1 = createCommonjsModule(function (module, exports) {
1789
- /** Detect free variable `exports`. */
1790
- var freeExports = exports && !exports.nodeType && exports;
1791
-
1792
- /** Detect free variable `module`. */
1793
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1794
-
1795
- /** Detect the popular CommonJS extension `module.exports`. */
1796
- var moduleExports = freeModule && freeModule.exports === freeExports;
1797
-
1798
- /** Built-in value references. */
1799
- var Buffer = moduleExports ? _root.Buffer : undefined;
1800
-
1801
- /* Built-in method references for those with the same name as other `lodash` methods. */
1802
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1803
-
1804
- /**
1805
- * Checks if `value` is a buffer.
1806
- *
1807
- * @static
1808
- * @memberOf _
1809
- * @since 4.3.0
1810
- * @category Lang
1811
- * @param {*} value The value to check.
1812
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1813
- * @example
1814
- *
1815
- * _.isBuffer(new Buffer(2));
1816
- * // => true
1817
- *
1818
- * _.isBuffer(new Uint8Array(2));
1819
- * // => false
1820
- */
1821
- var isBuffer = nativeIsBuffer || stubFalse_1;
1822
-
1823
- module.exports = isBuffer;
1824
- });
1825
-
1826
- /** Used as references for various `Number` constants. */
1827
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
1828
-
1829
- /** Used to detect unsigned integer values. */
1830
- var reIsUint = /^(?:0|[1-9]\d*)$/;
1831
-
1832
- /**
1833
- * Checks if `value` is a valid array-like index.
1834
- *
1835
- * @private
1836
- * @param {*} value The value to check.
1837
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1838
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1839
- */
1840
- function isIndex(value, length) {
1841
- var type = typeof value;
1842
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
1843
-
1844
- return !!length &&
1845
- (type == 'number' ||
1846
- (type != 'symbol' && reIsUint.test(value))) &&
1847
- (value > -1 && value % 1 == 0 && value < length);
1848
- }
1849
-
1850
- var _isIndex = isIndex;
1851
-
1852
- /** Used as references for various `Number` constants. */
1853
- var MAX_SAFE_INTEGER = 9007199254740991;
1854
-
1855
- /**
1856
- * Checks if `value` is a valid array-like length.
1857
- *
1858
- * **Note:** This method is loosely based on
1859
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1860
- *
1861
- * @static
1862
- * @memberOf _
1863
- * @since 4.0.0
1864
- * @category Lang
1865
- * @param {*} value The value to check.
1866
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1867
- * @example
1868
- *
1869
- * _.isLength(3);
1870
- * // => true
1871
- *
1872
- * _.isLength(Number.MIN_VALUE);
1873
- * // => false
1874
- *
1875
- * _.isLength(Infinity);
1876
- * // => false
1877
- *
1878
- * _.isLength('3');
1879
- * // => false
1880
- */
1881
- function isLength(value) {
1882
- return typeof value == 'number' &&
1883
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1884
- }
1885
-
1886
- var isLength_1 = isLength;
1887
-
1888
- /** `Object#toString` result references. */
1889
- var argsTag$1 = '[object Arguments]',
1890
- arrayTag$1 = '[object Array]',
1891
- boolTag = '[object Boolean]',
1892
- dateTag = '[object Date]',
1893
- errorTag = '[object Error]',
1894
- funcTag = '[object Function]',
1895
- mapTag$1 = '[object Map]',
1896
- numberTag = '[object Number]',
1897
- objectTag$2 = '[object Object]',
1898
- regexpTag = '[object RegExp]',
1899
- setTag$1 = '[object Set]',
1900
- stringTag = '[object String]',
1901
- weakMapTag$1 = '[object WeakMap]';
1902
-
1903
- var arrayBufferTag = '[object ArrayBuffer]',
1904
- dataViewTag$1 = '[object DataView]',
1905
- float32Tag = '[object Float32Array]',
1906
- float64Tag = '[object Float64Array]',
1907
- int8Tag = '[object Int8Array]',
1908
- int16Tag = '[object Int16Array]',
1909
- int32Tag = '[object Int32Array]',
1910
- uint8Tag = '[object Uint8Array]',
1911
- uint8ClampedTag = '[object Uint8ClampedArray]',
1912
- uint16Tag = '[object Uint16Array]',
1913
- uint32Tag = '[object Uint32Array]';
1914
-
1915
- /** Used to identify `toStringTag` values of typed arrays. */
1916
- var typedArrayTags = {};
1917
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
1918
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
1919
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
1920
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
1921
- typedArrayTags[uint32Tag] = true;
1922
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1923
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
1924
- typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
1925
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
1926
- typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
1927
- typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] =
1928
- typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
1929
- typedArrayTags[weakMapTag$1] = false;
1930
-
1931
- /**
1932
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1933
- *
1934
- * @private
1935
- * @param {*} value The value to check.
1936
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1937
- */
1938
- function baseIsTypedArray(value) {
1939
- return isObjectLike_1(value) &&
1940
- isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
1941
- }
1942
-
1943
- var _baseIsTypedArray = baseIsTypedArray;
1944
-
1945
- /**
1946
- * The base implementation of `_.unary` without support for storing metadata.
1947
- *
1948
- * @private
1949
- * @param {Function} func The function to cap arguments for.
1950
- * @returns {Function} Returns the new capped function.
1951
- */
1952
- function baseUnary(func) {
1953
- return function(value) {
1954
- return func(value);
1955
- };
1956
- }
1957
-
1958
- var _baseUnary = baseUnary;
1959
-
1960
- var _nodeUtil = createCommonjsModule(function (module, exports) {
746
+ createCommonjsModule(function (module, exports) {
1961
747
  /** Detect free variable `exports`. */
1962
748
  var freeExports = exports && !exports.nodeType && exports;
1963
749
 
@@ -1988,308 +774,6 @@ var nodeUtil = (function() {
1988
774
  module.exports = nodeUtil;
1989
775
  });
1990
776
 
1991
- /* Node.js helper references. */
1992
- var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
1993
-
1994
- /**
1995
- * Checks if `value` is classified as a typed array.
1996
- *
1997
- * @static
1998
- * @memberOf _
1999
- * @since 3.0.0
2000
- * @category Lang
2001
- * @param {*} value The value to check.
2002
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2003
- * @example
2004
- *
2005
- * _.isTypedArray(new Uint8Array);
2006
- * // => true
2007
- *
2008
- * _.isTypedArray([]);
2009
- * // => false
2010
- */
2011
- var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
2012
-
2013
- var isTypedArray_1 = isTypedArray;
2014
-
2015
- /** Used for built-in method references. */
2016
- var objectProto$4 = Object.prototype;
2017
-
2018
- /** Used to check objects for own properties. */
2019
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
2020
-
2021
- /**
2022
- * Creates an array of the enumerable property names of the array-like `value`.
2023
- *
2024
- * @private
2025
- * @param {*} value The value to query.
2026
- * @param {boolean} inherited Specify returning inherited property names.
2027
- * @returns {Array} Returns the array of property names.
2028
- */
2029
- function arrayLikeKeys(value, inherited) {
2030
- var isArr = isArray_1(value),
2031
- isArg = !isArr && isArguments_1(value),
2032
- isBuff = !isArr && !isArg && isBuffer_1(value),
2033
- isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
2034
- skipIndexes = isArr || isArg || isBuff || isType,
2035
- result = skipIndexes ? _baseTimes(value.length, String) : [],
2036
- length = result.length;
2037
-
2038
- for (var key in value) {
2039
- if ((inherited || hasOwnProperty$3.call(value, key)) &&
2040
- !(skipIndexes && (
2041
- // Safari 9 has enumerable `arguments.length` in strict mode.
2042
- key == 'length' ||
2043
- // Node.js 0.10 has enumerable non-index properties on buffers.
2044
- (isBuff && (key == 'offset' || key == 'parent')) ||
2045
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
2046
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2047
- // Skip index properties.
2048
- _isIndex(key, length)
2049
- ))) {
2050
- result.push(key);
2051
- }
2052
- }
2053
- return result;
2054
- }
2055
-
2056
- var _arrayLikeKeys = arrayLikeKeys;
2057
-
2058
- /** Used for built-in method references. */
2059
- var objectProto$3 = Object.prototype;
2060
-
2061
- /**
2062
- * Checks if `value` is likely a prototype object.
2063
- *
2064
- * @private
2065
- * @param {*} value The value to check.
2066
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
2067
- */
2068
- function isPrototype(value) {
2069
- var Ctor = value && value.constructor,
2070
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
2071
-
2072
- return value === proto;
2073
- }
2074
-
2075
- var _isPrototype = isPrototype;
2076
-
2077
- /**
2078
- * Creates a unary function that invokes `func` with its argument transformed.
2079
- *
2080
- * @private
2081
- * @param {Function} func The function to wrap.
2082
- * @param {Function} transform The argument transform.
2083
- * @returns {Function} Returns the new function.
2084
- */
2085
- function overArg(func, transform) {
2086
- return function(arg) {
2087
- return func(transform(arg));
2088
- };
2089
- }
2090
-
2091
- var _overArg = overArg;
2092
-
2093
- /* Built-in method references for those with the same name as other `lodash` methods. */
2094
- var nativeKeys = _overArg(Object.keys, Object);
2095
-
2096
- var _nativeKeys = nativeKeys;
2097
-
2098
- /** Used for built-in method references. */
2099
- var objectProto$2 = Object.prototype;
2100
-
2101
- /** Used to check objects for own properties. */
2102
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2103
-
2104
- /**
2105
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2106
- *
2107
- * @private
2108
- * @param {Object} object The object to query.
2109
- * @returns {Array} Returns the array of property names.
2110
- */
2111
- function baseKeys(object) {
2112
- if (!_isPrototype(object)) {
2113
- return _nativeKeys(object);
2114
- }
2115
- var result = [];
2116
- for (var key in Object(object)) {
2117
- if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
2118
- result.push(key);
2119
- }
2120
- }
2121
- return result;
2122
- }
2123
-
2124
- var _baseKeys = baseKeys;
2125
-
2126
- /**
2127
- * Checks if `value` is array-like. A value is considered array-like if it's
2128
- * not a function and has a `value.length` that's an integer greater than or
2129
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2130
- *
2131
- * @static
2132
- * @memberOf _
2133
- * @since 4.0.0
2134
- * @category Lang
2135
- * @param {*} value The value to check.
2136
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2137
- * @example
2138
- *
2139
- * _.isArrayLike([1, 2, 3]);
2140
- * // => true
2141
- *
2142
- * _.isArrayLike(document.body.children);
2143
- * // => true
2144
- *
2145
- * _.isArrayLike('abc');
2146
- * // => true
2147
- *
2148
- * _.isArrayLike(_.noop);
2149
- * // => false
2150
- */
2151
- function isArrayLike(value) {
2152
- return value != null && isLength_1(value.length) && !isFunction_1(value);
2153
- }
2154
-
2155
- var isArrayLike_1 = isArrayLike;
2156
-
2157
- /**
2158
- * Creates an array of the own enumerable property names of `object`.
2159
- *
2160
- * **Note:** Non-object values are coerced to objects. See the
2161
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2162
- * for more details.
2163
- *
2164
- * @static
2165
- * @since 0.1.0
2166
- * @memberOf _
2167
- * @category Object
2168
- * @param {Object} object The object to query.
2169
- * @returns {Array} Returns the array of property names.
2170
- * @example
2171
- *
2172
- * function Foo() {
2173
- * this.a = 1;
2174
- * this.b = 2;
2175
- * }
2176
- *
2177
- * Foo.prototype.c = 3;
2178
- *
2179
- * _.keys(new Foo);
2180
- * // => ['a', 'b'] (iteration order is not guaranteed)
2181
- *
2182
- * _.keys('hi');
2183
- * // => ['0', '1']
2184
- */
2185
- function keys(object) {
2186
- return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
2187
- }
2188
-
2189
- var keys_1 = keys;
2190
-
2191
- /**
2192
- * Creates an array of own enumerable property names and symbols of `object`.
2193
- *
2194
- * @private
2195
- * @param {Object} object The object to query.
2196
- * @returns {Array} Returns the array of property names and symbols.
2197
- */
2198
- function getAllKeys(object) {
2199
- return _baseGetAllKeys(object, keys_1, _getSymbols);
2200
- }
2201
-
2202
- var _getAllKeys = getAllKeys;
2203
-
2204
- /** Used to compose bitmasks for value comparisons. */
2205
- var COMPARE_PARTIAL_FLAG$1 = 1;
2206
-
2207
- /** Used for built-in method references. */
2208
- var objectProto$1 = Object.prototype;
2209
-
2210
- /** Used to check objects for own properties. */
2211
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2212
-
2213
- /**
2214
- * A specialized version of `baseIsEqualDeep` for objects with support for
2215
- * partial deep comparisons.
2216
- *
2217
- * @private
2218
- * @param {Object} object The object to compare.
2219
- * @param {Object} other The other object to compare.
2220
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2221
- * @param {Function} customizer The function to customize comparisons.
2222
- * @param {Function} equalFunc The function to determine equivalents of values.
2223
- * @param {Object} stack Tracks traversed `object` and `other` objects.
2224
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2225
- */
2226
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2227
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
2228
- objProps = _getAllKeys(object),
2229
- objLength = objProps.length,
2230
- othProps = _getAllKeys(other),
2231
- othLength = othProps.length;
2232
-
2233
- if (objLength != othLength && !isPartial) {
2234
- return false;
2235
- }
2236
- var index = objLength;
2237
- while (index--) {
2238
- var key = objProps[index];
2239
- if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2240
- return false;
2241
- }
2242
- }
2243
- // Check that cyclic values are equal.
2244
- var objStacked = stack.get(object);
2245
- var othStacked = stack.get(other);
2246
- if (objStacked && othStacked) {
2247
- return objStacked == other && othStacked == object;
2248
- }
2249
- var result = true;
2250
- stack.set(object, other);
2251
- stack.set(other, object);
2252
-
2253
- var skipCtor = isPartial;
2254
- while (++index < objLength) {
2255
- key = objProps[index];
2256
- var objValue = object[key],
2257
- othValue = other[key];
2258
-
2259
- if (customizer) {
2260
- var compared = isPartial
2261
- ? customizer(othValue, objValue, key, other, object, stack)
2262
- : customizer(objValue, othValue, key, object, other, stack);
2263
- }
2264
- // Recursively compare objects (susceptible to call stack limits).
2265
- if (!(compared === undefined
2266
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
2267
- : compared
2268
- )) {
2269
- result = false;
2270
- break;
2271
- }
2272
- skipCtor || (skipCtor = key == 'constructor');
2273
- }
2274
- if (result && !skipCtor) {
2275
- var objCtor = object.constructor,
2276
- othCtor = other.constructor;
2277
-
2278
- // Non `Object` object instances with different constructors are not equal.
2279
- if (objCtor != othCtor &&
2280
- ('constructor' in object && 'constructor' in other) &&
2281
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
2282
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2283
- result = false;
2284
- }
2285
- }
2286
- stack['delete'](object);
2287
- stack['delete'](other);
2288
- return result;
2289
- }
2290
-
2291
- var _equalObjects = equalObjects;
2292
-
2293
777
  /* Built-in method references that are verified to be native. */
2294
778
  var DataView = _getNative(_root, 'DataView');
2295
779
 
@@ -2312,7 +796,7 @@ var _WeakMap = WeakMap;
2312
796
 
2313
797
  /** `Object#toString` result references. */
2314
798
  var mapTag = '[object Map]',
2315
- objectTag$1 = '[object Object]',
799
+ objectTag = '[object Object]',
2316
800
  promiseTag = '[object Promise]',
2317
801
  setTag = '[object Set]',
2318
802
  weakMapTag = '[object WeakMap]';
@@ -2343,7 +827,7 @@ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
2343
827
  (_WeakMap && getTag(new _WeakMap) != weakMapTag)) {
2344
828
  getTag = function(value) {
2345
829
  var result = _baseGetTag(value),
2346
- Ctor = result == objectTag$1 ? value.constructor : undefined,
830
+ Ctor = result == objectTag ? value.constructor : undefined,
2347
831
  ctorString = Ctor ? _toSource(Ctor) : '';
2348
832
 
2349
833
  if (ctorString) {
@@ -2359,143 +843,6 @@ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
2359
843
  };
2360
844
  }
2361
845
 
2362
- var _getTag = getTag;
2363
-
2364
- /** Used to compose bitmasks for value comparisons. */
2365
- var COMPARE_PARTIAL_FLAG = 1;
2366
-
2367
- /** `Object#toString` result references. */
2368
- var argsTag = '[object Arguments]',
2369
- arrayTag = '[object Array]',
2370
- objectTag = '[object Object]';
2371
-
2372
- /** Used for built-in method references. */
2373
- var objectProto = Object.prototype;
2374
-
2375
- /** Used to check objects for own properties. */
2376
- var hasOwnProperty = objectProto.hasOwnProperty;
2377
-
2378
- /**
2379
- * A specialized version of `baseIsEqual` for arrays and objects which performs
2380
- * deep comparisons and tracks traversed objects enabling objects with circular
2381
- * references to be compared.
2382
- *
2383
- * @private
2384
- * @param {Object} object The object to compare.
2385
- * @param {Object} other The other object to compare.
2386
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2387
- * @param {Function} customizer The function to customize comparisons.
2388
- * @param {Function} equalFunc The function to determine equivalents of values.
2389
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
2390
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2391
- */
2392
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2393
- var objIsArr = isArray_1(object),
2394
- othIsArr = isArray_1(other),
2395
- objTag = objIsArr ? arrayTag : _getTag(object),
2396
- othTag = othIsArr ? arrayTag : _getTag(other);
2397
-
2398
- objTag = objTag == argsTag ? objectTag : objTag;
2399
- othTag = othTag == argsTag ? objectTag : othTag;
2400
-
2401
- var objIsObj = objTag == objectTag,
2402
- othIsObj = othTag == objectTag,
2403
- isSameTag = objTag == othTag;
2404
-
2405
- if (isSameTag && isBuffer_1(object)) {
2406
- if (!isBuffer_1(other)) {
2407
- return false;
2408
- }
2409
- objIsArr = true;
2410
- objIsObj = false;
2411
- }
2412
- if (isSameTag && !objIsObj) {
2413
- stack || (stack = new _Stack);
2414
- return (objIsArr || isTypedArray_1(object))
2415
- ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
2416
- : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2417
- }
2418
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2419
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2420
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2421
-
2422
- if (objIsWrapped || othIsWrapped) {
2423
- var objUnwrapped = objIsWrapped ? object.value() : object,
2424
- othUnwrapped = othIsWrapped ? other.value() : other;
2425
-
2426
- stack || (stack = new _Stack);
2427
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2428
- }
2429
- }
2430
- if (!isSameTag) {
2431
- return false;
2432
- }
2433
- stack || (stack = new _Stack);
2434
- return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2435
- }
2436
-
2437
- var _baseIsEqualDeep = baseIsEqualDeep;
2438
-
2439
- /**
2440
- * The base implementation of `_.isEqual` which supports partial comparisons
2441
- * and tracks traversed objects.
2442
- *
2443
- * @private
2444
- * @param {*} value The value to compare.
2445
- * @param {*} other The other value to compare.
2446
- * @param {boolean} bitmask The bitmask flags.
2447
- * 1 - Unordered comparison
2448
- * 2 - Partial comparison
2449
- * @param {Function} [customizer] The function to customize comparisons.
2450
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
2451
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2452
- */
2453
- function baseIsEqual(value, other, bitmask, customizer, stack) {
2454
- if (value === other) {
2455
- return true;
2456
- }
2457
- if (value == null || other == null || (!isObjectLike_1(value) && !isObjectLike_1(other))) {
2458
- return value !== value && other !== other;
2459
- }
2460
- return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2461
- }
2462
-
2463
- var _baseIsEqual = baseIsEqual;
2464
-
2465
- /**
2466
- * Performs a deep comparison between two values to determine if they are
2467
- * equivalent.
2468
- *
2469
- * **Note:** This method supports comparing arrays, array buffers, booleans,
2470
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
2471
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
2472
- * by their own, not inherited, enumerable properties. Functions and DOM
2473
- * nodes are compared by strict equality, i.e. `===`.
2474
- *
2475
- * @static
2476
- * @memberOf _
2477
- * @since 0.1.0
2478
- * @category Lang
2479
- * @param {*} value The value to compare.
2480
- * @param {*} other The other value to compare.
2481
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2482
- * @example
2483
- *
2484
- * var object = { 'a': 1 };
2485
- * var other = { 'a': 1 };
2486
- *
2487
- * _.isEqual(object, other);
2488
- * // => true
2489
- *
2490
- * object === other;
2491
- * // => false
2492
- */
2493
- function isEqual(value, other) {
2494
- return _baseIsEqual(value, other);
2495
- }
2496
-
2497
- var isEqual_1 = isEqual;
2498
-
2499
846
  const signPdfFile = async pdfSignature => {
2500
847
  const {
2501
848
  x,
@@ -2526,32 +873,38 @@ const signPdfFile = async pdfSignature => {
2526
873
  };
2527
874
 
2528
875
  const _excluded$1 = ["placeholder", "signature", "url", "width", "height", "padding", "filename", "defaultLocation", "onChange"];
2529
- const PDFSign = withLocale(/*#__PURE__*/forwardRef((_ref, ref) => {
2530
- let {
2531
- placeholder,
2532
- signature,
2533
- url,
2534
- width,
2535
- height,
2536
- padding,
2537
- filename = 'signed-document.pdf',
2538
- defaultLocation,
2539
- onChange
2540
- } = _ref,
2541
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
2542
- const [location, setLocation] = useState(Object.assign({}, defaultLocation));
2543
- const [pdfProps, setPdfProps] = useState(null);
2544
- const {
2545
- formatMessage
2546
- } = useIntl();
876
+ const PDFSignInner = /*#__PURE__*/forwardRef(({
877
+ size,
878
+ currentPage,
879
+ placeholder,
880
+ signature,
881
+ url,
882
+ width: _width = 200,
883
+ height: _height = 80,
884
+ padding,
885
+ filename: _filename = 'signed-document.pdf',
886
+ defaultLocation,
887
+ onChange
888
+ }, ref) => {
889
+ const initLocation = useMemo(() => {
890
+ return {
891
+ scaleX: 1,
892
+ scaleY: 1,
893
+ x: Math.round((size.width - _width) / 2),
894
+ y: Math.round((size.height - _height) / 2),
895
+ size: {
896
+ width: _width,
897
+ height: _height,
898
+ x: Math.round((size.width - _width) / 2),
899
+ y: Math.round((size.height - _height) / 2)
900
+ }
901
+ };
902
+ }, [size, _width, _height]);
903
+ const [location, setLocationOrigin] = useState(Object.assign({}, initLocation, defaultLocation));
904
+ const setLocation = useRefCallback(value => {
905
+ setLocationOrigin(Object.assign({}, initLocation, value));
906
+ });
2547
907
  const pdfSignature = useMemo(() => {
2548
- if (!pdfProps) {
2549
- return null;
2550
- }
2551
- const {
2552
- size,
2553
- currentPage
2554
- } = pdfProps;
2555
908
  const scaleX = size.width / size.originalWidth;
2556
909
  const scaleY = size.height / size.originalHeight;
2557
910
  const pdfX = Math.round(location.size.x / scaleX);
@@ -2568,15 +921,10 @@ const PDFSign = withLocale(/*#__PURE__*/forwardRef((_ref, ref) => {
2568
921
  height: signHeight,
2569
922
  signature,
2570
923
  url,
2571
- filename
924
+ filename: _filename
2572
925
  };
2573
- }, [pdfProps, location, signature, url, filename]);
926
+ }, [location, signature, url, _filename, size, currentPage]);
2574
927
  const signPdf = useCallback(async () => {
2575
- if (!pdfProps) {
2576
- throw new Error(formatMessage({
2577
- id: 'loadingError'
2578
- }));
2579
- }
2580
928
  return await signPdfFile(pdfSignature);
2581
929
  }, [pdfSignature]);
2582
930
  useImperativeHandle(ref, () => ({
@@ -2592,33 +940,48 @@ const PDFSign = withLocale(/*#__PURE__*/forwardRef((_ref, ref) => {
2592
940
  location
2593
941
  });
2594
942
  }, [pdfSignature, location, handlerChange]);
943
+ return /*#__PURE__*/jsx(LocationLayer, {
944
+ stageWidth: size.width,
945
+ stageHeight: size.height,
946
+ width: _width,
947
+ height: _height,
948
+ padding: padding,
949
+ placeholder: placeholder,
950
+ signature: signature,
951
+ value: location,
952
+ onChange: setLocation
953
+ });
954
+ });
955
+ const PDFSign = withLocale(/*#__PURE__*/forwardRef((_ref, ref) => {
956
+ let {
957
+ placeholder,
958
+ signature,
959
+ url,
960
+ width,
961
+ height,
962
+ padding,
963
+ filename = 'signed-document.pdf',
964
+ onChange
965
+ } = _ref,
966
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
2595
967
  return /*#__PURE__*/jsx(PDFViewer, _extends({}, props, {
2596
968
  url: url,
2597
969
  children: ({
2598
970
  size,
2599
971
  currentPage
2600
972
  }) => {
2601
- setTimeout(() => {
2602
- if (!isEqual_1({
2603
- size,
2604
- currentPage
2605
- }, pdfProps)) {
2606
- setPdfProps({
2607
- size,
2608
- currentPage
2609
- });
2610
- }
2611
- }, 0);
2612
- return /*#__PURE__*/jsx(LocationLayer, {
2613
- stageWidth: size.width,
2614
- stageHeight: size.height,
973
+ return /*#__PURE__*/jsx(PDFSignInner, {
974
+ ref: ref,
975
+ size: size,
976
+ currentPage: currentPage,
977
+ url: url,
978
+ filename: filename,
2615
979
  width: width,
2616
980
  height: height,
2617
981
  padding: padding,
2618
982
  placeholder: placeholder,
2619
983
  signature: signature,
2620
- value: location,
2621
- onChange: setLocation
984
+ onChange: onChange
2622
985
  });
2623
986
  }
2624
987
  }));