@audius/sdk 1.0.33 → 1.0.35

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.esm.js CHANGED
@@ -550,6 +550,8 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
550
550
  };
551
551
  }
552
552
 
553
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
554
+
553
555
  var Web3;
554
556
 
555
557
  if (typeof window !== 'undefined' && window && window.Web3) {
@@ -36930,9 +36932,9 @@ var ChatPermission;
36930
36932
  })(ChatPermission || (ChatPermission = {}));
36931
36933
 
36932
36934
  var name = "@audius/sdk";
36933
- var version = "1.0.33";
36935
+ var version = "1.0.35";
36934
36936
  var audius = {
36935
- releaseSHA: "503765c37798a57b28320d6bb45253c27cb34741"
36937
+ releaseSHA: "e40315da81c1fcf7d1d43d1b7a4bcefc5d1243d1"
36936
36938
  };
36937
36939
  var description = "";
36938
36940
  var main = "dist/index.cjs.js";
@@ -36975,7 +36977,7 @@ var scripts = {
36975
36977
  "gen:prod": "npm run gen:prod:default ; npm run gen:prod:full",
36976
36978
  "gen:prod:default": "node ./src/sdk/api/generator/gen.js",
36977
36979
  "gen:prod:full": "node ./src/sdk/api/generator/gen.js --api-flavor full",
36978
- postinstall: "patch-package"
36980
+ prepare: "patch-package"
36979
36981
  };
36980
36982
  var dependencies = {
36981
36983
  "@audius/anchor-audius-data": "0.0.2",
@@ -37016,7 +37018,6 @@ var dependencies = {
37016
37018
  lodash: "4.17.21",
37017
37019
  "micro-aes-gcm": "0.3.3",
37018
37020
  "node-localstorage": "^1.3.1",
37019
- "patch-package": "6.5.0",
37020
37021
  "proper-url-join": "1.2.0",
37021
37022
  "rollup-plugin-shim": "^1.0.0",
37022
37023
  "safe-buffer": "5.2.1",
@@ -37064,6 +37065,7 @@ var devDependencies = {
37064
37065
  mocha: "9.2.2",
37065
37066
  nock: "13.1.2",
37066
37067
  nyc: "15.1.0",
37068
+ "patch-package": "6.5.0",
37067
37069
  prettier: "^2.6.1",
37068
37070
  "prettier-config-standard": "^5.0.0",
37069
37071
  rollup: "2.70.1",
@@ -62642,247 +62644,3431 @@ var syncNodes = /*#__PURE__*/function () {
62642
62644
  };
62643
62645
  }();
62644
62646
 
62645
- var THREE_SECONDS = 3000;
62646
- var MAX_TRIES = 3;
62647
- /** Check if the user's primary creator node is healthy */
62647
+ var freeGlobal$1 = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
62648
+ var _freeGlobal = freeGlobal$1;
62648
62649
 
62649
- var checkPrimaryHealthy = /*#__PURE__*/function () {
62650
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
62651
- var healthy;
62652
- return regeneratorRuntime.wrap(function _callee$(_context) {
62653
- while (1) {
62654
- switch (_context.prev = _context.next) {
62655
- case 0:
62656
- _context.next = 2;
62657
- return Utils.isHealthy(primary);
62650
+ var freeGlobal = _freeGlobal;
62651
+ /** Detect free variable `self`. */
62658
62652
 
62659
- case 2:
62660
- healthy = _context.sent;
62653
+ var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
62654
+ /** Used as a reference to the global object. */
62661
62655
 
62662
- if (!healthy) {
62663
- _context.next = 7;
62664
- break;
62665
- }
62656
+ var root$8 = freeGlobal || freeSelf || Function('return this')();
62657
+ var _root = root$8;
62666
62658
 
62667
- return _context.abrupt("return", healthy);
62659
+ var root$7 = _root;
62660
+ /** Built-in value references. */
62668
62661
 
62669
- case 7:
62670
- if (!(tries === 0)) {
62671
- _context.next = 9;
62672
- break;
62673
- }
62662
+ var _Symbol2 = root$7.Symbol;
62663
+ var _Symbol$4 = _Symbol2;
62674
62664
 
62675
- return _context.abrupt("return", false);
62665
+ var _Symbol$3 = _Symbol$4;
62666
+ /** Used for built-in method references. */
62676
62667
 
62677
- case 9:
62678
- _context.next = 11;
62679
- return Utils.wait(THREE_SECONDS);
62668
+ var objectProto$b = Object.prototype;
62669
+ /** Used to check objects for own properties. */
62680
62670
 
62681
- case 11:
62682
- _context.next = 13;
62683
- return checkPrimaryHealthy(libs, primary, tries - 1);
62671
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
62672
+ /**
62673
+ * Used to resolve the
62674
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
62675
+ * of values.
62676
+ */
62684
62677
 
62685
- case 13:
62686
- return _context.abrupt("return", _context.sent);
62678
+ var nativeObjectToString$1 = objectProto$b.toString;
62679
+ /** Built-in value references. */
62687
62680
 
62688
- case 14:
62689
- case "end":
62690
- return _context.stop();
62691
- }
62692
- }
62693
- }, _callee);
62694
- }));
62681
+ var symToStringTag$1 = _Symbol$3 ? _Symbol$3.toStringTag : undefined;
62682
+ /**
62683
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
62684
+ *
62685
+ * @private
62686
+ * @param {*} value The value to query.
62687
+ * @returns {string} Returns the raw `toStringTag`.
62688
+ */
62695
62689
 
62696
- return function checkPrimaryHealthy(_x, _x2, _x3) {
62697
- return _ref.apply(this, arguments);
62698
- };
62690
+ function getRawTag$1(value) {
62691
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
62692
+ tag = value[symToStringTag$1];
62693
+
62694
+ try {
62695
+ value[symToStringTag$1] = undefined;
62696
+ var unmasked = true;
62697
+ } catch (e) {}
62698
+
62699
+ var result = nativeObjectToString$1.call(value);
62700
+
62701
+ if (unmasked) {
62702
+ if (isOwn) {
62703
+ value[symToStringTag$1] = tag;
62704
+ } else {
62705
+ delete value[symToStringTag$1];
62706
+ }
62707
+ }
62708
+
62709
+ return result;
62710
+ }
62711
+
62712
+ var _getRawTag = getRawTag$1;
62713
+
62714
+ /** Used for built-in method references. */
62715
+ var objectProto$a = Object.prototype;
62716
+ /**
62717
+ * Used to resolve the
62718
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
62719
+ * of values.
62720
+ */
62721
+
62722
+ var nativeObjectToString = objectProto$a.toString;
62723
+ /**
62724
+ * Converts `value` to a string using `Object.prototype.toString`.
62725
+ *
62726
+ * @private
62727
+ * @param {*} value The value to convert.
62728
+ * @returns {string} Returns the converted string.
62729
+ */
62730
+
62731
+ function objectToString$1(value) {
62732
+ return nativeObjectToString.call(value);
62733
+ }
62734
+
62735
+ var _objectToString = objectToString$1;
62736
+
62737
+ var _Symbol$2 = _Symbol$4,
62738
+ getRawTag = _getRawTag,
62739
+ objectToString = _objectToString;
62740
+ /** `Object#toString` result references. */
62741
+
62742
+ var nullTag = '[object Null]',
62743
+ undefinedTag = '[object Undefined]';
62744
+ /** Built-in value references. */
62745
+
62746
+ var symToStringTag = _Symbol$2 ? _Symbol$2.toStringTag : undefined;
62747
+ /**
62748
+ * The base implementation of `getTag` without fallbacks for buggy environments.
62749
+ *
62750
+ * @private
62751
+ * @param {*} value The value to query.
62752
+ * @returns {string} Returns the `toStringTag`.
62753
+ */
62754
+
62755
+ function baseGetTag$5(value) {
62756
+ if (value == null) {
62757
+ return value === undefined ? undefinedTag : nullTag;
62758
+ }
62759
+
62760
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
62761
+ }
62762
+
62763
+ var _baseGetTag = baseGetTag$5;
62764
+
62765
+ function isObjectLike$5(value) {
62766
+ return value != null && _typeof(value) == 'object';
62767
+ }
62768
+
62769
+ var isObjectLike_1 = isObjectLike$5;
62770
+
62771
+ var baseGetTag$4 = _baseGetTag,
62772
+ isObjectLike$4 = isObjectLike_1;
62773
+ /** `Object#toString` result references. */
62774
+
62775
+ var symbolTag$1 = '[object Symbol]';
62776
+ /**
62777
+ * Checks if `value` is classified as a `Symbol` primitive or object.
62778
+ *
62779
+ * @static
62780
+ * @memberOf _
62781
+ * @since 4.0.0
62782
+ * @category Lang
62783
+ * @param {*} value The value to check.
62784
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
62785
+ * @example
62786
+ *
62787
+ * _.isSymbol(Symbol.iterator);
62788
+ * // => true
62789
+ *
62790
+ * _.isSymbol('abc');
62791
+ * // => false
62792
+ */
62793
+
62794
+ function isSymbol$4(value) {
62795
+ return _typeof(value) == 'symbol' || isObjectLike$4(value) && baseGetTag$4(value) == symbolTag$1;
62796
+ }
62797
+
62798
+ var isSymbol_1 = isSymbol$4;
62799
+
62800
+ var isSymbol$3 = isSymbol_1;
62801
+ /**
62802
+ * The base implementation of methods like `_.max` and `_.min` which accepts a
62803
+ * `comparator` to determine the extremum value.
62804
+ *
62805
+ * @private
62806
+ * @param {Array} array The array to iterate over.
62807
+ * @param {Function} iteratee The iteratee invoked per iteration.
62808
+ * @param {Function} comparator The comparator used to compare values.
62809
+ * @returns {*} Returns the extremum value.
62810
+ */
62811
+
62812
+ function baseExtremum$1(array, iteratee, comparator) {
62813
+ var index = -1,
62814
+ length = array.length;
62815
+
62816
+ while (++index < length) {
62817
+ var value = array[index],
62818
+ current = iteratee(value);
62819
+
62820
+ if (current != null && (computed === undefined ? current === current && !isSymbol$3(current) : comparator(current, computed))) {
62821
+ var computed = current,
62822
+ result = value;
62823
+ }
62824
+ }
62825
+
62826
+ return result;
62827
+ }
62828
+
62829
+ var _baseExtremum = baseExtremum$1;
62830
+
62831
+ /**
62832
+ * The base implementation of `_.gt` which doesn't coerce arguments.
62833
+ *
62834
+ * @private
62835
+ * @param {*} value The value to compare.
62836
+ * @param {*} other The other value to compare.
62837
+ * @returns {boolean} Returns `true` if `value` is greater than `other`,
62838
+ * else `false`.
62839
+ */
62840
+
62841
+ function baseGt$1(value, other) {
62842
+ return value > other;
62843
+ }
62844
+
62845
+ var _baseGt = baseGt$1;
62846
+
62847
+ /**
62848
+ * Removes all key-value entries from the list cache.
62849
+ *
62850
+ * @private
62851
+ * @name clear
62852
+ * @memberOf ListCache
62853
+ */
62854
+
62855
+ function listCacheClear$1() {
62856
+ this.__data__ = [];
62857
+ this.size = 0;
62858
+ }
62859
+
62860
+ var _listCacheClear = listCacheClear$1;
62861
+
62862
+ /**
62863
+ * Performs a
62864
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
62865
+ * comparison between two values to determine if they are equivalent.
62866
+ *
62867
+ * @static
62868
+ * @memberOf _
62869
+ * @since 4.0.0
62870
+ * @category Lang
62871
+ * @param {*} value The value to compare.
62872
+ * @param {*} other The other value to compare.
62873
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
62874
+ * @example
62875
+ *
62876
+ * var object = { 'a': 1 };
62877
+ * var other = { 'a': 1 };
62878
+ *
62879
+ * _.eq(object, object);
62880
+ * // => true
62881
+ *
62882
+ * _.eq(object, other);
62883
+ * // => false
62884
+ *
62885
+ * _.eq('a', 'a');
62886
+ * // => true
62887
+ *
62888
+ * _.eq('a', Object('a'));
62889
+ * // => false
62890
+ *
62891
+ * _.eq(NaN, NaN);
62892
+ * // => true
62893
+ */
62894
+
62895
+ function eq$2(value, other) {
62896
+ return value === other || value !== value && other !== other;
62897
+ }
62898
+
62899
+ var eq_1 = eq$2;
62900
+
62901
+ var eq$1 = eq_1;
62902
+ /**
62903
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
62904
+ *
62905
+ * @private
62906
+ * @param {Array} array The array to inspect.
62907
+ * @param {*} key The key to search for.
62908
+ * @returns {number} Returns the index of the matched value, else `-1`.
62909
+ */
62910
+
62911
+ function assocIndexOf$4(array, key) {
62912
+ var length = array.length;
62913
+
62914
+ while (length--) {
62915
+ if (eq$1(array[length][0], key)) {
62916
+ return length;
62917
+ }
62918
+ }
62919
+
62920
+ return -1;
62921
+ }
62922
+
62923
+ var _assocIndexOf = assocIndexOf$4;
62924
+
62925
+ var assocIndexOf$3 = _assocIndexOf;
62926
+ /** Used for built-in method references. */
62927
+
62928
+ var arrayProto = Array.prototype;
62929
+ /** Built-in value references. */
62930
+
62931
+ var splice = arrayProto.splice;
62932
+ /**
62933
+ * Removes `key` and its value from the list cache.
62934
+ *
62935
+ * @private
62936
+ * @name delete
62937
+ * @memberOf ListCache
62938
+ * @param {string} key The key of the value to remove.
62939
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
62940
+ */
62941
+
62942
+ function listCacheDelete$1(key) {
62943
+ var data = this.__data__,
62944
+ index = assocIndexOf$3(data, key);
62945
+
62946
+ if (index < 0) {
62947
+ return false;
62948
+ }
62949
+
62950
+ var lastIndex = data.length - 1;
62951
+
62952
+ if (index == lastIndex) {
62953
+ data.pop();
62954
+ } else {
62955
+ splice.call(data, index, 1);
62956
+ }
62957
+
62958
+ --this.size;
62959
+ return true;
62960
+ }
62961
+
62962
+ var _listCacheDelete = listCacheDelete$1;
62963
+
62964
+ var assocIndexOf$2 = _assocIndexOf;
62965
+ /**
62966
+ * Gets the list cache value for `key`.
62967
+ *
62968
+ * @private
62969
+ * @name get
62970
+ * @memberOf ListCache
62971
+ * @param {string} key The key of the value to get.
62972
+ * @returns {*} Returns the entry value.
62973
+ */
62974
+
62975
+ function listCacheGet$1(key) {
62976
+ var data = this.__data__,
62977
+ index = assocIndexOf$2(data, key);
62978
+ return index < 0 ? undefined : data[index][1];
62979
+ }
62980
+
62981
+ var _listCacheGet = listCacheGet$1;
62982
+
62983
+ var assocIndexOf$1 = _assocIndexOf;
62984
+ /**
62985
+ * Checks if a list cache value for `key` exists.
62986
+ *
62987
+ * @private
62988
+ * @name has
62989
+ * @memberOf ListCache
62990
+ * @param {string} key The key of the entry to check.
62991
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
62992
+ */
62993
+
62994
+ function listCacheHas$1(key) {
62995
+ return assocIndexOf$1(this.__data__, key) > -1;
62996
+ }
62997
+
62998
+ var _listCacheHas = listCacheHas$1;
62999
+
63000
+ var assocIndexOf = _assocIndexOf;
63001
+ /**
63002
+ * Sets the list cache `key` to `value`.
63003
+ *
63004
+ * @private
63005
+ * @name set
63006
+ * @memberOf ListCache
63007
+ * @param {string} key The key of the value to set.
63008
+ * @param {*} value The value to set.
63009
+ * @returns {Object} Returns the list cache instance.
63010
+ */
63011
+
63012
+ function listCacheSet$1(key, value) {
63013
+ var data = this.__data__,
63014
+ index = assocIndexOf(data, key);
63015
+
63016
+ if (index < 0) {
63017
+ ++this.size;
63018
+ data.push([key, value]);
63019
+ } else {
63020
+ data[index][1] = value;
63021
+ }
63022
+
63023
+ return this;
63024
+ }
63025
+
63026
+ var _listCacheSet = listCacheSet$1;
63027
+
63028
+ var listCacheClear = _listCacheClear,
63029
+ listCacheDelete = _listCacheDelete,
63030
+ listCacheGet = _listCacheGet,
63031
+ listCacheHas = _listCacheHas,
63032
+ listCacheSet = _listCacheSet;
63033
+ /**
63034
+ * Creates an list cache object.
63035
+ *
63036
+ * @private
63037
+ * @constructor
63038
+ * @param {Array} [entries] The key-value pairs to cache.
63039
+ */
63040
+
63041
+ function ListCache$4(entries) {
63042
+ var index = -1,
63043
+ length = entries == null ? 0 : entries.length;
63044
+ this.clear();
63045
+
63046
+ while (++index < length) {
63047
+ var entry = entries[index];
63048
+ this.set(entry[0], entry[1]);
63049
+ }
63050
+ } // Add methods to `ListCache`.
63051
+
63052
+
63053
+ ListCache$4.prototype.clear = listCacheClear;
63054
+ ListCache$4.prototype['delete'] = listCacheDelete;
63055
+ ListCache$4.prototype.get = listCacheGet;
63056
+ ListCache$4.prototype.has = listCacheHas;
63057
+ ListCache$4.prototype.set = listCacheSet;
63058
+ var _ListCache = ListCache$4;
63059
+
63060
+ var ListCache$3 = _ListCache;
63061
+ /**
63062
+ * Removes all key-value entries from the stack.
63063
+ *
63064
+ * @private
63065
+ * @name clear
63066
+ * @memberOf Stack
63067
+ */
63068
+
63069
+ function stackClear$1() {
63070
+ this.__data__ = new ListCache$3();
63071
+ this.size = 0;
63072
+ }
63073
+
63074
+ var _stackClear = stackClear$1;
63075
+
63076
+ /**
63077
+ * Removes `key` and its value from the stack.
63078
+ *
63079
+ * @private
63080
+ * @name delete
63081
+ * @memberOf Stack
63082
+ * @param {string} key The key of the value to remove.
63083
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63084
+ */
63085
+
63086
+ function stackDelete$1(key) {
63087
+ var data = this.__data__,
63088
+ result = data['delete'](key);
63089
+ this.size = data.size;
63090
+ return result;
63091
+ }
63092
+
63093
+ var _stackDelete = stackDelete$1;
63094
+
63095
+ /**
63096
+ * Gets the stack value for `key`.
63097
+ *
63098
+ * @private
63099
+ * @name get
63100
+ * @memberOf Stack
63101
+ * @param {string} key The key of the value to get.
63102
+ * @returns {*} Returns the entry value.
63103
+ */
63104
+
63105
+ function stackGet$1(key) {
63106
+ return this.__data__.get(key);
63107
+ }
63108
+
63109
+ var _stackGet = stackGet$1;
63110
+
63111
+ /**
63112
+ * Checks if a stack value for `key` exists.
63113
+ *
63114
+ * @private
63115
+ * @name has
63116
+ * @memberOf Stack
63117
+ * @param {string} key The key of the entry to check.
63118
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63119
+ */
63120
+
63121
+ function stackHas$1(key) {
63122
+ return this.__data__.has(key);
63123
+ }
63124
+
63125
+ var _stackHas = stackHas$1;
63126
+
63127
+ function isObject$3(value) {
63128
+ var type = _typeof(value);
63129
+
63130
+ return value != null && (type == 'object' || type == 'function');
63131
+ }
63132
+
63133
+ var isObject_1 = isObject$3;
63134
+
63135
+ var baseGetTag$3 = _baseGetTag,
63136
+ isObject$2 = isObject_1;
63137
+ /** `Object#toString` result references. */
63138
+
63139
+ var asyncTag = '[object AsyncFunction]',
63140
+ funcTag$1 = '[object Function]',
63141
+ genTag = '[object GeneratorFunction]',
63142
+ proxyTag = '[object Proxy]';
63143
+ /**
63144
+ * Checks if `value` is classified as a `Function` object.
63145
+ *
63146
+ * @static
63147
+ * @memberOf _
63148
+ * @since 0.1.0
63149
+ * @category Lang
63150
+ * @param {*} value The value to check.
63151
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
63152
+ * @example
63153
+ *
63154
+ * _.isFunction(_);
63155
+ * // => true
63156
+ *
63157
+ * _.isFunction(/abc/);
63158
+ * // => false
63159
+ */
63160
+
63161
+ function isFunction$2(value) {
63162
+ if (!isObject$2(value)) {
63163
+ return false;
63164
+ } // The use of `Object#toString` avoids issues with the `typeof` operator
63165
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
63166
+
63167
+
63168
+ var tag = baseGetTag$3(value);
63169
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
63170
+ }
63171
+
63172
+ var isFunction_1 = isFunction$2;
63173
+
63174
+ var root$6 = _root;
63175
+ /** Used to detect overreaching core-js shims. */
63176
+
63177
+ var coreJsData$1 = root$6['__core-js_shared__'];
63178
+ var _coreJsData = coreJsData$1;
63179
+
63180
+ var coreJsData = _coreJsData;
63181
+ /** Used to detect methods masquerading as native. */
63182
+
63183
+ var maskSrcKey = function () {
63184
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
63185
+ return uid ? 'Symbol(src)_1.' + uid : '';
62699
63186
  }();
62700
- /** Gets new endpoints from a user's secondaries */
63187
+ /**
63188
+ * Checks if `func` has its source masked.
63189
+ *
63190
+ * @private
63191
+ * @param {Function} func The function to check.
63192
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
63193
+ */
62701
63194
 
62702
63195
 
62703
- var getNewPrimary = /*#__PURE__*/function () {
62704
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(libs, secondaries) {
62705
- var _iterator, _step, _libs$creatorNode, secondary, syncStatus;
63196
+ function isMasked$1(func) {
63197
+ return !!maskSrcKey && maskSrcKey in func;
63198
+ }
62706
63199
 
62707
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
62708
- while (1) {
62709
- switch (_context2.prev = _context2.next) {
62710
- case 0:
62711
- _iterator = _createForOfIteratorHelper(secondaries);
62712
- _context2.prev = 1;
63200
+ var _isMasked = isMasked$1;
62713
63201
 
62714
- _iterator.s();
63202
+ /** Used for built-in method references. */
63203
+ var funcProto$1 = Function.prototype;
63204
+ /** Used to resolve the decompiled source of functions. */
62715
63205
 
62716
- case 3:
62717
- if ((_step = _iterator.n()).done) {
62718
- _context2.next = 14;
62719
- break;
62720
- }
63206
+ var funcToString$1 = funcProto$1.toString;
63207
+ /**
63208
+ * Converts `func` to its source code.
63209
+ *
63210
+ * @private
63211
+ * @param {Function} func The function to convert.
63212
+ * @returns {string} Returns the source code.
63213
+ */
62721
63214
 
62722
- secondary = _step.value;
62723
- _context2.next = 7;
62724
- return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.getSyncStatus(secondary);
63215
+ function toSource$2(func) {
63216
+ if (func != null) {
63217
+ try {
63218
+ return funcToString$1.call(func);
63219
+ } catch (e) {}
62725
63220
 
62726
- case 7:
62727
- syncStatus = _context2.sent;
63221
+ try {
63222
+ return func + '';
63223
+ } catch (e) {}
63224
+ }
62728
63225
 
62729
- if (syncStatus) {
62730
- _context2.next = 10;
62731
- break;
62732
- }
63226
+ return '';
63227
+ }
62733
63228
 
62734
- return _context2.abrupt("continue", 12);
63229
+ var _toSource = toSource$2;
62735
63230
 
62736
- case 10:
62737
- if (syncStatus.isBehind) {
62738
- _context2.next = 12;
62739
- break;
62740
- }
63231
+ var isFunction$1 = isFunction_1,
63232
+ isMasked = _isMasked,
63233
+ isObject$1 = isObject_1,
63234
+ toSource$1 = _toSource;
63235
+ /**
63236
+ * Used to match `RegExp`
63237
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
63238
+ */
62741
63239
 
62742
- return _context2.abrupt("return", secondary);
63240
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
63241
+ /** Used to detect host constructors (Safari). */
62743
63242
 
62744
- case 12:
62745
- _context2.next = 3;
62746
- break;
63243
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
63244
+ /** Used for built-in method references. */
62747
63245
 
62748
- case 14:
62749
- _context2.next = 19;
62750
- break;
63246
+ var funcProto = Function.prototype,
63247
+ objectProto$9 = Object.prototype;
63248
+ /** Used to resolve the decompiled source of functions. */
62751
63249
 
62752
- case 16:
62753
- _context2.prev = 16;
62754
- _context2.t0 = _context2["catch"](1);
63250
+ var funcToString = funcProto.toString;
63251
+ /** Used to check objects for own properties. */
62755
63252
 
62756
- _iterator.e(_context2.t0);
63253
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
63254
+ /** Used to detect if a method is native. */
62757
63255
 
62758
- case 19:
62759
- _context2.prev = 19;
63256
+ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
63257
+ /**
63258
+ * The base implementation of `_.isNative` without bad shim checks.
63259
+ *
63260
+ * @private
63261
+ * @param {*} value The value to check.
63262
+ * @returns {boolean} Returns `true` if `value` is a native function,
63263
+ * else `false`.
63264
+ */
62760
63265
 
62761
- _iterator.f();
63266
+ function baseIsNative$1(value) {
63267
+ if (!isObject$1(value) || isMasked(value)) {
63268
+ return false;
63269
+ }
62762
63270
 
62763
- return _context2.finish(19);
63271
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
63272
+ return pattern.test(toSource$1(value));
63273
+ }
62764
63274
 
62765
- case 22:
62766
- throw new Error("Could not find valid secondaries for user ".concat(secondaries));
63275
+ var _baseIsNative = baseIsNative$1;
62767
63276
 
62768
- case 23:
62769
- case "end":
62770
- return _context2.stop();
62771
- }
62772
- }
62773
- }, _callee2, null, [[1, 16, 19, 22]]);
62774
- }));
63277
+ /**
63278
+ * Gets the value at `key` of `object`.
63279
+ *
63280
+ * @private
63281
+ * @param {Object} [object] The object to query.
63282
+ * @param {string} key The key of the property to get.
63283
+ * @returns {*} Returns the property value.
63284
+ */
62775
63285
 
62776
- return function getNewPrimary(_x4, _x5) {
62777
- return _ref2.apply(this, arguments);
63286
+ function getValue$1(object, key) {
63287
+ return object == null ? undefined : object[key];
63288
+ }
63289
+
63290
+ var _getValue = getValue$1;
63291
+
63292
+ var baseIsNative = _baseIsNative,
63293
+ getValue = _getValue;
63294
+ /**
63295
+ * Gets the native function at `key` of `object`.
63296
+ *
63297
+ * @private
63298
+ * @param {Object} object The object to query.
63299
+ * @param {string} key The key of the method to get.
63300
+ * @returns {*} Returns the function if it's native, else `undefined`.
63301
+ */
63302
+
63303
+ function getNative$6(object, key) {
63304
+ var value = getValue(object, key);
63305
+ return baseIsNative(value) ? value : undefined;
63306
+ }
63307
+
63308
+ var _getNative = getNative$6;
63309
+
63310
+ var getNative$5 = _getNative,
63311
+ root$5 = _root;
63312
+ /* Built-in method references that are verified to be native. */
63313
+
63314
+ var Map$4 = getNative$5(root$5, 'Map');
63315
+ var _Map = Map$4;
63316
+
63317
+ var getNative$4 = _getNative;
63318
+ /* Built-in method references that are verified to be native. */
63319
+
63320
+ var nativeCreate$4 = getNative$4(Object, 'create');
63321
+ var _nativeCreate = nativeCreate$4;
63322
+
63323
+ var nativeCreate$3 = _nativeCreate;
63324
+ /**
63325
+ * Removes all key-value entries from the hash.
63326
+ *
63327
+ * @private
63328
+ * @name clear
63329
+ * @memberOf Hash
63330
+ */
63331
+
63332
+ function hashClear$1() {
63333
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
63334
+ this.size = 0;
63335
+ }
63336
+
63337
+ var _hashClear = hashClear$1;
63338
+
63339
+ /**
63340
+ * Removes `key` and its value from the hash.
63341
+ *
63342
+ * @private
63343
+ * @name delete
63344
+ * @memberOf Hash
63345
+ * @param {Object} hash The hash to modify.
63346
+ * @param {string} key The key of the value to remove.
63347
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63348
+ */
63349
+
63350
+ function hashDelete$1(key) {
63351
+ var result = this.has(key) && delete this.__data__[key];
63352
+ this.size -= result ? 1 : 0;
63353
+ return result;
63354
+ }
63355
+
63356
+ var _hashDelete = hashDelete$1;
63357
+
63358
+ var nativeCreate$2 = _nativeCreate;
63359
+ /** Used to stand-in for `undefined` hash values. */
63360
+
63361
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
63362
+ /** Used for built-in method references. */
63363
+
63364
+ var objectProto$8 = Object.prototype;
63365
+ /** Used to check objects for own properties. */
63366
+
63367
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
63368
+ /**
63369
+ * Gets the hash value for `key`.
63370
+ *
63371
+ * @private
63372
+ * @name get
63373
+ * @memberOf Hash
63374
+ * @param {string} key The key of the value to get.
63375
+ * @returns {*} Returns the entry value.
63376
+ */
63377
+
63378
+ function hashGet$1(key) {
63379
+ var data = this.__data__;
63380
+
63381
+ if (nativeCreate$2) {
63382
+ var result = data[key];
63383
+ return result === HASH_UNDEFINED$2 ? undefined : result;
63384
+ }
63385
+
63386
+ return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
63387
+ }
63388
+
63389
+ var _hashGet = hashGet$1;
63390
+
63391
+ var nativeCreate$1 = _nativeCreate;
63392
+ /** Used for built-in method references. */
63393
+
63394
+ var objectProto$7 = Object.prototype;
63395
+ /** Used to check objects for own properties. */
63396
+
63397
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
63398
+ /**
63399
+ * Checks if a hash value for `key` exists.
63400
+ *
63401
+ * @private
63402
+ * @name has
63403
+ * @memberOf Hash
63404
+ * @param {string} key The key of the entry to check.
63405
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63406
+ */
63407
+
63408
+ function hashHas$1(key) {
63409
+ var data = this.__data__;
63410
+ return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty$5.call(data, key);
63411
+ }
63412
+
63413
+ var _hashHas = hashHas$1;
63414
+
63415
+ var nativeCreate = _nativeCreate;
63416
+ /** Used to stand-in for `undefined` hash values. */
63417
+
63418
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
63419
+ /**
63420
+ * Sets the hash `key` to `value`.
63421
+ *
63422
+ * @private
63423
+ * @name set
63424
+ * @memberOf Hash
63425
+ * @param {string} key The key of the value to set.
63426
+ * @param {*} value The value to set.
63427
+ * @returns {Object} Returns the hash instance.
63428
+ */
63429
+
63430
+ function hashSet$1(key, value) {
63431
+ var data = this.__data__;
63432
+ this.size += this.has(key) ? 0 : 1;
63433
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
63434
+ return this;
63435
+ }
63436
+
63437
+ var _hashSet = hashSet$1;
63438
+
63439
+ var hashClear = _hashClear,
63440
+ hashDelete = _hashDelete,
63441
+ hashGet = _hashGet,
63442
+ hashHas = _hashHas,
63443
+ hashSet = _hashSet;
63444
+ /**
63445
+ * Creates a hash object.
63446
+ *
63447
+ * @private
63448
+ * @constructor
63449
+ * @param {Array} [entries] The key-value pairs to cache.
63450
+ */
63451
+
63452
+ function Hash$1(entries) {
63453
+ var index = -1,
63454
+ length = entries == null ? 0 : entries.length;
63455
+ this.clear();
63456
+
63457
+ while (++index < length) {
63458
+ var entry = entries[index];
63459
+ this.set(entry[0], entry[1]);
63460
+ }
63461
+ } // Add methods to `Hash`.
63462
+
63463
+
63464
+ Hash$1.prototype.clear = hashClear;
63465
+ Hash$1.prototype['delete'] = hashDelete;
63466
+ Hash$1.prototype.get = hashGet;
63467
+ Hash$1.prototype.has = hashHas;
63468
+ Hash$1.prototype.set = hashSet;
63469
+ var _Hash = Hash$1;
63470
+
63471
+ var Hash = _Hash,
63472
+ ListCache$2 = _ListCache,
63473
+ Map$3 = _Map;
63474
+ /**
63475
+ * Removes all key-value entries from the map.
63476
+ *
63477
+ * @private
63478
+ * @name clear
63479
+ * @memberOf MapCache
63480
+ */
63481
+
63482
+ function mapCacheClear$1() {
63483
+ this.size = 0;
63484
+ this.__data__ = {
63485
+ 'hash': new Hash(),
63486
+ 'map': new (Map$3 || ListCache$2)(),
63487
+ 'string': new Hash()
62778
63488
  };
62779
- }();
63489
+ }
62780
63490
 
62781
- var rolloverNodes = /*#__PURE__*/function () {
62782
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
62783
- var _libs$userStateManage;
63491
+ var _mapCacheClear = mapCacheClear$1;
62784
63492
 
62785
- var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode2, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
63493
+ function isKeyable$1(value) {
63494
+ var type = _typeof(value);
62786
63495
 
62787
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
62788
- while (1) {
62789
- switch (_context3.prev = _context3.next) {
62790
- case 0:
62791
- console.debug('Sanity Check - rolloverNodes');
62792
- user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
63496
+ return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
63497
+ }
62793
63498
 
62794
- if (user) {
62795
- _context3.next = 4;
62796
- break;
62797
- }
63499
+ var _isKeyable = isKeyable$1;
62798
63500
 
62799
- return _context3.abrupt("return");
63501
+ var isKeyable = _isKeyable;
63502
+ /**
63503
+ * Gets the data for `map`.
63504
+ *
63505
+ * @private
63506
+ * @param {Object} map The map to query.
63507
+ * @param {string} key The reference key.
63508
+ * @returns {*} Returns the map data.
63509
+ */
62800
63510
 
62801
- case 4:
62802
- primary = CreatorNode.getPrimary(user.creator_node_endpoint);
63511
+ function getMapData$4(map, key) {
63512
+ var data = map.__data__;
63513
+ return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
63514
+ }
62803
63515
 
62804
- if (primary) {
62805
- _context3.next = 7;
62806
- break;
62807
- }
63516
+ var _getMapData = getMapData$4;
62808
63517
 
62809
- return _context3.abrupt("return");
63518
+ var getMapData$3 = _getMapData;
63519
+ /**
63520
+ * Removes `key` and its value from the map.
63521
+ *
63522
+ * @private
63523
+ * @name delete
63524
+ * @memberOf MapCache
63525
+ * @param {string} key The key of the value to remove.
63526
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63527
+ */
62810
63528
 
62811
- case 7:
62812
- _context3.next = 9;
62813
- return checkPrimaryHealthy(libs, primary, MAX_TRIES);
63529
+ function mapCacheDelete$1(key) {
63530
+ var result = getMapData$3(this, key)['delete'](key);
63531
+ this.size -= result ? 1 : 0;
63532
+ return result;
63533
+ }
62814
63534
 
62815
- case 9:
62816
- healthy = _context3.sent;
63535
+ var _mapCacheDelete = mapCacheDelete$1;
62817
63536
 
62818
- if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
62819
- _context3.next = 12;
62820
- break;
62821
- }
63537
+ var getMapData$2 = _getMapData;
63538
+ /**
63539
+ * Gets the map value for `key`.
63540
+ *
63541
+ * @private
63542
+ * @name get
63543
+ * @memberOf MapCache
63544
+ * @param {string} key The key of the value to get.
63545
+ * @returns {*} Returns the entry value.
63546
+ */
62822
63547
 
62823
- return _context3.abrupt("return");
63548
+ function mapCacheGet$1(key) {
63549
+ return getMapData$2(this, key).get(key);
63550
+ }
62824
63551
 
62825
- case 12:
62826
- secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
62827
- _context3.prev = 13;
62828
- _context3.next = 16;
62829
- return getNewPrimary(libs, secondaries);
63552
+ var _mapCacheGet = mapCacheGet$1;
62830
63553
 
62831
- case 16:
62832
- newPrimary = _context3.sent;
62833
- index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
63554
+ var getMapData$1 = _getMapData;
63555
+ /**
63556
+ * Checks if a map value for `key` exists.
63557
+ *
63558
+ * @private
63559
+ * @name has
63560
+ * @memberOf MapCache
63561
+ * @param {string} key The key of the entry to check.
63562
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63563
+ */
62834
63564
 
62835
- newSecondaries = _toConsumableArray(secondaries);
62836
- newSecondaries.splice(index, 1);
62837
- _context3.next = 22;
62838
- return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
62839
- numberOfNodes: 2 - newSecondaries.length,
62840
- whitelist: creatorNodeWhitelist,
62841
- // Exclude ones we currently have
62842
- blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
62843
- preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
62844
- preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
62845
- });
63565
+ function mapCacheHas$1(key) {
63566
+ return getMapData$1(this, key).has(key);
63567
+ }
62846
63568
 
62847
- case 22:
62848
- autoselect = _context3.sent;
63569
+ var _mapCacheHas = mapCacheHas$1;
62849
63570
 
62850
- if (autoselect) {
62851
- newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
62852
- } // Set the new endpoint and connect to it
63571
+ var getMapData = _getMapData;
63572
+ /**
63573
+ * Sets the map `key` to `value`.
63574
+ *
63575
+ * @private
63576
+ * @name set
63577
+ * @memberOf MapCache
63578
+ * @param {string} key The key of the value to set.
63579
+ * @param {*} value The value to set.
63580
+ * @returns {Object} Returns the map cache instance.
63581
+ */
62853
63582
 
63583
+ function mapCacheSet$1(key, value) {
63584
+ var data = getMapData(this, key),
63585
+ size = data.size;
63586
+ data.set(key, value);
63587
+ this.size += data.size == size ? 0 : 1;
63588
+ return this;
63589
+ }
62854
63590
 
62855
- newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
62856
- _context3.next = 27;
62857
- return (_libs$creatorNode2 = libs.creatorNode) === null || _libs$creatorNode2 === void 0 ? void 0 : _libs$creatorNode2.setEndpoint(newEndpoints[0]);
63591
+ var _mapCacheSet = mapCacheSet$1;
62858
63592
 
62859
- case 27:
62860
- // Update the user
62861
- newMetadata = _objectSpread2({}, user);
62862
- newMetadata.creator_node_endpoint = newEndpoints.join(',');
62863
- console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
62864
- _context3.next = 32;
62865
- return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata);
63593
+ var mapCacheClear = _mapCacheClear,
63594
+ mapCacheDelete = _mapCacheDelete,
63595
+ mapCacheGet = _mapCacheGet,
63596
+ mapCacheHas = _mapCacheHas,
63597
+ mapCacheSet = _mapCacheSet;
63598
+ /**
63599
+ * Creates a map cache object to store key-value pairs.
63600
+ *
63601
+ * @private
63602
+ * @constructor
63603
+ * @param {Array} [entries] The key-value pairs to cache.
63604
+ */
62866
63605
 
62867
- case 32:
62868
- _context3.next = 37;
62869
- break;
63606
+ function MapCache$3(entries) {
63607
+ var index = -1,
63608
+ length = entries == null ? 0 : entries.length;
63609
+ this.clear();
62870
63610
 
62871
- case 34:
62872
- _context3.prev = 34;
62873
- _context3.t0 = _context3["catch"](13);
62874
- console.error(_context3.t0);
63611
+ while (++index < length) {
63612
+ var entry = entries[index];
63613
+ this.set(entry[0], entry[1]);
63614
+ }
63615
+ } // Add methods to `MapCache`.
62875
63616
 
62876
- case 37:
62877
- case "end":
62878
- return _context3.stop();
62879
- }
62880
- }
62881
- }, _callee3, null, [[13, 34]]);
62882
- }));
62883
63617
 
62884
- return function rolloverNodes(_x6, _x7, _x8) {
62885
- return _ref3.apply(this, arguments);
63618
+ MapCache$3.prototype.clear = mapCacheClear;
63619
+ MapCache$3.prototype['delete'] = mapCacheDelete;
63620
+ MapCache$3.prototype.get = mapCacheGet;
63621
+ MapCache$3.prototype.has = mapCacheHas;
63622
+ MapCache$3.prototype.set = mapCacheSet;
63623
+ var _MapCache = MapCache$3;
63624
+
63625
+ var ListCache$1 = _ListCache,
63626
+ Map$2 = _Map,
63627
+ MapCache$2 = _MapCache;
63628
+ /** Used as the size to enable large array optimizations. */
63629
+
63630
+ var LARGE_ARRAY_SIZE = 200;
63631
+ /**
63632
+ * Sets the stack `key` to `value`.
63633
+ *
63634
+ * @private
63635
+ * @name set
63636
+ * @memberOf Stack
63637
+ * @param {string} key The key of the value to set.
63638
+ * @param {*} value The value to set.
63639
+ * @returns {Object} Returns the stack cache instance.
63640
+ */
63641
+
63642
+ function stackSet$1(key, value) {
63643
+ var data = this.__data__;
63644
+
63645
+ if (data instanceof ListCache$1) {
63646
+ var pairs = data.__data__;
63647
+
63648
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
63649
+ pairs.push([key, value]);
63650
+ this.size = ++data.size;
63651
+ return this;
63652
+ }
63653
+
63654
+ data = this.__data__ = new MapCache$2(pairs);
63655
+ }
63656
+
63657
+ data.set(key, value);
63658
+ this.size = data.size;
63659
+ return this;
63660
+ }
63661
+
63662
+ var _stackSet = stackSet$1;
63663
+
63664
+ var ListCache = _ListCache,
63665
+ stackClear = _stackClear,
63666
+ stackDelete = _stackDelete,
63667
+ stackGet = _stackGet,
63668
+ stackHas = _stackHas,
63669
+ stackSet = _stackSet;
63670
+ /**
63671
+ * Creates a stack cache object to store key-value pairs.
63672
+ *
63673
+ * @private
63674
+ * @constructor
63675
+ * @param {Array} [entries] The key-value pairs to cache.
63676
+ */
63677
+
63678
+ function Stack$2(entries) {
63679
+ var data = this.__data__ = new ListCache(entries);
63680
+ this.size = data.size;
63681
+ } // Add methods to `Stack`.
63682
+
63683
+
63684
+ Stack$2.prototype.clear = stackClear;
63685
+ Stack$2.prototype['delete'] = stackDelete;
63686
+ Stack$2.prototype.get = stackGet;
63687
+ Stack$2.prototype.has = stackHas;
63688
+ Stack$2.prototype.set = stackSet;
63689
+ var _Stack = Stack$2;
63690
+
63691
+ /** Used to stand-in for `undefined` hash values. */
63692
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
63693
+ /**
63694
+ * Adds `value` to the array cache.
63695
+ *
63696
+ * @private
63697
+ * @name add
63698
+ * @memberOf SetCache
63699
+ * @alias push
63700
+ * @param {*} value The value to cache.
63701
+ * @returns {Object} Returns the cache instance.
63702
+ */
63703
+
63704
+ function setCacheAdd$1(value) {
63705
+ this.__data__.set(value, HASH_UNDEFINED);
63706
+
63707
+ return this;
63708
+ }
63709
+
63710
+ var _setCacheAdd = setCacheAdd$1;
63711
+
63712
+ /**
63713
+ * Checks if `value` is in the array cache.
63714
+ *
63715
+ * @private
63716
+ * @name has
63717
+ * @memberOf SetCache
63718
+ * @param {*} value The value to search for.
63719
+ * @returns {number} Returns `true` if `value` is found, else `false`.
63720
+ */
63721
+
63722
+ function setCacheHas$1(value) {
63723
+ return this.__data__.has(value);
63724
+ }
63725
+
63726
+ var _setCacheHas = setCacheHas$1;
63727
+
63728
+ var MapCache$1 = _MapCache,
63729
+ setCacheAdd = _setCacheAdd,
63730
+ setCacheHas = _setCacheHas;
63731
+ /**
63732
+ *
63733
+ * Creates an array cache object to store unique values.
63734
+ *
63735
+ * @private
63736
+ * @constructor
63737
+ * @param {Array} [values] The values to cache.
63738
+ */
63739
+
63740
+ function SetCache$1(values) {
63741
+ var index = -1,
63742
+ length = values == null ? 0 : values.length;
63743
+ this.__data__ = new MapCache$1();
63744
+
63745
+ while (++index < length) {
63746
+ this.add(values[index]);
63747
+ }
63748
+ } // Add methods to `SetCache`.
63749
+
63750
+
63751
+ SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
63752
+ SetCache$1.prototype.has = setCacheHas;
63753
+ var _SetCache = SetCache$1;
63754
+
63755
+ /**
63756
+ * A specialized version of `_.some` for arrays without support for iteratee
63757
+ * shorthands.
63758
+ *
63759
+ * @private
63760
+ * @param {Array} [array] The array to iterate over.
63761
+ * @param {Function} predicate The function invoked per iteration.
63762
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
63763
+ * else `false`.
63764
+ */
63765
+
63766
+ function arraySome$1(array, predicate) {
63767
+ var index = -1,
63768
+ length = array == null ? 0 : array.length;
63769
+
63770
+ while (++index < length) {
63771
+ if (predicate(array[index], index, array)) {
63772
+ return true;
63773
+ }
63774
+ }
63775
+
63776
+ return false;
63777
+ }
63778
+
63779
+ var _arraySome = arraySome$1;
63780
+
63781
+ /**
63782
+ * Checks if a `cache` value for `key` exists.
63783
+ *
63784
+ * @private
63785
+ * @param {Object} cache The cache to query.
63786
+ * @param {string} key The key of the entry to check.
63787
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63788
+ */
63789
+
63790
+ function cacheHas$1(cache, key) {
63791
+ return cache.has(key);
63792
+ }
63793
+
63794
+ var _cacheHas = cacheHas$1;
63795
+
63796
+ var SetCache = _SetCache,
63797
+ arraySome = _arraySome,
63798
+ cacheHas = _cacheHas;
63799
+ /** Used to compose bitmasks for value comparisons. */
63800
+
63801
+ var COMPARE_PARTIAL_FLAG$5 = 1,
63802
+ COMPARE_UNORDERED_FLAG$3 = 2;
63803
+ /**
63804
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
63805
+ * partial deep comparisons.
63806
+ *
63807
+ * @private
63808
+ * @param {Array} array The array to compare.
63809
+ * @param {Array} other The other array to compare.
63810
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
63811
+ * @param {Function} customizer The function to customize comparisons.
63812
+ * @param {Function} equalFunc The function to determine equivalents of values.
63813
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
63814
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
63815
+ */
63816
+
63817
+ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
63818
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
63819
+ arrLength = array.length,
63820
+ othLength = other.length;
63821
+
63822
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
63823
+ return false;
63824
+ } // Check that cyclic values are equal.
63825
+
63826
+
63827
+ var arrStacked = stack.get(array);
63828
+ var othStacked = stack.get(other);
63829
+
63830
+ if (arrStacked && othStacked) {
63831
+ return arrStacked == other && othStacked == array;
63832
+ }
63833
+
63834
+ var index = -1,
63835
+ result = true,
63836
+ seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : undefined;
63837
+ stack.set(array, other);
63838
+ stack.set(other, array); // Ignore non-index properties.
63839
+
63840
+ while (++index < arrLength) {
63841
+ var arrValue = array[index],
63842
+ othValue = other[index];
63843
+
63844
+ if (customizer) {
63845
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
63846
+ }
63847
+
63848
+ if (compared !== undefined) {
63849
+ if (compared) {
63850
+ continue;
63851
+ }
63852
+
63853
+ result = false;
63854
+ break;
63855
+ } // Recursively compare arrays (susceptible to call stack limits).
63856
+
63857
+
63858
+ if (seen) {
63859
+ if (!arraySome(other, function (othValue, othIndex) {
63860
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
63861
+ return seen.push(othIndex);
63862
+ }
63863
+ })) {
63864
+ result = false;
63865
+ break;
63866
+ }
63867
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
63868
+ result = false;
63869
+ break;
63870
+ }
63871
+ }
63872
+
63873
+ stack['delete'](array);
63874
+ stack['delete'](other);
63875
+ return result;
63876
+ }
63877
+
63878
+ var _equalArrays = equalArrays$2;
63879
+
63880
+ var root$4 = _root;
63881
+ /** Built-in value references. */
63882
+
63883
+ var Uint8Array$2 = root$4.Uint8Array;
63884
+ var _Uint8Array = Uint8Array$2;
63885
+
63886
+ /**
63887
+ * Converts `map` to its key-value pairs.
63888
+ *
63889
+ * @private
63890
+ * @param {Object} map The map to convert.
63891
+ * @returns {Array} Returns the key-value pairs.
63892
+ */
63893
+
63894
+ function mapToArray$1(map) {
63895
+ var index = -1,
63896
+ result = Array(map.size);
63897
+ map.forEach(function (value, key) {
63898
+ result[++index] = [key, value];
63899
+ });
63900
+ return result;
63901
+ }
63902
+
63903
+ var _mapToArray = mapToArray$1;
63904
+
63905
+ /**
63906
+ * Converts `set` to an array of its values.
63907
+ *
63908
+ * @private
63909
+ * @param {Object} set The set to convert.
63910
+ * @returns {Array} Returns the values.
63911
+ */
63912
+
63913
+ function setToArray$1(set) {
63914
+ var index = -1,
63915
+ result = Array(set.size);
63916
+ set.forEach(function (value) {
63917
+ result[++index] = value;
63918
+ });
63919
+ return result;
63920
+ }
63921
+
63922
+ var _setToArray = setToArray$1;
63923
+
63924
+ var _Symbol$1 = _Symbol$4,
63925
+ Uint8Array$1 = _Uint8Array,
63926
+ eq = eq_1,
63927
+ equalArrays$1 = _equalArrays,
63928
+ mapToArray = _mapToArray,
63929
+ setToArray = _setToArray;
63930
+ /** Used to compose bitmasks for value comparisons. */
63931
+
63932
+ var COMPARE_PARTIAL_FLAG$4 = 1,
63933
+ COMPARE_UNORDERED_FLAG$2 = 2;
63934
+ /** `Object#toString` result references. */
63935
+
63936
+ var boolTag$1 = '[object Boolean]',
63937
+ dateTag$1 = '[object Date]',
63938
+ errorTag$1 = '[object Error]',
63939
+ mapTag$2 = '[object Map]',
63940
+ numberTag$1 = '[object Number]',
63941
+ regexpTag$1 = '[object RegExp]',
63942
+ setTag$2 = '[object Set]',
63943
+ stringTag$1 = '[object String]',
63944
+ symbolTag = '[object Symbol]';
63945
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
63946
+ dataViewTag$2 = '[object DataView]';
63947
+ /** Used to convert symbols to primitives and strings. */
63948
+
63949
+ var symbolProto$1 = _Symbol$1 ? _Symbol$1.prototype : undefined,
63950
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
63951
+ /**
63952
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
63953
+ * the same `toStringTag`.
63954
+ *
63955
+ * **Note:** This function only supports comparing values with tags of
63956
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
63957
+ *
63958
+ * @private
63959
+ * @param {Object} object The object to compare.
63960
+ * @param {Object} other The other object to compare.
63961
+ * @param {string} tag The `toStringTag` of the objects to compare.
63962
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
63963
+ * @param {Function} customizer The function to customize comparisons.
63964
+ * @param {Function} equalFunc The function to determine equivalents of values.
63965
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
63966
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
63967
+ */
63968
+
63969
+ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
63970
+ switch (tag) {
63971
+ case dataViewTag$2:
63972
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
63973
+ return false;
63974
+ }
63975
+
63976
+ object = object.buffer;
63977
+ other = other.buffer;
63978
+
63979
+ case arrayBufferTag$1:
63980
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
63981
+ return false;
63982
+ }
63983
+
63984
+ return true;
63985
+
63986
+ case boolTag$1:
63987
+ case dateTag$1:
63988
+ case numberTag$1:
63989
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
63990
+ // Invalid dates are coerced to `NaN`.
63991
+ return eq(+object, +other);
63992
+
63993
+ case errorTag$1:
63994
+ return object.name == other.name && object.message == other.message;
63995
+
63996
+ case regexpTag$1:
63997
+ case stringTag$1:
63998
+ // Coerce regexes to strings and treat strings, primitives and objects,
63999
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
64000
+ // for more details.
64001
+ return object == other + '';
64002
+
64003
+ case mapTag$2:
64004
+ var convert = mapToArray;
64005
+
64006
+ case setTag$2:
64007
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
64008
+ convert || (convert = setToArray);
64009
+
64010
+ if (object.size != other.size && !isPartial) {
64011
+ return false;
64012
+ } // Assume cyclic values are equal.
64013
+
64014
+
64015
+ var stacked = stack.get(object);
64016
+
64017
+ if (stacked) {
64018
+ return stacked == other;
64019
+ }
64020
+
64021
+ bitmask |= COMPARE_UNORDERED_FLAG$2; // Recursively compare objects (susceptible to call stack limits).
64022
+
64023
+ stack.set(object, other);
64024
+ var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
64025
+ stack['delete'](object);
64026
+ return result;
64027
+
64028
+ case symbolTag:
64029
+ if (symbolValueOf) {
64030
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
64031
+ }
64032
+
64033
+ }
64034
+
64035
+ return false;
64036
+ }
64037
+
64038
+ var _equalByTag = equalByTag$1;
64039
+
64040
+ /**
64041
+ * Appends the elements of `values` to `array`.
64042
+ *
64043
+ * @private
64044
+ * @param {Array} array The array to modify.
64045
+ * @param {Array} values The values to append.
64046
+ * @returns {Array} Returns `array`.
64047
+ */
64048
+
64049
+ function arrayPush$1(array, values) {
64050
+ var index = -1,
64051
+ length = values.length,
64052
+ offset = array.length;
64053
+
64054
+ while (++index < length) {
64055
+ array[offset + index] = values[index];
64056
+ }
64057
+
64058
+ return array;
64059
+ }
64060
+
64061
+ var _arrayPush = arrayPush$1;
64062
+
64063
+ /**
64064
+ * Checks if `value` is classified as an `Array` object.
64065
+ *
64066
+ * @static
64067
+ * @memberOf _
64068
+ * @since 0.1.0
64069
+ * @category Lang
64070
+ * @param {*} value The value to check.
64071
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
64072
+ * @example
64073
+ *
64074
+ * _.isArray([1, 2, 3]);
64075
+ * // => true
64076
+ *
64077
+ * _.isArray(document.body.children);
64078
+ * // => false
64079
+ *
64080
+ * _.isArray('abc');
64081
+ * // => false
64082
+ *
64083
+ * _.isArray(_.noop);
64084
+ * // => false
64085
+ */
64086
+ var isArray$8 = Array.isArray;
64087
+ var isArray_1 = isArray$8;
64088
+
64089
+ var arrayPush = _arrayPush,
64090
+ isArray$7 = isArray_1;
64091
+ /**
64092
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
64093
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
64094
+ * symbols of `object`.
64095
+ *
64096
+ * @private
64097
+ * @param {Object} object The object to query.
64098
+ * @param {Function} keysFunc The function to get the keys of `object`.
64099
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
64100
+ * @returns {Array} Returns the array of property names and symbols.
64101
+ */
64102
+
64103
+ function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
64104
+ var result = keysFunc(object);
64105
+ return isArray$7(object) ? result : arrayPush(result, symbolsFunc(object));
64106
+ }
64107
+
64108
+ var _baseGetAllKeys = baseGetAllKeys$1;
64109
+
64110
+ /**
64111
+ * A specialized version of `_.filter` for arrays without support for
64112
+ * iteratee shorthands.
64113
+ *
64114
+ * @private
64115
+ * @param {Array} [array] The array to iterate over.
64116
+ * @param {Function} predicate The function invoked per iteration.
64117
+ * @returns {Array} Returns the new filtered array.
64118
+ */
64119
+
64120
+ function arrayFilter$1(array, predicate) {
64121
+ var index = -1,
64122
+ length = array == null ? 0 : array.length,
64123
+ resIndex = 0,
64124
+ result = [];
64125
+
64126
+ while (++index < length) {
64127
+ var value = array[index];
64128
+
64129
+ if (predicate(value, index, array)) {
64130
+ result[resIndex++] = value;
64131
+ }
64132
+ }
64133
+
64134
+ return result;
64135
+ }
64136
+
64137
+ var _arrayFilter = arrayFilter$1;
64138
+
64139
+ /**
64140
+ * This method returns a new empty array.
64141
+ *
64142
+ * @static
64143
+ * @memberOf _
64144
+ * @since 4.13.0
64145
+ * @category Util
64146
+ * @returns {Array} Returns the new empty array.
64147
+ * @example
64148
+ *
64149
+ * var arrays = _.times(2, _.stubArray);
64150
+ *
64151
+ * console.log(arrays);
64152
+ * // => [[], []]
64153
+ *
64154
+ * console.log(arrays[0] === arrays[1]);
64155
+ * // => false
64156
+ */
64157
+
64158
+ function stubArray$1() {
64159
+ return [];
64160
+ }
64161
+
64162
+ var stubArray_1 = stubArray$1;
64163
+
64164
+ var arrayFilter = _arrayFilter,
64165
+ stubArray = stubArray_1;
64166
+ /** Used for built-in method references. */
64167
+
64168
+ var objectProto$6 = Object.prototype;
64169
+ /** Built-in value references. */
64170
+
64171
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
64172
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64173
+
64174
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
64175
+ /**
64176
+ * Creates an array of the own enumerable symbols of `object`.
64177
+ *
64178
+ * @private
64179
+ * @param {Object} object The object to query.
64180
+ * @returns {Array} Returns the array of symbols.
64181
+ */
64182
+
64183
+ var getSymbols$1 = !nativeGetSymbols ? stubArray : function (object) {
64184
+ if (object == null) {
64185
+ return [];
64186
+ }
64187
+
64188
+ object = Object(object);
64189
+ return arrayFilter(nativeGetSymbols(object), function (symbol) {
64190
+ return propertyIsEnumerable$1.call(object, symbol);
64191
+ });
64192
+ };
64193
+ var _getSymbols = getSymbols$1;
64194
+
64195
+ /**
64196
+ * The base implementation of `_.times` without support for iteratee shorthands
64197
+ * or max array length checks.
64198
+ *
64199
+ * @private
64200
+ * @param {number} n The number of times to invoke `iteratee`.
64201
+ * @param {Function} iteratee The function invoked per iteration.
64202
+ * @returns {Array} Returns the array of results.
64203
+ */
64204
+
64205
+ function baseTimes$1(n, iteratee) {
64206
+ var index = -1,
64207
+ result = Array(n);
64208
+
64209
+ while (++index < n) {
64210
+ result[index] = iteratee(index);
64211
+ }
64212
+
64213
+ return result;
64214
+ }
64215
+
64216
+ var _baseTimes = baseTimes$1;
64217
+
64218
+ var baseGetTag$2 = _baseGetTag,
64219
+ isObjectLike$3 = isObjectLike_1;
64220
+ /** `Object#toString` result references. */
64221
+
64222
+ var argsTag$2 = '[object Arguments]';
64223
+ /**
64224
+ * The base implementation of `_.isArguments`.
64225
+ *
64226
+ * @private
64227
+ * @param {*} value The value to check.
64228
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
64229
+ */
64230
+
64231
+ function baseIsArguments$1(value) {
64232
+ return isObjectLike$3(value) && baseGetTag$2(value) == argsTag$2;
64233
+ }
64234
+
64235
+ var _baseIsArguments = baseIsArguments$1;
64236
+
64237
+ var baseIsArguments = _baseIsArguments,
64238
+ isObjectLike$2 = isObjectLike_1;
64239
+ /** Used for built-in method references. */
64240
+
64241
+ var objectProto$5 = Object.prototype;
64242
+ /** Used to check objects for own properties. */
64243
+
64244
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
64245
+ /** Built-in value references. */
64246
+
64247
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
64248
+ /**
64249
+ * Checks if `value` is likely an `arguments` object.
64250
+ *
64251
+ * @static
64252
+ * @memberOf _
64253
+ * @since 0.1.0
64254
+ * @category Lang
64255
+ * @param {*} value The value to check.
64256
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
64257
+ * else `false`.
64258
+ * @example
64259
+ *
64260
+ * _.isArguments(function() { return arguments; }());
64261
+ * // => true
64262
+ *
64263
+ * _.isArguments([1, 2, 3]);
64264
+ * // => false
64265
+ */
64266
+
64267
+ var isArguments$2 = baseIsArguments(function () {
64268
+ return arguments;
64269
+ }()) ? baseIsArguments : function (value) {
64270
+ return isObjectLike$2(value) && hasOwnProperty$4.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
64271
+ };
64272
+ var isArguments_1 = isArguments$2;
64273
+
64274
+ var isBuffer$2 = {exports: {}};
64275
+
64276
+ /**
64277
+ * This method returns `false`.
64278
+ *
64279
+ * @static
64280
+ * @memberOf _
64281
+ * @since 4.13.0
64282
+ * @category Util
64283
+ * @returns {boolean} Returns `false`.
64284
+ * @example
64285
+ *
64286
+ * _.times(2, _.stubFalse);
64287
+ * // => [false, false]
64288
+ */
64289
+
64290
+ function stubFalse() {
64291
+ return false;
64292
+ }
64293
+
64294
+ var stubFalse_1 = stubFalse;
64295
+
64296
+ (function (module, exports) {
64297
+ var root = _root,
64298
+ stubFalse = stubFalse_1;
64299
+ /** Detect free variable `exports`. */
64300
+
64301
+ var freeExports = exports && !exports.nodeType && exports;
64302
+ /** Detect free variable `module`. */
64303
+
64304
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
64305
+ /** Detect the popular CommonJS extension `module.exports`. */
64306
+
64307
+ var moduleExports = freeModule && freeModule.exports === freeExports;
64308
+ /** Built-in value references. */
64309
+
64310
+ var Buffer = moduleExports ? root.Buffer : undefined;
64311
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64312
+
64313
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
64314
+ /**
64315
+ * Checks if `value` is a buffer.
64316
+ *
64317
+ * @static
64318
+ * @memberOf _
64319
+ * @since 4.3.0
64320
+ * @category Lang
64321
+ * @param {*} value The value to check.
64322
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
64323
+ * @example
64324
+ *
64325
+ * _.isBuffer(new Buffer(2));
64326
+ * // => true
64327
+ *
64328
+ * _.isBuffer(new Uint8Array(2));
64329
+ * // => false
64330
+ */
64331
+
64332
+ var isBuffer = nativeIsBuffer || stubFalse;
64333
+ module.exports = isBuffer;
64334
+ })(isBuffer$2, isBuffer$2.exports);
64335
+
64336
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
64337
+ /** Used to detect unsigned integer values. */
64338
+
64339
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
64340
+ /**
64341
+ * Checks if `value` is a valid array-like index.
64342
+ *
64343
+ * @private
64344
+ * @param {*} value The value to check.
64345
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
64346
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
64347
+ */
64348
+
64349
+ function isIndex$2(value, length) {
64350
+ var type = _typeof(value);
64351
+
64352
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
64353
+ return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
64354
+ }
64355
+
64356
+ var _isIndex = isIndex$2;
64357
+
64358
+ /** Used as references for various `Number` constants. */
64359
+ var MAX_SAFE_INTEGER = 9007199254740991;
64360
+ /**
64361
+ * Checks if `value` is a valid array-like length.
64362
+ *
64363
+ * **Note:** This method is loosely based on
64364
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
64365
+ *
64366
+ * @static
64367
+ * @memberOf _
64368
+ * @since 4.0.0
64369
+ * @category Lang
64370
+ * @param {*} value The value to check.
64371
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
64372
+ * @example
64373
+ *
64374
+ * _.isLength(3);
64375
+ * // => true
64376
+ *
64377
+ * _.isLength(Number.MIN_VALUE);
64378
+ * // => false
64379
+ *
64380
+ * _.isLength(Infinity);
64381
+ * // => false
64382
+ *
64383
+ * _.isLength('3');
64384
+ * // => false
64385
+ */
64386
+
64387
+ function isLength$3(value) {
64388
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
64389
+ }
64390
+
64391
+ var isLength_1 = isLength$3;
64392
+
64393
+ var baseGetTag$1 = _baseGetTag,
64394
+ isLength$2 = isLength_1,
64395
+ isObjectLike$1 = isObjectLike_1;
64396
+ /** `Object#toString` result references. */
64397
+
64398
+ var argsTag$1 = '[object Arguments]',
64399
+ arrayTag$1 = '[object Array]',
64400
+ boolTag = '[object Boolean]',
64401
+ dateTag = '[object Date]',
64402
+ errorTag = '[object Error]',
64403
+ funcTag = '[object Function]',
64404
+ mapTag$1 = '[object Map]',
64405
+ numberTag = '[object Number]',
64406
+ objectTag$2 = '[object Object]',
64407
+ regexpTag = '[object RegExp]',
64408
+ setTag$1 = '[object Set]',
64409
+ stringTag = '[object String]',
64410
+ weakMapTag$1 = '[object WeakMap]';
64411
+ var arrayBufferTag = '[object ArrayBuffer]',
64412
+ dataViewTag$1 = '[object DataView]',
64413
+ float32Tag = '[object Float32Array]',
64414
+ float64Tag = '[object Float64Array]',
64415
+ int8Tag = '[object Int8Array]',
64416
+ int16Tag = '[object Int16Array]',
64417
+ int32Tag = '[object Int32Array]',
64418
+ uint8Tag = '[object Uint8Array]',
64419
+ uint8ClampedTag = '[object Uint8ClampedArray]',
64420
+ uint16Tag = '[object Uint16Array]',
64421
+ uint32Tag = '[object Uint32Array]';
64422
+ /** Used to identify `toStringTag` values of typed arrays. */
64423
+
64424
+ var typedArrayTags = {};
64425
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
64426
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
64427
+ /**
64428
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
64429
+ *
64430
+ * @private
64431
+ * @param {*} value The value to check.
64432
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
64433
+ */
64434
+
64435
+ function baseIsTypedArray$1(value) {
64436
+ return isObjectLike$1(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$1(value)];
64437
+ }
64438
+
64439
+ var _baseIsTypedArray = baseIsTypedArray$1;
64440
+
64441
+ /**
64442
+ * The base implementation of `_.unary` without support for storing metadata.
64443
+ *
64444
+ * @private
64445
+ * @param {Function} func The function to cap arguments for.
64446
+ * @returns {Function} Returns the new capped function.
64447
+ */
64448
+
64449
+ function baseUnary$1(func) {
64450
+ return function (value) {
64451
+ return func(value);
64452
+ };
64453
+ }
64454
+
64455
+ var _baseUnary = baseUnary$1;
64456
+
64457
+ var _nodeUtil = {exports: {}};
64458
+
64459
+ (function (module, exports) {
64460
+ var freeGlobal = _freeGlobal;
64461
+ /** Detect free variable `exports`. */
64462
+
64463
+ var freeExports = exports && !exports.nodeType && exports;
64464
+ /** Detect free variable `module`. */
64465
+
64466
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
64467
+ /** Detect the popular CommonJS extension `module.exports`. */
64468
+
64469
+ var moduleExports = freeModule && freeModule.exports === freeExports;
64470
+ /** Detect free variable `process` from Node.js. */
64471
+
64472
+ var freeProcess = moduleExports && freeGlobal.process;
64473
+ /** Used to access faster Node.js helpers. */
64474
+
64475
+ var nodeUtil = function () {
64476
+ try {
64477
+ // Use `util.types` for Node.js 10+.
64478
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
64479
+
64480
+ if (types) {
64481
+ return types;
64482
+ } // Legacy `process.binding('util')` for Node.js < 10.
64483
+
64484
+
64485
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
64486
+ } catch (e) {}
64487
+ }();
64488
+
64489
+ module.exports = nodeUtil;
64490
+ })(_nodeUtil, _nodeUtil.exports);
64491
+
64492
+ var baseIsTypedArray = _baseIsTypedArray,
64493
+ baseUnary = _baseUnary,
64494
+ nodeUtil = _nodeUtil.exports;
64495
+ /* Node.js helper references. */
64496
+
64497
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
64498
+ /**
64499
+ * Checks if `value` is classified as a typed array.
64500
+ *
64501
+ * @static
64502
+ * @memberOf _
64503
+ * @since 3.0.0
64504
+ * @category Lang
64505
+ * @param {*} value The value to check.
64506
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
64507
+ * @example
64508
+ *
64509
+ * _.isTypedArray(new Uint8Array);
64510
+ * // => true
64511
+ *
64512
+ * _.isTypedArray([]);
64513
+ * // => false
64514
+ */
64515
+
64516
+ var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
64517
+ var isTypedArray_1 = isTypedArray$2;
64518
+
64519
+ var baseTimes = _baseTimes,
64520
+ isArguments$1 = isArguments_1,
64521
+ isArray$6 = isArray_1,
64522
+ isBuffer$1 = isBuffer$2.exports,
64523
+ isIndex$1 = _isIndex,
64524
+ isTypedArray$1 = isTypedArray_1;
64525
+ /** Used for built-in method references. */
64526
+
64527
+ var objectProto$4 = Object.prototype;
64528
+ /** Used to check objects for own properties. */
64529
+
64530
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
64531
+ /**
64532
+ * Creates an array of the enumerable property names of the array-like `value`.
64533
+ *
64534
+ * @private
64535
+ * @param {*} value The value to query.
64536
+ * @param {boolean} inherited Specify returning inherited property names.
64537
+ * @returns {Array} Returns the array of property names.
64538
+ */
64539
+
64540
+ function arrayLikeKeys$1(value, inherited) {
64541
+ var isArr = isArray$6(value),
64542
+ isArg = !isArr && isArguments$1(value),
64543
+ isBuff = !isArr && !isArg && isBuffer$1(value),
64544
+ isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
64545
+ skipIndexes = isArr || isArg || isBuff || isType,
64546
+ result = skipIndexes ? baseTimes(value.length, String) : [],
64547
+ length = result.length;
64548
+
64549
+ for (var key in value) {
64550
+ if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
64551
+ key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
64552
+ isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
64553
+ isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
64554
+ isIndex$1(key, length)))) {
64555
+ result.push(key);
64556
+ }
64557
+ }
64558
+
64559
+ return result;
64560
+ }
64561
+
64562
+ var _arrayLikeKeys = arrayLikeKeys$1;
64563
+
64564
+ /** Used for built-in method references. */
64565
+ var objectProto$3 = Object.prototype;
64566
+ /**
64567
+ * Checks if `value` is likely a prototype object.
64568
+ *
64569
+ * @private
64570
+ * @param {*} value The value to check.
64571
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
64572
+ */
64573
+
64574
+ function isPrototype$1(value) {
64575
+ var Ctor = value && value.constructor,
64576
+ proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$3;
64577
+ return value === proto;
64578
+ }
64579
+
64580
+ var _isPrototype = isPrototype$1;
64581
+
64582
+ /**
64583
+ * Creates a unary function that invokes `func` with its argument transformed.
64584
+ *
64585
+ * @private
64586
+ * @param {Function} func The function to wrap.
64587
+ * @param {Function} transform The argument transform.
64588
+ * @returns {Function} Returns the new function.
64589
+ */
64590
+
64591
+ function overArg$1(func, transform) {
64592
+ return function (arg) {
64593
+ return func(transform(arg));
64594
+ };
64595
+ }
64596
+
64597
+ var _overArg = overArg$1;
64598
+
64599
+ var overArg = _overArg;
64600
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64601
+
64602
+ var nativeKeys$1 = overArg(Object.keys, Object);
64603
+ var _nativeKeys = nativeKeys$1;
64604
+
64605
+ var isPrototype = _isPrototype,
64606
+ nativeKeys = _nativeKeys;
64607
+ /** Used for built-in method references. */
64608
+
64609
+ var objectProto$2 = Object.prototype;
64610
+ /** Used to check objects for own properties. */
64611
+
64612
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
64613
+ /**
64614
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
64615
+ *
64616
+ * @private
64617
+ * @param {Object} object The object to query.
64618
+ * @returns {Array} Returns the array of property names.
64619
+ */
64620
+
64621
+ function baseKeys$1(object) {
64622
+ if (!isPrototype(object)) {
64623
+ return nativeKeys(object);
64624
+ }
64625
+
64626
+ var result = [];
64627
+
64628
+ for (var key in Object(object)) {
64629
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
64630
+ result.push(key);
64631
+ }
64632
+ }
64633
+
64634
+ return result;
64635
+ }
64636
+
64637
+ var _baseKeys = baseKeys$1;
64638
+
64639
+ var isFunction = isFunction_1,
64640
+ isLength$1 = isLength_1;
64641
+ /**
64642
+ * Checks if `value` is array-like. A value is considered array-like if it's
64643
+ * not a function and has a `value.length` that's an integer greater than or
64644
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
64645
+ *
64646
+ * @static
64647
+ * @memberOf _
64648
+ * @since 4.0.0
64649
+ * @category Lang
64650
+ * @param {*} value The value to check.
64651
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
64652
+ * @example
64653
+ *
64654
+ * _.isArrayLike([1, 2, 3]);
64655
+ * // => true
64656
+ *
64657
+ * _.isArrayLike(document.body.children);
64658
+ * // => true
64659
+ *
64660
+ * _.isArrayLike('abc');
64661
+ * // => true
64662
+ *
64663
+ * _.isArrayLike(_.noop);
64664
+ * // => false
64665
+ */
64666
+
64667
+ function isArrayLike$1(value) {
64668
+ return value != null && isLength$1(value.length) && !isFunction(value);
64669
+ }
64670
+
64671
+ var isArrayLike_1 = isArrayLike$1;
64672
+
64673
+ var arrayLikeKeys = _arrayLikeKeys,
64674
+ baseKeys = _baseKeys,
64675
+ isArrayLike = isArrayLike_1;
64676
+ /**
64677
+ * Creates an array of the own enumerable property names of `object`.
64678
+ *
64679
+ * **Note:** Non-object values are coerced to objects. See the
64680
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
64681
+ * for more details.
64682
+ *
64683
+ * @static
64684
+ * @since 0.1.0
64685
+ * @memberOf _
64686
+ * @category Object
64687
+ * @param {Object} object The object to query.
64688
+ * @returns {Array} Returns the array of property names.
64689
+ * @example
64690
+ *
64691
+ * function Foo() {
64692
+ * this.a = 1;
64693
+ * this.b = 2;
64694
+ * }
64695
+ *
64696
+ * Foo.prototype.c = 3;
64697
+ *
64698
+ * _.keys(new Foo);
64699
+ * // => ['a', 'b'] (iteration order is not guaranteed)
64700
+ *
64701
+ * _.keys('hi');
64702
+ * // => ['0', '1']
64703
+ */
64704
+
64705
+ function keys$2(object) {
64706
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
64707
+ }
64708
+
64709
+ var keys_1 = keys$2;
64710
+
64711
+ var baseGetAllKeys = _baseGetAllKeys,
64712
+ getSymbols = _getSymbols,
64713
+ keys$1 = keys_1;
64714
+ /**
64715
+ * Creates an array of own enumerable property names and symbols of `object`.
64716
+ *
64717
+ * @private
64718
+ * @param {Object} object The object to query.
64719
+ * @returns {Array} Returns the array of property names and symbols.
64720
+ */
64721
+
64722
+ function getAllKeys$1(object) {
64723
+ return baseGetAllKeys(object, keys$1, getSymbols);
64724
+ }
64725
+
64726
+ var _getAllKeys = getAllKeys$1;
64727
+
64728
+ var getAllKeys = _getAllKeys;
64729
+ /** Used to compose bitmasks for value comparisons. */
64730
+
64731
+ var COMPARE_PARTIAL_FLAG$3 = 1;
64732
+ /** Used for built-in method references. */
64733
+
64734
+ var objectProto$1 = Object.prototype;
64735
+ /** Used to check objects for own properties. */
64736
+
64737
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
64738
+ /**
64739
+ * A specialized version of `baseIsEqualDeep` for objects with support for
64740
+ * partial deep comparisons.
64741
+ *
64742
+ * @private
64743
+ * @param {Object} object The object to compare.
64744
+ * @param {Object} other The other object to compare.
64745
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
64746
+ * @param {Function} customizer The function to customize comparisons.
64747
+ * @param {Function} equalFunc The function to determine equivalents of values.
64748
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
64749
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
64750
+ */
64751
+
64752
+ function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
64753
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
64754
+ objProps = getAllKeys(object),
64755
+ objLength = objProps.length,
64756
+ othProps = getAllKeys(other),
64757
+ othLength = othProps.length;
64758
+
64759
+ if (objLength != othLength && !isPartial) {
64760
+ return false;
64761
+ }
64762
+
64763
+ var index = objLength;
64764
+
64765
+ while (index--) {
64766
+ var key = objProps[index];
64767
+
64768
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
64769
+ return false;
64770
+ }
64771
+ } // Check that cyclic values are equal.
64772
+
64773
+
64774
+ var objStacked = stack.get(object);
64775
+ var othStacked = stack.get(other);
64776
+
64777
+ if (objStacked && othStacked) {
64778
+ return objStacked == other && othStacked == object;
64779
+ }
64780
+
64781
+ var result = true;
64782
+ stack.set(object, other);
64783
+ stack.set(other, object);
64784
+ var skipCtor = isPartial;
64785
+
64786
+ while (++index < objLength) {
64787
+ key = objProps[index];
64788
+ var objValue = object[key],
64789
+ othValue = other[key];
64790
+
64791
+ if (customizer) {
64792
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
64793
+ } // Recursively compare objects (susceptible to call stack limits).
64794
+
64795
+
64796
+ if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
64797
+ result = false;
64798
+ break;
64799
+ }
64800
+
64801
+ skipCtor || (skipCtor = key == 'constructor');
64802
+ }
64803
+
64804
+ if (result && !skipCtor) {
64805
+ var objCtor = object.constructor,
64806
+ othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
64807
+
64808
+ if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
64809
+ result = false;
64810
+ }
64811
+ }
64812
+
64813
+ stack['delete'](object);
64814
+ stack['delete'](other);
64815
+ return result;
64816
+ }
64817
+
64818
+ var _equalObjects = equalObjects$1;
64819
+
64820
+ var getNative$3 = _getNative,
64821
+ root$3 = _root;
64822
+ /* Built-in method references that are verified to be native. */
64823
+
64824
+ var DataView$1 = getNative$3(root$3, 'DataView');
64825
+ var _DataView = DataView$1;
64826
+
64827
+ var getNative$2 = _getNative,
64828
+ root$2 = _root;
64829
+ /* Built-in method references that are verified to be native. */
64830
+
64831
+ var Promise$2 = getNative$2(root$2, 'Promise');
64832
+ var _Promise = Promise$2;
64833
+
64834
+ var getNative$1 = _getNative,
64835
+ root$1 = _root;
64836
+ /* Built-in method references that are verified to be native. */
64837
+
64838
+ var Set$2 = getNative$1(root$1, 'Set');
64839
+ var _Set = Set$2;
64840
+
64841
+ var getNative = _getNative,
64842
+ root = _root;
64843
+ /* Built-in method references that are verified to be native. */
64844
+
64845
+ var WeakMap$2 = getNative(root, 'WeakMap');
64846
+ var _WeakMap = WeakMap$2;
64847
+
64848
+ var DataView = _DataView,
64849
+ Map$1 = _Map,
64850
+ Promise$1 = _Promise,
64851
+ Set$1 = _Set,
64852
+ WeakMap$1 = _WeakMap,
64853
+ baseGetTag = _baseGetTag,
64854
+ toSource = _toSource;
64855
+ /** `Object#toString` result references. */
64856
+
64857
+ var mapTag = '[object Map]',
64858
+ objectTag$1 = '[object Object]',
64859
+ promiseTag = '[object Promise]',
64860
+ setTag = '[object Set]',
64861
+ weakMapTag = '[object WeakMap]';
64862
+ var dataViewTag = '[object DataView]';
64863
+ /** Used to detect maps, sets, and weakmaps. */
64864
+
64865
+ var dataViewCtorString = toSource(DataView),
64866
+ mapCtorString = toSource(Map$1),
64867
+ promiseCtorString = toSource(Promise$1),
64868
+ setCtorString = toSource(Set$1),
64869
+ weakMapCtorString = toSource(WeakMap$1);
64870
+ /**
64871
+ * Gets the `toStringTag` of `value`.
64872
+ *
64873
+ * @private
64874
+ * @param {*} value The value to query.
64875
+ * @returns {string} Returns the `toStringTag`.
64876
+ */
64877
+
64878
+ var getTag$1 = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
64879
+
64880
+ if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$1 && getTag$1(new Set$1()) != setTag || WeakMap$1 && getTag$1(new WeakMap$1()) != weakMapTag) {
64881
+ getTag$1 = function getTag(value) {
64882
+ var result = baseGetTag(value),
64883
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
64884
+ ctorString = Ctor ? toSource(Ctor) : '';
64885
+
64886
+ if (ctorString) {
64887
+ switch (ctorString) {
64888
+ case dataViewCtorString:
64889
+ return dataViewTag;
64890
+
64891
+ case mapCtorString:
64892
+ return mapTag;
64893
+
64894
+ case promiseCtorString:
64895
+ return promiseTag;
64896
+
64897
+ case setCtorString:
64898
+ return setTag;
64899
+
64900
+ case weakMapCtorString:
64901
+ return weakMapTag;
64902
+ }
64903
+ }
64904
+
64905
+ return result;
64906
+ };
64907
+ }
64908
+
64909
+ var _getTag = getTag$1;
64910
+
64911
+ var Stack$1 = _Stack,
64912
+ equalArrays = _equalArrays,
64913
+ equalByTag = _equalByTag,
64914
+ equalObjects = _equalObjects,
64915
+ getTag = _getTag,
64916
+ isArray$5 = isArray_1,
64917
+ isBuffer = isBuffer$2.exports,
64918
+ isTypedArray = isTypedArray_1;
64919
+ /** Used to compose bitmasks for value comparisons. */
64920
+
64921
+ var COMPARE_PARTIAL_FLAG$2 = 1;
64922
+ /** `Object#toString` result references. */
64923
+
64924
+ var argsTag = '[object Arguments]',
64925
+ arrayTag = '[object Array]',
64926
+ objectTag = '[object Object]';
64927
+ /** Used for built-in method references. */
64928
+
64929
+ var objectProto = Object.prototype;
64930
+ /** Used to check objects for own properties. */
64931
+
64932
+ var hasOwnProperty = objectProto.hasOwnProperty;
64933
+ /**
64934
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
64935
+ * deep comparisons and tracks traversed objects enabling objects with circular
64936
+ * references to be compared.
64937
+ *
64938
+ * @private
64939
+ * @param {Object} object The object to compare.
64940
+ * @param {Object} other The other object to compare.
64941
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
64942
+ * @param {Function} customizer The function to customize comparisons.
64943
+ * @param {Function} equalFunc The function to determine equivalents of values.
64944
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
64945
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
64946
+ */
64947
+
64948
+ function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
64949
+ var objIsArr = isArray$5(object),
64950
+ othIsArr = isArray$5(other),
64951
+ objTag = objIsArr ? arrayTag : getTag(object),
64952
+ othTag = othIsArr ? arrayTag : getTag(other);
64953
+ objTag = objTag == argsTag ? objectTag : objTag;
64954
+ othTag = othTag == argsTag ? objectTag : othTag;
64955
+ var objIsObj = objTag == objectTag,
64956
+ othIsObj = othTag == objectTag,
64957
+ isSameTag = objTag == othTag;
64958
+
64959
+ if (isSameTag && isBuffer(object)) {
64960
+ if (!isBuffer(other)) {
64961
+ return false;
64962
+ }
64963
+
64964
+ objIsArr = true;
64965
+ objIsObj = false;
64966
+ }
64967
+
64968
+ if (isSameTag && !objIsObj) {
64969
+ stack || (stack = new Stack$1());
64970
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
64971
+ }
64972
+
64973
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
64974
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
64975
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
64976
+
64977
+ if (objIsWrapped || othIsWrapped) {
64978
+ var objUnwrapped = objIsWrapped ? object.value() : object,
64979
+ othUnwrapped = othIsWrapped ? other.value() : other;
64980
+ stack || (stack = new Stack$1());
64981
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
64982
+ }
64983
+ }
64984
+
64985
+ if (!isSameTag) {
64986
+ return false;
64987
+ }
64988
+
64989
+ stack || (stack = new Stack$1());
64990
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
64991
+ }
64992
+
64993
+ var _baseIsEqualDeep = baseIsEqualDeep$1;
64994
+
64995
+ var baseIsEqualDeep = _baseIsEqualDeep,
64996
+ isObjectLike = isObjectLike_1;
64997
+ /**
64998
+ * The base implementation of `_.isEqual` which supports partial comparisons
64999
+ * and tracks traversed objects.
65000
+ *
65001
+ * @private
65002
+ * @param {*} value The value to compare.
65003
+ * @param {*} other The other value to compare.
65004
+ * @param {boolean} bitmask The bitmask flags.
65005
+ * 1 - Unordered comparison
65006
+ * 2 - Partial comparison
65007
+ * @param {Function} [customizer] The function to customize comparisons.
65008
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
65009
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
65010
+ */
65011
+
65012
+ function baseIsEqual$2(value, other, bitmask, customizer, stack) {
65013
+ if (value === other) {
65014
+ return true;
65015
+ }
65016
+
65017
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
65018
+ return value !== value && other !== other;
65019
+ }
65020
+
65021
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
65022
+ }
65023
+
65024
+ var _baseIsEqual = baseIsEqual$2;
65025
+
65026
+ var Stack = _Stack,
65027
+ baseIsEqual$1 = _baseIsEqual;
65028
+ /** Used to compose bitmasks for value comparisons. */
65029
+
65030
+ var COMPARE_PARTIAL_FLAG$1 = 1,
65031
+ COMPARE_UNORDERED_FLAG$1 = 2;
65032
+ /**
65033
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
65034
+ *
65035
+ * @private
65036
+ * @param {Object} object The object to inspect.
65037
+ * @param {Object} source The object of property values to match.
65038
+ * @param {Array} matchData The property names, values, and compare flags to match.
65039
+ * @param {Function} [customizer] The function to customize comparisons.
65040
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
65041
+ */
65042
+
65043
+ function baseIsMatch$1(object, source, matchData, customizer) {
65044
+ var index = matchData.length,
65045
+ length = index,
65046
+ noCustomizer = !customizer;
65047
+
65048
+ if (object == null) {
65049
+ return !length;
65050
+ }
65051
+
65052
+ object = Object(object);
65053
+
65054
+ while (index--) {
65055
+ var data = matchData[index];
65056
+
65057
+ if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
65058
+ return false;
65059
+ }
65060
+ }
65061
+
65062
+ while (++index < length) {
65063
+ data = matchData[index];
65064
+ var key = data[0],
65065
+ objValue = object[key],
65066
+ srcValue = data[1];
65067
+
65068
+ if (noCustomizer && data[2]) {
65069
+ if (objValue === undefined && !(key in object)) {
65070
+ return false;
65071
+ }
65072
+ } else {
65073
+ var stack = new Stack();
65074
+
65075
+ if (customizer) {
65076
+ var result = customizer(objValue, srcValue, key, object, source, stack);
65077
+ }
65078
+
65079
+ if (!(result === undefined ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
65080
+ return false;
65081
+ }
65082
+ }
65083
+ }
65084
+
65085
+ return true;
65086
+ }
65087
+
65088
+ var _baseIsMatch = baseIsMatch$1;
65089
+
65090
+ var isObject = isObject_1;
65091
+ /**
65092
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
65093
+ *
65094
+ * @private
65095
+ * @param {*} value The value to check.
65096
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
65097
+ * equality comparisons, else `false`.
65098
+ */
65099
+
65100
+ function isStrictComparable$2(value) {
65101
+ return value === value && !isObject(value);
65102
+ }
65103
+
65104
+ var _isStrictComparable = isStrictComparable$2;
65105
+
65106
+ var isStrictComparable$1 = _isStrictComparable,
65107
+ keys = keys_1;
65108
+ /**
65109
+ * Gets the property names, values, and compare flags of `object`.
65110
+ *
65111
+ * @private
65112
+ * @param {Object} object The object to query.
65113
+ * @returns {Array} Returns the match data of `object`.
65114
+ */
65115
+
65116
+ function getMatchData$1(object) {
65117
+ var result = keys(object),
65118
+ length = result.length;
65119
+
65120
+ while (length--) {
65121
+ var key = result[length],
65122
+ value = object[key];
65123
+ result[length] = [key, value, isStrictComparable$1(value)];
65124
+ }
65125
+
65126
+ return result;
65127
+ }
65128
+
65129
+ var _getMatchData = getMatchData$1;
65130
+
65131
+ /**
65132
+ * A specialized version of `matchesProperty` for source values suitable
65133
+ * for strict equality comparisons, i.e. `===`.
65134
+ *
65135
+ * @private
65136
+ * @param {string} key The key of the property to get.
65137
+ * @param {*} srcValue The value to match.
65138
+ * @returns {Function} Returns the new spec function.
65139
+ */
65140
+
65141
+ function matchesStrictComparable$2(key, srcValue) {
65142
+ return function (object) {
65143
+ if (object == null) {
65144
+ return false;
65145
+ }
65146
+
65147
+ return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
65148
+ };
65149
+ }
65150
+
65151
+ var _matchesStrictComparable = matchesStrictComparable$2;
65152
+
65153
+ var baseIsMatch = _baseIsMatch,
65154
+ getMatchData = _getMatchData,
65155
+ matchesStrictComparable$1 = _matchesStrictComparable;
65156
+ /**
65157
+ * The base implementation of `_.matches` which doesn't clone `source`.
65158
+ *
65159
+ * @private
65160
+ * @param {Object} source The object of property values to match.
65161
+ * @returns {Function} Returns the new spec function.
65162
+ */
65163
+
65164
+ function baseMatches$1(source) {
65165
+ var matchData = getMatchData(source);
65166
+
65167
+ if (matchData.length == 1 && matchData[0][2]) {
65168
+ return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
65169
+ }
65170
+
65171
+ return function (object) {
65172
+ return object === source || baseIsMatch(object, source, matchData);
65173
+ };
65174
+ }
65175
+
65176
+ var _baseMatches = baseMatches$1;
65177
+
65178
+ var isArray$4 = isArray_1,
65179
+ isSymbol$2 = isSymbol_1;
65180
+ /** Used to match property names within property paths. */
65181
+
65182
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
65183
+ reIsPlainProp = /^\w*$/;
65184
+ /**
65185
+ * Checks if `value` is a property name and not a property path.
65186
+ *
65187
+ * @private
65188
+ * @param {*} value The value to check.
65189
+ * @param {Object} [object] The object to query keys on.
65190
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
65191
+ */
65192
+
65193
+ function isKey$3(value, object) {
65194
+ if (isArray$4(value)) {
65195
+ return false;
65196
+ }
65197
+
65198
+ var type = _typeof(value);
65199
+
65200
+ if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol$2(value)) {
65201
+ return true;
65202
+ }
65203
+
65204
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
65205
+ }
65206
+
65207
+ var _isKey = isKey$3;
65208
+
65209
+ var MapCache = _MapCache;
65210
+ /** Error message constants. */
65211
+
65212
+ var FUNC_ERROR_TEXT = 'Expected a function';
65213
+ /**
65214
+ * Creates a function that memoizes the result of `func`. If `resolver` is
65215
+ * provided, it determines the cache key for storing the result based on the
65216
+ * arguments provided to the memoized function. By default, the first argument
65217
+ * provided to the memoized function is used as the map cache key. The `func`
65218
+ * is invoked with the `this` binding of the memoized function.
65219
+ *
65220
+ * **Note:** The cache is exposed as the `cache` property on the memoized
65221
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
65222
+ * constructor with one whose instances implement the
65223
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
65224
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
65225
+ *
65226
+ * @static
65227
+ * @memberOf _
65228
+ * @since 0.1.0
65229
+ * @category Function
65230
+ * @param {Function} func The function to have its output memoized.
65231
+ * @param {Function} [resolver] The function to resolve the cache key.
65232
+ * @returns {Function} Returns the new memoized function.
65233
+ * @example
65234
+ *
65235
+ * var object = { 'a': 1, 'b': 2 };
65236
+ * var other = { 'c': 3, 'd': 4 };
65237
+ *
65238
+ * var values = _.memoize(_.values);
65239
+ * values(object);
65240
+ * // => [1, 2]
65241
+ *
65242
+ * values(other);
65243
+ * // => [3, 4]
65244
+ *
65245
+ * object.a = 2;
65246
+ * values(object);
65247
+ * // => [1, 2]
65248
+ *
65249
+ * // Modify the result cache.
65250
+ * values.cache.set(object, ['a', 'b']);
65251
+ * values(object);
65252
+ * // => ['a', 'b']
65253
+ *
65254
+ * // Replace `_.memoize.Cache`.
65255
+ * _.memoize.Cache = WeakMap;
65256
+ */
65257
+
65258
+ function memoize$1(func, resolver) {
65259
+ if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
65260
+ throw new TypeError(FUNC_ERROR_TEXT);
65261
+ }
65262
+
65263
+ var memoized = function memoized() {
65264
+ var args = arguments,
65265
+ key = resolver ? resolver.apply(this, args) : args[0],
65266
+ cache = memoized.cache;
65267
+
65268
+ if (cache.has(key)) {
65269
+ return cache.get(key);
65270
+ }
65271
+
65272
+ var result = func.apply(this, args);
65273
+ memoized.cache = cache.set(key, result) || cache;
65274
+ return result;
65275
+ };
65276
+
65277
+ memoized.cache = new (memoize$1.Cache || MapCache)();
65278
+ return memoized;
65279
+ } // Expose `MapCache`.
65280
+
65281
+
65282
+ memoize$1.Cache = MapCache;
65283
+ var memoize_1 = memoize$1;
65284
+
65285
+ var memoize = memoize_1;
65286
+ /** Used as the maximum memoize cache size. */
65287
+
65288
+ var MAX_MEMOIZE_SIZE = 500;
65289
+ /**
65290
+ * A specialized version of `_.memoize` which clears the memoized function's
65291
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
65292
+ *
65293
+ * @private
65294
+ * @param {Function} func The function to have its output memoized.
65295
+ * @returns {Function} Returns the new memoized function.
65296
+ */
65297
+
65298
+ function memoizeCapped$1(func) {
65299
+ var result = memoize(func, function (key) {
65300
+ if (cache.size === MAX_MEMOIZE_SIZE) {
65301
+ cache.clear();
65302
+ }
65303
+
65304
+ return key;
65305
+ });
65306
+ var cache = result.cache;
65307
+ return result;
65308
+ }
65309
+
65310
+ var _memoizeCapped = memoizeCapped$1;
65311
+
65312
+ var memoizeCapped = _memoizeCapped;
65313
+ /** Used to match property names within property paths. */
65314
+
65315
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
65316
+ /** Used to match backslashes in property paths. */
65317
+
65318
+ var reEscapeChar = /\\(\\)?/g;
65319
+ /**
65320
+ * Converts `string` to a property path array.
65321
+ *
65322
+ * @private
65323
+ * @param {string} string The string to convert.
65324
+ * @returns {Array} Returns the property path array.
65325
+ */
65326
+
65327
+ var stringToPath$1 = memoizeCapped(function (string) {
65328
+ var result = [];
65329
+
65330
+ if (string.charCodeAt(0) === 46
65331
+ /* . */
65332
+ ) {
65333
+ result.push('');
65334
+ }
65335
+
65336
+ string.replace(rePropName, function (match, number, quote, subString) {
65337
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
65338
+ });
65339
+ return result;
65340
+ });
65341
+ var _stringToPath = stringToPath$1;
65342
+
65343
+ /**
65344
+ * A specialized version of `_.map` for arrays without support for iteratee
65345
+ * shorthands.
65346
+ *
65347
+ * @private
65348
+ * @param {Array} [array] The array to iterate over.
65349
+ * @param {Function} iteratee The function invoked per iteration.
65350
+ * @returns {Array} Returns the new mapped array.
65351
+ */
65352
+
65353
+ function arrayMap$1(array, iteratee) {
65354
+ var index = -1,
65355
+ length = array == null ? 0 : array.length,
65356
+ result = Array(length);
65357
+
65358
+ while (++index < length) {
65359
+ result[index] = iteratee(array[index], index, array);
65360
+ }
65361
+
65362
+ return result;
65363
+ }
65364
+
65365
+ var _arrayMap = arrayMap$1;
65366
+
65367
+ var _Symbol = _Symbol$4,
65368
+ arrayMap = _arrayMap,
65369
+ isArray$3 = isArray_1,
65370
+ isSymbol$1 = isSymbol_1;
65371
+ /** Used as references for various `Number` constants. */
65372
+
65373
+ var INFINITY$1 = 1 / 0;
65374
+ /** Used to convert symbols to primitives and strings. */
65375
+
65376
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
65377
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
65378
+ /**
65379
+ * The base implementation of `_.toString` which doesn't convert nullish
65380
+ * values to empty strings.
65381
+ *
65382
+ * @private
65383
+ * @param {*} value The value to process.
65384
+ * @returns {string} Returns the string.
65385
+ */
65386
+
65387
+ function baseToString$1(value) {
65388
+ // Exit early for strings to avoid a performance hit in some environments.
65389
+ if (typeof value == 'string') {
65390
+ return value;
65391
+ }
65392
+
65393
+ if (isArray$3(value)) {
65394
+ // Recursively convert values (susceptible to call stack limits).
65395
+ return arrayMap(value, baseToString$1) + '';
65396
+ }
65397
+
65398
+ if (isSymbol$1(value)) {
65399
+ return symbolToString ? symbolToString.call(value) : '';
65400
+ }
65401
+
65402
+ var result = value + '';
65403
+ return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result;
65404
+ }
65405
+
65406
+ var _baseToString = baseToString$1;
65407
+
65408
+ var baseToString = _baseToString;
65409
+ /**
65410
+ * Converts `value` to a string. An empty string is returned for `null`
65411
+ * and `undefined` values. The sign of `-0` is preserved.
65412
+ *
65413
+ * @static
65414
+ * @memberOf _
65415
+ * @since 4.0.0
65416
+ * @category Lang
65417
+ * @param {*} value The value to convert.
65418
+ * @returns {string} Returns the converted string.
65419
+ * @example
65420
+ *
65421
+ * _.toString(null);
65422
+ * // => ''
65423
+ *
65424
+ * _.toString(-0);
65425
+ * // => '-0'
65426
+ *
65427
+ * _.toString([1, 2, 3]);
65428
+ * // => '1,2,3'
65429
+ */
65430
+
65431
+ function toString$1(value) {
65432
+ return value == null ? '' : baseToString(value);
65433
+ }
65434
+
65435
+ var toString_1 = toString$1;
65436
+
65437
+ var isArray$2 = isArray_1,
65438
+ isKey$2 = _isKey,
65439
+ stringToPath = _stringToPath,
65440
+ toString = toString_1;
65441
+ /**
65442
+ * Casts `value` to a path array if it's not one.
65443
+ *
65444
+ * @private
65445
+ * @param {*} value The value to inspect.
65446
+ * @param {Object} [object] The object to query keys on.
65447
+ * @returns {Array} Returns the cast property path array.
65448
+ */
65449
+
65450
+ function castPath$2(value, object) {
65451
+ if (isArray$2(value)) {
65452
+ return value;
65453
+ }
65454
+
65455
+ return isKey$2(value, object) ? [value] : stringToPath(toString(value));
65456
+ }
65457
+
65458
+ var _castPath = castPath$2;
65459
+
65460
+ var isSymbol = isSymbol_1;
65461
+ /** Used as references for various `Number` constants. */
65462
+
65463
+ var INFINITY = 1 / 0;
65464
+ /**
65465
+ * Converts `value` to a string key if it's not a string or symbol.
65466
+ *
65467
+ * @private
65468
+ * @param {*} value The value to inspect.
65469
+ * @returns {string|symbol} Returns the key.
65470
+ */
65471
+
65472
+ function toKey$4(value) {
65473
+ if (typeof value == 'string' || isSymbol(value)) {
65474
+ return value;
65475
+ }
65476
+
65477
+ var result = value + '';
65478
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
65479
+ }
65480
+
65481
+ var _toKey = toKey$4;
65482
+
65483
+ var castPath$1 = _castPath,
65484
+ toKey$3 = _toKey;
65485
+ /**
65486
+ * The base implementation of `_.get` without support for default values.
65487
+ *
65488
+ * @private
65489
+ * @param {Object} object The object to query.
65490
+ * @param {Array|string} path The path of the property to get.
65491
+ * @returns {*} Returns the resolved value.
65492
+ */
65493
+
65494
+ function baseGet$2(object, path) {
65495
+ path = castPath$1(path, object);
65496
+ var index = 0,
65497
+ length = path.length;
65498
+
65499
+ while (object != null && index < length) {
65500
+ object = object[toKey$3(path[index++])];
65501
+ }
65502
+
65503
+ return index && index == length ? object : undefined;
65504
+ }
65505
+
65506
+ var _baseGet = baseGet$2;
65507
+
65508
+ var baseGet$1 = _baseGet;
65509
+ /**
65510
+ * Gets the value at `path` of `object`. If the resolved value is
65511
+ * `undefined`, the `defaultValue` is returned in its place.
65512
+ *
65513
+ * @static
65514
+ * @memberOf _
65515
+ * @since 3.7.0
65516
+ * @category Object
65517
+ * @param {Object} object The object to query.
65518
+ * @param {Array|string} path The path of the property to get.
65519
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
65520
+ * @returns {*} Returns the resolved value.
65521
+ * @example
65522
+ *
65523
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
65524
+ *
65525
+ * _.get(object, 'a[0].b.c');
65526
+ * // => 3
65527
+ *
65528
+ * _.get(object, ['a', '0', 'b', 'c']);
65529
+ * // => 3
65530
+ *
65531
+ * _.get(object, 'a.b.c', 'default');
65532
+ * // => 'default'
65533
+ */
65534
+
65535
+ function get$1(object, path, defaultValue) {
65536
+ var result = object == null ? undefined : baseGet$1(object, path);
65537
+ return result === undefined ? defaultValue : result;
65538
+ }
65539
+
65540
+ var get_1 = get$1;
65541
+
65542
+ /**
65543
+ * The base implementation of `_.hasIn` without support for deep paths.
65544
+ *
65545
+ * @private
65546
+ * @param {Object} [object] The object to query.
65547
+ * @param {Array|string} key The key to check.
65548
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
65549
+ */
65550
+
65551
+ function baseHasIn$1(object, key) {
65552
+ return object != null && key in Object(object);
65553
+ }
65554
+
65555
+ var _baseHasIn = baseHasIn$1;
65556
+
65557
+ var castPath = _castPath,
65558
+ isArguments = isArguments_1,
65559
+ isArray$1 = isArray_1,
65560
+ isIndex = _isIndex,
65561
+ isLength = isLength_1,
65562
+ toKey$2 = _toKey;
65563
+ /**
65564
+ * Checks if `path` exists on `object`.
65565
+ *
65566
+ * @private
65567
+ * @param {Object} object The object to query.
65568
+ * @param {Array|string} path The path to check.
65569
+ * @param {Function} hasFunc The function to check properties.
65570
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
65571
+ */
65572
+
65573
+ function hasPath$1(object, path, hasFunc) {
65574
+ path = castPath(path, object);
65575
+ var index = -1,
65576
+ length = path.length,
65577
+ result = false;
65578
+
65579
+ while (++index < length) {
65580
+ var key = toKey$2(path[index]);
65581
+
65582
+ if (!(result = object != null && hasFunc(object, key))) {
65583
+ break;
65584
+ }
65585
+
65586
+ object = object[key];
65587
+ }
65588
+
65589
+ if (result || ++index != length) {
65590
+ return result;
65591
+ }
65592
+
65593
+ length = object == null ? 0 : object.length;
65594
+ return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments(object));
65595
+ }
65596
+
65597
+ var _hasPath = hasPath$1;
65598
+
65599
+ var baseHasIn = _baseHasIn,
65600
+ hasPath = _hasPath;
65601
+ /**
65602
+ * Checks if `path` is a direct or inherited property of `object`.
65603
+ *
65604
+ * @static
65605
+ * @memberOf _
65606
+ * @since 4.0.0
65607
+ * @category Object
65608
+ * @param {Object} object The object to query.
65609
+ * @param {Array|string} path The path to check.
65610
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
65611
+ * @example
65612
+ *
65613
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
65614
+ *
65615
+ * _.hasIn(object, 'a');
65616
+ * // => true
65617
+ *
65618
+ * _.hasIn(object, 'a.b');
65619
+ * // => true
65620
+ *
65621
+ * _.hasIn(object, ['a', 'b']);
65622
+ * // => true
65623
+ *
65624
+ * _.hasIn(object, 'b');
65625
+ * // => false
65626
+ */
65627
+
65628
+ function hasIn$1(object, path) {
65629
+ return object != null && hasPath(object, path, baseHasIn);
65630
+ }
65631
+
65632
+ var hasIn_1 = hasIn$1;
65633
+
65634
+ var baseIsEqual = _baseIsEqual,
65635
+ get = get_1,
65636
+ hasIn = hasIn_1,
65637
+ isKey$1 = _isKey,
65638
+ isStrictComparable = _isStrictComparable,
65639
+ matchesStrictComparable = _matchesStrictComparable,
65640
+ toKey$1 = _toKey;
65641
+ /** Used to compose bitmasks for value comparisons. */
65642
+
65643
+ var COMPARE_PARTIAL_FLAG = 1,
65644
+ COMPARE_UNORDERED_FLAG = 2;
65645
+ /**
65646
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
65647
+ *
65648
+ * @private
65649
+ * @param {string} path The path of the property to get.
65650
+ * @param {*} srcValue The value to match.
65651
+ * @returns {Function} Returns the new spec function.
65652
+ */
65653
+
65654
+ function baseMatchesProperty$1(path, srcValue) {
65655
+ if (isKey$1(path) && isStrictComparable(srcValue)) {
65656
+ return matchesStrictComparable(toKey$1(path), srcValue);
65657
+ }
65658
+
65659
+ return function (object) {
65660
+ var objValue = get(object, path);
65661
+ return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
65662
+ };
65663
+ }
65664
+
65665
+ var _baseMatchesProperty = baseMatchesProperty$1;
65666
+
65667
+ /**
65668
+ * This method returns the first argument it receives.
65669
+ *
65670
+ * @static
65671
+ * @since 0.1.0
65672
+ * @memberOf _
65673
+ * @category Util
65674
+ * @param {*} value Any value.
65675
+ * @returns {*} Returns `value`.
65676
+ * @example
65677
+ *
65678
+ * var object = { 'a': 1 };
65679
+ *
65680
+ * console.log(_.identity(object) === object);
65681
+ * // => true
65682
+ */
65683
+
65684
+ function identity$1(value) {
65685
+ return value;
65686
+ }
65687
+
65688
+ var identity_1 = identity$1;
65689
+
65690
+ /**
65691
+ * The base implementation of `_.property` without support for deep paths.
65692
+ *
65693
+ * @private
65694
+ * @param {string} key The key of the property to get.
65695
+ * @returns {Function} Returns the new accessor function.
65696
+ */
65697
+
65698
+ function baseProperty$1(key) {
65699
+ return function (object) {
65700
+ return object == null ? undefined : object[key];
65701
+ };
65702
+ }
65703
+
65704
+ var _baseProperty = baseProperty$1;
65705
+
65706
+ var baseGet = _baseGet;
65707
+ /**
65708
+ * A specialized version of `baseProperty` which supports deep paths.
65709
+ *
65710
+ * @private
65711
+ * @param {Array|string} path The path of the property to get.
65712
+ * @returns {Function} Returns the new accessor function.
65713
+ */
65714
+
65715
+ function basePropertyDeep$1(path) {
65716
+ return function (object) {
65717
+ return baseGet(object, path);
65718
+ };
65719
+ }
65720
+
65721
+ var _basePropertyDeep = basePropertyDeep$1;
65722
+
65723
+ var baseProperty = _baseProperty,
65724
+ basePropertyDeep = _basePropertyDeep,
65725
+ isKey = _isKey,
65726
+ toKey = _toKey;
65727
+ /**
65728
+ * Creates a function that returns the value at `path` of a given object.
65729
+ *
65730
+ * @static
65731
+ * @memberOf _
65732
+ * @since 2.4.0
65733
+ * @category Util
65734
+ * @param {Array|string} path The path of the property to get.
65735
+ * @returns {Function} Returns the new accessor function.
65736
+ * @example
65737
+ *
65738
+ * var objects = [
65739
+ * { 'a': { 'b': 2 } },
65740
+ * { 'a': { 'b': 1 } }
65741
+ * ];
65742
+ *
65743
+ * _.map(objects, _.property('a.b'));
65744
+ * // => [2, 1]
65745
+ *
65746
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
65747
+ * // => [1, 2]
65748
+ */
65749
+
65750
+ function property$1(path) {
65751
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
65752
+ }
65753
+
65754
+ var property_1 = property$1;
65755
+
65756
+ var baseMatches = _baseMatches,
65757
+ baseMatchesProperty = _baseMatchesProperty,
65758
+ identity = identity_1,
65759
+ isArray = isArray_1,
65760
+ property = property_1;
65761
+ /**
65762
+ * The base implementation of `_.iteratee`.
65763
+ *
65764
+ * @private
65765
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
65766
+ * @returns {Function} Returns the iteratee.
65767
+ */
65768
+
65769
+ function baseIteratee$1(value) {
65770
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
65771
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
65772
+ if (typeof value == 'function') {
65773
+ return value;
65774
+ }
65775
+
65776
+ if (value == null) {
65777
+ return identity;
65778
+ }
65779
+
65780
+ if (_typeof(value) == 'object') {
65781
+ return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
65782
+ }
65783
+
65784
+ return property(value);
65785
+ }
65786
+
65787
+ var _baseIteratee = baseIteratee$1;
65788
+
65789
+ var baseExtremum = _baseExtremum,
65790
+ baseGt = _baseGt,
65791
+ baseIteratee = _baseIteratee;
65792
+ /**
65793
+ * This method is like `_.max` except that it accepts `iteratee` which is
65794
+ * invoked for each element in `array` to generate the criterion by which
65795
+ * the value is ranked. The iteratee is invoked with one argument: (value).
65796
+ *
65797
+ * @static
65798
+ * @memberOf _
65799
+ * @since 4.0.0
65800
+ * @category Math
65801
+ * @param {Array} array The array to iterate over.
65802
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
65803
+ * @returns {*} Returns the maximum value.
65804
+ * @example
65805
+ *
65806
+ * var objects = [{ 'n': 1 }, { 'n': 2 }];
65807
+ *
65808
+ * _.maxBy(objects, function(o) { return o.n; });
65809
+ * // => { 'n': 2 }
65810
+ *
65811
+ * // The `_.property` iteratee shorthand.
65812
+ * _.maxBy(objects, 'n');
65813
+ * // => { 'n': 2 }
65814
+ */
65815
+
65816
+ function maxBy(array, iteratee) {
65817
+ return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : undefined;
65818
+ }
65819
+
65820
+ var maxBy_1 = maxBy;
65821
+
65822
+ var THREE_SECONDS = 3000;
65823
+ var MAX_TRIES = 3;
65824
+ /** Check if the user's primary creator node is healthy */
65825
+
65826
+ var checkPrimaryHealthy = /*#__PURE__*/function () {
65827
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
65828
+ var healthy;
65829
+ return regeneratorRuntime.wrap(function _callee$(_context) {
65830
+ while (1) {
65831
+ switch (_context.prev = _context.next) {
65832
+ case 0:
65833
+ _context.next = 2;
65834
+ return Utils.isHealthy(primary);
65835
+
65836
+ case 2:
65837
+ healthy = _context.sent;
65838
+
65839
+ if (!healthy) {
65840
+ _context.next = 7;
65841
+ break;
65842
+ }
65843
+
65844
+ return _context.abrupt("return", healthy);
65845
+
65846
+ case 7:
65847
+ if (!(tries === 0)) {
65848
+ _context.next = 9;
65849
+ break;
65850
+ }
65851
+
65852
+ return _context.abrupt("return", false);
65853
+
65854
+ case 9:
65855
+ _context.next = 11;
65856
+ return Utils.wait(THREE_SECONDS);
65857
+
65858
+ case 11:
65859
+ _context.next = 13;
65860
+ return checkPrimaryHealthy(libs, primary, tries - 1);
65861
+
65862
+ case 13:
65863
+ return _context.abrupt("return", _context.sent);
65864
+
65865
+ case 14:
65866
+ case "end":
65867
+ return _context.stop();
65868
+ }
65869
+ }
65870
+ }, _callee);
65871
+ }));
65872
+
65873
+ return function checkPrimaryHealthy(_x, _x2, _x3) {
65874
+ return _ref.apply(this, arguments);
65875
+ };
65876
+ }();
65877
+ /** Gets new endpoints from a user's secondaries */
65878
+
65879
+
65880
+ var getNewPrimary = /*#__PURE__*/function () {
65881
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(secondaries, wallet) {
65882
+ var _maxBy;
65883
+
65884
+ var secondaryStatuses, max;
65885
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
65886
+ while (1) {
65887
+ switch (_context3.prev = _context3.next) {
65888
+ case 0:
65889
+ _context3.next = 2;
65890
+ return Promise.all(secondaries.map( /*#__PURE__*/function () {
65891
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(secondary) {
65892
+ var clockValue;
65893
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
65894
+ while (1) {
65895
+ switch (_context2.prev = _context2.next) {
65896
+ case 0:
65897
+ _context2.prev = 0;
65898
+ _context2.next = 3;
65899
+ return CreatorNode.getClockValue(secondary, wallet);
65900
+
65901
+ case 3:
65902
+ clockValue = _context2.sent;
65903
+
65904
+ if (!clockValue) {
65905
+ _context2.next = 6;
65906
+ break;
65907
+ }
65908
+
65909
+ return _context2.abrupt("return", {
65910
+ secondary: secondary,
65911
+ clockValue: clockValue
65912
+ });
65913
+
65914
+ case 6:
65915
+ return _context2.abrupt("return", undefined);
65916
+
65917
+ case 9:
65918
+ _context2.prev = 9;
65919
+ _context2.t0 = _context2["catch"](0);
65920
+ console.warn(_context2.t0);
65921
+ return _context2.abrupt("return", undefined);
65922
+
65923
+ case 13:
65924
+ case "end":
65925
+ return _context2.stop();
65926
+ }
65927
+ }
65928
+ }, _callee2, null, [[0, 9]]);
65929
+ }));
65930
+
65931
+ return function (_x6) {
65932
+ return _ref3.apply(this, arguments);
65933
+ };
65934
+ }()));
65935
+
65936
+ case 2:
65937
+ secondaryStatuses = _context3.sent.filter(Boolean);
65938
+ max = (_maxBy = maxBy_1(secondaryStatuses, function (s) {
65939
+ return s === null || s === void 0 ? void 0 : s.clockValue;
65940
+ })) === null || _maxBy === void 0 ? void 0 : _maxBy.secondary;
65941
+
65942
+ if (max) {
65943
+ _context3.next = 6;
65944
+ break;
65945
+ }
65946
+
65947
+ throw new Error("Could not find valid secondaries for user ".concat(secondaries));
65948
+
65949
+ case 6:
65950
+ return _context3.abrupt("return", max);
65951
+
65952
+ case 7:
65953
+ case "end":
65954
+ return _context3.stop();
65955
+ }
65956
+ }
65957
+ }, _callee3);
65958
+ }));
65959
+
65960
+ return function getNewPrimary(_x4, _x5) {
65961
+ return _ref2.apply(this, arguments);
65962
+ };
65963
+ }();
65964
+
65965
+ var rolloverNodes = /*#__PURE__*/function () {
65966
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
65967
+ var _libs$userStateManage;
65968
+
65969
+ var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
65970
+
65971
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
65972
+ while (1) {
65973
+ switch (_context4.prev = _context4.next) {
65974
+ case 0:
65975
+ console.debug('Sanity Check - rolloverNodes');
65976
+ user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
65977
+
65978
+ if (user) {
65979
+ _context4.next = 4;
65980
+ break;
65981
+ }
65982
+
65983
+ return _context4.abrupt("return");
65984
+
65985
+ case 4:
65986
+ primary = CreatorNode.getPrimary(user.creator_node_endpoint);
65987
+
65988
+ if (primary) {
65989
+ _context4.next = 7;
65990
+ break;
65991
+ }
65992
+
65993
+ return _context4.abrupt("return");
65994
+
65995
+ case 7:
65996
+ _context4.next = 9;
65997
+ return checkPrimaryHealthy(libs, primary, MAX_TRIES);
65998
+
65999
+ case 9:
66000
+ healthy = _context4.sent;
66001
+
66002
+ if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
66003
+ _context4.next = 12;
66004
+ break;
66005
+ }
66006
+
66007
+ return _context4.abrupt("return");
66008
+
66009
+ case 12:
66010
+ secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
66011
+ _context4.prev = 13;
66012
+ _context4.next = 16;
66013
+ return getNewPrimary(secondaries, user.wallet);
66014
+
66015
+ case 16:
66016
+ newPrimary = _context4.sent;
66017
+ index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
66018
+
66019
+ newSecondaries = _toConsumableArray(secondaries);
66020
+ newSecondaries.splice(index, 1);
66021
+ _context4.next = 22;
66022
+ return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
66023
+ numberOfNodes: 2 - newSecondaries.length,
66024
+ whitelist: creatorNodeWhitelist,
66025
+ // Exclude ones we currently have
66026
+ blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
66027
+ preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
66028
+ preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
66029
+ });
66030
+
66031
+ case 22:
66032
+ autoselect = _context4.sent;
66033
+
66034
+ if (autoselect) {
66035
+ newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
66036
+ } // Set the new endpoint and connect to it
66037
+
66038
+
66039
+ newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
66040
+ _context4.next = 27;
66041
+ return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.setEndpoint(newEndpoints[0]);
66042
+
66043
+ case 27:
66044
+ // Update the user
66045
+ newMetadata = _objectSpread2({}, user);
66046
+ newMetadata.creator_node_endpoint = newEndpoints.join(',');
66047
+ console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
66048
+ _context4.next = 32;
66049
+ return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata, true
66050
+ /* useEntityManager */
66051
+ );
66052
+
66053
+ case 32:
66054
+ _context4.next = 37;
66055
+ break;
66056
+
66057
+ case 34:
66058
+ _context4.prev = 34;
66059
+ _context4.t0 = _context4["catch"](13);
66060
+ console.error(_context4.t0);
66061
+
66062
+ case 37:
66063
+ case "end":
66064
+ return _context4.stop();
66065
+ }
66066
+ }
66067
+ }, _callee4, null, [[13, 34]]);
66068
+ }));
66069
+
66070
+ return function rolloverNodes(_x7, _x8, _x9) {
66071
+ return _ref4.apply(this, arguments);
62886
66072
  };
62887
66073
  }();
62888
66074