@kne/react-pdf-sign 1.1.0 → 1.1.2

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.
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ const PDFViewer = _ref => {
57
57
  pdfjsUrl: pdfjsUrlProps,
58
58
  url,
59
59
  maxWidth = 1200,
60
+ isFlat,
60
61
  children
61
62
  } = _ref;
62
63
  const {
@@ -84,29 +85,14 @@ const PDFViewer = _ref => {
84
85
  setWidth(Math.min(ref.current.clientWidth, maxWidth));
85
86
  }
86
87
  });
87
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
88
- ref: ref,
89
- className: classnames__default["default"](className, style['pdf-view-container'], 'pdf-view-container'),
90
- style: {
91
- maxWidth: maxWidth
92
- },
93
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
94
- className: classnames__default["default"](style['pdf-view'], 'pdf-view'),
95
- children: /*#__PURE__*/jsxRuntime.jsx(reactPdf.Document, _extends({}, Object.assign({}, documentProps), {
96
- loading: /*#__PURE__*/jsxRuntime.jsx(antd.Flex, {
97
- justify: "center",
98
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Spin, {})
99
- }),
100
- onLoadSuccess: _ref2 => {
101
- let {
102
- numPages
103
- } = _ref2;
104
- _objectWithoutPropertiesLoose(_ref2, _excluded$4);
105
- setPageSize(numPages);
106
- if (!Number.isInteger(defaultPage)) {
107
- setCurrentPage(numPages);
108
- }
109
- },
88
+ const renderPage = _ref2 => {
89
+ let {
90
+ currentPage
91
+ } = _ref2;
92
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
93
+ className: classnames__default["default"](style['pdf-view-container'], 'pdf-view-container'),
94
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
95
+ className: classnames__default["default"](style['pdf-view'], 'pdf-view'),
110
96
  children: /*#__PURE__*/jsxRuntime.jsx(reactPdf.Page, {
111
97
  width: width,
112
98
  pageNumber: currentPage,
@@ -120,31 +106,69 @@ const PDFViewer = _ref => {
120
106
  });
121
107
  }
122
108
  })
123
- }))
124
- }), size && children && /*#__PURE__*/jsxRuntime.jsx("div", {
125
- className: classnames__default["default"](style['pdf-view-children'], 'pdf-view-children'),
126
- children: typeof children === 'function' ? children({
127
- size,
128
- currentPage,
129
- pageSize
130
- }) : children
131
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
132
- className: classnames__default["default"](style['pdf-view-page-control'], 'pdf-view-page-control'),
133
- children: [currentPage > 1 && /*#__PURE__*/jsxRuntime.jsx(icons.LeftOutlined, {
134
- className: classnames__default["default"](style['pdf-view-page-control-left'], 'pdf-view-page-control-left'),
135
- onClick: () => {
136
- setCurrentPage(currentPage - 1);
137
- }
138
- }), currentPage < pageSize && /*#__PURE__*/jsxRuntime.jsx(icons.RightOutlined, {
139
- className: classnames__default["default"](style['pdf-view-page-control-right'], 'pdf-view-page-control-right'),
140
- onClick: () => {
141
- setCurrentPage(currentPage + 1);
109
+ }), size && children && /*#__PURE__*/jsxRuntime.jsx("div", {
110
+ className: classnames__default["default"](style['pdf-view-children'], 'pdf-view-children'),
111
+ children: typeof children === 'function' ? children({
112
+ size,
113
+ currentPage,
114
+ pageSize
115
+ }) : children
116
+ })]
117
+ });
118
+ };
119
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
120
+ ref: ref,
121
+ className: classnames__default["default"](className, style['pdf-view-container'], 'pdf-view-container'),
122
+ style: {
123
+ maxWidth: maxWidth
124
+ },
125
+ children: /*#__PURE__*/jsxRuntime.jsxs(reactPdf.Document, _extends({}, Object.assign({}, documentProps), {
126
+ loading: /*#__PURE__*/jsxRuntime.jsx(antd.Flex, {
127
+ justify: "center",
128
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Spin, {})
129
+ }),
130
+ onLoadSuccess: _ref3 => {
131
+ let {
132
+ numPages
133
+ } = _ref3;
134
+ _objectWithoutPropertiesLoose(_ref3, _excluded$4);
135
+ setPageSize(numPages);
136
+ if (!Number.isInteger(defaultPage)) {
137
+ setCurrentPage(numPages);
142
138
  }
143
- }), pageSize ? /*#__PURE__*/jsxRuntime.jsxs("div", {
144
- className: classnames__default["default"](style['pdf-view-page-control-current'], 'pdf-view-page-control-current'),
145
- children: [currentPage, "/", pageSize]
146
- }) : null]
147
- })]
139
+ },
140
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Flex, {
141
+ vertical: true,
142
+ gap: 8,
143
+ children: isFlat ? Array.from({
144
+ length: pageSize
145
+ }).map((item, index) => {
146
+ return /*#__PURE__*/jsxRuntime.jsx(react.Fragment, {
147
+ children: renderPage({
148
+ currentPage: index + 1
149
+ })
150
+ }, index);
151
+ }) : renderPage({
152
+ currentPage
153
+ })
154
+ }), isFlat ? null : /*#__PURE__*/jsxRuntime.jsxs("div", {
155
+ className: classnames__default["default"](style['pdf-view-page-control'], 'pdf-view-page-control'),
156
+ children: [currentPage > 1 && /*#__PURE__*/jsxRuntime.jsx(icons.LeftOutlined, {
157
+ className: classnames__default["default"](style['pdf-view-page-control-left'], 'pdf-view-page-control-left'),
158
+ onClick: () => {
159
+ setCurrentPage(currentPage - 1);
160
+ }
161
+ }), currentPage < pageSize && /*#__PURE__*/jsxRuntime.jsx(icons.RightOutlined, {
162
+ className: classnames__default["default"](style['pdf-view-page-control-right'], 'pdf-view-page-control-right'),
163
+ onClick: () => {
164
+ setCurrentPage(currentPage + 1);
165
+ }
166
+ }), pageSize ? /*#__PURE__*/jsxRuntime.jsxs("div", {
167
+ className: classnames__default["default"](style['pdf-view-page-control-current'], 'pdf-view-page-control-current'),
168
+ children: [currentPage, "/", pageSize]
169
+ }) : null]
170
+ })]
171
+ }))
148
172
  });
149
173
  };
150
174
 
@@ -686,24 +710,25 @@ const PDFSignInner = /*#__PURE__*/react.forwardRef((_ref, ref) => {
686
710
  height = 80,
687
711
  padding,
688
712
  filename = 'signed-document.pdf',
689
- defaultLocation,
713
+ location,
714
+ setLocation,
690
715
  onChange
691
716
  } = _ref;
692
717
  const initLocation = react.useMemo(() => {
693
718
  return getInitLocation({
694
- stageWidth: size.width,
695
- stageHeight: size.height,
719
+ stageWidth: size.originalWidth,
720
+ stageHeight: size.originalHeight,
696
721
  width,
697
722
  height
698
723
  });
699
724
  }, [size, width, height]);
700
- const [location, setLocationOrigin] = react.useState(Object.assign({}, initLocation, defaultLocation));
701
- const setLocation = useRefCallback__default["default"](value => {
702
- setLocationOrigin(Object.assign({}, initLocation, value));
703
- });
725
+ const targetLocation = react.useMemo(() => {
726
+ return Object.assign({}, initLocation, location);
727
+ }, [initLocation, location]);
728
+ const setTargetLocation = value => setLocation(Object.assign({}, initLocation, value));
704
729
  const pdfSignature = react.useMemo(() => {
705
730
  return Object.assign({}, computedPDFSignLocation({
706
- location,
731
+ location: targetLocation,
707
732
  size
708
733
  }), {
709
734
  signature,
@@ -713,7 +738,7 @@ const PDFSignInner = /*#__PURE__*/react.forwardRef((_ref, ref) => {
713
738
  pageWidth: Math.round(size.originalWidth),
714
739
  pageHeight: Math.round(size.originalHeight)
715
740
  });
716
- }, [location, signature, url, filename, size, currentPage]);
741
+ }, [targetLocation, signature, url, filename, size, currentPage]);
717
742
  const signPdf = react.useCallback(function () {
718
743
  try {
719
744
  return Promise.resolve(signPdfFile(pdfSignature));
@@ -723,7 +748,7 @@ const PDFSignInner = /*#__PURE__*/react.forwardRef((_ref, ref) => {
723
748
  }, [pdfSignature]);
724
749
  react.useImperativeHandle(ref, () => ({
725
750
  getLocation: () => location,
726
- setLocation: value => setLocation(value),
751
+ setLocation: value => setTargetLocation(value),
727
752
  getPdfSignature: () => pdfSignature,
728
753
  sign: () => signPdf()
729
754
  }));
@@ -734,16 +759,22 @@ const PDFSignInner = /*#__PURE__*/react.forwardRef((_ref, ref) => {
734
759
  location
735
760
  });
736
761
  }, [pdfSignature, location, handlerChange]);
737
- return /*#__PURE__*/jsxRuntime.jsx(LocationLayer, {
738
- stageWidth: size.width,
739
- stageHeight: size.height,
740
- width: width,
741
- height: height,
742
- padding: padding,
743
- placeholder: placeholder,
744
- signature: signature,
745
- value: location,
746
- onChange: setLocation
762
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
763
+ style: {
764
+ transform: "scale(" + size.width / size.originalWidth + ")",
765
+ transformOrigin: '0 0'
766
+ },
767
+ children: /*#__PURE__*/jsxRuntime.jsx(LocationLayer, {
768
+ stageWidth: size.originalWidth,
769
+ stageHeight: size.originalHeight,
770
+ width: width,
771
+ height: height,
772
+ padding: padding,
773
+ placeholder: placeholder,
774
+ signature: signature,
775
+ value: targetLocation,
776
+ onChange: setTargetLocation
777
+ })
747
778
  });
748
779
  });
749
780
  const PDFSign = withLocale(/*#__PURE__*/react.forwardRef((_ref2, ref) => {
@@ -759,6 +790,7 @@ const PDFSign = withLocale(/*#__PURE__*/react.forwardRef((_ref2, ref) => {
759
790
  onChange
760
791
  } = _ref2,
761
792
  props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
793
+ const [location, setLocation] = react.useState(Object.assign({}, defaultLocation));
762
794
  return /*#__PURE__*/jsxRuntime.jsx(PDFViewer, _extends({}, props, {
763
795
  url: url,
764
796
  children: _ref3 => {
@@ -772,7 +804,8 @@ const PDFSign = withLocale(/*#__PURE__*/react.forwardRef((_ref2, ref) => {
772
804
  currentPage: currentPage,
773
805
  url: url,
774
806
  filename: filename,
775
- defaultLocation: defaultLocation,
807
+ location: location,
808
+ setLocation: setLocation,
776
809
  width: width,
777
810
  height: height,
778
811
  padding: padding,
@@ -784,108 +817,3375 @@ const PDFSign = withLocale(/*#__PURE__*/react.forwardRef((_ref2, ref) => {
784
817
  }));
785
818
  }));
786
819
 
787
- const _excluded$1 = ["placeholder", "url", "width", "height", "padding", "filename", "defaultSignatureList", "onSign", "onChange", "isEdit"];
788
- const PDFSignMultiInner = /*#__PURE__*/react.forwardRef((_ref, ref) => {
789
- let {
790
- size,
791
- currentPage,
792
- placeholder,
793
- url,
794
- width = 200,
795
- height = 80,
796
- padding,
797
- filename = 'signed-document.pdf',
798
- defaultSignatureList,
799
- isEdit,
800
- onSign,
801
- onChange
802
- } = _ref;
803
- const [signatureList, setSignatureList] = react.useState(defaultSignatureList || []);
804
- const {
805
- formatMessage
806
- } = reactIntl.useIntl();
807
- const pdfSignatureList = react.useMemo(() => {
808
- return signatureList.filter(location => location.signature).map(location => {
809
- return Object.assign({}, computedPDFSignLocation({
810
- location,
811
- size
812
- }), {
813
- page: location.page,
814
- signature: location.signature
815
- });
816
- });
817
- }, [signatureList, size]);
818
- react.useImperativeHandle(ref, () => ({
819
- getSignatureList: () => signatureList,
820
- setSignatureList: value => setSignatureList(value),
821
- getPdfSignatureList: () => {
822
- return pdfSignatureList;
823
- },
824
- sign: () => {
825
- if (!pdfSignatureList.length) {
826
- return Promise.reject(new Error(formatMessage({
827
- id: 'signatureAdd'
828
- })));
829
- }
830
- return signMultiPdfFile({
831
- url,
832
- filename,
833
- signatureList: pdfSignatureList
834
- });
835
- },
836
- addSignLocation: () => {
837
- setSignatureList(signatureList => {
838
- return [...signatureList, {
839
- page: currentPage
840
- }];
841
- });
820
+ /**
821
+ * A specialized version of `_.map` for arrays without support for iteratee
822
+ * shorthands.
823
+ *
824
+ * @private
825
+ * @param {Array} [array] The array to iterate over.
826
+ * @param {Function} iteratee The function invoked per iteration.
827
+ * @returns {Array} Returns the new mapped array.
828
+ */
829
+ function arrayMap(array, iteratee) {
830
+ var index = -1,
831
+ length = array == null ? 0 : array.length,
832
+ result = Array(length);
833
+
834
+ while (++index < length) {
835
+ result[index] = iteratee(array[index], index, array);
836
+ }
837
+ return result;
838
+ }
839
+
840
+ var _arrayMap = arrayMap;
841
+
842
+ /**
843
+ * Removes all key-value entries from the list cache.
844
+ *
845
+ * @private
846
+ * @name clear
847
+ * @memberOf ListCache
848
+ */
849
+ function listCacheClear() {
850
+ this.__data__ = [];
851
+ this.size = 0;
852
+ }
853
+
854
+ var _listCacheClear = listCacheClear;
855
+
856
+ /**
857
+ * Performs a
858
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
859
+ * comparison between two values to determine if they are equivalent.
860
+ *
861
+ * @static
862
+ * @memberOf _
863
+ * @since 4.0.0
864
+ * @category Lang
865
+ * @param {*} value The value to compare.
866
+ * @param {*} other The other value to compare.
867
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
868
+ * @example
869
+ *
870
+ * var object = { 'a': 1 };
871
+ * var other = { 'a': 1 };
872
+ *
873
+ * _.eq(object, object);
874
+ * // => true
875
+ *
876
+ * _.eq(object, other);
877
+ * // => false
878
+ *
879
+ * _.eq('a', 'a');
880
+ * // => true
881
+ *
882
+ * _.eq('a', Object('a'));
883
+ * // => false
884
+ *
885
+ * _.eq(NaN, NaN);
886
+ * // => true
887
+ */
888
+ function eq(value, other) {
889
+ return value === other || (value !== value && other !== other);
890
+ }
891
+
892
+ var eq_1 = eq;
893
+
894
+ /**
895
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
896
+ *
897
+ * @private
898
+ * @param {Array} array The array to inspect.
899
+ * @param {*} key The key to search for.
900
+ * @returns {number} Returns the index of the matched value, else `-1`.
901
+ */
902
+ function assocIndexOf(array, key) {
903
+ var length = array.length;
904
+ while (length--) {
905
+ if (eq_1(array[length][0], key)) {
906
+ return length;
842
907
  }
843
- }));
844
- return /*#__PURE__*/jsxRuntime.jsx(LocationGroup, {
845
- isEdit: isEdit,
846
- currentPage: currentPage,
847
- stageWidth: size.width,
848
- stageHeight: size.height,
849
- width: width,
850
- height: height,
851
- padding: padding,
852
- placeholder: placeholder,
853
- value: signatureList,
854
- onChange: setSignatureList,
855
- onClick: _ref2 => {
856
- let {
857
- index,
858
- value
859
- } = _ref2;
860
- onSign && onSign({
861
- size: value.size,
862
- callback: signature => {
863
- setSignatureList(value => {
864
- const newValue = value.slice(0);
865
- newValue[index] = Object.assign({}, newValue[index], {
866
- signature
867
- });
868
- return newValue;
869
- });
870
- }
871
- });
908
+ }
909
+ return -1;
910
+ }
911
+
912
+ var _assocIndexOf = assocIndexOf;
913
+
914
+ /** Used for built-in method references. */
915
+ var arrayProto = Array.prototype;
916
+
917
+ /** Built-in value references. */
918
+ var splice = arrayProto.splice;
919
+
920
+ /**
921
+ * Removes `key` and its value from the list cache.
922
+ *
923
+ * @private
924
+ * @name delete
925
+ * @memberOf ListCache
926
+ * @param {string} key The key of the value to remove.
927
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
928
+ */
929
+ function listCacheDelete(key) {
930
+ var data = this.__data__,
931
+ index = _assocIndexOf(data, key);
932
+
933
+ if (index < 0) {
934
+ return false;
935
+ }
936
+ var lastIndex = data.length - 1;
937
+ if (index == lastIndex) {
938
+ data.pop();
939
+ } else {
940
+ splice.call(data, index, 1);
941
+ }
942
+ --this.size;
943
+ return true;
944
+ }
945
+
946
+ var _listCacheDelete = listCacheDelete;
947
+
948
+ /**
949
+ * Gets the list cache value for `key`.
950
+ *
951
+ * @private
952
+ * @name get
953
+ * @memberOf ListCache
954
+ * @param {string} key The key of the value to get.
955
+ * @returns {*} Returns the entry value.
956
+ */
957
+ function listCacheGet(key) {
958
+ var data = this.__data__,
959
+ index = _assocIndexOf(data, key);
960
+
961
+ return index < 0 ? undefined : data[index][1];
962
+ }
963
+
964
+ var _listCacheGet = listCacheGet;
965
+
966
+ /**
967
+ * Checks if a list cache value for `key` exists.
968
+ *
969
+ * @private
970
+ * @name has
971
+ * @memberOf ListCache
972
+ * @param {string} key The key of the entry to check.
973
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
974
+ */
975
+ function listCacheHas(key) {
976
+ return _assocIndexOf(this.__data__, key) > -1;
977
+ }
978
+
979
+ var _listCacheHas = listCacheHas;
980
+
981
+ /**
982
+ * Sets the list cache `key` to `value`.
983
+ *
984
+ * @private
985
+ * @name set
986
+ * @memberOf ListCache
987
+ * @param {string} key The key of the value to set.
988
+ * @param {*} value The value to set.
989
+ * @returns {Object} Returns the list cache instance.
990
+ */
991
+ function listCacheSet(key, value) {
992
+ var data = this.__data__,
993
+ index = _assocIndexOf(data, key);
994
+
995
+ if (index < 0) {
996
+ ++this.size;
997
+ data.push([key, value]);
998
+ } else {
999
+ data[index][1] = value;
1000
+ }
1001
+ return this;
1002
+ }
1003
+
1004
+ var _listCacheSet = listCacheSet;
1005
+
1006
+ /**
1007
+ * Creates an list cache object.
1008
+ *
1009
+ * @private
1010
+ * @constructor
1011
+ * @param {Array} [entries] The key-value pairs to cache.
1012
+ */
1013
+ function ListCache(entries) {
1014
+ var index = -1,
1015
+ length = entries == null ? 0 : entries.length;
1016
+
1017
+ this.clear();
1018
+ while (++index < length) {
1019
+ var entry = entries[index];
1020
+ this.set(entry[0], entry[1]);
1021
+ }
1022
+ }
1023
+
1024
+ // Add methods to `ListCache`.
1025
+ ListCache.prototype.clear = _listCacheClear;
1026
+ ListCache.prototype['delete'] = _listCacheDelete;
1027
+ ListCache.prototype.get = _listCacheGet;
1028
+ ListCache.prototype.has = _listCacheHas;
1029
+ ListCache.prototype.set = _listCacheSet;
1030
+
1031
+ var _ListCache = ListCache;
1032
+
1033
+ /**
1034
+ * Removes all key-value entries from the stack.
1035
+ *
1036
+ * @private
1037
+ * @name clear
1038
+ * @memberOf Stack
1039
+ */
1040
+ function stackClear() {
1041
+ this.__data__ = new _ListCache;
1042
+ this.size = 0;
1043
+ }
1044
+
1045
+ var _stackClear = stackClear;
1046
+
1047
+ /**
1048
+ * Removes `key` and its value from the stack.
1049
+ *
1050
+ * @private
1051
+ * @name delete
1052
+ * @memberOf Stack
1053
+ * @param {string} key The key of the value to remove.
1054
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1055
+ */
1056
+ function stackDelete(key) {
1057
+ var data = this.__data__,
1058
+ result = data['delete'](key);
1059
+
1060
+ this.size = data.size;
1061
+ return result;
1062
+ }
1063
+
1064
+ var _stackDelete = stackDelete;
1065
+
1066
+ /**
1067
+ * Gets the stack value for `key`.
1068
+ *
1069
+ * @private
1070
+ * @name get
1071
+ * @memberOf Stack
1072
+ * @param {string} key The key of the value to get.
1073
+ * @returns {*} Returns the entry value.
1074
+ */
1075
+ function stackGet(key) {
1076
+ return this.__data__.get(key);
1077
+ }
1078
+
1079
+ var _stackGet = stackGet;
1080
+
1081
+ /**
1082
+ * Checks if a stack value for `key` exists.
1083
+ *
1084
+ * @private
1085
+ * @name has
1086
+ * @memberOf Stack
1087
+ * @param {string} key The key of the entry to check.
1088
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1089
+ */
1090
+ function stackHas(key) {
1091
+ return this.__data__.has(key);
1092
+ }
1093
+
1094
+ var _stackHas = stackHas;
1095
+
1096
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1097
+
1098
+ function createCommonjsModule(fn) {
1099
+ var module = { exports: {} };
1100
+ return fn(module, module.exports), module.exports;
1101
+ }
1102
+
1103
+ /** Detect free variable `global` from Node.js. */
1104
+
1105
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1106
+
1107
+ var _freeGlobal = freeGlobal;
1108
+
1109
+ /** Detect free variable `self`. */
1110
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
1111
+
1112
+ /** Used as a reference to the global object. */
1113
+ var root = _freeGlobal || freeSelf || Function('return this')();
1114
+
1115
+ var _root = root;
1116
+
1117
+ /** Built-in value references. */
1118
+ var Symbol$1 = _root.Symbol;
1119
+
1120
+ var _Symbol = Symbol$1;
1121
+
1122
+ /** Used for built-in method references. */
1123
+ var objectProto$d = Object.prototype;
1124
+
1125
+ /** Used to check objects for own properties. */
1126
+ var hasOwnProperty$a = objectProto$d.hasOwnProperty;
1127
+
1128
+ /**
1129
+ * Used to resolve the
1130
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1131
+ * of values.
1132
+ */
1133
+ var nativeObjectToString$1 = objectProto$d.toString;
1134
+
1135
+ /** Built-in value references. */
1136
+ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
1137
+
1138
+ /**
1139
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1140
+ *
1141
+ * @private
1142
+ * @param {*} value The value to query.
1143
+ * @returns {string} Returns the raw `toStringTag`.
1144
+ */
1145
+ function getRawTag(value) {
1146
+ var isOwn = hasOwnProperty$a.call(value, symToStringTag$1),
1147
+ tag = value[symToStringTag$1];
1148
+
1149
+ try {
1150
+ value[symToStringTag$1] = undefined;
1151
+ var unmasked = true;
1152
+ } catch (e) {}
1153
+
1154
+ var result = nativeObjectToString$1.call(value);
1155
+ if (unmasked) {
1156
+ if (isOwn) {
1157
+ value[symToStringTag$1] = tag;
1158
+ } else {
1159
+ delete value[symToStringTag$1];
872
1160
  }
873
- });
874
- });
875
- const PDFSignMulti = withLocale(/*#__PURE__*/react.forwardRef((_ref3, ref) => {
876
- let {
877
- placeholder,
878
- url,
879
- width,
880
- height,
881
- padding,
882
- filename = 'signed-document.pdf',
883
- defaultSignatureList,
884
- onSign,
885
- onChange,
886
- isEdit
887
- } = _ref3,
888
- props = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
1161
+ }
1162
+ return result;
1163
+ }
1164
+
1165
+ var _getRawTag = getRawTag;
1166
+
1167
+ /** Used for built-in method references. */
1168
+ var objectProto$c = Object.prototype;
1169
+
1170
+ /**
1171
+ * Used to resolve the
1172
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1173
+ * of values.
1174
+ */
1175
+ var nativeObjectToString = objectProto$c.toString;
1176
+
1177
+ /**
1178
+ * Converts `value` to a string using `Object.prototype.toString`.
1179
+ *
1180
+ * @private
1181
+ * @param {*} value The value to convert.
1182
+ * @returns {string} Returns the converted string.
1183
+ */
1184
+ function objectToString(value) {
1185
+ return nativeObjectToString.call(value);
1186
+ }
1187
+
1188
+ var _objectToString = objectToString;
1189
+
1190
+ /** `Object#toString` result references. */
1191
+ var nullTag = '[object Null]',
1192
+ undefinedTag = '[object Undefined]';
1193
+
1194
+ /** Built-in value references. */
1195
+ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
1196
+
1197
+ /**
1198
+ * The base implementation of `getTag` without fallbacks for buggy environments.
1199
+ *
1200
+ * @private
1201
+ * @param {*} value The value to query.
1202
+ * @returns {string} Returns the `toStringTag`.
1203
+ */
1204
+ function baseGetTag(value) {
1205
+ if (value == null) {
1206
+ return value === undefined ? undefinedTag : nullTag;
1207
+ }
1208
+ return (symToStringTag && symToStringTag in Object(value))
1209
+ ? _getRawTag(value)
1210
+ : _objectToString(value);
1211
+ }
1212
+
1213
+ var _baseGetTag = baseGetTag;
1214
+
1215
+ /**
1216
+ * Checks if `value` is the
1217
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1218
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1219
+ *
1220
+ * @static
1221
+ * @memberOf _
1222
+ * @since 0.1.0
1223
+ * @category Lang
1224
+ * @param {*} value The value to check.
1225
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1226
+ * @example
1227
+ *
1228
+ * _.isObject({});
1229
+ * // => true
1230
+ *
1231
+ * _.isObject([1, 2, 3]);
1232
+ * // => true
1233
+ *
1234
+ * _.isObject(_.noop);
1235
+ * // => true
1236
+ *
1237
+ * _.isObject(null);
1238
+ * // => false
1239
+ */
1240
+ function isObject(value) {
1241
+ var type = typeof value;
1242
+ return value != null && (type == 'object' || type == 'function');
1243
+ }
1244
+
1245
+ var isObject_1 = isObject;
1246
+
1247
+ /** `Object#toString` result references. */
1248
+ var asyncTag = '[object AsyncFunction]',
1249
+ funcTag$2 = '[object Function]',
1250
+ genTag$1 = '[object GeneratorFunction]',
1251
+ proxyTag = '[object Proxy]';
1252
+
1253
+ /**
1254
+ * Checks if `value` is classified as a `Function` object.
1255
+ *
1256
+ * @static
1257
+ * @memberOf _
1258
+ * @since 0.1.0
1259
+ * @category Lang
1260
+ * @param {*} value The value to check.
1261
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1262
+ * @example
1263
+ *
1264
+ * _.isFunction(_);
1265
+ * // => true
1266
+ *
1267
+ * _.isFunction(/abc/);
1268
+ * // => false
1269
+ */
1270
+ function isFunction(value) {
1271
+ if (!isObject_1(value)) {
1272
+ return false;
1273
+ }
1274
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1275
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
1276
+ var tag = _baseGetTag(value);
1277
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
1278
+ }
1279
+
1280
+ var isFunction_1 = isFunction;
1281
+
1282
+ /** Used to detect overreaching core-js shims. */
1283
+ var coreJsData = _root['__core-js_shared__'];
1284
+
1285
+ var _coreJsData = coreJsData;
1286
+
1287
+ /** Used to detect methods masquerading as native. */
1288
+ var maskSrcKey = (function() {
1289
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
1290
+ return uid ? ('Symbol(src)_1.' + uid) : '';
1291
+ }());
1292
+
1293
+ /**
1294
+ * Checks if `func` has its source masked.
1295
+ *
1296
+ * @private
1297
+ * @param {Function} func The function to check.
1298
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1299
+ */
1300
+ function isMasked(func) {
1301
+ return !!maskSrcKey && (maskSrcKey in func);
1302
+ }
1303
+
1304
+ var _isMasked = isMasked;
1305
+
1306
+ /** Used for built-in method references. */
1307
+ var funcProto$2 = Function.prototype;
1308
+
1309
+ /** Used to resolve the decompiled source of functions. */
1310
+ var funcToString$2 = funcProto$2.toString;
1311
+
1312
+ /**
1313
+ * Converts `func` to its source code.
1314
+ *
1315
+ * @private
1316
+ * @param {Function} func The function to convert.
1317
+ * @returns {string} Returns the source code.
1318
+ */
1319
+ function toSource(func) {
1320
+ if (func != null) {
1321
+ try {
1322
+ return funcToString$2.call(func);
1323
+ } catch (e) {}
1324
+ try {
1325
+ return (func + '');
1326
+ } catch (e) {}
1327
+ }
1328
+ return '';
1329
+ }
1330
+
1331
+ var _toSource = toSource;
1332
+
1333
+ /**
1334
+ * Used to match `RegExp`
1335
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1336
+ */
1337
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1338
+
1339
+ /** Used to detect host constructors (Safari). */
1340
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1341
+
1342
+ /** Used for built-in method references. */
1343
+ var funcProto$1 = Function.prototype,
1344
+ objectProto$b = Object.prototype;
1345
+
1346
+ /** Used to resolve the decompiled source of functions. */
1347
+ var funcToString$1 = funcProto$1.toString;
1348
+
1349
+ /** Used to check objects for own properties. */
1350
+ var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
1351
+
1352
+ /** Used to detect if a method is native. */
1353
+ var reIsNative = RegExp('^' +
1354
+ funcToString$1.call(hasOwnProperty$9).replace(reRegExpChar, '\\$&')
1355
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1356
+ );
1357
+
1358
+ /**
1359
+ * The base implementation of `_.isNative` without bad shim checks.
1360
+ *
1361
+ * @private
1362
+ * @param {*} value The value to check.
1363
+ * @returns {boolean} Returns `true` if `value` is a native function,
1364
+ * else `false`.
1365
+ */
1366
+ function baseIsNative(value) {
1367
+ if (!isObject_1(value) || _isMasked(value)) {
1368
+ return false;
1369
+ }
1370
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
1371
+ return pattern.test(_toSource(value));
1372
+ }
1373
+
1374
+ var _baseIsNative = baseIsNative;
1375
+
1376
+ /**
1377
+ * Gets the value at `key` of `object`.
1378
+ *
1379
+ * @private
1380
+ * @param {Object} [object] The object to query.
1381
+ * @param {string} key The key of the property to get.
1382
+ * @returns {*} Returns the property value.
1383
+ */
1384
+ function getValue(object, key) {
1385
+ return object == null ? undefined : object[key];
1386
+ }
1387
+
1388
+ var _getValue = getValue;
1389
+
1390
+ /**
1391
+ * Gets the native function at `key` of `object`.
1392
+ *
1393
+ * @private
1394
+ * @param {Object} object The object to query.
1395
+ * @param {string} key The key of the method to get.
1396
+ * @returns {*} Returns the function if it's native, else `undefined`.
1397
+ */
1398
+ function getNative(object, key) {
1399
+ var value = _getValue(object, key);
1400
+ return _baseIsNative(value) ? value : undefined;
1401
+ }
1402
+
1403
+ var _getNative = getNative;
1404
+
1405
+ /* Built-in method references that are verified to be native. */
1406
+ var Map = _getNative(_root, 'Map');
1407
+
1408
+ var _Map = Map;
1409
+
1410
+ /* Built-in method references that are verified to be native. */
1411
+ var nativeCreate = _getNative(Object, 'create');
1412
+
1413
+ var _nativeCreate = nativeCreate;
1414
+
1415
+ /**
1416
+ * Removes all key-value entries from the hash.
1417
+ *
1418
+ * @private
1419
+ * @name clear
1420
+ * @memberOf Hash
1421
+ */
1422
+ function hashClear() {
1423
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
1424
+ this.size = 0;
1425
+ }
1426
+
1427
+ var _hashClear = hashClear;
1428
+
1429
+ /**
1430
+ * Removes `key` and its value from the hash.
1431
+ *
1432
+ * @private
1433
+ * @name delete
1434
+ * @memberOf Hash
1435
+ * @param {Object} hash The hash to modify.
1436
+ * @param {string} key The key of the value to remove.
1437
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1438
+ */
1439
+ function hashDelete(key) {
1440
+ var result = this.has(key) && delete this.__data__[key];
1441
+ this.size -= result ? 1 : 0;
1442
+ return result;
1443
+ }
1444
+
1445
+ var _hashDelete = hashDelete;
1446
+
1447
+ /** Used to stand-in for `undefined` hash values. */
1448
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1449
+
1450
+ /** Used for built-in method references. */
1451
+ var objectProto$a = Object.prototype;
1452
+
1453
+ /** Used to check objects for own properties. */
1454
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
1455
+
1456
+ /**
1457
+ * Gets the hash value for `key`.
1458
+ *
1459
+ * @private
1460
+ * @name get
1461
+ * @memberOf Hash
1462
+ * @param {string} key The key of the value to get.
1463
+ * @returns {*} Returns the entry value.
1464
+ */
1465
+ function hashGet(key) {
1466
+ var data = this.__data__;
1467
+ if (_nativeCreate) {
1468
+ var result = data[key];
1469
+ return result === HASH_UNDEFINED$1 ? undefined : result;
1470
+ }
1471
+ return hasOwnProperty$8.call(data, key) ? data[key] : undefined;
1472
+ }
1473
+
1474
+ var _hashGet = hashGet;
1475
+
1476
+ /** Used for built-in method references. */
1477
+ var objectProto$9 = Object.prototype;
1478
+
1479
+ /** Used to check objects for own properties. */
1480
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
1481
+
1482
+ /**
1483
+ * Checks if a hash value for `key` exists.
1484
+ *
1485
+ * @private
1486
+ * @name has
1487
+ * @memberOf Hash
1488
+ * @param {string} key The key of the entry to check.
1489
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1490
+ */
1491
+ function hashHas(key) {
1492
+ var data = this.__data__;
1493
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$7.call(data, key);
1494
+ }
1495
+
1496
+ var _hashHas = hashHas;
1497
+
1498
+ /** Used to stand-in for `undefined` hash values. */
1499
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1500
+
1501
+ /**
1502
+ * Sets the hash `key` to `value`.
1503
+ *
1504
+ * @private
1505
+ * @name set
1506
+ * @memberOf Hash
1507
+ * @param {string} key The key of the value to set.
1508
+ * @param {*} value The value to set.
1509
+ * @returns {Object} Returns the hash instance.
1510
+ */
1511
+ function hashSet(key, value) {
1512
+ var data = this.__data__;
1513
+ this.size += this.has(key) ? 0 : 1;
1514
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1515
+ return this;
1516
+ }
1517
+
1518
+ var _hashSet = hashSet;
1519
+
1520
+ /**
1521
+ * Creates a hash object.
1522
+ *
1523
+ * @private
1524
+ * @constructor
1525
+ * @param {Array} [entries] The key-value pairs to cache.
1526
+ */
1527
+ function Hash(entries) {
1528
+ var index = -1,
1529
+ length = entries == null ? 0 : entries.length;
1530
+
1531
+ this.clear();
1532
+ while (++index < length) {
1533
+ var entry = entries[index];
1534
+ this.set(entry[0], entry[1]);
1535
+ }
1536
+ }
1537
+
1538
+ // Add methods to `Hash`.
1539
+ Hash.prototype.clear = _hashClear;
1540
+ Hash.prototype['delete'] = _hashDelete;
1541
+ Hash.prototype.get = _hashGet;
1542
+ Hash.prototype.has = _hashHas;
1543
+ Hash.prototype.set = _hashSet;
1544
+
1545
+ var _Hash = Hash;
1546
+
1547
+ /**
1548
+ * Removes all key-value entries from the map.
1549
+ *
1550
+ * @private
1551
+ * @name clear
1552
+ * @memberOf MapCache
1553
+ */
1554
+ function mapCacheClear() {
1555
+ this.size = 0;
1556
+ this.__data__ = {
1557
+ 'hash': new _Hash,
1558
+ 'map': new (_Map || _ListCache),
1559
+ 'string': new _Hash
1560
+ };
1561
+ }
1562
+
1563
+ var _mapCacheClear = mapCacheClear;
1564
+
1565
+ /**
1566
+ * Checks if `value` is suitable for use as unique object key.
1567
+ *
1568
+ * @private
1569
+ * @param {*} value The value to check.
1570
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1571
+ */
1572
+ function isKeyable(value) {
1573
+ var type = typeof value;
1574
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1575
+ ? (value !== '__proto__')
1576
+ : (value === null);
1577
+ }
1578
+
1579
+ var _isKeyable = isKeyable;
1580
+
1581
+ /**
1582
+ * Gets the data for `map`.
1583
+ *
1584
+ * @private
1585
+ * @param {Object} map The map to query.
1586
+ * @param {string} key The reference key.
1587
+ * @returns {*} Returns the map data.
1588
+ */
1589
+ function getMapData(map, key) {
1590
+ var data = map.__data__;
1591
+ return _isKeyable(key)
1592
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1593
+ : data.map;
1594
+ }
1595
+
1596
+ var _getMapData = getMapData;
1597
+
1598
+ /**
1599
+ * Removes `key` and its value from the map.
1600
+ *
1601
+ * @private
1602
+ * @name delete
1603
+ * @memberOf MapCache
1604
+ * @param {string} key The key of the value to remove.
1605
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1606
+ */
1607
+ function mapCacheDelete(key) {
1608
+ var result = _getMapData(this, key)['delete'](key);
1609
+ this.size -= result ? 1 : 0;
1610
+ return result;
1611
+ }
1612
+
1613
+ var _mapCacheDelete = mapCacheDelete;
1614
+
1615
+ /**
1616
+ * Gets the map value for `key`.
1617
+ *
1618
+ * @private
1619
+ * @name get
1620
+ * @memberOf MapCache
1621
+ * @param {string} key The key of the value to get.
1622
+ * @returns {*} Returns the entry value.
1623
+ */
1624
+ function mapCacheGet(key) {
1625
+ return _getMapData(this, key).get(key);
1626
+ }
1627
+
1628
+ var _mapCacheGet = mapCacheGet;
1629
+
1630
+ /**
1631
+ * Checks if a map value for `key` exists.
1632
+ *
1633
+ * @private
1634
+ * @name has
1635
+ * @memberOf MapCache
1636
+ * @param {string} key The key of the entry to check.
1637
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1638
+ */
1639
+ function mapCacheHas(key) {
1640
+ return _getMapData(this, key).has(key);
1641
+ }
1642
+
1643
+ var _mapCacheHas = mapCacheHas;
1644
+
1645
+ /**
1646
+ * Sets the map `key` to `value`.
1647
+ *
1648
+ * @private
1649
+ * @name set
1650
+ * @memberOf MapCache
1651
+ * @param {string} key The key of the value to set.
1652
+ * @param {*} value The value to set.
1653
+ * @returns {Object} Returns the map cache instance.
1654
+ */
1655
+ function mapCacheSet(key, value) {
1656
+ var data = _getMapData(this, key),
1657
+ size = data.size;
1658
+
1659
+ data.set(key, value);
1660
+ this.size += data.size == size ? 0 : 1;
1661
+ return this;
1662
+ }
1663
+
1664
+ var _mapCacheSet = mapCacheSet;
1665
+
1666
+ /**
1667
+ * Creates a map cache object to store key-value pairs.
1668
+ *
1669
+ * @private
1670
+ * @constructor
1671
+ * @param {Array} [entries] The key-value pairs to cache.
1672
+ */
1673
+ function MapCache(entries) {
1674
+ var index = -1,
1675
+ length = entries == null ? 0 : entries.length;
1676
+
1677
+ this.clear();
1678
+ while (++index < length) {
1679
+ var entry = entries[index];
1680
+ this.set(entry[0], entry[1]);
1681
+ }
1682
+ }
1683
+
1684
+ // Add methods to `MapCache`.
1685
+ MapCache.prototype.clear = _mapCacheClear;
1686
+ MapCache.prototype['delete'] = _mapCacheDelete;
1687
+ MapCache.prototype.get = _mapCacheGet;
1688
+ MapCache.prototype.has = _mapCacheHas;
1689
+ MapCache.prototype.set = _mapCacheSet;
1690
+
1691
+ var _MapCache = MapCache;
1692
+
1693
+ /** Used as the size to enable large array optimizations. */
1694
+ var LARGE_ARRAY_SIZE = 200;
1695
+
1696
+ /**
1697
+ * Sets the stack `key` to `value`.
1698
+ *
1699
+ * @private
1700
+ * @name set
1701
+ * @memberOf Stack
1702
+ * @param {string} key The key of the value to set.
1703
+ * @param {*} value The value to set.
1704
+ * @returns {Object} Returns the stack cache instance.
1705
+ */
1706
+ function stackSet(key, value) {
1707
+ var data = this.__data__;
1708
+ if (data instanceof _ListCache) {
1709
+ var pairs = data.__data__;
1710
+ if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1711
+ pairs.push([key, value]);
1712
+ this.size = ++data.size;
1713
+ return this;
1714
+ }
1715
+ data = this.__data__ = new _MapCache(pairs);
1716
+ }
1717
+ data.set(key, value);
1718
+ this.size = data.size;
1719
+ return this;
1720
+ }
1721
+
1722
+ var _stackSet = stackSet;
1723
+
1724
+ /**
1725
+ * Creates a stack cache object to store key-value pairs.
1726
+ *
1727
+ * @private
1728
+ * @constructor
1729
+ * @param {Array} [entries] The key-value pairs to cache.
1730
+ */
1731
+ function Stack(entries) {
1732
+ var data = this.__data__ = new _ListCache(entries);
1733
+ this.size = data.size;
1734
+ }
1735
+
1736
+ // Add methods to `Stack`.
1737
+ Stack.prototype.clear = _stackClear;
1738
+ Stack.prototype['delete'] = _stackDelete;
1739
+ Stack.prototype.get = _stackGet;
1740
+ Stack.prototype.has = _stackHas;
1741
+ Stack.prototype.set = _stackSet;
1742
+
1743
+ var _Stack = Stack;
1744
+
1745
+ /**
1746
+ * A specialized version of `_.forEach` for arrays without support for
1747
+ * iteratee shorthands.
1748
+ *
1749
+ * @private
1750
+ * @param {Array} [array] The array to iterate over.
1751
+ * @param {Function} iteratee The function invoked per iteration.
1752
+ * @returns {Array} Returns `array`.
1753
+ */
1754
+ function arrayEach(array, iteratee) {
1755
+ var index = -1,
1756
+ length = array == null ? 0 : array.length;
1757
+
1758
+ while (++index < length) {
1759
+ if (iteratee(array[index], index, array) === false) {
1760
+ break;
1761
+ }
1762
+ }
1763
+ return array;
1764
+ }
1765
+
1766
+ var _arrayEach = arrayEach;
1767
+
1768
+ var defineProperty = (function() {
1769
+ try {
1770
+ var func = _getNative(Object, 'defineProperty');
1771
+ func({}, '', {});
1772
+ return func;
1773
+ } catch (e) {}
1774
+ }());
1775
+
1776
+ var _defineProperty = defineProperty;
1777
+
1778
+ /**
1779
+ * The base implementation of `assignValue` and `assignMergeValue` without
1780
+ * value checks.
1781
+ *
1782
+ * @private
1783
+ * @param {Object} object The object to modify.
1784
+ * @param {string} key The key of the property to assign.
1785
+ * @param {*} value The value to assign.
1786
+ */
1787
+ function baseAssignValue(object, key, value) {
1788
+ if (key == '__proto__' && _defineProperty) {
1789
+ _defineProperty(object, key, {
1790
+ 'configurable': true,
1791
+ 'enumerable': true,
1792
+ 'value': value,
1793
+ 'writable': true
1794
+ });
1795
+ } else {
1796
+ object[key] = value;
1797
+ }
1798
+ }
1799
+
1800
+ var _baseAssignValue = baseAssignValue;
1801
+
1802
+ /** Used for built-in method references. */
1803
+ var objectProto$8 = Object.prototype;
1804
+
1805
+ /** Used to check objects for own properties. */
1806
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
1807
+
1808
+ /**
1809
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
1810
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1811
+ * for equality comparisons.
1812
+ *
1813
+ * @private
1814
+ * @param {Object} object The object to modify.
1815
+ * @param {string} key The key of the property to assign.
1816
+ * @param {*} value The value to assign.
1817
+ */
1818
+ function assignValue(object, key, value) {
1819
+ var objValue = object[key];
1820
+ if (!(hasOwnProperty$6.call(object, key) && eq_1(objValue, value)) ||
1821
+ (value === undefined && !(key in object))) {
1822
+ _baseAssignValue(object, key, value);
1823
+ }
1824
+ }
1825
+
1826
+ var _assignValue = assignValue;
1827
+
1828
+ /**
1829
+ * Copies properties of `source` to `object`.
1830
+ *
1831
+ * @private
1832
+ * @param {Object} source The object to copy properties from.
1833
+ * @param {Array} props The property identifiers to copy.
1834
+ * @param {Object} [object={}] The object to copy properties to.
1835
+ * @param {Function} [customizer] The function to customize copied values.
1836
+ * @returns {Object} Returns `object`.
1837
+ */
1838
+ function copyObject(source, props, object, customizer) {
1839
+ var isNew = !object;
1840
+ object || (object = {});
1841
+
1842
+ var index = -1,
1843
+ length = props.length;
1844
+
1845
+ while (++index < length) {
1846
+ var key = props[index];
1847
+
1848
+ var newValue = customizer
1849
+ ? customizer(object[key], source[key], key, object, source)
1850
+ : undefined;
1851
+
1852
+ if (newValue === undefined) {
1853
+ newValue = source[key];
1854
+ }
1855
+ if (isNew) {
1856
+ _baseAssignValue(object, key, newValue);
1857
+ } else {
1858
+ _assignValue(object, key, newValue);
1859
+ }
1860
+ }
1861
+ return object;
1862
+ }
1863
+
1864
+ var _copyObject = copyObject;
1865
+
1866
+ /**
1867
+ * The base implementation of `_.times` without support for iteratee shorthands
1868
+ * or max array length checks.
1869
+ *
1870
+ * @private
1871
+ * @param {number} n The number of times to invoke `iteratee`.
1872
+ * @param {Function} iteratee The function invoked per iteration.
1873
+ * @returns {Array} Returns the array of results.
1874
+ */
1875
+ function baseTimes(n, iteratee) {
1876
+ var index = -1,
1877
+ result = Array(n);
1878
+
1879
+ while (++index < n) {
1880
+ result[index] = iteratee(index);
1881
+ }
1882
+ return result;
1883
+ }
1884
+
1885
+ var _baseTimes = baseTimes;
1886
+
1887
+ /**
1888
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1889
+ * and has a `typeof` result of "object".
1890
+ *
1891
+ * @static
1892
+ * @memberOf _
1893
+ * @since 4.0.0
1894
+ * @category Lang
1895
+ * @param {*} value The value to check.
1896
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1897
+ * @example
1898
+ *
1899
+ * _.isObjectLike({});
1900
+ * // => true
1901
+ *
1902
+ * _.isObjectLike([1, 2, 3]);
1903
+ * // => true
1904
+ *
1905
+ * _.isObjectLike(_.noop);
1906
+ * // => false
1907
+ *
1908
+ * _.isObjectLike(null);
1909
+ * // => false
1910
+ */
1911
+ function isObjectLike(value) {
1912
+ return value != null && typeof value == 'object';
1913
+ }
1914
+
1915
+ var isObjectLike_1 = isObjectLike;
1916
+
1917
+ /** `Object#toString` result references. */
1918
+ var argsTag$2 = '[object Arguments]';
1919
+
1920
+ /**
1921
+ * The base implementation of `_.isArguments`.
1922
+ *
1923
+ * @private
1924
+ * @param {*} value The value to check.
1925
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1926
+ */
1927
+ function baseIsArguments(value) {
1928
+ return isObjectLike_1(value) && _baseGetTag(value) == argsTag$2;
1929
+ }
1930
+
1931
+ var _baseIsArguments = baseIsArguments;
1932
+
1933
+ /** Used for built-in method references. */
1934
+ var objectProto$7 = Object.prototype;
1935
+
1936
+ /** Used to check objects for own properties. */
1937
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
1938
+
1939
+ /** Built-in value references. */
1940
+ var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
1941
+
1942
+ /**
1943
+ * Checks if `value` is likely an `arguments` object.
1944
+ *
1945
+ * @static
1946
+ * @memberOf _
1947
+ * @since 0.1.0
1948
+ * @category Lang
1949
+ * @param {*} value The value to check.
1950
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1951
+ * else `false`.
1952
+ * @example
1953
+ *
1954
+ * _.isArguments(function() { return arguments; }());
1955
+ * // => true
1956
+ *
1957
+ * _.isArguments([1, 2, 3]);
1958
+ * // => false
1959
+ */
1960
+ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
1961
+ return isObjectLike_1(value) && hasOwnProperty$5.call(value, 'callee') &&
1962
+ !propertyIsEnumerable$1.call(value, 'callee');
1963
+ };
1964
+
1965
+ var isArguments_1 = isArguments;
1966
+
1967
+ /**
1968
+ * Checks if `value` is classified as an `Array` object.
1969
+ *
1970
+ * @static
1971
+ * @memberOf _
1972
+ * @since 0.1.0
1973
+ * @category Lang
1974
+ * @param {*} value The value to check.
1975
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1976
+ * @example
1977
+ *
1978
+ * _.isArray([1, 2, 3]);
1979
+ * // => true
1980
+ *
1981
+ * _.isArray(document.body.children);
1982
+ * // => false
1983
+ *
1984
+ * _.isArray('abc');
1985
+ * // => false
1986
+ *
1987
+ * _.isArray(_.noop);
1988
+ * // => false
1989
+ */
1990
+ var isArray = Array.isArray;
1991
+
1992
+ var isArray_1 = isArray;
1993
+
1994
+ /**
1995
+ * This method returns `false`.
1996
+ *
1997
+ * @static
1998
+ * @memberOf _
1999
+ * @since 4.13.0
2000
+ * @category Util
2001
+ * @returns {boolean} Returns `false`.
2002
+ * @example
2003
+ *
2004
+ * _.times(2, _.stubFalse);
2005
+ * // => [false, false]
2006
+ */
2007
+ function stubFalse() {
2008
+ return false;
2009
+ }
2010
+
2011
+ var stubFalse_1 = stubFalse;
2012
+
2013
+ var isBuffer_1 = createCommonjsModule(function (module, exports) {
2014
+ /** Detect free variable `exports`. */
2015
+ var freeExports = exports && !exports.nodeType && exports;
2016
+
2017
+ /** Detect free variable `module`. */
2018
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2019
+
2020
+ /** Detect the popular CommonJS extension `module.exports`. */
2021
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2022
+
2023
+ /** Built-in value references. */
2024
+ var Buffer = moduleExports ? _root.Buffer : undefined;
2025
+
2026
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2027
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
2028
+
2029
+ /**
2030
+ * Checks if `value` is a buffer.
2031
+ *
2032
+ * @static
2033
+ * @memberOf _
2034
+ * @since 4.3.0
2035
+ * @category Lang
2036
+ * @param {*} value The value to check.
2037
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
2038
+ * @example
2039
+ *
2040
+ * _.isBuffer(new Buffer(2));
2041
+ * // => true
2042
+ *
2043
+ * _.isBuffer(new Uint8Array(2));
2044
+ * // => false
2045
+ */
2046
+ var isBuffer = nativeIsBuffer || stubFalse_1;
2047
+
2048
+ module.exports = isBuffer;
2049
+ });
2050
+
2051
+ /** Used as references for various `Number` constants. */
2052
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
2053
+
2054
+ /** Used to detect unsigned integer values. */
2055
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2056
+
2057
+ /**
2058
+ * Checks if `value` is a valid array-like index.
2059
+ *
2060
+ * @private
2061
+ * @param {*} value The value to check.
2062
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2063
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2064
+ */
2065
+ function isIndex(value, length) {
2066
+ var type = typeof value;
2067
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
2068
+
2069
+ return !!length &&
2070
+ (type == 'number' ||
2071
+ (type != 'symbol' && reIsUint.test(value))) &&
2072
+ (value > -1 && value % 1 == 0 && value < length);
2073
+ }
2074
+
2075
+ var _isIndex = isIndex;
2076
+
2077
+ /** Used as references for various `Number` constants. */
2078
+ var MAX_SAFE_INTEGER = 9007199254740991;
2079
+
2080
+ /**
2081
+ * Checks if `value` is a valid array-like length.
2082
+ *
2083
+ * **Note:** This method is loosely based on
2084
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2085
+ *
2086
+ * @static
2087
+ * @memberOf _
2088
+ * @since 4.0.0
2089
+ * @category Lang
2090
+ * @param {*} value The value to check.
2091
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2092
+ * @example
2093
+ *
2094
+ * _.isLength(3);
2095
+ * // => true
2096
+ *
2097
+ * _.isLength(Number.MIN_VALUE);
2098
+ * // => false
2099
+ *
2100
+ * _.isLength(Infinity);
2101
+ * // => false
2102
+ *
2103
+ * _.isLength('3');
2104
+ * // => false
2105
+ */
2106
+ function isLength(value) {
2107
+ return typeof value == 'number' &&
2108
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2109
+ }
2110
+
2111
+ var isLength_1 = isLength;
2112
+
2113
+ /** `Object#toString` result references. */
2114
+ var argsTag$1 = '[object Arguments]',
2115
+ arrayTag$1 = '[object Array]',
2116
+ boolTag$2 = '[object Boolean]',
2117
+ dateTag$2 = '[object Date]',
2118
+ errorTag$1 = '[object Error]',
2119
+ funcTag$1 = '[object Function]',
2120
+ mapTag$4 = '[object Map]',
2121
+ numberTag$2 = '[object Number]',
2122
+ objectTag$3 = '[object Object]',
2123
+ regexpTag$2 = '[object RegExp]',
2124
+ setTag$4 = '[object Set]',
2125
+ stringTag$2 = '[object String]',
2126
+ weakMapTag$2 = '[object WeakMap]';
2127
+
2128
+ var arrayBufferTag$2 = '[object ArrayBuffer]',
2129
+ dataViewTag$3 = '[object DataView]',
2130
+ float32Tag$2 = '[object Float32Array]',
2131
+ float64Tag$2 = '[object Float64Array]',
2132
+ int8Tag$2 = '[object Int8Array]',
2133
+ int16Tag$2 = '[object Int16Array]',
2134
+ int32Tag$2 = '[object Int32Array]',
2135
+ uint8Tag$2 = '[object Uint8Array]',
2136
+ uint8ClampedTag$2 = '[object Uint8ClampedArray]',
2137
+ uint16Tag$2 = '[object Uint16Array]',
2138
+ uint32Tag$2 = '[object Uint32Array]';
2139
+
2140
+ /** Used to identify `toStringTag` values of typed arrays. */
2141
+ var typedArrayTags = {};
2142
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
2143
+ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
2144
+ typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
2145
+ typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
2146
+ typedArrayTags[uint32Tag$2] = true;
2147
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
2148
+ typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
2149
+ typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
2150
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
2151
+ typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
2152
+ typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$2] =
2153
+ typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
2154
+ typedArrayTags[weakMapTag$2] = false;
2155
+
2156
+ /**
2157
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
2158
+ *
2159
+ * @private
2160
+ * @param {*} value The value to check.
2161
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2162
+ */
2163
+ function baseIsTypedArray(value) {
2164
+ return isObjectLike_1(value) &&
2165
+ isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
2166
+ }
2167
+
2168
+ var _baseIsTypedArray = baseIsTypedArray;
2169
+
2170
+ /**
2171
+ * The base implementation of `_.unary` without support for storing metadata.
2172
+ *
2173
+ * @private
2174
+ * @param {Function} func The function to cap arguments for.
2175
+ * @returns {Function} Returns the new capped function.
2176
+ */
2177
+ function baseUnary(func) {
2178
+ return function(value) {
2179
+ return func(value);
2180
+ };
2181
+ }
2182
+
2183
+ var _baseUnary = baseUnary;
2184
+
2185
+ var _nodeUtil = createCommonjsModule(function (module, exports) {
2186
+ /** Detect free variable `exports`. */
2187
+ var freeExports = exports && !exports.nodeType && exports;
2188
+
2189
+ /** Detect free variable `module`. */
2190
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2191
+
2192
+ /** Detect the popular CommonJS extension `module.exports`. */
2193
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2194
+
2195
+ /** Detect free variable `process` from Node.js. */
2196
+ var freeProcess = moduleExports && _freeGlobal.process;
2197
+
2198
+ /** Used to access faster Node.js helpers. */
2199
+ var nodeUtil = (function() {
2200
+ try {
2201
+ // Use `util.types` for Node.js 10+.
2202
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
2203
+
2204
+ if (types) {
2205
+ return types;
2206
+ }
2207
+
2208
+ // Legacy `process.binding('util')` for Node.js < 10.
2209
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
2210
+ } catch (e) {}
2211
+ }());
2212
+
2213
+ module.exports = nodeUtil;
2214
+ });
2215
+
2216
+ /* Node.js helper references. */
2217
+ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
2218
+
2219
+ /**
2220
+ * Checks if `value` is classified as a typed array.
2221
+ *
2222
+ * @static
2223
+ * @memberOf _
2224
+ * @since 3.0.0
2225
+ * @category Lang
2226
+ * @param {*} value The value to check.
2227
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2228
+ * @example
2229
+ *
2230
+ * _.isTypedArray(new Uint8Array);
2231
+ * // => true
2232
+ *
2233
+ * _.isTypedArray([]);
2234
+ * // => false
2235
+ */
2236
+ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
2237
+
2238
+ var isTypedArray_1 = isTypedArray;
2239
+
2240
+ /** Used for built-in method references. */
2241
+ var objectProto$6 = Object.prototype;
2242
+
2243
+ /** Used to check objects for own properties. */
2244
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
2245
+
2246
+ /**
2247
+ * Creates an array of the enumerable property names of the array-like `value`.
2248
+ *
2249
+ * @private
2250
+ * @param {*} value The value to query.
2251
+ * @param {boolean} inherited Specify returning inherited property names.
2252
+ * @returns {Array} Returns the array of property names.
2253
+ */
2254
+ function arrayLikeKeys(value, inherited) {
2255
+ var isArr = isArray_1(value),
2256
+ isArg = !isArr && isArguments_1(value),
2257
+ isBuff = !isArr && !isArg && isBuffer_1(value),
2258
+ isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
2259
+ skipIndexes = isArr || isArg || isBuff || isType,
2260
+ result = skipIndexes ? _baseTimes(value.length, String) : [],
2261
+ length = result.length;
2262
+
2263
+ for (var key in value) {
2264
+ if ((inherited || hasOwnProperty$4.call(value, key)) &&
2265
+ !(skipIndexes && (
2266
+ // Safari 9 has enumerable `arguments.length` in strict mode.
2267
+ key == 'length' ||
2268
+ // Node.js 0.10 has enumerable non-index properties on buffers.
2269
+ (isBuff && (key == 'offset' || key == 'parent')) ||
2270
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
2271
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2272
+ // Skip index properties.
2273
+ _isIndex(key, length)
2274
+ ))) {
2275
+ result.push(key);
2276
+ }
2277
+ }
2278
+ return result;
2279
+ }
2280
+
2281
+ var _arrayLikeKeys = arrayLikeKeys;
2282
+
2283
+ /** Used for built-in method references. */
2284
+ var objectProto$5 = Object.prototype;
2285
+
2286
+ /**
2287
+ * Checks if `value` is likely a prototype object.
2288
+ *
2289
+ * @private
2290
+ * @param {*} value The value to check.
2291
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
2292
+ */
2293
+ function isPrototype(value) {
2294
+ var Ctor = value && value.constructor,
2295
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
2296
+
2297
+ return value === proto;
2298
+ }
2299
+
2300
+ var _isPrototype = isPrototype;
2301
+
2302
+ /**
2303
+ * Creates a unary function that invokes `func` with its argument transformed.
2304
+ *
2305
+ * @private
2306
+ * @param {Function} func The function to wrap.
2307
+ * @param {Function} transform The argument transform.
2308
+ * @returns {Function} Returns the new function.
2309
+ */
2310
+ function overArg(func, transform) {
2311
+ return function(arg) {
2312
+ return func(transform(arg));
2313
+ };
2314
+ }
2315
+
2316
+ var _overArg = overArg;
2317
+
2318
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2319
+ var nativeKeys = _overArg(Object.keys, Object);
2320
+
2321
+ var _nativeKeys = nativeKeys;
2322
+
2323
+ /** Used for built-in method references. */
2324
+ var objectProto$4 = Object.prototype;
2325
+
2326
+ /** Used to check objects for own properties. */
2327
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
2328
+
2329
+ /**
2330
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
2331
+ *
2332
+ * @private
2333
+ * @param {Object} object The object to query.
2334
+ * @returns {Array} Returns the array of property names.
2335
+ */
2336
+ function baseKeys(object) {
2337
+ if (!_isPrototype(object)) {
2338
+ return _nativeKeys(object);
2339
+ }
2340
+ var result = [];
2341
+ for (var key in Object(object)) {
2342
+ if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
2343
+ result.push(key);
2344
+ }
2345
+ }
2346
+ return result;
2347
+ }
2348
+
2349
+ var _baseKeys = baseKeys;
2350
+
2351
+ /**
2352
+ * Checks if `value` is array-like. A value is considered array-like if it's
2353
+ * not a function and has a `value.length` that's an integer greater than or
2354
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2355
+ *
2356
+ * @static
2357
+ * @memberOf _
2358
+ * @since 4.0.0
2359
+ * @category Lang
2360
+ * @param {*} value The value to check.
2361
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2362
+ * @example
2363
+ *
2364
+ * _.isArrayLike([1, 2, 3]);
2365
+ * // => true
2366
+ *
2367
+ * _.isArrayLike(document.body.children);
2368
+ * // => true
2369
+ *
2370
+ * _.isArrayLike('abc');
2371
+ * // => true
2372
+ *
2373
+ * _.isArrayLike(_.noop);
2374
+ * // => false
2375
+ */
2376
+ function isArrayLike(value) {
2377
+ return value != null && isLength_1(value.length) && !isFunction_1(value);
2378
+ }
2379
+
2380
+ var isArrayLike_1 = isArrayLike;
2381
+
2382
+ /**
2383
+ * Creates an array of the own enumerable property names of `object`.
2384
+ *
2385
+ * **Note:** Non-object values are coerced to objects. See the
2386
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2387
+ * for more details.
2388
+ *
2389
+ * @static
2390
+ * @since 0.1.0
2391
+ * @memberOf _
2392
+ * @category Object
2393
+ * @param {Object} object The object to query.
2394
+ * @returns {Array} Returns the array of property names.
2395
+ * @example
2396
+ *
2397
+ * function Foo() {
2398
+ * this.a = 1;
2399
+ * this.b = 2;
2400
+ * }
2401
+ *
2402
+ * Foo.prototype.c = 3;
2403
+ *
2404
+ * _.keys(new Foo);
2405
+ * // => ['a', 'b'] (iteration order is not guaranteed)
2406
+ *
2407
+ * _.keys('hi');
2408
+ * // => ['0', '1']
2409
+ */
2410
+ function keys(object) {
2411
+ return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
2412
+ }
2413
+
2414
+ var keys_1 = keys;
2415
+
2416
+ /**
2417
+ * The base implementation of `_.assign` without support for multiple sources
2418
+ * or `customizer` functions.
2419
+ *
2420
+ * @private
2421
+ * @param {Object} object The destination object.
2422
+ * @param {Object} source The source object.
2423
+ * @returns {Object} Returns `object`.
2424
+ */
2425
+ function baseAssign(object, source) {
2426
+ return object && _copyObject(source, keys_1(source), object);
2427
+ }
2428
+
2429
+ var _baseAssign = baseAssign;
2430
+
2431
+ /**
2432
+ * This function is like
2433
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2434
+ * except that it includes inherited enumerable properties.
2435
+ *
2436
+ * @private
2437
+ * @param {Object} object The object to query.
2438
+ * @returns {Array} Returns the array of property names.
2439
+ */
2440
+ function nativeKeysIn(object) {
2441
+ var result = [];
2442
+ if (object != null) {
2443
+ for (var key in Object(object)) {
2444
+ result.push(key);
2445
+ }
2446
+ }
2447
+ return result;
2448
+ }
2449
+
2450
+ var _nativeKeysIn = nativeKeysIn;
2451
+
2452
+ /** Used for built-in method references. */
2453
+ var objectProto$3 = Object.prototype;
2454
+
2455
+ /** Used to check objects for own properties. */
2456
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
2457
+
2458
+ /**
2459
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
2460
+ *
2461
+ * @private
2462
+ * @param {Object} object The object to query.
2463
+ * @returns {Array} Returns the array of property names.
2464
+ */
2465
+ function baseKeysIn(object) {
2466
+ if (!isObject_1(object)) {
2467
+ return _nativeKeysIn(object);
2468
+ }
2469
+ var isProto = _isPrototype(object),
2470
+ result = [];
2471
+
2472
+ for (var key in object) {
2473
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty$2.call(object, key)))) {
2474
+ result.push(key);
2475
+ }
2476
+ }
2477
+ return result;
2478
+ }
2479
+
2480
+ var _baseKeysIn = baseKeysIn;
2481
+
2482
+ /**
2483
+ * Creates an array of the own and inherited enumerable property names of `object`.
2484
+ *
2485
+ * **Note:** Non-object values are coerced to objects.
2486
+ *
2487
+ * @static
2488
+ * @memberOf _
2489
+ * @since 3.0.0
2490
+ * @category Object
2491
+ * @param {Object} object The object to query.
2492
+ * @returns {Array} Returns the array of property names.
2493
+ * @example
2494
+ *
2495
+ * function Foo() {
2496
+ * this.a = 1;
2497
+ * this.b = 2;
2498
+ * }
2499
+ *
2500
+ * Foo.prototype.c = 3;
2501
+ *
2502
+ * _.keysIn(new Foo);
2503
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
2504
+ */
2505
+ function keysIn(object) {
2506
+ return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
2507
+ }
2508
+
2509
+ var keysIn_1 = keysIn;
2510
+
2511
+ /**
2512
+ * The base implementation of `_.assignIn` without support for multiple sources
2513
+ * or `customizer` functions.
2514
+ *
2515
+ * @private
2516
+ * @param {Object} object The destination object.
2517
+ * @param {Object} source The source object.
2518
+ * @returns {Object} Returns `object`.
2519
+ */
2520
+ function baseAssignIn(object, source) {
2521
+ return object && _copyObject(source, keysIn_1(source), object);
2522
+ }
2523
+
2524
+ var _baseAssignIn = baseAssignIn;
2525
+
2526
+ var _cloneBuffer = createCommonjsModule(function (module, exports) {
2527
+ /** Detect free variable `exports`. */
2528
+ var freeExports = exports && !exports.nodeType && exports;
2529
+
2530
+ /** Detect free variable `module`. */
2531
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
2532
+
2533
+ /** Detect the popular CommonJS extension `module.exports`. */
2534
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2535
+
2536
+ /** Built-in value references. */
2537
+ var Buffer = moduleExports ? _root.Buffer : undefined,
2538
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
2539
+
2540
+ /**
2541
+ * Creates a clone of `buffer`.
2542
+ *
2543
+ * @private
2544
+ * @param {Buffer} buffer The buffer to clone.
2545
+ * @param {boolean} [isDeep] Specify a deep clone.
2546
+ * @returns {Buffer} Returns the cloned buffer.
2547
+ */
2548
+ function cloneBuffer(buffer, isDeep) {
2549
+ if (isDeep) {
2550
+ return buffer.slice();
2551
+ }
2552
+ var length = buffer.length,
2553
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
2554
+
2555
+ buffer.copy(result);
2556
+ return result;
2557
+ }
2558
+
2559
+ module.exports = cloneBuffer;
2560
+ });
2561
+
2562
+ /**
2563
+ * Copies the values of `source` to `array`.
2564
+ *
2565
+ * @private
2566
+ * @param {Array} source The array to copy values from.
2567
+ * @param {Array} [array=[]] The array to copy values to.
2568
+ * @returns {Array} Returns `array`.
2569
+ */
2570
+ function copyArray(source, array) {
2571
+ var index = -1,
2572
+ length = source.length;
2573
+
2574
+ array || (array = Array(length));
2575
+ while (++index < length) {
2576
+ array[index] = source[index];
2577
+ }
2578
+ return array;
2579
+ }
2580
+
2581
+ var _copyArray = copyArray;
2582
+
2583
+ /**
2584
+ * A specialized version of `_.filter` for arrays without support for
2585
+ * iteratee shorthands.
2586
+ *
2587
+ * @private
2588
+ * @param {Array} [array] The array to iterate over.
2589
+ * @param {Function} predicate The function invoked per iteration.
2590
+ * @returns {Array} Returns the new filtered array.
2591
+ */
2592
+ function arrayFilter(array, predicate) {
2593
+ var index = -1,
2594
+ length = array == null ? 0 : array.length,
2595
+ resIndex = 0,
2596
+ result = [];
2597
+
2598
+ while (++index < length) {
2599
+ var value = array[index];
2600
+ if (predicate(value, index, array)) {
2601
+ result[resIndex++] = value;
2602
+ }
2603
+ }
2604
+ return result;
2605
+ }
2606
+
2607
+ var _arrayFilter = arrayFilter;
2608
+
2609
+ /**
2610
+ * This method returns a new empty array.
2611
+ *
2612
+ * @static
2613
+ * @memberOf _
2614
+ * @since 4.13.0
2615
+ * @category Util
2616
+ * @returns {Array} Returns the new empty array.
2617
+ * @example
2618
+ *
2619
+ * var arrays = _.times(2, _.stubArray);
2620
+ *
2621
+ * console.log(arrays);
2622
+ * // => [[], []]
2623
+ *
2624
+ * console.log(arrays[0] === arrays[1]);
2625
+ * // => false
2626
+ */
2627
+ function stubArray() {
2628
+ return [];
2629
+ }
2630
+
2631
+ var stubArray_1 = stubArray;
2632
+
2633
+ /** Used for built-in method references. */
2634
+ var objectProto$2 = Object.prototype;
2635
+
2636
+ /** Built-in value references. */
2637
+ var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
2638
+
2639
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2640
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
2641
+
2642
+ /**
2643
+ * Creates an array of the own enumerable symbols of `object`.
2644
+ *
2645
+ * @private
2646
+ * @param {Object} object The object to query.
2647
+ * @returns {Array} Returns the array of symbols.
2648
+ */
2649
+ var getSymbols = !nativeGetSymbols$1 ? stubArray_1 : function(object) {
2650
+ if (object == null) {
2651
+ return [];
2652
+ }
2653
+ object = Object(object);
2654
+ return _arrayFilter(nativeGetSymbols$1(object), function(symbol) {
2655
+ return propertyIsEnumerable.call(object, symbol);
2656
+ });
2657
+ };
2658
+
2659
+ var _getSymbols = getSymbols;
2660
+
2661
+ /**
2662
+ * Copies own symbols of `source` to `object`.
2663
+ *
2664
+ * @private
2665
+ * @param {Object} source The object to copy symbols from.
2666
+ * @param {Object} [object={}] The object to copy symbols to.
2667
+ * @returns {Object} Returns `object`.
2668
+ */
2669
+ function copySymbols(source, object) {
2670
+ return _copyObject(source, _getSymbols(source), object);
2671
+ }
2672
+
2673
+ var _copySymbols = copySymbols;
2674
+
2675
+ /**
2676
+ * Appends the elements of `values` to `array`.
2677
+ *
2678
+ * @private
2679
+ * @param {Array} array The array to modify.
2680
+ * @param {Array} values The values to append.
2681
+ * @returns {Array} Returns `array`.
2682
+ */
2683
+ function arrayPush(array, values) {
2684
+ var index = -1,
2685
+ length = values.length,
2686
+ offset = array.length;
2687
+
2688
+ while (++index < length) {
2689
+ array[offset + index] = values[index];
2690
+ }
2691
+ return array;
2692
+ }
2693
+
2694
+ var _arrayPush = arrayPush;
2695
+
2696
+ /** Built-in value references. */
2697
+ var getPrototype = _overArg(Object.getPrototypeOf, Object);
2698
+
2699
+ var _getPrototype = getPrototype;
2700
+
2701
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2702
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
2703
+
2704
+ /**
2705
+ * Creates an array of the own and inherited enumerable symbols of `object`.
2706
+ *
2707
+ * @private
2708
+ * @param {Object} object The object to query.
2709
+ * @returns {Array} Returns the array of symbols.
2710
+ */
2711
+ var getSymbolsIn = !nativeGetSymbols ? stubArray_1 : function(object) {
2712
+ var result = [];
2713
+ while (object) {
2714
+ _arrayPush(result, _getSymbols(object));
2715
+ object = _getPrototype(object);
2716
+ }
2717
+ return result;
2718
+ };
2719
+
2720
+ var _getSymbolsIn = getSymbolsIn;
2721
+
2722
+ /**
2723
+ * Copies own and inherited symbols of `source` to `object`.
2724
+ *
2725
+ * @private
2726
+ * @param {Object} source The object to copy symbols from.
2727
+ * @param {Object} [object={}] The object to copy symbols to.
2728
+ * @returns {Object} Returns `object`.
2729
+ */
2730
+ function copySymbolsIn(source, object) {
2731
+ return _copyObject(source, _getSymbolsIn(source), object);
2732
+ }
2733
+
2734
+ var _copySymbolsIn = copySymbolsIn;
2735
+
2736
+ /**
2737
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
2738
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
2739
+ * symbols of `object`.
2740
+ *
2741
+ * @private
2742
+ * @param {Object} object The object to query.
2743
+ * @param {Function} keysFunc The function to get the keys of `object`.
2744
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
2745
+ * @returns {Array} Returns the array of property names and symbols.
2746
+ */
2747
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2748
+ var result = keysFunc(object);
2749
+ return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
2750
+ }
2751
+
2752
+ var _baseGetAllKeys = baseGetAllKeys;
2753
+
2754
+ /**
2755
+ * Creates an array of own enumerable property names and symbols of `object`.
2756
+ *
2757
+ * @private
2758
+ * @param {Object} object The object to query.
2759
+ * @returns {Array} Returns the array of property names and symbols.
2760
+ */
2761
+ function getAllKeys(object) {
2762
+ return _baseGetAllKeys(object, keys_1, _getSymbols);
2763
+ }
2764
+
2765
+ var _getAllKeys = getAllKeys;
2766
+
2767
+ /**
2768
+ * Creates an array of own and inherited enumerable property names and
2769
+ * symbols of `object`.
2770
+ *
2771
+ * @private
2772
+ * @param {Object} object The object to query.
2773
+ * @returns {Array} Returns the array of property names and symbols.
2774
+ */
2775
+ function getAllKeysIn(object) {
2776
+ return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn);
2777
+ }
2778
+
2779
+ var _getAllKeysIn = getAllKeysIn;
2780
+
2781
+ /* Built-in method references that are verified to be native. */
2782
+ var DataView = _getNative(_root, 'DataView');
2783
+
2784
+ var _DataView = DataView;
2785
+
2786
+ /* Built-in method references that are verified to be native. */
2787
+ var Promise$1 = _getNative(_root, 'Promise');
2788
+
2789
+ var _Promise = Promise$1;
2790
+
2791
+ /* Built-in method references that are verified to be native. */
2792
+ var Set = _getNative(_root, 'Set');
2793
+
2794
+ var _Set = Set;
2795
+
2796
+ /* Built-in method references that are verified to be native. */
2797
+ var WeakMap = _getNative(_root, 'WeakMap');
2798
+
2799
+ var _WeakMap = WeakMap;
2800
+
2801
+ /** `Object#toString` result references. */
2802
+ var mapTag$3 = '[object Map]',
2803
+ objectTag$2 = '[object Object]',
2804
+ promiseTag = '[object Promise]',
2805
+ setTag$3 = '[object Set]',
2806
+ weakMapTag$1 = '[object WeakMap]';
2807
+
2808
+ var dataViewTag$2 = '[object DataView]';
2809
+
2810
+ /** Used to detect maps, sets, and weakmaps. */
2811
+ var dataViewCtorString = _toSource(_DataView),
2812
+ mapCtorString = _toSource(_Map),
2813
+ promiseCtorString = _toSource(_Promise),
2814
+ setCtorString = _toSource(_Set),
2815
+ weakMapCtorString = _toSource(_WeakMap);
2816
+
2817
+ /**
2818
+ * Gets the `toStringTag` of `value`.
2819
+ *
2820
+ * @private
2821
+ * @param {*} value The value to query.
2822
+ * @returns {string} Returns the `toStringTag`.
2823
+ */
2824
+ var getTag = _baseGetTag;
2825
+
2826
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2827
+ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
2828
+ (_Map && getTag(new _Map) != mapTag$3) ||
2829
+ (_Promise && getTag(_Promise.resolve()) != promiseTag) ||
2830
+ (_Set && getTag(new _Set) != setTag$3) ||
2831
+ (_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) {
2832
+ getTag = function(value) {
2833
+ var result = _baseGetTag(value),
2834
+ Ctor = result == objectTag$2 ? value.constructor : undefined,
2835
+ ctorString = Ctor ? _toSource(Ctor) : '';
2836
+
2837
+ if (ctorString) {
2838
+ switch (ctorString) {
2839
+ case dataViewCtorString: return dataViewTag$2;
2840
+ case mapCtorString: return mapTag$3;
2841
+ case promiseCtorString: return promiseTag;
2842
+ case setCtorString: return setTag$3;
2843
+ case weakMapCtorString: return weakMapTag$1;
2844
+ }
2845
+ }
2846
+ return result;
2847
+ };
2848
+ }
2849
+
2850
+ var _getTag = getTag;
2851
+
2852
+ /** Used for built-in method references. */
2853
+ var objectProto$1 = Object.prototype;
2854
+
2855
+ /** Used to check objects for own properties. */
2856
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2857
+
2858
+ /**
2859
+ * Initializes an array clone.
2860
+ *
2861
+ * @private
2862
+ * @param {Array} array The array to clone.
2863
+ * @returns {Array} Returns the initialized clone.
2864
+ */
2865
+ function initCloneArray(array) {
2866
+ var length = array.length,
2867
+ result = new array.constructor(length);
2868
+
2869
+ // Add properties assigned by `RegExp#exec`.
2870
+ if (length && typeof array[0] == 'string' && hasOwnProperty$1.call(array, 'index')) {
2871
+ result.index = array.index;
2872
+ result.input = array.input;
2873
+ }
2874
+ return result;
2875
+ }
2876
+
2877
+ var _initCloneArray = initCloneArray;
2878
+
2879
+ /** Built-in value references. */
2880
+ var Uint8Array$1 = _root.Uint8Array;
2881
+
2882
+ var _Uint8Array = Uint8Array$1;
2883
+
2884
+ /**
2885
+ * Creates a clone of `arrayBuffer`.
2886
+ *
2887
+ * @private
2888
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2889
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
2890
+ */
2891
+ function cloneArrayBuffer(arrayBuffer) {
2892
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2893
+ new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
2894
+ return result;
2895
+ }
2896
+
2897
+ var _cloneArrayBuffer = cloneArrayBuffer;
2898
+
2899
+ /**
2900
+ * Creates a clone of `dataView`.
2901
+ *
2902
+ * @private
2903
+ * @param {Object} dataView The data view to clone.
2904
+ * @param {boolean} [isDeep] Specify a deep clone.
2905
+ * @returns {Object} Returns the cloned data view.
2906
+ */
2907
+ function cloneDataView(dataView, isDeep) {
2908
+ var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2909
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2910
+ }
2911
+
2912
+ var _cloneDataView = cloneDataView;
2913
+
2914
+ /** Used to match `RegExp` flags from their coerced string values. */
2915
+ var reFlags = /\w*$/;
2916
+
2917
+ /**
2918
+ * Creates a clone of `regexp`.
2919
+ *
2920
+ * @private
2921
+ * @param {Object} regexp The regexp to clone.
2922
+ * @returns {Object} Returns the cloned regexp.
2923
+ */
2924
+ function cloneRegExp(regexp) {
2925
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2926
+ result.lastIndex = regexp.lastIndex;
2927
+ return result;
2928
+ }
2929
+
2930
+ var _cloneRegExp = cloneRegExp;
2931
+
2932
+ /** Used to convert symbols to primitives and strings. */
2933
+ var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
2934
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
2935
+
2936
+ /**
2937
+ * Creates a clone of the `symbol` object.
2938
+ *
2939
+ * @private
2940
+ * @param {Object} symbol The symbol object to clone.
2941
+ * @returns {Object} Returns the cloned symbol object.
2942
+ */
2943
+ function cloneSymbol(symbol) {
2944
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2945
+ }
2946
+
2947
+ var _cloneSymbol = cloneSymbol;
2948
+
2949
+ /**
2950
+ * Creates a clone of `typedArray`.
2951
+ *
2952
+ * @private
2953
+ * @param {Object} typedArray The typed array to clone.
2954
+ * @param {boolean} [isDeep] Specify a deep clone.
2955
+ * @returns {Object} Returns the cloned typed array.
2956
+ */
2957
+ function cloneTypedArray(typedArray, isDeep) {
2958
+ var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2959
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2960
+ }
2961
+
2962
+ var _cloneTypedArray = cloneTypedArray;
2963
+
2964
+ /** `Object#toString` result references. */
2965
+ var boolTag$1 = '[object Boolean]',
2966
+ dateTag$1 = '[object Date]',
2967
+ mapTag$2 = '[object Map]',
2968
+ numberTag$1 = '[object Number]',
2969
+ regexpTag$1 = '[object RegExp]',
2970
+ setTag$2 = '[object Set]',
2971
+ stringTag$1 = '[object String]',
2972
+ symbolTag$2 = '[object Symbol]';
2973
+
2974
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
2975
+ dataViewTag$1 = '[object DataView]',
2976
+ float32Tag$1 = '[object Float32Array]',
2977
+ float64Tag$1 = '[object Float64Array]',
2978
+ int8Tag$1 = '[object Int8Array]',
2979
+ int16Tag$1 = '[object Int16Array]',
2980
+ int32Tag$1 = '[object Int32Array]',
2981
+ uint8Tag$1 = '[object Uint8Array]',
2982
+ uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2983
+ uint16Tag$1 = '[object Uint16Array]',
2984
+ uint32Tag$1 = '[object Uint32Array]';
2985
+
2986
+ /**
2987
+ * Initializes an object clone based on its `toStringTag`.
2988
+ *
2989
+ * **Note:** This function only supports cloning values with tags of
2990
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2991
+ *
2992
+ * @private
2993
+ * @param {Object} object The object to clone.
2994
+ * @param {string} tag The `toStringTag` of the object to clone.
2995
+ * @param {boolean} [isDeep] Specify a deep clone.
2996
+ * @returns {Object} Returns the initialized clone.
2997
+ */
2998
+ function initCloneByTag(object, tag, isDeep) {
2999
+ var Ctor = object.constructor;
3000
+ switch (tag) {
3001
+ case arrayBufferTag$1:
3002
+ return _cloneArrayBuffer(object);
3003
+
3004
+ case boolTag$1:
3005
+ case dateTag$1:
3006
+ return new Ctor(+object);
3007
+
3008
+ case dataViewTag$1:
3009
+ return _cloneDataView(object, isDeep);
3010
+
3011
+ case float32Tag$1: case float64Tag$1:
3012
+ case int8Tag$1: case int16Tag$1: case int32Tag$1:
3013
+ case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
3014
+ return _cloneTypedArray(object, isDeep);
3015
+
3016
+ case mapTag$2:
3017
+ return new Ctor;
3018
+
3019
+ case numberTag$1:
3020
+ case stringTag$1:
3021
+ return new Ctor(object);
3022
+
3023
+ case regexpTag$1:
3024
+ return _cloneRegExp(object);
3025
+
3026
+ case setTag$2:
3027
+ return new Ctor;
3028
+
3029
+ case symbolTag$2:
3030
+ return _cloneSymbol(object);
3031
+ }
3032
+ }
3033
+
3034
+ var _initCloneByTag = initCloneByTag;
3035
+
3036
+ /** Built-in value references. */
3037
+ var objectCreate = Object.create;
3038
+
3039
+ /**
3040
+ * The base implementation of `_.create` without support for assigning
3041
+ * properties to the created object.
3042
+ *
3043
+ * @private
3044
+ * @param {Object} proto The object to inherit from.
3045
+ * @returns {Object} Returns the new object.
3046
+ */
3047
+ var baseCreate = (function() {
3048
+ function object() {}
3049
+ return function(proto) {
3050
+ if (!isObject_1(proto)) {
3051
+ return {};
3052
+ }
3053
+ if (objectCreate) {
3054
+ return objectCreate(proto);
3055
+ }
3056
+ object.prototype = proto;
3057
+ var result = new object;
3058
+ object.prototype = undefined;
3059
+ return result;
3060
+ };
3061
+ }());
3062
+
3063
+ var _baseCreate = baseCreate;
3064
+
3065
+ /**
3066
+ * Initializes an object clone.
3067
+ *
3068
+ * @private
3069
+ * @param {Object} object The object to clone.
3070
+ * @returns {Object} Returns the initialized clone.
3071
+ */
3072
+ function initCloneObject(object) {
3073
+ return (typeof object.constructor == 'function' && !_isPrototype(object))
3074
+ ? _baseCreate(_getPrototype(object))
3075
+ : {};
3076
+ }
3077
+
3078
+ var _initCloneObject = initCloneObject;
3079
+
3080
+ /** `Object#toString` result references. */
3081
+ var mapTag$1 = '[object Map]';
3082
+
3083
+ /**
3084
+ * The base implementation of `_.isMap` without Node.js optimizations.
3085
+ *
3086
+ * @private
3087
+ * @param {*} value The value to check.
3088
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
3089
+ */
3090
+ function baseIsMap(value) {
3091
+ return isObjectLike_1(value) && _getTag(value) == mapTag$1;
3092
+ }
3093
+
3094
+ var _baseIsMap = baseIsMap;
3095
+
3096
+ /* Node.js helper references. */
3097
+ var nodeIsMap = _nodeUtil && _nodeUtil.isMap;
3098
+
3099
+ /**
3100
+ * Checks if `value` is classified as a `Map` object.
3101
+ *
3102
+ * @static
3103
+ * @memberOf _
3104
+ * @since 4.3.0
3105
+ * @category Lang
3106
+ * @param {*} value The value to check.
3107
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
3108
+ * @example
3109
+ *
3110
+ * _.isMap(new Map);
3111
+ * // => true
3112
+ *
3113
+ * _.isMap(new WeakMap);
3114
+ * // => false
3115
+ */
3116
+ var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap;
3117
+
3118
+ var isMap_1 = isMap;
3119
+
3120
+ /** `Object#toString` result references. */
3121
+ var setTag$1 = '[object Set]';
3122
+
3123
+ /**
3124
+ * The base implementation of `_.isSet` without Node.js optimizations.
3125
+ *
3126
+ * @private
3127
+ * @param {*} value The value to check.
3128
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
3129
+ */
3130
+ function baseIsSet(value) {
3131
+ return isObjectLike_1(value) && _getTag(value) == setTag$1;
3132
+ }
3133
+
3134
+ var _baseIsSet = baseIsSet;
3135
+
3136
+ /* Node.js helper references. */
3137
+ var nodeIsSet = _nodeUtil && _nodeUtil.isSet;
3138
+
3139
+ /**
3140
+ * Checks if `value` is classified as a `Set` object.
3141
+ *
3142
+ * @static
3143
+ * @memberOf _
3144
+ * @since 4.3.0
3145
+ * @category Lang
3146
+ * @param {*} value The value to check.
3147
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
3148
+ * @example
3149
+ *
3150
+ * _.isSet(new Set);
3151
+ * // => true
3152
+ *
3153
+ * _.isSet(new WeakSet);
3154
+ * // => false
3155
+ */
3156
+ var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet;
3157
+
3158
+ var isSet_1 = isSet;
3159
+
3160
+ /** Used to compose bitmasks for cloning. */
3161
+ var CLONE_DEEP_FLAG$1 = 1,
3162
+ CLONE_FLAT_FLAG$1 = 2,
3163
+ CLONE_SYMBOLS_FLAG$1 = 4;
3164
+
3165
+ /** `Object#toString` result references. */
3166
+ var argsTag = '[object Arguments]',
3167
+ arrayTag = '[object Array]',
3168
+ boolTag = '[object Boolean]',
3169
+ dateTag = '[object Date]',
3170
+ errorTag = '[object Error]',
3171
+ funcTag = '[object Function]',
3172
+ genTag = '[object GeneratorFunction]',
3173
+ mapTag = '[object Map]',
3174
+ numberTag = '[object Number]',
3175
+ objectTag$1 = '[object Object]',
3176
+ regexpTag = '[object RegExp]',
3177
+ setTag = '[object Set]',
3178
+ stringTag = '[object String]',
3179
+ symbolTag$1 = '[object Symbol]',
3180
+ weakMapTag = '[object WeakMap]';
3181
+
3182
+ var arrayBufferTag = '[object ArrayBuffer]',
3183
+ dataViewTag = '[object DataView]',
3184
+ float32Tag = '[object Float32Array]',
3185
+ float64Tag = '[object Float64Array]',
3186
+ int8Tag = '[object Int8Array]',
3187
+ int16Tag = '[object Int16Array]',
3188
+ int32Tag = '[object Int32Array]',
3189
+ uint8Tag = '[object Uint8Array]',
3190
+ uint8ClampedTag = '[object Uint8ClampedArray]',
3191
+ uint16Tag = '[object Uint16Array]',
3192
+ uint32Tag = '[object Uint32Array]';
3193
+
3194
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
3195
+ var cloneableTags = {};
3196
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
3197
+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
3198
+ cloneableTags[boolTag] = cloneableTags[dateTag] =
3199
+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =
3200
+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =
3201
+ cloneableTags[int32Tag] = cloneableTags[mapTag] =
3202
+ cloneableTags[numberTag] = cloneableTags[objectTag$1] =
3203
+ cloneableTags[regexpTag] = cloneableTags[setTag] =
3204
+ cloneableTags[stringTag] = cloneableTags[symbolTag$1] =
3205
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
3206
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
3207
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
3208
+ cloneableTags[weakMapTag] = false;
3209
+
3210
+ /**
3211
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
3212
+ * traversed objects.
3213
+ *
3214
+ * @private
3215
+ * @param {*} value The value to clone.
3216
+ * @param {boolean} bitmask The bitmask flags.
3217
+ * 1 - Deep clone
3218
+ * 2 - Flatten inherited properties
3219
+ * 4 - Clone symbols
3220
+ * @param {Function} [customizer] The function to customize cloning.
3221
+ * @param {string} [key] The key of `value`.
3222
+ * @param {Object} [object] The parent object of `value`.
3223
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
3224
+ * @returns {*} Returns the cloned value.
3225
+ */
3226
+ function baseClone(value, bitmask, customizer, key, object, stack) {
3227
+ var result,
3228
+ isDeep = bitmask & CLONE_DEEP_FLAG$1,
3229
+ isFlat = bitmask & CLONE_FLAT_FLAG$1,
3230
+ isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
3231
+
3232
+ if (customizer) {
3233
+ result = object ? customizer(value, key, object, stack) : customizer(value);
3234
+ }
3235
+ if (result !== undefined) {
3236
+ return result;
3237
+ }
3238
+ if (!isObject_1(value)) {
3239
+ return value;
3240
+ }
3241
+ var isArr = isArray_1(value);
3242
+ if (isArr) {
3243
+ result = _initCloneArray(value);
3244
+ if (!isDeep) {
3245
+ return _copyArray(value, result);
3246
+ }
3247
+ } else {
3248
+ var tag = _getTag(value),
3249
+ isFunc = tag == funcTag || tag == genTag;
3250
+
3251
+ if (isBuffer_1(value)) {
3252
+ return _cloneBuffer(value, isDeep);
3253
+ }
3254
+ if (tag == objectTag$1 || tag == argsTag || (isFunc && !object)) {
3255
+ result = (isFlat || isFunc) ? {} : _initCloneObject(value);
3256
+ if (!isDeep) {
3257
+ return isFlat
3258
+ ? _copySymbolsIn(value, _baseAssignIn(result, value))
3259
+ : _copySymbols(value, _baseAssign(result, value));
3260
+ }
3261
+ } else {
3262
+ if (!cloneableTags[tag]) {
3263
+ return object ? value : {};
3264
+ }
3265
+ result = _initCloneByTag(value, tag, isDeep);
3266
+ }
3267
+ }
3268
+ // Check for circular references and return its corresponding clone.
3269
+ stack || (stack = new _Stack);
3270
+ var stacked = stack.get(value);
3271
+ if (stacked) {
3272
+ return stacked;
3273
+ }
3274
+ stack.set(value, result);
3275
+
3276
+ if (isSet_1(value)) {
3277
+ value.forEach(function(subValue) {
3278
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
3279
+ });
3280
+ } else if (isMap_1(value)) {
3281
+ value.forEach(function(subValue, key) {
3282
+ result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
3283
+ });
3284
+ }
3285
+
3286
+ var keysFunc = isFull
3287
+ ? (isFlat ? _getAllKeysIn : _getAllKeys)
3288
+ : (isFlat ? keysIn_1 : keys_1);
3289
+
3290
+ var props = isArr ? undefined : keysFunc(value);
3291
+ _arrayEach(props || value, function(subValue, key) {
3292
+ if (props) {
3293
+ key = subValue;
3294
+ subValue = value[key];
3295
+ }
3296
+ // Recursively populate clone (susceptible to call stack limits).
3297
+ _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
3298
+ });
3299
+ return result;
3300
+ }
3301
+
3302
+ var _baseClone = baseClone;
3303
+
3304
+ /** `Object#toString` result references. */
3305
+ var symbolTag = '[object Symbol]';
3306
+
3307
+ /**
3308
+ * Checks if `value` is classified as a `Symbol` primitive or object.
3309
+ *
3310
+ * @static
3311
+ * @memberOf _
3312
+ * @since 4.0.0
3313
+ * @category Lang
3314
+ * @param {*} value The value to check.
3315
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
3316
+ * @example
3317
+ *
3318
+ * _.isSymbol(Symbol.iterator);
3319
+ * // => true
3320
+ *
3321
+ * _.isSymbol('abc');
3322
+ * // => false
3323
+ */
3324
+ function isSymbol(value) {
3325
+ return typeof value == 'symbol' ||
3326
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
3327
+ }
3328
+
3329
+ var isSymbol_1 = isSymbol;
3330
+
3331
+ /** Used to match property names within property paths. */
3332
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
3333
+ reIsPlainProp = /^\w*$/;
3334
+
3335
+ /**
3336
+ * Checks if `value` is a property name and not a property path.
3337
+ *
3338
+ * @private
3339
+ * @param {*} value The value to check.
3340
+ * @param {Object} [object] The object to query keys on.
3341
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
3342
+ */
3343
+ function isKey(value, object) {
3344
+ if (isArray_1(value)) {
3345
+ return false;
3346
+ }
3347
+ var type = typeof value;
3348
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
3349
+ value == null || isSymbol_1(value)) {
3350
+ return true;
3351
+ }
3352
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
3353
+ (object != null && value in Object(object));
3354
+ }
3355
+
3356
+ var _isKey = isKey;
3357
+
3358
+ /** Error message constants. */
3359
+ var FUNC_ERROR_TEXT = 'Expected a function';
3360
+
3361
+ /**
3362
+ * Creates a function that memoizes the result of `func`. If `resolver` is
3363
+ * provided, it determines the cache key for storing the result based on the
3364
+ * arguments provided to the memoized function. By default, the first argument
3365
+ * provided to the memoized function is used as the map cache key. The `func`
3366
+ * is invoked with the `this` binding of the memoized function.
3367
+ *
3368
+ * **Note:** The cache is exposed as the `cache` property on the memoized
3369
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
3370
+ * constructor with one whose instances implement the
3371
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
3372
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
3373
+ *
3374
+ * @static
3375
+ * @memberOf _
3376
+ * @since 0.1.0
3377
+ * @category Function
3378
+ * @param {Function} func The function to have its output memoized.
3379
+ * @param {Function} [resolver] The function to resolve the cache key.
3380
+ * @returns {Function} Returns the new memoized function.
3381
+ * @example
3382
+ *
3383
+ * var object = { 'a': 1, 'b': 2 };
3384
+ * var other = { 'c': 3, 'd': 4 };
3385
+ *
3386
+ * var values = _.memoize(_.values);
3387
+ * values(object);
3388
+ * // => [1, 2]
3389
+ *
3390
+ * values(other);
3391
+ * // => [3, 4]
3392
+ *
3393
+ * object.a = 2;
3394
+ * values(object);
3395
+ * // => [1, 2]
3396
+ *
3397
+ * // Modify the result cache.
3398
+ * values.cache.set(object, ['a', 'b']);
3399
+ * values(object);
3400
+ * // => ['a', 'b']
3401
+ *
3402
+ * // Replace `_.memoize.Cache`.
3403
+ * _.memoize.Cache = WeakMap;
3404
+ */
3405
+ function memoize(func, resolver) {
3406
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
3407
+ throw new TypeError(FUNC_ERROR_TEXT);
3408
+ }
3409
+ var memoized = function() {
3410
+ var args = arguments,
3411
+ key = resolver ? resolver.apply(this, args) : args[0],
3412
+ cache = memoized.cache;
3413
+
3414
+ if (cache.has(key)) {
3415
+ return cache.get(key);
3416
+ }
3417
+ var result = func.apply(this, args);
3418
+ memoized.cache = cache.set(key, result) || cache;
3419
+ return result;
3420
+ };
3421
+ memoized.cache = new (memoize.Cache || _MapCache);
3422
+ return memoized;
3423
+ }
3424
+
3425
+ // Expose `MapCache`.
3426
+ memoize.Cache = _MapCache;
3427
+
3428
+ var memoize_1 = memoize;
3429
+
3430
+ /** Used as the maximum memoize cache size. */
3431
+ var MAX_MEMOIZE_SIZE = 500;
3432
+
3433
+ /**
3434
+ * A specialized version of `_.memoize` which clears the memoized function's
3435
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
3436
+ *
3437
+ * @private
3438
+ * @param {Function} func The function to have its output memoized.
3439
+ * @returns {Function} Returns the new memoized function.
3440
+ */
3441
+ function memoizeCapped(func) {
3442
+ var result = memoize_1(func, function(key) {
3443
+ if (cache.size === MAX_MEMOIZE_SIZE) {
3444
+ cache.clear();
3445
+ }
3446
+ return key;
3447
+ });
3448
+
3449
+ var cache = result.cache;
3450
+ return result;
3451
+ }
3452
+
3453
+ var _memoizeCapped = memoizeCapped;
3454
+
3455
+ /** Used to match property names within property paths. */
3456
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
3457
+
3458
+ /** Used to match backslashes in property paths. */
3459
+ var reEscapeChar = /\\(\\)?/g;
3460
+
3461
+ /**
3462
+ * Converts `string` to a property path array.
3463
+ *
3464
+ * @private
3465
+ * @param {string} string The string to convert.
3466
+ * @returns {Array} Returns the property path array.
3467
+ */
3468
+ var stringToPath = _memoizeCapped(function(string) {
3469
+ var result = [];
3470
+ if (string.charCodeAt(0) === 46 /* . */) {
3471
+ result.push('');
3472
+ }
3473
+ string.replace(rePropName, function(match, number, quote, subString) {
3474
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
3475
+ });
3476
+ return result;
3477
+ });
3478
+
3479
+ var _stringToPath = stringToPath;
3480
+
3481
+ /** Used as references for various `Number` constants. */
3482
+ var INFINITY$1 = 1 / 0;
3483
+
3484
+ /** Used to convert symbols to primitives and strings. */
3485
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
3486
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
3487
+
3488
+ /**
3489
+ * The base implementation of `_.toString` which doesn't convert nullish
3490
+ * values to empty strings.
3491
+ *
3492
+ * @private
3493
+ * @param {*} value The value to process.
3494
+ * @returns {string} Returns the string.
3495
+ */
3496
+ function baseToString(value) {
3497
+ // Exit early for strings to avoid a performance hit in some environments.
3498
+ if (typeof value == 'string') {
3499
+ return value;
3500
+ }
3501
+ if (isArray_1(value)) {
3502
+ // Recursively convert values (susceptible to call stack limits).
3503
+ return _arrayMap(value, baseToString) + '';
3504
+ }
3505
+ if (isSymbol_1(value)) {
3506
+ return symbolToString ? symbolToString.call(value) : '';
3507
+ }
3508
+ var result = (value + '');
3509
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
3510
+ }
3511
+
3512
+ var _baseToString = baseToString;
3513
+
3514
+ /**
3515
+ * Converts `value` to a string. An empty string is returned for `null`
3516
+ * and `undefined` values. The sign of `-0` is preserved.
3517
+ *
3518
+ * @static
3519
+ * @memberOf _
3520
+ * @since 4.0.0
3521
+ * @category Lang
3522
+ * @param {*} value The value to convert.
3523
+ * @returns {string} Returns the converted string.
3524
+ * @example
3525
+ *
3526
+ * _.toString(null);
3527
+ * // => ''
3528
+ *
3529
+ * _.toString(-0);
3530
+ * // => '-0'
3531
+ *
3532
+ * _.toString([1, 2, 3]);
3533
+ * // => '1,2,3'
3534
+ */
3535
+ function toString(value) {
3536
+ return value == null ? '' : _baseToString(value);
3537
+ }
3538
+
3539
+ var toString_1 = toString;
3540
+
3541
+ /**
3542
+ * Casts `value` to a path array if it's not one.
3543
+ *
3544
+ * @private
3545
+ * @param {*} value The value to inspect.
3546
+ * @param {Object} [object] The object to query keys on.
3547
+ * @returns {Array} Returns the cast property path array.
3548
+ */
3549
+ function castPath(value, object) {
3550
+ if (isArray_1(value)) {
3551
+ return value;
3552
+ }
3553
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
3554
+ }
3555
+
3556
+ var _castPath = castPath;
3557
+
3558
+ /**
3559
+ * Gets the last element of `array`.
3560
+ *
3561
+ * @static
3562
+ * @memberOf _
3563
+ * @since 0.1.0
3564
+ * @category Array
3565
+ * @param {Array} array The array to query.
3566
+ * @returns {*} Returns the last element of `array`.
3567
+ * @example
3568
+ *
3569
+ * _.last([1, 2, 3]);
3570
+ * // => 3
3571
+ */
3572
+ function last(array) {
3573
+ var length = array == null ? 0 : array.length;
3574
+ return length ? array[length - 1] : undefined;
3575
+ }
3576
+
3577
+ var last_1 = last;
3578
+
3579
+ /** Used as references for various `Number` constants. */
3580
+ var INFINITY = 1 / 0;
3581
+
3582
+ /**
3583
+ * Converts `value` to a string key if it's not a string or symbol.
3584
+ *
3585
+ * @private
3586
+ * @param {*} value The value to inspect.
3587
+ * @returns {string|symbol} Returns the key.
3588
+ */
3589
+ function toKey(value) {
3590
+ if (typeof value == 'string' || isSymbol_1(value)) {
3591
+ return value;
3592
+ }
3593
+ var result = (value + '');
3594
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
3595
+ }
3596
+
3597
+ var _toKey = toKey;
3598
+
3599
+ /**
3600
+ * The base implementation of `_.get` without support for default values.
3601
+ *
3602
+ * @private
3603
+ * @param {Object} object The object to query.
3604
+ * @param {Array|string} path The path of the property to get.
3605
+ * @returns {*} Returns the resolved value.
3606
+ */
3607
+ function baseGet(object, path) {
3608
+ path = _castPath(path, object);
3609
+
3610
+ var index = 0,
3611
+ length = path.length;
3612
+
3613
+ while (object != null && index < length) {
3614
+ object = object[_toKey(path[index++])];
3615
+ }
3616
+ return (index && index == length) ? object : undefined;
3617
+ }
3618
+
3619
+ var _baseGet = baseGet;
3620
+
3621
+ /**
3622
+ * The base implementation of `_.slice` without an iteratee call guard.
3623
+ *
3624
+ * @private
3625
+ * @param {Array} array The array to slice.
3626
+ * @param {number} [start=0] The start position.
3627
+ * @param {number} [end=array.length] The end position.
3628
+ * @returns {Array} Returns the slice of `array`.
3629
+ */
3630
+ function baseSlice(array, start, end) {
3631
+ var index = -1,
3632
+ length = array.length;
3633
+
3634
+ if (start < 0) {
3635
+ start = -start > length ? 0 : (length + start);
3636
+ }
3637
+ end = end > length ? length : end;
3638
+ if (end < 0) {
3639
+ end += length;
3640
+ }
3641
+ length = start > end ? 0 : ((end - start) >>> 0);
3642
+ start >>>= 0;
3643
+
3644
+ var result = Array(length);
3645
+ while (++index < length) {
3646
+ result[index] = array[index + start];
3647
+ }
3648
+ return result;
3649
+ }
3650
+
3651
+ var _baseSlice = baseSlice;
3652
+
3653
+ /**
3654
+ * Gets the parent value at `path` of `object`.
3655
+ *
3656
+ * @private
3657
+ * @param {Object} object The object to query.
3658
+ * @param {Array} path The path to get the parent value of.
3659
+ * @returns {*} Returns the parent value.
3660
+ */
3661
+ function parent(object, path) {
3662
+ return path.length < 2 ? object : _baseGet(object, _baseSlice(path, 0, -1));
3663
+ }
3664
+
3665
+ var _parent = parent;
3666
+
3667
+ /**
3668
+ * The base implementation of `_.unset`.
3669
+ *
3670
+ * @private
3671
+ * @param {Object} object The object to modify.
3672
+ * @param {Array|string} path The property path to unset.
3673
+ * @returns {boolean} Returns `true` if the property is deleted, else `false`.
3674
+ */
3675
+ function baseUnset(object, path) {
3676
+ path = _castPath(path, object);
3677
+ object = _parent(object, path);
3678
+ return object == null || delete object[_toKey(last_1(path))];
3679
+ }
3680
+
3681
+ var _baseUnset = baseUnset;
3682
+
3683
+ /** `Object#toString` result references. */
3684
+ var objectTag = '[object Object]';
3685
+
3686
+ /** Used for built-in method references. */
3687
+ var funcProto = Function.prototype,
3688
+ objectProto = Object.prototype;
3689
+
3690
+ /** Used to resolve the decompiled source of functions. */
3691
+ var funcToString = funcProto.toString;
3692
+
3693
+ /** Used to check objects for own properties. */
3694
+ var hasOwnProperty = objectProto.hasOwnProperty;
3695
+
3696
+ /** Used to infer the `Object` constructor. */
3697
+ var objectCtorString = funcToString.call(Object);
3698
+
3699
+ /**
3700
+ * Checks if `value` is a plain object, that is, an object created by the
3701
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
3702
+ *
3703
+ * @static
3704
+ * @memberOf _
3705
+ * @since 0.8.0
3706
+ * @category Lang
3707
+ * @param {*} value The value to check.
3708
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
3709
+ * @example
3710
+ *
3711
+ * function Foo() {
3712
+ * this.a = 1;
3713
+ * }
3714
+ *
3715
+ * _.isPlainObject(new Foo);
3716
+ * // => false
3717
+ *
3718
+ * _.isPlainObject([1, 2, 3]);
3719
+ * // => false
3720
+ *
3721
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
3722
+ * // => true
3723
+ *
3724
+ * _.isPlainObject(Object.create(null));
3725
+ * // => true
3726
+ */
3727
+ function isPlainObject(value) {
3728
+ if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) {
3729
+ return false;
3730
+ }
3731
+ var proto = _getPrototype(value);
3732
+ if (proto === null) {
3733
+ return true;
3734
+ }
3735
+ var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
3736
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
3737
+ funcToString.call(Ctor) == objectCtorString;
3738
+ }
3739
+
3740
+ var isPlainObject_1 = isPlainObject;
3741
+
3742
+ /**
3743
+ * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
3744
+ * objects.
3745
+ *
3746
+ * @private
3747
+ * @param {*} value The value to inspect.
3748
+ * @param {string} key The key of the property to inspect.
3749
+ * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
3750
+ */
3751
+ function customOmitClone(value) {
3752
+ return isPlainObject_1(value) ? undefined : value;
3753
+ }
3754
+
3755
+ var _customOmitClone = customOmitClone;
3756
+
3757
+ /** Built-in value references. */
3758
+ var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
3759
+
3760
+ /**
3761
+ * Checks if `value` is a flattenable `arguments` object or array.
3762
+ *
3763
+ * @private
3764
+ * @param {*} value The value to check.
3765
+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
3766
+ */
3767
+ function isFlattenable(value) {
3768
+ return isArray_1(value) || isArguments_1(value) ||
3769
+ !!(spreadableSymbol && value && value[spreadableSymbol]);
3770
+ }
3771
+
3772
+ var _isFlattenable = isFlattenable;
3773
+
3774
+ /**
3775
+ * The base implementation of `_.flatten` with support for restricting flattening.
3776
+ *
3777
+ * @private
3778
+ * @param {Array} array The array to flatten.
3779
+ * @param {number} depth The maximum recursion depth.
3780
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
3781
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
3782
+ * @param {Array} [result=[]] The initial result value.
3783
+ * @returns {Array} Returns the new flattened array.
3784
+ */
3785
+ function baseFlatten(array, depth, predicate, isStrict, result) {
3786
+ var index = -1,
3787
+ length = array.length;
3788
+
3789
+ predicate || (predicate = _isFlattenable);
3790
+ result || (result = []);
3791
+
3792
+ while (++index < length) {
3793
+ var value = array[index];
3794
+ if (depth > 0 && predicate(value)) {
3795
+ if (depth > 1) {
3796
+ // Recursively flatten arrays (susceptible to call stack limits).
3797
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
3798
+ } else {
3799
+ _arrayPush(result, value);
3800
+ }
3801
+ } else if (!isStrict) {
3802
+ result[result.length] = value;
3803
+ }
3804
+ }
3805
+ return result;
3806
+ }
3807
+
3808
+ var _baseFlatten = baseFlatten;
3809
+
3810
+ /**
3811
+ * Flattens `array` a single level deep.
3812
+ *
3813
+ * @static
3814
+ * @memberOf _
3815
+ * @since 0.1.0
3816
+ * @category Array
3817
+ * @param {Array} array The array to flatten.
3818
+ * @returns {Array} Returns the new flattened array.
3819
+ * @example
3820
+ *
3821
+ * _.flatten([1, [2, [3, [4]], 5]]);
3822
+ * // => [1, 2, [3, [4]], 5]
3823
+ */
3824
+ function flatten(array) {
3825
+ var length = array == null ? 0 : array.length;
3826
+ return length ? _baseFlatten(array, 1) : [];
3827
+ }
3828
+
3829
+ var flatten_1 = flatten;
3830
+
3831
+ /**
3832
+ * A faster alternative to `Function#apply`, this function invokes `func`
3833
+ * with the `this` binding of `thisArg` and the arguments of `args`.
3834
+ *
3835
+ * @private
3836
+ * @param {Function} func The function to invoke.
3837
+ * @param {*} thisArg The `this` binding of `func`.
3838
+ * @param {Array} args The arguments to invoke `func` with.
3839
+ * @returns {*} Returns the result of `func`.
3840
+ */
3841
+ function apply(func, thisArg, args) {
3842
+ switch (args.length) {
3843
+ case 0: return func.call(thisArg);
3844
+ case 1: return func.call(thisArg, args[0]);
3845
+ case 2: return func.call(thisArg, args[0], args[1]);
3846
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
3847
+ }
3848
+ return func.apply(thisArg, args);
3849
+ }
3850
+
3851
+ var _apply = apply;
3852
+
3853
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3854
+ var nativeMax = Math.max;
3855
+
3856
+ /**
3857
+ * A specialized version of `baseRest` which transforms the rest array.
3858
+ *
3859
+ * @private
3860
+ * @param {Function} func The function to apply a rest parameter to.
3861
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
3862
+ * @param {Function} transform The rest array transform.
3863
+ * @returns {Function} Returns the new function.
3864
+ */
3865
+ function overRest(func, start, transform) {
3866
+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
3867
+ return function() {
3868
+ var args = arguments,
3869
+ index = -1,
3870
+ length = nativeMax(args.length - start, 0),
3871
+ array = Array(length);
3872
+
3873
+ while (++index < length) {
3874
+ array[index] = args[start + index];
3875
+ }
3876
+ index = -1;
3877
+ var otherArgs = Array(start + 1);
3878
+ while (++index < start) {
3879
+ otherArgs[index] = args[index];
3880
+ }
3881
+ otherArgs[start] = transform(array);
3882
+ return _apply(func, this, otherArgs);
3883
+ };
3884
+ }
3885
+
3886
+ var _overRest = overRest;
3887
+
3888
+ /**
3889
+ * Creates a function that returns `value`.
3890
+ *
3891
+ * @static
3892
+ * @memberOf _
3893
+ * @since 2.4.0
3894
+ * @category Util
3895
+ * @param {*} value The value to return from the new function.
3896
+ * @returns {Function} Returns the new constant function.
3897
+ * @example
3898
+ *
3899
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
3900
+ *
3901
+ * console.log(objects);
3902
+ * // => [{ 'a': 1 }, { 'a': 1 }]
3903
+ *
3904
+ * console.log(objects[0] === objects[1]);
3905
+ * // => true
3906
+ */
3907
+ function constant(value) {
3908
+ return function() {
3909
+ return value;
3910
+ };
3911
+ }
3912
+
3913
+ var constant_1 = constant;
3914
+
3915
+ /**
3916
+ * This method returns the first argument it receives.
3917
+ *
3918
+ * @static
3919
+ * @since 0.1.0
3920
+ * @memberOf _
3921
+ * @category Util
3922
+ * @param {*} value Any value.
3923
+ * @returns {*} Returns `value`.
3924
+ * @example
3925
+ *
3926
+ * var object = { 'a': 1 };
3927
+ *
3928
+ * console.log(_.identity(object) === object);
3929
+ * // => true
3930
+ */
3931
+ function identity(value) {
3932
+ return value;
3933
+ }
3934
+
3935
+ var identity_1 = identity;
3936
+
3937
+ /**
3938
+ * The base implementation of `setToString` without support for hot loop shorting.
3939
+ *
3940
+ * @private
3941
+ * @param {Function} func The function to modify.
3942
+ * @param {Function} string The `toString` result.
3943
+ * @returns {Function} Returns `func`.
3944
+ */
3945
+ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
3946
+ return _defineProperty(func, 'toString', {
3947
+ 'configurable': true,
3948
+ 'enumerable': false,
3949
+ 'value': constant_1(string),
3950
+ 'writable': true
3951
+ });
3952
+ };
3953
+
3954
+ var _baseSetToString = baseSetToString;
3955
+
3956
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */
3957
+ var HOT_COUNT = 800,
3958
+ HOT_SPAN = 16;
3959
+
3960
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3961
+ var nativeNow = Date.now;
3962
+
3963
+ /**
3964
+ * Creates a function that'll short out and invoke `identity` instead
3965
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
3966
+ * milliseconds.
3967
+ *
3968
+ * @private
3969
+ * @param {Function} func The function to restrict.
3970
+ * @returns {Function} Returns the new shortable function.
3971
+ */
3972
+ function shortOut(func) {
3973
+ var count = 0,
3974
+ lastCalled = 0;
3975
+
3976
+ return function() {
3977
+ var stamp = nativeNow(),
3978
+ remaining = HOT_SPAN - (stamp - lastCalled);
3979
+
3980
+ lastCalled = stamp;
3981
+ if (remaining > 0) {
3982
+ if (++count >= HOT_COUNT) {
3983
+ return arguments[0];
3984
+ }
3985
+ } else {
3986
+ count = 0;
3987
+ }
3988
+ return func.apply(undefined, arguments);
3989
+ };
3990
+ }
3991
+
3992
+ var _shortOut = shortOut;
3993
+
3994
+ /**
3995
+ * Sets the `toString` method of `func` to return `string`.
3996
+ *
3997
+ * @private
3998
+ * @param {Function} func The function to modify.
3999
+ * @param {Function} string The `toString` result.
4000
+ * @returns {Function} Returns `func`.
4001
+ */
4002
+ var setToString = _shortOut(_baseSetToString);
4003
+
4004
+ var _setToString = setToString;
4005
+
4006
+ /**
4007
+ * A specialized version of `baseRest` which flattens the rest array.
4008
+ *
4009
+ * @private
4010
+ * @param {Function} func The function to apply a rest parameter to.
4011
+ * @returns {Function} Returns the new function.
4012
+ */
4013
+ function flatRest(func) {
4014
+ return _setToString(_overRest(func, undefined, flatten_1), func + '');
4015
+ }
4016
+
4017
+ var _flatRest = flatRest;
4018
+
4019
+ /** Used to compose bitmasks for cloning. */
4020
+ var CLONE_DEEP_FLAG = 1,
4021
+ CLONE_FLAT_FLAG = 2,
4022
+ CLONE_SYMBOLS_FLAG = 4;
4023
+
4024
+ /**
4025
+ * The opposite of `_.pick`; this method creates an object composed of the
4026
+ * own and inherited enumerable property paths of `object` that are not omitted.
4027
+ *
4028
+ * **Note:** This method is considerably slower than `_.pick`.
4029
+ *
4030
+ * @static
4031
+ * @since 0.1.0
4032
+ * @memberOf _
4033
+ * @category Object
4034
+ * @param {Object} object The source object.
4035
+ * @param {...(string|string[])} [paths] The property paths to omit.
4036
+ * @returns {Object} Returns the new object.
4037
+ * @example
4038
+ *
4039
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
4040
+ *
4041
+ * _.omit(object, ['a', 'c']);
4042
+ * // => { 'b': '2' }
4043
+ */
4044
+ var omit = _flatRest(function(object, paths) {
4045
+ var result = {};
4046
+ if (object == null) {
4047
+ return result;
4048
+ }
4049
+ var isDeep = false;
4050
+ paths = _arrayMap(paths, function(path) {
4051
+ path = _castPath(path, object);
4052
+ isDeep || (isDeep = path.length > 1);
4053
+ return path;
4054
+ });
4055
+ _copyObject(object, _getAllKeysIn(object), result);
4056
+ if (isDeep) {
4057
+ result = _baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, _customOmitClone);
4058
+ }
4059
+ var length = paths.length;
4060
+ while (length--) {
4061
+ _baseUnset(result, paths[length]);
4062
+ }
4063
+ return result;
4064
+ });
4065
+
4066
+ var omit_1 = omit;
4067
+
4068
+ const _excluded$1 = ["placeholder", "url", "width", "height", "padding", "filename", "defaultSignatureList", "onSign", "onChange", "isEdit"];
4069
+ const PDFSignMultiInner = /*#__PURE__*/react.forwardRef((_ref, ref) => {
4070
+ let {
4071
+ size,
4072
+ currentPage,
4073
+ placeholder,
4074
+ url,
4075
+ width = 200,
4076
+ height = 80,
4077
+ padding,
4078
+ filename = 'signed-document.pdf',
4079
+ signatureList,
4080
+ setSignatureList,
4081
+ isEdit,
4082
+ onSign,
4083
+ onChange
4084
+ } = _ref;
4085
+ const {
4086
+ formatMessage
4087
+ } = reactIntl.useIntl();
4088
+ const pdfSignatureList = react.useMemo(() => {
4089
+ return signatureList.filter(location => location.signature).map(location => {
4090
+ return Object.assign({}, computedPDFSignLocation({
4091
+ location,
4092
+ size
4093
+ }), {
4094
+ page: location.page,
4095
+ signature: location.signature
4096
+ });
4097
+ });
4098
+ }, [signatureList, size]);
4099
+ react.useEffect(() => {
4100
+ onChange && onChange(signatureList);
4101
+ }, [signatureList]);
4102
+ react.useImperativeHandle(ref, () => ({
4103
+ getSignatureList: () => {
4104
+ return signatureList.map(item => {
4105
+ return omit_1(item, ['signature']);
4106
+ });
4107
+ },
4108
+ setSignatureList: value => setSignatureList(value),
4109
+ getPdfSignatureList: () => {
4110
+ return pdfSignatureList;
4111
+ },
4112
+ sign: () => {
4113
+ if (!pdfSignatureList.length) {
4114
+ return Promise.reject(new Error(formatMessage({
4115
+ id: 'signatureAdd'
4116
+ })));
4117
+ }
4118
+ return signMultiPdfFile({
4119
+ url,
4120
+ filename,
4121
+ signatureList: pdfSignatureList
4122
+ });
4123
+ },
4124
+ addSignLocation: page => {
4125
+ setSignatureList(signatureList => {
4126
+ return [...signatureList, Object.assign({}, getInitLocation({
4127
+ width,
4128
+ height,
4129
+ stageWidth: size.originalWidth,
4130
+ stageHeight: size.originalHeight
4131
+ }), {
4132
+ page: page || currentPage
4133
+ })];
4134
+ });
4135
+ }
4136
+ }));
4137
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
4138
+ style: {
4139
+ transform: "scale(" + size.width / size.originalWidth + ")",
4140
+ transformOrigin: '0 0'
4141
+ },
4142
+ children: /*#__PURE__*/jsxRuntime.jsx(LocationGroup, {
4143
+ isEdit: isEdit,
4144
+ currentPage: currentPage,
4145
+ stageWidth: size.originalWidth,
4146
+ stageHeight: size.originalHeight,
4147
+ width: width,
4148
+ height: height,
4149
+ padding: padding,
4150
+ placeholder: placeholder,
4151
+ value: signatureList,
4152
+ onChange: setSignatureList,
4153
+ onClick: _ref2 => {
4154
+ let {
4155
+ index,
4156
+ value
4157
+ } = _ref2;
4158
+ onSign && onSign({
4159
+ size: value.size,
4160
+ callback: signature => {
4161
+ setSignatureList(value => {
4162
+ const newValue = value.slice(0);
4163
+ newValue[index] = Object.assign({}, newValue[index], {
4164
+ signature
4165
+ });
4166
+ return newValue;
4167
+ });
4168
+ }
4169
+ });
4170
+ }
4171
+ })
4172
+ });
4173
+ });
4174
+ const PDFSignMulti = withLocale(/*#__PURE__*/react.forwardRef((_ref3, ref) => {
4175
+ let {
4176
+ placeholder,
4177
+ url,
4178
+ width,
4179
+ height,
4180
+ padding,
4181
+ filename = 'signed-document.pdf',
4182
+ defaultSignatureList,
4183
+ onSign,
4184
+ onChange,
4185
+ isEdit
4186
+ } = _ref3,
4187
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
4188
+ const [signatureList, setSignatureList] = react.useState(defaultSignatureList || []);
889
4189
  return /*#__PURE__*/jsxRuntime.jsx(PDFViewer, _extends({}, props, {
890
4190
  url: url,
891
4191
  children: _ref4 => {
@@ -899,7 +4199,8 @@ const PDFSignMulti = withLocale(/*#__PURE__*/react.forwardRef((_ref3, ref) => {
899
4199
  currentPage: currentPage,
900
4200
  url: url,
901
4201
  filename: filename,
902
- defaultSignatureList: defaultSignatureList,
4202
+ signatureList: signatureList,
4203
+ setSignatureList: setSignatureList,
903
4204
  width: width,
904
4205
  height: height,
905
4206
  padding: padding,