@jobber/hooks 2.17.4 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/index.cjs +49 -0
  2. package/dist/index.mjs +23 -0
  3. package/dist/isObjectLike-cjs.js +228 -0
  4. package/dist/isObjectLike-es.js +219 -0
  5. package/dist/useBool/index.cjs +8 -0
  6. package/dist/useBool/index.mjs +2 -0
  7. package/dist/useBool-cjs.js +13 -0
  8. package/dist/useBool-es.js +11 -0
  9. package/dist/useBreakpoints/index.cjs +11 -0
  10. package/dist/useBreakpoints/index.mjs +3 -0
  11. package/dist/useBreakpoints/mockViewportWidth/{mockViewportWidth.js → index.cjs} +5 -4
  12. package/dist/useBreakpoints/mockViewportWidth/index.mjs +66 -0
  13. package/dist/useBreakpoints-cjs.js +48 -0
  14. package/dist/useBreakpoints-es.js +45 -0
  15. package/dist/useCallbackRef/index.cjs +8 -0
  16. package/dist/useCallbackRef/index.mjs +2 -0
  17. package/dist/useCallbackRef-cjs.js +17 -0
  18. package/dist/useCallbackRef-es.js +15 -0
  19. package/dist/useCollectionQuery/index.cjs +13 -0
  20. package/dist/useCollectionQuery/index.mjs +7 -0
  21. package/dist/useCollectionQuery/useCollectionQuery.d.ts +1 -1
  22. package/dist/useCollectionQuery-cjs.js +2842 -0
  23. package/dist/useCollectionQuery-es.js +2821 -0
  24. package/dist/useDebounce/index.cjs +9 -0
  25. package/dist/useDebounce/index.mjs +3 -0
  26. package/dist/useDebounce-cjs.js +92 -0
  27. package/dist/useDebounce-es.js +90 -0
  28. package/dist/useFocusTrap/index.cjs +8 -0
  29. package/dist/useFocusTrap/index.mjs +2 -0
  30. package/dist/{useFocusTrap/useFocusTrap.js → useFocusTrap-cjs.js} +8 -6
  31. package/dist/useFocusTrap-es.js +68 -0
  32. package/dist/useFormState/index.cjs +8 -0
  33. package/dist/useFormState/index.mjs +2 -0
  34. package/dist/useFormState-cjs.js +13 -0
  35. package/dist/useFormState-es.js +11 -0
  36. package/dist/useInView/index.cjs +8 -0
  37. package/dist/useInView/index.mjs +2 -0
  38. package/dist/{useInView/useInView.js → useInView-cjs.js} +10 -8
  39. package/dist/useInView-es.js +19 -0
  40. package/dist/useIsMounted/index.cjs +9 -0
  41. package/dist/useIsMounted/index.mjs +3 -0
  42. package/dist/{useIsMounted/useIsMounted.js → useIsMounted-cjs.js} +9 -7
  43. package/dist/useIsMounted-es.js +34 -0
  44. package/dist/useLiveAnnounce/index.cjs +8 -0
  45. package/dist/useLiveAnnounce/index.mjs +2 -0
  46. package/dist/{useLiveAnnounce/useLiveAnnounce.js → useLiveAnnounce-cjs.js} +8 -6
  47. package/dist/useLiveAnnounce-es.js +41 -0
  48. package/dist/useOnKeyDown/index.cjs +8 -0
  49. package/dist/useOnKeyDown/index.mjs +2 -0
  50. package/dist/{useOnKeyDown/useOnKeyDown.js → useOnKeyDown-cjs.js} +7 -5
  51. package/dist/useOnKeyDown-es.js +34 -0
  52. package/dist/useOnMount/index.cjs +9 -0
  53. package/dist/useOnMount/index.mjs +3 -0
  54. package/dist/{useOnMount/useOnMount.js → useOnMount-cjs.js} +9 -8
  55. package/dist/useOnMount-es.js +19 -0
  56. package/dist/useRefocusOnActivator/index.cjs +8 -0
  57. package/dist/useRefocusOnActivator/index.mjs +2 -0
  58. package/dist/{useRefocusOnActivator/useRefocusOnActivator.js → useRefocusOnActivator-cjs.js} +7 -5
  59. package/dist/useRefocusOnActivator-es.js +26 -0
  60. package/dist/useResizeObserver/index.cjs +10 -0
  61. package/dist/useResizeObserver/index.mjs +3 -0
  62. package/dist/useResizeObserver-cjs.js +1519 -0
  63. package/dist/useResizeObserver-es.js +1516 -0
  64. package/dist/useSafeLayoutEffect/index.cjs +8 -0
  65. package/dist/useSafeLayoutEffect/index.mjs +2 -0
  66. package/dist/useSafeLayoutEffect-cjs.js +9 -0
  67. package/dist/useSafeLayoutEffect-es.js +7 -0
  68. package/dist/useShowClear/{useShowClear.js → index.cjs} +4 -3
  69. package/dist/useShowClear/index.mjs +17 -0
  70. package/dist/useStepper/index.cjs +8 -0
  71. package/dist/useStepper/index.mjs +2 -0
  72. package/dist/{useStepper/useStepper.js → useStepper-cjs.js} +26 -14
  73. package/dist/useStepper-es.js +51 -0
  74. package/dist/useWindowDimensions/index.cjs +8 -0
  75. package/dist/useWindowDimensions/index.mjs +2 -0
  76. package/dist/{useWindowDimensions/useWindowDimensions.js → useWindowDimensions-cjs.js} +8 -6
  77. package/dist/useWindowDimensions-es.js +28 -0
  78. package/package.json +109 -7
  79. package/dist/index.js +0 -34
  80. package/dist/useBool/index.js +0 -5
  81. package/dist/useBool/useBool.js +0 -11
  82. package/dist/useBool/useBool.test.d.ts +0 -1
  83. package/dist/useBool/useBool.test.js +0 -28
  84. package/dist/useBreakpoints/index.js +0 -20
  85. package/dist/useBreakpoints/mockViewportWidth/index.js +0 -17
  86. package/dist/useBreakpoints/mockViewportWidth/mockViewportWidth.test.d.ts +0 -1
  87. package/dist/useBreakpoints/mockViewportWidth/mockViewportWidth.test.js +0 -17
  88. package/dist/useBreakpoints/useBreakpoints.js +0 -28
  89. package/dist/useBreakpoints/useBreakpoints.test.d.ts +0 -1
  90. package/dist/useBreakpoints/useBreakpoints.test.js +0 -142
  91. package/dist/useBreakpoints/useMediaQuery.js +0 -22
  92. package/dist/useCallbackRef/index.js +0 -5
  93. package/dist/useCallbackRef/useCallbackRef.js +0 -15
  94. package/dist/useCallbackRef/useCallbackRef.test.d.ts +0 -1
  95. package/dist/useCallbackRef/useCallbackRef.test.js +0 -29
  96. package/dist/useCollectionQuery/index.js +0 -5
  97. package/dist/useCollectionQuery/mdxUtils.js +0 -152
  98. package/dist/useCollectionQuery/test-utilities/index.d.ts +0 -3
  99. package/dist/useCollectionQuery/test-utilities/index.js +0 -19
  100. package/dist/useCollectionQuery/test-utilities/mocks.d.ts +0 -106
  101. package/dist/useCollectionQuery/test-utilities/mocks.js +0 -131
  102. package/dist/useCollectionQuery/test-utilities/queries.d.ts +0 -37
  103. package/dist/useCollectionQuery/test-utilities/queries.js +0 -59
  104. package/dist/useCollectionQuery/test-utilities/utils.d.ts +0 -1
  105. package/dist/useCollectionQuery/test-utilities/utils.js +0 -17
  106. package/dist/useCollectionQuery/uniqueEdges.js +0 -18
  107. package/dist/useCollectionQuery/uniqueNodes.js +0 -10
  108. package/dist/useCollectionQuery/useCollectionQuery.js +0 -194
  109. package/dist/useCollectionQuery/useCollectionQuery.test.d.ts +0 -1
  110. package/dist/useCollectionQuery/useCollectionQuery.test.js +0 -357
  111. package/dist/useDebounce/index.js +0 -5
  112. package/dist/useDebounce/useDebounce.js +0 -29
  113. package/dist/useDebounce/useDebounce.test.d.ts +0 -1
  114. package/dist/useDebounce/useDebounce.test.js +0 -190
  115. package/dist/useFocusTrap/index.js +0 -5
  116. package/dist/useFocusTrap/useFocusTrap.test.d.ts +0 -1
  117. package/dist/useFocusTrap/useFocusTrap.test.js +0 -61
  118. package/dist/useFormState/index.js +0 -5
  119. package/dist/useFormState/useFormState.js +0 -11
  120. package/dist/useInView/index.js +0 -17
  121. package/dist/useInView/useInView.test.d.ts +0 -1
  122. package/dist/useInView/useInView.test.js +0 -29
  123. package/dist/useIsMounted/index.js +0 -5
  124. package/dist/useIsMounted/useIsMounted.test.d.ts +0 -1
  125. package/dist/useIsMounted/useIsMounted.test.js +0 -15
  126. package/dist/useLiveAnnounce/index.js +0 -5
  127. package/dist/useLiveAnnounce/useLiveAnnounce.test.d.ts +0 -1
  128. package/dist/useLiveAnnounce/useLiveAnnounce.test.js +0 -60
  129. package/dist/useOnKeyDown/index.js +0 -5
  130. package/dist/useOnKeyDown/useOnKeyDown.test.d.ts +0 -1
  131. package/dist/useOnKeyDown/useOnKeyDown.test.js +0 -23
  132. package/dist/useOnMount/index.js +0 -5
  133. package/dist/useOnMount/useOnMount.test.d.ts +0 -1
  134. package/dist/useOnMount/useOnMount.test.js +0 -18
  135. package/dist/useRefocusOnActivator/index.js +0 -5
  136. package/dist/useResizeObserver/index.js +0 -17
  137. package/dist/useResizeObserver/useResizeObserver.js +0 -68
  138. package/dist/useSafeLayoutEffect/index.js +0 -5
  139. package/dist/useSafeLayoutEffect/useSafeLayoutEffect.js +0 -7
  140. package/dist/useShowClear/index.js +0 -5
  141. package/dist/useShowClear/useShowClear.test.d.ts +0 -1
  142. package/dist/useShowClear/useShowClear.test.js +0 -210
  143. package/dist/useStepper/index.js +0 -5
  144. package/dist/useStepper/useStepper.test.d.ts +0 -1
  145. package/dist/useStepper/useStepper.test.js +0 -79
  146. package/dist/useWindowDimensions/index.js +0 -5
  147. package/dist/useWindowDimensions/useWIndowDimensions.test.d.ts +0 -1
  148. package/dist/useWindowDimensions/useWIndowDimensions.test.js +0 -23
@@ -0,0 +1,2821 @@
1
+ import * as apolloClient from '@apollo/client';
2
+ import { b as _baseGetTag, c as isObject_1, _ as _root, i as isObjectLike_1, d as _freeGlobal, e as _Symbol, a as getDefaultExportFromCjs } from './isObjectLike-es.js';
3
+ import { useState, useCallback, useEffect } from 'react';
4
+ import { config } from '@jobber/formatters';
5
+ import { u as useIsMounted } from './useIsMounted-es.js';
6
+
7
+ /**
8
+ * Removes all key-value entries from the list cache.
9
+ *
10
+ * @private
11
+ * @name clear
12
+ * @memberOf ListCache
13
+ */
14
+
15
+ function listCacheClear$1() {
16
+ this.__data__ = [];
17
+ this.size = 0;
18
+ }
19
+
20
+ var _listCacheClear = listCacheClear$1;
21
+
22
+ /**
23
+ * Performs a
24
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
25
+ * comparison between two values to determine if they are equivalent.
26
+ *
27
+ * @static
28
+ * @memberOf _
29
+ * @since 4.0.0
30
+ * @category Lang
31
+ * @param {*} value The value to compare.
32
+ * @param {*} other The other value to compare.
33
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
34
+ * @example
35
+ *
36
+ * var object = { 'a': 1 };
37
+ * var other = { 'a': 1 };
38
+ *
39
+ * _.eq(object, object);
40
+ * // => true
41
+ *
42
+ * _.eq(object, other);
43
+ * // => false
44
+ *
45
+ * _.eq('a', 'a');
46
+ * // => true
47
+ *
48
+ * _.eq('a', Object('a'));
49
+ * // => false
50
+ *
51
+ * _.eq(NaN, NaN);
52
+ * // => true
53
+ */
54
+
55
+ function eq$2(value, other) {
56
+ return value === other || (value !== value && other !== other);
57
+ }
58
+
59
+ var eq_1 = eq$2;
60
+
61
+ var eq$1 = eq_1;
62
+
63
+ /**
64
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
65
+ *
66
+ * @private
67
+ * @param {Array} array The array to inspect.
68
+ * @param {*} key The key to search for.
69
+ * @returns {number} Returns the index of the matched value, else `-1`.
70
+ */
71
+ function assocIndexOf$4(array, key) {
72
+ var length = array.length;
73
+ while (length--) {
74
+ if (eq$1(array[length][0], key)) {
75
+ return length;
76
+ }
77
+ }
78
+ return -1;
79
+ }
80
+
81
+ var _assocIndexOf = assocIndexOf$4;
82
+
83
+ var assocIndexOf$3 = _assocIndexOf;
84
+
85
+ /** Used for built-in method references. */
86
+ var arrayProto = Array.prototype;
87
+
88
+ /** Built-in value references. */
89
+ var splice = arrayProto.splice;
90
+
91
+ /**
92
+ * Removes `key` and its value from the list cache.
93
+ *
94
+ * @private
95
+ * @name delete
96
+ * @memberOf ListCache
97
+ * @param {string} key The key of the value to remove.
98
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
99
+ */
100
+ function listCacheDelete$1(key) {
101
+ var data = this.__data__,
102
+ index = assocIndexOf$3(data, key);
103
+
104
+ if (index < 0) {
105
+ return false;
106
+ }
107
+ var lastIndex = data.length - 1;
108
+ if (index == lastIndex) {
109
+ data.pop();
110
+ } else {
111
+ splice.call(data, index, 1);
112
+ }
113
+ --this.size;
114
+ return true;
115
+ }
116
+
117
+ var _listCacheDelete = listCacheDelete$1;
118
+
119
+ var assocIndexOf$2 = _assocIndexOf;
120
+
121
+ /**
122
+ * Gets the list cache value for `key`.
123
+ *
124
+ * @private
125
+ * @name get
126
+ * @memberOf ListCache
127
+ * @param {string} key The key of the value to get.
128
+ * @returns {*} Returns the entry value.
129
+ */
130
+ function listCacheGet$1(key) {
131
+ var data = this.__data__,
132
+ index = assocIndexOf$2(data, key);
133
+
134
+ return index < 0 ? undefined : data[index][1];
135
+ }
136
+
137
+ var _listCacheGet = listCacheGet$1;
138
+
139
+ var assocIndexOf$1 = _assocIndexOf;
140
+
141
+ /**
142
+ * Checks if a list cache value for `key` exists.
143
+ *
144
+ * @private
145
+ * @name has
146
+ * @memberOf ListCache
147
+ * @param {string} key The key of the entry to check.
148
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
149
+ */
150
+ function listCacheHas$1(key) {
151
+ return assocIndexOf$1(this.__data__, key) > -1;
152
+ }
153
+
154
+ var _listCacheHas = listCacheHas$1;
155
+
156
+ var assocIndexOf = _assocIndexOf;
157
+
158
+ /**
159
+ * Sets the list cache `key` to `value`.
160
+ *
161
+ * @private
162
+ * @name set
163
+ * @memberOf ListCache
164
+ * @param {string} key The key of the value to set.
165
+ * @param {*} value The value to set.
166
+ * @returns {Object} Returns the list cache instance.
167
+ */
168
+ function listCacheSet$1(key, value) {
169
+ var data = this.__data__,
170
+ index = assocIndexOf(data, key);
171
+
172
+ if (index < 0) {
173
+ ++this.size;
174
+ data.push([key, value]);
175
+ } else {
176
+ data[index][1] = value;
177
+ }
178
+ return this;
179
+ }
180
+
181
+ var _listCacheSet = listCacheSet$1;
182
+
183
+ var listCacheClear = _listCacheClear,
184
+ listCacheDelete = _listCacheDelete,
185
+ listCacheGet = _listCacheGet,
186
+ listCacheHas = _listCacheHas,
187
+ listCacheSet = _listCacheSet;
188
+
189
+ /**
190
+ * Creates an list cache object.
191
+ *
192
+ * @private
193
+ * @constructor
194
+ * @param {Array} [entries] The key-value pairs to cache.
195
+ */
196
+ function ListCache$4(entries) {
197
+ var index = -1,
198
+ length = entries == null ? 0 : entries.length;
199
+
200
+ this.clear();
201
+ while (++index < length) {
202
+ var entry = entries[index];
203
+ this.set(entry[0], entry[1]);
204
+ }
205
+ }
206
+
207
+ // Add methods to `ListCache`.
208
+ ListCache$4.prototype.clear = listCacheClear;
209
+ ListCache$4.prototype['delete'] = listCacheDelete;
210
+ ListCache$4.prototype.get = listCacheGet;
211
+ ListCache$4.prototype.has = listCacheHas;
212
+ ListCache$4.prototype.set = listCacheSet;
213
+
214
+ var _ListCache = ListCache$4;
215
+
216
+ var ListCache$3 = _ListCache;
217
+
218
+ /**
219
+ * Removes all key-value entries from the stack.
220
+ *
221
+ * @private
222
+ * @name clear
223
+ * @memberOf Stack
224
+ */
225
+ function stackClear$1() {
226
+ this.__data__ = new ListCache$3;
227
+ this.size = 0;
228
+ }
229
+
230
+ var _stackClear = stackClear$1;
231
+
232
+ /**
233
+ * Removes `key` and its value from the stack.
234
+ *
235
+ * @private
236
+ * @name delete
237
+ * @memberOf Stack
238
+ * @param {string} key The key of the value to remove.
239
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
240
+ */
241
+
242
+ function stackDelete$1(key) {
243
+ var data = this.__data__,
244
+ result = data['delete'](key);
245
+
246
+ this.size = data.size;
247
+ return result;
248
+ }
249
+
250
+ var _stackDelete = stackDelete$1;
251
+
252
+ /**
253
+ * Gets the stack value for `key`.
254
+ *
255
+ * @private
256
+ * @name get
257
+ * @memberOf Stack
258
+ * @param {string} key The key of the value to get.
259
+ * @returns {*} Returns the entry value.
260
+ */
261
+
262
+ function stackGet$1(key) {
263
+ return this.__data__.get(key);
264
+ }
265
+
266
+ var _stackGet = stackGet$1;
267
+
268
+ /**
269
+ * Checks if a stack value for `key` exists.
270
+ *
271
+ * @private
272
+ * @name has
273
+ * @memberOf Stack
274
+ * @param {string} key The key of the entry to check.
275
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
276
+ */
277
+
278
+ function stackHas$1(key) {
279
+ return this.__data__.has(key);
280
+ }
281
+
282
+ var _stackHas = stackHas$1;
283
+
284
+ var baseGetTag$3 = _baseGetTag,
285
+ isObject$4 = isObject_1;
286
+
287
+ /** `Object#toString` result references. */
288
+ var asyncTag = '[object AsyncFunction]',
289
+ funcTag$2 = '[object Function]',
290
+ genTag$1 = '[object GeneratorFunction]',
291
+ proxyTag = '[object Proxy]';
292
+
293
+ /**
294
+ * Checks if `value` is classified as a `Function` object.
295
+ *
296
+ * @static
297
+ * @memberOf _
298
+ * @since 0.1.0
299
+ * @category Lang
300
+ * @param {*} value The value to check.
301
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
302
+ * @example
303
+ *
304
+ * _.isFunction(_);
305
+ * // => true
306
+ *
307
+ * _.isFunction(/abc/);
308
+ * // => false
309
+ */
310
+ function isFunction$2(value) {
311
+ if (!isObject$4(value)) {
312
+ return false;
313
+ }
314
+ // The use of `Object#toString` avoids issues with the `typeof` operator
315
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
316
+ var tag = baseGetTag$3(value);
317
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
318
+ }
319
+
320
+ var isFunction_1 = isFunction$2;
321
+
322
+ var root$6 = _root;
323
+
324
+ /** Used to detect overreaching core-js shims. */
325
+ var coreJsData$1 = root$6['__core-js_shared__'];
326
+
327
+ var _coreJsData = coreJsData$1;
328
+
329
+ var coreJsData = _coreJsData;
330
+
331
+ /** Used to detect methods masquerading as native. */
332
+ var maskSrcKey = (function() {
333
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
334
+ return uid ? ('Symbol(src)_1.' + uid) : '';
335
+ }());
336
+
337
+ /**
338
+ * Checks if `func` has its source masked.
339
+ *
340
+ * @private
341
+ * @param {Function} func The function to check.
342
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
343
+ */
344
+ function isMasked$1(func) {
345
+ return !!maskSrcKey && (maskSrcKey in func);
346
+ }
347
+
348
+ var _isMasked = isMasked$1;
349
+
350
+ /** Used for built-in method references. */
351
+
352
+ var funcProto$1 = Function.prototype;
353
+
354
+ /** Used to resolve the decompiled source of functions. */
355
+ var funcToString$1 = funcProto$1.toString;
356
+
357
+ /**
358
+ * Converts `func` to its source code.
359
+ *
360
+ * @private
361
+ * @param {Function} func The function to convert.
362
+ * @returns {string} Returns the source code.
363
+ */
364
+ function toSource$2(func) {
365
+ if (func != null) {
366
+ try {
367
+ return funcToString$1.call(func);
368
+ } catch (e) {}
369
+ try {
370
+ return (func + '');
371
+ } catch (e) {}
372
+ }
373
+ return '';
374
+ }
375
+
376
+ var _toSource = toSource$2;
377
+
378
+ var isFunction$1 = isFunction_1,
379
+ isMasked = _isMasked,
380
+ isObject$3 = isObject_1,
381
+ toSource$1 = _toSource;
382
+
383
+ /**
384
+ * Used to match `RegExp`
385
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
386
+ */
387
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
388
+
389
+ /** Used to detect host constructors (Safari). */
390
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
391
+
392
+ /** Used for built-in method references. */
393
+ var funcProto = Function.prototype,
394
+ objectProto$a = Object.prototype;
395
+
396
+ /** Used to resolve the decompiled source of functions. */
397
+ var funcToString = funcProto.toString;
398
+
399
+ /** Used to check objects for own properties. */
400
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
401
+
402
+ /** Used to detect if a method is native. */
403
+ var reIsNative = RegExp('^' +
404
+ funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
405
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
406
+ );
407
+
408
+ /**
409
+ * The base implementation of `_.isNative` without bad shim checks.
410
+ *
411
+ * @private
412
+ * @param {*} value The value to check.
413
+ * @returns {boolean} Returns `true` if `value` is a native function,
414
+ * else `false`.
415
+ */
416
+ function baseIsNative$1(value) {
417
+ if (!isObject$3(value) || isMasked(value)) {
418
+ return false;
419
+ }
420
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
421
+ return pattern.test(toSource$1(value));
422
+ }
423
+
424
+ var _baseIsNative = baseIsNative$1;
425
+
426
+ /**
427
+ * Gets the value at `key` of `object`.
428
+ *
429
+ * @private
430
+ * @param {Object} [object] The object to query.
431
+ * @param {string} key The key of the property to get.
432
+ * @returns {*} Returns the property value.
433
+ */
434
+
435
+ function getValue$1(object, key) {
436
+ return object == null ? undefined : object[key];
437
+ }
438
+
439
+ var _getValue = getValue$1;
440
+
441
+ var baseIsNative = _baseIsNative,
442
+ getValue = _getValue;
443
+
444
+ /**
445
+ * Gets the native function at `key` of `object`.
446
+ *
447
+ * @private
448
+ * @param {Object} object The object to query.
449
+ * @param {string} key The key of the method to get.
450
+ * @returns {*} Returns the function if it's native, else `undefined`.
451
+ */
452
+ function getNative$7(object, key) {
453
+ var value = getValue(object, key);
454
+ return baseIsNative(value) ? value : undefined;
455
+ }
456
+
457
+ var _getNative = getNative$7;
458
+
459
+ var getNative$6 = _getNative,
460
+ root$5 = _root;
461
+
462
+ /* Built-in method references that are verified to be native. */
463
+ var Map$4 = getNative$6(root$5, 'Map');
464
+
465
+ var _Map = Map$4;
466
+
467
+ var getNative$5 = _getNative;
468
+
469
+ /* Built-in method references that are verified to be native. */
470
+ var nativeCreate$4 = getNative$5(Object, 'create');
471
+
472
+ var _nativeCreate = nativeCreate$4;
473
+
474
+ var nativeCreate$3 = _nativeCreate;
475
+
476
+ /**
477
+ * Removes all key-value entries from the hash.
478
+ *
479
+ * @private
480
+ * @name clear
481
+ * @memberOf Hash
482
+ */
483
+ function hashClear$1() {
484
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
485
+ this.size = 0;
486
+ }
487
+
488
+ var _hashClear = hashClear$1;
489
+
490
+ /**
491
+ * Removes `key` and its value from the hash.
492
+ *
493
+ * @private
494
+ * @name delete
495
+ * @memberOf Hash
496
+ * @param {Object} hash The hash to modify.
497
+ * @param {string} key The key of the value to remove.
498
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
499
+ */
500
+
501
+ function hashDelete$1(key) {
502
+ var result = this.has(key) && delete this.__data__[key];
503
+ this.size -= result ? 1 : 0;
504
+ return result;
505
+ }
506
+
507
+ var _hashDelete = hashDelete$1;
508
+
509
+ var nativeCreate$2 = _nativeCreate;
510
+
511
+ /** Used to stand-in for `undefined` hash values. */
512
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
513
+
514
+ /** Used for built-in method references. */
515
+ var objectProto$9 = Object.prototype;
516
+
517
+ /** Used to check objects for own properties. */
518
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
519
+
520
+ /**
521
+ * Gets the hash value for `key`.
522
+ *
523
+ * @private
524
+ * @name get
525
+ * @memberOf Hash
526
+ * @param {string} key The key of the value to get.
527
+ * @returns {*} Returns the entry value.
528
+ */
529
+ function hashGet$1(key) {
530
+ var data = this.__data__;
531
+ if (nativeCreate$2) {
532
+ var result = data[key];
533
+ return result === HASH_UNDEFINED$1 ? undefined : result;
534
+ }
535
+ return hasOwnProperty$7.call(data, key) ? data[key] : undefined;
536
+ }
537
+
538
+ var _hashGet = hashGet$1;
539
+
540
+ var nativeCreate$1 = _nativeCreate;
541
+
542
+ /** Used for built-in method references. */
543
+ var objectProto$8 = Object.prototype;
544
+
545
+ /** Used to check objects for own properties. */
546
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
547
+
548
+ /**
549
+ * Checks if a hash value for `key` exists.
550
+ *
551
+ * @private
552
+ * @name has
553
+ * @memberOf Hash
554
+ * @param {string} key The key of the entry to check.
555
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
556
+ */
557
+ function hashHas$1(key) {
558
+ var data = this.__data__;
559
+ return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$6.call(data, key);
560
+ }
561
+
562
+ var _hashHas = hashHas$1;
563
+
564
+ var nativeCreate = _nativeCreate;
565
+
566
+ /** Used to stand-in for `undefined` hash values. */
567
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
568
+
569
+ /**
570
+ * Sets the hash `key` to `value`.
571
+ *
572
+ * @private
573
+ * @name set
574
+ * @memberOf Hash
575
+ * @param {string} key The key of the value to set.
576
+ * @param {*} value The value to set.
577
+ * @returns {Object} Returns the hash instance.
578
+ */
579
+ function hashSet$1(key, value) {
580
+ var data = this.__data__;
581
+ this.size += this.has(key) ? 0 : 1;
582
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
583
+ return this;
584
+ }
585
+
586
+ var _hashSet = hashSet$1;
587
+
588
+ var hashClear = _hashClear,
589
+ hashDelete = _hashDelete,
590
+ hashGet = _hashGet,
591
+ hashHas = _hashHas,
592
+ hashSet = _hashSet;
593
+
594
+ /**
595
+ * Creates a hash object.
596
+ *
597
+ * @private
598
+ * @constructor
599
+ * @param {Array} [entries] The key-value pairs to cache.
600
+ */
601
+ function Hash$1(entries) {
602
+ var index = -1,
603
+ length = entries == null ? 0 : entries.length;
604
+
605
+ this.clear();
606
+ while (++index < length) {
607
+ var entry = entries[index];
608
+ this.set(entry[0], entry[1]);
609
+ }
610
+ }
611
+
612
+ // Add methods to `Hash`.
613
+ Hash$1.prototype.clear = hashClear;
614
+ Hash$1.prototype['delete'] = hashDelete;
615
+ Hash$1.prototype.get = hashGet;
616
+ Hash$1.prototype.has = hashHas;
617
+ Hash$1.prototype.set = hashSet;
618
+
619
+ var _Hash = Hash$1;
620
+
621
+ var Hash = _Hash,
622
+ ListCache$2 = _ListCache,
623
+ Map$3 = _Map;
624
+
625
+ /**
626
+ * Removes all key-value entries from the map.
627
+ *
628
+ * @private
629
+ * @name clear
630
+ * @memberOf MapCache
631
+ */
632
+ function mapCacheClear$1() {
633
+ this.size = 0;
634
+ this.__data__ = {
635
+ 'hash': new Hash,
636
+ 'map': new (Map$3 || ListCache$2),
637
+ 'string': new Hash
638
+ };
639
+ }
640
+
641
+ var _mapCacheClear = mapCacheClear$1;
642
+
643
+ /**
644
+ * Checks if `value` is suitable for use as unique object key.
645
+ *
646
+ * @private
647
+ * @param {*} value The value to check.
648
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
649
+ */
650
+
651
+ function isKeyable$1(value) {
652
+ var type = typeof value;
653
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
654
+ ? (value !== '__proto__')
655
+ : (value === null);
656
+ }
657
+
658
+ var _isKeyable = isKeyable$1;
659
+
660
+ var isKeyable = _isKeyable;
661
+
662
+ /**
663
+ * Gets the data for `map`.
664
+ *
665
+ * @private
666
+ * @param {Object} map The map to query.
667
+ * @param {string} key The reference key.
668
+ * @returns {*} Returns the map data.
669
+ */
670
+ function getMapData$4(map, key) {
671
+ var data = map.__data__;
672
+ return isKeyable(key)
673
+ ? data[typeof key == 'string' ? 'string' : 'hash']
674
+ : data.map;
675
+ }
676
+
677
+ var _getMapData = getMapData$4;
678
+
679
+ var getMapData$3 = _getMapData;
680
+
681
+ /**
682
+ * Removes `key` and its value from the map.
683
+ *
684
+ * @private
685
+ * @name delete
686
+ * @memberOf MapCache
687
+ * @param {string} key The key of the value to remove.
688
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
689
+ */
690
+ function mapCacheDelete$1(key) {
691
+ var result = getMapData$3(this, key)['delete'](key);
692
+ this.size -= result ? 1 : 0;
693
+ return result;
694
+ }
695
+
696
+ var _mapCacheDelete = mapCacheDelete$1;
697
+
698
+ var getMapData$2 = _getMapData;
699
+
700
+ /**
701
+ * Gets the map value for `key`.
702
+ *
703
+ * @private
704
+ * @name get
705
+ * @memberOf MapCache
706
+ * @param {string} key The key of the value to get.
707
+ * @returns {*} Returns the entry value.
708
+ */
709
+ function mapCacheGet$1(key) {
710
+ return getMapData$2(this, key).get(key);
711
+ }
712
+
713
+ var _mapCacheGet = mapCacheGet$1;
714
+
715
+ var getMapData$1 = _getMapData;
716
+
717
+ /**
718
+ * Checks if a map value for `key` exists.
719
+ *
720
+ * @private
721
+ * @name has
722
+ * @memberOf MapCache
723
+ * @param {string} key The key of the entry to check.
724
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
725
+ */
726
+ function mapCacheHas$1(key) {
727
+ return getMapData$1(this, key).has(key);
728
+ }
729
+
730
+ var _mapCacheHas = mapCacheHas$1;
731
+
732
+ var getMapData = _getMapData;
733
+
734
+ /**
735
+ * Sets the map `key` to `value`.
736
+ *
737
+ * @private
738
+ * @name set
739
+ * @memberOf MapCache
740
+ * @param {string} key The key of the value to set.
741
+ * @param {*} value The value to set.
742
+ * @returns {Object} Returns the map cache instance.
743
+ */
744
+ function mapCacheSet$1(key, value) {
745
+ var data = getMapData(this, key),
746
+ size = data.size;
747
+
748
+ data.set(key, value);
749
+ this.size += data.size == size ? 0 : 1;
750
+ return this;
751
+ }
752
+
753
+ var _mapCacheSet = mapCacheSet$1;
754
+
755
+ var mapCacheClear = _mapCacheClear,
756
+ mapCacheDelete = _mapCacheDelete,
757
+ mapCacheGet = _mapCacheGet,
758
+ mapCacheHas = _mapCacheHas,
759
+ mapCacheSet = _mapCacheSet;
760
+
761
+ /**
762
+ * Creates a map cache object to store key-value pairs.
763
+ *
764
+ * @private
765
+ * @constructor
766
+ * @param {Array} [entries] The key-value pairs to cache.
767
+ */
768
+ function MapCache$1(entries) {
769
+ var index = -1,
770
+ length = entries == null ? 0 : entries.length;
771
+
772
+ this.clear();
773
+ while (++index < length) {
774
+ var entry = entries[index];
775
+ this.set(entry[0], entry[1]);
776
+ }
777
+ }
778
+
779
+ // Add methods to `MapCache`.
780
+ MapCache$1.prototype.clear = mapCacheClear;
781
+ MapCache$1.prototype['delete'] = mapCacheDelete;
782
+ MapCache$1.prototype.get = mapCacheGet;
783
+ MapCache$1.prototype.has = mapCacheHas;
784
+ MapCache$1.prototype.set = mapCacheSet;
785
+
786
+ var _MapCache = MapCache$1;
787
+
788
+ var ListCache$1 = _ListCache,
789
+ Map$2 = _Map,
790
+ MapCache = _MapCache;
791
+
792
+ /** Used as the size to enable large array optimizations. */
793
+ var LARGE_ARRAY_SIZE = 200;
794
+
795
+ /**
796
+ * Sets the stack `key` to `value`.
797
+ *
798
+ * @private
799
+ * @name set
800
+ * @memberOf Stack
801
+ * @param {string} key The key of the value to set.
802
+ * @param {*} value The value to set.
803
+ * @returns {Object} Returns the stack cache instance.
804
+ */
805
+ function stackSet$1(key, value) {
806
+ var data = this.__data__;
807
+ if (data instanceof ListCache$1) {
808
+ var pairs = data.__data__;
809
+ if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
810
+ pairs.push([key, value]);
811
+ this.size = ++data.size;
812
+ return this;
813
+ }
814
+ data = this.__data__ = new MapCache(pairs);
815
+ }
816
+ data.set(key, value);
817
+ this.size = data.size;
818
+ return this;
819
+ }
820
+
821
+ var _stackSet = stackSet$1;
822
+
823
+ var ListCache = _ListCache,
824
+ stackClear = _stackClear,
825
+ stackDelete = _stackDelete,
826
+ stackGet = _stackGet,
827
+ stackHas = _stackHas,
828
+ stackSet = _stackSet;
829
+
830
+ /**
831
+ * Creates a stack cache object to store key-value pairs.
832
+ *
833
+ * @private
834
+ * @constructor
835
+ * @param {Array} [entries] The key-value pairs to cache.
836
+ */
837
+ function Stack$1(entries) {
838
+ var data = this.__data__ = new ListCache(entries);
839
+ this.size = data.size;
840
+ }
841
+
842
+ // Add methods to `Stack`.
843
+ Stack$1.prototype.clear = stackClear;
844
+ Stack$1.prototype['delete'] = stackDelete;
845
+ Stack$1.prototype.get = stackGet;
846
+ Stack$1.prototype.has = stackHas;
847
+ Stack$1.prototype.set = stackSet;
848
+
849
+ var _Stack = Stack$1;
850
+
851
+ /**
852
+ * A specialized version of `_.forEach` for arrays without support for
853
+ * iteratee shorthands.
854
+ *
855
+ * @private
856
+ * @param {Array} [array] The array to iterate over.
857
+ * @param {Function} iteratee The function invoked per iteration.
858
+ * @returns {Array} Returns `array`.
859
+ */
860
+
861
+ function arrayEach$1(array, iteratee) {
862
+ var index = -1,
863
+ length = array == null ? 0 : array.length;
864
+
865
+ while (++index < length) {
866
+ if (iteratee(array[index], index, array) === false) {
867
+ break;
868
+ }
869
+ }
870
+ return array;
871
+ }
872
+
873
+ var _arrayEach = arrayEach$1;
874
+
875
+ var getNative$4 = _getNative;
876
+
877
+ var defineProperty$1 = (function() {
878
+ try {
879
+ var func = getNative$4(Object, 'defineProperty');
880
+ func({}, '', {});
881
+ return func;
882
+ } catch (e) {}
883
+ }());
884
+
885
+ var _defineProperty = defineProperty$1;
886
+
887
+ var defineProperty = _defineProperty;
888
+
889
+ /**
890
+ * The base implementation of `assignValue` and `assignMergeValue` without
891
+ * value checks.
892
+ *
893
+ * @private
894
+ * @param {Object} object The object to modify.
895
+ * @param {string} key The key of the property to assign.
896
+ * @param {*} value The value to assign.
897
+ */
898
+ function baseAssignValue$2(object, key, value) {
899
+ if (key == '__proto__' && defineProperty) {
900
+ defineProperty(object, key, {
901
+ 'configurable': true,
902
+ 'enumerable': true,
903
+ 'value': value,
904
+ 'writable': true
905
+ });
906
+ } else {
907
+ object[key] = value;
908
+ }
909
+ }
910
+
911
+ var _baseAssignValue = baseAssignValue$2;
912
+
913
+ var baseAssignValue$1 = _baseAssignValue,
914
+ eq = eq_1;
915
+
916
+ /** Used for built-in method references. */
917
+ var objectProto$7 = Object.prototype;
918
+
919
+ /** Used to check objects for own properties. */
920
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
921
+
922
+ /**
923
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
924
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
925
+ * for equality comparisons.
926
+ *
927
+ * @private
928
+ * @param {Object} object The object to modify.
929
+ * @param {string} key The key of the property to assign.
930
+ * @param {*} value The value to assign.
931
+ */
932
+ function assignValue$2(object, key, value) {
933
+ var objValue = object[key];
934
+ if (!(hasOwnProperty$5.call(object, key) && eq(objValue, value)) ||
935
+ (value === undefined && !(key in object))) {
936
+ baseAssignValue$1(object, key, value);
937
+ }
938
+ }
939
+
940
+ var _assignValue = assignValue$2;
941
+
942
+ var assignValue$1 = _assignValue,
943
+ baseAssignValue = _baseAssignValue;
944
+
945
+ /**
946
+ * Copies properties of `source` to `object`.
947
+ *
948
+ * @private
949
+ * @param {Object} source The object to copy properties from.
950
+ * @param {Array} props The property identifiers to copy.
951
+ * @param {Object} [object={}] The object to copy properties to.
952
+ * @param {Function} [customizer] The function to customize copied values.
953
+ * @returns {Object} Returns `object`.
954
+ */
955
+ function copyObject$4(source, props, object, customizer) {
956
+ var isNew = !object;
957
+ object || (object = {});
958
+
959
+ var index = -1,
960
+ length = props.length;
961
+
962
+ while (++index < length) {
963
+ var key = props[index];
964
+
965
+ var newValue = customizer
966
+ ? customizer(object[key], source[key], key, object, source)
967
+ : undefined;
968
+
969
+ if (newValue === undefined) {
970
+ newValue = source[key];
971
+ }
972
+ if (isNew) {
973
+ baseAssignValue(object, key, newValue);
974
+ } else {
975
+ assignValue$1(object, key, newValue);
976
+ }
977
+ }
978
+ return object;
979
+ }
980
+
981
+ var _copyObject = copyObject$4;
982
+
983
+ /**
984
+ * The base implementation of `_.times` without support for iteratee shorthands
985
+ * or max array length checks.
986
+ *
987
+ * @private
988
+ * @param {number} n The number of times to invoke `iteratee`.
989
+ * @param {Function} iteratee The function invoked per iteration.
990
+ * @returns {Array} Returns the array of results.
991
+ */
992
+
993
+ function baseTimes$1(n, iteratee) {
994
+ var index = -1,
995
+ result = Array(n);
996
+
997
+ while (++index < n) {
998
+ result[index] = iteratee(index);
999
+ }
1000
+ return result;
1001
+ }
1002
+
1003
+ var _baseTimes = baseTimes$1;
1004
+
1005
+ var baseGetTag$2 = _baseGetTag,
1006
+ isObjectLike$4 = isObjectLike_1;
1007
+
1008
+ /** `Object#toString` result references. */
1009
+ var argsTag$2 = '[object Arguments]';
1010
+
1011
+ /**
1012
+ * The base implementation of `_.isArguments`.
1013
+ *
1014
+ * @private
1015
+ * @param {*} value The value to check.
1016
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1017
+ */
1018
+ function baseIsArguments$1(value) {
1019
+ return isObjectLike$4(value) && baseGetTag$2(value) == argsTag$2;
1020
+ }
1021
+
1022
+ var _baseIsArguments = baseIsArguments$1;
1023
+
1024
+ var baseIsArguments = _baseIsArguments,
1025
+ isObjectLike$3 = isObjectLike_1;
1026
+
1027
+ /** Used for built-in method references. */
1028
+ var objectProto$6 = Object.prototype;
1029
+
1030
+ /** Used to check objects for own properties. */
1031
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
1032
+
1033
+ /** Built-in value references. */
1034
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
1035
+
1036
+ /**
1037
+ * Checks if `value` is likely an `arguments` object.
1038
+ *
1039
+ * @static
1040
+ * @memberOf _
1041
+ * @since 0.1.0
1042
+ * @category Lang
1043
+ * @param {*} value The value to check.
1044
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1045
+ * else `false`.
1046
+ * @example
1047
+ *
1048
+ * _.isArguments(function() { return arguments; }());
1049
+ * // => true
1050
+ *
1051
+ * _.isArguments([1, 2, 3]);
1052
+ * // => false
1053
+ */
1054
+ var isArguments$1 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1055
+ return isObjectLike$3(value) && hasOwnProperty$4.call(value, 'callee') &&
1056
+ !propertyIsEnumerable$1.call(value, 'callee');
1057
+ };
1058
+
1059
+ var isArguments_1 = isArguments$1;
1060
+
1061
+ /**
1062
+ * Checks if `value` is classified as an `Array` object.
1063
+ *
1064
+ * @static
1065
+ * @memberOf _
1066
+ * @since 0.1.0
1067
+ * @category Lang
1068
+ * @param {*} value The value to check.
1069
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1070
+ * @example
1071
+ *
1072
+ * _.isArray([1, 2, 3]);
1073
+ * // => true
1074
+ *
1075
+ * _.isArray(document.body.children);
1076
+ * // => false
1077
+ *
1078
+ * _.isArray('abc');
1079
+ * // => false
1080
+ *
1081
+ * _.isArray(_.noop);
1082
+ * // => false
1083
+ */
1084
+
1085
+ var isArray$3 = Array.isArray;
1086
+
1087
+ var isArray_1 = isArray$3;
1088
+
1089
+ var isBuffer$2 = {exports: {}};
1090
+
1091
+ /**
1092
+ * This method returns `false`.
1093
+ *
1094
+ * @static
1095
+ * @memberOf _
1096
+ * @since 4.13.0
1097
+ * @category Util
1098
+ * @returns {boolean} Returns `false`.
1099
+ * @example
1100
+ *
1101
+ * _.times(2, _.stubFalse);
1102
+ * // => [false, false]
1103
+ */
1104
+
1105
+ function stubFalse() {
1106
+ return false;
1107
+ }
1108
+
1109
+ var stubFalse_1 = stubFalse;
1110
+
1111
+ isBuffer$2.exports;
1112
+
1113
+ (function (module, exports) {
1114
+ var root = _root,
1115
+ stubFalse = stubFalse_1;
1116
+
1117
+ /** Detect free variable `exports`. */
1118
+ var freeExports = exports && !exports.nodeType && exports;
1119
+
1120
+ /** Detect free variable `module`. */
1121
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1122
+
1123
+ /** Detect the popular CommonJS extension `module.exports`. */
1124
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1125
+
1126
+ /** Built-in value references. */
1127
+ var Buffer = moduleExports ? root.Buffer : undefined;
1128
+
1129
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1130
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1131
+
1132
+ /**
1133
+ * Checks if `value` is a buffer.
1134
+ *
1135
+ * @static
1136
+ * @memberOf _
1137
+ * @since 4.3.0
1138
+ * @category Lang
1139
+ * @param {*} value The value to check.
1140
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1141
+ * @example
1142
+ *
1143
+ * _.isBuffer(new Buffer(2));
1144
+ * // => true
1145
+ *
1146
+ * _.isBuffer(new Uint8Array(2));
1147
+ * // => false
1148
+ */
1149
+ var isBuffer = nativeIsBuffer || stubFalse;
1150
+
1151
+ module.exports = isBuffer;
1152
+ } (isBuffer$2, isBuffer$2.exports));
1153
+
1154
+ var isBufferExports = isBuffer$2.exports;
1155
+
1156
+ /** Used as references for various `Number` constants. */
1157
+
1158
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
1159
+
1160
+ /** Used to detect unsigned integer values. */
1161
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1162
+
1163
+ /**
1164
+ * Checks if `value` is a valid array-like index.
1165
+ *
1166
+ * @private
1167
+ * @param {*} value The value to check.
1168
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1169
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1170
+ */
1171
+ function isIndex$1(value, length) {
1172
+ var type = typeof value;
1173
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
1174
+
1175
+ return !!length &&
1176
+ (type == 'number' ||
1177
+ (type != 'symbol' && reIsUint.test(value))) &&
1178
+ (value > -1 && value % 1 == 0 && value < length);
1179
+ }
1180
+
1181
+ var _isIndex = isIndex$1;
1182
+
1183
+ /** Used as references for various `Number` constants. */
1184
+
1185
+ var MAX_SAFE_INTEGER = 9007199254740991;
1186
+
1187
+ /**
1188
+ * Checks if `value` is a valid array-like length.
1189
+ *
1190
+ * **Note:** This method is loosely based on
1191
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1192
+ *
1193
+ * @static
1194
+ * @memberOf _
1195
+ * @since 4.0.0
1196
+ * @category Lang
1197
+ * @param {*} value The value to check.
1198
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1199
+ * @example
1200
+ *
1201
+ * _.isLength(3);
1202
+ * // => true
1203
+ *
1204
+ * _.isLength(Number.MIN_VALUE);
1205
+ * // => false
1206
+ *
1207
+ * _.isLength(Infinity);
1208
+ * // => false
1209
+ *
1210
+ * _.isLength('3');
1211
+ * // => false
1212
+ */
1213
+ function isLength$2(value) {
1214
+ return typeof value == 'number' &&
1215
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1216
+ }
1217
+
1218
+ var isLength_1 = isLength$2;
1219
+
1220
+ var baseGetTag$1 = _baseGetTag,
1221
+ isLength$1 = isLength_1,
1222
+ isObjectLike$2 = isObjectLike_1;
1223
+
1224
+ /** `Object#toString` result references. */
1225
+ var argsTag$1 = '[object Arguments]',
1226
+ arrayTag$1 = '[object Array]',
1227
+ boolTag$2 = '[object Boolean]',
1228
+ dateTag$2 = '[object Date]',
1229
+ errorTag$1 = '[object Error]',
1230
+ funcTag$1 = '[object Function]',
1231
+ mapTag$4 = '[object Map]',
1232
+ numberTag$2 = '[object Number]',
1233
+ objectTag$2 = '[object Object]',
1234
+ regexpTag$2 = '[object RegExp]',
1235
+ setTag$4 = '[object Set]',
1236
+ stringTag$2 = '[object String]',
1237
+ weakMapTag$2 = '[object WeakMap]';
1238
+
1239
+ var arrayBufferTag$2 = '[object ArrayBuffer]',
1240
+ dataViewTag$3 = '[object DataView]',
1241
+ float32Tag$2 = '[object Float32Array]',
1242
+ float64Tag$2 = '[object Float64Array]',
1243
+ int8Tag$2 = '[object Int8Array]',
1244
+ int16Tag$2 = '[object Int16Array]',
1245
+ int32Tag$2 = '[object Int32Array]',
1246
+ uint8Tag$2 = '[object Uint8Array]',
1247
+ uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1248
+ uint16Tag$2 = '[object Uint16Array]',
1249
+ uint32Tag$2 = '[object Uint32Array]';
1250
+
1251
+ /** Used to identify `toStringTag` values of typed arrays. */
1252
+ var typedArrayTags = {};
1253
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1254
+ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1255
+ typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1256
+ typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1257
+ typedArrayTags[uint32Tag$2] = true;
1258
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1259
+ typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1260
+ typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1261
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1262
+ typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
1263
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
1264
+ typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
1265
+ typedArrayTags[weakMapTag$2] = false;
1266
+
1267
+ /**
1268
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1269
+ *
1270
+ * @private
1271
+ * @param {*} value The value to check.
1272
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1273
+ */
1274
+ function baseIsTypedArray$1(value) {
1275
+ return isObjectLike$2(value) &&
1276
+ isLength$1(value.length) && !!typedArrayTags[baseGetTag$1(value)];
1277
+ }
1278
+
1279
+ var _baseIsTypedArray = baseIsTypedArray$1;
1280
+
1281
+ /**
1282
+ * The base implementation of `_.unary` without support for storing metadata.
1283
+ *
1284
+ * @private
1285
+ * @param {Function} func The function to cap arguments for.
1286
+ * @returns {Function} Returns the new capped function.
1287
+ */
1288
+
1289
+ function baseUnary$3(func) {
1290
+ return function(value) {
1291
+ return func(value);
1292
+ };
1293
+ }
1294
+
1295
+ var _baseUnary = baseUnary$3;
1296
+
1297
+ var _nodeUtil = {exports: {}};
1298
+
1299
+ _nodeUtil.exports;
1300
+
1301
+ (function (module, exports) {
1302
+ var freeGlobal = _freeGlobal;
1303
+
1304
+ /** Detect free variable `exports`. */
1305
+ var freeExports = exports && !exports.nodeType && exports;
1306
+
1307
+ /** Detect free variable `module`. */
1308
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1309
+
1310
+ /** Detect the popular CommonJS extension `module.exports`. */
1311
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1312
+
1313
+ /** Detect free variable `process` from Node.js. */
1314
+ var freeProcess = moduleExports && freeGlobal.process;
1315
+
1316
+ /** Used to access faster Node.js helpers. */
1317
+ var nodeUtil = (function() {
1318
+ try {
1319
+ // Use `util.types` for Node.js 10+.
1320
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
1321
+
1322
+ if (types) {
1323
+ return types;
1324
+ }
1325
+
1326
+ // Legacy `process.binding('util')` for Node.js < 10.
1327
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
1328
+ } catch (e) {}
1329
+ }());
1330
+
1331
+ module.exports = nodeUtil;
1332
+ } (_nodeUtil, _nodeUtil.exports));
1333
+
1334
+ var _nodeUtilExports = _nodeUtil.exports;
1335
+
1336
+ var baseIsTypedArray = _baseIsTypedArray,
1337
+ baseUnary$2 = _baseUnary,
1338
+ nodeUtil$2 = _nodeUtilExports;
1339
+
1340
+ /* Node.js helper references. */
1341
+ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
1342
+
1343
+ /**
1344
+ * Checks if `value` is classified as a typed array.
1345
+ *
1346
+ * @static
1347
+ * @memberOf _
1348
+ * @since 3.0.0
1349
+ * @category Lang
1350
+ * @param {*} value The value to check.
1351
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1352
+ * @example
1353
+ *
1354
+ * _.isTypedArray(new Uint8Array);
1355
+ * // => true
1356
+ *
1357
+ * _.isTypedArray([]);
1358
+ * // => false
1359
+ */
1360
+ var isTypedArray$1 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
1361
+
1362
+ var isTypedArray_1 = isTypedArray$1;
1363
+
1364
+ var baseTimes = _baseTimes,
1365
+ isArguments = isArguments_1,
1366
+ isArray$2 = isArray_1,
1367
+ isBuffer$1 = isBufferExports,
1368
+ isIndex = _isIndex,
1369
+ isTypedArray = isTypedArray_1;
1370
+
1371
+ /** Used for built-in method references. */
1372
+ var objectProto$5 = Object.prototype;
1373
+
1374
+ /** Used to check objects for own properties. */
1375
+ var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
1376
+
1377
+ /**
1378
+ * Creates an array of the enumerable property names of the array-like `value`.
1379
+ *
1380
+ * @private
1381
+ * @param {*} value The value to query.
1382
+ * @param {boolean} inherited Specify returning inherited property names.
1383
+ * @returns {Array} Returns the array of property names.
1384
+ */
1385
+ function arrayLikeKeys$2(value, inherited) {
1386
+ var isArr = isArray$2(value),
1387
+ isArg = !isArr && isArguments(value),
1388
+ isBuff = !isArr && !isArg && isBuffer$1(value),
1389
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1390
+ skipIndexes = isArr || isArg || isBuff || isType,
1391
+ result = skipIndexes ? baseTimes(value.length, String) : [],
1392
+ length = result.length;
1393
+
1394
+ for (var key in value) {
1395
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
1396
+ !(skipIndexes && (
1397
+ // Safari 9 has enumerable `arguments.length` in strict mode.
1398
+ key == 'length' ||
1399
+ // Node.js 0.10 has enumerable non-index properties on buffers.
1400
+ (isBuff && (key == 'offset' || key == 'parent')) ||
1401
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
1402
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1403
+ // Skip index properties.
1404
+ isIndex(key, length)
1405
+ ))) {
1406
+ result.push(key);
1407
+ }
1408
+ }
1409
+ return result;
1410
+ }
1411
+
1412
+ var _arrayLikeKeys = arrayLikeKeys$2;
1413
+
1414
+ /** Used for built-in method references. */
1415
+
1416
+ var objectProto$4 = Object.prototype;
1417
+
1418
+ /**
1419
+ * Checks if `value` is likely a prototype object.
1420
+ *
1421
+ * @private
1422
+ * @param {*} value The value to check.
1423
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1424
+ */
1425
+ function isPrototype$3(value) {
1426
+ var Ctor = value && value.constructor,
1427
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
1428
+
1429
+ return value === proto;
1430
+ }
1431
+
1432
+ var _isPrototype = isPrototype$3;
1433
+
1434
+ /**
1435
+ * Creates a unary function that invokes `func` with its argument transformed.
1436
+ *
1437
+ * @private
1438
+ * @param {Function} func The function to wrap.
1439
+ * @param {Function} transform The argument transform.
1440
+ * @returns {Function} Returns the new function.
1441
+ */
1442
+
1443
+ function overArg$2(func, transform) {
1444
+ return function(arg) {
1445
+ return func(transform(arg));
1446
+ };
1447
+ }
1448
+
1449
+ var _overArg = overArg$2;
1450
+
1451
+ var overArg$1 = _overArg;
1452
+
1453
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1454
+ var nativeKeys$1 = overArg$1(Object.keys, Object);
1455
+
1456
+ var _nativeKeys = nativeKeys$1;
1457
+
1458
+ var isPrototype$2 = _isPrototype,
1459
+ nativeKeys = _nativeKeys;
1460
+
1461
+ /** Used for built-in method references. */
1462
+ var objectProto$3 = Object.prototype;
1463
+
1464
+ /** Used to check objects for own properties. */
1465
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1466
+
1467
+ /**
1468
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1469
+ *
1470
+ * @private
1471
+ * @param {Object} object The object to query.
1472
+ * @returns {Array} Returns the array of property names.
1473
+ */
1474
+ function baseKeys$1(object) {
1475
+ if (!isPrototype$2(object)) {
1476
+ return nativeKeys(object);
1477
+ }
1478
+ var result = [];
1479
+ for (var key in Object(object)) {
1480
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
1481
+ result.push(key);
1482
+ }
1483
+ }
1484
+ return result;
1485
+ }
1486
+
1487
+ var _baseKeys = baseKeys$1;
1488
+
1489
+ var isFunction = isFunction_1,
1490
+ isLength = isLength_1;
1491
+
1492
+ /**
1493
+ * Checks if `value` is array-like. A value is considered array-like if it's
1494
+ * not a function and has a `value.length` that's an integer greater than or
1495
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1496
+ *
1497
+ * @static
1498
+ * @memberOf _
1499
+ * @since 4.0.0
1500
+ * @category Lang
1501
+ * @param {*} value The value to check.
1502
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1503
+ * @example
1504
+ *
1505
+ * _.isArrayLike([1, 2, 3]);
1506
+ * // => true
1507
+ *
1508
+ * _.isArrayLike(document.body.children);
1509
+ * // => true
1510
+ *
1511
+ * _.isArrayLike('abc');
1512
+ * // => true
1513
+ *
1514
+ * _.isArrayLike(_.noop);
1515
+ * // => false
1516
+ */
1517
+ function isArrayLike$2(value) {
1518
+ return value != null && isLength(value.length) && !isFunction(value);
1519
+ }
1520
+
1521
+ var isArrayLike_1 = isArrayLike$2;
1522
+
1523
+ var arrayLikeKeys$1 = _arrayLikeKeys,
1524
+ baseKeys = _baseKeys,
1525
+ isArrayLike$1 = isArrayLike_1;
1526
+
1527
+ /**
1528
+ * Creates an array of the own enumerable property names of `object`.
1529
+ *
1530
+ * **Note:** Non-object values are coerced to objects. See the
1531
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1532
+ * for more details.
1533
+ *
1534
+ * @static
1535
+ * @since 0.1.0
1536
+ * @memberOf _
1537
+ * @category Object
1538
+ * @param {Object} object The object to query.
1539
+ * @returns {Array} Returns the array of property names.
1540
+ * @example
1541
+ *
1542
+ * function Foo() {
1543
+ * this.a = 1;
1544
+ * this.b = 2;
1545
+ * }
1546
+ *
1547
+ * Foo.prototype.c = 3;
1548
+ *
1549
+ * _.keys(new Foo);
1550
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1551
+ *
1552
+ * _.keys('hi');
1553
+ * // => ['0', '1']
1554
+ */
1555
+ function keys$3(object) {
1556
+ return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys(object);
1557
+ }
1558
+
1559
+ var keys_1 = keys$3;
1560
+
1561
+ var copyObject$3 = _copyObject,
1562
+ keys$2 = keys_1;
1563
+
1564
+ /**
1565
+ * The base implementation of `_.assign` without support for multiple sources
1566
+ * or `customizer` functions.
1567
+ *
1568
+ * @private
1569
+ * @param {Object} object The destination object.
1570
+ * @param {Object} source The source object.
1571
+ * @returns {Object} Returns `object`.
1572
+ */
1573
+ function baseAssign$1(object, source) {
1574
+ return object && copyObject$3(source, keys$2(source), object);
1575
+ }
1576
+
1577
+ var _baseAssign = baseAssign$1;
1578
+
1579
+ /**
1580
+ * This function is like
1581
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1582
+ * except that it includes inherited enumerable properties.
1583
+ *
1584
+ * @private
1585
+ * @param {Object} object The object to query.
1586
+ * @returns {Array} Returns the array of property names.
1587
+ */
1588
+
1589
+ function nativeKeysIn$1(object) {
1590
+ var result = [];
1591
+ if (object != null) {
1592
+ for (var key in Object(object)) {
1593
+ result.push(key);
1594
+ }
1595
+ }
1596
+ return result;
1597
+ }
1598
+
1599
+ var _nativeKeysIn = nativeKeysIn$1;
1600
+
1601
+ var isObject$2 = isObject_1,
1602
+ isPrototype$1 = _isPrototype,
1603
+ nativeKeysIn = _nativeKeysIn;
1604
+
1605
+ /** Used for built-in method references. */
1606
+ var objectProto$2 = Object.prototype;
1607
+
1608
+ /** Used to check objects for own properties. */
1609
+ var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1610
+
1611
+ /**
1612
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1613
+ *
1614
+ * @private
1615
+ * @param {Object} object The object to query.
1616
+ * @returns {Array} Returns the array of property names.
1617
+ */
1618
+ function baseKeysIn$1(object) {
1619
+ if (!isObject$2(object)) {
1620
+ return nativeKeysIn(object);
1621
+ }
1622
+ var isProto = isPrototype$1(object),
1623
+ result = [];
1624
+
1625
+ for (var key in object) {
1626
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty$1.call(object, key)))) {
1627
+ result.push(key);
1628
+ }
1629
+ }
1630
+ return result;
1631
+ }
1632
+
1633
+ var _baseKeysIn = baseKeysIn$1;
1634
+
1635
+ var arrayLikeKeys = _arrayLikeKeys,
1636
+ baseKeysIn = _baseKeysIn,
1637
+ isArrayLike = isArrayLike_1;
1638
+
1639
+ /**
1640
+ * Creates an array of the own and inherited enumerable property names of `object`.
1641
+ *
1642
+ * **Note:** Non-object values are coerced to objects.
1643
+ *
1644
+ * @static
1645
+ * @memberOf _
1646
+ * @since 3.0.0
1647
+ * @category Object
1648
+ * @param {Object} object The object to query.
1649
+ * @returns {Array} Returns the array of property names.
1650
+ * @example
1651
+ *
1652
+ * function Foo() {
1653
+ * this.a = 1;
1654
+ * this.b = 2;
1655
+ * }
1656
+ *
1657
+ * Foo.prototype.c = 3;
1658
+ *
1659
+ * _.keysIn(new Foo);
1660
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1661
+ */
1662
+ function keysIn$3(object) {
1663
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1664
+ }
1665
+
1666
+ var keysIn_1 = keysIn$3;
1667
+
1668
+ var copyObject$2 = _copyObject,
1669
+ keysIn$2 = keysIn_1;
1670
+
1671
+ /**
1672
+ * The base implementation of `_.assignIn` without support for multiple sources
1673
+ * or `customizer` functions.
1674
+ *
1675
+ * @private
1676
+ * @param {Object} object The destination object.
1677
+ * @param {Object} source The source object.
1678
+ * @returns {Object} Returns `object`.
1679
+ */
1680
+ function baseAssignIn$1(object, source) {
1681
+ return object && copyObject$2(source, keysIn$2(source), object);
1682
+ }
1683
+
1684
+ var _baseAssignIn = baseAssignIn$1;
1685
+
1686
+ var _cloneBuffer = {exports: {}};
1687
+
1688
+ _cloneBuffer.exports;
1689
+
1690
+ (function (module, exports) {
1691
+ var root = _root;
1692
+
1693
+ /** Detect free variable `exports`. */
1694
+ var freeExports = exports && !exports.nodeType && exports;
1695
+
1696
+ /** Detect free variable `module`. */
1697
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1698
+
1699
+ /** Detect the popular CommonJS extension `module.exports`. */
1700
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1701
+
1702
+ /** Built-in value references. */
1703
+ var Buffer = moduleExports ? root.Buffer : undefined,
1704
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1705
+
1706
+ /**
1707
+ * Creates a clone of `buffer`.
1708
+ *
1709
+ * @private
1710
+ * @param {Buffer} buffer The buffer to clone.
1711
+ * @param {boolean} [isDeep] Specify a deep clone.
1712
+ * @returns {Buffer} Returns the cloned buffer.
1713
+ */
1714
+ function cloneBuffer(buffer, isDeep) {
1715
+ if (isDeep) {
1716
+ return buffer.slice();
1717
+ }
1718
+ var length = buffer.length,
1719
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1720
+
1721
+ buffer.copy(result);
1722
+ return result;
1723
+ }
1724
+
1725
+ module.exports = cloneBuffer;
1726
+ } (_cloneBuffer, _cloneBuffer.exports));
1727
+
1728
+ var _cloneBufferExports = _cloneBuffer.exports;
1729
+
1730
+ /**
1731
+ * Copies the values of `source` to `array`.
1732
+ *
1733
+ * @private
1734
+ * @param {Array} source The array to copy values from.
1735
+ * @param {Array} [array=[]] The array to copy values to.
1736
+ * @returns {Array} Returns `array`.
1737
+ */
1738
+
1739
+ function copyArray$1(source, array) {
1740
+ var index = -1,
1741
+ length = source.length;
1742
+
1743
+ array || (array = Array(length));
1744
+ while (++index < length) {
1745
+ array[index] = source[index];
1746
+ }
1747
+ return array;
1748
+ }
1749
+
1750
+ var _copyArray = copyArray$1;
1751
+
1752
+ /**
1753
+ * A specialized version of `_.filter` for arrays without support for
1754
+ * iteratee shorthands.
1755
+ *
1756
+ * @private
1757
+ * @param {Array} [array] The array to iterate over.
1758
+ * @param {Function} predicate The function invoked per iteration.
1759
+ * @returns {Array} Returns the new filtered array.
1760
+ */
1761
+
1762
+ function arrayFilter$1(array, predicate) {
1763
+ var index = -1,
1764
+ length = array == null ? 0 : array.length,
1765
+ resIndex = 0,
1766
+ result = [];
1767
+
1768
+ while (++index < length) {
1769
+ var value = array[index];
1770
+ if (predicate(value, index, array)) {
1771
+ result[resIndex++] = value;
1772
+ }
1773
+ }
1774
+ return result;
1775
+ }
1776
+
1777
+ var _arrayFilter = arrayFilter$1;
1778
+
1779
+ /**
1780
+ * This method returns a new empty array.
1781
+ *
1782
+ * @static
1783
+ * @memberOf _
1784
+ * @since 4.13.0
1785
+ * @category Util
1786
+ * @returns {Array} Returns the new empty array.
1787
+ * @example
1788
+ *
1789
+ * var arrays = _.times(2, _.stubArray);
1790
+ *
1791
+ * console.log(arrays);
1792
+ * // => [[], []]
1793
+ *
1794
+ * console.log(arrays[0] === arrays[1]);
1795
+ * // => false
1796
+ */
1797
+
1798
+ function stubArray$2() {
1799
+ return [];
1800
+ }
1801
+
1802
+ var stubArray_1 = stubArray$2;
1803
+
1804
+ var arrayFilter = _arrayFilter,
1805
+ stubArray$1 = stubArray_1;
1806
+
1807
+ /** Used for built-in method references. */
1808
+ var objectProto$1 = Object.prototype;
1809
+
1810
+ /** Built-in value references. */
1811
+ var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1812
+
1813
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1814
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1815
+
1816
+ /**
1817
+ * Creates an array of the own enumerable symbols of `object`.
1818
+ *
1819
+ * @private
1820
+ * @param {Object} object The object to query.
1821
+ * @returns {Array} Returns the array of symbols.
1822
+ */
1823
+ var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
1824
+ if (object == null) {
1825
+ return [];
1826
+ }
1827
+ object = Object(object);
1828
+ return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1829
+ return propertyIsEnumerable.call(object, symbol);
1830
+ });
1831
+ };
1832
+
1833
+ var _getSymbols = getSymbols$3;
1834
+
1835
+ var copyObject$1 = _copyObject,
1836
+ getSymbols$2 = _getSymbols;
1837
+
1838
+ /**
1839
+ * Copies own symbols of `source` to `object`.
1840
+ *
1841
+ * @private
1842
+ * @param {Object} source The object to copy symbols from.
1843
+ * @param {Object} [object={}] The object to copy symbols to.
1844
+ * @returns {Object} Returns `object`.
1845
+ */
1846
+ function copySymbols$1(source, object) {
1847
+ return copyObject$1(source, getSymbols$2(source), object);
1848
+ }
1849
+
1850
+ var _copySymbols = copySymbols$1;
1851
+
1852
+ /**
1853
+ * Appends the elements of `values` to `array`.
1854
+ *
1855
+ * @private
1856
+ * @param {Array} array The array to modify.
1857
+ * @param {Array} values The values to append.
1858
+ * @returns {Array} Returns `array`.
1859
+ */
1860
+
1861
+ function arrayPush$2(array, values) {
1862
+ var index = -1,
1863
+ length = values.length,
1864
+ offset = array.length;
1865
+
1866
+ while (++index < length) {
1867
+ array[offset + index] = values[index];
1868
+ }
1869
+ return array;
1870
+ }
1871
+
1872
+ var _arrayPush = arrayPush$2;
1873
+
1874
+ var overArg = _overArg;
1875
+
1876
+ /** Built-in value references. */
1877
+ var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
1878
+
1879
+ var _getPrototype = getPrototype$2;
1880
+
1881
+ var arrayPush$1 = _arrayPush,
1882
+ getPrototype$1 = _getPrototype,
1883
+ getSymbols$1 = _getSymbols,
1884
+ stubArray = stubArray_1;
1885
+
1886
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1887
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1888
+
1889
+ /**
1890
+ * Creates an array of the own and inherited enumerable symbols of `object`.
1891
+ *
1892
+ * @private
1893
+ * @param {Object} object The object to query.
1894
+ * @returns {Array} Returns the array of symbols.
1895
+ */
1896
+ var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
1897
+ var result = [];
1898
+ while (object) {
1899
+ arrayPush$1(result, getSymbols$1(object));
1900
+ object = getPrototype$1(object);
1901
+ }
1902
+ return result;
1903
+ };
1904
+
1905
+ var _getSymbolsIn = getSymbolsIn$2;
1906
+
1907
+ var copyObject = _copyObject,
1908
+ getSymbolsIn$1 = _getSymbolsIn;
1909
+
1910
+ /**
1911
+ * Copies own and inherited symbols of `source` to `object`.
1912
+ *
1913
+ * @private
1914
+ * @param {Object} source The object to copy symbols from.
1915
+ * @param {Object} [object={}] The object to copy symbols to.
1916
+ * @returns {Object} Returns `object`.
1917
+ */
1918
+ function copySymbolsIn$1(source, object) {
1919
+ return copyObject(source, getSymbolsIn$1(source), object);
1920
+ }
1921
+
1922
+ var _copySymbolsIn = copySymbolsIn$1;
1923
+
1924
+ var arrayPush = _arrayPush,
1925
+ isArray$1 = isArray_1;
1926
+
1927
+ /**
1928
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1929
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1930
+ * symbols of `object`.
1931
+ *
1932
+ * @private
1933
+ * @param {Object} object The object to query.
1934
+ * @param {Function} keysFunc The function to get the keys of `object`.
1935
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1936
+ * @returns {Array} Returns the array of property names and symbols.
1937
+ */
1938
+ function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
1939
+ var result = keysFunc(object);
1940
+ return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
1941
+ }
1942
+
1943
+ var _baseGetAllKeys = baseGetAllKeys$2;
1944
+
1945
+ var baseGetAllKeys$1 = _baseGetAllKeys,
1946
+ getSymbols = _getSymbols,
1947
+ keys$1 = keys_1;
1948
+
1949
+ /**
1950
+ * Creates an array of own enumerable property names and symbols of `object`.
1951
+ *
1952
+ * @private
1953
+ * @param {Object} object The object to query.
1954
+ * @returns {Array} Returns the array of property names and symbols.
1955
+ */
1956
+ function getAllKeys$1(object) {
1957
+ return baseGetAllKeys$1(object, keys$1, getSymbols);
1958
+ }
1959
+
1960
+ var _getAllKeys = getAllKeys$1;
1961
+
1962
+ var baseGetAllKeys = _baseGetAllKeys,
1963
+ getSymbolsIn = _getSymbolsIn,
1964
+ keysIn$1 = keysIn_1;
1965
+
1966
+ /**
1967
+ * Creates an array of own and inherited enumerable property names and
1968
+ * symbols of `object`.
1969
+ *
1970
+ * @private
1971
+ * @param {Object} object The object to query.
1972
+ * @returns {Array} Returns the array of property names and symbols.
1973
+ */
1974
+ function getAllKeysIn$1(object) {
1975
+ return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
1976
+ }
1977
+
1978
+ var _getAllKeysIn = getAllKeysIn$1;
1979
+
1980
+ var getNative$3 = _getNative,
1981
+ root$4 = _root;
1982
+
1983
+ /* Built-in method references that are verified to be native. */
1984
+ var DataView$1 = getNative$3(root$4, 'DataView');
1985
+
1986
+ var _DataView = DataView$1;
1987
+
1988
+ var getNative$2 = _getNative,
1989
+ root$3 = _root;
1990
+
1991
+ /* Built-in method references that are verified to be native. */
1992
+ var Promise$2 = getNative$2(root$3, 'Promise');
1993
+
1994
+ var _Promise = Promise$2;
1995
+
1996
+ var getNative$1 = _getNative,
1997
+ root$2 = _root;
1998
+
1999
+ /* Built-in method references that are verified to be native. */
2000
+ var Set$1 = getNative$1(root$2, 'Set');
2001
+
2002
+ var _Set = Set$1;
2003
+
2004
+ var getNative = _getNative,
2005
+ root$1 = _root;
2006
+
2007
+ /* Built-in method references that are verified to be native. */
2008
+ var WeakMap$1 = getNative(root$1, 'WeakMap');
2009
+
2010
+ var _WeakMap = WeakMap$1;
2011
+
2012
+ var DataView = _DataView,
2013
+ Map$1 = _Map,
2014
+ Promise$1 = _Promise,
2015
+ Set = _Set,
2016
+ WeakMap = _WeakMap,
2017
+ baseGetTag = _baseGetTag,
2018
+ toSource = _toSource;
2019
+
2020
+ /** `Object#toString` result references. */
2021
+ var mapTag$3 = '[object Map]',
2022
+ objectTag$1 = '[object Object]',
2023
+ promiseTag = '[object Promise]',
2024
+ setTag$3 = '[object Set]',
2025
+ weakMapTag$1 = '[object WeakMap]';
2026
+
2027
+ var dataViewTag$2 = '[object DataView]';
2028
+
2029
+ /** Used to detect maps, sets, and weakmaps. */
2030
+ var dataViewCtorString = toSource(DataView),
2031
+ mapCtorString = toSource(Map$1),
2032
+ promiseCtorString = toSource(Promise$1),
2033
+ setCtorString = toSource(Set),
2034
+ weakMapCtorString = toSource(WeakMap);
2035
+
2036
+ /**
2037
+ * Gets the `toStringTag` of `value`.
2038
+ *
2039
+ * @private
2040
+ * @param {*} value The value to query.
2041
+ * @returns {string} Returns the `toStringTag`.
2042
+ */
2043
+ var getTag$3 = baseGetTag;
2044
+
2045
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2046
+ if ((DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
2047
+ (Map$1 && getTag$3(new Map$1) != mapTag$3) ||
2048
+ (Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag) ||
2049
+ (Set && getTag$3(new Set) != setTag$3) ||
2050
+ (WeakMap && getTag$3(new WeakMap) != weakMapTag$1)) {
2051
+ getTag$3 = function(value) {
2052
+ var result = baseGetTag(value),
2053
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
2054
+ ctorString = Ctor ? toSource(Ctor) : '';
2055
+
2056
+ if (ctorString) {
2057
+ switch (ctorString) {
2058
+ case dataViewCtorString: return dataViewTag$2;
2059
+ case mapCtorString: return mapTag$3;
2060
+ case promiseCtorString: return promiseTag;
2061
+ case setCtorString: return setTag$3;
2062
+ case weakMapCtorString: return weakMapTag$1;
2063
+ }
2064
+ }
2065
+ return result;
2066
+ };
2067
+ }
2068
+
2069
+ var _getTag = getTag$3;
2070
+
2071
+ /** Used for built-in method references. */
2072
+
2073
+ var objectProto = Object.prototype;
2074
+
2075
+ /** Used to check objects for own properties. */
2076
+ var hasOwnProperty = objectProto.hasOwnProperty;
2077
+
2078
+ /**
2079
+ * Initializes an array clone.
2080
+ *
2081
+ * @private
2082
+ * @param {Array} array The array to clone.
2083
+ * @returns {Array} Returns the initialized clone.
2084
+ */
2085
+ function initCloneArray$1(array) {
2086
+ var length = array.length,
2087
+ result = new array.constructor(length);
2088
+
2089
+ // Add properties assigned by `RegExp#exec`.
2090
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2091
+ result.index = array.index;
2092
+ result.input = array.input;
2093
+ }
2094
+ return result;
2095
+ }
2096
+
2097
+ var _initCloneArray = initCloneArray$1;
2098
+
2099
+ var root = _root;
2100
+
2101
+ /** Built-in value references. */
2102
+ var Uint8Array$1 = root.Uint8Array;
2103
+
2104
+ var _Uint8Array = Uint8Array$1;
2105
+
2106
+ var Uint8Array = _Uint8Array;
2107
+
2108
+ /**
2109
+ * Creates a clone of `arrayBuffer`.
2110
+ *
2111
+ * @private
2112
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2113
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
2114
+ */
2115
+ function cloneArrayBuffer$3(arrayBuffer) {
2116
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2117
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
2118
+ return result;
2119
+ }
2120
+
2121
+ var _cloneArrayBuffer = cloneArrayBuffer$3;
2122
+
2123
+ var cloneArrayBuffer$2 = _cloneArrayBuffer;
2124
+
2125
+ /**
2126
+ * Creates a clone of `dataView`.
2127
+ *
2128
+ * @private
2129
+ * @param {Object} dataView The data view to clone.
2130
+ * @param {boolean} [isDeep] Specify a deep clone.
2131
+ * @returns {Object} Returns the cloned data view.
2132
+ */
2133
+ function cloneDataView$1(dataView, isDeep) {
2134
+ var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
2135
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2136
+ }
2137
+
2138
+ var _cloneDataView = cloneDataView$1;
2139
+
2140
+ /** Used to match `RegExp` flags from their coerced string values. */
2141
+
2142
+ var reFlags = /\w*$/;
2143
+
2144
+ /**
2145
+ * Creates a clone of `regexp`.
2146
+ *
2147
+ * @private
2148
+ * @param {Object} regexp The regexp to clone.
2149
+ * @returns {Object} Returns the cloned regexp.
2150
+ */
2151
+ function cloneRegExp$1(regexp) {
2152
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2153
+ result.lastIndex = regexp.lastIndex;
2154
+ return result;
2155
+ }
2156
+
2157
+ var _cloneRegExp = cloneRegExp$1;
2158
+
2159
+ var Symbol = _Symbol;
2160
+
2161
+ /** Used to convert symbols to primitives and strings. */
2162
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
2163
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2164
+
2165
+ /**
2166
+ * Creates a clone of the `symbol` object.
2167
+ *
2168
+ * @private
2169
+ * @param {Object} symbol The symbol object to clone.
2170
+ * @returns {Object} Returns the cloned symbol object.
2171
+ */
2172
+ function cloneSymbol$1(symbol) {
2173
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2174
+ }
2175
+
2176
+ var _cloneSymbol = cloneSymbol$1;
2177
+
2178
+ var cloneArrayBuffer$1 = _cloneArrayBuffer;
2179
+
2180
+ /**
2181
+ * Creates a clone of `typedArray`.
2182
+ *
2183
+ * @private
2184
+ * @param {Object} typedArray The typed array to clone.
2185
+ * @param {boolean} [isDeep] Specify a deep clone.
2186
+ * @returns {Object} Returns the cloned typed array.
2187
+ */
2188
+ function cloneTypedArray$1(typedArray, isDeep) {
2189
+ var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
2190
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2191
+ }
2192
+
2193
+ var _cloneTypedArray = cloneTypedArray$1;
2194
+
2195
+ var cloneArrayBuffer = _cloneArrayBuffer,
2196
+ cloneDataView = _cloneDataView,
2197
+ cloneRegExp = _cloneRegExp,
2198
+ cloneSymbol = _cloneSymbol,
2199
+ cloneTypedArray = _cloneTypedArray;
2200
+
2201
+ /** `Object#toString` result references. */
2202
+ var boolTag$1 = '[object Boolean]',
2203
+ dateTag$1 = '[object Date]',
2204
+ mapTag$2 = '[object Map]',
2205
+ numberTag$1 = '[object Number]',
2206
+ regexpTag$1 = '[object RegExp]',
2207
+ setTag$2 = '[object Set]',
2208
+ stringTag$1 = '[object String]',
2209
+ symbolTag$1 = '[object Symbol]';
2210
+
2211
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
2212
+ dataViewTag$1 = '[object DataView]',
2213
+ float32Tag$1 = '[object Float32Array]',
2214
+ float64Tag$1 = '[object Float64Array]',
2215
+ int8Tag$1 = '[object Int8Array]',
2216
+ int16Tag$1 = '[object Int16Array]',
2217
+ int32Tag$1 = '[object Int32Array]',
2218
+ uint8Tag$1 = '[object Uint8Array]',
2219
+ uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2220
+ uint16Tag$1 = '[object Uint16Array]',
2221
+ uint32Tag$1 = '[object Uint32Array]';
2222
+
2223
+ /**
2224
+ * Initializes an object clone based on its `toStringTag`.
2225
+ *
2226
+ * **Note:** This function only supports cloning values with tags of
2227
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2228
+ *
2229
+ * @private
2230
+ * @param {Object} object The object to clone.
2231
+ * @param {string} tag The `toStringTag` of the object to clone.
2232
+ * @param {boolean} [isDeep] Specify a deep clone.
2233
+ * @returns {Object} Returns the initialized clone.
2234
+ */
2235
+ function initCloneByTag$1(object, tag, isDeep) {
2236
+ var Ctor = object.constructor;
2237
+ switch (tag) {
2238
+ case arrayBufferTag$1:
2239
+ return cloneArrayBuffer(object);
2240
+
2241
+ case boolTag$1:
2242
+ case dateTag$1:
2243
+ return new Ctor(+object);
2244
+
2245
+ case dataViewTag$1:
2246
+ return cloneDataView(object, isDeep);
2247
+
2248
+ case float32Tag$1: case float64Tag$1:
2249
+ case int8Tag$1: case int16Tag$1: case int32Tag$1:
2250
+ case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2251
+ return cloneTypedArray(object, isDeep);
2252
+
2253
+ case mapTag$2:
2254
+ return new Ctor;
2255
+
2256
+ case numberTag$1:
2257
+ case stringTag$1:
2258
+ return new Ctor(object);
2259
+
2260
+ case regexpTag$1:
2261
+ return cloneRegExp(object);
2262
+
2263
+ case setTag$2:
2264
+ return new Ctor;
2265
+
2266
+ case symbolTag$1:
2267
+ return cloneSymbol(object);
2268
+ }
2269
+ }
2270
+
2271
+ var _initCloneByTag = initCloneByTag$1;
2272
+
2273
+ var isObject$1 = isObject_1;
2274
+
2275
+ /** Built-in value references. */
2276
+ var objectCreate = Object.create;
2277
+
2278
+ /**
2279
+ * The base implementation of `_.create` without support for assigning
2280
+ * properties to the created object.
2281
+ *
2282
+ * @private
2283
+ * @param {Object} proto The object to inherit from.
2284
+ * @returns {Object} Returns the new object.
2285
+ */
2286
+ var baseCreate$1 = (function() {
2287
+ function object() {}
2288
+ return function(proto) {
2289
+ if (!isObject$1(proto)) {
2290
+ return {};
2291
+ }
2292
+ if (objectCreate) {
2293
+ return objectCreate(proto);
2294
+ }
2295
+ object.prototype = proto;
2296
+ var result = new object;
2297
+ object.prototype = undefined;
2298
+ return result;
2299
+ };
2300
+ }());
2301
+
2302
+ var _baseCreate = baseCreate$1;
2303
+
2304
+ var baseCreate = _baseCreate,
2305
+ getPrototype = _getPrototype,
2306
+ isPrototype = _isPrototype;
2307
+
2308
+ /**
2309
+ * Initializes an object clone.
2310
+ *
2311
+ * @private
2312
+ * @param {Object} object The object to clone.
2313
+ * @returns {Object} Returns the initialized clone.
2314
+ */
2315
+ function initCloneObject$1(object) {
2316
+ return (typeof object.constructor == 'function' && !isPrototype(object))
2317
+ ? baseCreate(getPrototype(object))
2318
+ : {};
2319
+ }
2320
+
2321
+ var _initCloneObject = initCloneObject$1;
2322
+
2323
+ var getTag$2 = _getTag,
2324
+ isObjectLike$1 = isObjectLike_1;
2325
+
2326
+ /** `Object#toString` result references. */
2327
+ var mapTag$1 = '[object Map]';
2328
+
2329
+ /**
2330
+ * The base implementation of `_.isMap` without Node.js optimizations.
2331
+ *
2332
+ * @private
2333
+ * @param {*} value The value to check.
2334
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2335
+ */
2336
+ function baseIsMap$1(value) {
2337
+ return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
2338
+ }
2339
+
2340
+ var _baseIsMap = baseIsMap$1;
2341
+
2342
+ var baseIsMap = _baseIsMap,
2343
+ baseUnary$1 = _baseUnary,
2344
+ nodeUtil$1 = _nodeUtilExports;
2345
+
2346
+ /* Node.js helper references. */
2347
+ var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
2348
+
2349
+ /**
2350
+ * Checks if `value` is classified as a `Map` object.
2351
+ *
2352
+ * @static
2353
+ * @memberOf _
2354
+ * @since 4.3.0
2355
+ * @category Lang
2356
+ * @param {*} value The value to check.
2357
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2358
+ * @example
2359
+ *
2360
+ * _.isMap(new Map);
2361
+ * // => true
2362
+ *
2363
+ * _.isMap(new WeakMap);
2364
+ * // => false
2365
+ */
2366
+ var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
2367
+
2368
+ var isMap_1 = isMap$1;
2369
+
2370
+ var getTag$1 = _getTag,
2371
+ isObjectLike = isObjectLike_1;
2372
+
2373
+ /** `Object#toString` result references. */
2374
+ var setTag$1 = '[object Set]';
2375
+
2376
+ /**
2377
+ * The base implementation of `_.isSet` without Node.js optimizations.
2378
+ *
2379
+ * @private
2380
+ * @param {*} value The value to check.
2381
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2382
+ */
2383
+ function baseIsSet$1(value) {
2384
+ return isObjectLike(value) && getTag$1(value) == setTag$1;
2385
+ }
2386
+
2387
+ var _baseIsSet = baseIsSet$1;
2388
+
2389
+ var baseIsSet = _baseIsSet,
2390
+ baseUnary = _baseUnary,
2391
+ nodeUtil = _nodeUtilExports;
2392
+
2393
+ /* Node.js helper references. */
2394
+ var nodeIsSet = nodeUtil && nodeUtil.isSet;
2395
+
2396
+ /**
2397
+ * Checks if `value` is classified as a `Set` object.
2398
+ *
2399
+ * @static
2400
+ * @memberOf _
2401
+ * @since 4.3.0
2402
+ * @category Lang
2403
+ * @param {*} value The value to check.
2404
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2405
+ * @example
2406
+ *
2407
+ * _.isSet(new Set);
2408
+ * // => true
2409
+ *
2410
+ * _.isSet(new WeakSet);
2411
+ * // => false
2412
+ */
2413
+ var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2414
+
2415
+ var isSet_1 = isSet$1;
2416
+
2417
+ var Stack = _Stack,
2418
+ arrayEach = _arrayEach,
2419
+ assignValue = _assignValue,
2420
+ baseAssign = _baseAssign,
2421
+ baseAssignIn = _baseAssignIn,
2422
+ cloneBuffer = _cloneBufferExports,
2423
+ copyArray = _copyArray,
2424
+ copySymbols = _copySymbols,
2425
+ copySymbolsIn = _copySymbolsIn,
2426
+ getAllKeys = _getAllKeys,
2427
+ getAllKeysIn = _getAllKeysIn,
2428
+ getTag = _getTag,
2429
+ initCloneArray = _initCloneArray,
2430
+ initCloneByTag = _initCloneByTag,
2431
+ initCloneObject = _initCloneObject,
2432
+ isArray = isArray_1,
2433
+ isBuffer = isBufferExports,
2434
+ isMap = isMap_1,
2435
+ isObject = isObject_1,
2436
+ isSet = isSet_1,
2437
+ keys = keys_1,
2438
+ keysIn = keysIn_1;
2439
+
2440
+ /** Used to compose bitmasks for cloning. */
2441
+ var CLONE_DEEP_FLAG$1 = 1,
2442
+ CLONE_FLAT_FLAG = 2,
2443
+ CLONE_SYMBOLS_FLAG$1 = 4;
2444
+
2445
+ /** `Object#toString` result references. */
2446
+ var argsTag = '[object Arguments]',
2447
+ arrayTag = '[object Array]',
2448
+ boolTag = '[object Boolean]',
2449
+ dateTag = '[object Date]',
2450
+ errorTag = '[object Error]',
2451
+ funcTag = '[object Function]',
2452
+ genTag = '[object GeneratorFunction]',
2453
+ mapTag = '[object Map]',
2454
+ numberTag = '[object Number]',
2455
+ objectTag = '[object Object]',
2456
+ regexpTag = '[object RegExp]',
2457
+ setTag = '[object Set]',
2458
+ stringTag = '[object String]',
2459
+ symbolTag = '[object Symbol]',
2460
+ weakMapTag = '[object WeakMap]';
2461
+
2462
+ var arrayBufferTag = '[object ArrayBuffer]',
2463
+ dataViewTag = '[object DataView]',
2464
+ float32Tag = '[object Float32Array]',
2465
+ float64Tag = '[object Float64Array]',
2466
+ int8Tag = '[object Int8Array]',
2467
+ int16Tag = '[object Int16Array]',
2468
+ int32Tag = '[object Int32Array]',
2469
+ uint8Tag = '[object Uint8Array]',
2470
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2471
+ uint16Tag = '[object Uint16Array]',
2472
+ uint32Tag = '[object Uint32Array]';
2473
+
2474
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
2475
+ var cloneableTags = {};
2476
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
2477
+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2478
+ cloneableTags[boolTag] = cloneableTags[dateTag] =
2479
+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2480
+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2481
+ cloneableTags[int32Tag] = cloneableTags[mapTag] =
2482
+ cloneableTags[numberTag] = cloneableTags[objectTag] =
2483
+ cloneableTags[regexpTag] = cloneableTags[setTag] =
2484
+ cloneableTags[stringTag] = cloneableTags[symbolTag] =
2485
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2486
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2487
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
2488
+ cloneableTags[weakMapTag] = false;
2489
+
2490
+ /**
2491
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2492
+ * traversed objects.
2493
+ *
2494
+ * @private
2495
+ * @param {*} value The value to clone.
2496
+ * @param {boolean} bitmask The bitmask flags.
2497
+ * 1 - Deep clone
2498
+ * 2 - Flatten inherited properties
2499
+ * 4 - Clone symbols
2500
+ * @param {Function} [customizer] The function to customize cloning.
2501
+ * @param {string} [key] The key of `value`.
2502
+ * @param {Object} [object] The parent object of `value`.
2503
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2504
+ * @returns {*} Returns the cloned value.
2505
+ */
2506
+ function baseClone$1(value, bitmask, customizer, key, object, stack) {
2507
+ var result,
2508
+ isDeep = bitmask & CLONE_DEEP_FLAG$1,
2509
+ isFlat = bitmask & CLONE_FLAT_FLAG,
2510
+ isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2511
+
2512
+ if (customizer) {
2513
+ result = object ? customizer(value, key, object, stack) : customizer(value);
2514
+ }
2515
+ if (result !== undefined) {
2516
+ return result;
2517
+ }
2518
+ if (!isObject(value)) {
2519
+ return value;
2520
+ }
2521
+ var isArr = isArray(value);
2522
+ if (isArr) {
2523
+ result = initCloneArray(value);
2524
+ if (!isDeep) {
2525
+ return copyArray(value, result);
2526
+ }
2527
+ } else {
2528
+ var tag = getTag(value),
2529
+ isFunc = tag == funcTag || tag == genTag;
2530
+
2531
+ if (isBuffer(value)) {
2532
+ return cloneBuffer(value, isDeep);
2533
+ }
2534
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2535
+ result = (isFlat || isFunc) ? {} : initCloneObject(value);
2536
+ if (!isDeep) {
2537
+ return isFlat
2538
+ ? copySymbolsIn(value, baseAssignIn(result, value))
2539
+ : copySymbols(value, baseAssign(result, value));
2540
+ }
2541
+ } else {
2542
+ if (!cloneableTags[tag]) {
2543
+ return object ? value : {};
2544
+ }
2545
+ result = initCloneByTag(value, tag, isDeep);
2546
+ }
2547
+ }
2548
+ // Check for circular references and return its corresponding clone.
2549
+ stack || (stack = new Stack);
2550
+ var stacked = stack.get(value);
2551
+ if (stacked) {
2552
+ return stacked;
2553
+ }
2554
+ stack.set(value, result);
2555
+
2556
+ if (isSet(value)) {
2557
+ value.forEach(function(subValue) {
2558
+ result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
2559
+ });
2560
+ } else if (isMap(value)) {
2561
+ value.forEach(function(subValue, key) {
2562
+ result.set(key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
2563
+ });
2564
+ }
2565
+
2566
+ var keysFunc = isFull
2567
+ ? (isFlat ? getAllKeysIn : getAllKeys)
2568
+ : (isFlat ? keysIn : keys);
2569
+
2570
+ var props = isArr ? undefined : keysFunc(value);
2571
+ arrayEach(props || value, function(subValue, key) {
2572
+ if (props) {
2573
+ key = subValue;
2574
+ subValue = value[key];
2575
+ }
2576
+ // Recursively populate clone (susceptible to call stack limits).
2577
+ assignValue(result, key, baseClone$1(subValue, bitmask, customizer, key, value, stack));
2578
+ });
2579
+ return result;
2580
+ }
2581
+
2582
+ var _baseClone = baseClone$1;
2583
+
2584
+ var baseClone = _baseClone;
2585
+
2586
+ /** Used to compose bitmasks for cloning. */
2587
+ var CLONE_DEEP_FLAG = 1,
2588
+ CLONE_SYMBOLS_FLAG = 4;
2589
+
2590
+ /**
2591
+ * This method is like `_.clone` except that it recursively clones `value`.
2592
+ *
2593
+ * @static
2594
+ * @memberOf _
2595
+ * @since 1.0.0
2596
+ * @category Lang
2597
+ * @param {*} value The value to recursively clone.
2598
+ * @returns {*} Returns the deep cloned value.
2599
+ * @see _.clone
2600
+ * @example
2601
+ *
2602
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
2603
+ *
2604
+ * var deep = _.cloneDeep(objects);
2605
+ * console.log(deep[0] === objects[0]);
2606
+ * // => false
2607
+ */
2608
+ function cloneDeep(value) {
2609
+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2610
+ }
2611
+
2612
+ var cloneDeep_1 = cloneDeep;
2613
+
2614
+ var cloneDeep$1 = /*@__PURE__*/getDefaultExportFromCjs(cloneDeep_1);
2615
+
2616
+ function uniqueNodes(nodes) {
2617
+ const result = new Map();
2618
+ nodes.forEach(node => {
2619
+ result.set(`${node.__typename}-${node.id}`, node);
2620
+ });
2621
+ return Array.from(result.values());
2622
+ }
2623
+
2624
+ function createEdge(node) {
2625
+ return {
2626
+ node: node,
2627
+ cursor: "",
2628
+ __typename: `${node.__typename}Edge`,
2629
+ };
2630
+ }
2631
+ function uniqueEdges(edges) {
2632
+ const result = new Map();
2633
+ edges.forEach(edge => {
2634
+ result.set(`${edge.__typename}-${edge.node.__typename}-${edge.node.id}`, edge);
2635
+ });
2636
+ return Array.from(result.values());
2637
+ }
2638
+
2639
+ const { useQuery } = apolloClient;
2640
+ function useCollectionQuery({ query, queryOptions, getCollectionByPath, subscription, }) {
2641
+ var _a, _b;
2642
+ const { data, loading, refetch, error, fetchMore, subscribeToMore } = useQuery(query, queryOptions);
2643
+ const isMounted = useIsMounted();
2644
+ const [loadingRefresh, setLoadingRefresh] = useState(false);
2645
+ const [loadingNextPage, setLoadingNextPage] = useState(false);
2646
+ const [hookError, setHookError] = useState();
2647
+ const loadingInitialContent = loading && !loadingRefresh && !loadingNextPage;
2648
+ const isSearching = !!((_a = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.variables) === null || _a === void 0 ? void 0 : _a.searchTerm);
2649
+ const refresh = useCallback(() => {
2650
+ if (loadingInitialContent || loadingRefresh) {
2651
+ return;
2652
+ }
2653
+ setLoadingRefresh(true);
2654
+ fetchMore({
2655
+ // a workaround fix for the error described in this post
2656
+ // https://github.com/apollographql/apollo-client/issues/7491#issuecomment-767985363
2657
+ // These changes can be reverted once we can update to version 3.4
2658
+ // (the current release candidate)
2659
+ variables: {},
2660
+ updateQuery: (prev, { fetchMoreResult }) => fetchMoreResult || prev,
2661
+ })
2662
+ .catch(err => config.errorNotifier("Refetch Error", err))
2663
+ .finally(() => {
2664
+ if (isMounted.current) {
2665
+ setLoadingRefresh(false);
2666
+ }
2667
+ });
2668
+ }, [
2669
+ loadingInitialContent,
2670
+ loadingRefresh,
2671
+ setLoadingRefresh,
2672
+ refetch,
2673
+ isMounted,
2674
+ ]);
2675
+ const nextPage = useCallback(() => {
2676
+ var _a;
2677
+ if (loadingInitialContent || loadingRefresh || loadingNextPage) {
2678
+ return;
2679
+ }
2680
+ const pageInfo = (_a = getCollectionByPath(data)) === null || _a === void 0 ? void 0 : _a.pageInfo;
2681
+ if (!pageInfo || !pageInfo.hasNextPage) {
2682
+ return;
2683
+ }
2684
+ setLoadingNextPage(true);
2685
+ setHookError(undefined);
2686
+ fetchMore({
2687
+ variables: {
2688
+ cursor: pageInfo.endCursor,
2689
+ },
2690
+ updateQuery: (prev, { fetchMoreResult }) => fetchMoreUpdateQueryHandler(prev, fetchMoreResult, getCollectionByPath),
2691
+ })
2692
+ .catch(err => {
2693
+ config.errorNotifier("FetchMore Error", err);
2694
+ setHookError(err);
2695
+ })
2696
+ .finally(() => {
2697
+ if (isMounted.current) {
2698
+ setLoadingNextPage(false);
2699
+ }
2700
+ });
2701
+ }, [
2702
+ data,
2703
+ loadingInitialContent,
2704
+ loadingRefresh,
2705
+ fetchMore,
2706
+ loadingNextPage,
2707
+ setLoadingNextPage,
2708
+ getCollectionByPath,
2709
+ isMounted,
2710
+ ]);
2711
+ useEffect(() => {
2712
+ if (subscription == undefined)
2713
+ return;
2714
+ const subscriptionOptions = subscription.options || {};
2715
+ // Reset this state so we can handle errors from the subscription
2716
+ setHookError(undefined);
2717
+ return subscribeToMore(Object.assign(Object.assign({}, subscriptionOptions), { document: subscription.document, updateQuery: (prev, { subscriptionData }) => subscribeToMoreHandler(isSearching, prev, getCollectionByPath, subscriptionData === null || subscriptionData === void 0 ? void 0 : subscriptionData.data, subscription.getNodeByPath), onError: err => {
2718
+ config.errorNotifier("Subscribe to More Error", err);
2719
+ setHookError(err);
2720
+ } }));
2721
+ },
2722
+ // Disabling this linter so we can force this only run once. If we didn't
2723
+ // do this we would need to ensure subscription, subscribeToMore, and getNodeByPath
2724
+ // all use useCallback.
2725
+ [(_b = queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.variables) === null || _b === void 0 ? void 0 : _b.searchTerm]);
2726
+ const combinedError = error || hookError;
2727
+ return {
2728
+ data,
2729
+ error: combinedError,
2730
+ refresh,
2731
+ loadingRefresh,
2732
+ nextPage,
2733
+ loadingNextPage,
2734
+ loadingInitialContent,
2735
+ };
2736
+ }
2737
+ /**
2738
+ * The following method uses an `output` variable, and indirectly modifies it through the `outputCollection` variable.
2739
+ * This type of indirect modification is prone to bugs, but I couldn't think of a better way to write this code.
2740
+ *
2741
+ * Here's what I was balancing:
2742
+ * 1. We need to copy the structure of prev to ensure that when we're combining two objects, we're not losing properties
2743
+ * 2. We need to extract a key from an unknown path that's given to us by getCollectionByPath and then we need to modify
2744
+ * that, and ensure that it's properly set on the cloned output object.
2745
+ * 3. We want to keep the interface to this hook as simple and easy to use as possible
2746
+ *
2747
+ * The alternative approaches that were rejected:
2748
+ * 1. We replace the getCollectionByPath with a keyPath string. (Eg. "data.conversation.message") and then we use lodash
2749
+ * `get` and `set` which should remove all the object manipulation. But, this approach loses us the type safety that
2750
+ * getCollectionByPath gives us
2751
+ * 2. We could add a setCollection function to the list of arguments for this hook. This leaves us with type safety but
2752
+ * makes the `useCollectionQuery` interface more complicated by adding arguments
2753
+ */
2754
+ function fetchMoreUpdateQueryHandler(prev, fetchMoreResult, getCollectionByPath) {
2755
+ const nextCollection = getCollectionByPath(fetchMoreResult);
2756
+ const output = cloneDeep$1(prev);
2757
+ const outputCollection = getCollectionByPath(output);
2758
+ if (outputCollection === undefined || nextCollection === undefined) {
2759
+ return output;
2760
+ }
2761
+ if (outputCollection.nodes && nextCollection.nodes) {
2762
+ outputCollection.nodes = getUpdatedNodes(outputCollection.nodes, nextCollection.nodes);
2763
+ }
2764
+ if (outputCollection.edges && nextCollection.edges) {
2765
+ outputCollection.edges = getUpdatedEdges(outputCollection.edges, nextCollection.edges);
2766
+ }
2767
+ Object.assign(outputCollection, Object.assign({ pageInfo: cloneDeep$1(nextCollection.pageInfo) }, getTotalCount(nextCollection.totalCount)));
2768
+ return output;
2769
+ }
2770
+ function subscribeToMoreHandler(isSearching, prev, getCollectionByPath, subscriptionData, getNodeByPath) {
2771
+ const node = getNodeByPath(subscriptionData);
2772
+ const output = cloneDeep$1(prev);
2773
+ const outputCollection = getCollectionByPath(output);
2774
+ if (outputCollection == undefined || node == undefined)
2775
+ return output;
2776
+ if (isAlreadyUpdated(outputCollection, node) || isSearching) {
2777
+ return prev;
2778
+ }
2779
+ if (outputCollection.nodes) {
2780
+ outputCollection.nodes = getUpdatedNodes(outputCollection.nodes, [node], false);
2781
+ }
2782
+ if (outputCollection.edges) {
2783
+ outputCollection.edges = getUpdatedEdges(outputCollection.edges, [createEdge(node)], false);
2784
+ }
2785
+ Object.assign(outputCollection, Object.assign({ pageInfo: cloneDeep$1(outputCollection.pageInfo) }, getTotalCount(outputCollection.totalCount, 1)));
2786
+ return output;
2787
+ }
2788
+ function getTotalCount(totalCount, additionalCount = 0) {
2789
+ return totalCount !== undefined
2790
+ ? { totalCount: totalCount + additionalCount }
2791
+ : {};
2792
+ }
2793
+ function isAlreadyUpdated(outputCollection, newNode) {
2794
+ let edgesAlreadyUpdated = true;
2795
+ let nodesAlreadyUpdated = true;
2796
+ if (outputCollection.edges) {
2797
+ edgesAlreadyUpdated = outputCollection.edges.some(edge => {
2798
+ return edge.node.id === newNode.id;
2799
+ });
2800
+ }
2801
+ if (outputCollection.nodes) {
2802
+ nodesAlreadyUpdated = outputCollection.nodes.some(node => {
2803
+ return node.id === newNode.id;
2804
+ });
2805
+ }
2806
+ return edgesAlreadyUpdated && nodesAlreadyUpdated;
2807
+ }
2808
+ function getUpdatedEdges(prevEdges, nextEdges, appendToEnd = true) {
2809
+ const newEdges = appendToEnd
2810
+ ? [...prevEdges, ...nextEdges]
2811
+ : [...nextEdges, ...prevEdges];
2812
+ return uniqueEdges(newEdges);
2813
+ }
2814
+ function getUpdatedNodes(prevNodes, nextNodes, appendToEnd = true) {
2815
+ const newNodes = appendToEnd
2816
+ ? [...prevNodes, ...nextNodes]
2817
+ : [...nextNodes, ...prevNodes];
2818
+ return uniqueNodes(newNodes);
2819
+ }
2820
+
2821
+ export { useCollectionQuery as u };