@razorpay/blade 10.12.1 → 10.13.1
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/build/components/index.d.ts +8 -0
- package/build/components/index.development.web.js +26 -7
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +8 -0
- package/build/components/index.native.js +4 -4
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +26 -7
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/build/tokens/index.d.ts +18 -1
- package/build/tokens/index.development.web.js +2292 -1325
- package/build/tokens/index.development.web.js.map +1 -1
- package/build/tokens/index.native.d.ts +18 -1
- package/build/tokens/index.native.js +1498 -898
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.production.web.js +1517 -91
- package/build/tokens/index.production.web.js.map +1 -1
- package/package.json +4 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _typeof from '@babel/runtime/helpers/typeof';
|
|
2
|
+
import _typeof$1 from '@babel/runtime/helpers/typeof';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
|
|
5
5
|
var border = {
|
|
@@ -324,8 +324,8 @@ var fontFamily = {
|
|
|
324
324
|
code: 'monospace'
|
|
325
325
|
};
|
|
326
326
|
|
|
327
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
328
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
327
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
328
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
331
|
* For font size and line-heights we can’t say from xl to 2xl the value will necessary increase.
|
|
@@ -341,7 +341,7 @@ var fontWeight = {
|
|
|
341
341
|
var typography = {
|
|
342
342
|
onDesktop: {
|
|
343
343
|
fonts: {
|
|
344
|
-
family: _objectSpread({}, fontFamily),
|
|
344
|
+
family: _objectSpread$1({}, fontFamily),
|
|
345
345
|
size: {
|
|
346
346
|
10: 9,
|
|
347
347
|
25: 10,
|
|
@@ -362,7 +362,7 @@ var typography = {
|
|
|
362
362
|
1300: 64,
|
|
363
363
|
1600: 88
|
|
364
364
|
},
|
|
365
|
-
weight: _objectSpread({}, fontWeight)
|
|
365
|
+
weight: _objectSpread$1({}, fontWeight)
|
|
366
366
|
},
|
|
367
367
|
lineHeights: {
|
|
368
368
|
0: 0,
|
|
@@ -387,7 +387,7 @@ var typography = {
|
|
|
387
387
|
|
|
388
388
|
onMobile: {
|
|
389
389
|
fonts: {
|
|
390
|
-
family: _objectSpread({}, fontFamily),
|
|
390
|
+
family: _objectSpread$1({}, fontFamily),
|
|
391
391
|
size: {
|
|
392
392
|
10: 9,
|
|
393
393
|
25: 10,
|
|
@@ -408,7 +408,7 @@ var typography = {
|
|
|
408
408
|
1300: 56,
|
|
409
409
|
1600: 64
|
|
410
410
|
},
|
|
411
|
-
weight: _objectSpread({}, fontWeight)
|
|
411
|
+
weight: _objectSpread$1({}, fontWeight)
|
|
412
412
|
},
|
|
413
413
|
lineHeights: {
|
|
414
414
|
0: 0,
|
|
@@ -4957,13 +4957,13 @@ var _listCacheClear = listCacheClear$1;
|
|
|
4957
4957
|
* // => true
|
|
4958
4958
|
*/
|
|
4959
4959
|
|
|
4960
|
-
function eq$
|
|
4960
|
+
function eq$4(value, other) {
|
|
4961
4961
|
return value === other || (value !== value && other !== other);
|
|
4962
4962
|
}
|
|
4963
4963
|
|
|
4964
|
-
var eq_1 = eq$
|
|
4964
|
+
var eq_1 = eq$4;
|
|
4965
4965
|
|
|
4966
|
-
var eq$
|
|
4966
|
+
var eq$3 = eq_1;
|
|
4967
4967
|
|
|
4968
4968
|
/**
|
|
4969
4969
|
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
@@ -4976,7 +4976,7 @@ var eq$4 = eq_1;
|
|
|
4976
4976
|
function assocIndexOf$4(array, key) {
|
|
4977
4977
|
var length = array.length;
|
|
4978
4978
|
while (length--) {
|
|
4979
|
-
if (eq$
|
|
4979
|
+
if (eq$3(array[length][0], key)) {
|
|
4980
4980
|
return length;
|
|
4981
4981
|
}
|
|
4982
4982
|
}
|
|
@@ -5212,17 +5212,17 @@ var _Symbol = Symbol$4;
|
|
|
5212
5212
|
var Symbol$3 = _Symbol;
|
|
5213
5213
|
|
|
5214
5214
|
/** Used for built-in method references. */
|
|
5215
|
-
var objectProto$
|
|
5215
|
+
var objectProto$d = Object.prototype;
|
|
5216
5216
|
|
|
5217
5217
|
/** Used to check objects for own properties. */
|
|
5218
|
-
var hasOwnProperty$
|
|
5218
|
+
var hasOwnProperty$a = objectProto$d.hasOwnProperty;
|
|
5219
5219
|
|
|
5220
5220
|
/**
|
|
5221
5221
|
* Used to resolve the
|
|
5222
5222
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
5223
5223
|
* of values.
|
|
5224
5224
|
*/
|
|
5225
|
-
var nativeObjectToString$1 = objectProto$
|
|
5225
|
+
var nativeObjectToString$1 = objectProto$d.toString;
|
|
5226
5226
|
|
|
5227
5227
|
/** Built-in value references. */
|
|
5228
5228
|
var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
|
|
@@ -5235,7 +5235,7 @@ var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
|
|
|
5235
5235
|
* @returns {string} Returns the raw `toStringTag`.
|
|
5236
5236
|
*/
|
|
5237
5237
|
function getRawTag$1(value) {
|
|
5238
|
-
var isOwn = hasOwnProperty$
|
|
5238
|
+
var isOwn = hasOwnProperty$a.call(value, symToStringTag$1),
|
|
5239
5239
|
tag = value[symToStringTag$1];
|
|
5240
5240
|
|
|
5241
5241
|
try {
|
|
@@ -5258,14 +5258,14 @@ var _getRawTag = getRawTag$1;
|
|
|
5258
5258
|
|
|
5259
5259
|
/** Used for built-in method references. */
|
|
5260
5260
|
|
|
5261
|
-
var objectProto$
|
|
5261
|
+
var objectProto$c = Object.prototype;
|
|
5262
5262
|
|
|
5263
5263
|
/**
|
|
5264
5264
|
* Used to resolve the
|
|
5265
5265
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
5266
5266
|
* of values.
|
|
5267
5267
|
*/
|
|
5268
|
-
var nativeObjectToString = objectProto$
|
|
5268
|
+
var nativeObjectToString = objectProto$c.toString;
|
|
5269
5269
|
|
|
5270
5270
|
/**
|
|
5271
5271
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -5454,17 +5454,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
5454
5454
|
|
|
5455
5455
|
/** Used for built-in method references. */
|
|
5456
5456
|
var funcProto$1 = Function.prototype,
|
|
5457
|
-
objectProto$
|
|
5457
|
+
objectProto$b = Object.prototype;
|
|
5458
5458
|
|
|
5459
5459
|
/** Used to resolve the decompiled source of functions. */
|
|
5460
5460
|
var funcToString$1 = funcProto$1.toString;
|
|
5461
5461
|
|
|
5462
5462
|
/** Used to check objects for own properties. */
|
|
5463
|
-
var hasOwnProperty$
|
|
5463
|
+
var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
5464
5464
|
|
|
5465
5465
|
/** Used to detect if a method is native. */
|
|
5466
5466
|
var reIsNative = RegExp('^' +
|
|
5467
|
-
funcToString$1.call(hasOwnProperty$
|
|
5467
|
+
funcToString$1.call(hasOwnProperty$9).replace(reRegExpChar, '\\$&')
|
|
5468
5468
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
5469
5469
|
);
|
|
5470
5470
|
|
|
@@ -5572,13 +5572,13 @@ var _hashDelete = hashDelete$1;
|
|
|
5572
5572
|
var nativeCreate$2 = _nativeCreate;
|
|
5573
5573
|
|
|
5574
5574
|
/** Used to stand-in for `undefined` hash values. */
|
|
5575
|
-
var HASH_UNDEFINED$
|
|
5575
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
5576
5576
|
|
|
5577
5577
|
/** Used for built-in method references. */
|
|
5578
|
-
var objectProto$
|
|
5578
|
+
var objectProto$a = Object.prototype;
|
|
5579
5579
|
|
|
5580
5580
|
/** Used to check objects for own properties. */
|
|
5581
|
-
var hasOwnProperty$
|
|
5581
|
+
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
5582
5582
|
|
|
5583
5583
|
/**
|
|
5584
5584
|
* Gets the hash value for `key`.
|
|
@@ -5593,9 +5593,9 @@ function hashGet$1(key) {
|
|
|
5593
5593
|
var data = this.__data__;
|
|
5594
5594
|
if (nativeCreate$2) {
|
|
5595
5595
|
var result = data[key];
|
|
5596
|
-
return result === HASH_UNDEFINED$
|
|
5596
|
+
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
5597
5597
|
}
|
|
5598
|
-
return hasOwnProperty$
|
|
5598
|
+
return hasOwnProperty$8.call(data, key) ? data[key] : undefined;
|
|
5599
5599
|
}
|
|
5600
5600
|
|
|
5601
5601
|
var _hashGet = hashGet$1;
|
|
@@ -5603,10 +5603,10 @@ var _hashGet = hashGet$1;
|
|
|
5603
5603
|
var nativeCreate$1 = _nativeCreate;
|
|
5604
5604
|
|
|
5605
5605
|
/** Used for built-in method references. */
|
|
5606
|
-
var objectProto$
|
|
5606
|
+
var objectProto$9 = Object.prototype;
|
|
5607
5607
|
|
|
5608
5608
|
/** Used to check objects for own properties. */
|
|
5609
|
-
var hasOwnProperty$
|
|
5609
|
+
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
5610
5610
|
|
|
5611
5611
|
/**
|
|
5612
5612
|
* Checks if a hash value for `key` exists.
|
|
@@ -5619,7 +5619,7 @@ var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
|
5619
5619
|
*/
|
|
5620
5620
|
function hashHas$1(key) {
|
|
5621
5621
|
var data = this.__data__;
|
|
5622
|
-
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$
|
|
5622
|
+
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$7.call(data, key);
|
|
5623
5623
|
}
|
|
5624
5624
|
|
|
5625
5625
|
var _hashHas = hashHas$1;
|
|
@@ -5627,7 +5627,7 @@ var _hashHas = hashHas$1;
|
|
|
5627
5627
|
var nativeCreate = _nativeCreate;
|
|
5628
5628
|
|
|
5629
5629
|
/** Used to stand-in for `undefined` hash values. */
|
|
5630
|
-
var HASH_UNDEFINED
|
|
5630
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
5631
5631
|
|
|
5632
5632
|
/**
|
|
5633
5633
|
* Sets the hash `key` to `value`.
|
|
@@ -5642,7 +5642,7 @@ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
|
5642
5642
|
function hashSet$1(key, value) {
|
|
5643
5643
|
var data = this.__data__;
|
|
5644
5644
|
this.size += this.has(key) ? 0 : 1;
|
|
5645
|
-
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED
|
|
5645
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
5646
5646
|
return this;
|
|
5647
5647
|
}
|
|
5648
5648
|
|
|
@@ -5828,7 +5828,7 @@ var mapCacheClear = _mapCacheClear,
|
|
|
5828
5828
|
* @constructor
|
|
5829
5829
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
5830
5830
|
*/
|
|
5831
|
-
function MapCache$
|
|
5831
|
+
function MapCache$1(entries) {
|
|
5832
5832
|
var index = -1,
|
|
5833
5833
|
length = entries == null ? 0 : entries.length;
|
|
5834
5834
|
|
|
@@ -5840,17 +5840,17 @@ function MapCache$2(entries) {
|
|
|
5840
5840
|
}
|
|
5841
5841
|
|
|
5842
5842
|
// Add methods to `MapCache`.
|
|
5843
|
-
MapCache$
|
|
5844
|
-
MapCache$
|
|
5845
|
-
MapCache$
|
|
5846
|
-
MapCache$
|
|
5847
|
-
MapCache$
|
|
5843
|
+
MapCache$1.prototype.clear = mapCacheClear;
|
|
5844
|
+
MapCache$1.prototype['delete'] = mapCacheDelete;
|
|
5845
|
+
MapCache$1.prototype.get = mapCacheGet;
|
|
5846
|
+
MapCache$1.prototype.has = mapCacheHas;
|
|
5847
|
+
MapCache$1.prototype.set = mapCacheSet;
|
|
5848
5848
|
|
|
5849
|
-
var _MapCache = MapCache$
|
|
5849
|
+
var _MapCache = MapCache$1;
|
|
5850
5850
|
|
|
5851
5851
|
var ListCache$1 = _ListCache,
|
|
5852
5852
|
Map$1 = _Map,
|
|
5853
|
-
MapCache
|
|
5853
|
+
MapCache = _MapCache;
|
|
5854
5854
|
|
|
5855
5855
|
/** Used as the size to enable large array optimizations. */
|
|
5856
5856
|
var LARGE_ARRAY_SIZE = 200;
|
|
@@ -5874,7 +5874,7 @@ function stackSet$1(key, value) {
|
|
|
5874
5874
|
this.size = ++data.size;
|
|
5875
5875
|
return this;
|
|
5876
5876
|
}
|
|
5877
|
-
data = this.__data__ = new MapCache
|
|
5877
|
+
data = this.__data__ = new MapCache(pairs);
|
|
5878
5878
|
}
|
|
5879
5879
|
data.set(key, value);
|
|
5880
5880
|
this.size = data.size;
|
|
@@ -5897,19 +5897,19 @@ var ListCache = _ListCache,
|
|
|
5897
5897
|
* @constructor
|
|
5898
5898
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
5899
5899
|
*/
|
|
5900
|
-
function Stack$
|
|
5900
|
+
function Stack$2(entries) {
|
|
5901
5901
|
var data = this.__data__ = new ListCache(entries);
|
|
5902
5902
|
this.size = data.size;
|
|
5903
5903
|
}
|
|
5904
5904
|
|
|
5905
5905
|
// Add methods to `Stack`.
|
|
5906
|
-
Stack$
|
|
5907
|
-
Stack$
|
|
5908
|
-
Stack$
|
|
5909
|
-
Stack$
|
|
5910
|
-
Stack$
|
|
5906
|
+
Stack$2.prototype.clear = stackClear;
|
|
5907
|
+
Stack$2.prototype['delete'] = stackDelete;
|
|
5908
|
+
Stack$2.prototype.get = stackGet;
|
|
5909
|
+
Stack$2.prototype.has = stackHas;
|
|
5910
|
+
Stack$2.prototype.set = stackSet;
|
|
5911
5911
|
|
|
5912
|
-
var _Stack = Stack$
|
|
5912
|
+
var _Stack = Stack$2;
|
|
5913
5913
|
|
|
5914
5914
|
/**
|
|
5915
5915
|
* A specialized version of `_.forEach` for arrays without support for
|
|
@@ -5974,13 +5974,13 @@ function baseAssignValue$3(object, key, value) {
|
|
|
5974
5974
|
var _baseAssignValue = baseAssignValue$3;
|
|
5975
5975
|
|
|
5976
5976
|
var baseAssignValue$2 = _baseAssignValue,
|
|
5977
|
-
eq$
|
|
5977
|
+
eq$2 = eq_1;
|
|
5978
5978
|
|
|
5979
5979
|
/** Used for built-in method references. */
|
|
5980
|
-
var objectProto$
|
|
5980
|
+
var objectProto$8 = Object.prototype;
|
|
5981
5981
|
|
|
5982
5982
|
/** Used to check objects for own properties. */
|
|
5983
|
-
var hasOwnProperty$
|
|
5983
|
+
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
5984
5984
|
|
|
5985
5985
|
/**
|
|
5986
5986
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
@@ -5994,7 +5994,7 @@ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
|
5994
5994
|
*/
|
|
5995
5995
|
function assignValue$2(object, key, value) {
|
|
5996
5996
|
var objValue = object[key];
|
|
5997
|
-
if (!(hasOwnProperty$
|
|
5997
|
+
if (!(hasOwnProperty$6.call(object, key) && eq$2(objValue, value)) ||
|
|
5998
5998
|
(value === undefined && !(key in object))) {
|
|
5999
5999
|
baseAssignValue$2(object, key, value);
|
|
6000
6000
|
}
|
|
@@ -6090,17 +6090,17 @@ var _baseTimes = baseTimes$1;
|
|
|
6090
6090
|
* // => false
|
|
6091
6091
|
*/
|
|
6092
6092
|
|
|
6093
|
-
function isObjectLike$
|
|
6093
|
+
function isObjectLike$7(value) {
|
|
6094
6094
|
return value != null && typeof value == 'object';
|
|
6095
6095
|
}
|
|
6096
6096
|
|
|
6097
|
-
var isObjectLike_1 = isObjectLike$
|
|
6097
|
+
var isObjectLike_1 = isObjectLike$7;
|
|
6098
6098
|
|
|
6099
6099
|
var baseGetTag$3 = _baseGetTag,
|
|
6100
|
-
isObjectLike$
|
|
6100
|
+
isObjectLike$6 = isObjectLike_1;
|
|
6101
6101
|
|
|
6102
6102
|
/** `Object#toString` result references. */
|
|
6103
|
-
var argsTag$
|
|
6103
|
+
var argsTag$2 = '[object Arguments]';
|
|
6104
6104
|
|
|
6105
6105
|
/**
|
|
6106
6106
|
* The base implementation of `_.isArguments`.
|
|
@@ -6110,22 +6110,22 @@ var argsTag$3 = '[object Arguments]';
|
|
|
6110
6110
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
6111
6111
|
*/
|
|
6112
6112
|
function baseIsArguments$1(value) {
|
|
6113
|
-
return isObjectLike$
|
|
6113
|
+
return isObjectLike$6(value) && baseGetTag$3(value) == argsTag$2;
|
|
6114
6114
|
}
|
|
6115
6115
|
|
|
6116
6116
|
var _baseIsArguments = baseIsArguments$1;
|
|
6117
6117
|
|
|
6118
6118
|
var baseIsArguments = _baseIsArguments,
|
|
6119
|
-
isObjectLike$
|
|
6119
|
+
isObjectLike$5 = isObjectLike_1;
|
|
6120
6120
|
|
|
6121
6121
|
/** Used for built-in method references. */
|
|
6122
|
-
var objectProto$
|
|
6122
|
+
var objectProto$7 = Object.prototype;
|
|
6123
6123
|
|
|
6124
6124
|
/** Used to check objects for own properties. */
|
|
6125
|
-
var hasOwnProperty$
|
|
6125
|
+
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
6126
6126
|
|
|
6127
6127
|
/** Built-in value references. */
|
|
6128
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
6128
|
+
var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
|
|
6129
6129
|
|
|
6130
6130
|
/**
|
|
6131
6131
|
* Checks if `value` is likely an `arguments` object.
|
|
@@ -6146,7 +6146,7 @@ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
|
|
|
6146
6146
|
* // => false
|
|
6147
6147
|
*/
|
|
6148
6148
|
var isArguments$2 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
6149
|
-
return isObjectLike$
|
|
6149
|
+
return isObjectLike$5(value) && hasOwnProperty$5.call(value, 'callee') &&
|
|
6150
6150
|
!propertyIsEnumerable$1.call(value, 'callee');
|
|
6151
6151
|
};
|
|
6152
6152
|
|
|
@@ -6176,11 +6176,11 @@ var isArguments_1 = isArguments$2;
|
|
|
6176
6176
|
* // => false
|
|
6177
6177
|
*/
|
|
6178
6178
|
|
|
6179
|
-
var isArray$
|
|
6179
|
+
var isArray$4 = Array.isArray;
|
|
6180
6180
|
|
|
6181
|
-
var isArray_1 = isArray$
|
|
6181
|
+
var isArray_1 = isArray$4;
|
|
6182
6182
|
|
|
6183
|
-
var isBuffer$
|
|
6183
|
+
var isBuffer$3 = {exports: {}};
|
|
6184
6184
|
|
|
6185
6185
|
/**
|
|
6186
6186
|
* This method returns `false`.
|
|
@@ -6202,7 +6202,7 @@ function stubFalse() {
|
|
|
6202
6202
|
|
|
6203
6203
|
var stubFalse_1 = stubFalse;
|
|
6204
6204
|
|
|
6205
|
-
isBuffer$
|
|
6205
|
+
isBuffer$3.exports;
|
|
6206
6206
|
|
|
6207
6207
|
(function (module, exports) {
|
|
6208
6208
|
var root = _root,
|
|
@@ -6243,9 +6243,9 @@ isBuffer$4.exports;
|
|
|
6243
6243
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
6244
6244
|
|
|
6245
6245
|
module.exports = isBuffer;
|
|
6246
|
-
} (isBuffer$
|
|
6246
|
+
} (isBuffer$3, isBuffer$3.exports));
|
|
6247
6247
|
|
|
6248
|
-
var isBufferExports = isBuffer$
|
|
6248
|
+
var isBufferExports = isBuffer$3.exports;
|
|
6249
6249
|
|
|
6250
6250
|
/** Used as references for various `Number` constants. */
|
|
6251
6251
|
|
|
@@ -6313,25 +6313,25 @@ var isLength_1 = isLength$2;
|
|
|
6313
6313
|
|
|
6314
6314
|
var baseGetTag$2 = _baseGetTag,
|
|
6315
6315
|
isLength$1 = isLength_1,
|
|
6316
|
-
isObjectLike$
|
|
6316
|
+
isObjectLike$4 = isObjectLike_1;
|
|
6317
6317
|
|
|
6318
6318
|
/** `Object#toString` result references. */
|
|
6319
|
-
var argsTag$
|
|
6320
|
-
arrayTag$
|
|
6321
|
-
boolTag$
|
|
6322
|
-
dateTag$
|
|
6323
|
-
errorTag$
|
|
6319
|
+
var argsTag$1 = '[object Arguments]',
|
|
6320
|
+
arrayTag$1 = '[object Array]',
|
|
6321
|
+
boolTag$2 = '[object Boolean]',
|
|
6322
|
+
dateTag$2 = '[object Date]',
|
|
6323
|
+
errorTag$1 = '[object Error]',
|
|
6324
6324
|
funcTag$1 = '[object Function]',
|
|
6325
|
-
mapTag$
|
|
6326
|
-
numberTag$
|
|
6327
|
-
objectTag$
|
|
6328
|
-
regexpTag$
|
|
6329
|
-
setTag$
|
|
6330
|
-
stringTag$
|
|
6325
|
+
mapTag$4 = '[object Map]',
|
|
6326
|
+
numberTag$2 = '[object Number]',
|
|
6327
|
+
objectTag$3 = '[object Object]',
|
|
6328
|
+
regexpTag$2 = '[object RegExp]',
|
|
6329
|
+
setTag$4 = '[object Set]',
|
|
6330
|
+
stringTag$2 = '[object String]',
|
|
6331
6331
|
weakMapTag$2 = '[object WeakMap]';
|
|
6332
6332
|
|
|
6333
|
-
var arrayBufferTag$
|
|
6334
|
-
dataViewTag$
|
|
6333
|
+
var arrayBufferTag$2 = '[object ArrayBuffer]',
|
|
6334
|
+
dataViewTag$3 = '[object DataView]',
|
|
6335
6335
|
float32Tag$2 = '[object Float32Array]',
|
|
6336
6336
|
float64Tag$2 = '[object Float64Array]',
|
|
6337
6337
|
int8Tag$2 = '[object Int8Array]',
|
|
@@ -6349,13 +6349,13 @@ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
|
|
|
6349
6349
|
typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
|
|
6350
6350
|
typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
|
|
6351
6351
|
typedArrayTags[uint32Tag$2] = true;
|
|
6352
|
-
typedArrayTags[argsTag$
|
|
6353
|
-
typedArrayTags[arrayBufferTag$
|
|
6354
|
-
typedArrayTags[dataViewTag$
|
|
6355
|
-
typedArrayTags[errorTag$
|
|
6356
|
-
typedArrayTags[mapTag$
|
|
6357
|
-
typedArrayTags[objectTag$
|
|
6358
|
-
typedArrayTags[setTag$
|
|
6352
|
+
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
|
|
6353
|
+
typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
|
|
6354
|
+
typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
|
|
6355
|
+
typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
|
|
6356
|
+
typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
|
|
6357
|
+
typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$2] =
|
|
6358
|
+
typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
|
|
6359
6359
|
typedArrayTags[weakMapTag$2] = false;
|
|
6360
6360
|
|
|
6361
6361
|
/**
|
|
@@ -6366,7 +6366,7 @@ typedArrayTags[weakMapTag$2] = false;
|
|
|
6366
6366
|
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
6367
6367
|
*/
|
|
6368
6368
|
function baseIsTypedArray$1(value) {
|
|
6369
|
-
return isObjectLike$
|
|
6369
|
+
return isObjectLike$4(value) &&
|
|
6370
6370
|
isLength$1(value.length) && !!typedArrayTags[baseGetTag$2(value)];
|
|
6371
6371
|
}
|
|
6372
6372
|
|
|
@@ -6451,22 +6451,22 @@ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
|
|
|
6451
6451
|
* _.isTypedArray([]);
|
|
6452
6452
|
* // => false
|
|
6453
6453
|
*/
|
|
6454
|
-
var isTypedArray$
|
|
6454
|
+
var isTypedArray$2 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
|
|
6455
6455
|
|
|
6456
|
-
var isTypedArray_1 = isTypedArray$
|
|
6456
|
+
var isTypedArray_1 = isTypedArray$2;
|
|
6457
6457
|
|
|
6458
6458
|
var baseTimes = _baseTimes,
|
|
6459
6459
|
isArguments$1 = isArguments_1,
|
|
6460
|
-
isArray$
|
|
6461
|
-
isBuffer$
|
|
6460
|
+
isArray$3 = isArray_1,
|
|
6461
|
+
isBuffer$2 = isBufferExports,
|
|
6462
6462
|
isIndex$1 = _isIndex,
|
|
6463
|
-
isTypedArray$
|
|
6463
|
+
isTypedArray$1 = isTypedArray_1;
|
|
6464
6464
|
|
|
6465
6465
|
/** Used for built-in method references. */
|
|
6466
|
-
var objectProto$
|
|
6466
|
+
var objectProto$6 = Object.prototype;
|
|
6467
6467
|
|
|
6468
6468
|
/** Used to check objects for own properties. */
|
|
6469
|
-
var hasOwnProperty$
|
|
6469
|
+
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
|
6470
6470
|
|
|
6471
6471
|
/**
|
|
6472
6472
|
* Creates an array of the enumerable property names of the array-like `value`.
|
|
@@ -6477,16 +6477,16 @@ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
|
6477
6477
|
* @returns {Array} Returns the array of property names.
|
|
6478
6478
|
*/
|
|
6479
6479
|
function arrayLikeKeys$2(value, inherited) {
|
|
6480
|
-
var isArr = isArray$
|
|
6480
|
+
var isArr = isArray$3(value),
|
|
6481
6481
|
isArg = !isArr && isArguments$1(value),
|
|
6482
|
-
isBuff = !isArr && !isArg && isBuffer$
|
|
6483
|
-
isType = !isArr && !isArg && !isBuff && isTypedArray$
|
|
6482
|
+
isBuff = !isArr && !isArg && isBuffer$2(value),
|
|
6483
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
|
|
6484
6484
|
skipIndexes = isArr || isArg || isBuff || isType,
|
|
6485
6485
|
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
6486
6486
|
length = result.length;
|
|
6487
6487
|
|
|
6488
6488
|
for (var key in value) {
|
|
6489
|
-
if ((inherited || hasOwnProperty$
|
|
6489
|
+
if ((inherited || hasOwnProperty$4.call(value, key)) &&
|
|
6490
6490
|
!(skipIndexes && (
|
|
6491
6491
|
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
6492
6492
|
key == 'length' ||
|
|
@@ -6507,7 +6507,7 @@ var _arrayLikeKeys = arrayLikeKeys$2;
|
|
|
6507
6507
|
|
|
6508
6508
|
/** Used for built-in method references. */
|
|
6509
6509
|
|
|
6510
|
-
var objectProto$
|
|
6510
|
+
var objectProto$5 = Object.prototype;
|
|
6511
6511
|
|
|
6512
6512
|
/**
|
|
6513
6513
|
* Checks if `value` is likely a prototype object.
|
|
@@ -6518,7 +6518,7 @@ var objectProto$7 = Object.prototype;
|
|
|
6518
6518
|
*/
|
|
6519
6519
|
function isPrototype$3(value) {
|
|
6520
6520
|
var Ctor = value && value.constructor,
|
|
6521
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$
|
|
6521
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
|
|
6522
6522
|
|
|
6523
6523
|
return value === proto;
|
|
6524
6524
|
}
|
|
@@ -6553,10 +6553,10 @@ var isPrototype$2 = _isPrototype,
|
|
|
6553
6553
|
nativeKeys = _nativeKeys;
|
|
6554
6554
|
|
|
6555
6555
|
/** Used for built-in method references. */
|
|
6556
|
-
var objectProto$
|
|
6556
|
+
var objectProto$4 = Object.prototype;
|
|
6557
6557
|
|
|
6558
6558
|
/** Used to check objects for own properties. */
|
|
6559
|
-
var hasOwnProperty$
|
|
6559
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
6560
6560
|
|
|
6561
6561
|
/**
|
|
6562
6562
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
@@ -6571,7 +6571,7 @@ function baseKeys$1(object) {
|
|
|
6571
6571
|
}
|
|
6572
6572
|
var result = [];
|
|
6573
6573
|
for (var key in Object(object)) {
|
|
6574
|
-
if (hasOwnProperty$
|
|
6574
|
+
if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
|
|
6575
6575
|
result.push(key);
|
|
6576
6576
|
}
|
|
6577
6577
|
}
|
|
@@ -6652,6 +6652,8 @@ function keys$3(object) {
|
|
|
6652
6652
|
|
|
6653
6653
|
var keys_1 = keys$3;
|
|
6654
6654
|
|
|
6655
|
+
var keys$4 = /*@__PURE__*/getDefaultExportFromCjs(keys_1);
|
|
6656
|
+
|
|
6655
6657
|
var copyObject$4 = _copyObject,
|
|
6656
6658
|
keys$2 = keys_1;
|
|
6657
6659
|
|
|
@@ -6697,10 +6699,10 @@ var isObject$5 = isObject_1,
|
|
|
6697
6699
|
nativeKeysIn = _nativeKeysIn;
|
|
6698
6700
|
|
|
6699
6701
|
/** Used for built-in method references. */
|
|
6700
|
-
var objectProto$
|
|
6702
|
+
var objectProto$3 = Object.prototype;
|
|
6701
6703
|
|
|
6702
6704
|
/** Used to check objects for own properties. */
|
|
6703
|
-
var hasOwnProperty$
|
|
6705
|
+
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
6704
6706
|
|
|
6705
6707
|
/**
|
|
6706
6708
|
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
@@ -6717,7 +6719,7 @@ function baseKeysIn$1(object) {
|
|
|
6717
6719
|
result = [];
|
|
6718
6720
|
|
|
6719
6721
|
for (var key in object) {
|
|
6720
|
-
if (!(key == 'constructor' && (isProto || !hasOwnProperty$
|
|
6722
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty$2.call(object, key)))) {
|
|
6721
6723
|
result.push(key);
|
|
6722
6724
|
}
|
|
6723
6725
|
}
|
|
@@ -6899,10 +6901,10 @@ var arrayFilter = _arrayFilter,
|
|
|
6899
6901
|
stubArray$1 = stubArray_1;
|
|
6900
6902
|
|
|
6901
6903
|
/** Used for built-in method references. */
|
|
6902
|
-
var objectProto$
|
|
6904
|
+
var objectProto$2 = Object.prototype;
|
|
6903
6905
|
|
|
6904
6906
|
/** Built-in value references. */
|
|
6905
|
-
var propertyIsEnumerable = objectProto$
|
|
6907
|
+
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
|
|
6906
6908
|
|
|
6907
6909
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
6908
6910
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
@@ -7016,7 +7018,7 @@ function copySymbolsIn$1(source, object) {
|
|
|
7016
7018
|
var _copySymbolsIn = copySymbolsIn$1;
|
|
7017
7019
|
|
|
7018
7020
|
var arrayPush = _arrayPush,
|
|
7019
|
-
isArray$
|
|
7021
|
+
isArray$2 = isArray_1;
|
|
7020
7022
|
|
|
7021
7023
|
/**
|
|
7022
7024
|
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
@@ -7031,7 +7033,7 @@ var arrayPush = _arrayPush,
|
|
|
7031
7033
|
*/
|
|
7032
7034
|
function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
|
|
7033
7035
|
var result = keysFunc(object);
|
|
7034
|
-
return isArray$
|
|
7036
|
+
return isArray$2(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
7035
7037
|
}
|
|
7036
7038
|
|
|
7037
7039
|
var _baseGetAllKeys = baseGetAllKeys$2;
|
|
@@ -7047,11 +7049,11 @@ var baseGetAllKeys$1 = _baseGetAllKeys,
|
|
|
7047
7049
|
* @param {Object} object The object to query.
|
|
7048
7050
|
* @returns {Array} Returns the array of property names and symbols.
|
|
7049
7051
|
*/
|
|
7050
|
-
function getAllKeys$
|
|
7052
|
+
function getAllKeys$1(object) {
|
|
7051
7053
|
return baseGetAllKeys$1(object, keys$1, getSymbols);
|
|
7052
7054
|
}
|
|
7053
7055
|
|
|
7054
|
-
var _getAllKeys = getAllKeys$
|
|
7056
|
+
var _getAllKeys = getAllKeys$1;
|
|
7055
7057
|
|
|
7056
7058
|
var baseGetAllKeys = _baseGetAllKeys,
|
|
7057
7059
|
getSymbolsIn = _getSymbolsIn,
|
|
@@ -7112,13 +7114,13 @@ var DataView = _DataView,
|
|
|
7112
7114
|
toSource = _toSource;
|
|
7113
7115
|
|
|
7114
7116
|
/** `Object#toString` result references. */
|
|
7115
|
-
var mapTag$
|
|
7116
|
-
objectTag$
|
|
7117
|
+
var mapTag$3 = '[object Map]',
|
|
7118
|
+
objectTag$2 = '[object Object]',
|
|
7117
7119
|
promiseTag = '[object Promise]',
|
|
7118
|
-
setTag$
|
|
7120
|
+
setTag$3 = '[object Set]',
|
|
7119
7121
|
weakMapTag$1 = '[object WeakMap]';
|
|
7120
7122
|
|
|
7121
|
-
var dataViewTag$
|
|
7123
|
+
var dataViewTag$2 = '[object DataView]';
|
|
7122
7124
|
|
|
7123
7125
|
/** Used to detect maps, sets, and weakmaps. */
|
|
7124
7126
|
var dataViewCtorString = toSource(DataView),
|
|
@@ -7134,25 +7136,25 @@ var dataViewCtorString = toSource(DataView),
|
|
|
7134
7136
|
* @param {*} value The value to query.
|
|
7135
7137
|
* @returns {string} Returns the `toStringTag`.
|
|
7136
7138
|
*/
|
|
7137
|
-
var getTag$
|
|
7139
|
+
var getTag$3 = baseGetTag$1;
|
|
7138
7140
|
|
|
7139
7141
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
7140
|
-
if ((DataView && getTag$
|
|
7141
|
-
(Map && getTag$
|
|
7142
|
-
(Promise$1 && getTag$
|
|
7143
|
-
(Set && getTag$
|
|
7144
|
-
(WeakMap && getTag$
|
|
7145
|
-
getTag$
|
|
7142
|
+
if ((DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
|
|
7143
|
+
(Map && getTag$3(new Map) != mapTag$3) ||
|
|
7144
|
+
(Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag) ||
|
|
7145
|
+
(Set && getTag$3(new Set) != setTag$3) ||
|
|
7146
|
+
(WeakMap && getTag$3(new WeakMap) != weakMapTag$1)) {
|
|
7147
|
+
getTag$3 = function(value) {
|
|
7146
7148
|
var result = baseGetTag$1(value),
|
|
7147
|
-
Ctor = result == objectTag$
|
|
7149
|
+
Ctor = result == objectTag$2 ? value.constructor : undefined,
|
|
7148
7150
|
ctorString = Ctor ? toSource(Ctor) : '';
|
|
7149
7151
|
|
|
7150
7152
|
if (ctorString) {
|
|
7151
7153
|
switch (ctorString) {
|
|
7152
|
-
case dataViewCtorString: return dataViewTag$
|
|
7153
|
-
case mapCtorString: return mapTag$
|
|
7154
|
+
case dataViewCtorString: return dataViewTag$2;
|
|
7155
|
+
case mapCtorString: return mapTag$3;
|
|
7154
7156
|
case promiseCtorString: return promiseTag;
|
|
7155
|
-
case setCtorString: return setTag$
|
|
7157
|
+
case setCtorString: return setTag$3;
|
|
7156
7158
|
case weakMapCtorString: return weakMapTag$1;
|
|
7157
7159
|
}
|
|
7158
7160
|
}
|
|
@@ -7160,14 +7162,14 @@ if ((DataView && getTag$4(new DataView(new ArrayBuffer(1))) != dataViewTag$3) ||
|
|
|
7160
7162
|
};
|
|
7161
7163
|
}
|
|
7162
7164
|
|
|
7163
|
-
var _getTag = getTag$
|
|
7165
|
+
var _getTag = getTag$3;
|
|
7164
7166
|
|
|
7165
7167
|
/** Used for built-in method references. */
|
|
7166
7168
|
|
|
7167
|
-
var objectProto$
|
|
7169
|
+
var objectProto$1 = Object.prototype;
|
|
7168
7170
|
|
|
7169
7171
|
/** Used to check objects for own properties. */
|
|
7170
|
-
var hasOwnProperty$
|
|
7172
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
7171
7173
|
|
|
7172
7174
|
/**
|
|
7173
7175
|
* Initializes an array clone.
|
|
@@ -7181,7 +7183,7 @@ function initCloneArray$1(array) {
|
|
|
7181
7183
|
result = new array.constructor(length);
|
|
7182
7184
|
|
|
7183
7185
|
// Add properties assigned by `RegExp#exec`.
|
|
7184
|
-
if (length && typeof array[0] == 'string' && hasOwnProperty$
|
|
7186
|
+
if (length && typeof array[0] == 'string' && hasOwnProperty$1.call(array, 'index')) {
|
|
7185
7187
|
result.index = array.index;
|
|
7186
7188
|
result.input = array.input;
|
|
7187
7189
|
}
|
|
@@ -7193,11 +7195,11 @@ var _initCloneArray = initCloneArray$1;
|
|
|
7193
7195
|
var root = _root;
|
|
7194
7196
|
|
|
7195
7197
|
/** Built-in value references. */
|
|
7196
|
-
var Uint8Array$
|
|
7198
|
+
var Uint8Array$1 = root.Uint8Array;
|
|
7197
7199
|
|
|
7198
|
-
var _Uint8Array = Uint8Array$
|
|
7200
|
+
var _Uint8Array = Uint8Array$1;
|
|
7199
7201
|
|
|
7200
|
-
var Uint8Array
|
|
7202
|
+
var Uint8Array = _Uint8Array;
|
|
7201
7203
|
|
|
7202
7204
|
/**
|
|
7203
7205
|
* Creates a clone of `arrayBuffer`.
|
|
@@ -7208,7 +7210,7 @@ var Uint8Array$1 = _Uint8Array;
|
|
|
7208
7210
|
*/
|
|
7209
7211
|
function cloneArrayBuffer$3(arrayBuffer) {
|
|
7210
7212
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
7211
|
-
new Uint8Array
|
|
7213
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
7212
7214
|
return result;
|
|
7213
7215
|
}
|
|
7214
7216
|
|
|
@@ -7253,8 +7255,8 @@ var _cloneRegExp = cloneRegExp$1;
|
|
|
7253
7255
|
var Symbol$1 = _Symbol;
|
|
7254
7256
|
|
|
7255
7257
|
/** Used to convert symbols to primitives and strings. */
|
|
7256
|
-
var symbolProto
|
|
7257
|
-
symbolValueOf
|
|
7258
|
+
var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
|
|
7259
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
7258
7260
|
|
|
7259
7261
|
/**
|
|
7260
7262
|
* Creates a clone of the `symbol` object.
|
|
@@ -7264,7 +7266,7 @@ var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : undefined,
|
|
|
7264
7266
|
* @returns {Object} Returns the cloned symbol object.
|
|
7265
7267
|
*/
|
|
7266
7268
|
function cloneSymbol$1(symbol) {
|
|
7267
|
-
return symbolValueOf
|
|
7269
|
+
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
|
7268
7270
|
}
|
|
7269
7271
|
|
|
7270
7272
|
var _cloneSymbol = cloneSymbol$1;
|
|
@@ -7293,17 +7295,17 @@ var cloneArrayBuffer = _cloneArrayBuffer,
|
|
|
7293
7295
|
cloneTypedArray$1 = _cloneTypedArray;
|
|
7294
7296
|
|
|
7295
7297
|
/** `Object#toString` result references. */
|
|
7296
|
-
var boolTag$
|
|
7297
|
-
dateTag$
|
|
7298
|
-
mapTag$
|
|
7299
|
-
numberTag$
|
|
7300
|
-
regexpTag$
|
|
7301
|
-
setTag$
|
|
7302
|
-
stringTag$
|
|
7303
|
-
symbolTag$
|
|
7298
|
+
var boolTag$1 = '[object Boolean]',
|
|
7299
|
+
dateTag$1 = '[object Date]',
|
|
7300
|
+
mapTag$2 = '[object Map]',
|
|
7301
|
+
numberTag$1 = '[object Number]',
|
|
7302
|
+
regexpTag$1 = '[object RegExp]',
|
|
7303
|
+
setTag$2 = '[object Set]',
|
|
7304
|
+
stringTag$1 = '[object String]',
|
|
7305
|
+
symbolTag$1 = '[object Symbol]';
|
|
7304
7306
|
|
|
7305
|
-
var arrayBufferTag$
|
|
7306
|
-
dataViewTag$
|
|
7307
|
+
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
7308
|
+
dataViewTag$1 = '[object DataView]',
|
|
7307
7309
|
float32Tag$1 = '[object Float32Array]',
|
|
7308
7310
|
float64Tag$1 = '[object Float64Array]',
|
|
7309
7311
|
int8Tag$1 = '[object Int8Array]',
|
|
@@ -7329,14 +7331,14 @@ var arrayBufferTag$2 = '[object ArrayBuffer]',
|
|
|
7329
7331
|
function initCloneByTag$1(object, tag, isDeep) {
|
|
7330
7332
|
var Ctor = object.constructor;
|
|
7331
7333
|
switch (tag) {
|
|
7332
|
-
case arrayBufferTag$
|
|
7334
|
+
case arrayBufferTag$1:
|
|
7333
7335
|
return cloneArrayBuffer(object);
|
|
7334
7336
|
|
|
7335
|
-
case boolTag$
|
|
7336
|
-
case dateTag$
|
|
7337
|
+
case boolTag$1:
|
|
7338
|
+
case dateTag$1:
|
|
7337
7339
|
return new Ctor(+object);
|
|
7338
7340
|
|
|
7339
|
-
case dataViewTag$
|
|
7341
|
+
case dataViewTag$1:
|
|
7340
7342
|
return cloneDataView(object, isDeep);
|
|
7341
7343
|
|
|
7342
7344
|
case float32Tag$1: case float64Tag$1:
|
|
@@ -7344,20 +7346,20 @@ function initCloneByTag$1(object, tag, isDeep) {
|
|
|
7344
7346
|
case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
|
|
7345
7347
|
return cloneTypedArray$1(object, isDeep);
|
|
7346
7348
|
|
|
7347
|
-
case mapTag$
|
|
7349
|
+
case mapTag$2:
|
|
7348
7350
|
return new Ctor;
|
|
7349
7351
|
|
|
7350
|
-
case numberTag$
|
|
7351
|
-
case stringTag$
|
|
7352
|
+
case numberTag$1:
|
|
7353
|
+
case stringTag$1:
|
|
7352
7354
|
return new Ctor(object);
|
|
7353
7355
|
|
|
7354
|
-
case regexpTag$
|
|
7356
|
+
case regexpTag$1:
|
|
7355
7357
|
return cloneRegExp(object);
|
|
7356
7358
|
|
|
7357
|
-
case setTag$
|
|
7359
|
+
case setTag$2:
|
|
7358
7360
|
return new Ctor;
|
|
7359
7361
|
|
|
7360
|
-
case symbolTag$
|
|
7362
|
+
case symbolTag$1:
|
|
7361
7363
|
return cloneSymbol(object);
|
|
7362
7364
|
}
|
|
7363
7365
|
}
|
|
@@ -7414,11 +7416,11 @@ function initCloneObject$2(object) {
|
|
|
7414
7416
|
|
|
7415
7417
|
var _initCloneObject = initCloneObject$2;
|
|
7416
7418
|
|
|
7417
|
-
var getTag$
|
|
7418
|
-
isObjectLike$
|
|
7419
|
+
var getTag$2 = _getTag,
|
|
7420
|
+
isObjectLike$3 = isObjectLike_1;
|
|
7419
7421
|
|
|
7420
7422
|
/** `Object#toString` result references. */
|
|
7421
|
-
var mapTag$
|
|
7423
|
+
var mapTag$1 = '[object Map]';
|
|
7422
7424
|
|
|
7423
7425
|
/**
|
|
7424
7426
|
* The base implementation of `_.isMap` without Node.js optimizations.
|
|
@@ -7428,7 +7430,7 @@ var mapTag$2 = '[object Map]';
|
|
|
7428
7430
|
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
|
|
7429
7431
|
*/
|
|
7430
7432
|
function baseIsMap$1(value) {
|
|
7431
|
-
return isObjectLike$
|
|
7433
|
+
return isObjectLike$3(value) && getTag$2(value) == mapTag$1;
|
|
7432
7434
|
}
|
|
7433
7435
|
|
|
7434
7436
|
var _baseIsMap = baseIsMap$1;
|
|
@@ -7461,11 +7463,11 @@ var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
|
|
|
7461
7463
|
|
|
7462
7464
|
var isMap_1 = isMap$1;
|
|
7463
7465
|
|
|
7464
|
-
var getTag$
|
|
7465
|
-
isObjectLike$
|
|
7466
|
+
var getTag$1 = _getTag,
|
|
7467
|
+
isObjectLike$2 = isObjectLike_1;
|
|
7466
7468
|
|
|
7467
7469
|
/** `Object#toString` result references. */
|
|
7468
|
-
var setTag$
|
|
7470
|
+
var setTag$1 = '[object Set]';
|
|
7469
7471
|
|
|
7470
7472
|
/**
|
|
7471
7473
|
* The base implementation of `_.isSet` without Node.js optimizations.
|
|
@@ -7475,7 +7477,7 @@ var setTag$2 = '[object Set]';
|
|
|
7475
7477
|
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
|
|
7476
7478
|
*/
|
|
7477
7479
|
function baseIsSet$1(value) {
|
|
7478
|
-
return isObjectLike$
|
|
7480
|
+
return isObjectLike$2(value) && getTag$1(value) == setTag$1;
|
|
7479
7481
|
}
|
|
7480
7482
|
|
|
7481
7483
|
var _baseIsSet = baseIsSet$1;
|
|
@@ -7508,7 +7510,7 @@ var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
|
7508
7510
|
|
|
7509
7511
|
var isSet_1 = isSet$1;
|
|
7510
7512
|
|
|
7511
|
-
var Stack$
|
|
7513
|
+
var Stack$1 = _Stack,
|
|
7512
7514
|
arrayEach = _arrayEach,
|
|
7513
7515
|
assignValue = _assignValue,
|
|
7514
7516
|
baseAssign = _baseAssign,
|
|
@@ -7517,14 +7519,14 @@ var Stack$2 = _Stack,
|
|
|
7517
7519
|
copyArray$1 = _copyArray,
|
|
7518
7520
|
copySymbols = _copySymbols,
|
|
7519
7521
|
copySymbolsIn = _copySymbolsIn,
|
|
7520
|
-
getAllKeys
|
|
7522
|
+
getAllKeys = _getAllKeys,
|
|
7521
7523
|
getAllKeysIn = _getAllKeysIn,
|
|
7522
|
-
getTag
|
|
7524
|
+
getTag = _getTag,
|
|
7523
7525
|
initCloneArray = _initCloneArray,
|
|
7524
7526
|
initCloneByTag = _initCloneByTag,
|
|
7525
7527
|
initCloneObject$1 = _initCloneObject,
|
|
7526
|
-
isArray$
|
|
7527
|
-
isBuffer$
|
|
7528
|
+
isArray$1 = isArray_1,
|
|
7529
|
+
isBuffer$1 = isBufferExports,
|
|
7528
7530
|
isMap = isMap_1,
|
|
7529
7531
|
isObject$3 = isObject_1,
|
|
7530
7532
|
isSet = isSet_1,
|
|
@@ -7537,24 +7539,24 @@ var CLONE_DEEP_FLAG$1 = 1,
|
|
|
7537
7539
|
CLONE_SYMBOLS_FLAG$1 = 4;
|
|
7538
7540
|
|
|
7539
7541
|
/** `Object#toString` result references. */
|
|
7540
|
-
var argsTag
|
|
7541
|
-
arrayTag
|
|
7542
|
-
boolTag
|
|
7543
|
-
dateTag
|
|
7544
|
-
errorTag
|
|
7542
|
+
var argsTag = '[object Arguments]',
|
|
7543
|
+
arrayTag = '[object Array]',
|
|
7544
|
+
boolTag = '[object Boolean]',
|
|
7545
|
+
dateTag = '[object Date]',
|
|
7546
|
+
errorTag = '[object Error]',
|
|
7545
7547
|
funcTag = '[object Function]',
|
|
7546
7548
|
genTag = '[object GeneratorFunction]',
|
|
7547
|
-
mapTag
|
|
7548
|
-
numberTag
|
|
7549
|
-
objectTag$
|
|
7550
|
-
regexpTag
|
|
7551
|
-
setTag
|
|
7552
|
-
stringTag
|
|
7553
|
-
symbolTag
|
|
7549
|
+
mapTag = '[object Map]',
|
|
7550
|
+
numberTag = '[object Number]',
|
|
7551
|
+
objectTag$1 = '[object Object]',
|
|
7552
|
+
regexpTag = '[object RegExp]',
|
|
7553
|
+
setTag = '[object Set]',
|
|
7554
|
+
stringTag = '[object String]',
|
|
7555
|
+
symbolTag = '[object Symbol]',
|
|
7554
7556
|
weakMapTag = '[object WeakMap]';
|
|
7555
7557
|
|
|
7556
|
-
var arrayBufferTag
|
|
7557
|
-
dataViewTag
|
|
7558
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
7559
|
+
dataViewTag = '[object DataView]',
|
|
7558
7560
|
float32Tag = '[object Float32Array]',
|
|
7559
7561
|
float64Tag = '[object Float64Array]',
|
|
7560
7562
|
int8Tag = '[object Int8Array]',
|
|
@@ -7567,18 +7569,18 @@ var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
|
7567
7569
|
|
|
7568
7570
|
/** Used to identify `toStringTag` values supported by `_.clone`. */
|
|
7569
7571
|
var cloneableTags = {};
|
|
7570
|
-
cloneableTags[argsTag
|
|
7571
|
-
cloneableTags[arrayBufferTag
|
|
7572
|
-
cloneableTags[boolTag
|
|
7572
|
+
cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
|
7573
|
+
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
|
7574
|
+
cloneableTags[boolTag] = cloneableTags[dateTag] =
|
|
7573
7575
|
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
|
7574
7576
|
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
|
7575
|
-
cloneableTags[int32Tag] = cloneableTags[mapTag
|
|
7576
|
-
cloneableTags[numberTag
|
|
7577
|
-
cloneableTags[regexpTag
|
|
7578
|
-
cloneableTags[stringTag
|
|
7577
|
+
cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
|
7578
|
+
cloneableTags[numberTag] = cloneableTags[objectTag$1] =
|
|
7579
|
+
cloneableTags[regexpTag] = cloneableTags[setTag] =
|
|
7580
|
+
cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
|
7579
7581
|
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
|
7580
7582
|
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
7581
|
-
cloneableTags[errorTag
|
|
7583
|
+
cloneableTags[errorTag] = cloneableTags[funcTag] =
|
|
7582
7584
|
cloneableTags[weakMapTag] = false;
|
|
7583
7585
|
|
|
7584
7586
|
/**
|
|
@@ -7612,20 +7614,20 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
|
7612
7614
|
if (!isObject$3(value)) {
|
|
7613
7615
|
return value;
|
|
7614
7616
|
}
|
|
7615
|
-
var isArr = isArray$
|
|
7617
|
+
var isArr = isArray$1(value);
|
|
7616
7618
|
if (isArr) {
|
|
7617
7619
|
result = initCloneArray(value);
|
|
7618
7620
|
if (!isDeep) {
|
|
7619
7621
|
return copyArray$1(value, result);
|
|
7620
7622
|
}
|
|
7621
7623
|
} else {
|
|
7622
|
-
var tag = getTag
|
|
7624
|
+
var tag = getTag(value),
|
|
7623
7625
|
isFunc = tag == funcTag || tag == genTag;
|
|
7624
7626
|
|
|
7625
|
-
if (isBuffer$
|
|
7627
|
+
if (isBuffer$1(value)) {
|
|
7626
7628
|
return cloneBuffer$1(value, isDeep);
|
|
7627
7629
|
}
|
|
7628
|
-
if (tag == objectTag$
|
|
7630
|
+
if (tag == objectTag$1 || tag == argsTag || (isFunc && !object)) {
|
|
7629
7631
|
result = (isFlat || isFunc) ? {} : initCloneObject$1(value);
|
|
7630
7632
|
if (!isDeep) {
|
|
7631
7633
|
return isFlat
|
|
@@ -7640,7 +7642,7 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
|
7640
7642
|
}
|
|
7641
7643
|
}
|
|
7642
7644
|
// Check for circular references and return its corresponding clone.
|
|
7643
|
-
stack || (stack = new Stack$
|
|
7645
|
+
stack || (stack = new Stack$1);
|
|
7644
7646
|
var stacked = stack.get(value);
|
|
7645
7647
|
if (stacked) {
|
|
7646
7648
|
return stacked;
|
|
@@ -7658,7 +7660,7 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
|
7658
7660
|
}
|
|
7659
7661
|
|
|
7660
7662
|
var keysFunc = isFull
|
|
7661
|
-
? (isFlat ? getAllKeysIn : getAllKeys
|
|
7663
|
+
? (isFlat ? getAllKeysIn : getAllKeys)
|
|
7662
7664
|
: (isFlat ? keysIn$2 : keys);
|
|
7663
7665
|
|
|
7664
7666
|
var props = isArr ? undefined : keysFunc(value);
|
|
@@ -7707,1401 +7709,2366 @@ var cloneDeep_1 = cloneDeep;
|
|
|
7707
7709
|
|
|
7708
7710
|
var cloneDeep$1 = /*@__PURE__*/getDefaultExportFromCjs(cloneDeep_1);
|
|
7709
7711
|
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
7712
|
+
var baseAssignValue = _baseAssignValue,
|
|
7713
|
+
eq$1 = eq_1;
|
|
7713
7714
|
|
|
7714
7715
|
/**
|
|
7715
|
-
*
|
|
7716
|
+
* This function is like `assignValue` except that it doesn't assign
|
|
7717
|
+
* `undefined` values.
|
|
7716
7718
|
*
|
|
7717
7719
|
* @private
|
|
7718
|
-
* @
|
|
7719
|
-
* @
|
|
7720
|
-
* @
|
|
7721
|
-
* @param {*} value The value to cache.
|
|
7722
|
-
* @returns {Object} Returns the cache instance.
|
|
7720
|
+
* @param {Object} object The object to modify.
|
|
7721
|
+
* @param {string} key The key of the property to assign.
|
|
7722
|
+
* @param {*} value The value to assign.
|
|
7723
7723
|
*/
|
|
7724
|
-
function
|
|
7725
|
-
|
|
7726
|
-
|
|
7724
|
+
function assignMergeValue$2(object, key, value) {
|
|
7725
|
+
if ((value !== undefined && !eq$1(object[key], value)) ||
|
|
7726
|
+
(value === undefined && !(key in object))) {
|
|
7727
|
+
baseAssignValue(object, key, value);
|
|
7728
|
+
}
|
|
7727
7729
|
}
|
|
7728
7730
|
|
|
7729
|
-
var
|
|
7731
|
+
var _assignMergeValue = assignMergeValue$2;
|
|
7730
7732
|
|
|
7731
7733
|
/**
|
|
7732
|
-
*
|
|
7734
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
7733
7735
|
*
|
|
7734
7736
|
* @private
|
|
7735
|
-
* @
|
|
7736
|
-
* @
|
|
7737
|
-
* @param {*} value The value to search for.
|
|
7738
|
-
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
7737
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
7738
|
+
* @returns {Function} Returns the new base function.
|
|
7739
7739
|
*/
|
|
7740
7740
|
|
|
7741
|
-
function
|
|
7742
|
-
return
|
|
7741
|
+
function createBaseFor$1(fromRight) {
|
|
7742
|
+
return function(object, iteratee, keysFunc) {
|
|
7743
|
+
var index = -1,
|
|
7744
|
+
iterable = Object(object),
|
|
7745
|
+
props = keysFunc(object),
|
|
7746
|
+
length = props.length;
|
|
7747
|
+
|
|
7748
|
+
while (length--) {
|
|
7749
|
+
var key = props[fromRight ? length : ++index];
|
|
7750
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
7751
|
+
break;
|
|
7752
|
+
}
|
|
7753
|
+
}
|
|
7754
|
+
return object;
|
|
7755
|
+
};
|
|
7743
7756
|
}
|
|
7744
7757
|
|
|
7745
|
-
var
|
|
7758
|
+
var _createBaseFor = createBaseFor$1;
|
|
7746
7759
|
|
|
7747
|
-
var
|
|
7748
|
-
setCacheAdd = _setCacheAdd,
|
|
7749
|
-
setCacheHas = _setCacheHas;
|
|
7760
|
+
var createBaseFor = _createBaseFor;
|
|
7750
7761
|
|
|
7751
7762
|
/**
|
|
7752
|
-
*
|
|
7753
|
-
*
|
|
7763
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
7764
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
7765
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
7754
7766
|
*
|
|
7755
7767
|
* @private
|
|
7756
|
-
* @
|
|
7757
|
-
* @param {
|
|
7768
|
+
* @param {Object} object The object to iterate over.
|
|
7769
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
7770
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
7771
|
+
* @returns {Object} Returns `object`.
|
|
7758
7772
|
*/
|
|
7759
|
-
|
|
7760
|
-
var index = -1,
|
|
7761
|
-
length = values == null ? 0 : values.length;
|
|
7762
|
-
|
|
7763
|
-
this.__data__ = new MapCache;
|
|
7764
|
-
while (++index < length) {
|
|
7765
|
-
this.add(values[index]);
|
|
7766
|
-
}
|
|
7767
|
-
}
|
|
7773
|
+
var baseFor$1 = createBaseFor();
|
|
7768
7774
|
|
|
7769
|
-
|
|
7770
|
-
SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
|
|
7771
|
-
SetCache$1.prototype.has = setCacheHas;
|
|
7775
|
+
var _baseFor = baseFor$1;
|
|
7772
7776
|
|
|
7773
|
-
var
|
|
7777
|
+
var isArrayLike$1 = isArrayLike_1,
|
|
7778
|
+
isObjectLike$1 = isObjectLike_1;
|
|
7774
7779
|
|
|
7775
7780
|
/**
|
|
7776
|
-
*
|
|
7777
|
-
*
|
|
7781
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
7782
|
+
* is an object.
|
|
7778
7783
|
*
|
|
7779
|
-
* @
|
|
7780
|
-
* @
|
|
7781
|
-
* @
|
|
7782
|
-
* @
|
|
7784
|
+
* @static
|
|
7785
|
+
* @memberOf _
|
|
7786
|
+
* @since 4.0.0
|
|
7787
|
+
* @category Lang
|
|
7788
|
+
* @param {*} value The value to check.
|
|
7789
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
7783
7790
|
* else `false`.
|
|
7791
|
+
* @example
|
|
7792
|
+
*
|
|
7793
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
7794
|
+
* // => true
|
|
7795
|
+
*
|
|
7796
|
+
* _.isArrayLikeObject(document.body.children);
|
|
7797
|
+
* // => true
|
|
7798
|
+
*
|
|
7799
|
+
* _.isArrayLikeObject('abc');
|
|
7800
|
+
* // => false
|
|
7801
|
+
*
|
|
7802
|
+
* _.isArrayLikeObject(_.noop);
|
|
7803
|
+
* // => false
|
|
7784
7804
|
*/
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
var index = -1,
|
|
7788
|
-
length = array == null ? 0 : array.length;
|
|
7789
|
-
|
|
7790
|
-
while (++index < length) {
|
|
7791
|
-
if (predicate(array[index], index, array)) {
|
|
7792
|
-
return true;
|
|
7793
|
-
}
|
|
7794
|
-
}
|
|
7795
|
-
return false;
|
|
7805
|
+
function isArrayLikeObject$1(value) {
|
|
7806
|
+
return isObjectLike$1(value) && isArrayLike$1(value);
|
|
7796
7807
|
}
|
|
7797
7808
|
|
|
7798
|
-
var
|
|
7809
|
+
var isArrayLikeObject_1 = isArrayLikeObject$1;
|
|
7810
|
+
|
|
7811
|
+
var baseGetTag = _baseGetTag,
|
|
7812
|
+
getPrototype = _getPrototype,
|
|
7813
|
+
isObjectLike = isObjectLike_1;
|
|
7799
7814
|
|
|
7800
|
-
/**
|
|
7801
|
-
|
|
7802
|
-
*
|
|
7803
|
-
* @private
|
|
7804
|
-
* @param {Object} cache The cache to query.
|
|
7805
|
-
* @param {string} key The key of the entry to check.
|
|
7806
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
7807
|
-
*/
|
|
7815
|
+
/** `Object#toString` result references. */
|
|
7816
|
+
var objectTag = '[object Object]';
|
|
7808
7817
|
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7818
|
+
/** Used for built-in method references. */
|
|
7819
|
+
var funcProto = Function.prototype,
|
|
7820
|
+
objectProto = Object.prototype;
|
|
7812
7821
|
|
|
7813
|
-
|
|
7822
|
+
/** Used to resolve the decompiled source of functions. */
|
|
7823
|
+
var funcToString = funcProto.toString;
|
|
7814
7824
|
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
cacheHas = _cacheHas;
|
|
7825
|
+
/** Used to check objects for own properties. */
|
|
7826
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
7818
7827
|
|
|
7819
|
-
/** Used to
|
|
7820
|
-
var
|
|
7821
|
-
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
7828
|
+
/** Used to infer the `Object` constructor. */
|
|
7829
|
+
var objectCtorString = funcToString.call(Object);
|
|
7822
7830
|
|
|
7823
7831
|
/**
|
|
7824
|
-
*
|
|
7825
|
-
*
|
|
7832
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
7833
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
7826
7834
|
*
|
|
7827
|
-
* @
|
|
7828
|
-
* @
|
|
7829
|
-
* @
|
|
7830
|
-
* @
|
|
7831
|
-
* @param {
|
|
7832
|
-
* @
|
|
7833
|
-
* @
|
|
7834
|
-
*
|
|
7835
|
+
* @static
|
|
7836
|
+
* @memberOf _
|
|
7837
|
+
* @since 0.8.0
|
|
7838
|
+
* @category Lang
|
|
7839
|
+
* @param {*} value The value to check.
|
|
7840
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
7841
|
+
* @example
|
|
7842
|
+
*
|
|
7843
|
+
* function Foo() {
|
|
7844
|
+
* this.a = 1;
|
|
7845
|
+
* }
|
|
7846
|
+
*
|
|
7847
|
+
* _.isPlainObject(new Foo);
|
|
7848
|
+
* // => false
|
|
7849
|
+
*
|
|
7850
|
+
* _.isPlainObject([1, 2, 3]);
|
|
7851
|
+
* // => false
|
|
7852
|
+
*
|
|
7853
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
7854
|
+
* // => true
|
|
7855
|
+
*
|
|
7856
|
+
* _.isPlainObject(Object.create(null));
|
|
7857
|
+
* // => true
|
|
7835
7858
|
*/
|
|
7836
|
-
function
|
|
7837
|
-
|
|
7838
|
-
arrLength = array.length,
|
|
7839
|
-
othLength = other.length;
|
|
7840
|
-
|
|
7841
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
7859
|
+
function isPlainObject$1(value) {
|
|
7860
|
+
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
7842
7861
|
return false;
|
|
7843
7862
|
}
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
if (arrStacked && othStacked) {
|
|
7848
|
-
return arrStacked == other && othStacked == array;
|
|
7863
|
+
var proto = getPrototype(value);
|
|
7864
|
+
if (proto === null) {
|
|
7865
|
+
return true;
|
|
7849
7866
|
}
|
|
7850
|
-
var
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
stack.set(array, other);
|
|
7855
|
-
stack.set(other, array);
|
|
7867
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
7868
|
+
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
7869
|
+
funcToString.call(Ctor) == objectCtorString;
|
|
7870
|
+
}
|
|
7856
7871
|
|
|
7857
|
-
|
|
7858
|
-
while (++index < arrLength) {
|
|
7859
|
-
var arrValue = array[index],
|
|
7860
|
-
othValue = other[index];
|
|
7861
|
-
|
|
7862
|
-
if (customizer) {
|
|
7863
|
-
var compared = isPartial
|
|
7864
|
-
? customizer(othValue, arrValue, index, other, array, stack)
|
|
7865
|
-
: customizer(arrValue, othValue, index, array, other, stack);
|
|
7866
|
-
}
|
|
7867
|
-
if (compared !== undefined) {
|
|
7868
|
-
if (compared) {
|
|
7869
|
-
continue;
|
|
7870
|
-
}
|
|
7871
|
-
result = false;
|
|
7872
|
-
break;
|
|
7873
|
-
}
|
|
7874
|
-
// Recursively compare arrays (susceptible to call stack limits).
|
|
7875
|
-
if (seen) {
|
|
7876
|
-
if (!arraySome(other, function(othValue, othIndex) {
|
|
7877
|
-
if (!cacheHas(seen, othIndex) &&
|
|
7878
|
-
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
7879
|
-
return seen.push(othIndex);
|
|
7880
|
-
}
|
|
7881
|
-
})) {
|
|
7882
|
-
result = false;
|
|
7883
|
-
break;
|
|
7884
|
-
}
|
|
7885
|
-
} else if (!(
|
|
7886
|
-
arrValue === othValue ||
|
|
7887
|
-
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
|
7888
|
-
)) {
|
|
7889
|
-
result = false;
|
|
7890
|
-
break;
|
|
7891
|
-
}
|
|
7892
|
-
}
|
|
7893
|
-
stack['delete'](array);
|
|
7894
|
-
stack['delete'](other);
|
|
7895
|
-
return result;
|
|
7896
|
-
}
|
|
7897
|
-
|
|
7898
|
-
var _equalArrays = equalArrays$2;
|
|
7872
|
+
var isPlainObject_1 = isPlainObject$1;
|
|
7899
7873
|
|
|
7900
7874
|
/**
|
|
7901
|
-
*
|
|
7875
|
+
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
7902
7876
|
*
|
|
7903
7877
|
* @private
|
|
7904
|
-
* @param {Object}
|
|
7905
|
-
* @
|
|
7878
|
+
* @param {Object} object The object to query.
|
|
7879
|
+
* @param {string} key The key of the property to get.
|
|
7880
|
+
* @returns {*} Returns the property value.
|
|
7906
7881
|
*/
|
|
7907
7882
|
|
|
7908
|
-
function
|
|
7909
|
-
|
|
7910
|
-
|
|
7883
|
+
function safeGet$2(object, key) {
|
|
7884
|
+
if (key === 'constructor' && typeof object[key] === 'function') {
|
|
7885
|
+
return;
|
|
7886
|
+
}
|
|
7911
7887
|
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
}
|
|
7915
|
-
|
|
7888
|
+
if (key == '__proto__') {
|
|
7889
|
+
return;
|
|
7890
|
+
}
|
|
7891
|
+
|
|
7892
|
+
return object[key];
|
|
7916
7893
|
}
|
|
7917
7894
|
|
|
7918
|
-
var
|
|
7895
|
+
var _safeGet = safeGet$2;
|
|
7896
|
+
|
|
7897
|
+
var copyObject = _copyObject,
|
|
7898
|
+
keysIn$1 = keysIn_1;
|
|
7919
7899
|
|
|
7920
7900
|
/**
|
|
7921
|
-
* Converts `
|
|
7901
|
+
* Converts `value` to a plain object flattening inherited enumerable string
|
|
7902
|
+
* keyed properties of `value` to own properties of the plain object.
|
|
7922
7903
|
*
|
|
7923
|
-
* @
|
|
7924
|
-
* @
|
|
7925
|
-
* @
|
|
7904
|
+
* @static
|
|
7905
|
+
* @memberOf _
|
|
7906
|
+
* @since 3.0.0
|
|
7907
|
+
* @category Lang
|
|
7908
|
+
* @param {*} value The value to convert.
|
|
7909
|
+
* @returns {Object} Returns the converted plain object.
|
|
7910
|
+
* @example
|
|
7911
|
+
*
|
|
7912
|
+
* function Foo() {
|
|
7913
|
+
* this.b = 2;
|
|
7914
|
+
* }
|
|
7915
|
+
*
|
|
7916
|
+
* Foo.prototype.c = 3;
|
|
7917
|
+
*
|
|
7918
|
+
* _.assign({ 'a': 1 }, new Foo);
|
|
7919
|
+
* // => { 'a': 1, 'b': 2 }
|
|
7920
|
+
*
|
|
7921
|
+
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
|
|
7922
|
+
* // => { 'a': 1, 'b': 2, 'c': 3 }
|
|
7926
7923
|
*/
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
var index = -1,
|
|
7930
|
-
result = Array(set.size);
|
|
7931
|
-
|
|
7932
|
-
set.forEach(function(value) {
|
|
7933
|
-
result[++index] = value;
|
|
7934
|
-
});
|
|
7935
|
-
return result;
|
|
7924
|
+
function toPlainObject$1(value) {
|
|
7925
|
+
return copyObject(value, keysIn$1(value));
|
|
7936
7926
|
}
|
|
7937
7927
|
|
|
7938
|
-
var
|
|
7939
|
-
|
|
7940
|
-
var Symbol = _Symbol,
|
|
7941
|
-
Uint8Array = _Uint8Array,
|
|
7942
|
-
eq$2 = eq_1,
|
|
7943
|
-
equalArrays$1 = _equalArrays,
|
|
7944
|
-
mapToArray = _mapToArray,
|
|
7945
|
-
setToArray = _setToArray;
|
|
7946
|
-
|
|
7947
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
7948
|
-
var COMPARE_PARTIAL_FLAG$2 = 1,
|
|
7949
|
-
COMPARE_UNORDERED_FLAG = 2;
|
|
7950
|
-
|
|
7951
|
-
/** `Object#toString` result references. */
|
|
7952
|
-
var boolTag = '[object Boolean]',
|
|
7953
|
-
dateTag = '[object Date]',
|
|
7954
|
-
errorTag = '[object Error]',
|
|
7955
|
-
mapTag = '[object Map]',
|
|
7956
|
-
numberTag = '[object Number]',
|
|
7957
|
-
regexpTag = '[object RegExp]',
|
|
7958
|
-
setTag = '[object Set]',
|
|
7959
|
-
stringTag = '[object String]',
|
|
7960
|
-
symbolTag = '[object Symbol]';
|
|
7961
|
-
|
|
7962
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
7963
|
-
dataViewTag = '[object DataView]';
|
|
7928
|
+
var toPlainObject_1 = toPlainObject$1;
|
|
7964
7929
|
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7930
|
+
var assignMergeValue$1 = _assignMergeValue,
|
|
7931
|
+
cloneBuffer = _cloneBufferExports,
|
|
7932
|
+
cloneTypedArray = _cloneTypedArray,
|
|
7933
|
+
copyArray = _copyArray,
|
|
7934
|
+
initCloneObject = _initCloneObject,
|
|
7935
|
+
isArguments = isArguments_1,
|
|
7936
|
+
isArray = isArray_1,
|
|
7937
|
+
isArrayLikeObject = isArrayLikeObject_1,
|
|
7938
|
+
isBuffer = isBufferExports,
|
|
7939
|
+
isFunction = isFunction_1,
|
|
7940
|
+
isObject$2 = isObject_1,
|
|
7941
|
+
isPlainObject = isPlainObject_1,
|
|
7942
|
+
isTypedArray = isTypedArray_1,
|
|
7943
|
+
safeGet$1 = _safeGet,
|
|
7944
|
+
toPlainObject = toPlainObject_1;
|
|
7968
7945
|
|
|
7969
7946
|
/**
|
|
7970
|
-
* A specialized version of `
|
|
7971
|
-
*
|
|
7972
|
-
*
|
|
7973
|
-
* **Note:** This function only supports comparing values with tags of
|
|
7974
|
-
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
7947
|
+
* A specialized version of `baseMerge` for arrays and objects which performs
|
|
7948
|
+
* deep merges and tracks traversed objects enabling objects with circular
|
|
7949
|
+
* references to be merged.
|
|
7975
7950
|
*
|
|
7976
7951
|
* @private
|
|
7977
|
-
* @param {Object} object The object
|
|
7978
|
-
* @param {Object}
|
|
7979
|
-
* @param {string}
|
|
7980
|
-
* @param {number}
|
|
7981
|
-
* @param {Function}
|
|
7982
|
-
* @param {Function}
|
|
7983
|
-
* @param {Object} stack Tracks traversed
|
|
7984
|
-
*
|
|
7952
|
+
* @param {Object} object The destination object.
|
|
7953
|
+
* @param {Object} source The source object.
|
|
7954
|
+
* @param {string} key The key of the value to merge.
|
|
7955
|
+
* @param {number} srcIndex The index of `source`.
|
|
7956
|
+
* @param {Function} mergeFunc The function to merge values.
|
|
7957
|
+
* @param {Function} [customizer] The function to customize assigned values.
|
|
7958
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
7959
|
+
* counterparts.
|
|
7985
7960
|
*/
|
|
7986
|
-
function
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
(object.byteOffset != other.byteOffset)) {
|
|
7991
|
-
return false;
|
|
7992
|
-
}
|
|
7993
|
-
object = object.buffer;
|
|
7994
|
-
other = other.buffer;
|
|
7995
|
-
|
|
7996
|
-
case arrayBufferTag:
|
|
7997
|
-
if ((object.byteLength != other.byteLength) ||
|
|
7998
|
-
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
7999
|
-
return false;
|
|
8000
|
-
}
|
|
8001
|
-
return true;
|
|
8002
|
-
|
|
8003
|
-
case boolTag:
|
|
8004
|
-
case dateTag:
|
|
8005
|
-
case numberTag:
|
|
8006
|
-
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
8007
|
-
// Invalid dates are coerced to `NaN`.
|
|
8008
|
-
return eq$2(+object, +other);
|
|
8009
|
-
|
|
8010
|
-
case errorTag:
|
|
8011
|
-
return object.name == other.name && object.message == other.message;
|
|
7961
|
+
function baseMergeDeep$1(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
7962
|
+
var objValue = safeGet$1(object, key),
|
|
7963
|
+
srcValue = safeGet$1(source, key),
|
|
7964
|
+
stacked = stack.get(srcValue);
|
|
8012
7965
|
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
7966
|
+
if (stacked) {
|
|
7967
|
+
assignMergeValue$1(object, key, stacked);
|
|
7968
|
+
return;
|
|
7969
|
+
}
|
|
7970
|
+
var newValue = customizer
|
|
7971
|
+
? customizer(objValue, srcValue, (key + ''), object, source, stack)
|
|
7972
|
+
: undefined;
|
|
8019
7973
|
|
|
8020
|
-
|
|
8021
|
-
var convert = mapToArray;
|
|
7974
|
+
var isCommon = newValue === undefined;
|
|
8022
7975
|
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
7976
|
+
if (isCommon) {
|
|
7977
|
+
var isArr = isArray(srcValue),
|
|
7978
|
+
isBuff = !isArr && isBuffer(srcValue),
|
|
7979
|
+
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
8026
7980
|
|
|
8027
|
-
|
|
8028
|
-
|
|
7981
|
+
newValue = srcValue;
|
|
7982
|
+
if (isArr || isBuff || isTyped) {
|
|
7983
|
+
if (isArray(objValue)) {
|
|
7984
|
+
newValue = objValue;
|
|
8029
7985
|
}
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
if (stacked) {
|
|
8033
|
-
return stacked == other;
|
|
7986
|
+
else if (isArrayLikeObject(objValue)) {
|
|
7987
|
+
newValue = copyArray(objValue);
|
|
8034
7988
|
}
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
7989
|
+
else if (isBuff) {
|
|
7990
|
+
isCommon = false;
|
|
7991
|
+
newValue = cloneBuffer(srcValue, true);
|
|
7992
|
+
}
|
|
7993
|
+
else if (isTyped) {
|
|
7994
|
+
isCommon = false;
|
|
7995
|
+
newValue = cloneTypedArray(srcValue, true);
|
|
7996
|
+
}
|
|
7997
|
+
else {
|
|
7998
|
+
newValue = [];
|
|
7999
|
+
}
|
|
8000
|
+
}
|
|
8001
|
+
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
8002
|
+
newValue = objValue;
|
|
8003
|
+
if (isArguments(objValue)) {
|
|
8004
|
+
newValue = toPlainObject(objValue);
|
|
8046
8005
|
}
|
|
8006
|
+
else if (!isObject$2(objValue) || isFunction(objValue)) {
|
|
8007
|
+
newValue = initCloneObject(srcValue);
|
|
8008
|
+
}
|
|
8009
|
+
}
|
|
8010
|
+
else {
|
|
8011
|
+
isCommon = false;
|
|
8012
|
+
}
|
|
8047
8013
|
}
|
|
8048
|
-
|
|
8014
|
+
if (isCommon) {
|
|
8015
|
+
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
8016
|
+
stack.set(srcValue, newValue);
|
|
8017
|
+
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
8018
|
+
stack['delete'](srcValue);
|
|
8019
|
+
}
|
|
8020
|
+
assignMergeValue$1(object, key, newValue);
|
|
8049
8021
|
}
|
|
8050
8022
|
|
|
8051
|
-
var
|
|
8052
|
-
|
|
8053
|
-
var getAllKeys = _getAllKeys;
|
|
8054
|
-
|
|
8055
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
8056
|
-
var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
8057
|
-
|
|
8058
|
-
/** Used for built-in method references. */
|
|
8059
|
-
var objectProto$2 = Object.prototype;
|
|
8023
|
+
var _baseMergeDeep = baseMergeDeep$1;
|
|
8060
8024
|
|
|
8061
|
-
|
|
8062
|
-
|
|
8025
|
+
var Stack = _Stack,
|
|
8026
|
+
assignMergeValue = _assignMergeValue,
|
|
8027
|
+
baseFor = _baseFor,
|
|
8028
|
+
baseMergeDeep = _baseMergeDeep,
|
|
8029
|
+
isObject$1 = isObject_1,
|
|
8030
|
+
keysIn = keysIn_1,
|
|
8031
|
+
safeGet = _safeGet;
|
|
8063
8032
|
|
|
8064
8033
|
/**
|
|
8065
|
-
*
|
|
8066
|
-
* partial deep comparisons.
|
|
8034
|
+
* The base implementation of `_.merge` without support for multiple sources.
|
|
8067
8035
|
*
|
|
8068
8036
|
* @private
|
|
8069
|
-
* @param {Object} object The object
|
|
8070
|
-
* @param {Object}
|
|
8071
|
-
* @param {number}
|
|
8072
|
-
* @param {Function} customizer The function to customize
|
|
8073
|
-
* @param {
|
|
8074
|
-
*
|
|
8075
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
8037
|
+
* @param {Object} object The destination object.
|
|
8038
|
+
* @param {Object} source The source object.
|
|
8039
|
+
* @param {number} srcIndex The index of `source`.
|
|
8040
|
+
* @param {Function} [customizer] The function to customize merged values.
|
|
8041
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
8042
|
+
* counterparts.
|
|
8076
8043
|
*/
|
|
8077
|
-
function
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
objLength = objProps.length,
|
|
8081
|
-
othProps = getAllKeys(other),
|
|
8082
|
-
othLength = othProps.length;
|
|
8083
|
-
|
|
8084
|
-
if (objLength != othLength && !isPartial) {
|
|
8085
|
-
return false;
|
|
8086
|
-
}
|
|
8087
|
-
var index = objLength;
|
|
8088
|
-
while (index--) {
|
|
8089
|
-
var key = objProps[index];
|
|
8090
|
-
if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
|
|
8091
|
-
return false;
|
|
8092
|
-
}
|
|
8093
|
-
}
|
|
8094
|
-
// Check that cyclic values are equal.
|
|
8095
|
-
var objStacked = stack.get(object);
|
|
8096
|
-
var othStacked = stack.get(other);
|
|
8097
|
-
if (objStacked && othStacked) {
|
|
8098
|
-
return objStacked == other && othStacked == object;
|
|
8044
|
+
function baseMerge$1(object, source, srcIndex, customizer, stack) {
|
|
8045
|
+
if (object === source) {
|
|
8046
|
+
return;
|
|
8099
8047
|
}
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
var skipCtor = isPartial;
|
|
8105
|
-
while (++index < objLength) {
|
|
8106
|
-
key = objProps[index];
|
|
8107
|
-
var objValue = object[key],
|
|
8108
|
-
othValue = other[key];
|
|
8109
|
-
|
|
8110
|
-
if (customizer) {
|
|
8111
|
-
var compared = isPartial
|
|
8112
|
-
? customizer(othValue, objValue, key, other, object, stack)
|
|
8113
|
-
: customizer(objValue, othValue, key, object, other, stack);
|
|
8114
|
-
}
|
|
8115
|
-
// Recursively compare objects (susceptible to call stack limits).
|
|
8116
|
-
if (!(compared === undefined
|
|
8117
|
-
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
|
8118
|
-
: compared
|
|
8119
|
-
)) {
|
|
8120
|
-
result = false;
|
|
8121
|
-
break;
|
|
8048
|
+
baseFor(source, function(srcValue, key) {
|
|
8049
|
+
stack || (stack = new Stack);
|
|
8050
|
+
if (isObject$1(srcValue)) {
|
|
8051
|
+
baseMergeDeep(object, source, key, srcIndex, baseMerge$1, customizer, stack);
|
|
8122
8052
|
}
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
|
8133
|
-
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
|
8134
|
-
result = false;
|
|
8053
|
+
else {
|
|
8054
|
+
var newValue = customizer
|
|
8055
|
+
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
|
|
8056
|
+
: undefined;
|
|
8057
|
+
|
|
8058
|
+
if (newValue === undefined) {
|
|
8059
|
+
newValue = srcValue;
|
|
8060
|
+
}
|
|
8061
|
+
assignMergeValue(object, key, newValue);
|
|
8135
8062
|
}
|
|
8136
|
-
}
|
|
8137
|
-
stack['delete'](object);
|
|
8138
|
-
stack['delete'](other);
|
|
8139
|
-
return result;
|
|
8063
|
+
}, keysIn);
|
|
8140
8064
|
}
|
|
8141
8065
|
|
|
8142
|
-
var
|
|
8143
|
-
|
|
8144
|
-
var Stack$1 = _Stack,
|
|
8145
|
-
equalArrays = _equalArrays,
|
|
8146
|
-
equalByTag = _equalByTag,
|
|
8147
|
-
equalObjects = _equalObjects,
|
|
8148
|
-
getTag = _getTag,
|
|
8149
|
-
isArray$1 = isArray_1,
|
|
8150
|
-
isBuffer$1 = isBufferExports,
|
|
8151
|
-
isTypedArray$1 = isTypedArray_1;
|
|
8152
|
-
|
|
8153
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
8154
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
8066
|
+
var _baseMerge = baseMerge$1;
|
|
8155
8067
|
|
|
8156
|
-
/**
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8068
|
+
/**
|
|
8069
|
+
* This method returns the first argument it receives.
|
|
8070
|
+
*
|
|
8071
|
+
* @static
|
|
8072
|
+
* @since 0.1.0
|
|
8073
|
+
* @memberOf _
|
|
8074
|
+
* @category Util
|
|
8075
|
+
* @param {*} value Any value.
|
|
8076
|
+
* @returns {*} Returns `value`.
|
|
8077
|
+
* @example
|
|
8078
|
+
*
|
|
8079
|
+
* var object = { 'a': 1 };
|
|
8080
|
+
*
|
|
8081
|
+
* console.log(_.identity(object) === object);
|
|
8082
|
+
* // => true
|
|
8083
|
+
*/
|
|
8160
8084
|
|
|
8161
|
-
|
|
8162
|
-
|
|
8085
|
+
function identity$2(value) {
|
|
8086
|
+
return value;
|
|
8087
|
+
}
|
|
8163
8088
|
|
|
8164
|
-
|
|
8165
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
8089
|
+
var identity_1 = identity$2;
|
|
8166
8090
|
|
|
8167
8091
|
/**
|
|
8168
|
-
* A
|
|
8169
|
-
*
|
|
8170
|
-
* references to be compared.
|
|
8092
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
8093
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
8171
8094
|
*
|
|
8172
8095
|
* @private
|
|
8173
|
-
* @param {
|
|
8174
|
-
* @param {
|
|
8175
|
-
* @param {
|
|
8176
|
-
* @
|
|
8177
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
8178
|
-
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
8179
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
8096
|
+
* @param {Function} func The function to invoke.
|
|
8097
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
8098
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
8099
|
+
* @returns {*} Returns the result of `func`.
|
|
8180
8100
|
*/
|
|
8181
|
-
function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
|
|
8182
|
-
var objIsArr = isArray$1(object),
|
|
8183
|
-
othIsArr = isArray$1(other),
|
|
8184
|
-
objTag = objIsArr ? arrayTag : getTag(object),
|
|
8185
|
-
othTag = othIsArr ? arrayTag : getTag(other);
|
|
8186
8101
|
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
if (isSameTag && isBuffer$1(object)) {
|
|
8195
|
-
if (!isBuffer$1(other)) {
|
|
8196
|
-
return false;
|
|
8197
|
-
}
|
|
8198
|
-
objIsArr = true;
|
|
8199
|
-
objIsObj = false;
|
|
8200
|
-
}
|
|
8201
|
-
if (isSameTag && !objIsObj) {
|
|
8202
|
-
stack || (stack = new Stack$1);
|
|
8203
|
-
return (objIsArr || isTypedArray$1(object))
|
|
8204
|
-
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
8205
|
-
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
8206
|
-
}
|
|
8207
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
8208
|
-
var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, '__wrapped__'),
|
|
8209
|
-
othIsWrapped = othIsObj && hasOwnProperty$1.call(other, '__wrapped__');
|
|
8210
|
-
|
|
8211
|
-
if (objIsWrapped || othIsWrapped) {
|
|
8212
|
-
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
8213
|
-
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
8214
|
-
|
|
8215
|
-
stack || (stack = new Stack$1);
|
|
8216
|
-
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
8217
|
-
}
|
|
8218
|
-
}
|
|
8219
|
-
if (!isSameTag) {
|
|
8220
|
-
return false;
|
|
8102
|
+
function apply$1(func, thisArg, args) {
|
|
8103
|
+
switch (args.length) {
|
|
8104
|
+
case 0: return func.call(thisArg);
|
|
8105
|
+
case 1: return func.call(thisArg, args[0]);
|
|
8106
|
+
case 2: return func.call(thisArg, args[0], args[1]);
|
|
8107
|
+
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
8221
8108
|
}
|
|
8222
|
-
|
|
8223
|
-
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
8109
|
+
return func.apply(thisArg, args);
|
|
8224
8110
|
}
|
|
8225
8111
|
|
|
8226
|
-
var
|
|
8112
|
+
var _apply = apply$1;
|
|
8113
|
+
|
|
8114
|
+
var apply = _apply;
|
|
8227
8115
|
|
|
8228
|
-
|
|
8229
|
-
|
|
8116
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
8117
|
+
var nativeMax = Math.max;
|
|
8230
8118
|
|
|
8231
8119
|
/**
|
|
8232
|
-
*
|
|
8233
|
-
* and tracks traversed objects.
|
|
8120
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
|
8234
8121
|
*
|
|
8235
8122
|
* @private
|
|
8236
|
-
* @param {
|
|
8237
|
-
* @param {
|
|
8238
|
-
* @param {
|
|
8239
|
-
*
|
|
8240
|
-
* 2 - Partial comparison
|
|
8241
|
-
* @param {Function} [customizer] The function to customize comparisons.
|
|
8242
|
-
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
|
8243
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
8123
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
8124
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
8125
|
+
* @param {Function} transform The rest array transform.
|
|
8126
|
+
* @returns {Function} Returns the new function.
|
|
8244
8127
|
*/
|
|
8245
|
-
function
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$1, stack);
|
|
8253
|
-
}
|
|
8128
|
+
function overRest$1(func, start, transform) {
|
|
8129
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
8130
|
+
return function() {
|
|
8131
|
+
var args = arguments,
|
|
8132
|
+
index = -1,
|
|
8133
|
+
length = nativeMax(args.length - start, 0),
|
|
8134
|
+
array = Array(length);
|
|
8254
8135
|
|
|
8255
|
-
|
|
8136
|
+
while (++index < length) {
|
|
8137
|
+
array[index] = args[start + index];
|
|
8138
|
+
}
|
|
8139
|
+
index = -1;
|
|
8140
|
+
var otherArgs = Array(start + 1);
|
|
8141
|
+
while (++index < start) {
|
|
8142
|
+
otherArgs[index] = args[index];
|
|
8143
|
+
}
|
|
8144
|
+
otherArgs[start] = transform(array);
|
|
8145
|
+
return apply(func, this, otherArgs);
|
|
8146
|
+
};
|
|
8147
|
+
}
|
|
8256
8148
|
|
|
8257
|
-
var
|
|
8149
|
+
var _overRest = overRest$1;
|
|
8258
8150
|
|
|
8259
8151
|
/**
|
|
8260
|
-
*
|
|
8261
|
-
* equivalent.
|
|
8262
|
-
*
|
|
8263
|
-
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
8264
|
-
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
8265
|
-
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
8266
|
-
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
8267
|
-
* nodes are compared by strict equality, i.e. `===`.
|
|
8152
|
+
* Creates a function that returns `value`.
|
|
8268
8153
|
*
|
|
8269
8154
|
* @static
|
|
8270
8155
|
* @memberOf _
|
|
8271
|
-
* @since
|
|
8272
|
-
* @category
|
|
8273
|
-
* @param {*} value The value to
|
|
8274
|
-
* @
|
|
8275
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
8156
|
+
* @since 2.4.0
|
|
8157
|
+
* @category Util
|
|
8158
|
+
* @param {*} value The value to return from the new function.
|
|
8159
|
+
* @returns {Function} Returns the new constant function.
|
|
8276
8160
|
* @example
|
|
8277
8161
|
*
|
|
8278
|
-
* var
|
|
8279
|
-
* var other = { 'a': 1 };
|
|
8162
|
+
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
8280
8163
|
*
|
|
8281
|
-
*
|
|
8282
|
-
* // =>
|
|
8164
|
+
* console.log(objects);
|
|
8165
|
+
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
8283
8166
|
*
|
|
8284
|
-
*
|
|
8285
|
-
* // =>
|
|
8167
|
+
* console.log(objects[0] === objects[1]);
|
|
8168
|
+
* // => true
|
|
8286
8169
|
*/
|
|
8287
|
-
function isEqual(value, other) {
|
|
8288
|
-
return baseIsEqual(value, other);
|
|
8289
|
-
}
|
|
8290
8170
|
|
|
8291
|
-
|
|
8171
|
+
function constant$1(value) {
|
|
8172
|
+
return function() {
|
|
8173
|
+
return value;
|
|
8174
|
+
};
|
|
8175
|
+
}
|
|
8292
8176
|
|
|
8293
|
-
var
|
|
8177
|
+
var constant_1 = constant$1;
|
|
8294
8178
|
|
|
8295
|
-
var
|
|
8296
|
-
|
|
8179
|
+
var constant = constant_1,
|
|
8180
|
+
defineProperty = _defineProperty,
|
|
8181
|
+
identity$1 = identity_1;
|
|
8297
8182
|
|
|
8298
8183
|
/**
|
|
8299
|
-
*
|
|
8300
|
-
* `undefined` values.
|
|
8184
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
|
8301
8185
|
*
|
|
8302
8186
|
* @private
|
|
8303
|
-
* @param {
|
|
8304
|
-
* @param {
|
|
8305
|
-
* @
|
|
8187
|
+
* @param {Function} func The function to modify.
|
|
8188
|
+
* @param {Function} string The `toString` result.
|
|
8189
|
+
* @returns {Function} Returns `func`.
|
|
8306
8190
|
*/
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8191
|
+
var baseSetToString$1 = !defineProperty ? identity$1 : function(func, string) {
|
|
8192
|
+
return defineProperty(func, 'toString', {
|
|
8193
|
+
'configurable': true,
|
|
8194
|
+
'enumerable': false,
|
|
8195
|
+
'value': constant(string),
|
|
8196
|
+
'writable': true
|
|
8197
|
+
});
|
|
8198
|
+
};
|
|
8313
8199
|
|
|
8314
|
-
var
|
|
8200
|
+
var _baseSetToString = baseSetToString$1;
|
|
8201
|
+
|
|
8202
|
+
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
8203
|
+
|
|
8204
|
+
var HOT_COUNT = 800,
|
|
8205
|
+
HOT_SPAN = 16;
|
|
8206
|
+
|
|
8207
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
8208
|
+
var nativeNow = Date.now;
|
|
8315
8209
|
|
|
8316
8210
|
/**
|
|
8317
|
-
* Creates a
|
|
8211
|
+
* Creates a function that'll short out and invoke `identity` instead
|
|
8212
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
8213
|
+
* milliseconds.
|
|
8318
8214
|
*
|
|
8319
8215
|
* @private
|
|
8320
|
-
* @param {
|
|
8321
|
-
* @returns {Function} Returns the new
|
|
8216
|
+
* @param {Function} func The function to restrict.
|
|
8217
|
+
* @returns {Function} Returns the new shortable function.
|
|
8322
8218
|
*/
|
|
8219
|
+
function shortOut$1(func) {
|
|
8220
|
+
var count = 0,
|
|
8221
|
+
lastCalled = 0;
|
|
8323
8222
|
|
|
8324
|
-
function
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
iterable = Object(object),
|
|
8328
|
-
props = keysFunc(object),
|
|
8329
|
-
length = props.length;
|
|
8223
|
+
return function() {
|
|
8224
|
+
var stamp = nativeNow(),
|
|
8225
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
8330
8226
|
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
if (
|
|
8334
|
-
|
|
8227
|
+
lastCalled = stamp;
|
|
8228
|
+
if (remaining > 0) {
|
|
8229
|
+
if (++count >= HOT_COUNT) {
|
|
8230
|
+
return arguments[0];
|
|
8335
8231
|
}
|
|
8232
|
+
} else {
|
|
8233
|
+
count = 0;
|
|
8336
8234
|
}
|
|
8337
|
-
return
|
|
8235
|
+
return func.apply(undefined, arguments);
|
|
8338
8236
|
};
|
|
8339
8237
|
}
|
|
8340
8238
|
|
|
8341
|
-
var
|
|
8239
|
+
var _shortOut = shortOut$1;
|
|
8342
8240
|
|
|
8343
|
-
var
|
|
8241
|
+
var baseSetToString = _baseSetToString,
|
|
8242
|
+
shortOut = _shortOut;
|
|
8344
8243
|
|
|
8345
8244
|
/**
|
|
8346
|
-
*
|
|
8347
|
-
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
8348
|
-
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
8245
|
+
* Sets the `toString` method of `func` to return `string`.
|
|
8349
8246
|
*
|
|
8350
8247
|
* @private
|
|
8351
|
-
* @param {
|
|
8352
|
-
* @param {Function}
|
|
8353
|
-
* @
|
|
8354
|
-
* @returns {Object} Returns `object`.
|
|
8248
|
+
* @param {Function} func The function to modify.
|
|
8249
|
+
* @param {Function} string The `toString` result.
|
|
8250
|
+
* @returns {Function} Returns `func`.
|
|
8355
8251
|
*/
|
|
8356
|
-
var
|
|
8252
|
+
var setToString$1 = shortOut(baseSetToString);
|
|
8357
8253
|
|
|
8358
|
-
var
|
|
8254
|
+
var _setToString = setToString$1;
|
|
8359
8255
|
|
|
8360
|
-
var
|
|
8361
|
-
|
|
8256
|
+
var identity = identity_1,
|
|
8257
|
+
overRest = _overRest,
|
|
8258
|
+
setToString = _setToString;
|
|
8362
8259
|
|
|
8363
8260
|
/**
|
|
8364
|
-
*
|
|
8365
|
-
* is an object.
|
|
8366
|
-
*
|
|
8367
|
-
* @static
|
|
8368
|
-
* @memberOf _
|
|
8369
|
-
* @since 4.0.0
|
|
8370
|
-
* @category Lang
|
|
8371
|
-
* @param {*} value The value to check.
|
|
8372
|
-
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
8373
|
-
* else `false`.
|
|
8374
|
-
* @example
|
|
8375
|
-
*
|
|
8376
|
-
* _.isArrayLikeObject([1, 2, 3]);
|
|
8377
|
-
* // => true
|
|
8378
|
-
*
|
|
8379
|
-
* _.isArrayLikeObject(document.body.children);
|
|
8380
|
-
* // => true
|
|
8381
|
-
*
|
|
8382
|
-
* _.isArrayLikeObject('abc');
|
|
8383
|
-
* // => false
|
|
8261
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
8384
8262
|
*
|
|
8385
|
-
*
|
|
8386
|
-
*
|
|
8263
|
+
* @private
|
|
8264
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
8265
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
8266
|
+
* @returns {Function} Returns the new function.
|
|
8387
8267
|
*/
|
|
8388
|
-
function
|
|
8389
|
-
return
|
|
8268
|
+
function baseRest$1(func, start) {
|
|
8269
|
+
return setToString(overRest(func, start, identity), func + '');
|
|
8390
8270
|
}
|
|
8391
8271
|
|
|
8392
|
-
var
|
|
8393
|
-
|
|
8394
|
-
var baseGetTag = _baseGetTag,
|
|
8395
|
-
getPrototype = _getPrototype,
|
|
8396
|
-
isObjectLike = isObjectLike_1;
|
|
8272
|
+
var _baseRest = baseRest$1;
|
|
8397
8273
|
|
|
8398
|
-
|
|
8399
|
-
|
|
8274
|
+
var eq = eq_1,
|
|
8275
|
+
isArrayLike = isArrayLike_1,
|
|
8276
|
+
isIndex = _isIndex,
|
|
8277
|
+
isObject = isObject_1;
|
|
8400
8278
|
|
|
8401
|
-
/**
|
|
8402
|
-
|
|
8403
|
-
|
|
8279
|
+
/**
|
|
8280
|
+
* Checks if the given arguments are from an iteratee call.
|
|
8281
|
+
*
|
|
8282
|
+
* @private
|
|
8283
|
+
* @param {*} value The potential iteratee value argument.
|
|
8284
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
8285
|
+
* @param {*} object The potential iteratee object argument.
|
|
8286
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
8287
|
+
* else `false`.
|
|
8288
|
+
*/
|
|
8289
|
+
function isIterateeCall$1(value, index, object) {
|
|
8290
|
+
if (!isObject(object)) {
|
|
8291
|
+
return false;
|
|
8292
|
+
}
|
|
8293
|
+
var type = typeof index;
|
|
8294
|
+
if (type == 'number'
|
|
8295
|
+
? (isArrayLike(object) && isIndex(index, object.length))
|
|
8296
|
+
: (type == 'string' && index in object)
|
|
8297
|
+
) {
|
|
8298
|
+
return eq(object[index], value);
|
|
8299
|
+
}
|
|
8300
|
+
return false;
|
|
8301
|
+
}
|
|
8404
8302
|
|
|
8405
|
-
|
|
8406
|
-
var funcToString = funcProto.toString;
|
|
8303
|
+
var _isIterateeCall = isIterateeCall$1;
|
|
8407
8304
|
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
/** Used to infer the `Object` constructor. */
|
|
8412
|
-
var objectCtorString = funcToString.call(Object);
|
|
8413
|
-
|
|
8414
|
-
/**
|
|
8415
|
-
* Checks if `value` is a plain object, that is, an object created by the
|
|
8416
|
-
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
8417
|
-
*
|
|
8418
|
-
* @static
|
|
8419
|
-
* @memberOf _
|
|
8420
|
-
* @since 0.8.0
|
|
8421
|
-
* @category Lang
|
|
8422
|
-
* @param {*} value The value to check.
|
|
8423
|
-
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
8424
|
-
* @example
|
|
8425
|
-
*
|
|
8426
|
-
* function Foo() {
|
|
8427
|
-
* this.a = 1;
|
|
8428
|
-
* }
|
|
8429
|
-
*
|
|
8430
|
-
* _.isPlainObject(new Foo);
|
|
8431
|
-
* // => false
|
|
8432
|
-
*
|
|
8433
|
-
* _.isPlainObject([1, 2, 3]);
|
|
8434
|
-
* // => false
|
|
8435
|
-
*
|
|
8436
|
-
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
8437
|
-
* // => true
|
|
8438
|
-
*
|
|
8439
|
-
* _.isPlainObject(Object.create(null));
|
|
8440
|
-
* // => true
|
|
8441
|
-
*/
|
|
8442
|
-
function isPlainObject$1(value) {
|
|
8443
|
-
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
8444
|
-
return false;
|
|
8445
|
-
}
|
|
8446
|
-
var proto = getPrototype(value);
|
|
8447
|
-
if (proto === null) {
|
|
8448
|
-
return true;
|
|
8449
|
-
}
|
|
8450
|
-
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
8451
|
-
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
8452
|
-
funcToString.call(Ctor) == objectCtorString;
|
|
8453
|
-
}
|
|
8454
|
-
|
|
8455
|
-
var isPlainObject_1 = isPlainObject$1;
|
|
8305
|
+
var baseRest = _baseRest,
|
|
8306
|
+
isIterateeCall = _isIterateeCall;
|
|
8456
8307
|
|
|
8457
8308
|
/**
|
|
8458
|
-
*
|
|
8309
|
+
* Creates a function like `_.assign`.
|
|
8459
8310
|
*
|
|
8460
8311
|
* @private
|
|
8461
|
-
* @param {
|
|
8462
|
-
* @
|
|
8463
|
-
* @returns {*} Returns the property value.
|
|
8312
|
+
* @param {Function} assigner The function to assign values.
|
|
8313
|
+
* @returns {Function} Returns the new assigner function.
|
|
8464
8314
|
*/
|
|
8315
|
+
function createAssigner$1(assigner) {
|
|
8316
|
+
return baseRest(function(object, sources) {
|
|
8317
|
+
var index = -1,
|
|
8318
|
+
length = sources.length,
|
|
8319
|
+
customizer = length > 1 ? sources[length - 1] : undefined,
|
|
8320
|
+
guard = length > 2 ? sources[2] : undefined;
|
|
8465
8321
|
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
}
|
|
8470
|
-
|
|
8471
|
-
if (key == '__proto__') {
|
|
8472
|
-
return;
|
|
8473
|
-
}
|
|
8322
|
+
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
|
8323
|
+
? (length--, customizer)
|
|
8324
|
+
: undefined;
|
|
8474
8325
|
|
|
8475
|
-
|
|
8326
|
+
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
8327
|
+
customizer = length < 3 ? undefined : customizer;
|
|
8328
|
+
length = 1;
|
|
8329
|
+
}
|
|
8330
|
+
object = Object(object);
|
|
8331
|
+
while (++index < length) {
|
|
8332
|
+
var source = sources[index];
|
|
8333
|
+
if (source) {
|
|
8334
|
+
assigner(object, source, index, customizer);
|
|
8335
|
+
}
|
|
8336
|
+
}
|
|
8337
|
+
return object;
|
|
8338
|
+
});
|
|
8476
8339
|
}
|
|
8477
8340
|
|
|
8478
|
-
var
|
|
8341
|
+
var _createAssigner = createAssigner$1;
|
|
8479
8342
|
|
|
8480
|
-
var
|
|
8481
|
-
|
|
8343
|
+
var baseMerge = _baseMerge,
|
|
8344
|
+
createAssigner = _createAssigner;
|
|
8482
8345
|
|
|
8483
8346
|
/**
|
|
8484
|
-
*
|
|
8485
|
-
* keyed properties of
|
|
8347
|
+
* This method is like `_.assign` except that it recursively merges own and
|
|
8348
|
+
* inherited enumerable string keyed properties of source objects into the
|
|
8349
|
+
* destination object. Source properties that resolve to `undefined` are
|
|
8350
|
+
* skipped if a destination value exists. Array and plain object properties
|
|
8351
|
+
* are merged recursively. Other objects and value types are overridden by
|
|
8352
|
+
* assignment. Source objects are applied from left to right. Subsequent
|
|
8353
|
+
* sources overwrite property assignments of previous sources.
|
|
8354
|
+
*
|
|
8355
|
+
* **Note:** This method mutates `object`.
|
|
8486
8356
|
*
|
|
8487
8357
|
* @static
|
|
8488
8358
|
* @memberOf _
|
|
8489
|
-
* @since
|
|
8490
|
-
* @category
|
|
8491
|
-
* @param {
|
|
8492
|
-
* @
|
|
8359
|
+
* @since 0.5.0
|
|
8360
|
+
* @category Object
|
|
8361
|
+
* @param {Object} object The destination object.
|
|
8362
|
+
* @param {...Object} [sources] The source objects.
|
|
8363
|
+
* @returns {Object} Returns `object`.
|
|
8493
8364
|
* @example
|
|
8494
8365
|
*
|
|
8495
|
-
*
|
|
8496
|
-
*
|
|
8497
|
-
* }
|
|
8498
|
-
*
|
|
8499
|
-
* Foo.prototype.c = 3;
|
|
8366
|
+
* var object = {
|
|
8367
|
+
* 'a': [{ 'b': 2 }, { 'd': 4 }]
|
|
8368
|
+
* };
|
|
8500
8369
|
*
|
|
8501
|
-
*
|
|
8502
|
-
*
|
|
8370
|
+
* var other = {
|
|
8371
|
+
* 'a': [{ 'c': 3 }, { 'e': 5 }]
|
|
8372
|
+
* };
|
|
8503
8373
|
*
|
|
8504
|
-
* _.
|
|
8505
|
-
* // => { 'a':
|
|
8374
|
+
* _.merge(object, other);
|
|
8375
|
+
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
|
|
8506
8376
|
*/
|
|
8507
|
-
function
|
|
8508
|
-
|
|
8509
|
-
}
|
|
8510
|
-
|
|
8511
|
-
var toPlainObject_1 = toPlainObject$1;
|
|
8377
|
+
var merge = createAssigner(function(object, source, srcIndex) {
|
|
8378
|
+
baseMerge(object, source, srcIndex);
|
|
8379
|
+
});
|
|
8512
8380
|
|
|
8513
|
-
var
|
|
8514
|
-
cloneBuffer = _cloneBufferExports,
|
|
8515
|
-
cloneTypedArray = _cloneTypedArray,
|
|
8516
|
-
copyArray = _copyArray,
|
|
8517
|
-
initCloneObject = _initCloneObject,
|
|
8518
|
-
isArguments = isArguments_1,
|
|
8519
|
-
isArray = isArray_1,
|
|
8520
|
-
isArrayLikeObject = isArrayLikeObject_1,
|
|
8521
|
-
isBuffer = isBufferExports,
|
|
8522
|
-
isFunction = isFunction_1,
|
|
8523
|
-
isObject$2 = isObject_1,
|
|
8524
|
-
isPlainObject = isPlainObject_1,
|
|
8525
|
-
isTypedArray = isTypedArray_1,
|
|
8526
|
-
safeGet$1 = _safeGet,
|
|
8527
|
-
toPlainObject = toPlainObject_1;
|
|
8381
|
+
var merge_1 = merge;
|
|
8528
8382
|
|
|
8529
|
-
|
|
8530
|
-
* A specialized version of `baseMerge` for arrays and objects which performs
|
|
8531
|
-
* deep merges and tracks traversed objects enabling objects with circular
|
|
8532
|
-
* references to be merged.
|
|
8533
|
-
*
|
|
8534
|
-
* @private
|
|
8535
|
-
* @param {Object} object The destination object.
|
|
8536
|
-
* @param {Object} source The source object.
|
|
8537
|
-
* @param {string} key The key of the value to merge.
|
|
8538
|
-
* @param {number} srcIndex The index of `source`.
|
|
8539
|
-
* @param {Function} mergeFunc The function to merge values.
|
|
8540
|
-
* @param {Function} [customizer] The function to customize assigned values.
|
|
8541
|
-
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
8542
|
-
* counterparts.
|
|
8543
|
-
*/
|
|
8544
|
-
function baseMergeDeep$1(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
8545
|
-
var objValue = safeGet$1(object, key),
|
|
8546
|
-
srcValue = safeGet$1(source, key),
|
|
8547
|
-
stacked = stack.get(srcValue);
|
|
8383
|
+
var merge$1 = /*@__PURE__*/getDefaultExportFromCjs(merge_1);
|
|
8548
8384
|
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8385
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
8386
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8387
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8388
|
+
var hasSameObjectStructure = function hasSameObjectStructure(obj1, obj2) {
|
|
8389
|
+
// Check if both objects are objects or not
|
|
8390
|
+
if (!isObject$9(obj1) || !isObject$9(obj2)) {
|
|
8391
|
+
return isObject$9(obj1) === isObject$9(obj2);
|
|
8552
8392
|
}
|
|
8553
|
-
var newValue = customizer
|
|
8554
|
-
? customizer(objValue, srcValue, (key + ''), object, source, stack)
|
|
8555
|
-
: undefined;
|
|
8556
8393
|
|
|
8557
|
-
|
|
8394
|
+
// Get the keys of both objects
|
|
8395
|
+
var keys1 = keys$4(obj1);
|
|
8396
|
+
var keys2 = keys$4(obj2);
|
|
8558
8397
|
|
|
8559
|
-
if
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8398
|
+
// Check if the length of the keys are the same
|
|
8399
|
+
if (keys1.length !== keys2.length) {
|
|
8400
|
+
return false;
|
|
8401
|
+
}
|
|
8563
8402
|
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
newValue = copyArray(objValue);
|
|
8571
|
-
}
|
|
8572
|
-
else if (isBuff) {
|
|
8573
|
-
isCommon = false;
|
|
8574
|
-
newValue = cloneBuffer(srcValue, true);
|
|
8575
|
-
}
|
|
8576
|
-
else if (isTyped) {
|
|
8577
|
-
isCommon = false;
|
|
8578
|
-
newValue = cloneTypedArray(srcValue, true);
|
|
8579
|
-
}
|
|
8580
|
-
else {
|
|
8581
|
-
newValue = [];
|
|
8582
|
-
}
|
|
8583
|
-
}
|
|
8584
|
-
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
8585
|
-
newValue = objValue;
|
|
8586
|
-
if (isArguments(objValue)) {
|
|
8587
|
-
newValue = toPlainObject(objValue);
|
|
8588
|
-
}
|
|
8589
|
-
else if (!isObject$2(objValue) || isFunction(objValue)) {
|
|
8590
|
-
newValue = initCloneObject(srcValue);
|
|
8591
|
-
}
|
|
8592
|
-
}
|
|
8593
|
-
else {
|
|
8594
|
-
isCommon = false;
|
|
8403
|
+
// Compare keys
|
|
8404
|
+
keys1.sort();
|
|
8405
|
+
keys2.sort();
|
|
8406
|
+
for (var i = 0; i < keys1.length; i++) {
|
|
8407
|
+
if (keys1[i] !== keys2[i]) {
|
|
8408
|
+
return false;
|
|
8595
8409
|
}
|
|
8596
8410
|
}
|
|
8597
|
-
if (isCommon) {
|
|
8598
|
-
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
8599
|
-
stack.set(srcValue, newValue);
|
|
8600
|
-
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
8601
|
-
stack['delete'](srcValue);
|
|
8602
|
-
}
|
|
8603
|
-
assignMergeValue$1(object, key, newValue);
|
|
8604
|
-
}
|
|
8605
8411
|
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8412
|
+
// Recursively check the key structures of nested objects
|
|
8413
|
+
var _iterator = _createForOfIteratorHelper(keys1),
|
|
8414
|
+
_step;
|
|
8415
|
+
try {
|
|
8416
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
8417
|
+
var _key = _step.value;
|
|
8418
|
+
if (!hasSameObjectStructure(obj1[_key], obj2[_key])) {
|
|
8419
|
+
return false;
|
|
8420
|
+
}
|
|
8421
|
+
}
|
|
8615
8422
|
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
* @param {Object} source The source object.
|
|
8622
|
-
* @param {number} srcIndex The index of `source`.
|
|
8623
|
-
* @param {Function} [customizer] The function to customize merged values.
|
|
8624
|
-
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
8625
|
-
* counterparts.
|
|
8626
|
-
*/
|
|
8627
|
-
function baseMerge$1(object, source, srcIndex, customizer, stack) {
|
|
8628
|
-
if (object === source) {
|
|
8629
|
-
return;
|
|
8423
|
+
// If all checks pass, the structures are the same
|
|
8424
|
+
} catch (err) {
|
|
8425
|
+
_iterator.e(err);
|
|
8426
|
+
} finally {
|
|
8427
|
+
_iterator.f();
|
|
8630
8428
|
}
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
if (isObject$1(srcValue)) {
|
|
8634
|
-
baseMergeDeep(object, source, key, srcIndex, baseMerge$1, customizer, stack);
|
|
8635
|
-
}
|
|
8636
|
-
else {
|
|
8637
|
-
var newValue = customizer
|
|
8638
|
-
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
|
|
8639
|
-
: undefined;
|
|
8429
|
+
return true;
|
|
8430
|
+
};
|
|
8640
8431
|
|
|
8641
|
-
|
|
8642
|
-
|
|
8432
|
+
var PREFIX = '[Blade]:';
|
|
8433
|
+
var throwBladeError = function throwBladeError(_ref) {
|
|
8434
|
+
var message = _ref.message,
|
|
8435
|
+
moduleName = _ref.moduleName;
|
|
8436
|
+
{
|
|
8437
|
+
var prefix = moduleName ? "[Blade: ".concat(moduleName, "]:") : PREFIX;
|
|
8438
|
+
throw new Error("".concat(prefix, " ").concat(message));
|
|
8439
|
+
}
|
|
8440
|
+
};
|
|
8441
|
+
var getCommonLogger = function getCommonLogger(type) {
|
|
8442
|
+
switch (type) {
|
|
8443
|
+
case 'error':
|
|
8444
|
+
return console.error;
|
|
8445
|
+
case 'warn':
|
|
8446
|
+
return console.warn;
|
|
8447
|
+
case 'log':
|
|
8448
|
+
default:
|
|
8449
|
+
return console.log;
|
|
8450
|
+
}
|
|
8451
|
+
};
|
|
8452
|
+
var logger = function logger(_ref2) {
|
|
8453
|
+
var message = _ref2.message,
|
|
8454
|
+
moduleName = _ref2.moduleName,
|
|
8455
|
+
type = _ref2.type;
|
|
8456
|
+
{
|
|
8457
|
+
var prefix = moduleName ? "[Blade: ".concat(moduleName, "]:") : PREFIX;
|
|
8458
|
+
getCommonLogger(type)("".concat(prefix, " ").concat(message));
|
|
8459
|
+
}
|
|
8460
|
+
};
|
|
8461
|
+
|
|
8462
|
+
var isPartialMatchObjectKeys = function isPartialMatchObjectKeys(_ref) {
|
|
8463
|
+
var objectToMatch = _ref.objectToMatch,
|
|
8464
|
+
objectToInspect = _ref.objectToInspect;
|
|
8465
|
+
var matchResponses = [];
|
|
8466
|
+
var matchObjectKeys = function matchObjectKeys(_ref2) {
|
|
8467
|
+
var innerObjectToMatch = _ref2.innerObjectToMatch,
|
|
8468
|
+
innerObjectToInspect = _ref2.innerObjectToInspect;
|
|
8469
|
+
for (var _i = 0, _Object$entries = Object.entries(innerObjectToMatch); _i < _Object$entries.length; _i++) {
|
|
8470
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
8471
|
+
key = _Object$entries$_i[0],
|
|
8472
|
+
valueToMatch = _Object$entries$_i[1];
|
|
8473
|
+
var valueToInspect = innerObjectToInspect[key];
|
|
8474
|
+
if (innerObjectToInspect.hasOwnProperty(key)) {
|
|
8475
|
+
if (valueToMatch === null || valueToMatch === undefined || valueToMatch === '' || Array.isArray(valueToMatch) ||
|
|
8476
|
+
// the condition checks if the "valueToMatch" is not of type object then "valueToMatch" type should be same as type of "valueToInspect"
|
|
8477
|
+
!(valueToMatch instanceof Object) && _typeof$1(valueToMatch) !== _typeof$1(valueToInspect)) {
|
|
8478
|
+
{
|
|
8479
|
+
// this is an invalid case, so we log error
|
|
8480
|
+
logger({
|
|
8481
|
+
message: "Unexpected value: ".concat(JSON.stringify(valueToMatch), " of type ").concat(_typeof$1(valueToMatch), " for key: ").concat(key),
|
|
8482
|
+
moduleName: 'isPartialMatchObjectKeys',
|
|
8483
|
+
type: 'error'
|
|
8484
|
+
});
|
|
8485
|
+
}
|
|
8486
|
+
matchResponses.push(false);
|
|
8487
|
+
}
|
|
8488
|
+
if (typeof valueToMatch === 'string') {
|
|
8489
|
+
// we have reached leaf node of the objectToMatch(i.e sub-object)
|
|
8490
|
+
matchResponses.push(true);
|
|
8491
|
+
}
|
|
8492
|
+
if (isObject$9(valueToMatch) && isObject$9(valueToInspect)) {
|
|
8493
|
+
// let's go inside further and do a nested check
|
|
8494
|
+
matchObjectKeys({
|
|
8495
|
+
innerObjectToMatch: valueToMatch,
|
|
8496
|
+
innerObjectToInspect: valueToInspect
|
|
8497
|
+
});
|
|
8498
|
+
}
|
|
8499
|
+
} else {
|
|
8500
|
+
{
|
|
8501
|
+
// the key doesn't exist in the innerObjectToMatch, so we log error
|
|
8502
|
+
logger({
|
|
8503
|
+
message: "".concat(key, " doesn't exist in ").concat(JSON.stringify(innerObjectToInspect, null, 2)),
|
|
8504
|
+
moduleName: 'isPartialMatchObjectKeys',
|
|
8505
|
+
type: 'error'
|
|
8506
|
+
});
|
|
8507
|
+
}
|
|
8508
|
+
matchResponses.push(false);
|
|
8643
8509
|
}
|
|
8644
|
-
assignMergeValue(object, key, newValue);
|
|
8645
8510
|
}
|
|
8646
|
-
}
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8511
|
+
};
|
|
8512
|
+
matchObjectKeys({
|
|
8513
|
+
innerObjectToMatch: objectToMatch,
|
|
8514
|
+
innerObjectToInspect: objectToInspect
|
|
8515
|
+
});
|
|
8516
|
+
return matchResponses.every(Boolean);
|
|
8517
|
+
};
|
|
8650
8518
|
|
|
8651
8519
|
/**
|
|
8652
|
-
*
|
|
8520
|
+
* @deprecated Use `createTheme` from `@razorpay/blade/tokens` instead
|
|
8653
8521
|
*
|
|
8654
|
-
* @
|
|
8655
|
-
* @since 0.1.0
|
|
8656
|
-
* @memberOf _
|
|
8657
|
-
* @category Util
|
|
8658
|
-
* @param {*} value Any value.
|
|
8659
|
-
* @returns {*} Returns `value`.
|
|
8660
|
-
* @example
|
|
8522
|
+
* @description
|
|
8661
8523
|
*
|
|
8662
|
-
*
|
|
8524
|
+
* `overrideTheme` merges the `baseThemeTokens` and `overrides` and returns a new ThemeTokens object,
|
|
8525
|
+
* which you can pass into BladeProvider.
|
|
8663
8526
|
*
|
|
8664
|
-
*
|
|
8665
|
-
*
|
|
8527
|
+
* @example
|
|
8528
|
+
* ```tsx
|
|
8529
|
+
* const customTheme = overrideTheme({
|
|
8530
|
+
* baseThemeTokens: paymentTheme, // theme to override
|
|
8531
|
+
* overrides: {
|
|
8532
|
+
* colors: {
|
|
8533
|
+
* onLight: {
|
|
8534
|
+
* brand: {
|
|
8535
|
+
* primary: {
|
|
8536
|
+
* '500': 'hsla(222, 100%, 96%, 1)',
|
|
8537
|
+
* },
|
|
8538
|
+
* },
|
|
8539
|
+
* },
|
|
8540
|
+
* },
|
|
8541
|
+
* },
|
|
8542
|
+
* });
|
|
8543
|
+
*
|
|
8544
|
+
* <BladeProvider themeTokens={customTheme} />
|
|
8545
|
+
* ```
|
|
8666
8546
|
*/
|
|
8547
|
+
var overrideTheme = function overrideTheme(_ref) {
|
|
8548
|
+
var baseThemeTokens = _ref.baseThemeTokens,
|
|
8549
|
+
overrides = _ref.overrides;
|
|
8550
|
+
{
|
|
8551
|
+
if (!hasSameObjectStructure(baseThemeTokens, paymentTheme)) {
|
|
8552
|
+
throwBladeError({
|
|
8553
|
+
message: 'The base theme provided is not a valid Blade theme',
|
|
8554
|
+
moduleName: 'overrideTheme'
|
|
8555
|
+
});
|
|
8556
|
+
}
|
|
8557
|
+
if (!isPartialMatchObjectKeys({
|
|
8558
|
+
objectToMatch: overrides,
|
|
8559
|
+
objectToInspect: baseThemeTokens
|
|
8560
|
+
})) {
|
|
8561
|
+
throwBladeError({
|
|
8562
|
+
message: 'The overrides object is not valid',
|
|
8563
|
+
moduleName: 'overrideTheme'
|
|
8564
|
+
});
|
|
8565
|
+
}
|
|
8566
|
+
}
|
|
8667
8567
|
|
|
8668
|
-
|
|
8669
|
-
return
|
|
8568
|
+
// Need to clone before merging since merge changes/mutates the actual object
|
|
8569
|
+
return merge$1(cloneDeep$1(baseThemeTokens), overrides);
|
|
8570
|
+
};
|
|
8571
|
+
|
|
8572
|
+
// This file is autogenerated. It's used to publish ESM to npm.
|
|
8573
|
+
function _typeof(obj) {
|
|
8574
|
+
"@babel/helpers - typeof";
|
|
8575
|
+
|
|
8576
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
8577
|
+
return typeof obj;
|
|
8578
|
+
} : function (obj) {
|
|
8579
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
8580
|
+
}, _typeof(obj);
|
|
8670
8581
|
}
|
|
8671
8582
|
|
|
8672
|
-
|
|
8583
|
+
// https://github.com/bgrins/TinyColor
|
|
8584
|
+
// Brian Grinstead, MIT License
|
|
8673
8585
|
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
* @param {Function} func The function to invoke.
|
|
8680
|
-
* @param {*} thisArg The `this` binding of `func`.
|
|
8681
|
-
* @param {Array} args The arguments to invoke `func` with.
|
|
8682
|
-
* @returns {*} Returns the result of `func`.
|
|
8683
|
-
*/
|
|
8586
|
+
var trimLeft = /^\s+/;
|
|
8587
|
+
var trimRight = /\s+$/;
|
|
8588
|
+
function tinycolor(color, opts) {
|
|
8589
|
+
color = color ? color : "";
|
|
8590
|
+
opts = opts || {};
|
|
8684
8591
|
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
case 1: return func.call(thisArg, args[0]);
|
|
8689
|
-
case 2: return func.call(thisArg, args[0], args[1]);
|
|
8690
|
-
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
8592
|
+
// If input is already a tinycolor, return itself
|
|
8593
|
+
if (color instanceof tinycolor) {
|
|
8594
|
+
return color;
|
|
8691
8595
|
}
|
|
8692
|
-
|
|
8596
|
+
// If we are called as a function, call using new instead
|
|
8597
|
+
if (!(this instanceof tinycolor)) {
|
|
8598
|
+
return new tinycolor(color, opts);
|
|
8599
|
+
}
|
|
8600
|
+
var rgb = inputToRGB(color);
|
|
8601
|
+
this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
|
|
8602
|
+
this._gradientType = opts.gradientType;
|
|
8603
|
+
|
|
8604
|
+
// Don't let the range of [0,255] come back in [0,1].
|
|
8605
|
+
// Potentially lose a little bit of precision here, but will fix issues where
|
|
8606
|
+
// .5 gets interpreted as half of the total, instead of half of 1
|
|
8607
|
+
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
|
|
8608
|
+
if (this._r < 1) this._r = Math.round(this._r);
|
|
8609
|
+
if (this._g < 1) this._g = Math.round(this._g);
|
|
8610
|
+
if (this._b < 1) this._b = Math.round(this._b);
|
|
8611
|
+
this._ok = rgb.ok;
|
|
8693
8612
|
}
|
|
8613
|
+
tinycolor.prototype = {
|
|
8614
|
+
isDark: function isDark() {
|
|
8615
|
+
return this.getBrightness() < 128;
|
|
8616
|
+
},
|
|
8617
|
+
isLight: function isLight() {
|
|
8618
|
+
return !this.isDark();
|
|
8619
|
+
},
|
|
8620
|
+
isValid: function isValid() {
|
|
8621
|
+
return this._ok;
|
|
8622
|
+
},
|
|
8623
|
+
getOriginalInput: function getOriginalInput() {
|
|
8624
|
+
return this._originalInput;
|
|
8625
|
+
},
|
|
8626
|
+
getFormat: function getFormat() {
|
|
8627
|
+
return this._format;
|
|
8628
|
+
},
|
|
8629
|
+
getAlpha: function getAlpha() {
|
|
8630
|
+
return this._a;
|
|
8631
|
+
},
|
|
8632
|
+
getBrightness: function getBrightness() {
|
|
8633
|
+
//http://www.w3.org/TR/AERT#color-contrast
|
|
8634
|
+
var rgb = this.toRgb();
|
|
8635
|
+
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
|
|
8636
|
+
},
|
|
8637
|
+
getLuminance: function getLuminance() {
|
|
8638
|
+
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
8639
|
+
var rgb = this.toRgb();
|
|
8640
|
+
var RsRGB, GsRGB, BsRGB, R, G, B;
|
|
8641
|
+
RsRGB = rgb.r / 255;
|
|
8642
|
+
GsRGB = rgb.g / 255;
|
|
8643
|
+
BsRGB = rgb.b / 255;
|
|
8644
|
+
if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
|
|
8645
|
+
if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
|
|
8646
|
+
if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
|
|
8647
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
8648
|
+
},
|
|
8649
|
+
setAlpha: function setAlpha(value) {
|
|
8650
|
+
this._a = boundAlpha(value);
|
|
8651
|
+
this._roundA = Math.round(100 * this._a) / 100;
|
|
8652
|
+
return this;
|
|
8653
|
+
},
|
|
8654
|
+
toHsv: function toHsv() {
|
|
8655
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
8656
|
+
return {
|
|
8657
|
+
h: hsv.h * 360,
|
|
8658
|
+
s: hsv.s,
|
|
8659
|
+
v: hsv.v,
|
|
8660
|
+
a: this._a
|
|
8661
|
+
};
|
|
8662
|
+
},
|
|
8663
|
+
toHsvString: function toHsvString() {
|
|
8664
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
8665
|
+
var h = Math.round(hsv.h * 360),
|
|
8666
|
+
s = Math.round(hsv.s * 100),
|
|
8667
|
+
v = Math.round(hsv.v * 100);
|
|
8668
|
+
return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
|
|
8669
|
+
},
|
|
8670
|
+
toHsl: function toHsl() {
|
|
8671
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
8672
|
+
return {
|
|
8673
|
+
h: hsl.h * 360,
|
|
8674
|
+
s: hsl.s,
|
|
8675
|
+
l: hsl.l,
|
|
8676
|
+
a: this._a
|
|
8677
|
+
};
|
|
8678
|
+
},
|
|
8679
|
+
toHslString: function toHslString() {
|
|
8680
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
8681
|
+
var h = Math.round(hsl.h * 360),
|
|
8682
|
+
s = Math.round(hsl.s * 100),
|
|
8683
|
+
l = Math.round(hsl.l * 100);
|
|
8684
|
+
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
|
|
8685
|
+
},
|
|
8686
|
+
toHex: function toHex(allow3Char) {
|
|
8687
|
+
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
|
8688
|
+
},
|
|
8689
|
+
toHexString: function toHexString(allow3Char) {
|
|
8690
|
+
return "#" + this.toHex(allow3Char);
|
|
8691
|
+
},
|
|
8692
|
+
toHex8: function toHex8(allow4Char) {
|
|
8693
|
+
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
|
|
8694
|
+
},
|
|
8695
|
+
toHex8String: function toHex8String(allow4Char) {
|
|
8696
|
+
return "#" + this.toHex8(allow4Char);
|
|
8697
|
+
},
|
|
8698
|
+
toRgb: function toRgb() {
|
|
8699
|
+
return {
|
|
8700
|
+
r: Math.round(this._r),
|
|
8701
|
+
g: Math.round(this._g),
|
|
8702
|
+
b: Math.round(this._b),
|
|
8703
|
+
a: this._a
|
|
8704
|
+
};
|
|
8705
|
+
},
|
|
8706
|
+
toRgbString: function toRgbString() {
|
|
8707
|
+
return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
|
|
8708
|
+
},
|
|
8709
|
+
toPercentageRgb: function toPercentageRgb() {
|
|
8710
|
+
return {
|
|
8711
|
+
r: Math.round(bound01(this._r, 255) * 100) + "%",
|
|
8712
|
+
g: Math.round(bound01(this._g, 255) * 100) + "%",
|
|
8713
|
+
b: Math.round(bound01(this._b, 255) * 100) + "%",
|
|
8714
|
+
a: this._a
|
|
8715
|
+
};
|
|
8716
|
+
},
|
|
8717
|
+
toPercentageRgbString: function toPercentageRgbString() {
|
|
8718
|
+
return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
8719
|
+
},
|
|
8720
|
+
toName: function toName() {
|
|
8721
|
+
if (this._a === 0) {
|
|
8722
|
+
return "transparent";
|
|
8723
|
+
}
|
|
8724
|
+
if (this._a < 1) {
|
|
8725
|
+
return false;
|
|
8726
|
+
}
|
|
8727
|
+
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
|
|
8728
|
+
},
|
|
8729
|
+
toFilter: function toFilter(secondColor) {
|
|
8730
|
+
var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
|
|
8731
|
+
var secondHex8String = hex8String;
|
|
8732
|
+
var gradientType = this._gradientType ? "GradientType = 1, " : "";
|
|
8733
|
+
if (secondColor) {
|
|
8734
|
+
var s = tinycolor(secondColor);
|
|
8735
|
+
secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
|
|
8736
|
+
}
|
|
8737
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
|
|
8738
|
+
},
|
|
8739
|
+
toString: function toString(format) {
|
|
8740
|
+
var formatSet = !!format;
|
|
8741
|
+
format = format || this._format;
|
|
8742
|
+
var formattedString = false;
|
|
8743
|
+
var hasAlpha = this._a < 1 && this._a >= 0;
|
|
8744
|
+
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
|
|
8745
|
+
if (needsAlphaFormat) {
|
|
8746
|
+
// Special case for "transparent", all other non-alpha formats
|
|
8747
|
+
// will return rgba when there is transparency.
|
|
8748
|
+
if (format === "name" && this._a === 0) {
|
|
8749
|
+
return this.toName();
|
|
8750
|
+
}
|
|
8751
|
+
return this.toRgbString();
|
|
8752
|
+
}
|
|
8753
|
+
if (format === "rgb") {
|
|
8754
|
+
formattedString = this.toRgbString();
|
|
8755
|
+
}
|
|
8756
|
+
if (format === "prgb") {
|
|
8757
|
+
formattedString = this.toPercentageRgbString();
|
|
8758
|
+
}
|
|
8759
|
+
if (format === "hex" || format === "hex6") {
|
|
8760
|
+
formattedString = this.toHexString();
|
|
8761
|
+
}
|
|
8762
|
+
if (format === "hex3") {
|
|
8763
|
+
formattedString = this.toHexString(true);
|
|
8764
|
+
}
|
|
8765
|
+
if (format === "hex4") {
|
|
8766
|
+
formattedString = this.toHex8String(true);
|
|
8767
|
+
}
|
|
8768
|
+
if (format === "hex8") {
|
|
8769
|
+
formattedString = this.toHex8String();
|
|
8770
|
+
}
|
|
8771
|
+
if (format === "name") {
|
|
8772
|
+
formattedString = this.toName();
|
|
8773
|
+
}
|
|
8774
|
+
if (format === "hsl") {
|
|
8775
|
+
formattedString = this.toHslString();
|
|
8776
|
+
}
|
|
8777
|
+
if (format === "hsv") {
|
|
8778
|
+
formattedString = this.toHsvString();
|
|
8779
|
+
}
|
|
8780
|
+
return formattedString || this.toHexString();
|
|
8781
|
+
},
|
|
8782
|
+
clone: function clone() {
|
|
8783
|
+
return tinycolor(this.toString());
|
|
8784
|
+
},
|
|
8785
|
+
_applyModification: function _applyModification(fn, args) {
|
|
8786
|
+
var color = fn.apply(null, [this].concat([].slice.call(args)));
|
|
8787
|
+
this._r = color._r;
|
|
8788
|
+
this._g = color._g;
|
|
8789
|
+
this._b = color._b;
|
|
8790
|
+
this.setAlpha(color._a);
|
|
8791
|
+
return this;
|
|
8792
|
+
},
|
|
8793
|
+
lighten: function lighten() {
|
|
8794
|
+
return this._applyModification(_lighten, arguments);
|
|
8795
|
+
},
|
|
8796
|
+
brighten: function brighten() {
|
|
8797
|
+
return this._applyModification(_brighten, arguments);
|
|
8798
|
+
},
|
|
8799
|
+
darken: function darken() {
|
|
8800
|
+
return this._applyModification(_darken, arguments);
|
|
8801
|
+
},
|
|
8802
|
+
desaturate: function desaturate() {
|
|
8803
|
+
return this._applyModification(_desaturate, arguments);
|
|
8804
|
+
},
|
|
8805
|
+
saturate: function saturate() {
|
|
8806
|
+
return this._applyModification(_saturate, arguments);
|
|
8807
|
+
},
|
|
8808
|
+
greyscale: function greyscale() {
|
|
8809
|
+
return this._applyModification(_greyscale, arguments);
|
|
8810
|
+
},
|
|
8811
|
+
spin: function spin() {
|
|
8812
|
+
return this._applyModification(_spin, arguments);
|
|
8813
|
+
},
|
|
8814
|
+
_applyCombination: function _applyCombination(fn, args) {
|
|
8815
|
+
return fn.apply(null, [this].concat([].slice.call(args)));
|
|
8816
|
+
},
|
|
8817
|
+
analogous: function analogous() {
|
|
8818
|
+
return this._applyCombination(_analogous, arguments);
|
|
8819
|
+
},
|
|
8820
|
+
complement: function complement() {
|
|
8821
|
+
return this._applyCombination(_complement, arguments);
|
|
8822
|
+
},
|
|
8823
|
+
monochromatic: function monochromatic() {
|
|
8824
|
+
return this._applyCombination(_monochromatic, arguments);
|
|
8825
|
+
},
|
|
8826
|
+
splitcomplement: function splitcomplement() {
|
|
8827
|
+
return this._applyCombination(_splitcomplement, arguments);
|
|
8828
|
+
},
|
|
8829
|
+
// Disabled until https://github.com/bgrins/TinyColor/issues/254
|
|
8830
|
+
// polyad: function (number) {
|
|
8831
|
+
// return this._applyCombination(polyad, [number]);
|
|
8832
|
+
// },
|
|
8833
|
+
triad: function triad() {
|
|
8834
|
+
return this._applyCombination(polyad, [3]);
|
|
8835
|
+
},
|
|
8836
|
+
tetrad: function tetrad() {
|
|
8837
|
+
return this._applyCombination(polyad, [4]);
|
|
8838
|
+
}
|
|
8839
|
+
};
|
|
8694
8840
|
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8841
|
+
// If input is an object, force 1 into "1.0" to handle ratios properly
|
|
8842
|
+
// String input requires "1.0" as input, so 1 will be treated as 1
|
|
8843
|
+
tinycolor.fromRatio = function (color, opts) {
|
|
8844
|
+
if (_typeof(color) == "object") {
|
|
8845
|
+
var newColor = {};
|
|
8846
|
+
for (var i in color) {
|
|
8847
|
+
if (color.hasOwnProperty(i)) {
|
|
8848
|
+
if (i === "a") {
|
|
8849
|
+
newColor[i] = color[i];
|
|
8850
|
+
} else {
|
|
8851
|
+
newColor[i] = convertToPercentage(color[i]);
|
|
8852
|
+
}
|
|
8853
|
+
}
|
|
8854
|
+
}
|
|
8855
|
+
color = newColor;
|
|
8856
|
+
}
|
|
8857
|
+
return tinycolor(color, opts);
|
|
8858
|
+
};
|
|
8698
8859
|
|
|
8699
|
-
|
|
8700
|
-
|
|
8860
|
+
// Given a string or object, convert that input to RGB
|
|
8861
|
+
// Possible string inputs:
|
|
8862
|
+
//
|
|
8863
|
+
// "red"
|
|
8864
|
+
// "#f00" or "f00"
|
|
8865
|
+
// "#ff0000" or "ff0000"
|
|
8866
|
+
// "#ff000000" or "ff000000"
|
|
8867
|
+
// "rgb 255 0 0" or "rgb (255, 0, 0)"
|
|
8868
|
+
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
|
8869
|
+
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
|
8870
|
+
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
|
8871
|
+
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
|
8872
|
+
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
|
8873
|
+
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
|
8874
|
+
//
|
|
8875
|
+
function inputToRGB(color) {
|
|
8876
|
+
var rgb = {
|
|
8877
|
+
r: 0,
|
|
8878
|
+
g: 0,
|
|
8879
|
+
b: 0
|
|
8880
|
+
};
|
|
8881
|
+
var a = 1;
|
|
8882
|
+
var s = null;
|
|
8883
|
+
var v = null;
|
|
8884
|
+
var l = null;
|
|
8885
|
+
var ok = false;
|
|
8886
|
+
var format = false;
|
|
8887
|
+
if (typeof color == "string") {
|
|
8888
|
+
color = stringInputToObject(color);
|
|
8889
|
+
}
|
|
8890
|
+
if (_typeof(color) == "object") {
|
|
8891
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
8892
|
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
8893
|
+
ok = true;
|
|
8894
|
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
8895
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
8896
|
+
s = convertToPercentage(color.s);
|
|
8897
|
+
v = convertToPercentage(color.v);
|
|
8898
|
+
rgb = hsvToRgb(color.h, s, v);
|
|
8899
|
+
ok = true;
|
|
8900
|
+
format = "hsv";
|
|
8901
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
8902
|
+
s = convertToPercentage(color.s);
|
|
8903
|
+
l = convertToPercentage(color.l);
|
|
8904
|
+
rgb = hslToRgb(color.h, s, l);
|
|
8905
|
+
ok = true;
|
|
8906
|
+
format = "hsl";
|
|
8907
|
+
}
|
|
8908
|
+
if (color.hasOwnProperty("a")) {
|
|
8909
|
+
a = color.a;
|
|
8910
|
+
}
|
|
8911
|
+
}
|
|
8912
|
+
a = boundAlpha(a);
|
|
8913
|
+
return {
|
|
8914
|
+
ok: ok,
|
|
8915
|
+
format: color.format || format,
|
|
8916
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
8917
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
8918
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
8919
|
+
a: a
|
|
8920
|
+
};
|
|
8921
|
+
}
|
|
8701
8922
|
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8923
|
+
// Conversion Functions
|
|
8924
|
+
// --------------------
|
|
8925
|
+
|
|
8926
|
+
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
|
|
8927
|
+
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
|
|
8928
|
+
|
|
8929
|
+
// `rgbToRgb`
|
|
8930
|
+
// Handle bounds / percentage checking to conform to CSS color spec
|
|
8931
|
+
// <http://www.w3.org/TR/css3-color/>
|
|
8932
|
+
// *Assumes:* r, g, b in [0, 255] or [0, 1]
|
|
8933
|
+
// *Returns:* { r, g, b } in [0, 255]
|
|
8934
|
+
function rgbToRgb(r, g, b) {
|
|
8935
|
+
return {
|
|
8936
|
+
r: bound01(r, 255) * 255,
|
|
8937
|
+
g: bound01(g, 255) * 255,
|
|
8938
|
+
b: bound01(b, 255) * 255
|
|
8939
|
+
};
|
|
8940
|
+
}
|
|
8718
8941
|
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8942
|
+
// `rgbToHsl`
|
|
8943
|
+
// Converts an RGB color value to HSL.
|
|
8944
|
+
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
|
|
8945
|
+
// *Returns:* { h, s, l } in [0,1]
|
|
8946
|
+
function rgbToHsl(r, g, b) {
|
|
8947
|
+
r = bound01(r, 255);
|
|
8948
|
+
g = bound01(g, 255);
|
|
8949
|
+
b = bound01(b, 255);
|
|
8950
|
+
var max = Math.max(r, g, b),
|
|
8951
|
+
min = Math.min(r, g, b);
|
|
8952
|
+
var h,
|
|
8953
|
+
s,
|
|
8954
|
+
l = (max + min) / 2;
|
|
8955
|
+
if (max == min) {
|
|
8956
|
+
h = s = 0; // achromatic
|
|
8957
|
+
} else {
|
|
8958
|
+
var d = max - min;
|
|
8959
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
8960
|
+
switch (max) {
|
|
8961
|
+
case r:
|
|
8962
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
8963
|
+
break;
|
|
8964
|
+
case g:
|
|
8965
|
+
h = (b - r) / d + 2;
|
|
8966
|
+
break;
|
|
8967
|
+
case b:
|
|
8968
|
+
h = (r - g) / d + 4;
|
|
8969
|
+
break;
|
|
8726
8970
|
}
|
|
8727
|
-
|
|
8728
|
-
|
|
8971
|
+
h /= 6;
|
|
8972
|
+
}
|
|
8973
|
+
return {
|
|
8974
|
+
h: h,
|
|
8975
|
+
s: s,
|
|
8976
|
+
l: l
|
|
8729
8977
|
};
|
|
8730
8978
|
}
|
|
8731
8979
|
|
|
8732
|
-
|
|
8980
|
+
// `hslToRgb`
|
|
8981
|
+
// Converts an HSL color value to RGB.
|
|
8982
|
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
|
|
8983
|
+
// *Returns:* { r, g, b } in the set [0, 255]
|
|
8984
|
+
function hslToRgb(h, s, l) {
|
|
8985
|
+
var r, g, b;
|
|
8986
|
+
h = bound01(h, 360);
|
|
8987
|
+
s = bound01(s, 100);
|
|
8988
|
+
l = bound01(l, 100);
|
|
8989
|
+
function hue2rgb(p, q, t) {
|
|
8990
|
+
if (t < 0) t += 1;
|
|
8991
|
+
if (t > 1) t -= 1;
|
|
8992
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
8993
|
+
if (t < 1 / 2) return q;
|
|
8994
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
8995
|
+
return p;
|
|
8996
|
+
}
|
|
8997
|
+
if (s === 0) {
|
|
8998
|
+
r = g = b = l; // achromatic
|
|
8999
|
+
} else {
|
|
9000
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
9001
|
+
var p = 2 * l - q;
|
|
9002
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
9003
|
+
g = hue2rgb(p, q, h);
|
|
9004
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
9005
|
+
}
|
|
9006
|
+
return {
|
|
9007
|
+
r: r * 255,
|
|
9008
|
+
g: g * 255,
|
|
9009
|
+
b: b * 255
|
|
9010
|
+
};
|
|
9011
|
+
}
|
|
8733
9012
|
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
*
|
|
8737
|
-
*
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
9013
|
+
// `rgbToHsv`
|
|
9014
|
+
// Converts an RGB color value to HSV
|
|
9015
|
+
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
|
|
9016
|
+
// *Returns:* { h, s, v } in [0,1]
|
|
9017
|
+
function rgbToHsv(r, g, b) {
|
|
9018
|
+
r = bound01(r, 255);
|
|
9019
|
+
g = bound01(g, 255);
|
|
9020
|
+
b = bound01(b, 255);
|
|
9021
|
+
var max = Math.max(r, g, b),
|
|
9022
|
+
min = Math.min(r, g, b);
|
|
9023
|
+
var h,
|
|
9024
|
+
s,
|
|
9025
|
+
v = max;
|
|
9026
|
+
var d = max - min;
|
|
9027
|
+
s = max === 0 ? 0 : d / max;
|
|
9028
|
+
if (max == min) {
|
|
9029
|
+
h = 0; // achromatic
|
|
9030
|
+
} else {
|
|
9031
|
+
switch (max) {
|
|
9032
|
+
case r:
|
|
9033
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
9034
|
+
break;
|
|
9035
|
+
case g:
|
|
9036
|
+
h = (b - r) / d + 2;
|
|
9037
|
+
break;
|
|
9038
|
+
case b:
|
|
9039
|
+
h = (r - g) / d + 4;
|
|
9040
|
+
break;
|
|
9041
|
+
}
|
|
9042
|
+
h /= 6;
|
|
9043
|
+
}
|
|
9044
|
+
return {
|
|
9045
|
+
h: h,
|
|
9046
|
+
s: s,
|
|
9047
|
+
v: v
|
|
9048
|
+
};
|
|
9049
|
+
}
|
|
8753
9050
|
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
9051
|
+
// `hsvToRgb`
|
|
9052
|
+
// Converts an HSV color value to RGB.
|
|
9053
|
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
|
|
9054
|
+
// *Returns:* { r, g, b } in the set [0, 255]
|
|
9055
|
+
function hsvToRgb(h, s, v) {
|
|
9056
|
+
h = bound01(h, 360) * 6;
|
|
9057
|
+
s = bound01(s, 100);
|
|
9058
|
+
v = bound01(v, 100);
|
|
9059
|
+
var i = Math.floor(h),
|
|
9060
|
+
f = h - i,
|
|
9061
|
+
p = v * (1 - s),
|
|
9062
|
+
q = v * (1 - f * s),
|
|
9063
|
+
t = v * (1 - (1 - f) * s),
|
|
9064
|
+
mod = i % 6,
|
|
9065
|
+
r = [v, q, p, p, t, v][mod],
|
|
9066
|
+
g = [t, v, v, q, p, p][mod],
|
|
9067
|
+
b = [p, p, t, v, v, q][mod];
|
|
9068
|
+
return {
|
|
9069
|
+
r: r * 255,
|
|
9070
|
+
g: g * 255,
|
|
9071
|
+
b: b * 255
|
|
8757
9072
|
};
|
|
8758
9073
|
}
|
|
8759
9074
|
|
|
8760
|
-
|
|
9075
|
+
// `rgbToHex`
|
|
9076
|
+
// Converts an RGB color to hex
|
|
9077
|
+
// Assumes r, g, and b are contained in the set [0, 255]
|
|
9078
|
+
// Returns a 3 or 6 character hex
|
|
9079
|
+
function rgbToHex(r, g, b, allow3Char) {
|
|
9080
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
8761
9081
|
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
9082
|
+
// Return a 3 character hex if possible
|
|
9083
|
+
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
|
|
9084
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
|
9085
|
+
}
|
|
9086
|
+
return hex.join("");
|
|
9087
|
+
}
|
|
8765
9088
|
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
9089
|
+
// `rgbaToHex`
|
|
9090
|
+
// Converts an RGBA color plus alpha transparency to hex
|
|
9091
|
+
// Assumes r, g, b are contained in the set [0, 255] and
|
|
9092
|
+
// a in [0, 1]. Returns a 4 or 8 character rgba hex
|
|
9093
|
+
function rgbaToHex(r, g, b, a, allow4Char) {
|
|
9094
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
|
|
9095
|
+
|
|
9096
|
+
// Return a 4 character hex if possible
|
|
9097
|
+
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
|
|
9098
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
|
9099
|
+
}
|
|
9100
|
+
return hex.join("");
|
|
9101
|
+
}
|
|
9102
|
+
|
|
9103
|
+
// `rgbaToArgbHex`
|
|
9104
|
+
// Converts an RGBA color to an ARGB Hex8 string
|
|
9105
|
+
// Rarely used, but required for "toFilter()"
|
|
9106
|
+
function rgbaToArgbHex(r, g, b, a) {
|
|
9107
|
+
var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
9108
|
+
return hex.join("");
|
|
9109
|
+
}
|
|
9110
|
+
|
|
9111
|
+
// `equals`
|
|
9112
|
+
// Can be called with any tinycolor input
|
|
9113
|
+
tinycolor.equals = function (color1, color2) {
|
|
9114
|
+
if (!color1 || !color2) return false;
|
|
9115
|
+
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
|
|
9116
|
+
};
|
|
9117
|
+
tinycolor.random = function () {
|
|
9118
|
+
return tinycolor.fromRatio({
|
|
9119
|
+
r: Math.random(),
|
|
9120
|
+
g: Math.random(),
|
|
9121
|
+
b: Math.random()
|
|
8780
9122
|
});
|
|
8781
9123
|
};
|
|
8782
9124
|
|
|
8783
|
-
|
|
9125
|
+
// Modification Functions
|
|
9126
|
+
// ----------------------
|
|
9127
|
+
// Thanks to less.js for some of the basics here
|
|
9128
|
+
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
|
|
9129
|
+
|
|
9130
|
+
function _desaturate(color, amount) {
|
|
9131
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
9132
|
+
var hsl = tinycolor(color).toHsl();
|
|
9133
|
+
hsl.s -= amount / 100;
|
|
9134
|
+
hsl.s = clamp01(hsl.s);
|
|
9135
|
+
return tinycolor(hsl);
|
|
9136
|
+
}
|
|
9137
|
+
function _saturate(color, amount) {
|
|
9138
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
9139
|
+
var hsl = tinycolor(color).toHsl();
|
|
9140
|
+
hsl.s += amount / 100;
|
|
9141
|
+
hsl.s = clamp01(hsl.s);
|
|
9142
|
+
return tinycolor(hsl);
|
|
9143
|
+
}
|
|
9144
|
+
function _greyscale(color) {
|
|
9145
|
+
return tinycolor(color).desaturate(100);
|
|
9146
|
+
}
|
|
9147
|
+
function _lighten(color, amount) {
|
|
9148
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
9149
|
+
var hsl = tinycolor(color).toHsl();
|
|
9150
|
+
hsl.l += amount / 100;
|
|
9151
|
+
hsl.l = clamp01(hsl.l);
|
|
9152
|
+
return tinycolor(hsl);
|
|
9153
|
+
}
|
|
9154
|
+
function _brighten(color, amount) {
|
|
9155
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
9156
|
+
var rgb = tinycolor(color).toRgb();
|
|
9157
|
+
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
|
|
9158
|
+
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
|
|
9159
|
+
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
|
|
9160
|
+
return tinycolor(rgb);
|
|
9161
|
+
}
|
|
9162
|
+
function _darken(color, amount) {
|
|
9163
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
9164
|
+
var hsl = tinycolor(color).toHsl();
|
|
9165
|
+
hsl.l -= amount / 100;
|
|
9166
|
+
hsl.l = clamp01(hsl.l);
|
|
9167
|
+
return tinycolor(hsl);
|
|
9168
|
+
}
|
|
8784
9169
|
|
|
8785
|
-
|
|
9170
|
+
// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
|
9171
|
+
// Values outside of this range will be wrapped into this range.
|
|
9172
|
+
function _spin(color, amount) {
|
|
9173
|
+
var hsl = tinycolor(color).toHsl();
|
|
9174
|
+
var hue = (hsl.h + amount) % 360;
|
|
9175
|
+
hsl.h = hue < 0 ? 360 + hue : hue;
|
|
9176
|
+
return tinycolor(hsl);
|
|
9177
|
+
}
|
|
8786
9178
|
|
|
8787
|
-
|
|
8788
|
-
|
|
9179
|
+
// Combination Functions
|
|
9180
|
+
// ---------------------
|
|
9181
|
+
// Thanks to jQuery xColor for some of the ideas behind these
|
|
9182
|
+
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
|
|
8789
9183
|
|
|
8790
|
-
|
|
8791
|
-
var
|
|
9184
|
+
function _complement(color) {
|
|
9185
|
+
var hsl = tinycolor(color).toHsl();
|
|
9186
|
+
hsl.h = (hsl.h + 180) % 360;
|
|
9187
|
+
return tinycolor(hsl);
|
|
9188
|
+
}
|
|
9189
|
+
function polyad(color, number) {
|
|
9190
|
+
if (isNaN(number) || number <= 0) {
|
|
9191
|
+
throw new Error("Argument to polyad must be a positive number");
|
|
9192
|
+
}
|
|
9193
|
+
var hsl = tinycolor(color).toHsl();
|
|
9194
|
+
var result = [tinycolor(color)];
|
|
9195
|
+
var step = 360 / number;
|
|
9196
|
+
for (var i = 1; i < number; i++) {
|
|
9197
|
+
result.push(tinycolor({
|
|
9198
|
+
h: (hsl.h + i * step) % 360,
|
|
9199
|
+
s: hsl.s,
|
|
9200
|
+
l: hsl.l
|
|
9201
|
+
}));
|
|
9202
|
+
}
|
|
9203
|
+
return result;
|
|
9204
|
+
}
|
|
9205
|
+
function _splitcomplement(color) {
|
|
9206
|
+
var hsl = tinycolor(color).toHsl();
|
|
9207
|
+
var h = hsl.h;
|
|
9208
|
+
return [tinycolor(color), tinycolor({
|
|
9209
|
+
h: (h + 72) % 360,
|
|
9210
|
+
s: hsl.s,
|
|
9211
|
+
l: hsl.l
|
|
9212
|
+
}), tinycolor({
|
|
9213
|
+
h: (h + 216) % 360,
|
|
9214
|
+
s: hsl.s,
|
|
9215
|
+
l: hsl.l
|
|
9216
|
+
})];
|
|
9217
|
+
}
|
|
9218
|
+
function _analogous(color, results, slices) {
|
|
9219
|
+
results = results || 6;
|
|
9220
|
+
slices = slices || 30;
|
|
9221
|
+
var hsl = tinycolor(color).toHsl();
|
|
9222
|
+
var part = 360 / slices;
|
|
9223
|
+
var ret = [tinycolor(color)];
|
|
9224
|
+
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
|
|
9225
|
+
hsl.h = (hsl.h + part) % 360;
|
|
9226
|
+
ret.push(tinycolor(hsl));
|
|
9227
|
+
}
|
|
9228
|
+
return ret;
|
|
9229
|
+
}
|
|
9230
|
+
function _monochromatic(color, results) {
|
|
9231
|
+
results = results || 6;
|
|
9232
|
+
var hsv = tinycolor(color).toHsv();
|
|
9233
|
+
var h = hsv.h,
|
|
9234
|
+
s = hsv.s,
|
|
9235
|
+
v = hsv.v;
|
|
9236
|
+
var ret = [];
|
|
9237
|
+
var modification = 1 / results;
|
|
9238
|
+
while (results--) {
|
|
9239
|
+
ret.push(tinycolor({
|
|
9240
|
+
h: h,
|
|
9241
|
+
s: s,
|
|
9242
|
+
v: v
|
|
9243
|
+
}));
|
|
9244
|
+
v = (v + modification) % 1;
|
|
9245
|
+
}
|
|
9246
|
+
return ret;
|
|
9247
|
+
}
|
|
8792
9248
|
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
9249
|
+
// Utility Functions
|
|
9250
|
+
// ---------------------
|
|
9251
|
+
|
|
9252
|
+
tinycolor.mix = function (color1, color2, amount) {
|
|
9253
|
+
amount = amount === 0 ? 0 : amount || 50;
|
|
9254
|
+
var rgb1 = tinycolor(color1).toRgb();
|
|
9255
|
+
var rgb2 = tinycolor(color2).toRgb();
|
|
9256
|
+
var p = amount / 100;
|
|
9257
|
+
var rgba = {
|
|
9258
|
+
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
9259
|
+
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
9260
|
+
b: (rgb2.b - rgb1.b) * p + rgb1.b,
|
|
9261
|
+
a: (rgb2.a - rgb1.a) * p + rgb1.a
|
|
9262
|
+
};
|
|
9263
|
+
return tinycolor(rgba);
|
|
9264
|
+
};
|
|
8805
9265
|
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
9266
|
+
// Readability Functions
|
|
9267
|
+
// ---------------------
|
|
9268
|
+
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
|
|
8809
9269
|
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
}
|
|
8818
|
-
return func.apply(undefined, arguments);
|
|
8819
|
-
};
|
|
8820
|
-
}
|
|
9270
|
+
// `contrast`
|
|
9271
|
+
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
|
|
9272
|
+
tinycolor.readability = function (color1, color2) {
|
|
9273
|
+
var c1 = tinycolor(color1);
|
|
9274
|
+
var c2 = tinycolor(color2);
|
|
9275
|
+
return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
|
|
9276
|
+
};
|
|
8821
9277
|
|
|
8822
|
-
|
|
9278
|
+
// `isReadable`
|
|
9279
|
+
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
|
|
9280
|
+
// The third argument is an optional Object.
|
|
9281
|
+
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
|
|
9282
|
+
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
|
|
9283
|
+
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
|
|
9284
|
+
|
|
9285
|
+
// *Example*
|
|
9286
|
+
// tinycolor.isReadable("#000", "#111") => false
|
|
9287
|
+
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
|
|
9288
|
+
tinycolor.isReadable = function (color1, color2, wcag2) {
|
|
9289
|
+
var readability = tinycolor.readability(color1, color2);
|
|
9290
|
+
var wcag2Parms, out;
|
|
9291
|
+
out = false;
|
|
9292
|
+
wcag2Parms = validateWCAG2Parms(wcag2);
|
|
9293
|
+
switch (wcag2Parms.level + wcag2Parms.size) {
|
|
9294
|
+
case "AAsmall":
|
|
9295
|
+
case "AAAlarge":
|
|
9296
|
+
out = readability >= 4.5;
|
|
9297
|
+
break;
|
|
9298
|
+
case "AAlarge":
|
|
9299
|
+
out = readability >= 3;
|
|
9300
|
+
break;
|
|
9301
|
+
case "AAAsmall":
|
|
9302
|
+
out = readability >= 7;
|
|
9303
|
+
break;
|
|
9304
|
+
}
|
|
9305
|
+
return out;
|
|
9306
|
+
};
|
|
8823
9307
|
|
|
8824
|
-
|
|
8825
|
-
|
|
9308
|
+
// `mostReadable`
|
|
9309
|
+
// Given a base color and a list of possible foreground or background
|
|
9310
|
+
// colors for that base, returns the most readable color.
|
|
9311
|
+
// Optionally returns Black or White if the most readable color is unreadable.
|
|
9312
|
+
// *Example*
|
|
9313
|
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
|
|
9314
|
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
|
|
9315
|
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
|
|
9316
|
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
|
|
9317
|
+
tinycolor.mostReadable = function (baseColor, colorList, args) {
|
|
9318
|
+
var bestColor = null;
|
|
9319
|
+
var bestScore = 0;
|
|
9320
|
+
var readability;
|
|
9321
|
+
var includeFallbackColors, level, size;
|
|
9322
|
+
args = args || {};
|
|
9323
|
+
includeFallbackColors = args.includeFallbackColors;
|
|
9324
|
+
level = args.level;
|
|
9325
|
+
size = args.size;
|
|
9326
|
+
for (var i = 0; i < colorList.length; i++) {
|
|
9327
|
+
readability = tinycolor.readability(baseColor, colorList[i]);
|
|
9328
|
+
if (readability > bestScore) {
|
|
9329
|
+
bestScore = readability;
|
|
9330
|
+
bestColor = tinycolor(colorList[i]);
|
|
9331
|
+
}
|
|
9332
|
+
}
|
|
9333
|
+
if (tinycolor.isReadable(baseColor, bestColor, {
|
|
9334
|
+
level: level,
|
|
9335
|
+
size: size
|
|
9336
|
+
}) || !includeFallbackColors) {
|
|
9337
|
+
return bestColor;
|
|
9338
|
+
} else {
|
|
9339
|
+
args.includeFallbackColors = false;
|
|
9340
|
+
return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
|
|
9341
|
+
}
|
|
9342
|
+
};
|
|
8826
9343
|
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
9344
|
+
// Big List of Colors
|
|
9345
|
+
// ------------------
|
|
9346
|
+
// <https://www.w3.org/TR/css-color-4/#named-colors>
|
|
9347
|
+
var names = tinycolor.names = {
|
|
9348
|
+
aliceblue: "f0f8ff",
|
|
9349
|
+
antiquewhite: "faebd7",
|
|
9350
|
+
aqua: "0ff",
|
|
9351
|
+
aquamarine: "7fffd4",
|
|
9352
|
+
azure: "f0ffff",
|
|
9353
|
+
beige: "f5f5dc",
|
|
9354
|
+
bisque: "ffe4c4",
|
|
9355
|
+
black: "000",
|
|
9356
|
+
blanchedalmond: "ffebcd",
|
|
9357
|
+
blue: "00f",
|
|
9358
|
+
blueviolet: "8a2be2",
|
|
9359
|
+
brown: "a52a2a",
|
|
9360
|
+
burlywood: "deb887",
|
|
9361
|
+
burntsienna: "ea7e5d",
|
|
9362
|
+
cadetblue: "5f9ea0",
|
|
9363
|
+
chartreuse: "7fff00",
|
|
9364
|
+
chocolate: "d2691e",
|
|
9365
|
+
coral: "ff7f50",
|
|
9366
|
+
cornflowerblue: "6495ed",
|
|
9367
|
+
cornsilk: "fff8dc",
|
|
9368
|
+
crimson: "dc143c",
|
|
9369
|
+
cyan: "0ff",
|
|
9370
|
+
darkblue: "00008b",
|
|
9371
|
+
darkcyan: "008b8b",
|
|
9372
|
+
darkgoldenrod: "b8860b",
|
|
9373
|
+
darkgray: "a9a9a9",
|
|
9374
|
+
darkgreen: "006400",
|
|
9375
|
+
darkgrey: "a9a9a9",
|
|
9376
|
+
darkkhaki: "bdb76b",
|
|
9377
|
+
darkmagenta: "8b008b",
|
|
9378
|
+
darkolivegreen: "556b2f",
|
|
9379
|
+
darkorange: "ff8c00",
|
|
9380
|
+
darkorchid: "9932cc",
|
|
9381
|
+
darkred: "8b0000",
|
|
9382
|
+
darksalmon: "e9967a",
|
|
9383
|
+
darkseagreen: "8fbc8f",
|
|
9384
|
+
darkslateblue: "483d8b",
|
|
9385
|
+
darkslategray: "2f4f4f",
|
|
9386
|
+
darkslategrey: "2f4f4f",
|
|
9387
|
+
darkturquoise: "00ced1",
|
|
9388
|
+
darkviolet: "9400d3",
|
|
9389
|
+
deeppink: "ff1493",
|
|
9390
|
+
deepskyblue: "00bfff",
|
|
9391
|
+
dimgray: "696969",
|
|
9392
|
+
dimgrey: "696969",
|
|
9393
|
+
dodgerblue: "1e90ff",
|
|
9394
|
+
firebrick: "b22222",
|
|
9395
|
+
floralwhite: "fffaf0",
|
|
9396
|
+
forestgreen: "228b22",
|
|
9397
|
+
fuchsia: "f0f",
|
|
9398
|
+
gainsboro: "dcdcdc",
|
|
9399
|
+
ghostwhite: "f8f8ff",
|
|
9400
|
+
gold: "ffd700",
|
|
9401
|
+
goldenrod: "daa520",
|
|
9402
|
+
gray: "808080",
|
|
9403
|
+
green: "008000",
|
|
9404
|
+
greenyellow: "adff2f",
|
|
9405
|
+
grey: "808080",
|
|
9406
|
+
honeydew: "f0fff0",
|
|
9407
|
+
hotpink: "ff69b4",
|
|
9408
|
+
indianred: "cd5c5c",
|
|
9409
|
+
indigo: "4b0082",
|
|
9410
|
+
ivory: "fffff0",
|
|
9411
|
+
khaki: "f0e68c",
|
|
9412
|
+
lavender: "e6e6fa",
|
|
9413
|
+
lavenderblush: "fff0f5",
|
|
9414
|
+
lawngreen: "7cfc00",
|
|
9415
|
+
lemonchiffon: "fffacd",
|
|
9416
|
+
lightblue: "add8e6",
|
|
9417
|
+
lightcoral: "f08080",
|
|
9418
|
+
lightcyan: "e0ffff",
|
|
9419
|
+
lightgoldenrodyellow: "fafad2",
|
|
9420
|
+
lightgray: "d3d3d3",
|
|
9421
|
+
lightgreen: "90ee90",
|
|
9422
|
+
lightgrey: "d3d3d3",
|
|
9423
|
+
lightpink: "ffb6c1",
|
|
9424
|
+
lightsalmon: "ffa07a",
|
|
9425
|
+
lightseagreen: "20b2aa",
|
|
9426
|
+
lightskyblue: "87cefa",
|
|
9427
|
+
lightslategray: "789",
|
|
9428
|
+
lightslategrey: "789",
|
|
9429
|
+
lightsteelblue: "b0c4de",
|
|
9430
|
+
lightyellow: "ffffe0",
|
|
9431
|
+
lime: "0f0",
|
|
9432
|
+
limegreen: "32cd32",
|
|
9433
|
+
linen: "faf0e6",
|
|
9434
|
+
magenta: "f0f",
|
|
9435
|
+
maroon: "800000",
|
|
9436
|
+
mediumaquamarine: "66cdaa",
|
|
9437
|
+
mediumblue: "0000cd",
|
|
9438
|
+
mediumorchid: "ba55d3",
|
|
9439
|
+
mediumpurple: "9370db",
|
|
9440
|
+
mediumseagreen: "3cb371",
|
|
9441
|
+
mediumslateblue: "7b68ee",
|
|
9442
|
+
mediumspringgreen: "00fa9a",
|
|
9443
|
+
mediumturquoise: "48d1cc",
|
|
9444
|
+
mediumvioletred: "c71585",
|
|
9445
|
+
midnightblue: "191970",
|
|
9446
|
+
mintcream: "f5fffa",
|
|
9447
|
+
mistyrose: "ffe4e1",
|
|
9448
|
+
moccasin: "ffe4b5",
|
|
9449
|
+
navajowhite: "ffdead",
|
|
9450
|
+
navy: "000080",
|
|
9451
|
+
oldlace: "fdf5e6",
|
|
9452
|
+
olive: "808000",
|
|
9453
|
+
olivedrab: "6b8e23",
|
|
9454
|
+
orange: "ffa500",
|
|
9455
|
+
orangered: "ff4500",
|
|
9456
|
+
orchid: "da70d6",
|
|
9457
|
+
palegoldenrod: "eee8aa",
|
|
9458
|
+
palegreen: "98fb98",
|
|
9459
|
+
paleturquoise: "afeeee",
|
|
9460
|
+
palevioletred: "db7093",
|
|
9461
|
+
papayawhip: "ffefd5",
|
|
9462
|
+
peachpuff: "ffdab9",
|
|
9463
|
+
peru: "cd853f",
|
|
9464
|
+
pink: "ffc0cb",
|
|
9465
|
+
plum: "dda0dd",
|
|
9466
|
+
powderblue: "b0e0e6",
|
|
9467
|
+
purple: "800080",
|
|
9468
|
+
rebeccapurple: "663399",
|
|
9469
|
+
red: "f00",
|
|
9470
|
+
rosybrown: "bc8f8f",
|
|
9471
|
+
royalblue: "4169e1",
|
|
9472
|
+
saddlebrown: "8b4513",
|
|
9473
|
+
salmon: "fa8072",
|
|
9474
|
+
sandybrown: "f4a460",
|
|
9475
|
+
seagreen: "2e8b57",
|
|
9476
|
+
seashell: "fff5ee",
|
|
9477
|
+
sienna: "a0522d",
|
|
9478
|
+
silver: "c0c0c0",
|
|
9479
|
+
skyblue: "87ceeb",
|
|
9480
|
+
slateblue: "6a5acd",
|
|
9481
|
+
slategray: "708090",
|
|
9482
|
+
slategrey: "708090",
|
|
9483
|
+
snow: "fffafa",
|
|
9484
|
+
springgreen: "00ff7f",
|
|
9485
|
+
steelblue: "4682b4",
|
|
9486
|
+
tan: "d2b48c",
|
|
9487
|
+
teal: "008080",
|
|
9488
|
+
thistle: "d8bfd8",
|
|
9489
|
+
tomato: "ff6347",
|
|
9490
|
+
turquoise: "40e0d0",
|
|
9491
|
+
violet: "ee82ee",
|
|
9492
|
+
wheat: "f5deb3",
|
|
9493
|
+
white: "fff",
|
|
9494
|
+
whitesmoke: "f5f5f5",
|
|
9495
|
+
yellow: "ff0",
|
|
9496
|
+
yellowgreen: "9acd32"
|
|
9497
|
+
};
|
|
8836
9498
|
|
|
8837
|
-
|
|
9499
|
+
// Make it easy to access colors via `hexNames[hex]`
|
|
9500
|
+
var hexNames = tinycolor.hexNames = flip(names);
|
|
8838
9501
|
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
setToString = _setToString;
|
|
9502
|
+
// Utilities
|
|
9503
|
+
// ---------
|
|
8842
9504
|
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
return setToString(overRest(func, start, identity), func + '');
|
|
9505
|
+
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
|
|
9506
|
+
function flip(o) {
|
|
9507
|
+
var flipped = {};
|
|
9508
|
+
for (var i in o) {
|
|
9509
|
+
if (o.hasOwnProperty(i)) {
|
|
9510
|
+
flipped[o[i]] = i;
|
|
9511
|
+
}
|
|
9512
|
+
}
|
|
9513
|
+
return flipped;
|
|
8853
9514
|
}
|
|
8854
9515
|
|
|
8855
|
-
|
|
9516
|
+
// Return a valid alpha value [0,1] with all invalid values being set to 1
|
|
9517
|
+
function boundAlpha(a) {
|
|
9518
|
+
a = parseFloat(a);
|
|
9519
|
+
if (isNaN(a) || a < 0 || a > 1) {
|
|
9520
|
+
a = 1;
|
|
9521
|
+
}
|
|
9522
|
+
return a;
|
|
9523
|
+
}
|
|
8856
9524
|
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
9525
|
+
// Take input from [0, n] and return it as [0, 1]
|
|
9526
|
+
function bound01(n, max) {
|
|
9527
|
+
if (isOnePointZero(n)) n = "100%";
|
|
9528
|
+
var processPercent = isPercentage(n);
|
|
9529
|
+
n = Math.min(max, Math.max(0, parseFloat(n)));
|
|
8861
9530
|
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
*
|
|
8865
|
-
* @private
|
|
8866
|
-
* @param {*} value The potential iteratee value argument.
|
|
8867
|
-
* @param {*} index The potential iteratee index or key argument.
|
|
8868
|
-
* @param {*} object The potential iteratee object argument.
|
|
8869
|
-
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
8870
|
-
* else `false`.
|
|
8871
|
-
*/
|
|
8872
|
-
function isIterateeCall$1(value, index, object) {
|
|
8873
|
-
if (!isObject(object)) {
|
|
8874
|
-
return false;
|
|
9531
|
+
// Automatically convert percentage into number
|
|
9532
|
+
if (processPercent) {
|
|
9533
|
+
n = parseInt(n * max, 10) / 100;
|
|
8875
9534
|
}
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
) {
|
|
8881
|
-
return eq(object[index], value);
|
|
9535
|
+
|
|
9536
|
+
// Handle floating point rounding errors
|
|
9537
|
+
if (Math.abs(n - max) < 0.000001) {
|
|
9538
|
+
return 1;
|
|
8882
9539
|
}
|
|
8883
|
-
|
|
9540
|
+
|
|
9541
|
+
// Convert into [0, 1] range if it isn't already
|
|
9542
|
+
return n % max / parseFloat(max);
|
|
8884
9543
|
}
|
|
8885
9544
|
|
|
8886
|
-
|
|
9545
|
+
// Force a number between 0 and 1
|
|
9546
|
+
function clamp01(val) {
|
|
9547
|
+
return Math.min(1, Math.max(0, val));
|
|
9548
|
+
}
|
|
8887
9549
|
|
|
8888
|
-
|
|
8889
|
-
|
|
9550
|
+
// Parse a base-16 hex value into a base-10 integer
|
|
9551
|
+
function parseIntFromHex(val) {
|
|
9552
|
+
return parseInt(val, 16);
|
|
9553
|
+
}
|
|
8890
9554
|
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
* @returns {Function} Returns the new assigner function.
|
|
8897
|
-
*/
|
|
8898
|
-
function createAssigner$1(assigner) {
|
|
8899
|
-
return baseRest(function(object, sources) {
|
|
8900
|
-
var index = -1,
|
|
8901
|
-
length = sources.length,
|
|
8902
|
-
customizer = length > 1 ? sources[length - 1] : undefined,
|
|
8903
|
-
guard = length > 2 ? sources[2] : undefined;
|
|
9555
|
+
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
|
|
9556
|
+
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
|
|
9557
|
+
function isOnePointZero(n) {
|
|
9558
|
+
return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
|
|
9559
|
+
}
|
|
8904
9560
|
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
9561
|
+
// Check to see if string passed in is a percentage
|
|
9562
|
+
function isPercentage(n) {
|
|
9563
|
+
return typeof n === "string" && n.indexOf("%") != -1;
|
|
9564
|
+
}
|
|
8908
9565
|
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
}
|
|
8913
|
-
object = Object(object);
|
|
8914
|
-
while (++index < length) {
|
|
8915
|
-
var source = sources[index];
|
|
8916
|
-
if (source) {
|
|
8917
|
-
assigner(object, source, index, customizer);
|
|
8918
|
-
}
|
|
8919
|
-
}
|
|
8920
|
-
return object;
|
|
8921
|
-
});
|
|
9566
|
+
// Force a hex value to have 2 characters
|
|
9567
|
+
function pad2(c) {
|
|
9568
|
+
return c.length == 1 ? "0" + c : "" + c;
|
|
8922
9569
|
}
|
|
8923
9570
|
|
|
8924
|
-
|
|
9571
|
+
// Replace a decimal with it's percentage value
|
|
9572
|
+
function convertToPercentage(n) {
|
|
9573
|
+
if (n <= 1) {
|
|
9574
|
+
n = n * 100 + "%";
|
|
9575
|
+
}
|
|
9576
|
+
return n;
|
|
9577
|
+
}
|
|
8925
9578
|
|
|
8926
|
-
|
|
8927
|
-
|
|
9579
|
+
// Converts a decimal to a hex value
|
|
9580
|
+
function convertDecimalToHex(d) {
|
|
9581
|
+
return Math.round(parseFloat(d) * 255).toString(16);
|
|
9582
|
+
}
|
|
9583
|
+
// Converts a hex value to a decimal
|
|
9584
|
+
function convertHexToDecimal(h) {
|
|
9585
|
+
return parseIntFromHex(h) / 255;
|
|
9586
|
+
}
|
|
9587
|
+
var matchers = function () {
|
|
9588
|
+
// <http://www.w3.org/TR/css3-values/#integers>
|
|
9589
|
+
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
9590
|
+
|
|
9591
|
+
// <http://www.w3.org/TR/css3-values/#number-value>
|
|
9592
|
+
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
9593
|
+
|
|
9594
|
+
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
|
|
9595
|
+
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
|
|
9596
|
+
|
|
9597
|
+
// Actual matching.
|
|
9598
|
+
// Parentheses and commas are optional, but not required.
|
|
9599
|
+
// Whitespace can take the place of commas or opening paren
|
|
9600
|
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
9601
|
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
9602
|
+
return {
|
|
9603
|
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
9604
|
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
9605
|
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
9606
|
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
|
9607
|
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
9608
|
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
9609
|
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
9610
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
9611
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
9612
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
9613
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
9614
|
+
};
|
|
9615
|
+
}();
|
|
9616
|
+
|
|
9617
|
+
// `isValidCSSUnit`
|
|
9618
|
+
// Take in a single string / number and check to see if it looks like a CSS unit
|
|
9619
|
+
// (see `matchers` above for definition).
|
|
9620
|
+
function isValidCSSUnit(color) {
|
|
9621
|
+
return !!matchers.CSS_UNIT.exec(color);
|
|
9622
|
+
}
|
|
9623
|
+
|
|
9624
|
+
// `stringInputToObject`
|
|
9625
|
+
// Permissive string parsing. Take in a number of formats, and output an object
|
|
9626
|
+
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
|
9627
|
+
function stringInputToObject(color) {
|
|
9628
|
+
color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
|
|
9629
|
+
var named = false;
|
|
9630
|
+
if (names[color]) {
|
|
9631
|
+
color = names[color];
|
|
9632
|
+
named = true;
|
|
9633
|
+
} else if (color == "transparent") {
|
|
9634
|
+
return {
|
|
9635
|
+
r: 0,
|
|
9636
|
+
g: 0,
|
|
9637
|
+
b: 0,
|
|
9638
|
+
a: 0,
|
|
9639
|
+
format: "name"
|
|
9640
|
+
};
|
|
9641
|
+
}
|
|
9642
|
+
|
|
9643
|
+
// Try to match string input using regular expressions.
|
|
9644
|
+
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
|
|
9645
|
+
// Just return an object and let the conversion functions handle that.
|
|
9646
|
+
// This way the result will be the same whether the tinycolor is initialized with string or object.
|
|
9647
|
+
var match;
|
|
9648
|
+
if (match = matchers.rgb.exec(color)) {
|
|
9649
|
+
return {
|
|
9650
|
+
r: match[1],
|
|
9651
|
+
g: match[2],
|
|
9652
|
+
b: match[3]
|
|
9653
|
+
};
|
|
9654
|
+
}
|
|
9655
|
+
if (match = matchers.rgba.exec(color)) {
|
|
9656
|
+
return {
|
|
9657
|
+
r: match[1],
|
|
9658
|
+
g: match[2],
|
|
9659
|
+
b: match[3],
|
|
9660
|
+
a: match[4]
|
|
9661
|
+
};
|
|
9662
|
+
}
|
|
9663
|
+
if (match = matchers.hsl.exec(color)) {
|
|
9664
|
+
return {
|
|
9665
|
+
h: match[1],
|
|
9666
|
+
s: match[2],
|
|
9667
|
+
l: match[3]
|
|
9668
|
+
};
|
|
9669
|
+
}
|
|
9670
|
+
if (match = matchers.hsla.exec(color)) {
|
|
9671
|
+
return {
|
|
9672
|
+
h: match[1],
|
|
9673
|
+
s: match[2],
|
|
9674
|
+
l: match[3],
|
|
9675
|
+
a: match[4]
|
|
9676
|
+
};
|
|
9677
|
+
}
|
|
9678
|
+
if (match = matchers.hsv.exec(color)) {
|
|
9679
|
+
return {
|
|
9680
|
+
h: match[1],
|
|
9681
|
+
s: match[2],
|
|
9682
|
+
v: match[3]
|
|
9683
|
+
};
|
|
9684
|
+
}
|
|
9685
|
+
if (match = matchers.hsva.exec(color)) {
|
|
9686
|
+
return {
|
|
9687
|
+
h: match[1],
|
|
9688
|
+
s: match[2],
|
|
9689
|
+
v: match[3],
|
|
9690
|
+
a: match[4]
|
|
9691
|
+
};
|
|
9692
|
+
}
|
|
9693
|
+
if (match = matchers.hex8.exec(color)) {
|
|
9694
|
+
return {
|
|
9695
|
+
r: parseIntFromHex(match[1]),
|
|
9696
|
+
g: parseIntFromHex(match[2]),
|
|
9697
|
+
b: parseIntFromHex(match[3]),
|
|
9698
|
+
a: convertHexToDecimal(match[4]),
|
|
9699
|
+
format: named ? "name" : "hex8"
|
|
9700
|
+
};
|
|
9701
|
+
}
|
|
9702
|
+
if (match = matchers.hex6.exec(color)) {
|
|
9703
|
+
return {
|
|
9704
|
+
r: parseIntFromHex(match[1]),
|
|
9705
|
+
g: parseIntFromHex(match[2]),
|
|
9706
|
+
b: parseIntFromHex(match[3]),
|
|
9707
|
+
format: named ? "name" : "hex"
|
|
9708
|
+
};
|
|
9709
|
+
}
|
|
9710
|
+
if (match = matchers.hex4.exec(color)) {
|
|
9711
|
+
return {
|
|
9712
|
+
r: parseIntFromHex(match[1] + "" + match[1]),
|
|
9713
|
+
g: parseIntFromHex(match[2] + "" + match[2]),
|
|
9714
|
+
b: parseIntFromHex(match[3] + "" + match[3]),
|
|
9715
|
+
a: convertHexToDecimal(match[4] + "" + match[4]),
|
|
9716
|
+
format: named ? "name" : "hex8"
|
|
9717
|
+
};
|
|
9718
|
+
}
|
|
9719
|
+
if (match = matchers.hex3.exec(color)) {
|
|
9720
|
+
return {
|
|
9721
|
+
r: parseIntFromHex(match[1] + "" + match[1]),
|
|
9722
|
+
g: parseIntFromHex(match[2] + "" + match[2]),
|
|
9723
|
+
b: parseIntFromHex(match[3] + "" + match[3]),
|
|
9724
|
+
format: named ? "name" : "hex"
|
|
9725
|
+
};
|
|
9726
|
+
}
|
|
9727
|
+
return false;
|
|
9728
|
+
}
|
|
9729
|
+
function validateWCAG2Parms(parms) {
|
|
9730
|
+
// return valid WCAG2 parms for isReadable.
|
|
9731
|
+
// If input parms are invalid, return {"level":"AA", "size":"small"}
|
|
9732
|
+
var level, size;
|
|
9733
|
+
parms = parms || {
|
|
9734
|
+
level: "AA",
|
|
9735
|
+
size: "small"
|
|
9736
|
+
};
|
|
9737
|
+
level = (parms.level || "AA").toUpperCase();
|
|
9738
|
+
size = (parms.size || "small").toLowerCase();
|
|
9739
|
+
if (level !== "AA" && level !== "AAA") {
|
|
9740
|
+
level = "AA";
|
|
9741
|
+
}
|
|
9742
|
+
if (size !== "small" && size !== "large") {
|
|
9743
|
+
size = "small";
|
|
9744
|
+
}
|
|
9745
|
+
return {
|
|
9746
|
+
level: level,
|
|
9747
|
+
size: size
|
|
9748
|
+
};
|
|
9749
|
+
}
|
|
9750
|
+
|
|
9751
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9752
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9753
|
+
// WCAG2ContrastOptions are the options used to determine if a color is readable
|
|
9754
|
+
var WCAG2ContrastOptions = {
|
|
9755
|
+
level: 'AAA',
|
|
9756
|
+
size: 'large'
|
|
9757
|
+
};
|
|
8928
9758
|
|
|
8929
9759
|
/**
|
|
8930
|
-
*
|
|
8931
|
-
*
|
|
8932
|
-
*
|
|
8933
|
-
*
|
|
8934
|
-
* are merged recursively. Other objects and value types are overridden by
|
|
8935
|
-
* assignment. Source objects are applied from left to right. Subsequent
|
|
8936
|
-
* sources overwrite property assignments of previous sources.
|
|
8937
|
-
*
|
|
8938
|
-
* **Note:** This method mutates `object`.
|
|
8939
|
-
*
|
|
8940
|
-
* @static
|
|
8941
|
-
* @memberOf _
|
|
8942
|
-
* @since 0.5.0
|
|
8943
|
-
* @category Object
|
|
8944
|
-
* @param {Object} object The destination object.
|
|
8945
|
-
* @param {...Object} [sources] The source objects.
|
|
8946
|
-
* @returns {Object} Returns `object`.
|
|
9760
|
+
* getColorWithOpacity
|
|
9761
|
+
* @param color - The color to add opacity to
|
|
9762
|
+
* @param opacity - The opacity to add to the color
|
|
9763
|
+
* @returns The color with the opacity added
|
|
8947
9764
|
* @example
|
|
9765
|
+
* getColorWithOpacity('#fff', 0.5) // returns 'hsla(0, 0%, 100%, 0.5)'
|
|
8948
9766
|
*
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
* var other = {
|
|
8954
|
-
* 'a': [{ 'c': 3 }, { 'e': 5 }]
|
|
8955
|
-
* };
|
|
8956
|
-
*
|
|
8957
|
-
* _.merge(object, other);
|
|
8958
|
-
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
|
|
8959
|
-
*/
|
|
8960
|
-
var merge = createAssigner(function(object, source, srcIndex) {
|
|
8961
|
-
baseMerge(object, source, srcIndex);
|
|
8962
|
-
});
|
|
8963
|
-
|
|
8964
|
-
var merge_1 = merge;
|
|
8965
|
-
|
|
8966
|
-
var merge$1 = /*@__PURE__*/getDefaultExportFromCjs(merge_1);
|
|
9767
|
+
**/
|
|
9768
|
+
var getColorWithOpacity = function getColorWithOpacity(color, opacity) {
|
|
9769
|
+
return tinycolor(color).setAlpha(opacity).toHslString();
|
|
9770
|
+
};
|
|
8967
9771
|
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
9772
|
+
/**
|
|
9773
|
+
*
|
|
9774
|
+
* @description
|
|
9775
|
+
* Generates a chromatic color palette based on the base color passed in.
|
|
9776
|
+
* The base color is used to generate a palette of 11 colors, 5 shades lighter and 5 shades darker than the base color.
|
|
9777
|
+
* @param baseColorInput - The base color to generate the chromatic color palette from in hex, rgb, or hsl format
|
|
9778
|
+
* @returns Array of chromatic color palette
|
|
9779
|
+
*/
|
|
9780
|
+
var generateChromaticBrandColors = function generateChromaticBrandColors(baseColorInput) {
|
|
9781
|
+
var baseColor = tinycolor(baseColorInput);
|
|
9782
|
+
var baseColorHslString = baseColor.toHslString();
|
|
8972
9783
|
{
|
|
8973
|
-
|
|
8974
|
-
|
|
9784
|
+
if (!baseColor.isValid()) {
|
|
9785
|
+
throwBladeError({
|
|
9786
|
+
message: 'Invalid brandColor passed',
|
|
9787
|
+
moduleName: 'createTheme'
|
|
9788
|
+
});
|
|
9789
|
+
}
|
|
8975
9790
|
}
|
|
8976
|
-
|
|
8977
|
-
var
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
9791
|
+
var palette = [baseColorHslString]; // Include the original color
|
|
9792
|
+
var brightness = tinycolor(baseColor).getBrightness();
|
|
9793
|
+
// Determine how much to lighten or darken the colors depending on the brightness of the base color
|
|
9794
|
+
var lightnessFactor = brightness > 150 ? 3 : 6;
|
|
9795
|
+
var darknessFactor = brightness < 50 ? 3 : 5;
|
|
9796
|
+
var currentColor = baseColor;
|
|
9797
|
+
|
|
9798
|
+
// Generate shades lighter
|
|
9799
|
+
for (var lightShadeIndex = 0; lightShadeIndex < 6; lightShadeIndex++) {
|
|
9800
|
+
currentColor = currentColor.brighten(lightnessFactor);
|
|
9801
|
+
palette.push(currentColor.toHslString());
|
|
8986
9802
|
}
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
var prefix = moduleName ? "[Blade: ".concat(moduleName, "]:") : PREFIX;
|
|
8994
|
-
getCommonLogger(type)("".concat(prefix, " ").concat(message));
|
|
9803
|
+
currentColor = tinycolor(baseColorHslString); // Reset to the base color
|
|
9804
|
+
|
|
9805
|
+
// Generate shades darker
|
|
9806
|
+
for (var darkShadeIndex = 0; darkShadeIndex < 4; darkShadeIndex++) {
|
|
9807
|
+
currentColor = currentColor.darken(darknessFactor);
|
|
9808
|
+
palette.unshift(currentColor.toHslString()); // Add shades at the beginning of the palette
|
|
8995
9809
|
}
|
|
9810
|
+
|
|
9811
|
+
var colorPalette = palette.reverse();
|
|
9812
|
+
var brandPrimaryColor = colorPalette[6];
|
|
9813
|
+
var brandColors = {
|
|
9814
|
+
'50': colorPalette[0],
|
|
9815
|
+
'100': colorPalette[1],
|
|
9816
|
+
'200': colorPalette[2],
|
|
9817
|
+
'300': colorPalette[3],
|
|
9818
|
+
'400': colorPalette[4],
|
|
9819
|
+
'500': colorPalette[5],
|
|
9820
|
+
'600': brandPrimaryColor,
|
|
9821
|
+
'700': colorPalette[7],
|
|
9822
|
+
'800': colorPalette[8],
|
|
9823
|
+
'900': colorPalette[9],
|
|
9824
|
+
'950': colorPalette[10],
|
|
9825
|
+
a00: getColorWithOpacity(brandPrimaryColor, opacity[0]),
|
|
9826
|
+
a50: getColorWithOpacity(brandPrimaryColor, opacity[1]),
|
|
9827
|
+
a100: getColorWithOpacity(brandPrimaryColor, opacity[2]),
|
|
9828
|
+
a200: getColorWithOpacity(brandPrimaryColor, opacity[3])
|
|
9829
|
+
};
|
|
9830
|
+
return brandColors;
|
|
8996
9831
|
};
|
|
8997
9832
|
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9833
|
+
/**
|
|
9834
|
+
*
|
|
9835
|
+
* @param brandColors - The brand colors to use to override the light theme
|
|
9836
|
+
* @description Returns overrides for the light theme with the brand colors passed in
|
|
9837
|
+
* @returns Overrides for the light theme with the custom brand colors
|
|
9838
|
+
*/
|
|
9839
|
+
var getOnLightOverrides = function getOnLightOverrides(brandColors) {
|
|
9840
|
+
// Select the most readable color to use as the foreground color on top of brand color
|
|
9841
|
+
// For example: On Primary Button where the background color is brand color, the text color should be either dark or light depending on which is more readable on top of that brand color
|
|
9842
|
+
var foregroundOnBrandColorLight = tinycolor.mostReadable(brandColors[800], [colors$2.neutral.blueGrayLight[1300], colors$2.neutral.blueGrayLight[0]], WCAG2ContrastOptions).toHslString();
|
|
9843
|
+
|
|
9844
|
+
// Select the most readable color to use as the foreground color on top of surface color
|
|
9845
|
+
// For example: On Secondary Button where the background color is surface color, the text color should be either the brand color or dark color depending on which is more readable on top of that surface color
|
|
9846
|
+
var foregroundOnSurfaceLight = tinycolor.isReadable(colors$2.neutral.blueGrayLight[50], brandColors[600], WCAG2ContrastOptions) ? brandColors[600] : colors$2.neutral.blueGrayLight[1100];
|
|
9847
|
+
|
|
9848
|
+
// Overrides for the light theme with the brand colors passed in
|
|
9849
|
+
var lightThemeOverrides = {
|
|
9850
|
+
colors: {
|
|
9851
|
+
onLight: {
|
|
9852
|
+
brand: {
|
|
9853
|
+
primary: {
|
|
9854
|
+
300: brandColors.a50,
|
|
9855
|
+
400: brandColors.a100,
|
|
9856
|
+
500: brandColors[600],
|
|
9857
|
+
600: brandColors[700],
|
|
9858
|
+
700: brandColors[800],
|
|
9859
|
+
800: brandColors[950]
|
|
9860
|
+
},
|
|
9861
|
+
gray: {
|
|
9862
|
+
200: {
|
|
9863
|
+
lowContrast: foregroundOnBrandColorLight
|
|
9864
|
+
}
|
|
9865
|
+
}
|
|
9866
|
+
},
|
|
9867
|
+
action: {
|
|
9868
|
+
background: {
|
|
9869
|
+
primary: {
|
|
9870
|
+
"default": brandColors[600],
|
|
9871
|
+
hover: brandColors[700],
|
|
9872
|
+
focus: brandColors[800],
|
|
9873
|
+
active: brandColors[900]
|
|
9874
|
+
},
|
|
9875
|
+
secondary: {
|
|
9876
|
+
"default": brandColors.a00,
|
|
9877
|
+
hover: brandColors.a50,
|
|
9878
|
+
focus: brandColors.a100,
|
|
9879
|
+
active: brandColors.a200
|
|
9880
|
+
},
|
|
9881
|
+
tertiary: {
|
|
9882
|
+
"default": colors$2.neutral.blueGrayLight[0],
|
|
9883
|
+
hover: colors$2.neutral.blueGrayLight[50],
|
|
9884
|
+
focus: colors$2.neutral.blueGrayLight[100],
|
|
9885
|
+
active: colors$2.neutral.blueGrayLight[200]
|
|
9886
|
+
}
|
|
9887
|
+
},
|
|
9888
|
+
border: {
|
|
9889
|
+
primary: {
|
|
9890
|
+
"default": brandColors[600],
|
|
9891
|
+
hover: brandColors[700],
|
|
9892
|
+
focus: brandColors[800],
|
|
9893
|
+
active: brandColors[900]
|
|
9894
|
+
},
|
|
9895
|
+
secondary: {
|
|
9896
|
+
"default": brandColors[600],
|
|
9897
|
+
hover: brandColors[600],
|
|
9898
|
+
focus: brandColors[600],
|
|
9899
|
+
active: brandColors[600]
|
|
9900
|
+
},
|
|
9901
|
+
tertiary: {
|
|
9902
|
+
"default": colors$2.neutral.blueGrayLight[300],
|
|
9903
|
+
hover: colors$2.neutral.blueGrayLight[300],
|
|
9904
|
+
focus: colors$2.neutral.blueGrayLight[300],
|
|
9905
|
+
active: colors$2.neutral.blueGrayLight[300]
|
|
9906
|
+
}
|
|
9907
|
+
},
|
|
9908
|
+
text: {
|
|
9909
|
+
primary: {
|
|
9910
|
+
"default": foregroundOnBrandColorLight,
|
|
9911
|
+
hover: foregroundOnBrandColorLight,
|
|
9912
|
+
focus: foregroundOnBrandColorLight,
|
|
9913
|
+
active: foregroundOnBrandColorLight
|
|
9914
|
+
},
|
|
9915
|
+
secondary: {
|
|
9916
|
+
"default": foregroundOnSurfaceLight,
|
|
9917
|
+
hover: foregroundOnSurfaceLight,
|
|
9918
|
+
focus: foregroundOnSurfaceLight,
|
|
9919
|
+
active: foregroundOnSurfaceLight
|
|
9920
|
+
}
|
|
9921
|
+
},
|
|
9922
|
+
icon: {
|
|
9923
|
+
primary: {
|
|
9924
|
+
"default": foregroundOnBrandColorLight,
|
|
9925
|
+
hover: foregroundOnBrandColorLight,
|
|
9926
|
+
focus: foregroundOnBrandColorLight,
|
|
9927
|
+
active: foregroundOnBrandColorLight
|
|
9928
|
+
},
|
|
9929
|
+
secondary: {
|
|
9930
|
+
"default": foregroundOnSurfaceLight,
|
|
9931
|
+
hover: foregroundOnSurfaceLight,
|
|
9932
|
+
focus: foregroundOnSurfaceLight,
|
|
9933
|
+
active: foregroundOnSurfaceLight
|
|
9934
|
+
}
|
|
9021
9935
|
}
|
|
9022
|
-
matchResponses.push(false);
|
|
9023
|
-
}
|
|
9024
|
-
if (typeof valueToMatch === 'string') {
|
|
9025
|
-
// we have reached leaf node of the objectToMatch(i.e sub-object)
|
|
9026
|
-
matchResponses.push(true);
|
|
9027
|
-
}
|
|
9028
|
-
if (isObject$9(valueToMatch) && isObject$9(valueToInspect)) {
|
|
9029
|
-
// let's go inside further and do a nested check
|
|
9030
|
-
matchObjectKeys({
|
|
9031
|
-
innerObjectToMatch: valueToMatch,
|
|
9032
|
-
innerObjectToInspect: valueToInspect
|
|
9033
|
-
});
|
|
9034
9936
|
}
|
|
9035
|
-
}
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9937
|
+
}
|
|
9938
|
+
}
|
|
9939
|
+
};
|
|
9940
|
+
return lightThemeOverrides;
|
|
9941
|
+
};
|
|
9942
|
+
|
|
9943
|
+
/**
|
|
9944
|
+
*
|
|
9945
|
+
* @param brandColors - The brand colors to use to override the dark theme
|
|
9946
|
+
* @description Returns overrides for the dark theme with the brand colors passed in
|
|
9947
|
+
* @returns Overrides for the dark theme with the custom brand colors
|
|
9948
|
+
*/
|
|
9949
|
+
var getOnDarkOverrides = function getOnDarkOverrides(brandColors) {
|
|
9950
|
+
// Select the most readable color to use as the foreground color on top of brand color
|
|
9951
|
+
// For example: On Primary Button where the background color is brand color, the text color should be either dark or light depending on which is more readable on top of that brand color
|
|
9952
|
+
var foregroundOnBrandColorDark = tinycolor.mostReadable(brandColors[800], [colors$2.neutral.blueGrayDark[800], colors$2.neutral.blueGrayDark[0]], WCAG2ContrastOptions).toHslString();
|
|
9953
|
+
|
|
9954
|
+
// Select the most readable color to use as the foreground color on top of surface color
|
|
9955
|
+
// For example: On Secondary Button where the background color is surface color, the text color should be either the brand color or light color depending on which is more readable on top of that surface color
|
|
9956
|
+
var foregroundOnSurfaceDark = tinycolor.isReadable(colors$2.neutral.blueGrayDark[1100], brandColors[400], WCAG2ContrastOptions) ? brandColors[400] : colors$2.neutral.blueGrayDark[0];
|
|
9957
|
+
|
|
9958
|
+
// Overrides for the dark theme with the brand colors passed in
|
|
9959
|
+
var darkThemeOverrides = {
|
|
9960
|
+
colors: {
|
|
9961
|
+
onDark: {
|
|
9962
|
+
brand: {
|
|
9963
|
+
primary: {
|
|
9964
|
+
300: brandColors.a100,
|
|
9965
|
+
400: brandColors.a200,
|
|
9966
|
+
500: brandColors[400],
|
|
9967
|
+
600: brandColors[500],
|
|
9968
|
+
700: brandColors[600],
|
|
9969
|
+
800: brandColors[900]
|
|
9970
|
+
},
|
|
9971
|
+
gray: {
|
|
9972
|
+
200: {
|
|
9973
|
+
lowContrast: foregroundOnBrandColorDark
|
|
9974
|
+
}
|
|
9975
|
+
}
|
|
9976
|
+
},
|
|
9977
|
+
action: {
|
|
9978
|
+
background: {
|
|
9979
|
+
primary: {
|
|
9980
|
+
"default": brandColors[500],
|
|
9981
|
+
hover: brandColors[600],
|
|
9982
|
+
focus: brandColors[700],
|
|
9983
|
+
active: brandColors[800]
|
|
9984
|
+
},
|
|
9985
|
+
secondary: {
|
|
9986
|
+
"default": brandColors.a00,
|
|
9987
|
+
hover: brandColors.a50,
|
|
9988
|
+
focus: brandColors.a100,
|
|
9989
|
+
active: brandColors.a200
|
|
9990
|
+
}
|
|
9991
|
+
},
|
|
9992
|
+
border: {
|
|
9993
|
+
primary: {
|
|
9994
|
+
"default": brandColors[500],
|
|
9995
|
+
hover: brandColors[600],
|
|
9996
|
+
focus: brandColors[700],
|
|
9997
|
+
active: brandColors[800]
|
|
9998
|
+
},
|
|
9999
|
+
secondary: {
|
|
10000
|
+
"default": brandColors[400],
|
|
10001
|
+
hover: brandColors[400],
|
|
10002
|
+
focus: brandColors[400],
|
|
10003
|
+
active: brandColors[400]
|
|
10004
|
+
}
|
|
10005
|
+
},
|
|
10006
|
+
text: {
|
|
10007
|
+
primary: {
|
|
10008
|
+
"default": foregroundOnBrandColorDark,
|
|
10009
|
+
hover: foregroundOnBrandColorDark,
|
|
10010
|
+
focus: foregroundOnBrandColorDark,
|
|
10011
|
+
active: foregroundOnBrandColorDark
|
|
10012
|
+
},
|
|
10013
|
+
secondary: {
|
|
10014
|
+
"default": foregroundOnSurfaceDark,
|
|
10015
|
+
hover: foregroundOnSurfaceDark,
|
|
10016
|
+
focus: foregroundOnSurfaceDark,
|
|
10017
|
+
active: foregroundOnSurfaceDark
|
|
10018
|
+
}
|
|
10019
|
+
},
|
|
10020
|
+
icon: {
|
|
10021
|
+
primary: {
|
|
10022
|
+
"default": foregroundOnBrandColorDark,
|
|
10023
|
+
hover: foregroundOnBrandColorDark,
|
|
10024
|
+
focus: foregroundOnBrandColorDark,
|
|
10025
|
+
active: foregroundOnBrandColorDark
|
|
10026
|
+
},
|
|
10027
|
+
secondary: {
|
|
10028
|
+
"default": foregroundOnSurfaceDark,
|
|
10029
|
+
hover: foregroundOnSurfaceDark,
|
|
10030
|
+
focus: foregroundOnSurfaceDark,
|
|
10031
|
+
active: foregroundOnSurfaceDark
|
|
10032
|
+
}
|
|
10033
|
+
}
|
|
9043
10034
|
}
|
|
9044
|
-
matchResponses.push(false);
|
|
9045
10035
|
}
|
|
9046
10036
|
}
|
|
9047
10037
|
};
|
|
9048
|
-
|
|
9049
|
-
innerObjectToMatch: objectToMatch,
|
|
9050
|
-
innerObjectToInspect: objectToInspect
|
|
9051
|
-
});
|
|
9052
|
-
return matchResponses.every(Boolean);
|
|
10038
|
+
return darkThemeOverrides;
|
|
9053
10039
|
};
|
|
9054
10040
|
|
|
9055
10041
|
/**
|
|
10042
|
+
* @param {Object} themeConfig - The brand color and overrides to apply to the theme
|
|
10043
|
+
* @param {string} themeConfig.brandColor - The brand color to use to generate the theme. Can be in hex, rgb, or hsl format.
|
|
9056
10044
|
* @description
|
|
9057
|
-
*
|
|
9058
|
-
*
|
|
9059
|
-
* which you can pass into BladeProvider.
|
|
9060
|
-
*
|
|
10045
|
+
* Creates a Blade Theme based on the custom brand color
|
|
10046
|
+
* @returns The Theme Tokens with the custom brand colors
|
|
9061
10047
|
* @example
|
|
9062
|
-
*
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
var baseThemeTokens = _ref.baseThemeTokens,
|
|
9083
|
-
overrides = _ref.overrides;
|
|
9084
|
-
{
|
|
9085
|
-
if (!isEqual$1(baseThemeTokens, paymentTheme) && !isEqual$1(baseThemeTokens, bankingTheme)) {
|
|
9086
|
-
throwBladeError({
|
|
9087
|
-
message: 'The base theme provided is not a valid Blade theme',
|
|
9088
|
-
moduleName: 'overrideTheme'
|
|
9089
|
-
});
|
|
9090
|
-
}
|
|
9091
|
-
if (!isPartialMatchObjectKeys({
|
|
9092
|
-
objectToMatch: overrides,
|
|
9093
|
-
objectToInspect: baseThemeTokens
|
|
9094
|
-
})) {
|
|
9095
|
-
throwBladeError({
|
|
9096
|
-
message: 'The overrides object is not valid',
|
|
9097
|
-
moduleName: 'overrideTheme'
|
|
9098
|
-
});
|
|
10048
|
+
* const theme = createTheme({ brandColor: '#19BEA2'})
|
|
10049
|
+
**/
|
|
10050
|
+
var createTheme = function createTheme(_ref) {
|
|
10051
|
+
var _brandedLightTheme$co, _brandedDarkTheme$col;
|
|
10052
|
+
var brandColor = _ref.brandColor;
|
|
10053
|
+
var chromaticBrandColors = generateChromaticBrandColors(brandColor);
|
|
10054
|
+
// Get onLight overrides
|
|
10055
|
+
var brandedLightTheme = getOnLightOverrides(chromaticBrandColors);
|
|
10056
|
+
// Get onDark overrides
|
|
10057
|
+
var brandedDarkTheme = getOnDarkOverrides(chromaticBrandColors);
|
|
10058
|
+
|
|
10059
|
+
// Override the payment theme with the brand colors
|
|
10060
|
+
var brandedThemeTokens = overrideTheme({
|
|
10061
|
+
baseThemeTokens: paymentTheme,
|
|
10062
|
+
overrides: {
|
|
10063
|
+
name: "custom-".concat(tinycolor(brandColor).toHex()),
|
|
10064
|
+
colors: {
|
|
10065
|
+
onLight: _objectSpread({}, brandedLightTheme === null || brandedLightTheme === void 0 ? void 0 : (_brandedLightTheme$co = brandedLightTheme.colors) === null || _brandedLightTheme$co === void 0 ? void 0 : _brandedLightTheme$co.onLight),
|
|
10066
|
+
onDark: _objectSpread({}, brandedDarkTheme === null || brandedDarkTheme === void 0 ? void 0 : (_brandedDarkTheme$col = brandedDarkTheme.colors) === null || _brandedDarkTheme$col === void 0 ? void 0 : _brandedDarkTheme$col.onDark)
|
|
10067
|
+
}
|
|
9099
10068
|
}
|
|
9100
|
-
}
|
|
9101
|
-
|
|
9102
|
-
// Need to clone before merging since merge changes/mutates the actual object
|
|
9103
|
-
return merge$1(cloneDeep$1(baseThemeTokens), overrides);
|
|
10069
|
+
});
|
|
10070
|
+
return brandedThemeTokens;
|
|
9104
10071
|
};
|
|
9105
10072
|
|
|
9106
|
-
export { bankingTheme, border, breakpoints, colors$2 as colors, elevation, motion, opacity, overrideTheme, paymentTheme, size, spacing, typography };
|
|
10073
|
+
export { bankingTheme, border, breakpoints, colors$2 as colors, createTheme, elevation, motion, opacity, overrideTheme, paymentTheme, size, spacing, typography };
|
|
9107
10074
|
//# sourceMappingURL=index.development.web.js.map
|