@tatsuokaniwa/swr-firestore 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,4427 @@
1
+ import { collection, getFirestore, query, where, orderBy, limit, onSnapshot, getCountFromServer, collectionGroup, doc } from "firebase/firestore";
2
+ import React, { createContext, useContext, useEffect, useLayoutEffect, useRef, useMemo, useCallback, useDebugValue } from "react";
3
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
4
+ var isArray$c = Array.isArray;
5
+ var isArray_1 = isArray$c;
6
+ var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
7
+ var _freeGlobal = freeGlobal$1;
8
+ var freeGlobal = _freeGlobal;
9
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
10
+ var root$c = freeGlobal || freeSelf || Function("return this")();
11
+ var _root = root$c;
12
+ var root$b = _root;
13
+ var Symbol$7 = root$b.Symbol;
14
+ var _Symbol = Symbol$7;
15
+ var Symbol$6 = _Symbol;
16
+ var objectProto$g = Object.prototype;
17
+ var hasOwnProperty$d = objectProto$g.hasOwnProperty;
18
+ var nativeObjectToString$1 = objectProto$g.toString;
19
+ var symToStringTag$1 = Symbol$6 ? Symbol$6.toStringTag : void 0;
20
+ function getRawTag$1(value) {
21
+ var isOwn = hasOwnProperty$d.call(value, symToStringTag$1), tag = value[symToStringTag$1];
22
+ try {
23
+ value[symToStringTag$1] = void 0;
24
+ var unmasked = true;
25
+ } catch (e) {
26
+ }
27
+ var result = nativeObjectToString$1.call(value);
28
+ if (unmasked) {
29
+ if (isOwn) {
30
+ value[symToStringTag$1] = tag;
31
+ } else {
32
+ delete value[symToStringTag$1];
33
+ }
34
+ }
35
+ return result;
36
+ }
37
+ var _getRawTag = getRawTag$1;
38
+ var objectProto$f = Object.prototype;
39
+ var nativeObjectToString = objectProto$f.toString;
40
+ function objectToString$1(value) {
41
+ return nativeObjectToString.call(value);
42
+ }
43
+ var _objectToString = objectToString$1;
44
+ var Symbol$5 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
45
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
46
+ var symToStringTag = Symbol$5 ? Symbol$5.toStringTag : void 0;
47
+ function baseGetTag$7(value) {
48
+ if (value == null) {
49
+ return value === void 0 ? undefinedTag : nullTag;
50
+ }
51
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
52
+ }
53
+ var _baseGetTag = baseGetTag$7;
54
+ function isObjectLike$b(value) {
55
+ return value != null && typeof value == "object";
56
+ }
57
+ var isObjectLike_1 = isObjectLike$b;
58
+ var baseGetTag$6 = _baseGetTag, isObjectLike$a = isObjectLike_1;
59
+ var symbolTag$3 = "[object Symbol]";
60
+ function isSymbol$5(value) {
61
+ return typeof value == "symbol" || isObjectLike$a(value) && baseGetTag$6(value) == symbolTag$3;
62
+ }
63
+ var isSymbol_1 = isSymbol$5;
64
+ var isArray$b = isArray_1, isSymbol$4 = isSymbol_1;
65
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
66
+ function isKey$3(value, object) {
67
+ if (isArray$b(value)) {
68
+ return false;
69
+ }
70
+ var type = typeof value;
71
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol$4(value)) {
72
+ return true;
73
+ }
74
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
75
+ }
76
+ var _isKey = isKey$3;
77
+ function isObject$8(value) {
78
+ var type = typeof value;
79
+ return value != null && (type == "object" || type == "function");
80
+ }
81
+ var isObject_1 = isObject$8;
82
+ var baseGetTag$5 = _baseGetTag, isObject$7 = isObject_1;
83
+ var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
84
+ function isFunction$3(value) {
85
+ if (!isObject$7(value)) {
86
+ return false;
87
+ }
88
+ var tag = baseGetTag$5(value);
89
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
90
+ }
91
+ var isFunction_1 = isFunction$3;
92
+ var root$a = _root;
93
+ var coreJsData$1 = root$a["__core-js_shared__"];
94
+ var _coreJsData = coreJsData$1;
95
+ var coreJsData = _coreJsData;
96
+ var maskSrcKey = function() {
97
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
98
+ return uid ? "Symbol(src)_1." + uid : "";
99
+ }();
100
+ function isMasked$1(func2) {
101
+ return !!maskSrcKey && maskSrcKey in func2;
102
+ }
103
+ var _isMasked = isMasked$1;
104
+ var funcProto$2 = Function.prototype;
105
+ var funcToString$2 = funcProto$2.toString;
106
+ function toSource$2(func2) {
107
+ if (func2 != null) {
108
+ try {
109
+ return funcToString$2.call(func2);
110
+ } catch (e) {
111
+ }
112
+ try {
113
+ return func2 + "";
114
+ } catch (e) {
115
+ }
116
+ }
117
+ return "";
118
+ }
119
+ var _toSource = toSource$2;
120
+ var isFunction$2 = isFunction_1, isMasked = _isMasked, isObject$6 = isObject_1, toSource$1 = _toSource;
121
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
122
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
123
+ var funcProto$1 = Function.prototype, objectProto$e = Object.prototype;
124
+ var funcToString$1 = funcProto$1.toString;
125
+ var hasOwnProperty$c = objectProto$e.hasOwnProperty;
126
+ var reIsNative = RegExp(
127
+ "^" + funcToString$1.call(hasOwnProperty$c).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
128
+ );
129
+ function baseIsNative$1(value) {
130
+ if (!isObject$6(value) || isMasked(value)) {
131
+ return false;
132
+ }
133
+ var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
134
+ return pattern.test(toSource$1(value));
135
+ }
136
+ var _baseIsNative = baseIsNative$1;
137
+ function getValue$1(object, key) {
138
+ return object == null ? void 0 : object[key];
139
+ }
140
+ var _getValue = getValue$1;
141
+ var baseIsNative = _baseIsNative, getValue = _getValue;
142
+ function getNative$7(object, key) {
143
+ var value = getValue(object, key);
144
+ return baseIsNative(value) ? value : void 0;
145
+ }
146
+ var _getNative = getNative$7;
147
+ var getNative$6 = _getNative;
148
+ var nativeCreate$4 = getNative$6(Object, "create");
149
+ var _nativeCreate = nativeCreate$4;
150
+ var nativeCreate$3 = _nativeCreate;
151
+ function hashClear$1() {
152
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
153
+ this.size = 0;
154
+ }
155
+ var _hashClear = hashClear$1;
156
+ function hashDelete$1(key) {
157
+ var result = this.has(key) && delete this.__data__[key];
158
+ this.size -= result ? 1 : 0;
159
+ return result;
160
+ }
161
+ var _hashDelete = hashDelete$1;
162
+ var nativeCreate$2 = _nativeCreate;
163
+ var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
164
+ var objectProto$d = Object.prototype;
165
+ var hasOwnProperty$b = objectProto$d.hasOwnProperty;
166
+ function hashGet$1(key) {
167
+ var data = this.__data__;
168
+ if (nativeCreate$2) {
169
+ var result = data[key];
170
+ return result === HASH_UNDEFINED$2 ? void 0 : result;
171
+ }
172
+ return hasOwnProperty$b.call(data, key) ? data[key] : void 0;
173
+ }
174
+ var _hashGet = hashGet$1;
175
+ var nativeCreate$1 = _nativeCreate;
176
+ var objectProto$c = Object.prototype;
177
+ var hasOwnProperty$a = objectProto$c.hasOwnProperty;
178
+ function hashHas$1(key) {
179
+ var data = this.__data__;
180
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$a.call(data, key);
181
+ }
182
+ var _hashHas = hashHas$1;
183
+ var nativeCreate = _nativeCreate;
184
+ var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
185
+ function hashSet$1(key, value) {
186
+ var data = this.__data__;
187
+ this.size += this.has(key) ? 0 : 1;
188
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
189
+ return this;
190
+ }
191
+ var _hashSet = hashSet$1;
192
+ var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
193
+ function Hash$1(entries) {
194
+ var index = -1, length = entries == null ? 0 : entries.length;
195
+ this.clear();
196
+ while (++index < length) {
197
+ var entry = entries[index];
198
+ this.set(entry[0], entry[1]);
199
+ }
200
+ }
201
+ Hash$1.prototype.clear = hashClear;
202
+ Hash$1.prototype["delete"] = hashDelete;
203
+ Hash$1.prototype.get = hashGet;
204
+ Hash$1.prototype.has = hashHas;
205
+ Hash$1.prototype.set = hashSet;
206
+ var _Hash = Hash$1;
207
+ function listCacheClear$1() {
208
+ this.__data__ = [];
209
+ this.size = 0;
210
+ }
211
+ var _listCacheClear = listCacheClear$1;
212
+ var eq_1;
213
+ var hasRequiredEq;
214
+ function requireEq() {
215
+ if (hasRequiredEq)
216
+ return eq_1;
217
+ hasRequiredEq = 1;
218
+ function eq2(value, other) {
219
+ return value === other || value !== value && other !== other;
220
+ }
221
+ eq_1 = eq2;
222
+ return eq_1;
223
+ }
224
+ var eq$1 = requireEq();
225
+ function assocIndexOf$4(array, key) {
226
+ var length = array.length;
227
+ while (length--) {
228
+ if (eq$1(array[length][0], key)) {
229
+ return length;
230
+ }
231
+ }
232
+ return -1;
233
+ }
234
+ var _assocIndexOf = assocIndexOf$4;
235
+ var assocIndexOf$3 = _assocIndexOf;
236
+ var arrayProto = Array.prototype;
237
+ var splice = arrayProto.splice;
238
+ function listCacheDelete$1(key) {
239
+ var data = this.__data__, index = assocIndexOf$3(data, key);
240
+ if (index < 0) {
241
+ return false;
242
+ }
243
+ var lastIndex = data.length - 1;
244
+ if (index == lastIndex) {
245
+ data.pop();
246
+ } else {
247
+ splice.call(data, index, 1);
248
+ }
249
+ --this.size;
250
+ return true;
251
+ }
252
+ var _listCacheDelete = listCacheDelete$1;
253
+ var assocIndexOf$2 = _assocIndexOf;
254
+ function listCacheGet$1(key) {
255
+ var data = this.__data__, index = assocIndexOf$2(data, key);
256
+ return index < 0 ? void 0 : data[index][1];
257
+ }
258
+ var _listCacheGet = listCacheGet$1;
259
+ var assocIndexOf$1 = _assocIndexOf;
260
+ function listCacheHas$1(key) {
261
+ return assocIndexOf$1(this.__data__, key) > -1;
262
+ }
263
+ var _listCacheHas = listCacheHas$1;
264
+ var assocIndexOf = _assocIndexOf;
265
+ function listCacheSet$1(key, value) {
266
+ var data = this.__data__, index = assocIndexOf(data, key);
267
+ if (index < 0) {
268
+ ++this.size;
269
+ data.push([key, value]);
270
+ } else {
271
+ data[index][1] = value;
272
+ }
273
+ return this;
274
+ }
275
+ var _listCacheSet = listCacheSet$1;
276
+ var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
277
+ function ListCache$4(entries) {
278
+ var index = -1, length = entries == null ? 0 : entries.length;
279
+ this.clear();
280
+ while (++index < length) {
281
+ var entry = entries[index];
282
+ this.set(entry[0], entry[1]);
283
+ }
284
+ }
285
+ ListCache$4.prototype.clear = listCacheClear;
286
+ ListCache$4.prototype["delete"] = listCacheDelete;
287
+ ListCache$4.prototype.get = listCacheGet;
288
+ ListCache$4.prototype.has = listCacheHas;
289
+ ListCache$4.prototype.set = listCacheSet;
290
+ var _ListCache = ListCache$4;
291
+ var getNative$5 = _getNative, root$9 = _root;
292
+ var Map$4 = getNative$5(root$9, "Map");
293
+ var _Map = Map$4;
294
+ var Hash = _Hash, ListCache$3 = _ListCache, Map$3 = _Map;
295
+ function mapCacheClear$1() {
296
+ this.size = 0;
297
+ this.__data__ = {
298
+ "hash": new Hash(),
299
+ "map": new (Map$3 || ListCache$3)(),
300
+ "string": new Hash()
301
+ };
302
+ }
303
+ var _mapCacheClear = mapCacheClear$1;
304
+ function isKeyable$1(value) {
305
+ var type = typeof value;
306
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
307
+ }
308
+ var _isKeyable = isKeyable$1;
309
+ var isKeyable = _isKeyable;
310
+ function getMapData$4(map, key) {
311
+ var data = map.__data__;
312
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
313
+ }
314
+ var _getMapData = getMapData$4;
315
+ var getMapData$3 = _getMapData;
316
+ function mapCacheDelete$1(key) {
317
+ var result = getMapData$3(this, key)["delete"](key);
318
+ this.size -= result ? 1 : 0;
319
+ return result;
320
+ }
321
+ var _mapCacheDelete = mapCacheDelete$1;
322
+ var getMapData$2 = _getMapData;
323
+ function mapCacheGet$1(key) {
324
+ return getMapData$2(this, key).get(key);
325
+ }
326
+ var _mapCacheGet = mapCacheGet$1;
327
+ var getMapData$1 = _getMapData;
328
+ function mapCacheHas$1(key) {
329
+ return getMapData$1(this, key).has(key);
330
+ }
331
+ var _mapCacheHas = mapCacheHas$1;
332
+ var getMapData = _getMapData;
333
+ function mapCacheSet$1(key, value) {
334
+ var data = getMapData(this, key), size = data.size;
335
+ data.set(key, value);
336
+ this.size += data.size == size ? 0 : 1;
337
+ return this;
338
+ }
339
+ var _mapCacheSet = mapCacheSet$1;
340
+ var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
341
+ function MapCache$3(entries) {
342
+ var index = -1, length = entries == null ? 0 : entries.length;
343
+ this.clear();
344
+ while (++index < length) {
345
+ var entry = entries[index];
346
+ this.set(entry[0], entry[1]);
347
+ }
348
+ }
349
+ MapCache$3.prototype.clear = mapCacheClear;
350
+ MapCache$3.prototype["delete"] = mapCacheDelete;
351
+ MapCache$3.prototype.get = mapCacheGet;
352
+ MapCache$3.prototype.has = mapCacheHas;
353
+ MapCache$3.prototype.set = mapCacheSet;
354
+ var _MapCache = MapCache$3;
355
+ var MapCache$2 = _MapCache;
356
+ var FUNC_ERROR_TEXT$1 = "Expected a function";
357
+ function memoize$1(func2, resolver) {
358
+ if (typeof func2 != "function" || resolver != null && typeof resolver != "function") {
359
+ throw new TypeError(FUNC_ERROR_TEXT$1);
360
+ }
361
+ var memoized = function() {
362
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
363
+ if (cache2.has(key)) {
364
+ return cache2.get(key);
365
+ }
366
+ var result = func2.apply(this, args);
367
+ memoized.cache = cache2.set(key, result) || cache2;
368
+ return result;
369
+ };
370
+ memoized.cache = new (memoize$1.Cache || MapCache$2)();
371
+ return memoized;
372
+ }
373
+ memoize$1.Cache = MapCache$2;
374
+ var memoize_1 = memoize$1;
375
+ var memoize = memoize_1;
376
+ var MAX_MEMOIZE_SIZE = 500;
377
+ function memoizeCapped$1(func2) {
378
+ var result = memoize(func2, function(key) {
379
+ if (cache2.size === MAX_MEMOIZE_SIZE) {
380
+ cache2.clear();
381
+ }
382
+ return key;
383
+ });
384
+ var cache2 = result.cache;
385
+ return result;
386
+ }
387
+ var _memoizeCapped = memoizeCapped$1;
388
+ var memoizeCapped = _memoizeCapped;
389
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
390
+ var reEscapeChar = /\\(\\)?/g;
391
+ var stringToPath$2 = memoizeCapped(function(string) {
392
+ var result = [];
393
+ if (string.charCodeAt(0) === 46) {
394
+ result.push("");
395
+ }
396
+ string.replace(rePropName, function(match, number, quote, subString) {
397
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
398
+ });
399
+ return result;
400
+ });
401
+ var _stringToPath = stringToPath$2;
402
+ function arrayMap$2(array, iteratee2) {
403
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
404
+ while (++index < length) {
405
+ result[index] = iteratee2(array[index], index, array);
406
+ }
407
+ return result;
408
+ }
409
+ var _arrayMap = arrayMap$2;
410
+ var Symbol$4 = _Symbol, arrayMap$1 = _arrayMap, isArray$a = isArray_1, isSymbol$3 = isSymbol_1;
411
+ var INFINITY$2 = 1 / 0;
412
+ var symbolProto$2 = Symbol$4 ? Symbol$4.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
413
+ function baseToString$1(value) {
414
+ if (typeof value == "string") {
415
+ return value;
416
+ }
417
+ if (isArray$a(value)) {
418
+ return arrayMap$1(value, baseToString$1) + "";
419
+ }
420
+ if (isSymbol$3(value)) {
421
+ return symbolToString ? symbolToString.call(value) : "";
422
+ }
423
+ var result = value + "";
424
+ return result == "0" && 1 / value == -INFINITY$2 ? "-0" : result;
425
+ }
426
+ var _baseToString = baseToString$1;
427
+ var baseToString = _baseToString;
428
+ function toString$2(value) {
429
+ return value == null ? "" : baseToString(value);
430
+ }
431
+ var toString_1 = toString$2;
432
+ var isArray$9 = isArray_1, isKey$2 = _isKey, stringToPath$1 = _stringToPath, toString$1 = toString_1;
433
+ function castPath$2(value, object) {
434
+ if (isArray$9(value)) {
435
+ return value;
436
+ }
437
+ return isKey$2(value, object) ? [value] : stringToPath$1(toString$1(value));
438
+ }
439
+ var _castPath = castPath$2;
440
+ var isSymbol$2 = isSymbol_1;
441
+ var INFINITY$1 = 1 / 0;
442
+ function toKey$5(value) {
443
+ if (typeof value == "string" || isSymbol$2(value)) {
444
+ return value;
445
+ }
446
+ var result = value + "";
447
+ return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
448
+ }
449
+ var _toKey = toKey$5;
450
+ var castPath$1 = _castPath, toKey$4 = _toKey;
451
+ function baseGet$2(object, path) {
452
+ path = castPath$1(path, object);
453
+ var index = 0, length = path.length;
454
+ while (object != null && index < length) {
455
+ object = object[toKey$4(path[index++])];
456
+ }
457
+ return index && index == length ? object : void 0;
458
+ }
459
+ var _baseGet = baseGet$2;
460
+ var baseGet$1 = _baseGet;
461
+ function get$1(object, path, defaultValue) {
462
+ var result = object == null ? void 0 : baseGet$1(object, path);
463
+ return result === void 0 ? defaultValue : result;
464
+ }
465
+ var get_1 = get$1;
466
+ var _mapping = {};
467
+ (function(exports) {
468
+ exports.aliasToReal = {
469
+ // Lodash aliases.
470
+ "each": "forEach",
471
+ "eachRight": "forEachRight",
472
+ "entries": "toPairs",
473
+ "entriesIn": "toPairsIn",
474
+ "extend": "assignIn",
475
+ "extendAll": "assignInAll",
476
+ "extendAllWith": "assignInAllWith",
477
+ "extendWith": "assignInWith",
478
+ "first": "head",
479
+ // Methods that are curried variants of others.
480
+ "conforms": "conformsTo",
481
+ "matches": "isMatch",
482
+ "property": "get",
483
+ // Ramda aliases.
484
+ "__": "placeholder",
485
+ "F": "stubFalse",
486
+ "T": "stubTrue",
487
+ "all": "every",
488
+ "allPass": "overEvery",
489
+ "always": "constant",
490
+ "any": "some",
491
+ "anyPass": "overSome",
492
+ "apply": "spread",
493
+ "assoc": "set",
494
+ "assocPath": "set",
495
+ "complement": "negate",
496
+ "compose": "flowRight",
497
+ "contains": "includes",
498
+ "dissoc": "unset",
499
+ "dissocPath": "unset",
500
+ "dropLast": "dropRight",
501
+ "dropLastWhile": "dropRightWhile",
502
+ "equals": "isEqual",
503
+ "identical": "eq",
504
+ "indexBy": "keyBy",
505
+ "init": "initial",
506
+ "invertObj": "invert",
507
+ "juxt": "over",
508
+ "omitAll": "omit",
509
+ "nAry": "ary",
510
+ "path": "get",
511
+ "pathEq": "matchesProperty",
512
+ "pathOr": "getOr",
513
+ "paths": "at",
514
+ "pickAll": "pick",
515
+ "pipe": "flow",
516
+ "pluck": "map",
517
+ "prop": "get",
518
+ "propEq": "matchesProperty",
519
+ "propOr": "getOr",
520
+ "props": "at",
521
+ "symmetricDifference": "xor",
522
+ "symmetricDifferenceBy": "xorBy",
523
+ "symmetricDifferenceWith": "xorWith",
524
+ "takeLast": "takeRight",
525
+ "takeLastWhile": "takeRightWhile",
526
+ "unapply": "rest",
527
+ "unnest": "flatten",
528
+ "useWith": "overArgs",
529
+ "where": "conformsTo",
530
+ "whereEq": "isMatch",
531
+ "zipObj": "zipObject"
532
+ };
533
+ exports.aryMethod = {
534
+ "1": [
535
+ "assignAll",
536
+ "assignInAll",
537
+ "attempt",
538
+ "castArray",
539
+ "ceil",
540
+ "create",
541
+ "curry",
542
+ "curryRight",
543
+ "defaultsAll",
544
+ "defaultsDeepAll",
545
+ "floor",
546
+ "flow",
547
+ "flowRight",
548
+ "fromPairs",
549
+ "invert",
550
+ "iteratee",
551
+ "memoize",
552
+ "method",
553
+ "mergeAll",
554
+ "methodOf",
555
+ "mixin",
556
+ "nthArg",
557
+ "over",
558
+ "overEvery",
559
+ "overSome",
560
+ "rest",
561
+ "reverse",
562
+ "round",
563
+ "runInContext",
564
+ "spread",
565
+ "template",
566
+ "trim",
567
+ "trimEnd",
568
+ "trimStart",
569
+ "uniqueId",
570
+ "words",
571
+ "zipAll"
572
+ ],
573
+ "2": [
574
+ "add",
575
+ "after",
576
+ "ary",
577
+ "assign",
578
+ "assignAllWith",
579
+ "assignIn",
580
+ "assignInAllWith",
581
+ "at",
582
+ "before",
583
+ "bind",
584
+ "bindAll",
585
+ "bindKey",
586
+ "chunk",
587
+ "cloneDeepWith",
588
+ "cloneWith",
589
+ "concat",
590
+ "conformsTo",
591
+ "countBy",
592
+ "curryN",
593
+ "curryRightN",
594
+ "debounce",
595
+ "defaults",
596
+ "defaultsDeep",
597
+ "defaultTo",
598
+ "delay",
599
+ "difference",
600
+ "divide",
601
+ "drop",
602
+ "dropRight",
603
+ "dropRightWhile",
604
+ "dropWhile",
605
+ "endsWith",
606
+ "eq",
607
+ "every",
608
+ "filter",
609
+ "find",
610
+ "findIndex",
611
+ "findKey",
612
+ "findLast",
613
+ "findLastIndex",
614
+ "findLastKey",
615
+ "flatMap",
616
+ "flatMapDeep",
617
+ "flattenDepth",
618
+ "forEach",
619
+ "forEachRight",
620
+ "forIn",
621
+ "forInRight",
622
+ "forOwn",
623
+ "forOwnRight",
624
+ "get",
625
+ "groupBy",
626
+ "gt",
627
+ "gte",
628
+ "has",
629
+ "hasIn",
630
+ "includes",
631
+ "indexOf",
632
+ "intersection",
633
+ "invertBy",
634
+ "invoke",
635
+ "invokeMap",
636
+ "isEqual",
637
+ "isMatch",
638
+ "join",
639
+ "keyBy",
640
+ "lastIndexOf",
641
+ "lt",
642
+ "lte",
643
+ "map",
644
+ "mapKeys",
645
+ "mapValues",
646
+ "matchesProperty",
647
+ "maxBy",
648
+ "meanBy",
649
+ "merge",
650
+ "mergeAllWith",
651
+ "minBy",
652
+ "multiply",
653
+ "nth",
654
+ "omit",
655
+ "omitBy",
656
+ "overArgs",
657
+ "pad",
658
+ "padEnd",
659
+ "padStart",
660
+ "parseInt",
661
+ "partial",
662
+ "partialRight",
663
+ "partition",
664
+ "pick",
665
+ "pickBy",
666
+ "propertyOf",
667
+ "pull",
668
+ "pullAll",
669
+ "pullAt",
670
+ "random",
671
+ "range",
672
+ "rangeRight",
673
+ "rearg",
674
+ "reject",
675
+ "remove",
676
+ "repeat",
677
+ "restFrom",
678
+ "result",
679
+ "sampleSize",
680
+ "some",
681
+ "sortBy",
682
+ "sortedIndex",
683
+ "sortedIndexOf",
684
+ "sortedLastIndex",
685
+ "sortedLastIndexOf",
686
+ "sortedUniqBy",
687
+ "split",
688
+ "spreadFrom",
689
+ "startsWith",
690
+ "subtract",
691
+ "sumBy",
692
+ "take",
693
+ "takeRight",
694
+ "takeRightWhile",
695
+ "takeWhile",
696
+ "tap",
697
+ "throttle",
698
+ "thru",
699
+ "times",
700
+ "trimChars",
701
+ "trimCharsEnd",
702
+ "trimCharsStart",
703
+ "truncate",
704
+ "union",
705
+ "uniqBy",
706
+ "uniqWith",
707
+ "unset",
708
+ "unzipWith",
709
+ "without",
710
+ "wrap",
711
+ "xor",
712
+ "zip",
713
+ "zipObject",
714
+ "zipObjectDeep"
715
+ ],
716
+ "3": [
717
+ "assignInWith",
718
+ "assignWith",
719
+ "clamp",
720
+ "differenceBy",
721
+ "differenceWith",
722
+ "findFrom",
723
+ "findIndexFrom",
724
+ "findLastFrom",
725
+ "findLastIndexFrom",
726
+ "getOr",
727
+ "includesFrom",
728
+ "indexOfFrom",
729
+ "inRange",
730
+ "intersectionBy",
731
+ "intersectionWith",
732
+ "invokeArgs",
733
+ "invokeArgsMap",
734
+ "isEqualWith",
735
+ "isMatchWith",
736
+ "flatMapDepth",
737
+ "lastIndexOfFrom",
738
+ "mergeWith",
739
+ "orderBy",
740
+ "padChars",
741
+ "padCharsEnd",
742
+ "padCharsStart",
743
+ "pullAllBy",
744
+ "pullAllWith",
745
+ "rangeStep",
746
+ "rangeStepRight",
747
+ "reduce",
748
+ "reduceRight",
749
+ "replace",
750
+ "set",
751
+ "slice",
752
+ "sortedIndexBy",
753
+ "sortedLastIndexBy",
754
+ "transform",
755
+ "unionBy",
756
+ "unionWith",
757
+ "update",
758
+ "xorBy",
759
+ "xorWith",
760
+ "zipWith"
761
+ ],
762
+ "4": [
763
+ "fill",
764
+ "setWith",
765
+ "updateWith"
766
+ ]
767
+ };
768
+ exports.aryRearg = {
769
+ "2": [1, 0],
770
+ "3": [2, 0, 1],
771
+ "4": [3, 2, 0, 1]
772
+ };
773
+ exports.iterateeAry = {
774
+ "dropRightWhile": 1,
775
+ "dropWhile": 1,
776
+ "every": 1,
777
+ "filter": 1,
778
+ "find": 1,
779
+ "findFrom": 1,
780
+ "findIndex": 1,
781
+ "findIndexFrom": 1,
782
+ "findKey": 1,
783
+ "findLast": 1,
784
+ "findLastFrom": 1,
785
+ "findLastIndex": 1,
786
+ "findLastIndexFrom": 1,
787
+ "findLastKey": 1,
788
+ "flatMap": 1,
789
+ "flatMapDeep": 1,
790
+ "flatMapDepth": 1,
791
+ "forEach": 1,
792
+ "forEachRight": 1,
793
+ "forIn": 1,
794
+ "forInRight": 1,
795
+ "forOwn": 1,
796
+ "forOwnRight": 1,
797
+ "map": 1,
798
+ "mapKeys": 1,
799
+ "mapValues": 1,
800
+ "partition": 1,
801
+ "reduce": 2,
802
+ "reduceRight": 2,
803
+ "reject": 1,
804
+ "remove": 1,
805
+ "some": 1,
806
+ "takeRightWhile": 1,
807
+ "takeWhile": 1,
808
+ "times": 1,
809
+ "transform": 2
810
+ };
811
+ exports.iterateeRearg = {
812
+ "mapKeys": [1],
813
+ "reduceRight": [1, 0]
814
+ };
815
+ exports.methodRearg = {
816
+ "assignInAllWith": [1, 0],
817
+ "assignInWith": [1, 2, 0],
818
+ "assignAllWith": [1, 0],
819
+ "assignWith": [1, 2, 0],
820
+ "differenceBy": [1, 2, 0],
821
+ "differenceWith": [1, 2, 0],
822
+ "getOr": [2, 1, 0],
823
+ "intersectionBy": [1, 2, 0],
824
+ "intersectionWith": [1, 2, 0],
825
+ "isEqualWith": [1, 2, 0],
826
+ "isMatchWith": [2, 1, 0],
827
+ "mergeAllWith": [1, 0],
828
+ "mergeWith": [1, 2, 0],
829
+ "padChars": [2, 1, 0],
830
+ "padCharsEnd": [2, 1, 0],
831
+ "padCharsStart": [2, 1, 0],
832
+ "pullAllBy": [2, 1, 0],
833
+ "pullAllWith": [2, 1, 0],
834
+ "rangeStep": [1, 2, 0],
835
+ "rangeStepRight": [1, 2, 0],
836
+ "setWith": [3, 1, 2, 0],
837
+ "sortedIndexBy": [2, 1, 0],
838
+ "sortedLastIndexBy": [2, 1, 0],
839
+ "unionBy": [1, 2, 0],
840
+ "unionWith": [1, 2, 0],
841
+ "updateWith": [3, 1, 2, 0],
842
+ "xorBy": [1, 2, 0],
843
+ "xorWith": [1, 2, 0],
844
+ "zipWith": [1, 2, 0]
845
+ };
846
+ exports.methodSpread = {
847
+ "assignAll": { "start": 0 },
848
+ "assignAllWith": { "start": 0 },
849
+ "assignInAll": { "start": 0 },
850
+ "assignInAllWith": { "start": 0 },
851
+ "defaultsAll": { "start": 0 },
852
+ "defaultsDeepAll": { "start": 0 },
853
+ "invokeArgs": { "start": 2 },
854
+ "invokeArgsMap": { "start": 2 },
855
+ "mergeAll": { "start": 0 },
856
+ "mergeAllWith": { "start": 0 },
857
+ "partial": { "start": 1 },
858
+ "partialRight": { "start": 1 },
859
+ "without": { "start": 1 },
860
+ "zipAll": { "start": 0 }
861
+ };
862
+ exports.mutate = {
863
+ "array": {
864
+ "fill": true,
865
+ "pull": true,
866
+ "pullAll": true,
867
+ "pullAllBy": true,
868
+ "pullAllWith": true,
869
+ "pullAt": true,
870
+ "remove": true,
871
+ "reverse": true
872
+ },
873
+ "object": {
874
+ "assign": true,
875
+ "assignAll": true,
876
+ "assignAllWith": true,
877
+ "assignIn": true,
878
+ "assignInAll": true,
879
+ "assignInAllWith": true,
880
+ "assignInWith": true,
881
+ "assignWith": true,
882
+ "defaults": true,
883
+ "defaultsAll": true,
884
+ "defaultsDeep": true,
885
+ "defaultsDeepAll": true,
886
+ "merge": true,
887
+ "mergeAll": true,
888
+ "mergeAllWith": true,
889
+ "mergeWith": true
890
+ },
891
+ "set": {
892
+ "set": true,
893
+ "setWith": true,
894
+ "unset": true,
895
+ "update": true,
896
+ "updateWith": true
897
+ }
898
+ };
899
+ exports.realToAlias = function() {
900
+ var hasOwnProperty2 = Object.prototype.hasOwnProperty, object = exports.aliasToReal, result = {};
901
+ for (var key in object) {
902
+ var value = object[key];
903
+ if (hasOwnProperty2.call(result, value)) {
904
+ result[value].push(key);
905
+ } else {
906
+ result[value] = [key];
907
+ }
908
+ }
909
+ return result;
910
+ }();
911
+ exports.remap = {
912
+ "assignAll": "assign",
913
+ "assignAllWith": "assignWith",
914
+ "assignInAll": "assignIn",
915
+ "assignInAllWith": "assignInWith",
916
+ "curryN": "curry",
917
+ "curryRightN": "curryRight",
918
+ "defaultsAll": "defaults",
919
+ "defaultsDeepAll": "defaultsDeep",
920
+ "findFrom": "find",
921
+ "findIndexFrom": "findIndex",
922
+ "findLastFrom": "findLast",
923
+ "findLastIndexFrom": "findLastIndex",
924
+ "getOr": "get",
925
+ "includesFrom": "includes",
926
+ "indexOfFrom": "indexOf",
927
+ "invokeArgs": "invoke",
928
+ "invokeArgsMap": "invokeMap",
929
+ "lastIndexOfFrom": "lastIndexOf",
930
+ "mergeAll": "merge",
931
+ "mergeAllWith": "mergeWith",
932
+ "padChars": "pad",
933
+ "padCharsEnd": "padEnd",
934
+ "padCharsStart": "padStart",
935
+ "propertyOf": "get",
936
+ "rangeStep": "range",
937
+ "rangeStepRight": "rangeRight",
938
+ "restFrom": "rest",
939
+ "spreadFrom": "spread",
940
+ "trimChars": "trim",
941
+ "trimCharsEnd": "trimEnd",
942
+ "trimCharsStart": "trimStart",
943
+ "zipAll": "zip"
944
+ };
945
+ exports.skipFixed = {
946
+ "castArray": true,
947
+ "flow": true,
948
+ "flowRight": true,
949
+ "iteratee": true,
950
+ "mixin": true,
951
+ "rearg": true,
952
+ "runInContext": true
953
+ };
954
+ exports.skipRearg = {
955
+ "add": true,
956
+ "assign": true,
957
+ "assignIn": true,
958
+ "bind": true,
959
+ "bindKey": true,
960
+ "concat": true,
961
+ "difference": true,
962
+ "divide": true,
963
+ "eq": true,
964
+ "gt": true,
965
+ "gte": true,
966
+ "isEqual": true,
967
+ "lt": true,
968
+ "lte": true,
969
+ "matchesProperty": true,
970
+ "merge": true,
971
+ "multiply": true,
972
+ "overArgs": true,
973
+ "partial": true,
974
+ "partialRight": true,
975
+ "propertyOf": true,
976
+ "random": true,
977
+ "range": true,
978
+ "rangeRight": true,
979
+ "subtract": true,
980
+ "zip": true,
981
+ "zipObject": true,
982
+ "zipObjectDeep": true
983
+ };
984
+ })(_mapping);
985
+ var placeholder;
986
+ var hasRequiredPlaceholder;
987
+ function requirePlaceholder() {
988
+ if (hasRequiredPlaceholder)
989
+ return placeholder;
990
+ hasRequiredPlaceholder = 1;
991
+ placeholder = {};
992
+ return placeholder;
993
+ }
994
+ var mapping = _mapping, fallbackHolder = requirePlaceholder();
995
+ var push = Array.prototype.push;
996
+ function baseArity(func2, n) {
997
+ return n == 2 ? function(a, b) {
998
+ return func2.apply(void 0, arguments);
999
+ } : function(a) {
1000
+ return func2.apply(void 0, arguments);
1001
+ };
1002
+ }
1003
+ function baseAry(func2, n) {
1004
+ return n == 2 ? function(a, b) {
1005
+ return func2(a, b);
1006
+ } : function(a) {
1007
+ return func2(a);
1008
+ };
1009
+ }
1010
+ function cloneArray(array) {
1011
+ var length = array ? array.length : 0, result = Array(length);
1012
+ while (length--) {
1013
+ result[length] = array[length];
1014
+ }
1015
+ return result;
1016
+ }
1017
+ function createCloner(func2) {
1018
+ return function(object) {
1019
+ return func2({}, object);
1020
+ };
1021
+ }
1022
+ function flatSpread(func2, start) {
1023
+ return function() {
1024
+ var length = arguments.length, lastIndex = length - 1, args = Array(length);
1025
+ while (length--) {
1026
+ args[length] = arguments[length];
1027
+ }
1028
+ var array = args[start], otherArgs = args.slice(0, start);
1029
+ if (array) {
1030
+ push.apply(otherArgs, array);
1031
+ }
1032
+ if (start != lastIndex) {
1033
+ push.apply(otherArgs, args.slice(start + 1));
1034
+ }
1035
+ return func2.apply(this, otherArgs);
1036
+ };
1037
+ }
1038
+ function wrapImmutable(func2, cloner) {
1039
+ return function() {
1040
+ var length = arguments.length;
1041
+ if (!length) {
1042
+ return;
1043
+ }
1044
+ var args = Array(length);
1045
+ while (length--) {
1046
+ args[length] = arguments[length];
1047
+ }
1048
+ var result = args[0] = cloner.apply(void 0, args);
1049
+ func2.apply(void 0, args);
1050
+ return result;
1051
+ };
1052
+ }
1053
+ function baseConvert$1(util2, name, func2, options) {
1054
+ var isLib = typeof name == "function", isObj = name === Object(name);
1055
+ if (isObj) {
1056
+ options = func2;
1057
+ func2 = name;
1058
+ name = void 0;
1059
+ }
1060
+ if (func2 == null) {
1061
+ throw new TypeError();
1062
+ }
1063
+ options || (options = {});
1064
+ var config = {
1065
+ "cap": "cap" in options ? options.cap : true,
1066
+ "curry": "curry" in options ? options.curry : true,
1067
+ "fixed": "fixed" in options ? options.fixed : true,
1068
+ "immutable": "immutable" in options ? options.immutable : true,
1069
+ "rearg": "rearg" in options ? options.rearg : true
1070
+ };
1071
+ var defaultHolder = isLib ? func2 : fallbackHolder, forceCurry = "curry" in options && options.curry, forceFixed = "fixed" in options && options.fixed, forceRearg = "rearg" in options && options.rearg, pristine = isLib ? func2.runInContext() : void 0;
1072
+ var helpers = isLib ? func2 : {
1073
+ "ary": util2.ary,
1074
+ "assign": util2.assign,
1075
+ "clone": util2.clone,
1076
+ "curry": util2.curry,
1077
+ "forEach": util2.forEach,
1078
+ "isArray": util2.isArray,
1079
+ "isError": util2.isError,
1080
+ "isFunction": util2.isFunction,
1081
+ "isWeakMap": util2.isWeakMap,
1082
+ "iteratee": util2.iteratee,
1083
+ "keys": util2.keys,
1084
+ "rearg": util2.rearg,
1085
+ "toInteger": util2.toInteger,
1086
+ "toPath": util2.toPath
1087
+ };
1088
+ var ary2 = helpers.ary, assign = helpers.assign, clone2 = helpers.clone, curry2 = helpers.curry, each = helpers.forEach, isArray2 = helpers.isArray, isError2 = helpers.isError, isFunction2 = helpers.isFunction, isWeakMap2 = helpers.isWeakMap, keys2 = helpers.keys, rearg2 = helpers.rearg, toInteger2 = helpers.toInteger, toPath2 = helpers.toPath;
1089
+ var aryMethodKeys = keys2(mapping.aryMethod);
1090
+ var wrappers = {
1091
+ "castArray": function(castArray) {
1092
+ return function() {
1093
+ var value = arguments[0];
1094
+ return isArray2(value) ? castArray(cloneArray(value)) : castArray.apply(void 0, arguments);
1095
+ };
1096
+ },
1097
+ "iteratee": function(iteratee2) {
1098
+ return function() {
1099
+ var func3 = arguments[0], arity = arguments[1], result = iteratee2(func3, arity), length = result.length;
1100
+ if (config.cap && typeof arity == "number") {
1101
+ arity = arity > 2 ? arity - 2 : 1;
1102
+ return length && length <= arity ? result : baseAry(result, arity);
1103
+ }
1104
+ return result;
1105
+ };
1106
+ },
1107
+ "mixin": function(mixin) {
1108
+ return function(source) {
1109
+ var func3 = this;
1110
+ if (!isFunction2(func3)) {
1111
+ return mixin(func3, Object(source));
1112
+ }
1113
+ var pairs2 = [];
1114
+ each(keys2(source), function(key) {
1115
+ if (isFunction2(source[key])) {
1116
+ pairs2.push([key, func3.prototype[key]]);
1117
+ }
1118
+ });
1119
+ mixin(func3, Object(source));
1120
+ each(pairs2, function(pair) {
1121
+ var value = pair[1];
1122
+ if (isFunction2(value)) {
1123
+ func3.prototype[pair[0]] = value;
1124
+ } else {
1125
+ delete func3.prototype[pair[0]];
1126
+ }
1127
+ });
1128
+ return func3;
1129
+ };
1130
+ },
1131
+ "nthArg": function(nthArg) {
1132
+ return function(n) {
1133
+ var arity = n < 0 ? 1 : toInteger2(n) + 1;
1134
+ return curry2(nthArg(n), arity);
1135
+ };
1136
+ },
1137
+ "rearg": function(rearg3) {
1138
+ return function(func3, indexes) {
1139
+ var arity = indexes ? indexes.length : 0;
1140
+ return curry2(rearg3(func3, indexes), arity);
1141
+ };
1142
+ },
1143
+ "runInContext": function(runInContext) {
1144
+ return function(context) {
1145
+ return baseConvert$1(util2, runInContext(context), options);
1146
+ };
1147
+ }
1148
+ };
1149
+ function castCap(name2, func3) {
1150
+ if (config.cap) {
1151
+ var indexes = mapping.iterateeRearg[name2];
1152
+ if (indexes) {
1153
+ return iterateeRearg(func3, indexes);
1154
+ }
1155
+ var n = !isLib && mapping.iterateeAry[name2];
1156
+ if (n) {
1157
+ return iterateeAry(func3, n);
1158
+ }
1159
+ }
1160
+ return func3;
1161
+ }
1162
+ function castCurry(name2, func3, n) {
1163
+ return forceCurry || config.curry && n > 1 ? curry2(func3, n) : func3;
1164
+ }
1165
+ function castFixed(name2, func3, n) {
1166
+ if (config.fixed && (forceFixed || !mapping.skipFixed[name2])) {
1167
+ var data = mapping.methodSpread[name2], start = data && data.start;
1168
+ return start === void 0 ? ary2(func3, n) : flatSpread(func3, start);
1169
+ }
1170
+ return func3;
1171
+ }
1172
+ function castRearg(name2, func3, n) {
1173
+ return config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name2]) ? rearg2(func3, mapping.methodRearg[name2] || mapping.aryRearg[n]) : func3;
1174
+ }
1175
+ function cloneByPath(object, path) {
1176
+ path = toPath2(path);
1177
+ var index = -1, length = path.length, lastIndex = length - 1, result = clone2(Object(object)), nested = result;
1178
+ while (nested != null && ++index < length) {
1179
+ var key = path[index], value = nested[key];
1180
+ if (value != null && !(isFunction2(value) || isError2(value) || isWeakMap2(value))) {
1181
+ nested[key] = clone2(index == lastIndex ? value : Object(value));
1182
+ }
1183
+ nested = nested[key];
1184
+ }
1185
+ return result;
1186
+ }
1187
+ function convertLib(options2) {
1188
+ return _.runInContext.convert(options2)(void 0);
1189
+ }
1190
+ function createConverter(name2, func3) {
1191
+ var realName = mapping.aliasToReal[name2] || name2, methodName = mapping.remap[realName] || realName, oldOptions = options;
1192
+ return function(options2) {
1193
+ var newUtil = isLib ? pristine : helpers, newFunc = isLib ? pristine[methodName] : func3, newOptions = assign(assign({}, oldOptions), options2);
1194
+ return baseConvert$1(newUtil, realName, newFunc, newOptions);
1195
+ };
1196
+ }
1197
+ function iterateeAry(func3, n) {
1198
+ return overArg2(func3, function(func4) {
1199
+ return typeof func4 == "function" ? baseAry(func4, n) : func4;
1200
+ });
1201
+ }
1202
+ function iterateeRearg(func3, indexes) {
1203
+ return overArg2(func3, function(func4) {
1204
+ var n = indexes.length;
1205
+ return baseArity(rearg2(baseAry(func4, n), indexes), n);
1206
+ });
1207
+ }
1208
+ function overArg2(func3, transform) {
1209
+ return function() {
1210
+ var length = arguments.length;
1211
+ if (!length) {
1212
+ return func3();
1213
+ }
1214
+ var args = Array(length);
1215
+ while (length--) {
1216
+ args[length] = arguments[length];
1217
+ }
1218
+ var index = config.rearg ? 0 : length - 1;
1219
+ args[index] = transform(args[index]);
1220
+ return func3.apply(void 0, args);
1221
+ };
1222
+ }
1223
+ function wrap(name2, func3, placeholder2) {
1224
+ var result, realName = mapping.aliasToReal[name2] || name2, wrapped = func3, wrapper = wrappers[realName];
1225
+ if (wrapper) {
1226
+ wrapped = wrapper(func3);
1227
+ } else if (config.immutable) {
1228
+ if (mapping.mutate.array[realName]) {
1229
+ wrapped = wrapImmutable(func3, cloneArray);
1230
+ } else if (mapping.mutate.object[realName]) {
1231
+ wrapped = wrapImmutable(func3, createCloner(func3));
1232
+ } else if (mapping.mutate.set[realName]) {
1233
+ wrapped = wrapImmutable(func3, cloneByPath);
1234
+ }
1235
+ }
1236
+ each(aryMethodKeys, function(aryKey) {
1237
+ each(mapping.aryMethod[aryKey], function(otherName) {
1238
+ if (realName == otherName) {
1239
+ var data = mapping.methodSpread[realName], afterRearg = data && data.afterRearg;
1240
+ result = afterRearg ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
1241
+ result = castCap(realName, result);
1242
+ result = castCurry(realName, result, aryKey);
1243
+ return false;
1244
+ }
1245
+ });
1246
+ return !result;
1247
+ });
1248
+ result || (result = wrapped);
1249
+ if (result == func3) {
1250
+ result = forceCurry ? curry2(result, 1) : function() {
1251
+ return func3.apply(this, arguments);
1252
+ };
1253
+ }
1254
+ result.convert = createConverter(realName, func3);
1255
+ result.placeholder = func3.placeholder = placeholder2;
1256
+ return result;
1257
+ }
1258
+ if (!isObj) {
1259
+ return wrap(name, func2, defaultHolder);
1260
+ }
1261
+ var _ = func2;
1262
+ var pairs = [];
1263
+ each(aryMethodKeys, function(aryKey) {
1264
+ each(mapping.aryMethod[aryKey], function(key) {
1265
+ var func3 = _[mapping.remap[key] || key];
1266
+ if (func3) {
1267
+ pairs.push([key, wrap(key, func3, _)]);
1268
+ }
1269
+ });
1270
+ });
1271
+ each(keys2(_), function(key) {
1272
+ var func3 = _[key];
1273
+ if (typeof func3 == "function") {
1274
+ var length = pairs.length;
1275
+ while (length--) {
1276
+ if (pairs[length][0] == key) {
1277
+ return;
1278
+ }
1279
+ }
1280
+ func3.convert = createConverter(key, func3);
1281
+ pairs.push([key, func3]);
1282
+ }
1283
+ });
1284
+ each(pairs, function(pair) {
1285
+ _[pair[0]] = pair[1];
1286
+ });
1287
+ _.convert = convertLib;
1288
+ _.placeholder = _;
1289
+ each(keys2(_), function(key) {
1290
+ each(mapping.realToAlias[key] || [], function(alias) {
1291
+ _[alias] = _[key];
1292
+ });
1293
+ });
1294
+ return _;
1295
+ }
1296
+ var _baseConvert = baseConvert$1;
1297
+ function identity$3(value) {
1298
+ return value;
1299
+ }
1300
+ var identity_1 = identity$3;
1301
+ var getNative$4 = _getNative, root$8 = _root;
1302
+ var WeakMap$3 = getNative$4(root$8, "WeakMap");
1303
+ var _WeakMap = WeakMap$3;
1304
+ var WeakMap$2 = _WeakMap;
1305
+ var metaMap$2 = WeakMap$2 && new WeakMap$2();
1306
+ var _metaMap = metaMap$2;
1307
+ var identity$2 = identity_1, metaMap$1 = _metaMap;
1308
+ var baseSetData$2 = !metaMap$1 ? identity$2 : function(func2, data) {
1309
+ metaMap$1.set(func2, data);
1310
+ return func2;
1311
+ };
1312
+ var _baseSetData = baseSetData$2;
1313
+ var isObject$5 = isObject_1;
1314
+ var objectCreate = Object.create;
1315
+ var baseCreate$4 = function() {
1316
+ function object() {
1317
+ }
1318
+ return function(proto) {
1319
+ if (!isObject$5(proto)) {
1320
+ return {};
1321
+ }
1322
+ if (objectCreate) {
1323
+ return objectCreate(proto);
1324
+ }
1325
+ object.prototype = proto;
1326
+ var result = new object();
1327
+ object.prototype = void 0;
1328
+ return result;
1329
+ };
1330
+ }();
1331
+ var _baseCreate = baseCreate$4;
1332
+ var baseCreate$3 = _baseCreate, isObject$4 = isObject_1;
1333
+ function createCtor$4(Ctor) {
1334
+ return function() {
1335
+ var args = arguments;
1336
+ switch (args.length) {
1337
+ case 0:
1338
+ return new Ctor();
1339
+ case 1:
1340
+ return new Ctor(args[0]);
1341
+ case 2:
1342
+ return new Ctor(args[0], args[1]);
1343
+ case 3:
1344
+ return new Ctor(args[0], args[1], args[2]);
1345
+ case 4:
1346
+ return new Ctor(args[0], args[1], args[2], args[3]);
1347
+ case 5:
1348
+ return new Ctor(args[0], args[1], args[2], args[3], args[4]);
1349
+ case 6:
1350
+ return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
1351
+ case 7:
1352
+ return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
1353
+ }
1354
+ var thisBinding = baseCreate$3(Ctor.prototype), result = Ctor.apply(thisBinding, args);
1355
+ return isObject$4(result) ? result : thisBinding;
1356
+ };
1357
+ }
1358
+ var _createCtor = createCtor$4;
1359
+ var createCtor$3 = _createCtor, root$7 = _root;
1360
+ var WRAP_BIND_FLAG$6 = 1;
1361
+ function createBind$1(func2, bitmask, thisArg) {
1362
+ var isBind = bitmask & WRAP_BIND_FLAG$6, Ctor = createCtor$3(func2);
1363
+ function wrapper() {
1364
+ var fn = this && this !== root$7 && this instanceof wrapper ? Ctor : func2;
1365
+ return fn.apply(isBind ? thisArg : this, arguments);
1366
+ }
1367
+ return wrapper;
1368
+ }
1369
+ var _createBind = createBind$1;
1370
+ function apply$3(func2, thisArg, args) {
1371
+ switch (args.length) {
1372
+ case 0:
1373
+ return func2.call(thisArg);
1374
+ case 1:
1375
+ return func2.call(thisArg, args[0]);
1376
+ case 2:
1377
+ return func2.call(thisArg, args[0], args[1]);
1378
+ case 3:
1379
+ return func2.call(thisArg, args[0], args[1], args[2]);
1380
+ }
1381
+ return func2.apply(thisArg, args);
1382
+ }
1383
+ var _apply = apply$3;
1384
+ var nativeMax$3 = Math.max;
1385
+ function composeArgs$2(args, partials, holders, isCurried) {
1386
+ var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax$3(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried;
1387
+ while (++leftIndex < leftLength) {
1388
+ result[leftIndex] = partials[leftIndex];
1389
+ }
1390
+ while (++argsIndex < holdersLength) {
1391
+ if (isUncurried || argsIndex < argsLength) {
1392
+ result[holders[argsIndex]] = args[argsIndex];
1393
+ }
1394
+ }
1395
+ while (rangeLength--) {
1396
+ result[leftIndex++] = args[argsIndex++];
1397
+ }
1398
+ return result;
1399
+ }
1400
+ var _composeArgs = composeArgs$2;
1401
+ var nativeMax$2 = Math.max;
1402
+ function composeArgsRight$2(args, partials, holders, isCurried) {
1403
+ var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax$2(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried;
1404
+ while (++argsIndex < rangeLength) {
1405
+ result[argsIndex] = args[argsIndex];
1406
+ }
1407
+ var offset = argsIndex;
1408
+ while (++rightIndex < rightLength) {
1409
+ result[offset + rightIndex] = partials[rightIndex];
1410
+ }
1411
+ while (++holdersIndex < holdersLength) {
1412
+ if (isUncurried || argsIndex < argsLength) {
1413
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
1414
+ }
1415
+ }
1416
+ return result;
1417
+ }
1418
+ var _composeArgsRight = composeArgsRight$2;
1419
+ function countHolders$1(array, placeholder2) {
1420
+ var length = array.length, result = 0;
1421
+ while (length--) {
1422
+ if (array[length] === placeholder2) {
1423
+ ++result;
1424
+ }
1425
+ }
1426
+ return result;
1427
+ }
1428
+ var _countHolders = countHolders$1;
1429
+ function baseLodash$3() {
1430
+ }
1431
+ var _baseLodash = baseLodash$3;
1432
+ var baseCreate$2 = _baseCreate, baseLodash$2 = _baseLodash;
1433
+ var MAX_ARRAY_LENGTH = 4294967295;
1434
+ function LazyWrapper$3(value) {
1435
+ this.__wrapped__ = value;
1436
+ this.__actions__ = [];
1437
+ this.__dir__ = 1;
1438
+ this.__filtered__ = false;
1439
+ this.__iteratees__ = [];
1440
+ this.__takeCount__ = MAX_ARRAY_LENGTH;
1441
+ this.__views__ = [];
1442
+ }
1443
+ LazyWrapper$3.prototype = baseCreate$2(baseLodash$2.prototype);
1444
+ LazyWrapper$3.prototype.constructor = LazyWrapper$3;
1445
+ var _LazyWrapper = LazyWrapper$3;
1446
+ function noop$2() {
1447
+ }
1448
+ var noop_1 = noop$2;
1449
+ var metaMap = _metaMap, noop$1 = noop_1;
1450
+ var getData$2 = !metaMap ? noop$1 : function(func2) {
1451
+ return metaMap.get(func2);
1452
+ };
1453
+ var _getData = getData$2;
1454
+ var realNames$1 = {};
1455
+ var _realNames = realNames$1;
1456
+ var realNames = _realNames;
1457
+ var objectProto$b = Object.prototype;
1458
+ var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
1459
+ function getFuncName$1(func2) {
1460
+ var result = func2.name + "", array = realNames[result], length = hasOwnProperty$9.call(realNames, result) ? array.length : 0;
1461
+ while (length--) {
1462
+ var data = array[length], otherFunc = data.func;
1463
+ if (otherFunc == null || otherFunc == func2) {
1464
+ return data.name;
1465
+ }
1466
+ }
1467
+ return result;
1468
+ }
1469
+ var _getFuncName = getFuncName$1;
1470
+ var baseCreate$1 = _baseCreate, baseLodash$1 = _baseLodash;
1471
+ function LodashWrapper$2(value, chainAll) {
1472
+ this.__wrapped__ = value;
1473
+ this.__actions__ = [];
1474
+ this.__chain__ = !!chainAll;
1475
+ this.__index__ = 0;
1476
+ this.__values__ = void 0;
1477
+ }
1478
+ LodashWrapper$2.prototype = baseCreate$1(baseLodash$1.prototype);
1479
+ LodashWrapper$2.prototype.constructor = LodashWrapper$2;
1480
+ var _LodashWrapper = LodashWrapper$2;
1481
+ function copyArray$4(source, array) {
1482
+ var index = -1, length = source.length;
1483
+ array || (array = Array(length));
1484
+ while (++index < length) {
1485
+ array[index] = source[index];
1486
+ }
1487
+ return array;
1488
+ }
1489
+ var _copyArray = copyArray$4;
1490
+ var LazyWrapper$2 = _LazyWrapper, LodashWrapper$1 = _LodashWrapper, copyArray$3 = _copyArray;
1491
+ function wrapperClone$1(wrapper) {
1492
+ if (wrapper instanceof LazyWrapper$2) {
1493
+ return wrapper.clone();
1494
+ }
1495
+ var result = new LodashWrapper$1(wrapper.__wrapped__, wrapper.__chain__);
1496
+ result.__actions__ = copyArray$3(wrapper.__actions__);
1497
+ result.__index__ = wrapper.__index__;
1498
+ result.__values__ = wrapper.__values__;
1499
+ return result;
1500
+ }
1501
+ var _wrapperClone = wrapperClone$1;
1502
+ var LazyWrapper$1 = _LazyWrapper, LodashWrapper = _LodashWrapper, baseLodash = _baseLodash, isArray$8 = isArray_1, isObjectLike$9 = isObjectLike_1, wrapperClone = _wrapperClone;
1503
+ var objectProto$a = Object.prototype;
1504
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
1505
+ function lodash$1(value) {
1506
+ if (isObjectLike$9(value) && !isArray$8(value) && !(value instanceof LazyWrapper$1)) {
1507
+ if (value instanceof LodashWrapper) {
1508
+ return value;
1509
+ }
1510
+ if (hasOwnProperty$8.call(value, "__wrapped__")) {
1511
+ return wrapperClone(value);
1512
+ }
1513
+ }
1514
+ return new LodashWrapper(value);
1515
+ }
1516
+ lodash$1.prototype = baseLodash.prototype;
1517
+ lodash$1.prototype.constructor = lodash$1;
1518
+ var wrapperLodash = lodash$1;
1519
+ var LazyWrapper = _LazyWrapper, getData$1 = _getData, getFuncName = _getFuncName, lodash = wrapperLodash;
1520
+ function isLaziable$1(func2) {
1521
+ var funcName = getFuncName(func2), other = lodash[funcName];
1522
+ if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
1523
+ return false;
1524
+ }
1525
+ if (func2 === other) {
1526
+ return true;
1527
+ }
1528
+ var data = getData$1(other);
1529
+ return !!data && func2 === data[0];
1530
+ }
1531
+ var _isLaziable = isLaziable$1;
1532
+ var HOT_COUNT = 800, HOT_SPAN = 16;
1533
+ var nativeNow = Date.now;
1534
+ function shortOut$2(func2) {
1535
+ var count = 0, lastCalled = 0;
1536
+ return function() {
1537
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
1538
+ lastCalled = stamp;
1539
+ if (remaining > 0) {
1540
+ if (++count >= HOT_COUNT) {
1541
+ return arguments[0];
1542
+ }
1543
+ } else {
1544
+ count = 0;
1545
+ }
1546
+ return func2.apply(void 0, arguments);
1547
+ };
1548
+ }
1549
+ var _shortOut = shortOut$2;
1550
+ var baseSetData$1 = _baseSetData, shortOut$1 = _shortOut;
1551
+ var setData$2 = shortOut$1(baseSetData$1);
1552
+ var _setData = setData$2;
1553
+ var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
1554
+ function getWrapDetails$1(source) {
1555
+ var match = source.match(reWrapDetails);
1556
+ return match ? match[1].split(reSplitDetails) : [];
1557
+ }
1558
+ var _getWrapDetails = getWrapDetails$1;
1559
+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
1560
+ function insertWrapDetails$1(source, details) {
1561
+ var length = details.length;
1562
+ if (!length) {
1563
+ return source;
1564
+ }
1565
+ var lastIndex = length - 1;
1566
+ details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
1567
+ details = details.join(length > 2 ? ", " : " ");
1568
+ return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
1569
+ }
1570
+ var _insertWrapDetails = insertWrapDetails$1;
1571
+ function constant$1(value) {
1572
+ return function() {
1573
+ return value;
1574
+ };
1575
+ }
1576
+ var constant_1 = constant$1;
1577
+ var getNative$3 = _getNative;
1578
+ var defineProperty$2 = function() {
1579
+ try {
1580
+ var func2 = getNative$3(Object, "defineProperty");
1581
+ func2({}, "", {});
1582
+ return func2;
1583
+ } catch (e) {
1584
+ }
1585
+ }();
1586
+ var _defineProperty = defineProperty$2;
1587
+ var constant = constant_1, defineProperty$1 = _defineProperty, identity$1 = identity_1;
1588
+ var baseSetToString$1 = !defineProperty$1 ? identity$1 : function(func2, string) {
1589
+ return defineProperty$1(func2, "toString", {
1590
+ "configurable": true,
1591
+ "enumerable": false,
1592
+ "value": constant(string),
1593
+ "writable": true
1594
+ });
1595
+ };
1596
+ var _baseSetToString = baseSetToString$1;
1597
+ var baseSetToString = _baseSetToString, shortOut = _shortOut;
1598
+ var setToString$2 = shortOut(baseSetToString);
1599
+ var _setToString = setToString$2;
1600
+ function arrayEach$2(array, iteratee2) {
1601
+ var index = -1, length = array == null ? 0 : array.length;
1602
+ while (++index < length) {
1603
+ if (iteratee2(array[index], index, array) === false) {
1604
+ break;
1605
+ }
1606
+ }
1607
+ return array;
1608
+ }
1609
+ var _arrayEach = arrayEach$2;
1610
+ function baseFindIndex$1(array, predicate, fromIndex, fromRight) {
1611
+ var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
1612
+ while (fromRight ? index-- : ++index < length) {
1613
+ if (predicate(array[index], index, array)) {
1614
+ return index;
1615
+ }
1616
+ }
1617
+ return -1;
1618
+ }
1619
+ var _baseFindIndex = baseFindIndex$1;
1620
+ function baseIsNaN$1(value) {
1621
+ return value !== value;
1622
+ }
1623
+ var _baseIsNaN = baseIsNaN$1;
1624
+ function strictIndexOf$1(array, value, fromIndex) {
1625
+ var index = fromIndex - 1, length = array.length;
1626
+ while (++index < length) {
1627
+ if (array[index] === value) {
1628
+ return index;
1629
+ }
1630
+ }
1631
+ return -1;
1632
+ }
1633
+ var _strictIndexOf = strictIndexOf$1;
1634
+ var baseFindIndex = _baseFindIndex, baseIsNaN = _baseIsNaN, strictIndexOf = _strictIndexOf;
1635
+ function baseIndexOf$1(array, value, fromIndex) {
1636
+ return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
1637
+ }
1638
+ var _baseIndexOf = baseIndexOf$1;
1639
+ var baseIndexOf = _baseIndexOf;
1640
+ function arrayIncludes$1(array, value) {
1641
+ var length = array == null ? 0 : array.length;
1642
+ return !!length && baseIndexOf(array, value, 0) > -1;
1643
+ }
1644
+ var _arrayIncludes = arrayIncludes$1;
1645
+ var arrayEach$1 = _arrayEach, arrayIncludes = _arrayIncludes;
1646
+ var WRAP_BIND_FLAG$5 = 1, WRAP_BIND_KEY_FLAG$4 = 2, WRAP_CURRY_FLAG$5 = 8, WRAP_CURRY_RIGHT_FLAG$2 = 16, WRAP_PARTIAL_FLAG$2 = 32, WRAP_PARTIAL_RIGHT_FLAG$2 = 64, WRAP_ARY_FLAG$3 = 128, WRAP_REARG_FLAG$2 = 256, WRAP_FLIP_FLAG$1 = 512;
1647
+ var wrapFlags = [
1648
+ ["ary", WRAP_ARY_FLAG$3],
1649
+ ["bind", WRAP_BIND_FLAG$5],
1650
+ ["bindKey", WRAP_BIND_KEY_FLAG$4],
1651
+ ["curry", WRAP_CURRY_FLAG$5],
1652
+ ["curryRight", WRAP_CURRY_RIGHT_FLAG$2],
1653
+ ["flip", WRAP_FLIP_FLAG$1],
1654
+ ["partial", WRAP_PARTIAL_FLAG$2],
1655
+ ["partialRight", WRAP_PARTIAL_RIGHT_FLAG$2],
1656
+ ["rearg", WRAP_REARG_FLAG$2]
1657
+ ];
1658
+ function updateWrapDetails$1(details, bitmask) {
1659
+ arrayEach$1(wrapFlags, function(pair) {
1660
+ var value = "_." + pair[0];
1661
+ if (bitmask & pair[1] && !arrayIncludes(details, value)) {
1662
+ details.push(value);
1663
+ }
1664
+ });
1665
+ return details.sort();
1666
+ }
1667
+ var _updateWrapDetails = updateWrapDetails$1;
1668
+ var getWrapDetails = _getWrapDetails, insertWrapDetails = _insertWrapDetails, setToString$1 = _setToString, updateWrapDetails = _updateWrapDetails;
1669
+ function setWrapToString$2(wrapper, reference, bitmask) {
1670
+ var source = reference + "";
1671
+ return setToString$1(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
1672
+ }
1673
+ var _setWrapToString = setWrapToString$2;
1674
+ var isLaziable = _isLaziable, setData$1 = _setData, setWrapToString$1 = _setWrapToString;
1675
+ var WRAP_BIND_FLAG$4 = 1, WRAP_BIND_KEY_FLAG$3 = 2, WRAP_CURRY_BOUND_FLAG$1 = 4, WRAP_CURRY_FLAG$4 = 8, WRAP_PARTIAL_FLAG$1 = 32, WRAP_PARTIAL_RIGHT_FLAG$1 = 64;
1676
+ function createRecurry$2(func2, bitmask, wrapFunc, placeholder2, thisArg, partials, holders, argPos, ary2, arity) {
1677
+ var isCurry = bitmask & WRAP_CURRY_FLAG$4, newHolders = isCurry ? holders : void 0, newHoldersRight = isCurry ? void 0 : holders, newPartials = isCurry ? partials : void 0, newPartialsRight = isCurry ? void 0 : partials;
1678
+ bitmask |= isCurry ? WRAP_PARTIAL_FLAG$1 : WRAP_PARTIAL_RIGHT_FLAG$1;
1679
+ bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG$1 : WRAP_PARTIAL_FLAG$1);
1680
+ if (!(bitmask & WRAP_CURRY_BOUND_FLAG$1)) {
1681
+ bitmask &= ~(WRAP_BIND_FLAG$4 | WRAP_BIND_KEY_FLAG$3);
1682
+ }
1683
+ var newData = [
1684
+ func2,
1685
+ bitmask,
1686
+ thisArg,
1687
+ newPartials,
1688
+ newHolders,
1689
+ newPartialsRight,
1690
+ newHoldersRight,
1691
+ argPos,
1692
+ ary2,
1693
+ arity
1694
+ ];
1695
+ var result = wrapFunc.apply(void 0, newData);
1696
+ if (isLaziable(func2)) {
1697
+ setData$1(result, newData);
1698
+ }
1699
+ result.placeholder = placeholder2;
1700
+ return setWrapToString$1(result, func2, bitmask);
1701
+ }
1702
+ var _createRecurry = createRecurry$2;
1703
+ function getHolder$2(func2) {
1704
+ var object = func2;
1705
+ return object.placeholder;
1706
+ }
1707
+ var _getHolder = getHolder$2;
1708
+ var _isIndex;
1709
+ var hasRequired_isIndex;
1710
+ function require_isIndex() {
1711
+ if (hasRequired_isIndex)
1712
+ return _isIndex;
1713
+ hasRequired_isIndex = 1;
1714
+ var MAX_SAFE_INTEGER2 = 9007199254740991;
1715
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1716
+ function isIndex2(value, length) {
1717
+ var type = typeof value;
1718
+ length = length == null ? MAX_SAFE_INTEGER2 : length;
1719
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
1720
+ }
1721
+ _isIndex = isIndex2;
1722
+ return _isIndex;
1723
+ }
1724
+ var copyArray$2 = _copyArray, isIndex$2 = require_isIndex();
1725
+ var nativeMin$1 = Math.min;
1726
+ function reorder$1(array, indexes) {
1727
+ var arrLength = array.length, length = nativeMin$1(indexes.length, arrLength), oldArray = copyArray$2(array);
1728
+ while (length--) {
1729
+ var index = indexes[length];
1730
+ array[length] = isIndex$2(index, arrLength) ? oldArray[index] : void 0;
1731
+ }
1732
+ return array;
1733
+ }
1734
+ var _reorder = reorder$1;
1735
+ var PLACEHOLDER$1 = "__lodash_placeholder__";
1736
+ function replaceHolders$3(array, placeholder2) {
1737
+ var index = -1, length = array.length, resIndex = 0, result = [];
1738
+ while (++index < length) {
1739
+ var value = array[index];
1740
+ if (value === placeholder2 || value === PLACEHOLDER$1) {
1741
+ array[index] = PLACEHOLDER$1;
1742
+ result[resIndex++] = index;
1743
+ }
1744
+ }
1745
+ return result;
1746
+ }
1747
+ var _replaceHolders = replaceHolders$3;
1748
+ var composeArgs$1 = _composeArgs, composeArgsRight$1 = _composeArgsRight, countHolders = _countHolders, createCtor$2 = _createCtor, createRecurry$1 = _createRecurry, getHolder$1 = _getHolder, reorder = _reorder, replaceHolders$2 = _replaceHolders, root$6 = _root;
1749
+ var WRAP_BIND_FLAG$3 = 1, WRAP_BIND_KEY_FLAG$2 = 2, WRAP_CURRY_FLAG$3 = 8, WRAP_CURRY_RIGHT_FLAG$1 = 16, WRAP_ARY_FLAG$2 = 128, WRAP_FLIP_FLAG = 512;
1750
+ function createHybrid$2(func2, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
1751
+ var isAry = bitmask & WRAP_ARY_FLAG$2, isBind = bitmask & WRAP_BIND_FLAG$3, isBindKey = bitmask & WRAP_BIND_KEY_FLAG$2, isCurried = bitmask & (WRAP_CURRY_FLAG$3 | WRAP_CURRY_RIGHT_FLAG$1), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? void 0 : createCtor$2(func2);
1752
+ function wrapper() {
1753
+ var length = arguments.length, args = Array(length), index = length;
1754
+ while (index--) {
1755
+ args[index] = arguments[index];
1756
+ }
1757
+ if (isCurried) {
1758
+ var placeholder2 = getHolder$1(wrapper), holdersCount = countHolders(args, placeholder2);
1759
+ }
1760
+ if (partials) {
1761
+ args = composeArgs$1(args, partials, holders, isCurried);
1762
+ }
1763
+ if (partialsRight) {
1764
+ args = composeArgsRight$1(args, partialsRight, holdersRight, isCurried);
1765
+ }
1766
+ length -= holdersCount;
1767
+ if (isCurried && length < arity) {
1768
+ var newHolders = replaceHolders$2(args, placeholder2);
1769
+ return createRecurry$1(
1770
+ func2,
1771
+ bitmask,
1772
+ createHybrid$2,
1773
+ wrapper.placeholder,
1774
+ thisArg,
1775
+ args,
1776
+ newHolders,
1777
+ argPos,
1778
+ ary2,
1779
+ arity - length
1780
+ );
1781
+ }
1782
+ var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func2] : func2;
1783
+ length = args.length;
1784
+ if (argPos) {
1785
+ args = reorder(args, argPos);
1786
+ } else if (isFlip && length > 1) {
1787
+ args.reverse();
1788
+ }
1789
+ if (isAry && ary2 < length) {
1790
+ args.length = ary2;
1791
+ }
1792
+ if (this && this !== root$6 && this instanceof wrapper) {
1793
+ fn = Ctor || createCtor$2(fn);
1794
+ }
1795
+ return fn.apply(thisBinding, args);
1796
+ }
1797
+ return wrapper;
1798
+ }
1799
+ var _createHybrid = createHybrid$2;
1800
+ var apply$2 = _apply, createCtor$1 = _createCtor, createHybrid$1 = _createHybrid, createRecurry = _createRecurry, getHolder = _getHolder, replaceHolders$1 = _replaceHolders, root$5 = _root;
1801
+ function createCurry$1(func2, bitmask, arity) {
1802
+ var Ctor = createCtor$1(func2);
1803
+ function wrapper() {
1804
+ var length = arguments.length, args = Array(length), index = length, placeholder2 = getHolder(wrapper);
1805
+ while (index--) {
1806
+ args[index] = arguments[index];
1807
+ }
1808
+ var holders = length < 3 && args[0] !== placeholder2 && args[length - 1] !== placeholder2 ? [] : replaceHolders$1(args, placeholder2);
1809
+ length -= holders.length;
1810
+ if (length < arity) {
1811
+ return createRecurry(
1812
+ func2,
1813
+ bitmask,
1814
+ createHybrid$1,
1815
+ wrapper.placeholder,
1816
+ void 0,
1817
+ args,
1818
+ holders,
1819
+ void 0,
1820
+ void 0,
1821
+ arity - length
1822
+ );
1823
+ }
1824
+ var fn = this && this !== root$5 && this instanceof wrapper ? Ctor : func2;
1825
+ return apply$2(fn, this, args);
1826
+ }
1827
+ return wrapper;
1828
+ }
1829
+ var _createCurry = createCurry$1;
1830
+ var apply$1 = _apply, createCtor = _createCtor, root$4 = _root;
1831
+ var WRAP_BIND_FLAG$2 = 1;
1832
+ function createPartial$1(func2, bitmask, thisArg, partials) {
1833
+ var isBind = bitmask & WRAP_BIND_FLAG$2, Ctor = createCtor(func2);
1834
+ function wrapper() {
1835
+ var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root$4 && this instanceof wrapper ? Ctor : func2;
1836
+ while (++leftIndex < leftLength) {
1837
+ args[leftIndex] = partials[leftIndex];
1838
+ }
1839
+ while (argsLength--) {
1840
+ args[leftIndex++] = arguments[++argsIndex];
1841
+ }
1842
+ return apply$1(fn, isBind ? thisArg : this, args);
1843
+ }
1844
+ return wrapper;
1845
+ }
1846
+ var _createPartial = createPartial$1;
1847
+ var composeArgs = _composeArgs, composeArgsRight = _composeArgsRight, replaceHolders = _replaceHolders;
1848
+ var PLACEHOLDER = "__lodash_placeholder__";
1849
+ var WRAP_BIND_FLAG$1 = 1, WRAP_BIND_KEY_FLAG$1 = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG$2 = 8, WRAP_ARY_FLAG$1 = 128, WRAP_REARG_FLAG$1 = 256;
1850
+ var nativeMin = Math.min;
1851
+ function mergeData$1(data, source) {
1852
+ var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG$1 | WRAP_BIND_KEY_FLAG$1 | WRAP_ARY_FLAG$1);
1853
+ var isCombo = srcBitmask == WRAP_ARY_FLAG$1 && bitmask == WRAP_CURRY_FLAG$2 || srcBitmask == WRAP_ARY_FLAG$1 && bitmask == WRAP_REARG_FLAG$1 && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG$1 | WRAP_REARG_FLAG$1) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG$2;
1854
+ if (!(isCommon || isCombo)) {
1855
+ return data;
1856
+ }
1857
+ if (srcBitmask & WRAP_BIND_FLAG$1) {
1858
+ data[2] = source[2];
1859
+ newBitmask |= bitmask & WRAP_BIND_FLAG$1 ? 0 : WRAP_CURRY_BOUND_FLAG;
1860
+ }
1861
+ var value = source[3];
1862
+ if (value) {
1863
+ var partials = data[3];
1864
+ data[3] = partials ? composeArgs(partials, value, source[4]) : value;
1865
+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
1866
+ }
1867
+ value = source[5];
1868
+ if (value) {
1869
+ partials = data[5];
1870
+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
1871
+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
1872
+ }
1873
+ value = source[7];
1874
+ if (value) {
1875
+ data[7] = value;
1876
+ }
1877
+ if (srcBitmask & WRAP_ARY_FLAG$1) {
1878
+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
1879
+ }
1880
+ if (data[9] == null) {
1881
+ data[9] = source[9];
1882
+ }
1883
+ data[0] = source[0];
1884
+ data[1] = newBitmask;
1885
+ return data;
1886
+ }
1887
+ var _mergeData = mergeData$1;
1888
+ var reWhitespace = /\s/;
1889
+ function trimmedEndIndex$1(string) {
1890
+ var index = string.length;
1891
+ while (index-- && reWhitespace.test(string.charAt(index))) {
1892
+ }
1893
+ return index;
1894
+ }
1895
+ var _trimmedEndIndex = trimmedEndIndex$1;
1896
+ var trimmedEndIndex = _trimmedEndIndex;
1897
+ var reTrimStart = /^\s+/;
1898
+ function baseTrim$1(string) {
1899
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
1900
+ }
1901
+ var _baseTrim = baseTrim$1;
1902
+ var baseTrim = _baseTrim, isObject$3 = isObject_1, isSymbol$1 = isSymbol_1;
1903
+ var NAN = 0 / 0;
1904
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
1905
+ var reIsBinary = /^0b[01]+$/i;
1906
+ var reIsOctal = /^0o[0-7]+$/i;
1907
+ var freeParseInt = parseInt;
1908
+ function toNumber$1(value) {
1909
+ if (typeof value == "number") {
1910
+ return value;
1911
+ }
1912
+ if (isSymbol$1(value)) {
1913
+ return NAN;
1914
+ }
1915
+ if (isObject$3(value)) {
1916
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
1917
+ value = isObject$3(other) ? other + "" : other;
1918
+ }
1919
+ if (typeof value != "string") {
1920
+ return value === 0 ? value : +value;
1921
+ }
1922
+ value = baseTrim(value);
1923
+ var isBinary = reIsBinary.test(value);
1924
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
1925
+ }
1926
+ var toNumber_1 = toNumber$1;
1927
+ var toNumber = toNumber_1;
1928
+ var INFINITY = 1 / 0, MAX_INTEGER = 17976931348623157e292;
1929
+ function toFinite$1(value) {
1930
+ if (!value) {
1931
+ return value === 0 ? value : 0;
1932
+ }
1933
+ value = toNumber(value);
1934
+ if (value === INFINITY || value === -INFINITY) {
1935
+ var sign = value < 0 ? -1 : 1;
1936
+ return sign * MAX_INTEGER;
1937
+ }
1938
+ return value === value ? value : 0;
1939
+ }
1940
+ var toFinite_1 = toFinite$1;
1941
+ var toFinite = toFinite_1;
1942
+ function toInteger$1(value) {
1943
+ var result = toFinite(value), remainder = result % 1;
1944
+ return result === result ? remainder ? result - remainder : result : 0;
1945
+ }
1946
+ var toInteger_1 = toInteger$1;
1947
+ var baseSetData = _baseSetData, createBind = _createBind, createCurry = _createCurry, createHybrid = _createHybrid, createPartial = _createPartial, getData = _getData, mergeData = _mergeData, setData = _setData, setWrapToString = _setWrapToString, toInteger = toInteger_1;
1948
+ var FUNC_ERROR_TEXT = "Expected a function";
1949
+ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_FLAG$1 = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64;
1950
+ var nativeMax$1 = Math.max;
1951
+ function createWrap$3(func2, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
1952
+ var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
1953
+ if (!isBindKey && typeof func2 != "function") {
1954
+ throw new TypeError(FUNC_ERROR_TEXT);
1955
+ }
1956
+ var length = partials ? partials.length : 0;
1957
+ if (!length) {
1958
+ bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
1959
+ partials = holders = void 0;
1960
+ }
1961
+ ary2 = ary2 === void 0 ? ary2 : nativeMax$1(toInteger(ary2), 0);
1962
+ arity = arity === void 0 ? arity : toInteger(arity);
1963
+ length -= holders ? holders.length : 0;
1964
+ if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
1965
+ var partialsRight = partials, holdersRight = holders;
1966
+ partials = holders = void 0;
1967
+ }
1968
+ var data = isBindKey ? void 0 : getData(func2);
1969
+ var newData = [
1970
+ func2,
1971
+ bitmask,
1972
+ thisArg,
1973
+ partials,
1974
+ holders,
1975
+ partialsRight,
1976
+ holdersRight,
1977
+ argPos,
1978
+ ary2,
1979
+ arity
1980
+ ];
1981
+ if (data) {
1982
+ mergeData(newData, data);
1983
+ }
1984
+ func2 = newData[0];
1985
+ bitmask = newData[1];
1986
+ thisArg = newData[2];
1987
+ partials = newData[3];
1988
+ holders = newData[4];
1989
+ arity = newData[9] = newData[9] === void 0 ? isBindKey ? 0 : func2.length : nativeMax$1(newData[9] - length, 0);
1990
+ if (!arity && bitmask & (WRAP_CURRY_FLAG$1 | WRAP_CURRY_RIGHT_FLAG)) {
1991
+ bitmask &= ~(WRAP_CURRY_FLAG$1 | WRAP_CURRY_RIGHT_FLAG);
1992
+ }
1993
+ if (!bitmask || bitmask == WRAP_BIND_FLAG) {
1994
+ var result = createBind(func2, bitmask, thisArg);
1995
+ } else if (bitmask == WRAP_CURRY_FLAG$1 || bitmask == WRAP_CURRY_RIGHT_FLAG) {
1996
+ result = createCurry(func2, bitmask, arity);
1997
+ } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
1998
+ result = createPartial(func2, bitmask, thisArg, partials);
1999
+ } else {
2000
+ result = createHybrid.apply(void 0, newData);
2001
+ }
2002
+ var setter = data ? baseSetData : setData;
2003
+ return setWrapToString(setter(result, newData), func2, bitmask);
2004
+ }
2005
+ var _createWrap = createWrap$3;
2006
+ var createWrap$2 = _createWrap;
2007
+ var WRAP_ARY_FLAG = 128;
2008
+ function ary(func2, n, guard) {
2009
+ n = guard ? void 0 : n;
2010
+ n = func2 && n == null ? func2.length : n;
2011
+ return createWrap$2(func2, WRAP_ARY_FLAG, void 0, void 0, void 0, void 0, n);
2012
+ }
2013
+ var ary_1 = ary;
2014
+ var defineProperty = _defineProperty;
2015
+ function baseAssignValue$1(object, key, value) {
2016
+ if (key == "__proto__" && defineProperty) {
2017
+ defineProperty(object, key, {
2018
+ "configurable": true,
2019
+ "enumerable": true,
2020
+ "value": value,
2021
+ "writable": true
2022
+ });
2023
+ } else {
2024
+ object[key] = value;
2025
+ }
2026
+ }
2027
+ var _baseAssignValue = baseAssignValue$1;
2028
+ var _assignValue;
2029
+ var hasRequired_assignValue;
2030
+ function require_assignValue() {
2031
+ if (hasRequired_assignValue)
2032
+ return _assignValue;
2033
+ hasRequired_assignValue = 1;
2034
+ var baseAssignValue2 = _baseAssignValue, eq2 = requireEq();
2035
+ var objectProto2 = Object.prototype;
2036
+ var hasOwnProperty2 = objectProto2.hasOwnProperty;
2037
+ function assignValue2(object, key, value) {
2038
+ var objValue = object[key];
2039
+ if (!(hasOwnProperty2.call(object, key) && eq2(objValue, value)) || value === void 0 && !(key in object)) {
2040
+ baseAssignValue2(object, key, value);
2041
+ }
2042
+ }
2043
+ _assignValue = assignValue2;
2044
+ return _assignValue;
2045
+ }
2046
+ var assignValue$1 = require_assignValue(), baseAssignValue = _baseAssignValue;
2047
+ function copyObject$4(source, props, object, customizer) {
2048
+ var isNew = !object;
2049
+ object || (object = {});
2050
+ var index = -1, length = props.length;
2051
+ while (++index < length) {
2052
+ var key = props[index];
2053
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
2054
+ if (newValue === void 0) {
2055
+ newValue = source[key];
2056
+ }
2057
+ if (isNew) {
2058
+ baseAssignValue(object, key, newValue);
2059
+ } else {
2060
+ assignValue$1(object, key, newValue);
2061
+ }
2062
+ }
2063
+ return object;
2064
+ }
2065
+ var _copyObject = copyObject$4;
2066
+ function baseTimes$1(n, iteratee2) {
2067
+ var index = -1, result = Array(n);
2068
+ while (++index < n) {
2069
+ result[index] = iteratee2(index);
2070
+ }
2071
+ return result;
2072
+ }
2073
+ var _baseTimes = baseTimes$1;
2074
+ var baseGetTag$4 = _baseGetTag, isObjectLike$8 = isObjectLike_1;
2075
+ var argsTag$3 = "[object Arguments]";
2076
+ function baseIsArguments$1(value) {
2077
+ return isObjectLike$8(value) && baseGetTag$4(value) == argsTag$3;
2078
+ }
2079
+ var _baseIsArguments = baseIsArguments$1;
2080
+ var baseIsArguments = _baseIsArguments, isObjectLike$7 = isObjectLike_1;
2081
+ var objectProto$9 = Object.prototype;
2082
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
2083
+ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
2084
+ var isArguments$3 = baseIsArguments(function() {
2085
+ return arguments;
2086
+ }()) ? baseIsArguments : function(value) {
2087
+ return isObjectLike$7(value) && hasOwnProperty$7.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
2088
+ };
2089
+ var isArguments_1 = isArguments$3;
2090
+ var isBufferExports = {};
2091
+ var isBuffer$3 = {
2092
+ get exports() {
2093
+ return isBufferExports;
2094
+ },
2095
+ set exports(v) {
2096
+ isBufferExports = v;
2097
+ }
2098
+ };
2099
+ function stubFalse() {
2100
+ return false;
2101
+ }
2102
+ var stubFalse_1 = stubFalse;
2103
+ (function(module, exports) {
2104
+ var root2 = _root, stubFalse2 = stubFalse_1;
2105
+ var freeExports = exports && !exports.nodeType && exports;
2106
+ var freeModule = freeExports && true && module && !module.nodeType && module;
2107
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2108
+ var Buffer = moduleExports ? root2.Buffer : void 0;
2109
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
2110
+ var isBuffer2 = nativeIsBuffer || stubFalse2;
2111
+ module.exports = isBuffer2;
2112
+ })(isBuffer$3, isBufferExports);
2113
+ var MAX_SAFE_INTEGER = 9007199254740991;
2114
+ function isLength$3(value) {
2115
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2116
+ }
2117
+ var isLength_1 = isLength$3;
2118
+ var baseGetTag$3 = _baseGetTag, isLength$2 = isLength_1, isObjectLike$6 = isObjectLike_1;
2119
+ var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$3 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$3 = "[object WeakMap]";
2120
+ var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
2121
+ var typedArrayTags = {};
2122
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
2123
+ typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$3] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$3] = false;
2124
+ function baseIsTypedArray$1(value) {
2125
+ return isObjectLike$6(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$3(value)];
2126
+ }
2127
+ var _baseIsTypedArray = baseIsTypedArray$1;
2128
+ function baseUnary$3(func2) {
2129
+ return function(value) {
2130
+ return func2(value);
2131
+ };
2132
+ }
2133
+ var _baseUnary = baseUnary$3;
2134
+ var _nodeUtilExports = {};
2135
+ var _nodeUtil = {
2136
+ get exports() {
2137
+ return _nodeUtilExports;
2138
+ },
2139
+ set exports(v) {
2140
+ _nodeUtilExports = v;
2141
+ }
2142
+ };
2143
+ (function(module, exports) {
2144
+ var freeGlobal2 = _freeGlobal;
2145
+ var freeExports = exports && !exports.nodeType && exports;
2146
+ var freeModule = freeExports && true && module && !module.nodeType && module;
2147
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2148
+ var freeProcess = moduleExports && freeGlobal2.process;
2149
+ var nodeUtil2 = function() {
2150
+ try {
2151
+ var types = freeModule && freeModule.require && freeModule.require("util").types;
2152
+ if (types) {
2153
+ return types;
2154
+ }
2155
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
2156
+ } catch (e) {
2157
+ }
2158
+ }();
2159
+ module.exports = nodeUtil2;
2160
+ })(_nodeUtil, _nodeUtilExports);
2161
+ var baseIsTypedArray = _baseIsTypedArray, baseUnary$2 = _baseUnary, nodeUtil$2 = _nodeUtilExports;
2162
+ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
2163
+ var isTypedArray$2 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
2164
+ var isTypedArray_1 = isTypedArray$2;
2165
+ var baseTimes = _baseTimes, isArguments$2 = isArguments_1, isArray$7 = isArray_1, isBuffer$2 = isBufferExports, isIndex$1 = require_isIndex(), isTypedArray$1 = isTypedArray_1;
2166
+ var objectProto$8 = Object.prototype;
2167
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
2168
+ function arrayLikeKeys$2(value, inherited) {
2169
+ var isArr = isArray$7(value), isArg = !isArr && isArguments$2(value), isBuff = !isArr && !isArg && isBuffer$2(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
2170
+ for (var key in value) {
2171
+ if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
2172
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2173
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2174
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
2175
+ isIndex$1(key, length)))) {
2176
+ result.push(key);
2177
+ }
2178
+ }
2179
+ return result;
2180
+ }
2181
+ var _arrayLikeKeys = arrayLikeKeys$2;
2182
+ var objectProto$7 = Object.prototype;
2183
+ function isPrototype$3(value) {
2184
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$7;
2185
+ return value === proto;
2186
+ }
2187
+ var _isPrototype = isPrototype$3;
2188
+ function overArg$2(func2, transform) {
2189
+ return function(arg) {
2190
+ return func2(transform(arg));
2191
+ };
2192
+ }
2193
+ var _overArg = overArg$2;
2194
+ var overArg$1 = _overArg;
2195
+ var nativeKeys$1 = overArg$1(Object.keys, Object);
2196
+ var _nativeKeys = nativeKeys$1;
2197
+ var isPrototype$2 = _isPrototype, nativeKeys = _nativeKeys;
2198
+ var objectProto$6 = Object.prototype;
2199
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
2200
+ function baseKeys$1(object) {
2201
+ if (!isPrototype$2(object)) {
2202
+ return nativeKeys(object);
2203
+ }
2204
+ var result = [];
2205
+ for (var key in Object(object)) {
2206
+ if (hasOwnProperty$5.call(object, key) && key != "constructor") {
2207
+ result.push(key);
2208
+ }
2209
+ }
2210
+ return result;
2211
+ }
2212
+ var _baseKeys = baseKeys$1;
2213
+ var isFunction$1 = isFunction_1, isLength$1 = isLength_1;
2214
+ function isArrayLike$2(value) {
2215
+ return value != null && isLength$1(value.length) && !isFunction$1(value);
2216
+ }
2217
+ var isArrayLike_1 = isArrayLike$2;
2218
+ var arrayLikeKeys$1 = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike$1 = isArrayLike_1;
2219
+ function keys$4(object) {
2220
+ return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys(object);
2221
+ }
2222
+ var keys_1 = keys$4;
2223
+ var copyObject$3 = _copyObject, keys$3 = keys_1;
2224
+ function baseAssign$1(object, source) {
2225
+ return object && copyObject$3(source, keys$3(source), object);
2226
+ }
2227
+ var _baseAssign = baseAssign$1;
2228
+ var ListCache$2 = _ListCache;
2229
+ function stackClear$1() {
2230
+ this.__data__ = new ListCache$2();
2231
+ this.size = 0;
2232
+ }
2233
+ var _stackClear = stackClear$1;
2234
+ function stackDelete$1(key) {
2235
+ var data = this.__data__, result = data["delete"](key);
2236
+ this.size = data.size;
2237
+ return result;
2238
+ }
2239
+ var _stackDelete = stackDelete$1;
2240
+ function stackGet$1(key) {
2241
+ return this.__data__.get(key);
2242
+ }
2243
+ var _stackGet = stackGet$1;
2244
+ function stackHas$1(key) {
2245
+ return this.__data__.has(key);
2246
+ }
2247
+ var _stackHas = stackHas$1;
2248
+ var ListCache$1 = _ListCache, Map$2 = _Map, MapCache$1 = _MapCache;
2249
+ var LARGE_ARRAY_SIZE = 200;
2250
+ function stackSet$1(key, value) {
2251
+ var data = this.__data__;
2252
+ if (data instanceof ListCache$1) {
2253
+ var pairs = data.__data__;
2254
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
2255
+ pairs.push([key, value]);
2256
+ this.size = ++data.size;
2257
+ return this;
2258
+ }
2259
+ data = this.__data__ = new MapCache$1(pairs);
2260
+ }
2261
+ data.set(key, value);
2262
+ this.size = data.size;
2263
+ return this;
2264
+ }
2265
+ var _stackSet = stackSet$1;
2266
+ var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
2267
+ function Stack$3(entries) {
2268
+ var data = this.__data__ = new ListCache(entries);
2269
+ this.size = data.size;
2270
+ }
2271
+ Stack$3.prototype.clear = stackClear;
2272
+ Stack$3.prototype["delete"] = stackDelete;
2273
+ Stack$3.prototype.get = stackGet;
2274
+ Stack$3.prototype.has = stackHas;
2275
+ Stack$3.prototype.set = stackSet;
2276
+ var _Stack = Stack$3;
2277
+ function nativeKeysIn$1(object) {
2278
+ var result = [];
2279
+ if (object != null) {
2280
+ for (var key in Object(object)) {
2281
+ result.push(key);
2282
+ }
2283
+ }
2284
+ return result;
2285
+ }
2286
+ var _nativeKeysIn = nativeKeysIn$1;
2287
+ var isObject$2 = isObject_1, isPrototype$1 = _isPrototype, nativeKeysIn = _nativeKeysIn;
2288
+ var objectProto$5 = Object.prototype;
2289
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
2290
+ function baseKeysIn$1(object) {
2291
+ if (!isObject$2(object)) {
2292
+ return nativeKeysIn(object);
2293
+ }
2294
+ var isProto = isPrototype$1(object), result = [];
2295
+ for (var key in object) {
2296
+ if (!(key == "constructor" && (isProto || !hasOwnProperty$4.call(object, key)))) {
2297
+ result.push(key);
2298
+ }
2299
+ }
2300
+ return result;
2301
+ }
2302
+ var _baseKeysIn = baseKeysIn$1;
2303
+ var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
2304
+ function keysIn$3(object) {
2305
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
2306
+ }
2307
+ var keysIn_1 = keysIn$3;
2308
+ var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
2309
+ function baseAssignIn$1(object, source) {
2310
+ return object && copyObject$2(source, keysIn$2(source), object);
2311
+ }
2312
+ var _baseAssignIn = baseAssignIn$1;
2313
+ var _cloneBufferExports = {};
2314
+ var _cloneBuffer = {
2315
+ get exports() {
2316
+ return _cloneBufferExports;
2317
+ },
2318
+ set exports(v) {
2319
+ _cloneBufferExports = v;
2320
+ }
2321
+ };
2322
+ (function(module, exports) {
2323
+ var root2 = _root;
2324
+ var freeExports = exports && !exports.nodeType && exports;
2325
+ var freeModule = freeExports && true && module && !module.nodeType && module;
2326
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2327
+ var Buffer = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
2328
+ function cloneBuffer2(buffer, isDeep) {
2329
+ if (isDeep) {
2330
+ return buffer.slice();
2331
+ }
2332
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
2333
+ buffer.copy(result);
2334
+ return result;
2335
+ }
2336
+ module.exports = cloneBuffer2;
2337
+ })(_cloneBuffer, _cloneBufferExports);
2338
+ function arrayFilter$1(array, predicate) {
2339
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
2340
+ while (++index < length) {
2341
+ var value = array[index];
2342
+ if (predicate(value, index, array)) {
2343
+ result[resIndex++] = value;
2344
+ }
2345
+ }
2346
+ return result;
2347
+ }
2348
+ var _arrayFilter = arrayFilter$1;
2349
+ function stubArray$2() {
2350
+ return [];
2351
+ }
2352
+ var stubArray_1 = stubArray$2;
2353
+ var arrayFilter = _arrayFilter, stubArray$1 = stubArray_1;
2354
+ var objectProto$4 = Object.prototype;
2355
+ var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
2356
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
2357
+ var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
2358
+ if (object == null) {
2359
+ return [];
2360
+ }
2361
+ object = Object(object);
2362
+ return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
2363
+ return propertyIsEnumerable.call(object, symbol);
2364
+ });
2365
+ };
2366
+ var _getSymbols = getSymbols$3;
2367
+ var copyObject$1 = _copyObject, getSymbols$2 = _getSymbols;
2368
+ function copySymbols$1(source, object) {
2369
+ return copyObject$1(source, getSymbols$2(source), object);
2370
+ }
2371
+ var _copySymbols = copySymbols$1;
2372
+ function arrayPush$3(array, values) {
2373
+ var index = -1, length = values.length, offset = array.length;
2374
+ while (++index < length) {
2375
+ array[offset + index] = values[index];
2376
+ }
2377
+ return array;
2378
+ }
2379
+ var _arrayPush = arrayPush$3;
2380
+ var overArg = _overArg;
2381
+ var getPrototype$3 = overArg(Object.getPrototypeOf, Object);
2382
+ var _getPrototype = getPrototype$3;
2383
+ var arrayPush$2 = _arrayPush, getPrototype$2 = _getPrototype, getSymbols$1 = _getSymbols, stubArray = stubArray_1;
2384
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
2385
+ var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
2386
+ var result = [];
2387
+ while (object) {
2388
+ arrayPush$2(result, getSymbols$1(object));
2389
+ object = getPrototype$2(object);
2390
+ }
2391
+ return result;
2392
+ };
2393
+ var _getSymbolsIn = getSymbolsIn$2;
2394
+ var copyObject = _copyObject, getSymbolsIn$1 = _getSymbolsIn;
2395
+ function copySymbolsIn$1(source, object) {
2396
+ return copyObject(source, getSymbolsIn$1(source), object);
2397
+ }
2398
+ var _copySymbolsIn = copySymbolsIn$1;
2399
+ var arrayPush$1 = _arrayPush, isArray$6 = isArray_1;
2400
+ function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
2401
+ var result = keysFunc(object);
2402
+ return isArray$6(object) ? result : arrayPush$1(result, symbolsFunc(object));
2403
+ }
2404
+ var _baseGetAllKeys = baseGetAllKeys$2;
2405
+ var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols = _getSymbols, keys$2 = keys_1;
2406
+ function getAllKeys$2(object) {
2407
+ return baseGetAllKeys$1(object, keys$2, getSymbols);
2408
+ }
2409
+ var _getAllKeys = getAllKeys$2;
2410
+ var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
2411
+ function getAllKeysIn$1(object) {
2412
+ return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
2413
+ }
2414
+ var _getAllKeysIn = getAllKeysIn$1;
2415
+ var getNative$2 = _getNative, root$3 = _root;
2416
+ var DataView$1 = getNative$2(root$3, "DataView");
2417
+ var _DataView = DataView$1;
2418
+ var getNative$1 = _getNative, root$2 = _root;
2419
+ var Promise$2 = getNative$1(root$2, "Promise");
2420
+ var _Promise = Promise$2;
2421
+ var getNative = _getNative, root$1 = _root;
2422
+ var Set$1 = getNative(root$1, "Set");
2423
+ var _Set = Set$1;
2424
+ var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set = _Set, WeakMap$1 = _WeakMap, baseGetTag$2 = _baseGetTag, toSource = _toSource;
2425
+ var mapTag$4 = "[object Map]", objectTag$3 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$2 = "[object WeakMap]";
2426
+ var dataViewTag$3 = "[object DataView]";
2427
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap$1);
2428
+ var getTag$5 = baseGetTag$2;
2429
+ if (DataView && getTag$5(new DataView(new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag$5(new Map$1()) != mapTag$4 || Promise$1 && getTag$5(Promise$1.resolve()) != promiseTag || Set && getTag$5(new Set()) != setTag$4 || WeakMap$1 && getTag$5(new WeakMap$1()) != weakMapTag$2) {
2430
+ getTag$5 = function(value) {
2431
+ var result = baseGetTag$2(value), Ctor = result == objectTag$3 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2432
+ if (ctorString) {
2433
+ switch (ctorString) {
2434
+ case dataViewCtorString:
2435
+ return dataViewTag$3;
2436
+ case mapCtorString:
2437
+ return mapTag$4;
2438
+ case promiseCtorString:
2439
+ return promiseTag;
2440
+ case setCtorString:
2441
+ return setTag$4;
2442
+ case weakMapCtorString:
2443
+ return weakMapTag$2;
2444
+ }
2445
+ }
2446
+ return result;
2447
+ };
2448
+ }
2449
+ var _getTag = getTag$5;
2450
+ var objectProto$3 = Object.prototype;
2451
+ var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
2452
+ function initCloneArray$1(array) {
2453
+ var length = array.length, result = new array.constructor(length);
2454
+ if (length && typeof array[0] == "string" && hasOwnProperty$3.call(array, "index")) {
2455
+ result.index = array.index;
2456
+ result.input = array.input;
2457
+ }
2458
+ return result;
2459
+ }
2460
+ var _initCloneArray = initCloneArray$1;
2461
+ var root = _root;
2462
+ var Uint8Array$2 = root.Uint8Array;
2463
+ var _Uint8Array = Uint8Array$2;
2464
+ var Uint8Array$1 = _Uint8Array;
2465
+ function cloneArrayBuffer$3(arrayBuffer) {
2466
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2467
+ new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
2468
+ return result;
2469
+ }
2470
+ var _cloneArrayBuffer = cloneArrayBuffer$3;
2471
+ var cloneArrayBuffer$2 = _cloneArrayBuffer;
2472
+ function cloneDataView$1(dataView, isDeep) {
2473
+ var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
2474
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2475
+ }
2476
+ var _cloneDataView = cloneDataView$1;
2477
+ var reFlags = /\w*$/;
2478
+ function cloneRegExp$1(regexp) {
2479
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2480
+ result.lastIndex = regexp.lastIndex;
2481
+ return result;
2482
+ }
2483
+ var _cloneRegExp = cloneRegExp$1;
2484
+ var Symbol$3 = _Symbol;
2485
+ var symbolProto$1 = Symbol$3 ? Symbol$3.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
2486
+ function cloneSymbol$1(symbol) {
2487
+ return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
2488
+ }
2489
+ var _cloneSymbol = cloneSymbol$1;
2490
+ var cloneArrayBuffer$1 = _cloneArrayBuffer;
2491
+ function cloneTypedArray$1(typedArray, isDeep) {
2492
+ var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
2493
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2494
+ }
2495
+ var _cloneTypedArray = cloneTypedArray$1;
2496
+ var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
2497
+ var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
2498
+ var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
2499
+ function initCloneByTag$1(object, tag, isDeep) {
2500
+ var Ctor = object.constructor;
2501
+ switch (tag) {
2502
+ case arrayBufferTag$2:
2503
+ return cloneArrayBuffer(object);
2504
+ case boolTag$2:
2505
+ case dateTag$2:
2506
+ return new Ctor(+object);
2507
+ case dataViewTag$2:
2508
+ return cloneDataView(object, isDeep);
2509
+ case float32Tag$1:
2510
+ case float64Tag$1:
2511
+ case int8Tag$1:
2512
+ case int16Tag$1:
2513
+ case int32Tag$1:
2514
+ case uint8Tag$1:
2515
+ case uint8ClampedTag$1:
2516
+ case uint16Tag$1:
2517
+ case uint32Tag$1:
2518
+ return cloneTypedArray(object, isDeep);
2519
+ case mapTag$3:
2520
+ return new Ctor();
2521
+ case numberTag$2:
2522
+ case stringTag$2:
2523
+ return new Ctor(object);
2524
+ case regexpTag$2:
2525
+ return cloneRegExp(object);
2526
+ case setTag$3:
2527
+ return new Ctor();
2528
+ case symbolTag$2:
2529
+ return cloneSymbol(object);
2530
+ }
2531
+ }
2532
+ var _initCloneByTag = initCloneByTag$1;
2533
+ var baseCreate = _baseCreate, getPrototype$1 = _getPrototype, isPrototype = _isPrototype;
2534
+ function initCloneObject$1(object) {
2535
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype$1(object)) : {};
2536
+ }
2537
+ var _initCloneObject = initCloneObject$1;
2538
+ var getTag$4 = _getTag, isObjectLike$5 = isObjectLike_1;
2539
+ var mapTag$2 = "[object Map]";
2540
+ function baseIsMap$1(value) {
2541
+ return isObjectLike$5(value) && getTag$4(value) == mapTag$2;
2542
+ }
2543
+ var _baseIsMap = baseIsMap$1;
2544
+ var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtilExports;
2545
+ var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
2546
+ var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
2547
+ var isMap_1 = isMap$1;
2548
+ var getTag$3 = _getTag, isObjectLike$4 = isObjectLike_1;
2549
+ var setTag$2 = "[object Set]";
2550
+ function baseIsSet$1(value) {
2551
+ return isObjectLike$4(value) && getTag$3(value) == setTag$2;
2552
+ }
2553
+ var _baseIsSet = baseIsSet$1;
2554
+ var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
2555
+ var nodeIsSet = nodeUtil && nodeUtil.isSet;
2556
+ var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2557
+ var isSet_1 = isSet$1;
2558
+ var Stack$2 = _Stack, arrayEach = _arrayEach, assignValue = require_assignValue(), baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBufferExports, copyArray$1 = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys$1 = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag$2 = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray$5 = isArray_1, isBuffer$1 = isBufferExports, isMap = isMap_1, isObject$1 = isObject_1, isSet = isSet_1, keys$1 = keys_1, keysIn = keysIn_1;
2559
+ var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
2560
+ var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$2 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag$1 = "[object WeakMap]";
2561
+ var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
2562
+ var cloneableTags = {};
2563
+ cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$2] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2564
+ cloneableTags[errorTag$2] = cloneableTags[funcTag] = cloneableTags[weakMapTag$1] = false;
2565
+ function baseClone$2(value, bitmask, customizer, key, object, stack) {
2566
+ var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2567
+ if (customizer) {
2568
+ result = object ? customizer(value, key, object, stack) : customizer(value);
2569
+ }
2570
+ if (result !== void 0) {
2571
+ return result;
2572
+ }
2573
+ if (!isObject$1(value)) {
2574
+ return value;
2575
+ }
2576
+ var isArr = isArray$5(value);
2577
+ if (isArr) {
2578
+ result = initCloneArray(value);
2579
+ if (!isDeep) {
2580
+ return copyArray$1(value, result);
2581
+ }
2582
+ } else {
2583
+ var tag = getTag$2(value), isFunc = tag == funcTag || tag == genTag;
2584
+ if (isBuffer$1(value)) {
2585
+ return cloneBuffer(value, isDeep);
2586
+ }
2587
+ if (tag == objectTag$2 || tag == argsTag$1 || isFunc && !object) {
2588
+ result = isFlat || isFunc ? {} : initCloneObject(value);
2589
+ if (!isDeep) {
2590
+ return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
2591
+ }
2592
+ } else {
2593
+ if (!cloneableTags[tag]) {
2594
+ return object ? value : {};
2595
+ }
2596
+ result = initCloneByTag(value, tag, isDeep);
2597
+ }
2598
+ }
2599
+ stack || (stack = new Stack$2());
2600
+ var stacked = stack.get(value);
2601
+ if (stacked) {
2602
+ return stacked;
2603
+ }
2604
+ stack.set(value, result);
2605
+ if (isSet(value)) {
2606
+ value.forEach(function(subValue) {
2607
+ result.add(baseClone$2(subValue, bitmask, customizer, subValue, value, stack));
2608
+ });
2609
+ } else if (isMap(value)) {
2610
+ value.forEach(function(subValue, key2) {
2611
+ result.set(key2, baseClone$2(subValue, bitmask, customizer, key2, value, stack));
2612
+ });
2613
+ }
2614
+ var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys$1 : isFlat ? keysIn : keys$1;
2615
+ var props = isArr ? void 0 : keysFunc(value);
2616
+ arrayEach(props || value, function(subValue, key2) {
2617
+ if (props) {
2618
+ key2 = subValue;
2619
+ subValue = value[key2];
2620
+ }
2621
+ assignValue(result, key2, baseClone$2(subValue, bitmask, customizer, key2, value, stack));
2622
+ });
2623
+ return result;
2624
+ }
2625
+ var _baseClone = baseClone$2;
2626
+ var baseClone$1 = _baseClone;
2627
+ var CLONE_SYMBOLS_FLAG = 4;
2628
+ function clone(value) {
2629
+ return baseClone$1(value, CLONE_SYMBOLS_FLAG);
2630
+ }
2631
+ var clone_1 = clone;
2632
+ var createWrap$1 = _createWrap;
2633
+ var WRAP_CURRY_FLAG = 8;
2634
+ function curry(func2, arity, guard) {
2635
+ arity = guard ? void 0 : arity;
2636
+ var result = createWrap$1(func2, WRAP_CURRY_FLAG, void 0, void 0, void 0, void 0, void 0, arity);
2637
+ result.placeholder = curry.placeholder;
2638
+ return result;
2639
+ }
2640
+ curry.placeholder = {};
2641
+ var curry_1 = curry;
2642
+ var baseGetTag$1 = _baseGetTag, getPrototype = _getPrototype, isObjectLike$3 = isObjectLike_1;
2643
+ var objectTag$1 = "[object Object]";
2644
+ var funcProto = Function.prototype, objectProto$2 = Object.prototype;
2645
+ var funcToString = funcProto.toString;
2646
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2647
+ var objectCtorString = funcToString.call(Object);
2648
+ function isPlainObject$1(value) {
2649
+ if (!isObjectLike$3(value) || baseGetTag$1(value) != objectTag$1) {
2650
+ return false;
2651
+ }
2652
+ var proto = getPrototype(value);
2653
+ if (proto === null) {
2654
+ return true;
2655
+ }
2656
+ var Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor;
2657
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
2658
+ }
2659
+ var isPlainObject_1 = isPlainObject$1;
2660
+ var baseGetTag = _baseGetTag, isObjectLike$2 = isObjectLike_1, isPlainObject = isPlainObject_1;
2661
+ var domExcTag = "[object DOMException]", errorTag$1 = "[object Error]";
2662
+ function isError(value) {
2663
+ if (!isObjectLike$2(value)) {
2664
+ return false;
2665
+ }
2666
+ var tag = baseGetTag(value);
2667
+ return tag == errorTag$1 || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
2668
+ }
2669
+ var isError_1 = isError;
2670
+ var getTag$1 = _getTag, isObjectLike$1 = isObjectLike_1;
2671
+ var weakMapTag = "[object WeakMap]";
2672
+ function isWeakMap(value) {
2673
+ return isObjectLike$1(value) && getTag$1(value) == weakMapTag;
2674
+ }
2675
+ var isWeakMap_1 = isWeakMap;
2676
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
2677
+ function setCacheAdd$1(value) {
2678
+ this.__data__.set(value, HASH_UNDEFINED);
2679
+ return this;
2680
+ }
2681
+ var _setCacheAdd = setCacheAdd$1;
2682
+ function setCacheHas$1(value) {
2683
+ return this.__data__.has(value);
2684
+ }
2685
+ var _setCacheHas = setCacheHas$1;
2686
+ var MapCache = _MapCache, setCacheAdd = _setCacheAdd, setCacheHas = _setCacheHas;
2687
+ function SetCache$1(values) {
2688
+ var index = -1, length = values == null ? 0 : values.length;
2689
+ this.__data__ = new MapCache();
2690
+ while (++index < length) {
2691
+ this.add(values[index]);
2692
+ }
2693
+ }
2694
+ SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
2695
+ SetCache$1.prototype.has = setCacheHas;
2696
+ var _SetCache = SetCache$1;
2697
+ function arraySome$1(array, predicate) {
2698
+ var index = -1, length = array == null ? 0 : array.length;
2699
+ while (++index < length) {
2700
+ if (predicate(array[index], index, array)) {
2701
+ return true;
2702
+ }
2703
+ }
2704
+ return false;
2705
+ }
2706
+ var _arraySome = arraySome$1;
2707
+ function cacheHas$1(cache2, key) {
2708
+ return cache2.has(key);
2709
+ }
2710
+ var _cacheHas = cacheHas$1;
2711
+ var SetCache = _SetCache, arraySome = _arraySome, cacheHas = _cacheHas;
2712
+ var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
2713
+ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
2714
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
2715
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
2716
+ return false;
2717
+ }
2718
+ var arrStacked = stack.get(array);
2719
+ var othStacked = stack.get(other);
2720
+ if (arrStacked && othStacked) {
2721
+ return arrStacked == other && othStacked == array;
2722
+ }
2723
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
2724
+ stack.set(array, other);
2725
+ stack.set(other, array);
2726
+ while (++index < arrLength) {
2727
+ var arrValue = array[index], othValue = other[index];
2728
+ if (customizer) {
2729
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
2730
+ }
2731
+ if (compared !== void 0) {
2732
+ if (compared) {
2733
+ continue;
2734
+ }
2735
+ result = false;
2736
+ break;
2737
+ }
2738
+ if (seen) {
2739
+ if (!arraySome(other, function(othValue2, othIndex) {
2740
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
2741
+ return seen.push(othIndex);
2742
+ }
2743
+ })) {
2744
+ result = false;
2745
+ break;
2746
+ }
2747
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
2748
+ result = false;
2749
+ break;
2750
+ }
2751
+ }
2752
+ stack["delete"](array);
2753
+ stack["delete"](other);
2754
+ return result;
2755
+ }
2756
+ var _equalArrays = equalArrays$2;
2757
+ function mapToArray$1(map) {
2758
+ var index = -1, result = Array(map.size);
2759
+ map.forEach(function(value, key) {
2760
+ result[++index] = [key, value];
2761
+ });
2762
+ return result;
2763
+ }
2764
+ var _mapToArray = mapToArray$1;
2765
+ function setToArray$1(set2) {
2766
+ var index = -1, result = Array(set2.size);
2767
+ set2.forEach(function(value) {
2768
+ result[++index] = value;
2769
+ });
2770
+ return result;
2771
+ }
2772
+ var _setToArray = setToArray$1;
2773
+ var Symbol$2 = _Symbol, Uint8Array = _Uint8Array, eq = requireEq(), equalArrays$1 = _equalArrays, mapToArray = _mapToArray, setToArray = _setToArray;
2774
+ var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
2775
+ var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
2776
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
2777
+ var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
2778
+ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
2779
+ switch (tag) {
2780
+ case dataViewTag:
2781
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
2782
+ return false;
2783
+ }
2784
+ object = object.buffer;
2785
+ other = other.buffer;
2786
+ case arrayBufferTag:
2787
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
2788
+ return false;
2789
+ }
2790
+ return true;
2791
+ case boolTag:
2792
+ case dateTag:
2793
+ case numberTag:
2794
+ return eq(+object, +other);
2795
+ case errorTag:
2796
+ return object.name == other.name && object.message == other.message;
2797
+ case regexpTag:
2798
+ case stringTag:
2799
+ return object == other + "";
2800
+ case mapTag:
2801
+ var convert2 = mapToArray;
2802
+ case setTag:
2803
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
2804
+ convert2 || (convert2 = setToArray);
2805
+ if (object.size != other.size && !isPartial) {
2806
+ return false;
2807
+ }
2808
+ var stacked = stack.get(object);
2809
+ if (stacked) {
2810
+ return stacked == other;
2811
+ }
2812
+ bitmask |= COMPARE_UNORDERED_FLAG$2;
2813
+ stack.set(object, other);
2814
+ var result = equalArrays$1(convert2(object), convert2(other), bitmask, customizer, equalFunc, stack);
2815
+ stack["delete"](object);
2816
+ return result;
2817
+ case symbolTag:
2818
+ if (symbolValueOf) {
2819
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
2820
+ }
2821
+ }
2822
+ return false;
2823
+ }
2824
+ var _equalByTag = equalByTag$1;
2825
+ var getAllKeys = _getAllKeys;
2826
+ var COMPARE_PARTIAL_FLAG$3 = 1;
2827
+ var objectProto$1 = Object.prototype;
2828
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2829
+ function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
2830
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
2831
+ if (objLength != othLength && !isPartial) {
2832
+ return false;
2833
+ }
2834
+ var index = objLength;
2835
+ while (index--) {
2836
+ var key = objProps[index];
2837
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2838
+ return false;
2839
+ }
2840
+ }
2841
+ var objStacked = stack.get(object);
2842
+ var othStacked = stack.get(other);
2843
+ if (objStacked && othStacked) {
2844
+ return objStacked == other && othStacked == object;
2845
+ }
2846
+ var result = true;
2847
+ stack.set(object, other);
2848
+ stack.set(other, object);
2849
+ var skipCtor = isPartial;
2850
+ while (++index < objLength) {
2851
+ key = objProps[index];
2852
+ var objValue = object[key], othValue = other[key];
2853
+ if (customizer) {
2854
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
2855
+ }
2856
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
2857
+ result = false;
2858
+ break;
2859
+ }
2860
+ skipCtor || (skipCtor = key == "constructor");
2861
+ }
2862
+ if (result && !skipCtor) {
2863
+ var objCtor = object.constructor, othCtor = other.constructor;
2864
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
2865
+ result = false;
2866
+ }
2867
+ }
2868
+ stack["delete"](object);
2869
+ stack["delete"](other);
2870
+ return result;
2871
+ }
2872
+ var _equalObjects = equalObjects$1;
2873
+ var Stack$1 = _Stack, equalArrays = _equalArrays, equalByTag = _equalByTag, equalObjects = _equalObjects, getTag = _getTag, isArray$4 = isArray_1, isBuffer = isBufferExports, isTypedArray = isTypedArray_1;
2874
+ var COMPARE_PARTIAL_FLAG$2 = 1;
2875
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
2876
+ var objectProto = Object.prototype;
2877
+ var hasOwnProperty = objectProto.hasOwnProperty;
2878
+ function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
2879
+ var objIsArr = isArray$4(object), othIsArr = isArray$4(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
2880
+ objTag = objTag == argsTag ? objectTag : objTag;
2881
+ othTag = othTag == argsTag ? objectTag : othTag;
2882
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
2883
+ if (isSameTag && isBuffer(object)) {
2884
+ if (!isBuffer(other)) {
2885
+ return false;
2886
+ }
2887
+ objIsArr = true;
2888
+ objIsObj = false;
2889
+ }
2890
+ if (isSameTag && !objIsObj) {
2891
+ stack || (stack = new Stack$1());
2892
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2893
+ }
2894
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
2895
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
2896
+ if (objIsWrapped || othIsWrapped) {
2897
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
2898
+ stack || (stack = new Stack$1());
2899
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2900
+ }
2901
+ }
2902
+ if (!isSameTag) {
2903
+ return false;
2904
+ }
2905
+ stack || (stack = new Stack$1());
2906
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2907
+ }
2908
+ var _baseIsEqualDeep = baseIsEqualDeep$1;
2909
+ var baseIsEqualDeep = _baseIsEqualDeep, isObjectLike = isObjectLike_1;
2910
+ function baseIsEqual$2(value, other, bitmask, customizer, stack) {
2911
+ if (value === other) {
2912
+ return true;
2913
+ }
2914
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
2915
+ return value !== value && other !== other;
2916
+ }
2917
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
2918
+ }
2919
+ var _baseIsEqual = baseIsEqual$2;
2920
+ var Stack = _Stack, baseIsEqual$1 = _baseIsEqual;
2921
+ var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
2922
+ function baseIsMatch$1(object, source, matchData, customizer) {
2923
+ var index = matchData.length, length = index, noCustomizer = !customizer;
2924
+ if (object == null) {
2925
+ return !length;
2926
+ }
2927
+ object = Object(object);
2928
+ while (index--) {
2929
+ var data = matchData[index];
2930
+ if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
2931
+ return false;
2932
+ }
2933
+ }
2934
+ while (++index < length) {
2935
+ data = matchData[index];
2936
+ var key = data[0], objValue = object[key], srcValue = data[1];
2937
+ if (noCustomizer && data[2]) {
2938
+ if (objValue === void 0 && !(key in object)) {
2939
+ return false;
2940
+ }
2941
+ } else {
2942
+ var stack = new Stack();
2943
+ if (customizer) {
2944
+ var result = customizer(objValue, srcValue, key, object, source, stack);
2945
+ }
2946
+ if (!(result === void 0 ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
2947
+ return false;
2948
+ }
2949
+ }
2950
+ }
2951
+ return true;
2952
+ }
2953
+ var _baseIsMatch = baseIsMatch$1;
2954
+ var isObject = isObject_1;
2955
+ function isStrictComparable$2(value) {
2956
+ return value === value && !isObject(value);
2957
+ }
2958
+ var _isStrictComparable = isStrictComparable$2;
2959
+ var isStrictComparable$1 = _isStrictComparable, keys = keys_1;
2960
+ function getMatchData$1(object) {
2961
+ var result = keys(object), length = result.length;
2962
+ while (length--) {
2963
+ var key = result[length], value = object[key];
2964
+ result[length] = [key, value, isStrictComparable$1(value)];
2965
+ }
2966
+ return result;
2967
+ }
2968
+ var _getMatchData = getMatchData$1;
2969
+ function matchesStrictComparable$2(key, srcValue) {
2970
+ return function(object) {
2971
+ if (object == null) {
2972
+ return false;
2973
+ }
2974
+ return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
2975
+ };
2976
+ }
2977
+ var _matchesStrictComparable = matchesStrictComparable$2;
2978
+ var baseIsMatch = _baseIsMatch, getMatchData = _getMatchData, matchesStrictComparable$1 = _matchesStrictComparable;
2979
+ function baseMatches$1(source) {
2980
+ var matchData = getMatchData(source);
2981
+ if (matchData.length == 1 && matchData[0][2]) {
2982
+ return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
2983
+ }
2984
+ return function(object) {
2985
+ return object === source || baseIsMatch(object, source, matchData);
2986
+ };
2987
+ }
2988
+ var _baseMatches = baseMatches$1;
2989
+ function baseHasIn$1(object, key) {
2990
+ return object != null && key in Object(object);
2991
+ }
2992
+ var _baseHasIn = baseHasIn$1;
2993
+ var castPath = _castPath, isArguments$1 = isArguments_1, isArray$3 = isArray_1, isIndex = require_isIndex(), isLength = isLength_1, toKey$3 = _toKey;
2994
+ function hasPath$1(object, path, hasFunc) {
2995
+ path = castPath(path, object);
2996
+ var index = -1, length = path.length, result = false;
2997
+ while (++index < length) {
2998
+ var key = toKey$3(path[index]);
2999
+ if (!(result = object != null && hasFunc(object, key))) {
3000
+ break;
3001
+ }
3002
+ object = object[key];
3003
+ }
3004
+ if (result || ++index != length) {
3005
+ return result;
3006
+ }
3007
+ length = object == null ? 0 : object.length;
3008
+ return !!length && isLength(length) && isIndex(key, length) && (isArray$3(object) || isArguments$1(object));
3009
+ }
3010
+ var _hasPath = hasPath$1;
3011
+ var baseHasIn = _baseHasIn, hasPath = _hasPath;
3012
+ function hasIn$1(object, path) {
3013
+ return object != null && hasPath(object, path, baseHasIn);
3014
+ }
3015
+ var hasIn_1 = hasIn$1;
3016
+ var baseIsEqual = _baseIsEqual, get = get_1, hasIn = hasIn_1, isKey$1 = _isKey, isStrictComparable = _isStrictComparable, matchesStrictComparable = _matchesStrictComparable, toKey$2 = _toKey;
3017
+ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
3018
+ function baseMatchesProperty$1(path, srcValue) {
3019
+ if (isKey$1(path) && isStrictComparable(srcValue)) {
3020
+ return matchesStrictComparable(toKey$2(path), srcValue);
3021
+ }
3022
+ return function(object) {
3023
+ var objValue = get(object, path);
3024
+ return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
3025
+ };
3026
+ }
3027
+ var _baseMatchesProperty = baseMatchesProperty$1;
3028
+ function baseProperty$1(key) {
3029
+ return function(object) {
3030
+ return object == null ? void 0 : object[key];
3031
+ };
3032
+ }
3033
+ var _baseProperty = baseProperty$1;
3034
+ var baseGet = _baseGet;
3035
+ function basePropertyDeep$1(path) {
3036
+ return function(object) {
3037
+ return baseGet(object, path);
3038
+ };
3039
+ }
3040
+ var _basePropertyDeep = basePropertyDeep$1;
3041
+ var baseProperty = _baseProperty, basePropertyDeep = _basePropertyDeep, isKey = _isKey, toKey$1 = _toKey;
3042
+ function property$1(path) {
3043
+ return isKey(path) ? baseProperty(toKey$1(path)) : basePropertyDeep(path);
3044
+ }
3045
+ var property_1 = property$1;
3046
+ var baseMatches = _baseMatches, baseMatchesProperty = _baseMatchesProperty, identity = identity_1, isArray$2 = isArray_1, property = property_1;
3047
+ function baseIteratee$1(value) {
3048
+ if (typeof value == "function") {
3049
+ return value;
3050
+ }
3051
+ if (value == null) {
3052
+ return identity;
3053
+ }
3054
+ if (typeof value == "object") {
3055
+ return isArray$2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
3056
+ }
3057
+ return property(value);
3058
+ }
3059
+ var _baseIteratee = baseIteratee$1;
3060
+ var baseClone = _baseClone, baseIteratee = _baseIteratee;
3061
+ var CLONE_DEEP_FLAG = 1;
3062
+ function iteratee(func2) {
3063
+ return baseIteratee(typeof func2 == "function" ? func2 : baseClone(func2, CLONE_DEEP_FLAG));
3064
+ }
3065
+ var iteratee_1 = iteratee;
3066
+ var Symbol$1 = _Symbol, isArguments = isArguments_1, isArray$1 = isArray_1;
3067
+ var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
3068
+ function isFlattenable$1(value) {
3069
+ return isArray$1(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
3070
+ }
3071
+ var _isFlattenable = isFlattenable$1;
3072
+ var arrayPush = _arrayPush, isFlattenable = _isFlattenable;
3073
+ function baseFlatten$1(array, depth, predicate, isStrict, result) {
3074
+ var index = -1, length = array.length;
3075
+ predicate || (predicate = isFlattenable);
3076
+ result || (result = []);
3077
+ while (++index < length) {
3078
+ var value = array[index];
3079
+ if (depth > 0 && predicate(value)) {
3080
+ if (depth > 1) {
3081
+ baseFlatten$1(value, depth - 1, predicate, isStrict, result);
3082
+ } else {
3083
+ arrayPush(result, value);
3084
+ }
3085
+ } else if (!isStrict) {
3086
+ result[result.length] = value;
3087
+ }
3088
+ }
3089
+ return result;
3090
+ }
3091
+ var _baseFlatten = baseFlatten$1;
3092
+ var baseFlatten = _baseFlatten;
3093
+ function flatten$1(array) {
3094
+ var length = array == null ? 0 : array.length;
3095
+ return length ? baseFlatten(array, 1) : [];
3096
+ }
3097
+ var flatten_1 = flatten$1;
3098
+ var apply = _apply;
3099
+ var nativeMax = Math.max;
3100
+ function overRest$1(func2, start, transform) {
3101
+ start = nativeMax(start === void 0 ? func2.length - 1 : start, 0);
3102
+ return function() {
3103
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
3104
+ while (++index < length) {
3105
+ array[index] = args[start + index];
3106
+ }
3107
+ index = -1;
3108
+ var otherArgs = Array(start + 1);
3109
+ while (++index < start) {
3110
+ otherArgs[index] = args[index];
3111
+ }
3112
+ otherArgs[start] = transform(array);
3113
+ return apply(func2, this, otherArgs);
3114
+ };
3115
+ }
3116
+ var _overRest = overRest$1;
3117
+ var flatten = flatten_1, overRest = _overRest, setToString = _setToString;
3118
+ function flatRest$1(func2) {
3119
+ return setToString(overRest(func2, void 0, flatten), func2 + "");
3120
+ }
3121
+ var _flatRest = flatRest$1;
3122
+ var createWrap = _createWrap, flatRest = _flatRest;
3123
+ var WRAP_REARG_FLAG = 256;
3124
+ var rearg = flatRest(function(func2, indexes) {
3125
+ return createWrap(func2, WRAP_REARG_FLAG, void 0, void 0, void 0, indexes);
3126
+ });
3127
+ var rearg_1 = rearg;
3128
+ var arrayMap = _arrayMap, copyArray = _copyArray, isArray = isArray_1, isSymbol = isSymbol_1, stringToPath = _stringToPath, toKey = _toKey, toString = toString_1;
3129
+ function toPath(value) {
3130
+ if (isArray(value)) {
3131
+ return arrayMap(value, toKey);
3132
+ }
3133
+ return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
3134
+ }
3135
+ var toPath_1 = toPath;
3136
+ var _util = {
3137
+ "ary": ary_1,
3138
+ "assign": _baseAssign,
3139
+ "clone": clone_1,
3140
+ "curry": curry_1,
3141
+ "forEach": _arrayEach,
3142
+ "isArray": isArray_1,
3143
+ "isError": isError_1,
3144
+ "isFunction": isFunction_1,
3145
+ "isWeakMap": isWeakMap_1,
3146
+ "iteratee": iteratee_1,
3147
+ "keys": _baseKeys,
3148
+ "rearg": rearg_1,
3149
+ "toInteger": toInteger_1,
3150
+ "toPath": toPath_1
3151
+ };
3152
+ var baseConvert = _baseConvert, util = _util;
3153
+ function convert$1(name, func2, options) {
3154
+ return baseConvert(util, name, func2, options);
3155
+ }
3156
+ var convert_1 = convert$1;
3157
+ var _baseSet;
3158
+ var hasRequired_baseSet;
3159
+ function require_baseSet() {
3160
+ if (hasRequired_baseSet)
3161
+ return _baseSet;
3162
+ hasRequired_baseSet = 1;
3163
+ var assignValue2 = require_assignValue(), castPath2 = _castPath, isIndex2 = require_isIndex(), isObject2 = isObject_1, toKey2 = _toKey;
3164
+ function baseSet(object, path, value, customizer) {
3165
+ if (!isObject2(object)) {
3166
+ return object;
3167
+ }
3168
+ path = castPath2(path, object);
3169
+ var index = -1, length = path.length, lastIndex = length - 1, nested = object;
3170
+ while (nested != null && ++index < length) {
3171
+ var key = toKey2(path[index]), newValue = value;
3172
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
3173
+ return object;
3174
+ }
3175
+ if (index != lastIndex) {
3176
+ var objValue = nested[key];
3177
+ newValue = customizer ? customizer(objValue, key, nested) : void 0;
3178
+ if (newValue === void 0) {
3179
+ newValue = isObject2(objValue) ? objValue : isIndex2(path[index + 1]) ? [] : {};
3180
+ }
3181
+ }
3182
+ assignValue2(nested, key, newValue);
3183
+ nested = nested[key];
3184
+ }
3185
+ return object;
3186
+ }
3187
+ _baseSet = baseSet;
3188
+ return _baseSet;
3189
+ }
3190
+ var set_1;
3191
+ var hasRequiredSet;
3192
+ function requireSet() {
3193
+ if (hasRequiredSet)
3194
+ return set_1;
3195
+ hasRequiredSet = 1;
3196
+ var baseSet = require_baseSet();
3197
+ function set2(object, path, value) {
3198
+ return object == null ? object : baseSet(object, path, value);
3199
+ }
3200
+ set_1 = set2;
3201
+ return set_1;
3202
+ }
3203
+ var convert = convert_1, func = convert("set", requireSet());
3204
+ func.placeholder = requirePlaceholder();
3205
+ var set = func;
3206
+ const formatTimestamp = (obj, props) => {
3207
+ if (props == null)
3208
+ return obj;
3209
+ return props.reduce((result, prop) => {
3210
+ const value = get_1(obj, prop);
3211
+ return set(prop, value != null && value.toDate ? value.toDate() : value, result);
3212
+ }, obj);
3213
+ };
3214
+ const getFirestoreConverter = (parseDates) => ({
3215
+ fromFirestore(snapshot) {
3216
+ const data = snapshot.data();
3217
+ return {
3218
+ ...formatTimestamp(data, parseDates),
3219
+ ref: snapshot.ref,
3220
+ exists: snapshot.exists,
3221
+ id: snapshot.id
3222
+ };
3223
+ },
3224
+ toFirestore(model) {
3225
+ return model;
3226
+ }
3227
+ });
3228
+ var shimExports = {};
3229
+ var shim = {
3230
+ get exports() {
3231
+ return shimExports;
3232
+ },
3233
+ set exports(v) {
3234
+ shimExports = v;
3235
+ }
3236
+ };
3237
+ var useSyncExternalStoreShim_production_min = {};
3238
+ /**
3239
+ * @license React
3240
+ * use-sync-external-store-shim.production.min.js
3241
+ *
3242
+ * Copyright (c) Facebook, Inc. and its affiliates.
3243
+ *
3244
+ * This source code is licensed under the MIT license found in the
3245
+ * LICENSE file in the root directory of this source tree.
3246
+ */
3247
+ var hasRequiredUseSyncExternalStoreShim_production_min;
3248
+ function requireUseSyncExternalStoreShim_production_min() {
3249
+ if (hasRequiredUseSyncExternalStoreShim_production_min)
3250
+ return useSyncExternalStoreShim_production_min;
3251
+ hasRequiredUseSyncExternalStoreShim_production_min = 1;
3252
+ var e = React;
3253
+ function h(a, b) {
3254
+ return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
3255
+ }
3256
+ var k = "function" === typeof Object.is ? Object.is : h, l = e.useState, m = e.useEffect, n = e.useLayoutEffect, p = e.useDebugValue;
3257
+ function q(a, b) {
3258
+ var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
3259
+ n(function() {
3260
+ c.value = d;
3261
+ c.getSnapshot = b;
3262
+ r(c) && g({ inst: c });
3263
+ }, [a, d, b]);
3264
+ m(function() {
3265
+ r(c) && g({ inst: c });
3266
+ return a(function() {
3267
+ r(c) && g({ inst: c });
3268
+ });
3269
+ }, [a]);
3270
+ p(d);
3271
+ return d;
3272
+ }
3273
+ function r(a) {
3274
+ var b = a.getSnapshot;
3275
+ a = a.value;
3276
+ try {
3277
+ var d = b();
3278
+ return !k(a, d);
3279
+ } catch (f) {
3280
+ return true;
3281
+ }
3282
+ }
3283
+ function t(a, b) {
3284
+ return b();
3285
+ }
3286
+ var u = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t : q;
3287
+ useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u;
3288
+ return useSyncExternalStoreShim_production_min;
3289
+ }
3290
+ var useSyncExternalStoreShim_development = {};
3291
+ /**
3292
+ * @license React
3293
+ * use-sync-external-store-shim.development.js
3294
+ *
3295
+ * Copyright (c) Facebook, Inc. and its affiliates.
3296
+ *
3297
+ * This source code is licensed under the MIT license found in the
3298
+ * LICENSE file in the root directory of this source tree.
3299
+ */
3300
+ var hasRequiredUseSyncExternalStoreShim_development;
3301
+ function requireUseSyncExternalStoreShim_development() {
3302
+ if (hasRequiredUseSyncExternalStoreShim_development)
3303
+ return useSyncExternalStoreShim_development;
3304
+ hasRequiredUseSyncExternalStoreShim_development = 1;
3305
+ if (process.env.NODE_ENV !== "production") {
3306
+ (function() {
3307
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
3308
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
3309
+ }
3310
+ var React$1 = React;
3311
+ var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3312
+ function error(format) {
3313
+ {
3314
+ {
3315
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
3316
+ args[_key2 - 1] = arguments[_key2];
3317
+ }
3318
+ printWarning("error", format, args);
3319
+ }
3320
+ }
3321
+ }
3322
+ function printWarning(level, format, args) {
3323
+ {
3324
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
3325
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
3326
+ if (stack !== "") {
3327
+ format += "%s";
3328
+ args = args.concat([stack]);
3329
+ }
3330
+ var argsWithFormat = args.map(function(item) {
3331
+ return String(item);
3332
+ });
3333
+ argsWithFormat.unshift("Warning: " + format);
3334
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
3335
+ }
3336
+ }
3337
+ function is(x, y) {
3338
+ return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
3339
+ }
3340
+ var objectIs = typeof Object.is === "function" ? Object.is : is;
3341
+ var useState = React$1.useState, useEffect2 = React$1.useEffect, useLayoutEffect2 = React$1.useLayoutEffect, useDebugValue2 = React$1.useDebugValue;
3342
+ var didWarnOld18Alpha = false;
3343
+ var didWarnUncachedGetSnapshot = false;
3344
+ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
3345
+ {
3346
+ if (!didWarnOld18Alpha) {
3347
+ if (React$1.startTransition !== void 0) {
3348
+ didWarnOld18Alpha = true;
3349
+ error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
3350
+ }
3351
+ }
3352
+ }
3353
+ var value = getSnapshot();
3354
+ {
3355
+ if (!didWarnUncachedGetSnapshot) {
3356
+ var cachedValue = getSnapshot();
3357
+ if (!objectIs(value, cachedValue)) {
3358
+ error("The result of getSnapshot should be cached to avoid an infinite loop");
3359
+ didWarnUncachedGetSnapshot = true;
3360
+ }
3361
+ }
3362
+ }
3363
+ var _useState = useState({
3364
+ inst: {
3365
+ value,
3366
+ getSnapshot
3367
+ }
3368
+ }), inst = _useState[0].inst, forceUpdate = _useState[1];
3369
+ useLayoutEffect2(function() {
3370
+ inst.value = value;
3371
+ inst.getSnapshot = getSnapshot;
3372
+ if (checkIfSnapshotChanged(inst)) {
3373
+ forceUpdate({
3374
+ inst
3375
+ });
3376
+ }
3377
+ }, [subscribe, value, getSnapshot]);
3378
+ useEffect2(function() {
3379
+ if (checkIfSnapshotChanged(inst)) {
3380
+ forceUpdate({
3381
+ inst
3382
+ });
3383
+ }
3384
+ var handleStoreChange = function() {
3385
+ if (checkIfSnapshotChanged(inst)) {
3386
+ forceUpdate({
3387
+ inst
3388
+ });
3389
+ }
3390
+ };
3391
+ return subscribe(handleStoreChange);
3392
+ }, [subscribe]);
3393
+ useDebugValue2(value);
3394
+ return value;
3395
+ }
3396
+ function checkIfSnapshotChanged(inst) {
3397
+ var latestGetSnapshot = inst.getSnapshot;
3398
+ var prevValue = inst.value;
3399
+ try {
3400
+ var nextValue = latestGetSnapshot();
3401
+ return !objectIs(prevValue, nextValue);
3402
+ } catch (error2) {
3403
+ return true;
3404
+ }
3405
+ }
3406
+ function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
3407
+ return getSnapshot();
3408
+ }
3409
+ var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
3410
+ var isServerEnvironment = !canUseDOM;
3411
+ var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
3412
+ var useSyncExternalStore$2 = React$1.useSyncExternalStore !== void 0 ? React$1.useSyncExternalStore : shim2;
3413
+ useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
3414
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
3415
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
3416
+ }
3417
+ })();
3418
+ }
3419
+ return useSyncExternalStoreShim_development;
3420
+ }
3421
+ (function(module) {
3422
+ if (process.env.NODE_ENV === "production") {
3423
+ module.exports = requireUseSyncExternalStoreShim_production_min();
3424
+ } else {
3425
+ module.exports = requireUseSyncExternalStoreShim_development();
3426
+ }
3427
+ })(shim);
3428
+ const SWRGlobalState = /* @__PURE__ */ new WeakMap();
3429
+ const EMPTY_CACHE = {};
3430
+ const INITIAL_CACHE = {};
3431
+ const noop = () => {
3432
+ };
3433
+ const UNDEFINED = (
3434
+ /*#__NOINLINE__*/
3435
+ noop()
3436
+ );
3437
+ const OBJECT = Object;
3438
+ const isUndefined = (v) => v === UNDEFINED;
3439
+ const isFunction = (v) => typeof v == "function";
3440
+ const mergeObjects = (a, b) => ({
3441
+ ...a,
3442
+ ...b
3443
+ });
3444
+ const STR_UNDEFINED = "undefined";
3445
+ const isWindowDefined = typeof window != STR_UNDEFINED;
3446
+ const isDocumentDefined = typeof document != STR_UNDEFINED;
3447
+ const hasRequestAnimationFrame = () => isWindowDefined && typeof window["requestAnimationFrame"] != STR_UNDEFINED;
3448
+ const createCacheHelper = (cache2, key) => {
3449
+ const state = SWRGlobalState.get(cache2);
3450
+ return [
3451
+ // Getter
3452
+ () => cache2.get(key) || EMPTY_CACHE,
3453
+ // Setter
3454
+ (info) => {
3455
+ if (!isUndefined(key)) {
3456
+ const prev = cache2.get(key);
3457
+ if (!(key in INITIAL_CACHE)) {
3458
+ INITIAL_CACHE[key] = prev;
3459
+ }
3460
+ state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);
3461
+ }
3462
+ },
3463
+ // Subscriber
3464
+ state[6],
3465
+ // Get server cache snapshot
3466
+ () => {
3467
+ if (!isUndefined(key)) {
3468
+ if (key in INITIAL_CACHE)
3469
+ return INITIAL_CACHE[key];
3470
+ }
3471
+ return cache2.get(key) || EMPTY_CACHE;
3472
+ }
3473
+ ];
3474
+ };
3475
+ const table = /* @__PURE__ */ new WeakMap();
3476
+ let counter = 0;
3477
+ const stableHash = (arg) => {
3478
+ const type = typeof arg;
3479
+ const constructor = arg && arg.constructor;
3480
+ const isDate = constructor == Date;
3481
+ let result;
3482
+ let index;
3483
+ if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {
3484
+ result = table.get(arg);
3485
+ if (result)
3486
+ return result;
3487
+ result = ++counter + "~";
3488
+ table.set(arg, result);
3489
+ if (constructor == Array) {
3490
+ result = "@";
3491
+ for (index = 0; index < arg.length; index++) {
3492
+ result += stableHash(arg[index]) + ",";
3493
+ }
3494
+ table.set(arg, result);
3495
+ }
3496
+ if (constructor == OBJECT) {
3497
+ result = "#";
3498
+ const keys2 = OBJECT.keys(arg).sort();
3499
+ while (!isUndefined(index = keys2.pop())) {
3500
+ if (!isUndefined(arg[index])) {
3501
+ result += index + ":" + stableHash(arg[index]) + ",";
3502
+ }
3503
+ }
3504
+ table.set(arg, result);
3505
+ }
3506
+ } else {
3507
+ result = isDate ? arg.toJSON() : type == "symbol" ? arg.toString() : type == "string" ? JSON.stringify(arg) : "" + arg;
3508
+ }
3509
+ return result;
3510
+ };
3511
+ let online = true;
3512
+ const isOnline = () => online;
3513
+ const [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [
3514
+ window.addEventListener.bind(window),
3515
+ window.removeEventListener.bind(window)
3516
+ ] : [
3517
+ noop,
3518
+ noop
3519
+ ];
3520
+ const isVisible = () => {
3521
+ const visibilityState = isDocumentDefined && document.visibilityState;
3522
+ return isUndefined(visibilityState) || visibilityState !== "hidden";
3523
+ };
3524
+ const initFocus = (callback) => {
3525
+ if (isDocumentDefined) {
3526
+ document.addEventListener("visibilitychange", callback);
3527
+ }
3528
+ onWindowEvent("focus", callback);
3529
+ return () => {
3530
+ if (isDocumentDefined) {
3531
+ document.removeEventListener("visibilitychange", callback);
3532
+ }
3533
+ offWindowEvent("focus", callback);
3534
+ };
3535
+ };
3536
+ const initReconnect = (callback) => {
3537
+ const onOnline = () => {
3538
+ online = true;
3539
+ callback();
3540
+ };
3541
+ const onOffline = () => {
3542
+ online = false;
3543
+ };
3544
+ onWindowEvent("online", onOnline);
3545
+ onWindowEvent("offline", onOffline);
3546
+ return () => {
3547
+ offWindowEvent("online", onOnline);
3548
+ offWindowEvent("offline", onOffline);
3549
+ };
3550
+ };
3551
+ const preset = {
3552
+ isOnline,
3553
+ isVisible
3554
+ };
3555
+ const defaultConfigOptions = {
3556
+ initFocus,
3557
+ initReconnect
3558
+ };
3559
+ const IS_REACT_LEGACY = !React.useId;
3560
+ const IS_SERVER = !isWindowDefined || "Deno" in window;
3561
+ const rAF = (f) => hasRequestAnimationFrame() ? window["requestAnimationFrame"](f) : setTimeout(f, 1);
3562
+ const useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;
3563
+ const navigatorConnection = typeof navigator !== "undefined" && navigator.connection;
3564
+ const slowConnection = !IS_SERVER && navigatorConnection && ([
3565
+ "slow-2g",
3566
+ "2g"
3567
+ ].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);
3568
+ const serialize = (key) => {
3569
+ if (isFunction(key)) {
3570
+ try {
3571
+ key = key();
3572
+ } catch (err) {
3573
+ key = "";
3574
+ }
3575
+ }
3576
+ const args = key;
3577
+ key = typeof key == "string" ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : "";
3578
+ return [
3579
+ key,
3580
+ args
3581
+ ];
3582
+ };
3583
+ let __timestamp = 0;
3584
+ const getTimestamp = () => ++__timestamp;
3585
+ const FOCUS_EVENT = 0;
3586
+ const RECONNECT_EVENT = 1;
3587
+ const MUTATE_EVENT = 2;
3588
+ const ERROR_REVALIDATE_EVENT = 3;
3589
+ var constants = {
3590
+ __proto__: null,
3591
+ FOCUS_EVENT,
3592
+ RECONNECT_EVENT,
3593
+ MUTATE_EVENT,
3594
+ ERROR_REVALIDATE_EVENT
3595
+ };
3596
+ async function internalMutate(...args) {
3597
+ const [cache2, _key, _data, _opts] = args;
3598
+ const options = mergeObjects({
3599
+ populateCache: true,
3600
+ throwOnError: true
3601
+ }, typeof _opts === "boolean" ? {
3602
+ revalidate: _opts
3603
+ } : _opts || {});
3604
+ let populateCache = options.populateCache;
3605
+ const rollbackOnErrorOption = options.rollbackOnError;
3606
+ let optimisticData = options.optimisticData;
3607
+ const revalidate = options.revalidate !== false;
3608
+ const rollbackOnError = (error) => {
3609
+ return typeof rollbackOnErrorOption === "function" ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;
3610
+ };
3611
+ const throwOnError = options.throwOnError;
3612
+ if (isFunction(_key)) {
3613
+ const keyFilter = _key;
3614
+ const matchedKeys = [];
3615
+ const it = cache2.keys();
3616
+ for (let keyIt = it.next(); !keyIt.done; keyIt = it.next()) {
3617
+ const key = keyIt.value;
3618
+ if (
3619
+ // Skip the special useSWRInfinite and useSWRSubscription keys.
3620
+ !/^\$(inf|sub)\$/.test(key) && keyFilter(cache2.get(key)._k)
3621
+ ) {
3622
+ matchedKeys.push(key);
3623
+ }
3624
+ }
3625
+ return Promise.all(matchedKeys.map(mutateByKey));
3626
+ }
3627
+ return mutateByKey(_key);
3628
+ async function mutateByKey(_k) {
3629
+ const [key] = serialize(_k);
3630
+ if (!key)
3631
+ return;
3632
+ const [get2, set2] = createCacheHelper(cache2, key);
3633
+ const [EVENT_REVALIDATORS, MUTATION, FETCH] = SWRGlobalState.get(cache2);
3634
+ const revalidators = EVENT_REVALIDATORS[key];
3635
+ const startRevalidate = () => {
3636
+ if (revalidate) {
3637
+ delete FETCH[key];
3638
+ if (revalidators && revalidators[0]) {
3639
+ return revalidators[0](MUTATE_EVENT).then(() => get2().data);
3640
+ }
3641
+ }
3642
+ return get2().data;
3643
+ };
3644
+ if (args.length < 3) {
3645
+ return startRevalidate();
3646
+ }
3647
+ let data = _data;
3648
+ let error;
3649
+ const beforeMutationTs = getTimestamp();
3650
+ MUTATION[key] = [
3651
+ beforeMutationTs,
3652
+ 0
3653
+ ];
3654
+ const hasOptimisticData = !isUndefined(optimisticData);
3655
+ const state = get2();
3656
+ const displayedData = state.data;
3657
+ const currentData = state._c;
3658
+ const committedData = isUndefined(currentData) ? displayedData : currentData;
3659
+ if (hasOptimisticData) {
3660
+ optimisticData = isFunction(optimisticData) ? optimisticData(committedData) : optimisticData;
3661
+ set2({
3662
+ data: optimisticData,
3663
+ _c: committedData
3664
+ });
3665
+ }
3666
+ if (isFunction(data)) {
3667
+ try {
3668
+ data = data(committedData);
3669
+ } catch (err) {
3670
+ error = err;
3671
+ }
3672
+ }
3673
+ if (data && isFunction(data.then)) {
3674
+ data = await data.catch((err) => {
3675
+ error = err;
3676
+ });
3677
+ if (beforeMutationTs !== MUTATION[key][0]) {
3678
+ if (error)
3679
+ throw error;
3680
+ return data;
3681
+ } else if (error && hasOptimisticData && rollbackOnError(error)) {
3682
+ populateCache = true;
3683
+ data = committedData;
3684
+ set2({
3685
+ data,
3686
+ _c: UNDEFINED
3687
+ });
3688
+ }
3689
+ }
3690
+ if (populateCache) {
3691
+ if (!error) {
3692
+ if (isFunction(populateCache)) {
3693
+ data = populateCache(data, committedData);
3694
+ }
3695
+ set2({
3696
+ data,
3697
+ _c: UNDEFINED
3698
+ });
3699
+ }
3700
+ }
3701
+ MUTATION[key][1] = getTimestamp();
3702
+ const res = await startRevalidate();
3703
+ set2({
3704
+ _c: UNDEFINED
3705
+ });
3706
+ if (error) {
3707
+ if (throwOnError)
3708
+ throw error;
3709
+ return;
3710
+ }
3711
+ return populateCache ? res : data;
3712
+ }
3713
+ }
3714
+ const revalidateAllKeys = (revalidators, type) => {
3715
+ for (const key in revalidators) {
3716
+ if (revalidators[key][0])
3717
+ revalidators[key][0](type);
3718
+ }
3719
+ };
3720
+ const initCache = (provider, options) => {
3721
+ if (!SWRGlobalState.has(provider)) {
3722
+ const opts = mergeObjects(defaultConfigOptions, options);
3723
+ const EVENT_REVALIDATORS = {};
3724
+ const mutate2 = internalMutate.bind(UNDEFINED, provider);
3725
+ let unmount = noop;
3726
+ const subscriptions = {};
3727
+ const subscribe = (key, callback) => {
3728
+ const subs = subscriptions[key] || [];
3729
+ subscriptions[key] = subs;
3730
+ subs.push(callback);
3731
+ return () => subs.splice(subs.indexOf(callback), 1);
3732
+ };
3733
+ const setter = (key, value, prev) => {
3734
+ provider.set(key, value);
3735
+ const subs = subscriptions[key];
3736
+ if (subs) {
3737
+ for (const fn of subs) {
3738
+ fn(value, prev);
3739
+ }
3740
+ }
3741
+ };
3742
+ const initProvider = () => {
3743
+ if (!SWRGlobalState.has(provider)) {
3744
+ SWRGlobalState.set(provider, [
3745
+ EVENT_REVALIDATORS,
3746
+ {},
3747
+ {},
3748
+ {},
3749
+ mutate2,
3750
+ setter,
3751
+ subscribe
3752
+ ]);
3753
+ if (!IS_SERVER) {
3754
+ const releaseFocus = opts.initFocus(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT)));
3755
+ const releaseReconnect = opts.initReconnect(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT)));
3756
+ unmount = () => {
3757
+ releaseFocus && releaseFocus();
3758
+ releaseReconnect && releaseReconnect();
3759
+ SWRGlobalState.delete(provider);
3760
+ };
3761
+ }
3762
+ }
3763
+ };
3764
+ initProvider();
3765
+ return [
3766
+ provider,
3767
+ mutate2,
3768
+ initProvider,
3769
+ unmount
3770
+ ];
3771
+ }
3772
+ return [
3773
+ provider,
3774
+ SWRGlobalState.get(provider)[4]
3775
+ ];
3776
+ };
3777
+ const onErrorRetry = (_, __, config, revalidate, opts) => {
3778
+ const maxRetryCount = config.errorRetryCount;
3779
+ const currentRetryCount = opts.retryCount;
3780
+ const timeout = ~~((Math.random() + 0.5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
3781
+ if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) {
3782
+ return;
3783
+ }
3784
+ setTimeout(revalidate, timeout, opts);
3785
+ };
3786
+ const compare = (currentData, newData) => stableHash(currentData) == stableHash(newData);
3787
+ const [cache, mutate] = initCache(/* @__PURE__ */ new Map());
3788
+ const defaultConfig = mergeObjects(
3789
+ {
3790
+ // events
3791
+ onLoadingSlow: noop,
3792
+ onSuccess: noop,
3793
+ onError: noop,
3794
+ onErrorRetry,
3795
+ onDiscarded: noop,
3796
+ // switches
3797
+ revalidateOnFocus: true,
3798
+ revalidateOnReconnect: true,
3799
+ revalidateIfStale: true,
3800
+ shouldRetryOnError: true,
3801
+ // timeouts
3802
+ errorRetryInterval: slowConnection ? 1e4 : 5e3,
3803
+ focusThrottleInterval: 5 * 1e3,
3804
+ dedupingInterval: 2 * 1e3,
3805
+ loadingTimeout: slowConnection ? 5e3 : 3e3,
3806
+ // providers
3807
+ compare,
3808
+ isPaused: () => false,
3809
+ cache,
3810
+ mutate,
3811
+ fallback: {}
3812
+ },
3813
+ // use web preset by default
3814
+ preset
3815
+ );
3816
+ const mergeConfigs = (a, b) => {
3817
+ const v = mergeObjects(a, b);
3818
+ if (b) {
3819
+ const { use: u1, fallback: f1 } = a;
3820
+ const { use: u2, fallback: f2 } = b;
3821
+ if (u1 && u2) {
3822
+ v.use = u1.concat(u2);
3823
+ }
3824
+ if (f1 && f2) {
3825
+ v.fallback = mergeObjects(f1, f2);
3826
+ }
3827
+ }
3828
+ return v;
3829
+ };
3830
+ const SWRConfigContext = createContext({});
3831
+ const enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
3832
+ const use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
3833
+ const setupDevTools = () => {
3834
+ if (enableDevtools) {
3835
+ window.__SWR_DEVTOOLS_REACT__ = React;
3836
+ }
3837
+ };
3838
+ const normalize = (args) => {
3839
+ return isFunction(args[1]) ? [
3840
+ args[0],
3841
+ args[1],
3842
+ args[2] || {}
3843
+ ] : [
3844
+ args[0],
3845
+ null,
3846
+ (args[1] === null ? args[2] : args[1]) || {}
3847
+ ];
3848
+ };
3849
+ const useSWRConfig = () => {
3850
+ return mergeObjects(defaultConfig, useContext(SWRConfigContext));
3851
+ };
3852
+ const middleware = (useSWRNext) => (key_, fetcher_, config) => {
3853
+ const fetcher = fetcher_ && ((...args) => {
3854
+ const key = serialize(key_)[0];
3855
+ const [, , , PRELOAD] = SWRGlobalState.get(cache);
3856
+ const req = PRELOAD[key];
3857
+ if (req) {
3858
+ delete PRELOAD[key];
3859
+ return req;
3860
+ }
3861
+ return fetcher_(...args);
3862
+ });
3863
+ return useSWRNext(key_, fetcher, config);
3864
+ };
3865
+ const BUILT_IN_MIDDLEWARE = use.concat(middleware);
3866
+ const withArgs = (hook) => {
3867
+ return function useSWRArgs(...args) {
3868
+ const fallbackConfig = useSWRConfig();
3869
+ const [key, fn, _config] = normalize(args);
3870
+ const config = mergeConfigs(fallbackConfig, _config);
3871
+ let next = hook;
3872
+ const { use: use2 } = config;
3873
+ const middleware2 = (use2 || []).concat(BUILT_IN_MIDDLEWARE);
3874
+ for (let i = middleware2.length; i--; ) {
3875
+ next = middleware2[i](next);
3876
+ }
3877
+ return next(key, fn || config.fetcher || null, config);
3878
+ };
3879
+ };
3880
+ const subscribeCallback = (key, callbacks, callback) => {
3881
+ const keyedRevalidators = callbacks[key] || (callbacks[key] = []);
3882
+ keyedRevalidators.push(callback);
3883
+ return () => {
3884
+ const index = keyedRevalidators.indexOf(callback);
3885
+ if (index >= 0) {
3886
+ keyedRevalidators[index] = keyedRevalidators[keyedRevalidators.length - 1];
3887
+ keyedRevalidators.pop();
3888
+ }
3889
+ };
3890
+ };
3891
+ const withMiddleware = (useSWR2, middleware2) => {
3892
+ return (...args) => {
3893
+ const [key, fn, config] = normalize(args);
3894
+ const uses = (config.use || []).concat(middleware2);
3895
+ return useSWR2(key, fn, {
3896
+ ...config,
3897
+ use: uses
3898
+ });
3899
+ };
3900
+ };
3901
+ setupDevTools();
3902
+ const WITH_DEDUPE = {
3903
+ dedupe: true
3904
+ };
3905
+ const useSWRHandler = (_key, fetcher, config) => {
3906
+ const { cache: cache2, compare: compare2, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData } = config;
3907
+ const [EVENT_REVALIDATORS, MUTATION, FETCH] = SWRGlobalState.get(cache2);
3908
+ const [key, fnArg] = serialize(_key);
3909
+ const initialMountedRef = useRef(false);
3910
+ const unmountedRef = useRef(false);
3911
+ const keyRef = useRef(key);
3912
+ const fetcherRef = useRef(fetcher);
3913
+ const configRef = useRef(config);
3914
+ const getConfig = () => configRef.current;
3915
+ const isActive = () => getConfig().isVisible() && getConfig().isOnline();
3916
+ const [getCache, setCache, subscribeCache, getInitialCache] = createCacheHelper(cache2, key);
3917
+ const stateDependencies = useRef({}).current;
3918
+ const fallback = isUndefined(fallbackData) ? config.fallback[key] : fallbackData;
3919
+ const isEqual = (prev, current) => {
3920
+ let equal = true;
3921
+ for (const _ in stateDependencies) {
3922
+ const t = _;
3923
+ if (t === "data") {
3924
+ if (!compare2(current[t], prev[t])) {
3925
+ if (isUndefined(prev[t])) {
3926
+ if (!compare2(current[t], returnedData)) {
3927
+ equal = false;
3928
+ }
3929
+ } else {
3930
+ equal = false;
3931
+ }
3932
+ }
3933
+ } else {
3934
+ if (current[t] !== prev[t]) {
3935
+ equal = false;
3936
+ }
3937
+ }
3938
+ }
3939
+ return equal;
3940
+ };
3941
+ const getSnapshot = useMemo(() => {
3942
+ const shouldStartRequest = (() => {
3943
+ if (!key)
3944
+ return false;
3945
+ if (!fetcher)
3946
+ return false;
3947
+ if (!isUndefined(revalidateOnMount))
3948
+ return revalidateOnMount;
3949
+ if (getConfig().isPaused())
3950
+ return false;
3951
+ if (suspense)
3952
+ return false;
3953
+ if (!isUndefined(revalidateIfStale))
3954
+ return revalidateIfStale;
3955
+ return true;
3956
+ })();
3957
+ const getSelectedCache = (state) => {
3958
+ const snapshot = mergeObjects(state);
3959
+ delete snapshot._k;
3960
+ if (!shouldStartRequest) {
3961
+ return snapshot;
3962
+ }
3963
+ return {
3964
+ isValidating: true,
3965
+ isLoading: true,
3966
+ ...snapshot
3967
+ };
3968
+ };
3969
+ const cachedData2 = getCache();
3970
+ const initialData = getInitialCache();
3971
+ const clientSnapshot = getSelectedCache(cachedData2);
3972
+ const serverSnapshot = cachedData2 === initialData ? clientSnapshot : getSelectedCache(initialData);
3973
+ let memorizedSnapshot = clientSnapshot;
3974
+ return [
3975
+ () => {
3976
+ const newSnapshot = getSelectedCache(getCache());
3977
+ return isEqual(newSnapshot, memorizedSnapshot) ? memorizedSnapshot : memorizedSnapshot = newSnapshot;
3978
+ },
3979
+ () => serverSnapshot
3980
+ ];
3981
+ }, [
3982
+ cache2,
3983
+ key
3984
+ ]);
3985
+ const cached = shimExports.useSyncExternalStore(useCallback(
3986
+ (callback) => subscribeCache(key, (current, prev) => {
3987
+ if (!isEqual(prev, current))
3988
+ callback();
3989
+ }),
3990
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3991
+ [
3992
+ cache2,
3993
+ key
3994
+ ]
3995
+ ), getSnapshot[0], getSnapshot[1]);
3996
+ const isInitialMount = !initialMountedRef.current;
3997
+ const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;
3998
+ const cachedData = cached.data;
3999
+ const data = isUndefined(cachedData) ? fallback : cachedData;
4000
+ const error = cached.error;
4001
+ const laggyDataRef = useRef(data);
4002
+ const returnedData = keepPreviousData ? isUndefined(cachedData) ? laggyDataRef.current : cachedData : data;
4003
+ const shouldDoInitialRevalidation = (() => {
4004
+ if (hasRevalidator && !isUndefined(error))
4005
+ return false;
4006
+ if (isInitialMount && !isUndefined(revalidateOnMount))
4007
+ return revalidateOnMount;
4008
+ if (getConfig().isPaused())
4009
+ return false;
4010
+ if (suspense)
4011
+ return isUndefined(data) ? false : revalidateIfStale;
4012
+ return isUndefined(data) || revalidateIfStale;
4013
+ })();
4014
+ const defaultValidatingState = !!(key && fetcher && isInitialMount && shouldDoInitialRevalidation);
4015
+ const isValidating = isUndefined(cached.isValidating) ? defaultValidatingState : cached.isValidating;
4016
+ const isLoading = isUndefined(cached.isLoading) ? defaultValidatingState : cached.isLoading;
4017
+ const revalidate = useCallback(
4018
+ async (revalidateOpts) => {
4019
+ const currentFetcher = fetcherRef.current;
4020
+ if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) {
4021
+ return false;
4022
+ }
4023
+ let newData;
4024
+ let startAt;
4025
+ let loading = true;
4026
+ const opts = revalidateOpts || {};
4027
+ const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;
4028
+ const callbackSafeguard = () => {
4029
+ if (IS_REACT_LEGACY) {
4030
+ return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;
4031
+ }
4032
+ return key === keyRef.current;
4033
+ };
4034
+ const finalState = {
4035
+ isValidating: false,
4036
+ isLoading: false
4037
+ };
4038
+ const finishRequestAndUpdateState = () => {
4039
+ setCache(finalState);
4040
+ };
4041
+ const cleanupState = () => {
4042
+ const requestInfo = FETCH[key];
4043
+ if (requestInfo && requestInfo[1] === startAt) {
4044
+ delete FETCH[key];
4045
+ }
4046
+ };
4047
+ const initialState = {
4048
+ isValidating: true
4049
+ };
4050
+ if (isUndefined(getCache().data)) {
4051
+ initialState.isLoading = true;
4052
+ }
4053
+ try {
4054
+ if (shouldStartNewRequest) {
4055
+ setCache(initialState);
4056
+ if (config.loadingTimeout && isUndefined(getCache().data)) {
4057
+ setTimeout(() => {
4058
+ if (loading && callbackSafeguard()) {
4059
+ getConfig().onLoadingSlow(key, config);
4060
+ }
4061
+ }, config.loadingTimeout);
4062
+ }
4063
+ FETCH[key] = [
4064
+ currentFetcher(fnArg),
4065
+ getTimestamp()
4066
+ ];
4067
+ }
4068
+ [newData, startAt] = FETCH[key];
4069
+ newData = await newData;
4070
+ if (shouldStartNewRequest) {
4071
+ setTimeout(cleanupState, config.dedupingInterval);
4072
+ }
4073
+ if (!FETCH[key] || FETCH[key][1] !== startAt) {
4074
+ if (shouldStartNewRequest) {
4075
+ if (callbackSafeguard()) {
4076
+ getConfig().onDiscarded(key);
4077
+ }
4078
+ }
4079
+ return false;
4080
+ }
4081
+ finalState.error = UNDEFINED;
4082
+ const mutationInfo = MUTATION[key];
4083
+ if (!isUndefined(mutationInfo) && // case 1
4084
+ (startAt <= mutationInfo[0] || // case 2
4085
+ startAt <= mutationInfo[1] || // case 3
4086
+ mutationInfo[1] === 0)) {
4087
+ finishRequestAndUpdateState();
4088
+ if (shouldStartNewRequest) {
4089
+ if (callbackSafeguard()) {
4090
+ getConfig().onDiscarded(key);
4091
+ }
4092
+ }
4093
+ return false;
4094
+ }
4095
+ const cacheData = getCache().data;
4096
+ finalState.data = compare2(cacheData, newData) ? cacheData : newData;
4097
+ if (shouldStartNewRequest) {
4098
+ if (callbackSafeguard()) {
4099
+ getConfig().onSuccess(newData, key, config);
4100
+ }
4101
+ }
4102
+ } catch (err) {
4103
+ cleanupState();
4104
+ const currentConfig = getConfig();
4105
+ const { shouldRetryOnError } = currentConfig;
4106
+ if (!currentConfig.isPaused()) {
4107
+ finalState.error = err;
4108
+ if (shouldStartNewRequest && callbackSafeguard()) {
4109
+ currentConfig.onError(err, key, currentConfig);
4110
+ if (shouldRetryOnError === true || isFunction(shouldRetryOnError) && shouldRetryOnError(err)) {
4111
+ if (isActive()) {
4112
+ currentConfig.onErrorRetry(err, key, currentConfig, (_opts) => {
4113
+ const revalidators = EVENT_REVALIDATORS[key];
4114
+ if (revalidators && revalidators[0]) {
4115
+ revalidators[0](constants.ERROR_REVALIDATE_EVENT, _opts);
4116
+ }
4117
+ }, {
4118
+ retryCount: (opts.retryCount || 0) + 1,
4119
+ dedupe: true
4120
+ });
4121
+ }
4122
+ }
4123
+ }
4124
+ }
4125
+ }
4126
+ loading = false;
4127
+ finishRequestAndUpdateState();
4128
+ return true;
4129
+ },
4130
+ // `setState` is immutable, and `eventsCallback`, `fnArg`, and
4131
+ // `keyValidating` are depending on `key`, so we can exclude them from
4132
+ // the deps array.
4133
+ //
4134
+ // FIXME:
4135
+ // `fn` and `config` might be changed during the lifecycle,
4136
+ // but they might be changed every render like this.
4137
+ // `useSWR('key', () => fetch('/api/'), { suspense: true })`
4138
+ // So we omit the values from the deps array
4139
+ // even though it might cause unexpected behaviors.
4140
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4141
+ [
4142
+ key,
4143
+ cache2
4144
+ ]
4145
+ );
4146
+ const boundMutate = useCallback(
4147
+ // Use callback to make sure `keyRef.current` returns latest result every time
4148
+ (...args) => {
4149
+ return internalMutate(cache2, keyRef.current, ...args);
4150
+ },
4151
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4152
+ []
4153
+ );
4154
+ useIsomorphicLayoutEffect(() => {
4155
+ fetcherRef.current = fetcher;
4156
+ configRef.current = config;
4157
+ if (!isUndefined(cachedData)) {
4158
+ laggyDataRef.current = cachedData;
4159
+ }
4160
+ });
4161
+ useIsomorphicLayoutEffect(() => {
4162
+ if (!key)
4163
+ return;
4164
+ const softRevalidate = revalidate.bind(UNDEFINED, WITH_DEDUPE);
4165
+ let nextFocusRevalidatedAt = 0;
4166
+ const onRevalidate = (type, opts = {}) => {
4167
+ if (type == constants.FOCUS_EVENT) {
4168
+ const now = Date.now();
4169
+ if (getConfig().revalidateOnFocus && now > nextFocusRevalidatedAt && isActive()) {
4170
+ nextFocusRevalidatedAt = now + getConfig().focusThrottleInterval;
4171
+ softRevalidate();
4172
+ }
4173
+ } else if (type == constants.RECONNECT_EVENT) {
4174
+ if (getConfig().revalidateOnReconnect && isActive()) {
4175
+ softRevalidate();
4176
+ }
4177
+ } else if (type == constants.MUTATE_EVENT) {
4178
+ return revalidate();
4179
+ } else if (type == constants.ERROR_REVALIDATE_EVENT) {
4180
+ return revalidate(opts);
4181
+ }
4182
+ return;
4183
+ };
4184
+ const unsubEvents = subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);
4185
+ unmountedRef.current = false;
4186
+ keyRef.current = key;
4187
+ initialMountedRef.current = true;
4188
+ setCache({
4189
+ _k: fnArg
4190
+ });
4191
+ if (shouldDoInitialRevalidation) {
4192
+ if (isUndefined(data) || IS_SERVER) {
4193
+ softRevalidate();
4194
+ } else {
4195
+ rAF(softRevalidate);
4196
+ }
4197
+ }
4198
+ return () => {
4199
+ unmountedRef.current = true;
4200
+ unsubEvents();
4201
+ };
4202
+ }, [
4203
+ key
4204
+ ]);
4205
+ useIsomorphicLayoutEffect(() => {
4206
+ let timer;
4207
+ function next() {
4208
+ const interval = isFunction(refreshInterval) ? refreshInterval(data) : refreshInterval;
4209
+ if (interval && timer !== -1) {
4210
+ timer = setTimeout(execute, interval);
4211
+ }
4212
+ }
4213
+ function execute() {
4214
+ if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) {
4215
+ revalidate(WITH_DEDUPE).then(next);
4216
+ } else {
4217
+ next();
4218
+ }
4219
+ }
4220
+ next();
4221
+ return () => {
4222
+ if (timer) {
4223
+ clearTimeout(timer);
4224
+ timer = -1;
4225
+ }
4226
+ };
4227
+ }, [
4228
+ refreshInterval,
4229
+ refreshWhenHidden,
4230
+ refreshWhenOffline,
4231
+ key
4232
+ ]);
4233
+ useDebugValue(returnedData);
4234
+ if (suspense && isUndefined(data) && key) {
4235
+ if (!IS_REACT_LEGACY && IS_SERVER) {
4236
+ throw new Error("Fallback data is required when using suspense in SSR.");
4237
+ }
4238
+ fetcherRef.current = fetcher;
4239
+ configRef.current = config;
4240
+ unmountedRef.current = false;
4241
+ throw isUndefined(error) ? revalidate(WITH_DEDUPE) : error;
4242
+ }
4243
+ return {
4244
+ mutate: boundMutate,
4245
+ get data() {
4246
+ stateDependencies.data = true;
4247
+ return returnedData;
4248
+ },
4249
+ get error() {
4250
+ stateDependencies.error = true;
4251
+ return error;
4252
+ },
4253
+ get isValidating() {
4254
+ stateDependencies.isValidating = true;
4255
+ return isValidating;
4256
+ },
4257
+ get isLoading() {
4258
+ stateDependencies.isLoading = true;
4259
+ return isLoading;
4260
+ }
4261
+ };
4262
+ };
4263
+ var useSWR = withArgs(useSWRHandler);
4264
+ const subscriptionStorage = /* @__PURE__ */ new WeakMap();
4265
+ const SUBSCRIPTION_PREFIX = "$sub$";
4266
+ const subscription = (useSWRNext) => {
4267
+ return (_key, subscribe, config) => {
4268
+ const [key] = serialize(_key);
4269
+ const subscriptionKey = key ? SUBSCRIPTION_PREFIX + key : void 0;
4270
+ const swr = useSWRNext(subscriptionKey, null, config);
4271
+ const { cache: cache2 } = config;
4272
+ if (!subscriptionStorage.has(cache2)) {
4273
+ subscriptionStorage.set(cache2, [
4274
+ /* @__PURE__ */ new Map(),
4275
+ /* @__PURE__ */ new Map()
4276
+ ]);
4277
+ }
4278
+ const [subscriptions, disposers] = subscriptionStorage.get(cache2);
4279
+ useIsomorphicLayoutEffect(() => {
4280
+ if (!subscriptionKey)
4281
+ return;
4282
+ const [, set2] = createCacheHelper(cache2, subscriptionKey);
4283
+ const refCount = subscriptions.get(subscriptionKey) || 0;
4284
+ const next = (error, data) => {
4285
+ if (error !== null && typeof error !== "undefined") {
4286
+ set2({
4287
+ error
4288
+ });
4289
+ } else {
4290
+ set2({
4291
+ error: void 0
4292
+ });
4293
+ swr.mutate(data, false);
4294
+ }
4295
+ };
4296
+ subscriptions.set(subscriptionKey, refCount + 1);
4297
+ if (!refCount) {
4298
+ const dispose = subscribe(key, {
4299
+ next
4300
+ });
4301
+ if (typeof dispose !== "function") {
4302
+ throw new Error("The `subscribe` function must return a function to unsubscribe.");
4303
+ }
4304
+ disposers.set(subscriptionKey, dispose);
4305
+ }
4306
+ return () => {
4307
+ setTimeout(() => {
4308
+ const count = subscriptions.get(subscriptionKey) - 1;
4309
+ subscriptions.set(subscriptionKey, count);
4310
+ if (!count) {
4311
+ const dispose = disposers.get(subscriptionKey);
4312
+ dispose == null ? void 0 : dispose();
4313
+ }
4314
+ });
4315
+ };
4316
+ }, [
4317
+ subscriptionKey
4318
+ ]);
4319
+ return {
4320
+ get data() {
4321
+ return swr.data;
4322
+ },
4323
+ get error() {
4324
+ return swr.error;
4325
+ }
4326
+ };
4327
+ };
4328
+ };
4329
+ const useSWRSubscription = withMiddleware(useSWR, subscription);
4330
+ const useCollection = (params) => {
4331
+ return useSWRSubscription(params, (_, { next }) => {
4332
+ if (params == null) {
4333
+ return () => {
4334
+ };
4335
+ }
4336
+ const { path, ...options } = params;
4337
+ const converter = getFirestoreConverter(options == null ? void 0 : options.parseDates);
4338
+ const ref = collection(getFirestore(), path);
4339
+ let q;
4340
+ if (options != null) {
4341
+ const { where: w, orderBy: o, limit: l } = options;
4342
+ q = query(ref, ...(w ? w : []).map((q2) => where(...q2)), ...(o ? o : []).map((q2) => orderBy(...q2)), ...l ? [limit(l)] : []);
4343
+ }
4344
+ const unsub = onSnapshot((q ?? ref).withConverter(converter), (qs) => {
4345
+ next(null, qs.docs.map((x) => x.data()));
4346
+ }, (error) => {
4347
+ next(error);
4348
+ });
4349
+ return () => unsub && unsub();
4350
+ });
4351
+ };
4352
+ const useCollectionCount = (params, swrOptions) => {
4353
+ const fetcher = (key) => {
4354
+ const { path, ...option } = key;
4355
+ const ref = collection(getFirestore(), path);
4356
+ let q;
4357
+ if (option) {
4358
+ const { where: w, orderBy: o, limit: l } = option;
4359
+ q = query(ref, ...(w ? w : []).map((q2) => where(...q2)), ...(o ? o : []).map((q2) => orderBy(...q2)), ...l ? [limit(l)] : []);
4360
+ }
4361
+ return getCountFromServer(q ?? ref).then((sn) => {
4362
+ return sn.data().count;
4363
+ });
4364
+ };
4365
+ return useSWR(params, fetcher, swrOptions);
4366
+ };
4367
+ const useCollectionGroup = (params) => {
4368
+ return useSWRSubscription(params, (_, { next }) => {
4369
+ if (params == null) {
4370
+ return () => {
4371
+ };
4372
+ }
4373
+ const { path, ...options } = params;
4374
+ const converter = getFirestoreConverter(options == null ? void 0 : options.parseDates);
4375
+ const ref = collectionGroup(getFirestore(), path);
4376
+ let q;
4377
+ if (options != null) {
4378
+ const { where: w, orderBy: o, limit: l } = options;
4379
+ q = query(ref, ...(w ? w : []).map((q2) => where(...q2)), ...(o ? o : []).map((q2) => orderBy(...q2)), ...l ? [limit(l)] : []);
4380
+ }
4381
+ const unsub = onSnapshot((q ?? ref).withConverter(converter), (qs) => {
4382
+ next(null, qs.docs.map((x) => x.data()));
4383
+ }, (error) => {
4384
+ next(error);
4385
+ });
4386
+ return () => unsub && unsub();
4387
+ });
4388
+ };
4389
+ const useCollectionGroupCount = (params, swrOptions) => {
4390
+ const fetcher = (key) => {
4391
+ const { path, ...option } = key;
4392
+ const ref = collectionGroup(getFirestore(), path);
4393
+ let q;
4394
+ if (option) {
4395
+ const { where: w, orderBy: o, limit: l } = option;
4396
+ q = query(ref, ...(w ? w : []).map((q2) => where(...q2)), ...(o ? o : []).map((q2) => orderBy(...q2)), ...l ? [limit(l)] : []);
4397
+ }
4398
+ return getCountFromServer(q ?? ref).then((sn) => {
4399
+ return sn.data().count;
4400
+ });
4401
+ };
4402
+ return useSWR(params, fetcher, swrOptions);
4403
+ };
4404
+ const useDoc = (params) => {
4405
+ return useSWRSubscription(params, (_, { next }) => {
4406
+ if (params == null) {
4407
+ return () => {
4408
+ };
4409
+ }
4410
+ const { path } = params;
4411
+ const ref = doc(getFirestore(), path);
4412
+ const converter = getFirestoreConverter(params == null ? void 0 : params.parseDates);
4413
+ const unsub = onSnapshot(ref.withConverter(converter), (doc2) => {
4414
+ next(null, doc2.data());
4415
+ }, (error) => {
4416
+ next(error);
4417
+ });
4418
+ return () => unsub && unsub();
4419
+ });
4420
+ };
4421
+ export {
4422
+ useCollection,
4423
+ useCollectionCount,
4424
+ useCollectionGroup,
4425
+ useCollectionGroupCount,
4426
+ useDoc
4427
+ };