@razorpay/blade 10.12.0 → 10.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.d.ts +6 -6
- package/build/components/index.development.web.js +21 -20
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +6 -6
- package/build/components/index.native.js +7 -7
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +21 -20
- 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
|
@@ -82,13 +82,13 @@ var _listCacheClear = listCacheClear$1;
|
|
|
82
82
|
* // => true
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
|
-
function eq$
|
|
85
|
+
function eq$4(value, other) {
|
|
86
86
|
return value === other || (value !== value && other !== other);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
var eq_1 = eq$
|
|
89
|
+
var eq_1 = eq$4;
|
|
90
90
|
|
|
91
|
-
var eq$
|
|
91
|
+
var eq$3 = eq_1;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
@@ -101,7 +101,7 @@ var eq$4 = eq_1;
|
|
|
101
101
|
function assocIndexOf$4(array, key) {
|
|
102
102
|
var length = array.length;
|
|
103
103
|
while (length--) {
|
|
104
|
-
if (eq$
|
|
104
|
+
if (eq$3(array[length][0], key)) {
|
|
105
105
|
return length;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -337,17 +337,17 @@ var _Symbol = Symbol$4;
|
|
|
337
337
|
var Symbol$3 = _Symbol;
|
|
338
338
|
|
|
339
339
|
/** Used for built-in method references. */
|
|
340
|
-
var objectProto$
|
|
340
|
+
var objectProto$d = Object.prototype;
|
|
341
341
|
|
|
342
342
|
/** Used to check objects for own properties. */
|
|
343
|
-
var hasOwnProperty$
|
|
343
|
+
var hasOwnProperty$a = objectProto$d.hasOwnProperty;
|
|
344
344
|
|
|
345
345
|
/**
|
|
346
346
|
* Used to resolve the
|
|
347
347
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
348
348
|
* of values.
|
|
349
349
|
*/
|
|
350
|
-
var nativeObjectToString$1 = objectProto$
|
|
350
|
+
var nativeObjectToString$1 = objectProto$d.toString;
|
|
351
351
|
|
|
352
352
|
/** Built-in value references. */
|
|
353
353
|
var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
|
|
@@ -360,7 +360,7 @@ var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
|
|
|
360
360
|
* @returns {string} Returns the raw `toStringTag`.
|
|
361
361
|
*/
|
|
362
362
|
function getRawTag$1(value) {
|
|
363
|
-
var isOwn = hasOwnProperty$
|
|
363
|
+
var isOwn = hasOwnProperty$a.call(value, symToStringTag$1),
|
|
364
364
|
tag = value[symToStringTag$1];
|
|
365
365
|
|
|
366
366
|
try {
|
|
@@ -383,14 +383,14 @@ var _getRawTag = getRawTag$1;
|
|
|
383
383
|
|
|
384
384
|
/** Used for built-in method references. */
|
|
385
385
|
|
|
386
|
-
var objectProto$
|
|
386
|
+
var objectProto$c = Object.prototype;
|
|
387
387
|
|
|
388
388
|
/**
|
|
389
389
|
* Used to resolve the
|
|
390
390
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
391
391
|
* of values.
|
|
392
392
|
*/
|
|
393
|
-
var nativeObjectToString = objectProto$
|
|
393
|
+
var nativeObjectToString = objectProto$c.toString;
|
|
394
394
|
|
|
395
395
|
/**
|
|
396
396
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -579,17 +579,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
579
579
|
|
|
580
580
|
/** Used for built-in method references. */
|
|
581
581
|
var funcProto$1 = Function.prototype,
|
|
582
|
-
objectProto$
|
|
582
|
+
objectProto$b = Object.prototype;
|
|
583
583
|
|
|
584
584
|
/** Used to resolve the decompiled source of functions. */
|
|
585
585
|
var funcToString$1 = funcProto$1.toString;
|
|
586
586
|
|
|
587
587
|
/** Used to check objects for own properties. */
|
|
588
|
-
var hasOwnProperty$
|
|
588
|
+
var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
589
589
|
|
|
590
590
|
/** Used to detect if a method is native. */
|
|
591
591
|
var reIsNative = RegExp('^' +
|
|
592
|
-
funcToString$1.call(hasOwnProperty$
|
|
592
|
+
funcToString$1.call(hasOwnProperty$9).replace(reRegExpChar, '\\$&')
|
|
593
593
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
594
594
|
);
|
|
595
595
|
|
|
@@ -697,13 +697,13 @@ var _hashDelete = hashDelete$1;
|
|
|
697
697
|
var nativeCreate$2 = _nativeCreate;
|
|
698
698
|
|
|
699
699
|
/** Used to stand-in for `undefined` hash values. */
|
|
700
|
-
var HASH_UNDEFINED$
|
|
700
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
701
701
|
|
|
702
702
|
/** Used for built-in method references. */
|
|
703
|
-
var objectProto$
|
|
703
|
+
var objectProto$a = Object.prototype;
|
|
704
704
|
|
|
705
705
|
/** Used to check objects for own properties. */
|
|
706
|
-
var hasOwnProperty$
|
|
706
|
+
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
707
707
|
|
|
708
708
|
/**
|
|
709
709
|
* Gets the hash value for `key`.
|
|
@@ -718,9 +718,9 @@ function hashGet$1(key) {
|
|
|
718
718
|
var data = this.__data__;
|
|
719
719
|
if (nativeCreate$2) {
|
|
720
720
|
var result = data[key];
|
|
721
|
-
return result === HASH_UNDEFINED$
|
|
721
|
+
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
722
722
|
}
|
|
723
|
-
return hasOwnProperty$
|
|
723
|
+
return hasOwnProperty$8.call(data, key) ? data[key] : undefined;
|
|
724
724
|
}
|
|
725
725
|
|
|
726
726
|
var _hashGet = hashGet$1;
|
|
@@ -728,10 +728,10 @@ var _hashGet = hashGet$1;
|
|
|
728
728
|
var nativeCreate$1 = _nativeCreate;
|
|
729
729
|
|
|
730
730
|
/** Used for built-in method references. */
|
|
731
|
-
var objectProto$
|
|
731
|
+
var objectProto$9 = Object.prototype;
|
|
732
732
|
|
|
733
733
|
/** Used to check objects for own properties. */
|
|
734
|
-
var hasOwnProperty$
|
|
734
|
+
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
735
735
|
|
|
736
736
|
/**
|
|
737
737
|
* Checks if a hash value for `key` exists.
|
|
@@ -744,7 +744,7 @@ var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
|
744
744
|
*/
|
|
745
745
|
function hashHas$1(key) {
|
|
746
746
|
var data = this.__data__;
|
|
747
|
-
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$
|
|
747
|
+
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$7.call(data, key);
|
|
748
748
|
}
|
|
749
749
|
|
|
750
750
|
var _hashHas = hashHas$1;
|
|
@@ -752,7 +752,7 @@ var _hashHas = hashHas$1;
|
|
|
752
752
|
var nativeCreate = _nativeCreate;
|
|
753
753
|
|
|
754
754
|
/** Used to stand-in for `undefined` hash values. */
|
|
755
|
-
var HASH_UNDEFINED
|
|
755
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
756
756
|
|
|
757
757
|
/**
|
|
758
758
|
* Sets the hash `key` to `value`.
|
|
@@ -767,7 +767,7 @@ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
|
767
767
|
function hashSet$1(key, value) {
|
|
768
768
|
var data = this.__data__;
|
|
769
769
|
this.size += this.has(key) ? 0 : 1;
|
|
770
|
-
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED
|
|
770
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
771
771
|
return this;
|
|
772
772
|
}
|
|
773
773
|
|
|
@@ -953,7 +953,7 @@ var mapCacheClear = _mapCacheClear,
|
|
|
953
953
|
* @constructor
|
|
954
954
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
955
955
|
*/
|
|
956
|
-
function MapCache$
|
|
956
|
+
function MapCache$1(entries) {
|
|
957
957
|
var index = -1,
|
|
958
958
|
length = entries == null ? 0 : entries.length;
|
|
959
959
|
|
|
@@ -965,17 +965,17 @@ function MapCache$2(entries) {
|
|
|
965
965
|
}
|
|
966
966
|
|
|
967
967
|
// Add methods to `MapCache`.
|
|
968
|
-
MapCache$
|
|
969
|
-
MapCache$
|
|
970
|
-
MapCache$
|
|
971
|
-
MapCache$
|
|
972
|
-
MapCache$
|
|
968
|
+
MapCache$1.prototype.clear = mapCacheClear;
|
|
969
|
+
MapCache$1.prototype['delete'] = mapCacheDelete;
|
|
970
|
+
MapCache$1.prototype.get = mapCacheGet;
|
|
971
|
+
MapCache$1.prototype.has = mapCacheHas;
|
|
972
|
+
MapCache$1.prototype.set = mapCacheSet;
|
|
973
973
|
|
|
974
|
-
var _MapCache = MapCache$
|
|
974
|
+
var _MapCache = MapCache$1;
|
|
975
975
|
|
|
976
976
|
var ListCache$1 = _ListCache,
|
|
977
977
|
Map$1 = _Map,
|
|
978
|
-
MapCache
|
|
978
|
+
MapCache = _MapCache;
|
|
979
979
|
|
|
980
980
|
/** Used as the size to enable large array optimizations. */
|
|
981
981
|
var LARGE_ARRAY_SIZE = 200;
|
|
@@ -999,7 +999,7 @@ function stackSet$1(key, value) {
|
|
|
999
999
|
this.size = ++data.size;
|
|
1000
1000
|
return this;
|
|
1001
1001
|
}
|
|
1002
|
-
data = this.__data__ = new MapCache
|
|
1002
|
+
data = this.__data__ = new MapCache(pairs);
|
|
1003
1003
|
}
|
|
1004
1004
|
data.set(key, value);
|
|
1005
1005
|
this.size = data.size;
|
|
@@ -1022,19 +1022,19 @@ var ListCache = _ListCache,
|
|
|
1022
1022
|
* @constructor
|
|
1023
1023
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
1024
1024
|
*/
|
|
1025
|
-
function Stack$
|
|
1025
|
+
function Stack$2(entries) {
|
|
1026
1026
|
var data = this.__data__ = new ListCache(entries);
|
|
1027
1027
|
this.size = data.size;
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
1030
|
// Add methods to `Stack`.
|
|
1031
|
-
Stack$
|
|
1032
|
-
Stack$
|
|
1033
|
-
Stack$
|
|
1034
|
-
Stack$
|
|
1035
|
-
Stack$
|
|
1031
|
+
Stack$2.prototype.clear = stackClear;
|
|
1032
|
+
Stack$2.prototype['delete'] = stackDelete;
|
|
1033
|
+
Stack$2.prototype.get = stackGet;
|
|
1034
|
+
Stack$2.prototype.has = stackHas;
|
|
1035
|
+
Stack$2.prototype.set = stackSet;
|
|
1036
1036
|
|
|
1037
|
-
var _Stack = Stack$
|
|
1037
|
+
var _Stack = Stack$2;
|
|
1038
1038
|
|
|
1039
1039
|
/**
|
|
1040
1040
|
* A specialized version of `_.forEach` for arrays without support for
|
|
@@ -1099,13 +1099,13 @@ function baseAssignValue$3(object, key, value) {
|
|
|
1099
1099
|
var _baseAssignValue = baseAssignValue$3;
|
|
1100
1100
|
|
|
1101
1101
|
var baseAssignValue$2 = _baseAssignValue,
|
|
1102
|
-
eq$
|
|
1102
|
+
eq$2 = eq_1;
|
|
1103
1103
|
|
|
1104
1104
|
/** Used for built-in method references. */
|
|
1105
|
-
var objectProto$
|
|
1105
|
+
var objectProto$8 = Object.prototype;
|
|
1106
1106
|
|
|
1107
1107
|
/** Used to check objects for own properties. */
|
|
1108
|
-
var hasOwnProperty$
|
|
1108
|
+
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
1109
1109
|
|
|
1110
1110
|
/**
|
|
1111
1111
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
@@ -1119,7 +1119,7 @@ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
|
1119
1119
|
*/
|
|
1120
1120
|
function assignValue$2(object, key, value) {
|
|
1121
1121
|
var objValue = object[key];
|
|
1122
|
-
if (!(hasOwnProperty$
|
|
1122
|
+
if (!(hasOwnProperty$6.call(object, key) && eq$2(objValue, value)) ||
|
|
1123
1123
|
(value === undefined && !(key in object))) {
|
|
1124
1124
|
baseAssignValue$2(object, key, value);
|
|
1125
1125
|
}
|
|
@@ -1215,17 +1215,17 @@ var _baseTimes = baseTimes$1;
|
|
|
1215
1215
|
* // => false
|
|
1216
1216
|
*/
|
|
1217
1217
|
|
|
1218
|
-
function isObjectLike$
|
|
1218
|
+
function isObjectLike$7(value) {
|
|
1219
1219
|
return value != null && typeof value == 'object';
|
|
1220
1220
|
}
|
|
1221
1221
|
|
|
1222
|
-
var isObjectLike_1 = isObjectLike$
|
|
1222
|
+
var isObjectLike_1 = isObjectLike$7;
|
|
1223
1223
|
|
|
1224
1224
|
var baseGetTag$3 = _baseGetTag,
|
|
1225
|
-
isObjectLike$
|
|
1225
|
+
isObjectLike$6 = isObjectLike_1;
|
|
1226
1226
|
|
|
1227
1227
|
/** `Object#toString` result references. */
|
|
1228
|
-
var argsTag$
|
|
1228
|
+
var argsTag$2 = '[object Arguments]';
|
|
1229
1229
|
|
|
1230
1230
|
/**
|
|
1231
1231
|
* The base implementation of `_.isArguments`.
|
|
@@ -1235,22 +1235,22 @@ var argsTag$3 = '[object Arguments]';
|
|
|
1235
1235
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1236
1236
|
*/
|
|
1237
1237
|
function baseIsArguments$1(value) {
|
|
1238
|
-
return isObjectLike$
|
|
1238
|
+
return isObjectLike$6(value) && baseGetTag$3(value) == argsTag$2;
|
|
1239
1239
|
}
|
|
1240
1240
|
|
|
1241
1241
|
var _baseIsArguments = baseIsArguments$1;
|
|
1242
1242
|
|
|
1243
1243
|
var baseIsArguments = _baseIsArguments,
|
|
1244
|
-
isObjectLike$
|
|
1244
|
+
isObjectLike$5 = isObjectLike_1;
|
|
1245
1245
|
|
|
1246
1246
|
/** Used for built-in method references. */
|
|
1247
|
-
var objectProto$
|
|
1247
|
+
var objectProto$7 = Object.prototype;
|
|
1248
1248
|
|
|
1249
1249
|
/** Used to check objects for own properties. */
|
|
1250
|
-
var hasOwnProperty$
|
|
1250
|
+
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
1251
1251
|
|
|
1252
1252
|
/** Built-in value references. */
|
|
1253
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
1253
|
+
var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
|
|
1254
1254
|
|
|
1255
1255
|
/**
|
|
1256
1256
|
* Checks if `value` is likely an `arguments` object.
|
|
@@ -1271,7 +1271,7 @@ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
|
|
|
1271
1271
|
* // => false
|
|
1272
1272
|
*/
|
|
1273
1273
|
var isArguments$2 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
1274
|
-
return isObjectLike$
|
|
1274
|
+
return isObjectLike$5(value) && hasOwnProperty$5.call(value, 'callee') &&
|
|
1275
1275
|
!propertyIsEnumerable$1.call(value, 'callee');
|
|
1276
1276
|
};
|
|
1277
1277
|
|
|
@@ -1301,11 +1301,11 @@ var isArguments_1 = isArguments$2;
|
|
|
1301
1301
|
* // => false
|
|
1302
1302
|
*/
|
|
1303
1303
|
|
|
1304
|
-
var isArray$
|
|
1304
|
+
var isArray$4 = Array.isArray;
|
|
1305
1305
|
|
|
1306
|
-
var isArray_1 = isArray$
|
|
1306
|
+
var isArray_1 = isArray$4;
|
|
1307
1307
|
|
|
1308
|
-
var isBuffer$
|
|
1308
|
+
var isBuffer$3 = {exports: {}};
|
|
1309
1309
|
|
|
1310
1310
|
/**
|
|
1311
1311
|
* This method returns `false`.
|
|
@@ -1327,7 +1327,7 @@ function stubFalse() {
|
|
|
1327
1327
|
|
|
1328
1328
|
var stubFalse_1 = stubFalse;
|
|
1329
1329
|
|
|
1330
|
-
isBuffer$
|
|
1330
|
+
isBuffer$3.exports;
|
|
1331
1331
|
|
|
1332
1332
|
(function (module, exports) {
|
|
1333
1333
|
var root = _root,
|
|
@@ -1368,9 +1368,9 @@ isBuffer$4.exports;
|
|
|
1368
1368
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
1369
1369
|
|
|
1370
1370
|
module.exports = isBuffer;
|
|
1371
|
-
} (isBuffer$
|
|
1371
|
+
} (isBuffer$3, isBuffer$3.exports));
|
|
1372
1372
|
|
|
1373
|
-
var isBufferExports = isBuffer$
|
|
1373
|
+
var isBufferExports = isBuffer$3.exports;
|
|
1374
1374
|
|
|
1375
1375
|
/** Used as references for various `Number` constants. */
|
|
1376
1376
|
|
|
@@ -1438,25 +1438,25 @@ var isLength_1 = isLength$2;
|
|
|
1438
1438
|
|
|
1439
1439
|
var baseGetTag$2 = _baseGetTag,
|
|
1440
1440
|
isLength$1 = isLength_1,
|
|
1441
|
-
isObjectLike$
|
|
1441
|
+
isObjectLike$4 = isObjectLike_1;
|
|
1442
1442
|
|
|
1443
1443
|
/** `Object#toString` result references. */
|
|
1444
|
-
var argsTag$
|
|
1445
|
-
arrayTag$
|
|
1446
|
-
boolTag$
|
|
1447
|
-
dateTag$
|
|
1448
|
-
errorTag$
|
|
1444
|
+
var argsTag$1 = '[object Arguments]',
|
|
1445
|
+
arrayTag$1 = '[object Array]',
|
|
1446
|
+
boolTag$2 = '[object Boolean]',
|
|
1447
|
+
dateTag$2 = '[object Date]',
|
|
1448
|
+
errorTag$1 = '[object Error]',
|
|
1449
1449
|
funcTag$1 = '[object Function]',
|
|
1450
|
-
mapTag$
|
|
1451
|
-
numberTag$
|
|
1452
|
-
objectTag$
|
|
1453
|
-
regexpTag$
|
|
1454
|
-
setTag$
|
|
1455
|
-
stringTag$
|
|
1450
|
+
mapTag$4 = '[object Map]',
|
|
1451
|
+
numberTag$2 = '[object Number]',
|
|
1452
|
+
objectTag$3 = '[object Object]',
|
|
1453
|
+
regexpTag$2 = '[object RegExp]',
|
|
1454
|
+
setTag$4 = '[object Set]',
|
|
1455
|
+
stringTag$2 = '[object String]',
|
|
1456
1456
|
weakMapTag$2 = '[object WeakMap]';
|
|
1457
1457
|
|
|
1458
|
-
var arrayBufferTag$
|
|
1459
|
-
dataViewTag$
|
|
1458
|
+
var arrayBufferTag$2 = '[object ArrayBuffer]',
|
|
1459
|
+
dataViewTag$3 = '[object DataView]',
|
|
1460
1460
|
float32Tag$2 = '[object Float32Array]',
|
|
1461
1461
|
float64Tag$2 = '[object Float64Array]',
|
|
1462
1462
|
int8Tag$2 = '[object Int8Array]',
|
|
@@ -1474,13 +1474,13 @@ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
|
|
|
1474
1474
|
typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
|
|
1475
1475
|
typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
|
|
1476
1476
|
typedArrayTags[uint32Tag$2] = true;
|
|
1477
|
-
typedArrayTags[argsTag$
|
|
1478
|
-
typedArrayTags[arrayBufferTag$
|
|
1479
|
-
typedArrayTags[dataViewTag$
|
|
1480
|
-
typedArrayTags[errorTag$
|
|
1481
|
-
typedArrayTags[mapTag$
|
|
1482
|
-
typedArrayTags[objectTag$
|
|
1483
|
-
typedArrayTags[setTag$
|
|
1477
|
+
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
|
|
1478
|
+
typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
|
|
1479
|
+
typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
|
|
1480
|
+
typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
|
|
1481
|
+
typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
|
|
1482
|
+
typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$2] =
|
|
1483
|
+
typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
|
|
1484
1484
|
typedArrayTags[weakMapTag$2] = false;
|
|
1485
1485
|
|
|
1486
1486
|
/**
|
|
@@ -1491,7 +1491,7 @@ typedArrayTags[weakMapTag$2] = false;
|
|
|
1491
1491
|
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1492
1492
|
*/
|
|
1493
1493
|
function baseIsTypedArray$1(value) {
|
|
1494
|
-
return isObjectLike$
|
|
1494
|
+
return isObjectLike$4(value) &&
|
|
1495
1495
|
isLength$1(value.length) && !!typedArrayTags[baseGetTag$2(value)];
|
|
1496
1496
|
}
|
|
1497
1497
|
|
|
@@ -1576,22 +1576,22 @@ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
|
|
|
1576
1576
|
* _.isTypedArray([]);
|
|
1577
1577
|
* // => false
|
|
1578
1578
|
*/
|
|
1579
|
-
var isTypedArray$
|
|
1579
|
+
var isTypedArray$2 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
|
|
1580
1580
|
|
|
1581
|
-
var isTypedArray_1 = isTypedArray$
|
|
1581
|
+
var isTypedArray_1 = isTypedArray$2;
|
|
1582
1582
|
|
|
1583
1583
|
var baseTimes = _baseTimes,
|
|
1584
1584
|
isArguments$1 = isArguments_1,
|
|
1585
|
-
isArray$
|
|
1586
|
-
isBuffer$
|
|
1585
|
+
isArray$3 = isArray_1,
|
|
1586
|
+
isBuffer$2 = isBufferExports,
|
|
1587
1587
|
isIndex$1 = _isIndex,
|
|
1588
|
-
isTypedArray$
|
|
1588
|
+
isTypedArray$1 = isTypedArray_1;
|
|
1589
1589
|
|
|
1590
1590
|
/** Used for built-in method references. */
|
|
1591
|
-
var objectProto$
|
|
1591
|
+
var objectProto$6 = Object.prototype;
|
|
1592
1592
|
|
|
1593
1593
|
/** Used to check objects for own properties. */
|
|
1594
|
-
var hasOwnProperty$
|
|
1594
|
+
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
|
1595
1595
|
|
|
1596
1596
|
/**
|
|
1597
1597
|
* Creates an array of the enumerable property names of the array-like `value`.
|
|
@@ -1602,16 +1602,16 @@ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
|
1602
1602
|
* @returns {Array} Returns the array of property names.
|
|
1603
1603
|
*/
|
|
1604
1604
|
function arrayLikeKeys$2(value, inherited) {
|
|
1605
|
-
var isArr = isArray$
|
|
1605
|
+
var isArr = isArray$3(value),
|
|
1606
1606
|
isArg = !isArr && isArguments$1(value),
|
|
1607
|
-
isBuff = !isArr && !isArg && isBuffer$
|
|
1608
|
-
isType = !isArr && !isArg && !isBuff && isTypedArray$
|
|
1607
|
+
isBuff = !isArr && !isArg && isBuffer$2(value),
|
|
1608
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
|
|
1609
1609
|
skipIndexes = isArr || isArg || isBuff || isType,
|
|
1610
1610
|
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
1611
1611
|
length = result.length;
|
|
1612
1612
|
|
|
1613
1613
|
for (var key in value) {
|
|
1614
|
-
if ((inherited || hasOwnProperty$
|
|
1614
|
+
if ((inherited || hasOwnProperty$4.call(value, key)) &&
|
|
1615
1615
|
!(skipIndexes && (
|
|
1616
1616
|
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1617
1617
|
key == 'length' ||
|
|
@@ -1632,7 +1632,7 @@ var _arrayLikeKeys = arrayLikeKeys$2;
|
|
|
1632
1632
|
|
|
1633
1633
|
/** Used for built-in method references. */
|
|
1634
1634
|
|
|
1635
|
-
var objectProto$
|
|
1635
|
+
var objectProto$5 = Object.prototype;
|
|
1636
1636
|
|
|
1637
1637
|
/**
|
|
1638
1638
|
* Checks if `value` is likely a prototype object.
|
|
@@ -1643,7 +1643,7 @@ var objectProto$7 = Object.prototype;
|
|
|
1643
1643
|
*/
|
|
1644
1644
|
function isPrototype$3(value) {
|
|
1645
1645
|
var Ctor = value && value.constructor,
|
|
1646
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$
|
|
1646
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
|
|
1647
1647
|
|
|
1648
1648
|
return value === proto;
|
|
1649
1649
|
}
|
|
@@ -1678,10 +1678,10 @@ var isPrototype$2 = _isPrototype,
|
|
|
1678
1678
|
nativeKeys = _nativeKeys;
|
|
1679
1679
|
|
|
1680
1680
|
/** Used for built-in method references. */
|
|
1681
|
-
var objectProto$
|
|
1681
|
+
var objectProto$4 = Object.prototype;
|
|
1682
1682
|
|
|
1683
1683
|
/** Used to check objects for own properties. */
|
|
1684
|
-
var hasOwnProperty$
|
|
1684
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
1685
1685
|
|
|
1686
1686
|
/**
|
|
1687
1687
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
@@ -1696,7 +1696,7 @@ function baseKeys$1(object) {
|
|
|
1696
1696
|
}
|
|
1697
1697
|
var result = [];
|
|
1698
1698
|
for (var key in Object(object)) {
|
|
1699
|
-
if (hasOwnProperty$
|
|
1699
|
+
if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
|
|
1700
1700
|
result.push(key);
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
@@ -1777,6 +1777,8 @@ function keys$3(object) {
|
|
|
1777
1777
|
|
|
1778
1778
|
var keys_1 = keys$3;
|
|
1779
1779
|
|
|
1780
|
+
var keys$4 = /*@__PURE__*/getDefaultExportFromCjs(keys_1);
|
|
1781
|
+
|
|
1780
1782
|
var copyObject$4 = _copyObject,
|
|
1781
1783
|
keys$2 = keys_1;
|
|
1782
1784
|
|
|
@@ -1822,10 +1824,10 @@ var isObject$5 = isObject_1,
|
|
|
1822
1824
|
nativeKeysIn = _nativeKeysIn;
|
|
1823
1825
|
|
|
1824
1826
|
/** Used for built-in method references. */
|
|
1825
|
-
var objectProto$
|
|
1827
|
+
var objectProto$3 = Object.prototype;
|
|
1826
1828
|
|
|
1827
1829
|
/** Used to check objects for own properties. */
|
|
1828
|
-
var hasOwnProperty$
|
|
1830
|
+
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
1829
1831
|
|
|
1830
1832
|
/**
|
|
1831
1833
|
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
@@ -1842,7 +1844,7 @@ function baseKeysIn$1(object) {
|
|
|
1842
1844
|
result = [];
|
|
1843
1845
|
|
|
1844
1846
|
for (var key in object) {
|
|
1845
|
-
if (!(key == 'constructor' && (isProto || !hasOwnProperty$
|
|
1847
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty$2.call(object, key)))) {
|
|
1846
1848
|
result.push(key);
|
|
1847
1849
|
}
|
|
1848
1850
|
}
|
|
@@ -2024,10 +2026,10 @@ var arrayFilter = _arrayFilter,
|
|
|
2024
2026
|
stubArray$1 = stubArray_1;
|
|
2025
2027
|
|
|
2026
2028
|
/** Used for built-in method references. */
|
|
2027
|
-
var objectProto$
|
|
2029
|
+
var objectProto$2 = Object.prototype;
|
|
2028
2030
|
|
|
2029
2031
|
/** Built-in value references. */
|
|
2030
|
-
var propertyIsEnumerable = objectProto$
|
|
2032
|
+
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
|
|
2031
2033
|
|
|
2032
2034
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2033
2035
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
@@ -2141,7 +2143,7 @@ function copySymbolsIn$1(source, object) {
|
|
|
2141
2143
|
var _copySymbolsIn = copySymbolsIn$1;
|
|
2142
2144
|
|
|
2143
2145
|
var arrayPush = _arrayPush,
|
|
2144
|
-
isArray$
|
|
2146
|
+
isArray$2 = isArray_1;
|
|
2145
2147
|
|
|
2146
2148
|
/**
|
|
2147
2149
|
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
@@ -2156,7 +2158,7 @@ var arrayPush = _arrayPush,
|
|
|
2156
2158
|
*/
|
|
2157
2159
|
function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
|
|
2158
2160
|
var result = keysFunc(object);
|
|
2159
|
-
return isArray$
|
|
2161
|
+
return isArray$2(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
2160
2162
|
}
|
|
2161
2163
|
|
|
2162
2164
|
var _baseGetAllKeys = baseGetAllKeys$2;
|
|
@@ -2172,11 +2174,11 @@ var baseGetAllKeys$1 = _baseGetAllKeys,
|
|
|
2172
2174
|
* @param {Object} object The object to query.
|
|
2173
2175
|
* @returns {Array} Returns the array of property names and symbols.
|
|
2174
2176
|
*/
|
|
2175
|
-
function getAllKeys$
|
|
2177
|
+
function getAllKeys$1(object) {
|
|
2176
2178
|
return baseGetAllKeys$1(object, keys$1, getSymbols);
|
|
2177
2179
|
}
|
|
2178
2180
|
|
|
2179
|
-
var _getAllKeys = getAllKeys$
|
|
2181
|
+
var _getAllKeys = getAllKeys$1;
|
|
2180
2182
|
|
|
2181
2183
|
var baseGetAllKeys = _baseGetAllKeys,
|
|
2182
2184
|
getSymbolsIn = _getSymbolsIn,
|
|
@@ -2237,13 +2239,13 @@ var DataView = _DataView,
|
|
|
2237
2239
|
toSource = _toSource;
|
|
2238
2240
|
|
|
2239
2241
|
/** `Object#toString` result references. */
|
|
2240
|
-
var mapTag$
|
|
2241
|
-
objectTag$
|
|
2242
|
+
var mapTag$3 = '[object Map]',
|
|
2243
|
+
objectTag$2 = '[object Object]',
|
|
2242
2244
|
promiseTag = '[object Promise]',
|
|
2243
|
-
setTag$
|
|
2245
|
+
setTag$3 = '[object Set]',
|
|
2244
2246
|
weakMapTag$1 = '[object WeakMap]';
|
|
2245
2247
|
|
|
2246
|
-
var dataViewTag$
|
|
2248
|
+
var dataViewTag$2 = '[object DataView]';
|
|
2247
2249
|
|
|
2248
2250
|
/** Used to detect maps, sets, and weakmaps. */
|
|
2249
2251
|
var dataViewCtorString = toSource(DataView),
|
|
@@ -2259,25 +2261,25 @@ var dataViewCtorString = toSource(DataView),
|
|
|
2259
2261
|
* @param {*} value The value to query.
|
|
2260
2262
|
* @returns {string} Returns the `toStringTag`.
|
|
2261
2263
|
*/
|
|
2262
|
-
var getTag$
|
|
2264
|
+
var getTag$3 = baseGetTag$1;
|
|
2263
2265
|
|
|
2264
2266
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
2265
|
-
if ((DataView && getTag$
|
|
2266
|
-
(Map && getTag$
|
|
2267
|
-
(Promise$1 && getTag$
|
|
2268
|
-
(Set && getTag$
|
|
2269
|
-
(WeakMap && getTag$
|
|
2270
|
-
getTag$
|
|
2267
|
+
if ((DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
|
|
2268
|
+
(Map && getTag$3(new Map) != mapTag$3) ||
|
|
2269
|
+
(Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag) ||
|
|
2270
|
+
(Set && getTag$3(new Set) != setTag$3) ||
|
|
2271
|
+
(WeakMap && getTag$3(new WeakMap) != weakMapTag$1)) {
|
|
2272
|
+
getTag$3 = function(value) {
|
|
2271
2273
|
var result = baseGetTag$1(value),
|
|
2272
|
-
Ctor = result == objectTag$
|
|
2274
|
+
Ctor = result == objectTag$2 ? value.constructor : undefined,
|
|
2273
2275
|
ctorString = Ctor ? toSource(Ctor) : '';
|
|
2274
2276
|
|
|
2275
2277
|
if (ctorString) {
|
|
2276
2278
|
switch (ctorString) {
|
|
2277
|
-
case dataViewCtorString: return dataViewTag$
|
|
2278
|
-
case mapCtorString: return mapTag$
|
|
2279
|
+
case dataViewCtorString: return dataViewTag$2;
|
|
2280
|
+
case mapCtorString: return mapTag$3;
|
|
2279
2281
|
case promiseCtorString: return promiseTag;
|
|
2280
|
-
case setCtorString: return setTag$
|
|
2282
|
+
case setCtorString: return setTag$3;
|
|
2281
2283
|
case weakMapCtorString: return weakMapTag$1;
|
|
2282
2284
|
}
|
|
2283
2285
|
}
|
|
@@ -2285,14 +2287,14 @@ if ((DataView && getTag$4(new DataView(new ArrayBuffer(1))) != dataViewTag$3) ||
|
|
|
2285
2287
|
};
|
|
2286
2288
|
}
|
|
2287
2289
|
|
|
2288
|
-
var _getTag = getTag$
|
|
2290
|
+
var _getTag = getTag$3;
|
|
2289
2291
|
|
|
2290
2292
|
/** Used for built-in method references. */
|
|
2291
2293
|
|
|
2292
|
-
var objectProto$
|
|
2294
|
+
var objectProto$1 = Object.prototype;
|
|
2293
2295
|
|
|
2294
2296
|
/** Used to check objects for own properties. */
|
|
2295
|
-
var hasOwnProperty$
|
|
2297
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
2296
2298
|
|
|
2297
2299
|
/**
|
|
2298
2300
|
* Initializes an array clone.
|
|
@@ -2306,7 +2308,7 @@ function initCloneArray$1(array) {
|
|
|
2306
2308
|
result = new array.constructor(length);
|
|
2307
2309
|
|
|
2308
2310
|
// Add properties assigned by `RegExp#exec`.
|
|
2309
|
-
if (length && typeof array[0] == 'string' && hasOwnProperty$
|
|
2311
|
+
if (length && typeof array[0] == 'string' && hasOwnProperty$1.call(array, 'index')) {
|
|
2310
2312
|
result.index = array.index;
|
|
2311
2313
|
result.input = array.input;
|
|
2312
2314
|
}
|
|
@@ -2318,11 +2320,11 @@ var _initCloneArray = initCloneArray$1;
|
|
|
2318
2320
|
var root = _root;
|
|
2319
2321
|
|
|
2320
2322
|
/** Built-in value references. */
|
|
2321
|
-
var Uint8Array$
|
|
2323
|
+
var Uint8Array$1 = root.Uint8Array;
|
|
2322
2324
|
|
|
2323
|
-
var _Uint8Array = Uint8Array$
|
|
2325
|
+
var _Uint8Array = Uint8Array$1;
|
|
2324
2326
|
|
|
2325
|
-
var Uint8Array
|
|
2327
|
+
var Uint8Array = _Uint8Array;
|
|
2326
2328
|
|
|
2327
2329
|
/**
|
|
2328
2330
|
* Creates a clone of `arrayBuffer`.
|
|
@@ -2333,7 +2335,7 @@ var Uint8Array$1 = _Uint8Array;
|
|
|
2333
2335
|
*/
|
|
2334
2336
|
function cloneArrayBuffer$3(arrayBuffer) {
|
|
2335
2337
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2336
|
-
new Uint8Array
|
|
2338
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
2337
2339
|
return result;
|
|
2338
2340
|
}
|
|
2339
2341
|
|
|
@@ -2378,8 +2380,8 @@ var _cloneRegExp = cloneRegExp$1;
|
|
|
2378
2380
|
var Symbol$1 = _Symbol;
|
|
2379
2381
|
|
|
2380
2382
|
/** Used to convert symbols to primitives and strings. */
|
|
2381
|
-
var symbolProto
|
|
2382
|
-
symbolValueOf
|
|
2383
|
+
var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
|
|
2384
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
2383
2385
|
|
|
2384
2386
|
/**
|
|
2385
2387
|
* Creates a clone of the `symbol` object.
|
|
@@ -2389,7 +2391,7 @@ var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : undefined,
|
|
|
2389
2391
|
* @returns {Object} Returns the cloned symbol object.
|
|
2390
2392
|
*/
|
|
2391
2393
|
function cloneSymbol$1(symbol) {
|
|
2392
|
-
return symbolValueOf
|
|
2394
|
+
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
|
2393
2395
|
}
|
|
2394
2396
|
|
|
2395
2397
|
var _cloneSymbol = cloneSymbol$1;
|
|
@@ -2418,17 +2420,17 @@ var cloneArrayBuffer = _cloneArrayBuffer,
|
|
|
2418
2420
|
cloneTypedArray$1 = _cloneTypedArray;
|
|
2419
2421
|
|
|
2420
2422
|
/** `Object#toString` result references. */
|
|
2421
|
-
var boolTag$
|
|
2422
|
-
dateTag$
|
|
2423
|
-
mapTag$
|
|
2424
|
-
numberTag$
|
|
2425
|
-
regexpTag$
|
|
2426
|
-
setTag$
|
|
2427
|
-
stringTag$
|
|
2428
|
-
symbolTag$
|
|
2423
|
+
var boolTag$1 = '[object Boolean]',
|
|
2424
|
+
dateTag$1 = '[object Date]',
|
|
2425
|
+
mapTag$2 = '[object Map]',
|
|
2426
|
+
numberTag$1 = '[object Number]',
|
|
2427
|
+
regexpTag$1 = '[object RegExp]',
|
|
2428
|
+
setTag$2 = '[object Set]',
|
|
2429
|
+
stringTag$1 = '[object String]',
|
|
2430
|
+
symbolTag$1 = '[object Symbol]';
|
|
2429
2431
|
|
|
2430
|
-
var arrayBufferTag$
|
|
2431
|
-
dataViewTag$
|
|
2432
|
+
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
2433
|
+
dataViewTag$1 = '[object DataView]',
|
|
2432
2434
|
float32Tag$1 = '[object Float32Array]',
|
|
2433
2435
|
float64Tag$1 = '[object Float64Array]',
|
|
2434
2436
|
int8Tag$1 = '[object Int8Array]',
|
|
@@ -2454,14 +2456,14 @@ var arrayBufferTag$2 = '[object ArrayBuffer]',
|
|
|
2454
2456
|
function initCloneByTag$1(object, tag, isDeep) {
|
|
2455
2457
|
var Ctor = object.constructor;
|
|
2456
2458
|
switch (tag) {
|
|
2457
|
-
case arrayBufferTag$
|
|
2459
|
+
case arrayBufferTag$1:
|
|
2458
2460
|
return cloneArrayBuffer(object);
|
|
2459
2461
|
|
|
2460
|
-
case boolTag$
|
|
2461
|
-
case dateTag$
|
|
2462
|
+
case boolTag$1:
|
|
2463
|
+
case dateTag$1:
|
|
2462
2464
|
return new Ctor(+object);
|
|
2463
2465
|
|
|
2464
|
-
case dataViewTag$
|
|
2466
|
+
case dataViewTag$1:
|
|
2465
2467
|
return cloneDataView(object, isDeep);
|
|
2466
2468
|
|
|
2467
2469
|
case float32Tag$1: case float64Tag$1:
|
|
@@ -2469,20 +2471,20 @@ function initCloneByTag$1(object, tag, isDeep) {
|
|
|
2469
2471
|
case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
|
|
2470
2472
|
return cloneTypedArray$1(object, isDeep);
|
|
2471
2473
|
|
|
2472
|
-
case mapTag$
|
|
2474
|
+
case mapTag$2:
|
|
2473
2475
|
return new Ctor;
|
|
2474
2476
|
|
|
2475
|
-
case numberTag$
|
|
2476
|
-
case stringTag$
|
|
2477
|
+
case numberTag$1:
|
|
2478
|
+
case stringTag$1:
|
|
2477
2479
|
return new Ctor(object);
|
|
2478
2480
|
|
|
2479
|
-
case regexpTag$
|
|
2481
|
+
case regexpTag$1:
|
|
2480
2482
|
return cloneRegExp(object);
|
|
2481
2483
|
|
|
2482
|
-
case setTag$
|
|
2484
|
+
case setTag$2:
|
|
2483
2485
|
return new Ctor;
|
|
2484
2486
|
|
|
2485
|
-
case symbolTag$
|
|
2487
|
+
case symbolTag$1:
|
|
2486
2488
|
return cloneSymbol(object);
|
|
2487
2489
|
}
|
|
2488
2490
|
}
|
|
@@ -2539,11 +2541,11 @@ function initCloneObject$2(object) {
|
|
|
2539
2541
|
|
|
2540
2542
|
var _initCloneObject = initCloneObject$2;
|
|
2541
2543
|
|
|
2542
|
-
var getTag$
|
|
2543
|
-
isObjectLike$
|
|
2544
|
+
var getTag$2 = _getTag,
|
|
2545
|
+
isObjectLike$3 = isObjectLike_1;
|
|
2544
2546
|
|
|
2545
2547
|
/** `Object#toString` result references. */
|
|
2546
|
-
var mapTag$
|
|
2548
|
+
var mapTag$1 = '[object Map]';
|
|
2547
2549
|
|
|
2548
2550
|
/**
|
|
2549
2551
|
* The base implementation of `_.isMap` without Node.js optimizations.
|
|
@@ -2553,7 +2555,7 @@ var mapTag$2 = '[object Map]';
|
|
|
2553
2555
|
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
|
|
2554
2556
|
*/
|
|
2555
2557
|
function baseIsMap$1(value) {
|
|
2556
|
-
return isObjectLike$
|
|
2558
|
+
return isObjectLike$3(value) && getTag$2(value) == mapTag$1;
|
|
2557
2559
|
}
|
|
2558
2560
|
|
|
2559
2561
|
var _baseIsMap = baseIsMap$1;
|
|
@@ -2586,11 +2588,11 @@ var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
|
|
|
2586
2588
|
|
|
2587
2589
|
var isMap_1 = isMap$1;
|
|
2588
2590
|
|
|
2589
|
-
var getTag$
|
|
2590
|
-
isObjectLike$
|
|
2591
|
+
var getTag$1 = _getTag,
|
|
2592
|
+
isObjectLike$2 = isObjectLike_1;
|
|
2591
2593
|
|
|
2592
2594
|
/** `Object#toString` result references. */
|
|
2593
|
-
var setTag$
|
|
2595
|
+
var setTag$1 = '[object Set]';
|
|
2594
2596
|
|
|
2595
2597
|
/**
|
|
2596
2598
|
* The base implementation of `_.isSet` without Node.js optimizations.
|
|
@@ -2600,7 +2602,7 @@ var setTag$2 = '[object Set]';
|
|
|
2600
2602
|
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
|
|
2601
2603
|
*/
|
|
2602
2604
|
function baseIsSet$1(value) {
|
|
2603
|
-
return isObjectLike$
|
|
2605
|
+
return isObjectLike$2(value) && getTag$1(value) == setTag$1;
|
|
2604
2606
|
}
|
|
2605
2607
|
|
|
2606
2608
|
var _baseIsSet = baseIsSet$1;
|
|
@@ -2633,7 +2635,7 @@ var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
|
2633
2635
|
|
|
2634
2636
|
var isSet_1 = isSet$1;
|
|
2635
2637
|
|
|
2636
|
-
var Stack$
|
|
2638
|
+
var Stack$1 = _Stack,
|
|
2637
2639
|
arrayEach = _arrayEach,
|
|
2638
2640
|
assignValue = _assignValue,
|
|
2639
2641
|
baseAssign = _baseAssign,
|
|
@@ -2642,14 +2644,14 @@ var Stack$2 = _Stack,
|
|
|
2642
2644
|
copyArray$1 = _copyArray,
|
|
2643
2645
|
copySymbols = _copySymbols,
|
|
2644
2646
|
copySymbolsIn = _copySymbolsIn,
|
|
2645
|
-
getAllKeys
|
|
2647
|
+
getAllKeys = _getAllKeys,
|
|
2646
2648
|
getAllKeysIn = _getAllKeysIn,
|
|
2647
|
-
getTag
|
|
2649
|
+
getTag = _getTag,
|
|
2648
2650
|
initCloneArray = _initCloneArray,
|
|
2649
2651
|
initCloneByTag = _initCloneByTag,
|
|
2650
2652
|
initCloneObject$1 = _initCloneObject,
|
|
2651
|
-
isArray$
|
|
2652
|
-
isBuffer$
|
|
2653
|
+
isArray$1 = isArray_1,
|
|
2654
|
+
isBuffer$1 = isBufferExports,
|
|
2653
2655
|
isMap = isMap_1,
|
|
2654
2656
|
isObject$3 = isObject_1,
|
|
2655
2657
|
isSet = isSet_1,
|
|
@@ -2662,24 +2664,24 @@ var CLONE_DEEP_FLAG$1 = 1,
|
|
|
2662
2664
|
CLONE_SYMBOLS_FLAG$1 = 4;
|
|
2663
2665
|
|
|
2664
2666
|
/** `Object#toString` result references. */
|
|
2665
|
-
var argsTag
|
|
2666
|
-
arrayTag
|
|
2667
|
-
boolTag
|
|
2668
|
-
dateTag
|
|
2669
|
-
errorTag
|
|
2667
|
+
var argsTag = '[object Arguments]',
|
|
2668
|
+
arrayTag = '[object Array]',
|
|
2669
|
+
boolTag = '[object Boolean]',
|
|
2670
|
+
dateTag = '[object Date]',
|
|
2671
|
+
errorTag = '[object Error]',
|
|
2670
2672
|
funcTag = '[object Function]',
|
|
2671
2673
|
genTag = '[object GeneratorFunction]',
|
|
2672
|
-
mapTag
|
|
2673
|
-
numberTag
|
|
2674
|
-
objectTag$
|
|
2675
|
-
regexpTag
|
|
2676
|
-
setTag
|
|
2677
|
-
stringTag
|
|
2678
|
-
symbolTag
|
|
2674
|
+
mapTag = '[object Map]',
|
|
2675
|
+
numberTag = '[object Number]',
|
|
2676
|
+
objectTag$1 = '[object Object]',
|
|
2677
|
+
regexpTag = '[object RegExp]',
|
|
2678
|
+
setTag = '[object Set]',
|
|
2679
|
+
stringTag = '[object String]',
|
|
2680
|
+
symbolTag = '[object Symbol]',
|
|
2679
2681
|
weakMapTag = '[object WeakMap]';
|
|
2680
2682
|
|
|
2681
|
-
var arrayBufferTag
|
|
2682
|
-
dataViewTag
|
|
2683
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
2684
|
+
dataViewTag = '[object DataView]',
|
|
2683
2685
|
float32Tag = '[object Float32Array]',
|
|
2684
2686
|
float64Tag = '[object Float64Array]',
|
|
2685
2687
|
int8Tag = '[object Int8Array]',
|
|
@@ -2692,18 +2694,18 @@ var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
|
2692
2694
|
|
|
2693
2695
|
/** Used to identify `toStringTag` values supported by `_.clone`. */
|
|
2694
2696
|
var cloneableTags = {};
|
|
2695
|
-
cloneableTags[argsTag
|
|
2696
|
-
cloneableTags[arrayBufferTag
|
|
2697
|
-
cloneableTags[boolTag
|
|
2697
|
+
cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
|
2698
|
+
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
|
2699
|
+
cloneableTags[boolTag] = cloneableTags[dateTag] =
|
|
2698
2700
|
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
|
2699
2701
|
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
|
2700
|
-
cloneableTags[int32Tag] = cloneableTags[mapTag
|
|
2701
|
-
cloneableTags[numberTag
|
|
2702
|
-
cloneableTags[regexpTag
|
|
2703
|
-
cloneableTags[stringTag
|
|
2702
|
+
cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
|
2703
|
+
cloneableTags[numberTag] = cloneableTags[objectTag$1] =
|
|
2704
|
+
cloneableTags[regexpTag] = cloneableTags[setTag] =
|
|
2705
|
+
cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
|
2704
2706
|
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
|
2705
2707
|
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
2706
|
-
cloneableTags[errorTag
|
|
2708
|
+
cloneableTags[errorTag] = cloneableTags[funcTag] =
|
|
2707
2709
|
cloneableTags[weakMapTag] = false;
|
|
2708
2710
|
|
|
2709
2711
|
/**
|
|
@@ -2737,20 +2739,20 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
|
2737
2739
|
if (!isObject$3(value)) {
|
|
2738
2740
|
return value;
|
|
2739
2741
|
}
|
|
2740
|
-
var isArr = isArray$
|
|
2742
|
+
var isArr = isArray$1(value);
|
|
2741
2743
|
if (isArr) {
|
|
2742
2744
|
result = initCloneArray(value);
|
|
2743
2745
|
if (!isDeep) {
|
|
2744
2746
|
return copyArray$1(value, result);
|
|
2745
2747
|
}
|
|
2746
2748
|
} else {
|
|
2747
|
-
var tag = getTag
|
|
2749
|
+
var tag = getTag(value),
|
|
2748
2750
|
isFunc = tag == funcTag || tag == genTag;
|
|
2749
2751
|
|
|
2750
|
-
if (isBuffer$
|
|
2752
|
+
if (isBuffer$1(value)) {
|
|
2751
2753
|
return cloneBuffer$1(value, isDeep);
|
|
2752
2754
|
}
|
|
2753
|
-
if (tag == objectTag$
|
|
2755
|
+
if (tag == objectTag$1 || tag == argsTag || (isFunc && !object)) {
|
|
2754
2756
|
result = (isFlat || isFunc) ? {} : initCloneObject$1(value);
|
|
2755
2757
|
if (!isDeep) {
|
|
2756
2758
|
return isFlat
|
|
@@ -2765,7 +2767,7 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
|
2765
2767
|
}
|
|
2766
2768
|
}
|
|
2767
2769
|
// Check for circular references and return its corresponding clone.
|
|
2768
|
-
stack || (stack = new Stack$
|
|
2770
|
+
stack || (stack = new Stack$1);
|
|
2769
2771
|
var stacked = stack.get(value);
|
|
2770
2772
|
if (stacked) {
|
|
2771
2773
|
return stacked;
|
|
@@ -2783,7 +2785,7 @@ function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
|
2783
2785
|
}
|
|
2784
2786
|
|
|
2785
2787
|
var keysFunc = isFull
|
|
2786
|
-
? (isFlat ? getAllKeysIn : getAllKeys
|
|
2788
|
+
? (isFlat ? getAllKeysIn : getAllKeys)
|
|
2787
2789
|
: (isFlat ? keysIn$2 : keys);
|
|
2788
2790
|
|
|
2789
2791
|
var props = isArr ? undefined : keysFunc(value);
|
|
@@ -2832,752 +2834,167 @@ var cloneDeep_1 = cloneDeep;
|
|
|
2832
2834
|
|
|
2833
2835
|
var cloneDeep$1 = /*@__PURE__*/getDefaultExportFromCjs(cloneDeep_1);
|
|
2834
2836
|
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
2837
|
+
var baseAssignValue = _baseAssignValue,
|
|
2838
|
+
eq$1 = eq_1;
|
|
2838
2839
|
|
|
2839
2840
|
/**
|
|
2840
|
-
*
|
|
2841
|
+
* This function is like `assignValue` except that it doesn't assign
|
|
2842
|
+
* `undefined` values.
|
|
2841
2843
|
*
|
|
2842
2844
|
* @private
|
|
2843
|
-
* @
|
|
2844
|
-
* @
|
|
2845
|
-
* @
|
|
2846
|
-
* @param {*} value The value to cache.
|
|
2847
|
-
* @returns {Object} Returns the cache instance.
|
|
2845
|
+
* @param {Object} object The object to modify.
|
|
2846
|
+
* @param {string} key The key of the property to assign.
|
|
2847
|
+
* @param {*} value The value to assign.
|
|
2848
2848
|
*/
|
|
2849
|
-
function
|
|
2850
|
-
|
|
2851
|
-
|
|
2849
|
+
function assignMergeValue$2(object, key, value) {
|
|
2850
|
+
if ((value !== undefined && !eq$1(object[key], value)) ||
|
|
2851
|
+
(value === undefined && !(key in object))) {
|
|
2852
|
+
baseAssignValue(object, key, value);
|
|
2853
|
+
}
|
|
2852
2854
|
}
|
|
2853
2855
|
|
|
2854
|
-
var
|
|
2856
|
+
var _assignMergeValue = assignMergeValue$2;
|
|
2855
2857
|
|
|
2856
2858
|
/**
|
|
2857
|
-
*
|
|
2859
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
2858
2860
|
*
|
|
2859
2861
|
* @private
|
|
2860
|
-
* @
|
|
2861
|
-
* @
|
|
2862
|
-
* @param {*} value The value to search for.
|
|
2863
|
-
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
2862
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
2863
|
+
* @returns {Function} Returns the new base function.
|
|
2864
2864
|
*/
|
|
2865
2865
|
|
|
2866
|
-
function
|
|
2867
|
-
return
|
|
2866
|
+
function createBaseFor$1(fromRight) {
|
|
2867
|
+
return function(object, iteratee, keysFunc) {
|
|
2868
|
+
var index = -1,
|
|
2869
|
+
iterable = Object(object),
|
|
2870
|
+
props = keysFunc(object),
|
|
2871
|
+
length = props.length;
|
|
2872
|
+
|
|
2873
|
+
while (length--) {
|
|
2874
|
+
var key = props[fromRight ? length : ++index];
|
|
2875
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
2876
|
+
break;
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
return object;
|
|
2880
|
+
};
|
|
2868
2881
|
}
|
|
2869
2882
|
|
|
2870
|
-
var
|
|
2883
|
+
var _createBaseFor = createBaseFor$1;
|
|
2871
2884
|
|
|
2872
|
-
var
|
|
2873
|
-
setCacheAdd = _setCacheAdd,
|
|
2874
|
-
setCacheHas = _setCacheHas;
|
|
2885
|
+
var createBaseFor = _createBaseFor;
|
|
2875
2886
|
|
|
2876
2887
|
/**
|
|
2877
|
-
*
|
|
2878
|
-
*
|
|
2888
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
2889
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
2890
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
2879
2891
|
*
|
|
2880
2892
|
* @private
|
|
2881
|
-
* @
|
|
2882
|
-
* @param {
|
|
2893
|
+
* @param {Object} object The object to iterate over.
|
|
2894
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
2895
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
2896
|
+
* @returns {Object} Returns `object`.
|
|
2883
2897
|
*/
|
|
2884
|
-
|
|
2885
|
-
var index = -1,
|
|
2886
|
-
length = values == null ? 0 : values.length;
|
|
2887
|
-
|
|
2888
|
-
this.__data__ = new MapCache;
|
|
2889
|
-
while (++index < length) {
|
|
2890
|
-
this.add(values[index]);
|
|
2891
|
-
}
|
|
2892
|
-
}
|
|
2898
|
+
var baseFor$1 = createBaseFor();
|
|
2893
2899
|
|
|
2894
|
-
|
|
2895
|
-
SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
|
|
2896
|
-
SetCache$1.prototype.has = setCacheHas;
|
|
2900
|
+
var _baseFor = baseFor$1;
|
|
2897
2901
|
|
|
2898
|
-
var
|
|
2902
|
+
var isArrayLike$1 = isArrayLike_1,
|
|
2903
|
+
isObjectLike$1 = isObjectLike_1;
|
|
2899
2904
|
|
|
2900
2905
|
/**
|
|
2901
|
-
*
|
|
2902
|
-
*
|
|
2906
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
2907
|
+
* is an object.
|
|
2903
2908
|
*
|
|
2904
|
-
* @
|
|
2905
|
-
* @
|
|
2906
|
-
* @
|
|
2907
|
-
* @
|
|
2909
|
+
* @static
|
|
2910
|
+
* @memberOf _
|
|
2911
|
+
* @since 4.0.0
|
|
2912
|
+
* @category Lang
|
|
2913
|
+
* @param {*} value The value to check.
|
|
2914
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
2908
2915
|
* else `false`.
|
|
2916
|
+
* @example
|
|
2917
|
+
*
|
|
2918
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
2919
|
+
* // => true
|
|
2920
|
+
*
|
|
2921
|
+
* _.isArrayLikeObject(document.body.children);
|
|
2922
|
+
* // => true
|
|
2923
|
+
*
|
|
2924
|
+
* _.isArrayLikeObject('abc');
|
|
2925
|
+
* // => false
|
|
2926
|
+
*
|
|
2927
|
+
* _.isArrayLikeObject(_.noop);
|
|
2928
|
+
* // => false
|
|
2909
2929
|
*/
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
var index = -1,
|
|
2913
|
-
length = array == null ? 0 : array.length;
|
|
2914
|
-
|
|
2915
|
-
while (++index < length) {
|
|
2916
|
-
if (predicate(array[index], index, array)) {
|
|
2917
|
-
return true;
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
return false;
|
|
2930
|
+
function isArrayLikeObject$1(value) {
|
|
2931
|
+
return isObjectLike$1(value) && isArrayLike$1(value);
|
|
2921
2932
|
}
|
|
2922
2933
|
|
|
2923
|
-
var
|
|
2934
|
+
var isArrayLikeObject_1 = isArrayLikeObject$1;
|
|
2924
2935
|
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
* @private
|
|
2929
|
-
* @param {Object} cache The cache to query.
|
|
2930
|
-
* @param {string} key The key of the entry to check.
|
|
2931
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
2932
|
-
*/
|
|
2936
|
+
var baseGetTag = _baseGetTag,
|
|
2937
|
+
getPrototype = _getPrototype,
|
|
2938
|
+
isObjectLike = isObjectLike_1;
|
|
2933
2939
|
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2940
|
+
/** `Object#toString` result references. */
|
|
2941
|
+
var objectTag = '[object Object]';
|
|
2942
|
+
|
|
2943
|
+
/** Used for built-in method references. */
|
|
2944
|
+
var funcProto = Function.prototype,
|
|
2945
|
+
objectProto = Object.prototype;
|
|
2937
2946
|
|
|
2938
|
-
|
|
2947
|
+
/** Used to resolve the decompiled source of functions. */
|
|
2948
|
+
var funcToString = funcProto.toString;
|
|
2939
2949
|
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
cacheHas = _cacheHas;
|
|
2950
|
+
/** Used to check objects for own properties. */
|
|
2951
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2943
2952
|
|
|
2944
|
-
/** Used to
|
|
2945
|
-
var
|
|
2946
|
-
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
2953
|
+
/** Used to infer the `Object` constructor. */
|
|
2954
|
+
var objectCtorString = funcToString.call(Object);
|
|
2947
2955
|
|
|
2948
2956
|
/**
|
|
2949
|
-
*
|
|
2950
|
-
*
|
|
2957
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
2958
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
2951
2959
|
*
|
|
2952
|
-
* @
|
|
2953
|
-
* @
|
|
2954
|
-
* @
|
|
2955
|
-
* @
|
|
2956
|
-
* @param {
|
|
2957
|
-
* @
|
|
2958
|
-
* @
|
|
2959
|
-
*
|
|
2960
|
+
* @static
|
|
2961
|
+
* @memberOf _
|
|
2962
|
+
* @since 0.8.0
|
|
2963
|
+
* @category Lang
|
|
2964
|
+
* @param {*} value The value to check.
|
|
2965
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
2966
|
+
* @example
|
|
2967
|
+
*
|
|
2968
|
+
* function Foo() {
|
|
2969
|
+
* this.a = 1;
|
|
2970
|
+
* }
|
|
2971
|
+
*
|
|
2972
|
+
* _.isPlainObject(new Foo);
|
|
2973
|
+
* // => false
|
|
2974
|
+
*
|
|
2975
|
+
* _.isPlainObject([1, 2, 3]);
|
|
2976
|
+
* // => false
|
|
2977
|
+
*
|
|
2978
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
2979
|
+
* // => true
|
|
2980
|
+
*
|
|
2981
|
+
* _.isPlainObject(Object.create(null));
|
|
2982
|
+
* // => true
|
|
2960
2983
|
*/
|
|
2961
|
-
function
|
|
2962
|
-
|
|
2963
|
-
arrLength = array.length,
|
|
2964
|
-
othLength = other.length;
|
|
2965
|
-
|
|
2966
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
2984
|
+
function isPlainObject$1(value) {
|
|
2985
|
+
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
2967
2986
|
return false;
|
|
2968
2987
|
}
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
if (arrStacked && othStacked) {
|
|
2973
|
-
return arrStacked == other && othStacked == array;
|
|
2988
|
+
var proto = getPrototype(value);
|
|
2989
|
+
if (proto === null) {
|
|
2990
|
+
return true;
|
|
2974
2991
|
}
|
|
2975
|
-
var
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
stack.set(array, other);
|
|
2980
|
-
stack.set(other, array);
|
|
2992
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
2993
|
+
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
2994
|
+
funcToString.call(Ctor) == objectCtorString;
|
|
2995
|
+
}
|
|
2981
2996
|
|
|
2982
|
-
|
|
2983
|
-
while (++index < arrLength) {
|
|
2984
|
-
var arrValue = array[index],
|
|
2985
|
-
othValue = other[index];
|
|
2986
|
-
|
|
2987
|
-
if (customizer) {
|
|
2988
|
-
var compared = isPartial
|
|
2989
|
-
? customizer(othValue, arrValue, index, other, array, stack)
|
|
2990
|
-
: customizer(arrValue, othValue, index, array, other, stack);
|
|
2991
|
-
}
|
|
2992
|
-
if (compared !== undefined) {
|
|
2993
|
-
if (compared) {
|
|
2994
|
-
continue;
|
|
2995
|
-
}
|
|
2996
|
-
result = false;
|
|
2997
|
-
break;
|
|
2998
|
-
}
|
|
2999
|
-
// Recursively compare arrays (susceptible to call stack limits).
|
|
3000
|
-
if (seen) {
|
|
3001
|
-
if (!arraySome(other, function(othValue, othIndex) {
|
|
3002
|
-
if (!cacheHas(seen, othIndex) &&
|
|
3003
|
-
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
3004
|
-
return seen.push(othIndex);
|
|
3005
|
-
}
|
|
3006
|
-
})) {
|
|
3007
|
-
result = false;
|
|
3008
|
-
break;
|
|
3009
|
-
}
|
|
3010
|
-
} else if (!(
|
|
3011
|
-
arrValue === othValue ||
|
|
3012
|
-
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
|
3013
|
-
)) {
|
|
3014
|
-
result = false;
|
|
3015
|
-
break;
|
|
3016
|
-
}
|
|
3017
|
-
}
|
|
3018
|
-
stack['delete'](array);
|
|
3019
|
-
stack['delete'](other);
|
|
3020
|
-
return result;
|
|
3021
|
-
}
|
|
3022
|
-
|
|
3023
|
-
var _equalArrays = equalArrays$2;
|
|
3024
|
-
|
|
3025
|
-
/**
|
|
3026
|
-
* Converts `map` to its key-value pairs.
|
|
3027
|
-
*
|
|
3028
|
-
* @private
|
|
3029
|
-
* @param {Object} map The map to convert.
|
|
3030
|
-
* @returns {Array} Returns the key-value pairs.
|
|
3031
|
-
*/
|
|
3032
|
-
|
|
3033
|
-
function mapToArray$1(map) {
|
|
3034
|
-
var index = -1,
|
|
3035
|
-
result = Array(map.size);
|
|
3036
|
-
|
|
3037
|
-
map.forEach(function(value, key) {
|
|
3038
|
-
result[++index] = [key, value];
|
|
3039
|
-
});
|
|
3040
|
-
return result;
|
|
3041
|
-
}
|
|
3042
|
-
|
|
3043
|
-
var _mapToArray = mapToArray$1;
|
|
3044
|
-
|
|
3045
|
-
/**
|
|
3046
|
-
* Converts `set` to an array of its values.
|
|
3047
|
-
*
|
|
3048
|
-
* @private
|
|
3049
|
-
* @param {Object} set The set to convert.
|
|
3050
|
-
* @returns {Array} Returns the values.
|
|
3051
|
-
*/
|
|
3052
|
-
|
|
3053
|
-
function setToArray$1(set) {
|
|
3054
|
-
var index = -1,
|
|
3055
|
-
result = Array(set.size);
|
|
3056
|
-
|
|
3057
|
-
set.forEach(function(value) {
|
|
3058
|
-
result[++index] = value;
|
|
3059
|
-
});
|
|
3060
|
-
return result;
|
|
3061
|
-
}
|
|
3062
|
-
|
|
3063
|
-
var _setToArray = setToArray$1;
|
|
3064
|
-
|
|
3065
|
-
var Symbol = _Symbol,
|
|
3066
|
-
Uint8Array = _Uint8Array,
|
|
3067
|
-
eq$2 = eq_1,
|
|
3068
|
-
equalArrays$1 = _equalArrays,
|
|
3069
|
-
mapToArray = _mapToArray,
|
|
3070
|
-
setToArray = _setToArray;
|
|
3071
|
-
|
|
3072
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
3073
|
-
var COMPARE_PARTIAL_FLAG$2 = 1,
|
|
3074
|
-
COMPARE_UNORDERED_FLAG = 2;
|
|
3075
|
-
|
|
3076
|
-
/** `Object#toString` result references. */
|
|
3077
|
-
var boolTag = '[object Boolean]',
|
|
3078
|
-
dateTag = '[object Date]',
|
|
3079
|
-
errorTag = '[object Error]',
|
|
3080
|
-
mapTag = '[object Map]',
|
|
3081
|
-
numberTag = '[object Number]',
|
|
3082
|
-
regexpTag = '[object RegExp]',
|
|
3083
|
-
setTag = '[object Set]',
|
|
3084
|
-
stringTag = '[object String]',
|
|
3085
|
-
symbolTag = '[object Symbol]';
|
|
3086
|
-
|
|
3087
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
3088
|
-
dataViewTag = '[object DataView]';
|
|
3089
|
-
|
|
3090
|
-
/** Used to convert symbols to primitives and strings. */
|
|
3091
|
-
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
3092
|
-
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
3093
|
-
|
|
3094
|
-
/**
|
|
3095
|
-
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
3096
|
-
* the same `toStringTag`.
|
|
3097
|
-
*
|
|
3098
|
-
* **Note:** This function only supports comparing values with tags of
|
|
3099
|
-
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
3100
|
-
*
|
|
3101
|
-
* @private
|
|
3102
|
-
* @param {Object} object The object to compare.
|
|
3103
|
-
* @param {Object} other The other object to compare.
|
|
3104
|
-
* @param {string} tag The `toStringTag` of the objects to compare.
|
|
3105
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
3106
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
3107
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
3108
|
-
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
3109
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
3110
|
-
*/
|
|
3111
|
-
function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
3112
|
-
switch (tag) {
|
|
3113
|
-
case dataViewTag:
|
|
3114
|
-
if ((object.byteLength != other.byteLength) ||
|
|
3115
|
-
(object.byteOffset != other.byteOffset)) {
|
|
3116
|
-
return false;
|
|
3117
|
-
}
|
|
3118
|
-
object = object.buffer;
|
|
3119
|
-
other = other.buffer;
|
|
3120
|
-
|
|
3121
|
-
case arrayBufferTag:
|
|
3122
|
-
if ((object.byteLength != other.byteLength) ||
|
|
3123
|
-
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
|
3124
|
-
return false;
|
|
3125
|
-
}
|
|
3126
|
-
return true;
|
|
3127
|
-
|
|
3128
|
-
case boolTag:
|
|
3129
|
-
case dateTag:
|
|
3130
|
-
case numberTag:
|
|
3131
|
-
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
3132
|
-
// Invalid dates are coerced to `NaN`.
|
|
3133
|
-
return eq$2(+object, +other);
|
|
3134
|
-
|
|
3135
|
-
case errorTag:
|
|
3136
|
-
return object.name == other.name && object.message == other.message;
|
|
3137
|
-
|
|
3138
|
-
case regexpTag:
|
|
3139
|
-
case stringTag:
|
|
3140
|
-
// Coerce regexes to strings and treat strings, primitives and objects,
|
|
3141
|
-
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
|
3142
|
-
// for more details.
|
|
3143
|
-
return object == (other + '');
|
|
3144
|
-
|
|
3145
|
-
case mapTag:
|
|
3146
|
-
var convert = mapToArray;
|
|
3147
|
-
|
|
3148
|
-
case setTag:
|
|
3149
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
3150
|
-
convert || (convert = setToArray);
|
|
3151
|
-
|
|
3152
|
-
if (object.size != other.size && !isPartial) {
|
|
3153
|
-
return false;
|
|
3154
|
-
}
|
|
3155
|
-
// Assume cyclic values are equal.
|
|
3156
|
-
var stacked = stack.get(object);
|
|
3157
|
-
if (stacked) {
|
|
3158
|
-
return stacked == other;
|
|
3159
|
-
}
|
|
3160
|
-
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
3161
|
-
|
|
3162
|
-
// Recursively compare objects (susceptible to call stack limits).
|
|
3163
|
-
stack.set(object, other);
|
|
3164
|
-
var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
3165
|
-
stack['delete'](object);
|
|
3166
|
-
return result;
|
|
3167
|
-
|
|
3168
|
-
case symbolTag:
|
|
3169
|
-
if (symbolValueOf) {
|
|
3170
|
-
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
3171
|
-
}
|
|
3172
|
-
}
|
|
3173
|
-
return false;
|
|
3174
|
-
}
|
|
3175
|
-
|
|
3176
|
-
var _equalByTag = equalByTag$1;
|
|
3177
|
-
|
|
3178
|
-
var getAllKeys = _getAllKeys;
|
|
3179
|
-
|
|
3180
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
3181
|
-
var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
3182
|
-
|
|
3183
|
-
/** Used for built-in method references. */
|
|
3184
|
-
var objectProto$2 = Object.prototype;
|
|
3185
|
-
|
|
3186
|
-
/** Used to check objects for own properties. */
|
|
3187
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
3188
|
-
|
|
3189
|
-
/**
|
|
3190
|
-
* A specialized version of `baseIsEqualDeep` for objects with support for
|
|
3191
|
-
* partial deep comparisons.
|
|
3192
|
-
*
|
|
3193
|
-
* @private
|
|
3194
|
-
* @param {Object} object The object to compare.
|
|
3195
|
-
* @param {Object} other The other object to compare.
|
|
3196
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
3197
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
3198
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
3199
|
-
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
3200
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
3201
|
-
*/
|
|
3202
|
-
function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
|
|
3203
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
|
|
3204
|
-
objProps = getAllKeys(object),
|
|
3205
|
-
objLength = objProps.length,
|
|
3206
|
-
othProps = getAllKeys(other),
|
|
3207
|
-
othLength = othProps.length;
|
|
3208
|
-
|
|
3209
|
-
if (objLength != othLength && !isPartial) {
|
|
3210
|
-
return false;
|
|
3211
|
-
}
|
|
3212
|
-
var index = objLength;
|
|
3213
|
-
while (index--) {
|
|
3214
|
-
var key = objProps[index];
|
|
3215
|
-
if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
|
|
3216
|
-
return false;
|
|
3217
|
-
}
|
|
3218
|
-
}
|
|
3219
|
-
// Check that cyclic values are equal.
|
|
3220
|
-
var objStacked = stack.get(object);
|
|
3221
|
-
var othStacked = stack.get(other);
|
|
3222
|
-
if (objStacked && othStacked) {
|
|
3223
|
-
return objStacked == other && othStacked == object;
|
|
3224
|
-
}
|
|
3225
|
-
var result = true;
|
|
3226
|
-
stack.set(object, other);
|
|
3227
|
-
stack.set(other, object);
|
|
3228
|
-
|
|
3229
|
-
var skipCtor = isPartial;
|
|
3230
|
-
while (++index < objLength) {
|
|
3231
|
-
key = objProps[index];
|
|
3232
|
-
var objValue = object[key],
|
|
3233
|
-
othValue = other[key];
|
|
3234
|
-
|
|
3235
|
-
if (customizer) {
|
|
3236
|
-
var compared = isPartial
|
|
3237
|
-
? customizer(othValue, objValue, key, other, object, stack)
|
|
3238
|
-
: customizer(objValue, othValue, key, object, other, stack);
|
|
3239
|
-
}
|
|
3240
|
-
// Recursively compare objects (susceptible to call stack limits).
|
|
3241
|
-
if (!(compared === undefined
|
|
3242
|
-
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
|
3243
|
-
: compared
|
|
3244
|
-
)) {
|
|
3245
|
-
result = false;
|
|
3246
|
-
break;
|
|
3247
|
-
}
|
|
3248
|
-
skipCtor || (skipCtor = key == 'constructor');
|
|
3249
|
-
}
|
|
3250
|
-
if (result && !skipCtor) {
|
|
3251
|
-
var objCtor = object.constructor,
|
|
3252
|
-
othCtor = other.constructor;
|
|
3253
|
-
|
|
3254
|
-
// Non `Object` object instances with different constructors are not equal.
|
|
3255
|
-
if (objCtor != othCtor &&
|
|
3256
|
-
('constructor' in object && 'constructor' in other) &&
|
|
3257
|
-
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
|
3258
|
-
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
|
3259
|
-
result = false;
|
|
3260
|
-
}
|
|
3261
|
-
}
|
|
3262
|
-
stack['delete'](object);
|
|
3263
|
-
stack['delete'](other);
|
|
3264
|
-
return result;
|
|
3265
|
-
}
|
|
3266
|
-
|
|
3267
|
-
var _equalObjects = equalObjects$1;
|
|
3268
|
-
|
|
3269
|
-
var Stack$1 = _Stack,
|
|
3270
|
-
equalArrays = _equalArrays,
|
|
3271
|
-
equalByTag = _equalByTag,
|
|
3272
|
-
equalObjects = _equalObjects,
|
|
3273
|
-
getTag = _getTag,
|
|
3274
|
-
isArray$1 = isArray_1,
|
|
3275
|
-
isBuffer$1 = isBufferExports,
|
|
3276
|
-
isTypedArray$1 = isTypedArray_1;
|
|
3277
|
-
|
|
3278
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
3279
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
3280
|
-
|
|
3281
|
-
/** `Object#toString` result references. */
|
|
3282
|
-
var argsTag = '[object Arguments]',
|
|
3283
|
-
arrayTag = '[object Array]',
|
|
3284
|
-
objectTag$1 = '[object Object]';
|
|
3285
|
-
|
|
3286
|
-
/** Used for built-in method references. */
|
|
3287
|
-
var objectProto$1 = Object.prototype;
|
|
3288
|
-
|
|
3289
|
-
/** Used to check objects for own properties. */
|
|
3290
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
3291
|
-
|
|
3292
|
-
/**
|
|
3293
|
-
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
|
3294
|
-
* deep comparisons and tracks traversed objects enabling objects with circular
|
|
3295
|
-
* references to be compared.
|
|
3296
|
-
*
|
|
3297
|
-
* @private
|
|
3298
|
-
* @param {Object} object The object to compare.
|
|
3299
|
-
* @param {Object} other The other object to compare.
|
|
3300
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
3301
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
3302
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
3303
|
-
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
3304
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
3305
|
-
*/
|
|
3306
|
-
function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
|
|
3307
|
-
var objIsArr = isArray$1(object),
|
|
3308
|
-
othIsArr = isArray$1(other),
|
|
3309
|
-
objTag = objIsArr ? arrayTag : getTag(object),
|
|
3310
|
-
othTag = othIsArr ? arrayTag : getTag(other);
|
|
3311
|
-
|
|
3312
|
-
objTag = objTag == argsTag ? objectTag$1 : objTag;
|
|
3313
|
-
othTag = othTag == argsTag ? objectTag$1 : othTag;
|
|
3314
|
-
|
|
3315
|
-
var objIsObj = objTag == objectTag$1,
|
|
3316
|
-
othIsObj = othTag == objectTag$1,
|
|
3317
|
-
isSameTag = objTag == othTag;
|
|
3318
|
-
|
|
3319
|
-
if (isSameTag && isBuffer$1(object)) {
|
|
3320
|
-
if (!isBuffer$1(other)) {
|
|
3321
|
-
return false;
|
|
3322
|
-
}
|
|
3323
|
-
objIsArr = true;
|
|
3324
|
-
objIsObj = false;
|
|
3325
|
-
}
|
|
3326
|
-
if (isSameTag && !objIsObj) {
|
|
3327
|
-
stack || (stack = new Stack$1);
|
|
3328
|
-
return (objIsArr || isTypedArray$1(object))
|
|
3329
|
-
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
3330
|
-
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
3331
|
-
}
|
|
3332
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
3333
|
-
var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, '__wrapped__'),
|
|
3334
|
-
othIsWrapped = othIsObj && hasOwnProperty$1.call(other, '__wrapped__');
|
|
3335
|
-
|
|
3336
|
-
if (objIsWrapped || othIsWrapped) {
|
|
3337
|
-
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
3338
|
-
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
3339
|
-
|
|
3340
|
-
stack || (stack = new Stack$1);
|
|
3341
|
-
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
3342
|
-
}
|
|
3343
|
-
}
|
|
3344
|
-
if (!isSameTag) {
|
|
3345
|
-
return false;
|
|
3346
|
-
}
|
|
3347
|
-
stack || (stack = new Stack$1);
|
|
3348
|
-
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
3349
|
-
}
|
|
3350
|
-
|
|
3351
|
-
var _baseIsEqualDeep = baseIsEqualDeep$1;
|
|
3352
|
-
|
|
3353
|
-
var baseIsEqualDeep = _baseIsEqualDeep,
|
|
3354
|
-
isObjectLike$2 = isObjectLike_1;
|
|
3355
|
-
|
|
3356
|
-
/**
|
|
3357
|
-
* The base implementation of `_.isEqual` which supports partial comparisons
|
|
3358
|
-
* and tracks traversed objects.
|
|
3359
|
-
*
|
|
3360
|
-
* @private
|
|
3361
|
-
* @param {*} value The value to compare.
|
|
3362
|
-
* @param {*} other The other value to compare.
|
|
3363
|
-
* @param {boolean} bitmask The bitmask flags.
|
|
3364
|
-
* 1 - Unordered comparison
|
|
3365
|
-
* 2 - Partial comparison
|
|
3366
|
-
* @param {Function} [customizer] The function to customize comparisons.
|
|
3367
|
-
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
|
3368
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
3369
|
-
*/
|
|
3370
|
-
function baseIsEqual$1(value, other, bitmask, customizer, stack) {
|
|
3371
|
-
if (value === other) {
|
|
3372
|
-
return true;
|
|
3373
|
-
}
|
|
3374
|
-
if (value == null || other == null || (!isObjectLike$2(value) && !isObjectLike$2(other))) {
|
|
3375
|
-
return value !== value && other !== other;
|
|
3376
|
-
}
|
|
3377
|
-
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$1, stack);
|
|
3378
|
-
}
|
|
3379
|
-
|
|
3380
|
-
var _baseIsEqual = baseIsEqual$1;
|
|
3381
|
-
|
|
3382
|
-
var baseIsEqual = _baseIsEqual;
|
|
3383
|
-
|
|
3384
|
-
/**
|
|
3385
|
-
* Performs a deep comparison between two values to determine if they are
|
|
3386
|
-
* equivalent.
|
|
3387
|
-
*
|
|
3388
|
-
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
3389
|
-
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
3390
|
-
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
3391
|
-
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
3392
|
-
* nodes are compared by strict equality, i.e. `===`.
|
|
3393
|
-
*
|
|
3394
|
-
* @static
|
|
3395
|
-
* @memberOf _
|
|
3396
|
-
* @since 0.1.0
|
|
3397
|
-
* @category Lang
|
|
3398
|
-
* @param {*} value The value to compare.
|
|
3399
|
-
* @param {*} other The other value to compare.
|
|
3400
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
3401
|
-
* @example
|
|
3402
|
-
*
|
|
3403
|
-
* var object = { 'a': 1 };
|
|
3404
|
-
* var other = { 'a': 1 };
|
|
3405
|
-
*
|
|
3406
|
-
* _.isEqual(object, other);
|
|
3407
|
-
* // => true
|
|
3408
|
-
*
|
|
3409
|
-
* object === other;
|
|
3410
|
-
* // => false
|
|
3411
|
-
*/
|
|
3412
|
-
function isEqual(value, other) {
|
|
3413
|
-
return baseIsEqual(value, other);
|
|
3414
|
-
}
|
|
3415
|
-
|
|
3416
|
-
var isEqual_1 = isEqual;
|
|
3417
|
-
|
|
3418
|
-
var isEqual$1 = /*@__PURE__*/getDefaultExportFromCjs(isEqual_1);
|
|
3419
|
-
|
|
3420
|
-
var baseAssignValue = _baseAssignValue,
|
|
3421
|
-
eq$1 = eq_1;
|
|
3422
|
-
|
|
3423
|
-
/**
|
|
3424
|
-
* This function is like `assignValue` except that it doesn't assign
|
|
3425
|
-
* `undefined` values.
|
|
3426
|
-
*
|
|
3427
|
-
* @private
|
|
3428
|
-
* @param {Object} object The object to modify.
|
|
3429
|
-
* @param {string} key The key of the property to assign.
|
|
3430
|
-
* @param {*} value The value to assign.
|
|
3431
|
-
*/
|
|
3432
|
-
function assignMergeValue$2(object, key, value) {
|
|
3433
|
-
if ((value !== undefined && !eq$1(object[key], value)) ||
|
|
3434
|
-
(value === undefined && !(key in object))) {
|
|
3435
|
-
baseAssignValue(object, key, value);
|
|
3436
|
-
}
|
|
3437
|
-
}
|
|
3438
|
-
|
|
3439
|
-
var _assignMergeValue = assignMergeValue$2;
|
|
3440
|
-
|
|
3441
|
-
/**
|
|
3442
|
-
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
3443
|
-
*
|
|
3444
|
-
* @private
|
|
3445
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
3446
|
-
* @returns {Function} Returns the new base function.
|
|
3447
|
-
*/
|
|
3448
|
-
|
|
3449
|
-
function createBaseFor$1(fromRight) {
|
|
3450
|
-
return function(object, iteratee, keysFunc) {
|
|
3451
|
-
var index = -1,
|
|
3452
|
-
iterable = Object(object),
|
|
3453
|
-
props = keysFunc(object),
|
|
3454
|
-
length = props.length;
|
|
3455
|
-
|
|
3456
|
-
while (length--) {
|
|
3457
|
-
var key = props[fromRight ? length : ++index];
|
|
3458
|
-
if (iteratee(iterable[key], key, iterable) === false) {
|
|
3459
|
-
break;
|
|
3460
|
-
}
|
|
3461
|
-
}
|
|
3462
|
-
return object;
|
|
3463
|
-
};
|
|
3464
|
-
}
|
|
3465
|
-
|
|
3466
|
-
var _createBaseFor = createBaseFor$1;
|
|
3467
|
-
|
|
3468
|
-
var createBaseFor = _createBaseFor;
|
|
3469
|
-
|
|
3470
|
-
/**
|
|
3471
|
-
* The base implementation of `baseForOwn` which iterates over `object`
|
|
3472
|
-
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
3473
|
-
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
3474
|
-
*
|
|
3475
|
-
* @private
|
|
3476
|
-
* @param {Object} object The object to iterate over.
|
|
3477
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
3478
|
-
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
3479
|
-
* @returns {Object} Returns `object`.
|
|
3480
|
-
*/
|
|
3481
|
-
var baseFor$1 = createBaseFor();
|
|
3482
|
-
|
|
3483
|
-
var _baseFor = baseFor$1;
|
|
3484
|
-
|
|
3485
|
-
var isArrayLike$1 = isArrayLike_1,
|
|
3486
|
-
isObjectLike$1 = isObjectLike_1;
|
|
3487
|
-
|
|
3488
|
-
/**
|
|
3489
|
-
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
3490
|
-
* is an object.
|
|
3491
|
-
*
|
|
3492
|
-
* @static
|
|
3493
|
-
* @memberOf _
|
|
3494
|
-
* @since 4.0.0
|
|
3495
|
-
* @category Lang
|
|
3496
|
-
* @param {*} value The value to check.
|
|
3497
|
-
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
3498
|
-
* else `false`.
|
|
3499
|
-
* @example
|
|
3500
|
-
*
|
|
3501
|
-
* _.isArrayLikeObject([1, 2, 3]);
|
|
3502
|
-
* // => true
|
|
3503
|
-
*
|
|
3504
|
-
* _.isArrayLikeObject(document.body.children);
|
|
3505
|
-
* // => true
|
|
3506
|
-
*
|
|
3507
|
-
* _.isArrayLikeObject('abc');
|
|
3508
|
-
* // => false
|
|
3509
|
-
*
|
|
3510
|
-
* _.isArrayLikeObject(_.noop);
|
|
3511
|
-
* // => false
|
|
3512
|
-
*/
|
|
3513
|
-
function isArrayLikeObject$1(value) {
|
|
3514
|
-
return isObjectLike$1(value) && isArrayLike$1(value);
|
|
3515
|
-
}
|
|
3516
|
-
|
|
3517
|
-
var isArrayLikeObject_1 = isArrayLikeObject$1;
|
|
3518
|
-
|
|
3519
|
-
var baseGetTag = _baseGetTag,
|
|
3520
|
-
getPrototype = _getPrototype,
|
|
3521
|
-
isObjectLike = isObjectLike_1;
|
|
3522
|
-
|
|
3523
|
-
/** `Object#toString` result references. */
|
|
3524
|
-
var objectTag = '[object Object]';
|
|
3525
|
-
|
|
3526
|
-
/** Used for built-in method references. */
|
|
3527
|
-
var funcProto = Function.prototype,
|
|
3528
|
-
objectProto = Object.prototype;
|
|
3529
|
-
|
|
3530
|
-
/** Used to resolve the decompiled source of functions. */
|
|
3531
|
-
var funcToString = funcProto.toString;
|
|
3532
|
-
|
|
3533
|
-
/** Used to check objects for own properties. */
|
|
3534
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
3535
|
-
|
|
3536
|
-
/** Used to infer the `Object` constructor. */
|
|
3537
|
-
var objectCtorString = funcToString.call(Object);
|
|
3538
|
-
|
|
3539
|
-
/**
|
|
3540
|
-
* Checks if `value` is a plain object, that is, an object created by the
|
|
3541
|
-
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
3542
|
-
*
|
|
3543
|
-
* @static
|
|
3544
|
-
* @memberOf _
|
|
3545
|
-
* @since 0.8.0
|
|
3546
|
-
* @category Lang
|
|
3547
|
-
* @param {*} value The value to check.
|
|
3548
|
-
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
3549
|
-
* @example
|
|
3550
|
-
*
|
|
3551
|
-
* function Foo() {
|
|
3552
|
-
* this.a = 1;
|
|
3553
|
-
* }
|
|
3554
|
-
*
|
|
3555
|
-
* _.isPlainObject(new Foo);
|
|
3556
|
-
* // => false
|
|
3557
|
-
*
|
|
3558
|
-
* _.isPlainObject([1, 2, 3]);
|
|
3559
|
-
* // => false
|
|
3560
|
-
*
|
|
3561
|
-
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
3562
|
-
* // => true
|
|
3563
|
-
*
|
|
3564
|
-
* _.isPlainObject(Object.create(null));
|
|
3565
|
-
* // => true
|
|
3566
|
-
*/
|
|
3567
|
-
function isPlainObject$1(value) {
|
|
3568
|
-
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
3569
|
-
return false;
|
|
3570
|
-
}
|
|
3571
|
-
var proto = getPrototype(value);
|
|
3572
|
-
if (proto === null) {
|
|
3573
|
-
return true;
|
|
3574
|
-
}
|
|
3575
|
-
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
3576
|
-
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
3577
|
-
funcToString.call(Ctor) == objectCtorString;
|
|
3578
|
-
}
|
|
3579
|
-
|
|
3580
|
-
var isPlainObject_1 = isPlainObject$1;
|
|
2997
|
+
var isPlainObject_1 = isPlainObject$1;
|
|
3581
2998
|
|
|
3582
2999
|
/**
|
|
3583
3000
|
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
@@ -4090,11 +3507,1194 @@ var merge_1 = merge;
|
|
|
4090
3507
|
|
|
4091
3508
|
var merge$1 = /*@__PURE__*/getDefaultExportFromCjs(merge_1);
|
|
4092
3509
|
|
|
3510
|
+
var hasSameObjectStructure=function hasSameObjectStructure(obj1,obj2){if(!isObject$9(obj1)||!isObject$9(obj2)){return isObject$9(obj1)===isObject$9(obj2);}var keys1=keys$4(obj1);var keys2=keys$4(obj2);if(keys1.length!==keys2.length){return false;}keys1.sort();keys2.sort();for(var i=0;i<keys1.length;i++){if(keys1[i]!==keys2[i]){return false;}}for(var _key of keys1){if(!hasSameObjectStructure(obj1[_key],obj2[_key])){return false;}}return true;};
|
|
3511
|
+
|
|
4093
3512
|
var PREFIX='[Blade]:';var throwBladeError=function throwBladeError(_ref){var message=_ref.message,moduleName=_ref.moduleName;if(__DEV__){var prefix=moduleName?`[Blade: ${moduleName}]:`:PREFIX;throw new Error(`${prefix} ${message}`);}};var getCommonLogger=function getCommonLogger(type){switch(type){case'error':return console.error;case'warn':return console.warn;case'log':default:return console.log;}};var logger=function logger(_ref2){var message=_ref2.message,moduleName=_ref2.moduleName,type=_ref2.type;if(__DEV__){var prefix=moduleName?`[Blade: ${moduleName}]:`:PREFIX;getCommonLogger(type)(`${prefix} ${message}`);}};
|
|
4094
3513
|
|
|
4095
3514
|
var isPartialMatchObjectKeys=function isPartialMatchObjectKeys(_ref){var objectToMatch=_ref.objectToMatch,objectToInspect=_ref.objectToInspect;var matchResponses=[];var matchObjectKeys=function matchObjectKeys(_ref2){var innerObjectToMatch=_ref2.innerObjectToMatch,innerObjectToInspect=_ref2.innerObjectToInspect;for(var _ref3 of Object.entries(innerObjectToMatch)){var _ref4=_slicedToArray(_ref3,2);var key=_ref4[0];var valueToMatch=_ref4[1];var valueToInspect=innerObjectToInspect[key];if(innerObjectToInspect.hasOwnProperty(key)){if(valueToMatch===null||valueToMatch===undefined||valueToMatch===''||Array.isArray(valueToMatch)||!(valueToMatch instanceof Object)&&typeof valueToMatch!==typeof valueToInspect){if(__DEV__){logger({message:`Unexpected value: ${JSON.stringify(valueToMatch)} of type ${typeof valueToMatch} for key: ${key}`,moduleName:'isPartialMatchObjectKeys',type:'error'});}matchResponses.push(false);}if(typeof valueToMatch==='string'){matchResponses.push(true);}if(isObject$9(valueToMatch)&&isObject$9(valueToInspect)){matchObjectKeys({innerObjectToMatch:valueToMatch,innerObjectToInspect:valueToInspect});}}else {if(__DEV__){logger({message:`${key} doesn't exist in ${JSON.stringify(innerObjectToInspect,null,2)}`,moduleName:'isPartialMatchObjectKeys',type:'error'});}matchResponses.push(false);}}};matchObjectKeys({innerObjectToMatch:objectToMatch,innerObjectToInspect:objectToInspect});return matchResponses.every(Boolean);};
|
|
4096
3515
|
|
|
4097
|
-
var overrideTheme=function overrideTheme(_ref){var baseThemeTokens=_ref.baseThemeTokens,overrides=_ref.overrides;if(__DEV__){if(!
|
|
3516
|
+
var overrideTheme=function overrideTheme(_ref){var baseThemeTokens=_ref.baseThemeTokens,overrides=_ref.overrides;if(__DEV__){if(!hasSameObjectStructure(baseThemeTokens,paymentTheme)){throwBladeError({message:'The base theme provided is not a valid Blade theme',moduleName:'overrideTheme'});}if(!isPartialMatchObjectKeys({objectToMatch:overrides,objectToInspect:baseThemeTokens})){throwBladeError({message:'The overrides object is not valid',moduleName:'overrideTheme'});}}return merge$1(cloneDeep$1(baseThemeTokens),overrides);};
|
|
3517
|
+
|
|
3518
|
+
// This file is autogenerated. It's used to publish ESM to npm.
|
|
3519
|
+
function _typeof(obj) {
|
|
3520
|
+
"@babel/helpers - typeof";
|
|
3521
|
+
|
|
3522
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
3523
|
+
return typeof obj;
|
|
3524
|
+
} : function (obj) {
|
|
3525
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
3526
|
+
}, _typeof(obj);
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
// https://github.com/bgrins/TinyColor
|
|
3530
|
+
// Brian Grinstead, MIT License
|
|
3531
|
+
|
|
3532
|
+
var trimLeft = /^\s+/;
|
|
3533
|
+
var trimRight = /\s+$/;
|
|
3534
|
+
function tinycolor(color, opts) {
|
|
3535
|
+
color = color ? color : "";
|
|
3536
|
+
opts = opts || {};
|
|
3537
|
+
|
|
3538
|
+
// If input is already a tinycolor, return itself
|
|
3539
|
+
if (color instanceof tinycolor) {
|
|
3540
|
+
return color;
|
|
3541
|
+
}
|
|
3542
|
+
// If we are called as a function, call using new instead
|
|
3543
|
+
if (!(this instanceof tinycolor)) {
|
|
3544
|
+
return new tinycolor(color, opts);
|
|
3545
|
+
}
|
|
3546
|
+
var rgb = inputToRGB(color);
|
|
3547
|
+
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;
|
|
3548
|
+
this._gradientType = opts.gradientType;
|
|
3549
|
+
|
|
3550
|
+
// Don't let the range of [0,255] come back in [0,1].
|
|
3551
|
+
// Potentially lose a little bit of precision here, but will fix issues where
|
|
3552
|
+
// .5 gets interpreted as half of the total, instead of half of 1
|
|
3553
|
+
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
|
|
3554
|
+
if (this._r < 1) this._r = Math.round(this._r);
|
|
3555
|
+
if (this._g < 1) this._g = Math.round(this._g);
|
|
3556
|
+
if (this._b < 1) this._b = Math.round(this._b);
|
|
3557
|
+
this._ok = rgb.ok;
|
|
3558
|
+
}
|
|
3559
|
+
tinycolor.prototype = {
|
|
3560
|
+
isDark: function isDark() {
|
|
3561
|
+
return this.getBrightness() < 128;
|
|
3562
|
+
},
|
|
3563
|
+
isLight: function isLight() {
|
|
3564
|
+
return !this.isDark();
|
|
3565
|
+
},
|
|
3566
|
+
isValid: function isValid() {
|
|
3567
|
+
return this._ok;
|
|
3568
|
+
},
|
|
3569
|
+
getOriginalInput: function getOriginalInput() {
|
|
3570
|
+
return this._originalInput;
|
|
3571
|
+
},
|
|
3572
|
+
getFormat: function getFormat() {
|
|
3573
|
+
return this._format;
|
|
3574
|
+
},
|
|
3575
|
+
getAlpha: function getAlpha() {
|
|
3576
|
+
return this._a;
|
|
3577
|
+
},
|
|
3578
|
+
getBrightness: function getBrightness() {
|
|
3579
|
+
//http://www.w3.org/TR/AERT#color-contrast
|
|
3580
|
+
var rgb = this.toRgb();
|
|
3581
|
+
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
|
|
3582
|
+
},
|
|
3583
|
+
getLuminance: function getLuminance() {
|
|
3584
|
+
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
3585
|
+
var rgb = this.toRgb();
|
|
3586
|
+
var RsRGB, GsRGB, BsRGB, R, G, B;
|
|
3587
|
+
RsRGB = rgb.r / 255;
|
|
3588
|
+
GsRGB = rgb.g / 255;
|
|
3589
|
+
BsRGB = rgb.b / 255;
|
|
3590
|
+
if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
|
|
3591
|
+
if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
|
|
3592
|
+
if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
|
|
3593
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
3594
|
+
},
|
|
3595
|
+
setAlpha: function setAlpha(value) {
|
|
3596
|
+
this._a = boundAlpha(value);
|
|
3597
|
+
this._roundA = Math.round(100 * this._a) / 100;
|
|
3598
|
+
return this;
|
|
3599
|
+
},
|
|
3600
|
+
toHsv: function toHsv() {
|
|
3601
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
3602
|
+
return {
|
|
3603
|
+
h: hsv.h * 360,
|
|
3604
|
+
s: hsv.s,
|
|
3605
|
+
v: hsv.v,
|
|
3606
|
+
a: this._a
|
|
3607
|
+
};
|
|
3608
|
+
},
|
|
3609
|
+
toHsvString: function toHsvString() {
|
|
3610
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
3611
|
+
var h = Math.round(hsv.h * 360),
|
|
3612
|
+
s = Math.round(hsv.s * 100),
|
|
3613
|
+
v = Math.round(hsv.v * 100);
|
|
3614
|
+
return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
|
|
3615
|
+
},
|
|
3616
|
+
toHsl: function toHsl() {
|
|
3617
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
3618
|
+
return {
|
|
3619
|
+
h: hsl.h * 360,
|
|
3620
|
+
s: hsl.s,
|
|
3621
|
+
l: hsl.l,
|
|
3622
|
+
a: this._a
|
|
3623
|
+
};
|
|
3624
|
+
},
|
|
3625
|
+
toHslString: function toHslString() {
|
|
3626
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
3627
|
+
var h = Math.round(hsl.h * 360),
|
|
3628
|
+
s = Math.round(hsl.s * 100),
|
|
3629
|
+
l = Math.round(hsl.l * 100);
|
|
3630
|
+
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
|
|
3631
|
+
},
|
|
3632
|
+
toHex: function toHex(allow3Char) {
|
|
3633
|
+
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
|
3634
|
+
},
|
|
3635
|
+
toHexString: function toHexString(allow3Char) {
|
|
3636
|
+
return "#" + this.toHex(allow3Char);
|
|
3637
|
+
},
|
|
3638
|
+
toHex8: function toHex8(allow4Char) {
|
|
3639
|
+
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
|
|
3640
|
+
},
|
|
3641
|
+
toHex8String: function toHex8String(allow4Char) {
|
|
3642
|
+
return "#" + this.toHex8(allow4Char);
|
|
3643
|
+
},
|
|
3644
|
+
toRgb: function toRgb() {
|
|
3645
|
+
return {
|
|
3646
|
+
r: Math.round(this._r),
|
|
3647
|
+
g: Math.round(this._g),
|
|
3648
|
+
b: Math.round(this._b),
|
|
3649
|
+
a: this._a
|
|
3650
|
+
};
|
|
3651
|
+
},
|
|
3652
|
+
toRgbString: function toRgbString() {
|
|
3653
|
+
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 + ")";
|
|
3654
|
+
},
|
|
3655
|
+
toPercentageRgb: function toPercentageRgb() {
|
|
3656
|
+
return {
|
|
3657
|
+
r: Math.round(bound01(this._r, 255) * 100) + "%",
|
|
3658
|
+
g: Math.round(bound01(this._g, 255) * 100) + "%",
|
|
3659
|
+
b: Math.round(bound01(this._b, 255) * 100) + "%",
|
|
3660
|
+
a: this._a
|
|
3661
|
+
};
|
|
3662
|
+
},
|
|
3663
|
+
toPercentageRgbString: function toPercentageRgbString() {
|
|
3664
|
+
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 + ")";
|
|
3665
|
+
},
|
|
3666
|
+
toName: function toName() {
|
|
3667
|
+
if (this._a === 0) {
|
|
3668
|
+
return "transparent";
|
|
3669
|
+
}
|
|
3670
|
+
if (this._a < 1) {
|
|
3671
|
+
return false;
|
|
3672
|
+
}
|
|
3673
|
+
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
|
|
3674
|
+
},
|
|
3675
|
+
toFilter: function toFilter(secondColor) {
|
|
3676
|
+
var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
|
|
3677
|
+
var secondHex8String = hex8String;
|
|
3678
|
+
var gradientType = this._gradientType ? "GradientType = 1, " : "";
|
|
3679
|
+
if (secondColor) {
|
|
3680
|
+
var s = tinycolor(secondColor);
|
|
3681
|
+
secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
|
|
3682
|
+
}
|
|
3683
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
|
|
3684
|
+
},
|
|
3685
|
+
toString: function toString(format) {
|
|
3686
|
+
var formatSet = !!format;
|
|
3687
|
+
format = format || this._format;
|
|
3688
|
+
var formattedString = false;
|
|
3689
|
+
var hasAlpha = this._a < 1 && this._a >= 0;
|
|
3690
|
+
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
|
|
3691
|
+
if (needsAlphaFormat) {
|
|
3692
|
+
// Special case for "transparent", all other non-alpha formats
|
|
3693
|
+
// will return rgba when there is transparency.
|
|
3694
|
+
if (format === "name" && this._a === 0) {
|
|
3695
|
+
return this.toName();
|
|
3696
|
+
}
|
|
3697
|
+
return this.toRgbString();
|
|
3698
|
+
}
|
|
3699
|
+
if (format === "rgb") {
|
|
3700
|
+
formattedString = this.toRgbString();
|
|
3701
|
+
}
|
|
3702
|
+
if (format === "prgb") {
|
|
3703
|
+
formattedString = this.toPercentageRgbString();
|
|
3704
|
+
}
|
|
3705
|
+
if (format === "hex" || format === "hex6") {
|
|
3706
|
+
formattedString = this.toHexString();
|
|
3707
|
+
}
|
|
3708
|
+
if (format === "hex3") {
|
|
3709
|
+
formattedString = this.toHexString(true);
|
|
3710
|
+
}
|
|
3711
|
+
if (format === "hex4") {
|
|
3712
|
+
formattedString = this.toHex8String(true);
|
|
3713
|
+
}
|
|
3714
|
+
if (format === "hex8") {
|
|
3715
|
+
formattedString = this.toHex8String();
|
|
3716
|
+
}
|
|
3717
|
+
if (format === "name") {
|
|
3718
|
+
formattedString = this.toName();
|
|
3719
|
+
}
|
|
3720
|
+
if (format === "hsl") {
|
|
3721
|
+
formattedString = this.toHslString();
|
|
3722
|
+
}
|
|
3723
|
+
if (format === "hsv") {
|
|
3724
|
+
formattedString = this.toHsvString();
|
|
3725
|
+
}
|
|
3726
|
+
return formattedString || this.toHexString();
|
|
3727
|
+
},
|
|
3728
|
+
clone: function clone() {
|
|
3729
|
+
return tinycolor(this.toString());
|
|
3730
|
+
},
|
|
3731
|
+
_applyModification: function _applyModification(fn, args) {
|
|
3732
|
+
var color = fn.apply(null, [this].concat([].slice.call(args)));
|
|
3733
|
+
this._r = color._r;
|
|
3734
|
+
this._g = color._g;
|
|
3735
|
+
this._b = color._b;
|
|
3736
|
+
this.setAlpha(color._a);
|
|
3737
|
+
return this;
|
|
3738
|
+
},
|
|
3739
|
+
lighten: function lighten() {
|
|
3740
|
+
return this._applyModification(_lighten, arguments);
|
|
3741
|
+
},
|
|
3742
|
+
brighten: function brighten() {
|
|
3743
|
+
return this._applyModification(_brighten, arguments);
|
|
3744
|
+
},
|
|
3745
|
+
darken: function darken() {
|
|
3746
|
+
return this._applyModification(_darken, arguments);
|
|
3747
|
+
},
|
|
3748
|
+
desaturate: function desaturate() {
|
|
3749
|
+
return this._applyModification(_desaturate, arguments);
|
|
3750
|
+
},
|
|
3751
|
+
saturate: function saturate() {
|
|
3752
|
+
return this._applyModification(_saturate, arguments);
|
|
3753
|
+
},
|
|
3754
|
+
greyscale: function greyscale() {
|
|
3755
|
+
return this._applyModification(_greyscale, arguments);
|
|
3756
|
+
},
|
|
3757
|
+
spin: function spin() {
|
|
3758
|
+
return this._applyModification(_spin, arguments);
|
|
3759
|
+
},
|
|
3760
|
+
_applyCombination: function _applyCombination(fn, args) {
|
|
3761
|
+
return fn.apply(null, [this].concat([].slice.call(args)));
|
|
3762
|
+
},
|
|
3763
|
+
analogous: function analogous() {
|
|
3764
|
+
return this._applyCombination(_analogous, arguments);
|
|
3765
|
+
},
|
|
3766
|
+
complement: function complement() {
|
|
3767
|
+
return this._applyCombination(_complement, arguments);
|
|
3768
|
+
},
|
|
3769
|
+
monochromatic: function monochromatic() {
|
|
3770
|
+
return this._applyCombination(_monochromatic, arguments);
|
|
3771
|
+
},
|
|
3772
|
+
splitcomplement: function splitcomplement() {
|
|
3773
|
+
return this._applyCombination(_splitcomplement, arguments);
|
|
3774
|
+
},
|
|
3775
|
+
// Disabled until https://github.com/bgrins/TinyColor/issues/254
|
|
3776
|
+
// polyad: function (number) {
|
|
3777
|
+
// return this._applyCombination(polyad, [number]);
|
|
3778
|
+
// },
|
|
3779
|
+
triad: function triad() {
|
|
3780
|
+
return this._applyCombination(polyad, [3]);
|
|
3781
|
+
},
|
|
3782
|
+
tetrad: function tetrad() {
|
|
3783
|
+
return this._applyCombination(polyad, [4]);
|
|
3784
|
+
}
|
|
3785
|
+
};
|
|
3786
|
+
|
|
3787
|
+
// If input is an object, force 1 into "1.0" to handle ratios properly
|
|
3788
|
+
// String input requires "1.0" as input, so 1 will be treated as 1
|
|
3789
|
+
tinycolor.fromRatio = function (color, opts) {
|
|
3790
|
+
if (_typeof(color) == "object") {
|
|
3791
|
+
var newColor = {};
|
|
3792
|
+
for (var i in color) {
|
|
3793
|
+
if (color.hasOwnProperty(i)) {
|
|
3794
|
+
if (i === "a") {
|
|
3795
|
+
newColor[i] = color[i];
|
|
3796
|
+
} else {
|
|
3797
|
+
newColor[i] = convertToPercentage(color[i]);
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
color = newColor;
|
|
3802
|
+
}
|
|
3803
|
+
return tinycolor(color, opts);
|
|
3804
|
+
};
|
|
3805
|
+
|
|
3806
|
+
// Given a string or object, convert that input to RGB
|
|
3807
|
+
// Possible string inputs:
|
|
3808
|
+
//
|
|
3809
|
+
// "red"
|
|
3810
|
+
// "#f00" or "f00"
|
|
3811
|
+
// "#ff0000" or "ff0000"
|
|
3812
|
+
// "#ff000000" or "ff000000"
|
|
3813
|
+
// "rgb 255 0 0" or "rgb (255, 0, 0)"
|
|
3814
|
+
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
|
3815
|
+
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
|
3816
|
+
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
|
3817
|
+
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
|
3818
|
+
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
|
3819
|
+
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
|
3820
|
+
//
|
|
3821
|
+
function inputToRGB(color) {
|
|
3822
|
+
var rgb = {
|
|
3823
|
+
r: 0,
|
|
3824
|
+
g: 0,
|
|
3825
|
+
b: 0
|
|
3826
|
+
};
|
|
3827
|
+
var a = 1;
|
|
3828
|
+
var s = null;
|
|
3829
|
+
var v = null;
|
|
3830
|
+
var l = null;
|
|
3831
|
+
var ok = false;
|
|
3832
|
+
var format = false;
|
|
3833
|
+
if (typeof color == "string") {
|
|
3834
|
+
color = stringInputToObject(color);
|
|
3835
|
+
}
|
|
3836
|
+
if (_typeof(color) == "object") {
|
|
3837
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
3838
|
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
3839
|
+
ok = true;
|
|
3840
|
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
3841
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
3842
|
+
s = convertToPercentage(color.s);
|
|
3843
|
+
v = convertToPercentage(color.v);
|
|
3844
|
+
rgb = hsvToRgb(color.h, s, v);
|
|
3845
|
+
ok = true;
|
|
3846
|
+
format = "hsv";
|
|
3847
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
3848
|
+
s = convertToPercentage(color.s);
|
|
3849
|
+
l = convertToPercentage(color.l);
|
|
3850
|
+
rgb = hslToRgb(color.h, s, l);
|
|
3851
|
+
ok = true;
|
|
3852
|
+
format = "hsl";
|
|
3853
|
+
}
|
|
3854
|
+
if (color.hasOwnProperty("a")) {
|
|
3855
|
+
a = color.a;
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
a = boundAlpha(a);
|
|
3859
|
+
return {
|
|
3860
|
+
ok: ok,
|
|
3861
|
+
format: color.format || format,
|
|
3862
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
3863
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
3864
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
3865
|
+
a: a
|
|
3866
|
+
};
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
// Conversion Functions
|
|
3870
|
+
// --------------------
|
|
3871
|
+
|
|
3872
|
+
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
|
|
3873
|
+
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
|
|
3874
|
+
|
|
3875
|
+
// `rgbToRgb`
|
|
3876
|
+
// Handle bounds / percentage checking to conform to CSS color spec
|
|
3877
|
+
// <http://www.w3.org/TR/css3-color/>
|
|
3878
|
+
// *Assumes:* r, g, b in [0, 255] or [0, 1]
|
|
3879
|
+
// *Returns:* { r, g, b } in [0, 255]
|
|
3880
|
+
function rgbToRgb(r, g, b) {
|
|
3881
|
+
return {
|
|
3882
|
+
r: bound01(r, 255) * 255,
|
|
3883
|
+
g: bound01(g, 255) * 255,
|
|
3884
|
+
b: bound01(b, 255) * 255
|
|
3885
|
+
};
|
|
3886
|
+
}
|
|
3887
|
+
|
|
3888
|
+
// `rgbToHsl`
|
|
3889
|
+
// Converts an RGB color value to HSL.
|
|
3890
|
+
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
|
|
3891
|
+
// *Returns:* { h, s, l } in [0,1]
|
|
3892
|
+
function rgbToHsl(r, g, b) {
|
|
3893
|
+
r = bound01(r, 255);
|
|
3894
|
+
g = bound01(g, 255);
|
|
3895
|
+
b = bound01(b, 255);
|
|
3896
|
+
var max = Math.max(r, g, b),
|
|
3897
|
+
min = Math.min(r, g, b);
|
|
3898
|
+
var h,
|
|
3899
|
+
s,
|
|
3900
|
+
l = (max + min) / 2;
|
|
3901
|
+
if (max == min) {
|
|
3902
|
+
h = s = 0; // achromatic
|
|
3903
|
+
} else {
|
|
3904
|
+
var d = max - min;
|
|
3905
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
3906
|
+
switch (max) {
|
|
3907
|
+
case r:
|
|
3908
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
3909
|
+
break;
|
|
3910
|
+
case g:
|
|
3911
|
+
h = (b - r) / d + 2;
|
|
3912
|
+
break;
|
|
3913
|
+
case b:
|
|
3914
|
+
h = (r - g) / d + 4;
|
|
3915
|
+
break;
|
|
3916
|
+
}
|
|
3917
|
+
h /= 6;
|
|
3918
|
+
}
|
|
3919
|
+
return {
|
|
3920
|
+
h: h,
|
|
3921
|
+
s: s,
|
|
3922
|
+
l: l
|
|
3923
|
+
};
|
|
3924
|
+
}
|
|
3925
|
+
|
|
3926
|
+
// `hslToRgb`
|
|
3927
|
+
// Converts an HSL color value to RGB.
|
|
3928
|
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
|
|
3929
|
+
// *Returns:* { r, g, b } in the set [0, 255]
|
|
3930
|
+
function hslToRgb(h, s, l) {
|
|
3931
|
+
var r, g, b;
|
|
3932
|
+
h = bound01(h, 360);
|
|
3933
|
+
s = bound01(s, 100);
|
|
3934
|
+
l = bound01(l, 100);
|
|
3935
|
+
function hue2rgb(p, q, t) {
|
|
3936
|
+
if (t < 0) t += 1;
|
|
3937
|
+
if (t > 1) t -= 1;
|
|
3938
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
3939
|
+
if (t < 1 / 2) return q;
|
|
3940
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
3941
|
+
return p;
|
|
3942
|
+
}
|
|
3943
|
+
if (s === 0) {
|
|
3944
|
+
r = g = b = l; // achromatic
|
|
3945
|
+
} else {
|
|
3946
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
3947
|
+
var p = 2 * l - q;
|
|
3948
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
3949
|
+
g = hue2rgb(p, q, h);
|
|
3950
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
3951
|
+
}
|
|
3952
|
+
return {
|
|
3953
|
+
r: r * 255,
|
|
3954
|
+
g: g * 255,
|
|
3955
|
+
b: b * 255
|
|
3956
|
+
};
|
|
3957
|
+
}
|
|
3958
|
+
|
|
3959
|
+
// `rgbToHsv`
|
|
3960
|
+
// Converts an RGB color value to HSV
|
|
3961
|
+
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
|
|
3962
|
+
// *Returns:* { h, s, v } in [0,1]
|
|
3963
|
+
function rgbToHsv(r, g, b) {
|
|
3964
|
+
r = bound01(r, 255);
|
|
3965
|
+
g = bound01(g, 255);
|
|
3966
|
+
b = bound01(b, 255);
|
|
3967
|
+
var max = Math.max(r, g, b),
|
|
3968
|
+
min = Math.min(r, g, b);
|
|
3969
|
+
var h,
|
|
3970
|
+
s,
|
|
3971
|
+
v = max;
|
|
3972
|
+
var d = max - min;
|
|
3973
|
+
s = max === 0 ? 0 : d / max;
|
|
3974
|
+
if (max == min) {
|
|
3975
|
+
h = 0; // achromatic
|
|
3976
|
+
} else {
|
|
3977
|
+
switch (max) {
|
|
3978
|
+
case r:
|
|
3979
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
3980
|
+
break;
|
|
3981
|
+
case g:
|
|
3982
|
+
h = (b - r) / d + 2;
|
|
3983
|
+
break;
|
|
3984
|
+
case b:
|
|
3985
|
+
h = (r - g) / d + 4;
|
|
3986
|
+
break;
|
|
3987
|
+
}
|
|
3988
|
+
h /= 6;
|
|
3989
|
+
}
|
|
3990
|
+
return {
|
|
3991
|
+
h: h,
|
|
3992
|
+
s: s,
|
|
3993
|
+
v: v
|
|
3994
|
+
};
|
|
3995
|
+
}
|
|
3996
|
+
|
|
3997
|
+
// `hsvToRgb`
|
|
3998
|
+
// Converts an HSV color value to RGB.
|
|
3999
|
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
|
|
4000
|
+
// *Returns:* { r, g, b } in the set [0, 255]
|
|
4001
|
+
function hsvToRgb(h, s, v) {
|
|
4002
|
+
h = bound01(h, 360) * 6;
|
|
4003
|
+
s = bound01(s, 100);
|
|
4004
|
+
v = bound01(v, 100);
|
|
4005
|
+
var i = Math.floor(h),
|
|
4006
|
+
f = h - i,
|
|
4007
|
+
p = v * (1 - s),
|
|
4008
|
+
q = v * (1 - f * s),
|
|
4009
|
+
t = v * (1 - (1 - f) * s),
|
|
4010
|
+
mod = i % 6,
|
|
4011
|
+
r = [v, q, p, p, t, v][mod],
|
|
4012
|
+
g = [t, v, v, q, p, p][mod],
|
|
4013
|
+
b = [p, p, t, v, v, q][mod];
|
|
4014
|
+
return {
|
|
4015
|
+
r: r * 255,
|
|
4016
|
+
g: g * 255,
|
|
4017
|
+
b: b * 255
|
|
4018
|
+
};
|
|
4019
|
+
}
|
|
4020
|
+
|
|
4021
|
+
// `rgbToHex`
|
|
4022
|
+
// Converts an RGB color to hex
|
|
4023
|
+
// Assumes r, g, and b are contained in the set [0, 255]
|
|
4024
|
+
// Returns a 3 or 6 character hex
|
|
4025
|
+
function rgbToHex(r, g, b, allow3Char) {
|
|
4026
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
4027
|
+
|
|
4028
|
+
// Return a 3 character hex if possible
|
|
4029
|
+
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)) {
|
|
4030
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
|
4031
|
+
}
|
|
4032
|
+
return hex.join("");
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
// `rgbaToHex`
|
|
4036
|
+
// Converts an RGBA color plus alpha transparency to hex
|
|
4037
|
+
// Assumes r, g, b are contained in the set [0, 255] and
|
|
4038
|
+
// a in [0, 1]. Returns a 4 or 8 character rgba hex
|
|
4039
|
+
function rgbaToHex(r, g, b, a, allow4Char) {
|
|
4040
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
|
|
4041
|
+
|
|
4042
|
+
// Return a 4 character hex if possible
|
|
4043
|
+
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)) {
|
|
4044
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
|
4045
|
+
}
|
|
4046
|
+
return hex.join("");
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
// `rgbaToArgbHex`
|
|
4050
|
+
// Converts an RGBA color to an ARGB Hex8 string
|
|
4051
|
+
// Rarely used, but required for "toFilter()"
|
|
4052
|
+
function rgbaToArgbHex(r, g, b, a) {
|
|
4053
|
+
var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
4054
|
+
return hex.join("");
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
// `equals`
|
|
4058
|
+
// Can be called with any tinycolor input
|
|
4059
|
+
tinycolor.equals = function (color1, color2) {
|
|
4060
|
+
if (!color1 || !color2) return false;
|
|
4061
|
+
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
|
|
4062
|
+
};
|
|
4063
|
+
tinycolor.random = function () {
|
|
4064
|
+
return tinycolor.fromRatio({
|
|
4065
|
+
r: Math.random(),
|
|
4066
|
+
g: Math.random(),
|
|
4067
|
+
b: Math.random()
|
|
4068
|
+
});
|
|
4069
|
+
};
|
|
4070
|
+
|
|
4071
|
+
// Modification Functions
|
|
4072
|
+
// ----------------------
|
|
4073
|
+
// Thanks to less.js for some of the basics here
|
|
4074
|
+
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
|
|
4075
|
+
|
|
4076
|
+
function _desaturate(color, amount) {
|
|
4077
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
4078
|
+
var hsl = tinycolor(color).toHsl();
|
|
4079
|
+
hsl.s -= amount / 100;
|
|
4080
|
+
hsl.s = clamp01(hsl.s);
|
|
4081
|
+
return tinycolor(hsl);
|
|
4082
|
+
}
|
|
4083
|
+
function _saturate(color, amount) {
|
|
4084
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
4085
|
+
var hsl = tinycolor(color).toHsl();
|
|
4086
|
+
hsl.s += amount / 100;
|
|
4087
|
+
hsl.s = clamp01(hsl.s);
|
|
4088
|
+
return tinycolor(hsl);
|
|
4089
|
+
}
|
|
4090
|
+
function _greyscale(color) {
|
|
4091
|
+
return tinycolor(color).desaturate(100);
|
|
4092
|
+
}
|
|
4093
|
+
function _lighten(color, amount) {
|
|
4094
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
4095
|
+
var hsl = tinycolor(color).toHsl();
|
|
4096
|
+
hsl.l += amount / 100;
|
|
4097
|
+
hsl.l = clamp01(hsl.l);
|
|
4098
|
+
return tinycolor(hsl);
|
|
4099
|
+
}
|
|
4100
|
+
function _brighten(color, amount) {
|
|
4101
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
4102
|
+
var rgb = tinycolor(color).toRgb();
|
|
4103
|
+
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
|
|
4104
|
+
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
|
|
4105
|
+
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
|
|
4106
|
+
return tinycolor(rgb);
|
|
4107
|
+
}
|
|
4108
|
+
function _darken(color, amount) {
|
|
4109
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
4110
|
+
var hsl = tinycolor(color).toHsl();
|
|
4111
|
+
hsl.l -= amount / 100;
|
|
4112
|
+
hsl.l = clamp01(hsl.l);
|
|
4113
|
+
return tinycolor(hsl);
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
|
4117
|
+
// Values outside of this range will be wrapped into this range.
|
|
4118
|
+
function _spin(color, amount) {
|
|
4119
|
+
var hsl = tinycolor(color).toHsl();
|
|
4120
|
+
var hue = (hsl.h + amount) % 360;
|
|
4121
|
+
hsl.h = hue < 0 ? 360 + hue : hue;
|
|
4122
|
+
return tinycolor(hsl);
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
// Combination Functions
|
|
4126
|
+
// ---------------------
|
|
4127
|
+
// Thanks to jQuery xColor for some of the ideas behind these
|
|
4128
|
+
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
|
|
4129
|
+
|
|
4130
|
+
function _complement(color) {
|
|
4131
|
+
var hsl = tinycolor(color).toHsl();
|
|
4132
|
+
hsl.h = (hsl.h + 180) % 360;
|
|
4133
|
+
return tinycolor(hsl);
|
|
4134
|
+
}
|
|
4135
|
+
function polyad(color, number) {
|
|
4136
|
+
if (isNaN(number) || number <= 0) {
|
|
4137
|
+
throw new Error("Argument to polyad must be a positive number");
|
|
4138
|
+
}
|
|
4139
|
+
var hsl = tinycolor(color).toHsl();
|
|
4140
|
+
var result = [tinycolor(color)];
|
|
4141
|
+
var step = 360 / number;
|
|
4142
|
+
for (var i = 1; i < number; i++) {
|
|
4143
|
+
result.push(tinycolor({
|
|
4144
|
+
h: (hsl.h + i * step) % 360,
|
|
4145
|
+
s: hsl.s,
|
|
4146
|
+
l: hsl.l
|
|
4147
|
+
}));
|
|
4148
|
+
}
|
|
4149
|
+
return result;
|
|
4150
|
+
}
|
|
4151
|
+
function _splitcomplement(color) {
|
|
4152
|
+
var hsl = tinycolor(color).toHsl();
|
|
4153
|
+
var h = hsl.h;
|
|
4154
|
+
return [tinycolor(color), tinycolor({
|
|
4155
|
+
h: (h + 72) % 360,
|
|
4156
|
+
s: hsl.s,
|
|
4157
|
+
l: hsl.l
|
|
4158
|
+
}), tinycolor({
|
|
4159
|
+
h: (h + 216) % 360,
|
|
4160
|
+
s: hsl.s,
|
|
4161
|
+
l: hsl.l
|
|
4162
|
+
})];
|
|
4163
|
+
}
|
|
4164
|
+
function _analogous(color, results, slices) {
|
|
4165
|
+
results = results || 6;
|
|
4166
|
+
slices = slices || 30;
|
|
4167
|
+
var hsl = tinycolor(color).toHsl();
|
|
4168
|
+
var part = 360 / slices;
|
|
4169
|
+
var ret = [tinycolor(color)];
|
|
4170
|
+
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
|
|
4171
|
+
hsl.h = (hsl.h + part) % 360;
|
|
4172
|
+
ret.push(tinycolor(hsl));
|
|
4173
|
+
}
|
|
4174
|
+
return ret;
|
|
4175
|
+
}
|
|
4176
|
+
function _monochromatic(color, results) {
|
|
4177
|
+
results = results || 6;
|
|
4178
|
+
var hsv = tinycolor(color).toHsv();
|
|
4179
|
+
var h = hsv.h,
|
|
4180
|
+
s = hsv.s,
|
|
4181
|
+
v = hsv.v;
|
|
4182
|
+
var ret = [];
|
|
4183
|
+
var modification = 1 / results;
|
|
4184
|
+
while (results--) {
|
|
4185
|
+
ret.push(tinycolor({
|
|
4186
|
+
h: h,
|
|
4187
|
+
s: s,
|
|
4188
|
+
v: v
|
|
4189
|
+
}));
|
|
4190
|
+
v = (v + modification) % 1;
|
|
4191
|
+
}
|
|
4192
|
+
return ret;
|
|
4193
|
+
}
|
|
4194
|
+
|
|
4195
|
+
// Utility Functions
|
|
4196
|
+
// ---------------------
|
|
4197
|
+
|
|
4198
|
+
tinycolor.mix = function (color1, color2, amount) {
|
|
4199
|
+
amount = amount === 0 ? 0 : amount || 50;
|
|
4200
|
+
var rgb1 = tinycolor(color1).toRgb();
|
|
4201
|
+
var rgb2 = tinycolor(color2).toRgb();
|
|
4202
|
+
var p = amount / 100;
|
|
4203
|
+
var rgba = {
|
|
4204
|
+
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
4205
|
+
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
4206
|
+
b: (rgb2.b - rgb1.b) * p + rgb1.b,
|
|
4207
|
+
a: (rgb2.a - rgb1.a) * p + rgb1.a
|
|
4208
|
+
};
|
|
4209
|
+
return tinycolor(rgba);
|
|
4210
|
+
};
|
|
4211
|
+
|
|
4212
|
+
// Readability Functions
|
|
4213
|
+
// ---------------------
|
|
4214
|
+
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
|
|
4215
|
+
|
|
4216
|
+
// `contrast`
|
|
4217
|
+
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
|
|
4218
|
+
tinycolor.readability = function (color1, color2) {
|
|
4219
|
+
var c1 = tinycolor(color1);
|
|
4220
|
+
var c2 = tinycolor(color2);
|
|
4221
|
+
return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
|
|
4222
|
+
};
|
|
4223
|
+
|
|
4224
|
+
// `isReadable`
|
|
4225
|
+
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
|
|
4226
|
+
// The third argument is an optional Object.
|
|
4227
|
+
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
|
|
4228
|
+
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
|
|
4229
|
+
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
|
|
4230
|
+
|
|
4231
|
+
// *Example*
|
|
4232
|
+
// tinycolor.isReadable("#000", "#111") => false
|
|
4233
|
+
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
|
|
4234
|
+
tinycolor.isReadable = function (color1, color2, wcag2) {
|
|
4235
|
+
var readability = tinycolor.readability(color1, color2);
|
|
4236
|
+
var wcag2Parms, out;
|
|
4237
|
+
out = false;
|
|
4238
|
+
wcag2Parms = validateWCAG2Parms(wcag2);
|
|
4239
|
+
switch (wcag2Parms.level + wcag2Parms.size) {
|
|
4240
|
+
case "AAsmall":
|
|
4241
|
+
case "AAAlarge":
|
|
4242
|
+
out = readability >= 4.5;
|
|
4243
|
+
break;
|
|
4244
|
+
case "AAlarge":
|
|
4245
|
+
out = readability >= 3;
|
|
4246
|
+
break;
|
|
4247
|
+
case "AAAsmall":
|
|
4248
|
+
out = readability >= 7;
|
|
4249
|
+
break;
|
|
4250
|
+
}
|
|
4251
|
+
return out;
|
|
4252
|
+
};
|
|
4253
|
+
|
|
4254
|
+
// `mostReadable`
|
|
4255
|
+
// Given a base color and a list of possible foreground or background
|
|
4256
|
+
// colors for that base, returns the most readable color.
|
|
4257
|
+
// Optionally returns Black or White if the most readable color is unreadable.
|
|
4258
|
+
// *Example*
|
|
4259
|
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
|
|
4260
|
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
|
|
4261
|
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
|
|
4262
|
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
|
|
4263
|
+
tinycolor.mostReadable = function (baseColor, colorList, args) {
|
|
4264
|
+
var bestColor = null;
|
|
4265
|
+
var bestScore = 0;
|
|
4266
|
+
var readability;
|
|
4267
|
+
var includeFallbackColors, level, size;
|
|
4268
|
+
args = args || {};
|
|
4269
|
+
includeFallbackColors = args.includeFallbackColors;
|
|
4270
|
+
level = args.level;
|
|
4271
|
+
size = args.size;
|
|
4272
|
+
for (var i = 0; i < colorList.length; i++) {
|
|
4273
|
+
readability = tinycolor.readability(baseColor, colorList[i]);
|
|
4274
|
+
if (readability > bestScore) {
|
|
4275
|
+
bestScore = readability;
|
|
4276
|
+
bestColor = tinycolor(colorList[i]);
|
|
4277
|
+
}
|
|
4278
|
+
}
|
|
4279
|
+
if (tinycolor.isReadable(baseColor, bestColor, {
|
|
4280
|
+
level: level,
|
|
4281
|
+
size: size
|
|
4282
|
+
}) || !includeFallbackColors) {
|
|
4283
|
+
return bestColor;
|
|
4284
|
+
} else {
|
|
4285
|
+
args.includeFallbackColors = false;
|
|
4286
|
+
return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
|
|
4287
|
+
}
|
|
4288
|
+
};
|
|
4289
|
+
|
|
4290
|
+
// Big List of Colors
|
|
4291
|
+
// ------------------
|
|
4292
|
+
// <https://www.w3.org/TR/css-color-4/#named-colors>
|
|
4293
|
+
var names = tinycolor.names = {
|
|
4294
|
+
aliceblue: "f0f8ff",
|
|
4295
|
+
antiquewhite: "faebd7",
|
|
4296
|
+
aqua: "0ff",
|
|
4297
|
+
aquamarine: "7fffd4",
|
|
4298
|
+
azure: "f0ffff",
|
|
4299
|
+
beige: "f5f5dc",
|
|
4300
|
+
bisque: "ffe4c4",
|
|
4301
|
+
black: "000",
|
|
4302
|
+
blanchedalmond: "ffebcd",
|
|
4303
|
+
blue: "00f",
|
|
4304
|
+
blueviolet: "8a2be2",
|
|
4305
|
+
brown: "a52a2a",
|
|
4306
|
+
burlywood: "deb887",
|
|
4307
|
+
burntsienna: "ea7e5d",
|
|
4308
|
+
cadetblue: "5f9ea0",
|
|
4309
|
+
chartreuse: "7fff00",
|
|
4310
|
+
chocolate: "d2691e",
|
|
4311
|
+
coral: "ff7f50",
|
|
4312
|
+
cornflowerblue: "6495ed",
|
|
4313
|
+
cornsilk: "fff8dc",
|
|
4314
|
+
crimson: "dc143c",
|
|
4315
|
+
cyan: "0ff",
|
|
4316
|
+
darkblue: "00008b",
|
|
4317
|
+
darkcyan: "008b8b",
|
|
4318
|
+
darkgoldenrod: "b8860b",
|
|
4319
|
+
darkgray: "a9a9a9",
|
|
4320
|
+
darkgreen: "006400",
|
|
4321
|
+
darkgrey: "a9a9a9",
|
|
4322
|
+
darkkhaki: "bdb76b",
|
|
4323
|
+
darkmagenta: "8b008b",
|
|
4324
|
+
darkolivegreen: "556b2f",
|
|
4325
|
+
darkorange: "ff8c00",
|
|
4326
|
+
darkorchid: "9932cc",
|
|
4327
|
+
darkred: "8b0000",
|
|
4328
|
+
darksalmon: "e9967a",
|
|
4329
|
+
darkseagreen: "8fbc8f",
|
|
4330
|
+
darkslateblue: "483d8b",
|
|
4331
|
+
darkslategray: "2f4f4f",
|
|
4332
|
+
darkslategrey: "2f4f4f",
|
|
4333
|
+
darkturquoise: "00ced1",
|
|
4334
|
+
darkviolet: "9400d3",
|
|
4335
|
+
deeppink: "ff1493",
|
|
4336
|
+
deepskyblue: "00bfff",
|
|
4337
|
+
dimgray: "696969",
|
|
4338
|
+
dimgrey: "696969",
|
|
4339
|
+
dodgerblue: "1e90ff",
|
|
4340
|
+
firebrick: "b22222",
|
|
4341
|
+
floralwhite: "fffaf0",
|
|
4342
|
+
forestgreen: "228b22",
|
|
4343
|
+
fuchsia: "f0f",
|
|
4344
|
+
gainsboro: "dcdcdc",
|
|
4345
|
+
ghostwhite: "f8f8ff",
|
|
4346
|
+
gold: "ffd700",
|
|
4347
|
+
goldenrod: "daa520",
|
|
4348
|
+
gray: "808080",
|
|
4349
|
+
green: "008000",
|
|
4350
|
+
greenyellow: "adff2f",
|
|
4351
|
+
grey: "808080",
|
|
4352
|
+
honeydew: "f0fff0",
|
|
4353
|
+
hotpink: "ff69b4",
|
|
4354
|
+
indianred: "cd5c5c",
|
|
4355
|
+
indigo: "4b0082",
|
|
4356
|
+
ivory: "fffff0",
|
|
4357
|
+
khaki: "f0e68c",
|
|
4358
|
+
lavender: "e6e6fa",
|
|
4359
|
+
lavenderblush: "fff0f5",
|
|
4360
|
+
lawngreen: "7cfc00",
|
|
4361
|
+
lemonchiffon: "fffacd",
|
|
4362
|
+
lightblue: "add8e6",
|
|
4363
|
+
lightcoral: "f08080",
|
|
4364
|
+
lightcyan: "e0ffff",
|
|
4365
|
+
lightgoldenrodyellow: "fafad2",
|
|
4366
|
+
lightgray: "d3d3d3",
|
|
4367
|
+
lightgreen: "90ee90",
|
|
4368
|
+
lightgrey: "d3d3d3",
|
|
4369
|
+
lightpink: "ffb6c1",
|
|
4370
|
+
lightsalmon: "ffa07a",
|
|
4371
|
+
lightseagreen: "20b2aa",
|
|
4372
|
+
lightskyblue: "87cefa",
|
|
4373
|
+
lightslategray: "789",
|
|
4374
|
+
lightslategrey: "789",
|
|
4375
|
+
lightsteelblue: "b0c4de",
|
|
4376
|
+
lightyellow: "ffffe0",
|
|
4377
|
+
lime: "0f0",
|
|
4378
|
+
limegreen: "32cd32",
|
|
4379
|
+
linen: "faf0e6",
|
|
4380
|
+
magenta: "f0f",
|
|
4381
|
+
maroon: "800000",
|
|
4382
|
+
mediumaquamarine: "66cdaa",
|
|
4383
|
+
mediumblue: "0000cd",
|
|
4384
|
+
mediumorchid: "ba55d3",
|
|
4385
|
+
mediumpurple: "9370db",
|
|
4386
|
+
mediumseagreen: "3cb371",
|
|
4387
|
+
mediumslateblue: "7b68ee",
|
|
4388
|
+
mediumspringgreen: "00fa9a",
|
|
4389
|
+
mediumturquoise: "48d1cc",
|
|
4390
|
+
mediumvioletred: "c71585",
|
|
4391
|
+
midnightblue: "191970",
|
|
4392
|
+
mintcream: "f5fffa",
|
|
4393
|
+
mistyrose: "ffe4e1",
|
|
4394
|
+
moccasin: "ffe4b5",
|
|
4395
|
+
navajowhite: "ffdead",
|
|
4396
|
+
navy: "000080",
|
|
4397
|
+
oldlace: "fdf5e6",
|
|
4398
|
+
olive: "808000",
|
|
4399
|
+
olivedrab: "6b8e23",
|
|
4400
|
+
orange: "ffa500",
|
|
4401
|
+
orangered: "ff4500",
|
|
4402
|
+
orchid: "da70d6",
|
|
4403
|
+
palegoldenrod: "eee8aa",
|
|
4404
|
+
palegreen: "98fb98",
|
|
4405
|
+
paleturquoise: "afeeee",
|
|
4406
|
+
palevioletred: "db7093",
|
|
4407
|
+
papayawhip: "ffefd5",
|
|
4408
|
+
peachpuff: "ffdab9",
|
|
4409
|
+
peru: "cd853f",
|
|
4410
|
+
pink: "ffc0cb",
|
|
4411
|
+
plum: "dda0dd",
|
|
4412
|
+
powderblue: "b0e0e6",
|
|
4413
|
+
purple: "800080",
|
|
4414
|
+
rebeccapurple: "663399",
|
|
4415
|
+
red: "f00",
|
|
4416
|
+
rosybrown: "bc8f8f",
|
|
4417
|
+
royalblue: "4169e1",
|
|
4418
|
+
saddlebrown: "8b4513",
|
|
4419
|
+
salmon: "fa8072",
|
|
4420
|
+
sandybrown: "f4a460",
|
|
4421
|
+
seagreen: "2e8b57",
|
|
4422
|
+
seashell: "fff5ee",
|
|
4423
|
+
sienna: "a0522d",
|
|
4424
|
+
silver: "c0c0c0",
|
|
4425
|
+
skyblue: "87ceeb",
|
|
4426
|
+
slateblue: "6a5acd",
|
|
4427
|
+
slategray: "708090",
|
|
4428
|
+
slategrey: "708090",
|
|
4429
|
+
snow: "fffafa",
|
|
4430
|
+
springgreen: "00ff7f",
|
|
4431
|
+
steelblue: "4682b4",
|
|
4432
|
+
tan: "d2b48c",
|
|
4433
|
+
teal: "008080",
|
|
4434
|
+
thistle: "d8bfd8",
|
|
4435
|
+
tomato: "ff6347",
|
|
4436
|
+
turquoise: "40e0d0",
|
|
4437
|
+
violet: "ee82ee",
|
|
4438
|
+
wheat: "f5deb3",
|
|
4439
|
+
white: "fff",
|
|
4440
|
+
whitesmoke: "f5f5f5",
|
|
4441
|
+
yellow: "ff0",
|
|
4442
|
+
yellowgreen: "9acd32"
|
|
4443
|
+
};
|
|
4444
|
+
|
|
4445
|
+
// Make it easy to access colors via `hexNames[hex]`
|
|
4446
|
+
var hexNames = tinycolor.hexNames = flip(names);
|
|
4447
|
+
|
|
4448
|
+
// Utilities
|
|
4449
|
+
// ---------
|
|
4450
|
+
|
|
4451
|
+
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
|
|
4452
|
+
function flip(o) {
|
|
4453
|
+
var flipped = {};
|
|
4454
|
+
for (var i in o) {
|
|
4455
|
+
if (o.hasOwnProperty(i)) {
|
|
4456
|
+
flipped[o[i]] = i;
|
|
4457
|
+
}
|
|
4458
|
+
}
|
|
4459
|
+
return flipped;
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4462
|
+
// Return a valid alpha value [0,1] with all invalid values being set to 1
|
|
4463
|
+
function boundAlpha(a) {
|
|
4464
|
+
a = parseFloat(a);
|
|
4465
|
+
if (isNaN(a) || a < 0 || a > 1) {
|
|
4466
|
+
a = 1;
|
|
4467
|
+
}
|
|
4468
|
+
return a;
|
|
4469
|
+
}
|
|
4470
|
+
|
|
4471
|
+
// Take input from [0, n] and return it as [0, 1]
|
|
4472
|
+
function bound01(n, max) {
|
|
4473
|
+
if (isOnePointZero(n)) n = "100%";
|
|
4474
|
+
var processPercent = isPercentage(n);
|
|
4475
|
+
n = Math.min(max, Math.max(0, parseFloat(n)));
|
|
4476
|
+
|
|
4477
|
+
// Automatically convert percentage into number
|
|
4478
|
+
if (processPercent) {
|
|
4479
|
+
n = parseInt(n * max, 10) / 100;
|
|
4480
|
+
}
|
|
4481
|
+
|
|
4482
|
+
// Handle floating point rounding errors
|
|
4483
|
+
if (Math.abs(n - max) < 0.000001) {
|
|
4484
|
+
return 1;
|
|
4485
|
+
}
|
|
4486
|
+
|
|
4487
|
+
// Convert into [0, 1] range if it isn't already
|
|
4488
|
+
return n % max / parseFloat(max);
|
|
4489
|
+
}
|
|
4490
|
+
|
|
4491
|
+
// Force a number between 0 and 1
|
|
4492
|
+
function clamp01(val) {
|
|
4493
|
+
return Math.min(1, Math.max(0, val));
|
|
4494
|
+
}
|
|
4495
|
+
|
|
4496
|
+
// Parse a base-16 hex value into a base-10 integer
|
|
4497
|
+
function parseIntFromHex(val) {
|
|
4498
|
+
return parseInt(val, 16);
|
|
4499
|
+
}
|
|
4500
|
+
|
|
4501
|
+
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
|
|
4502
|
+
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
|
|
4503
|
+
function isOnePointZero(n) {
|
|
4504
|
+
return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
|
|
4505
|
+
}
|
|
4506
|
+
|
|
4507
|
+
// Check to see if string passed in is a percentage
|
|
4508
|
+
function isPercentage(n) {
|
|
4509
|
+
return typeof n === "string" && n.indexOf("%") != -1;
|
|
4510
|
+
}
|
|
4511
|
+
|
|
4512
|
+
// Force a hex value to have 2 characters
|
|
4513
|
+
function pad2(c) {
|
|
4514
|
+
return c.length == 1 ? "0" + c : "" + c;
|
|
4515
|
+
}
|
|
4516
|
+
|
|
4517
|
+
// Replace a decimal with it's percentage value
|
|
4518
|
+
function convertToPercentage(n) {
|
|
4519
|
+
if (n <= 1) {
|
|
4520
|
+
n = n * 100 + "%";
|
|
4521
|
+
}
|
|
4522
|
+
return n;
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4525
|
+
// Converts a decimal to a hex value
|
|
4526
|
+
function convertDecimalToHex(d) {
|
|
4527
|
+
return Math.round(parseFloat(d) * 255).toString(16);
|
|
4528
|
+
}
|
|
4529
|
+
// Converts a hex value to a decimal
|
|
4530
|
+
function convertHexToDecimal(h) {
|
|
4531
|
+
return parseIntFromHex(h) / 255;
|
|
4532
|
+
}
|
|
4533
|
+
var matchers = function () {
|
|
4534
|
+
// <http://www.w3.org/TR/css3-values/#integers>
|
|
4535
|
+
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
4536
|
+
|
|
4537
|
+
// <http://www.w3.org/TR/css3-values/#number-value>
|
|
4538
|
+
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
4539
|
+
|
|
4540
|
+
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
|
|
4541
|
+
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
|
|
4542
|
+
|
|
4543
|
+
// Actual matching.
|
|
4544
|
+
// Parentheses and commas are optional, but not required.
|
|
4545
|
+
// Whitespace can take the place of commas or opening paren
|
|
4546
|
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
4547
|
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
4548
|
+
return {
|
|
4549
|
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
4550
|
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
4551
|
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
4552
|
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
|
4553
|
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
4554
|
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
4555
|
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
4556
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
4557
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
4558
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
4559
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
4560
|
+
};
|
|
4561
|
+
}();
|
|
4562
|
+
|
|
4563
|
+
// `isValidCSSUnit`
|
|
4564
|
+
// Take in a single string / number and check to see if it looks like a CSS unit
|
|
4565
|
+
// (see `matchers` above for definition).
|
|
4566
|
+
function isValidCSSUnit(color) {
|
|
4567
|
+
return !!matchers.CSS_UNIT.exec(color);
|
|
4568
|
+
}
|
|
4569
|
+
|
|
4570
|
+
// `stringInputToObject`
|
|
4571
|
+
// Permissive string parsing. Take in a number of formats, and output an object
|
|
4572
|
+
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
|
4573
|
+
function stringInputToObject(color) {
|
|
4574
|
+
color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
|
|
4575
|
+
var named = false;
|
|
4576
|
+
if (names[color]) {
|
|
4577
|
+
color = names[color];
|
|
4578
|
+
named = true;
|
|
4579
|
+
} else if (color == "transparent") {
|
|
4580
|
+
return {
|
|
4581
|
+
r: 0,
|
|
4582
|
+
g: 0,
|
|
4583
|
+
b: 0,
|
|
4584
|
+
a: 0,
|
|
4585
|
+
format: "name"
|
|
4586
|
+
};
|
|
4587
|
+
}
|
|
4588
|
+
|
|
4589
|
+
// Try to match string input using regular expressions.
|
|
4590
|
+
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
|
|
4591
|
+
// Just return an object and let the conversion functions handle that.
|
|
4592
|
+
// This way the result will be the same whether the tinycolor is initialized with string or object.
|
|
4593
|
+
var match;
|
|
4594
|
+
if (match = matchers.rgb.exec(color)) {
|
|
4595
|
+
return {
|
|
4596
|
+
r: match[1],
|
|
4597
|
+
g: match[2],
|
|
4598
|
+
b: match[3]
|
|
4599
|
+
};
|
|
4600
|
+
}
|
|
4601
|
+
if (match = matchers.rgba.exec(color)) {
|
|
4602
|
+
return {
|
|
4603
|
+
r: match[1],
|
|
4604
|
+
g: match[2],
|
|
4605
|
+
b: match[3],
|
|
4606
|
+
a: match[4]
|
|
4607
|
+
};
|
|
4608
|
+
}
|
|
4609
|
+
if (match = matchers.hsl.exec(color)) {
|
|
4610
|
+
return {
|
|
4611
|
+
h: match[1],
|
|
4612
|
+
s: match[2],
|
|
4613
|
+
l: match[3]
|
|
4614
|
+
};
|
|
4615
|
+
}
|
|
4616
|
+
if (match = matchers.hsla.exec(color)) {
|
|
4617
|
+
return {
|
|
4618
|
+
h: match[1],
|
|
4619
|
+
s: match[2],
|
|
4620
|
+
l: match[3],
|
|
4621
|
+
a: match[4]
|
|
4622
|
+
};
|
|
4623
|
+
}
|
|
4624
|
+
if (match = matchers.hsv.exec(color)) {
|
|
4625
|
+
return {
|
|
4626
|
+
h: match[1],
|
|
4627
|
+
s: match[2],
|
|
4628
|
+
v: match[3]
|
|
4629
|
+
};
|
|
4630
|
+
}
|
|
4631
|
+
if (match = matchers.hsva.exec(color)) {
|
|
4632
|
+
return {
|
|
4633
|
+
h: match[1],
|
|
4634
|
+
s: match[2],
|
|
4635
|
+
v: match[3],
|
|
4636
|
+
a: match[4]
|
|
4637
|
+
};
|
|
4638
|
+
}
|
|
4639
|
+
if (match = matchers.hex8.exec(color)) {
|
|
4640
|
+
return {
|
|
4641
|
+
r: parseIntFromHex(match[1]),
|
|
4642
|
+
g: parseIntFromHex(match[2]),
|
|
4643
|
+
b: parseIntFromHex(match[3]),
|
|
4644
|
+
a: convertHexToDecimal(match[4]),
|
|
4645
|
+
format: named ? "name" : "hex8"
|
|
4646
|
+
};
|
|
4647
|
+
}
|
|
4648
|
+
if (match = matchers.hex6.exec(color)) {
|
|
4649
|
+
return {
|
|
4650
|
+
r: parseIntFromHex(match[1]),
|
|
4651
|
+
g: parseIntFromHex(match[2]),
|
|
4652
|
+
b: parseIntFromHex(match[3]),
|
|
4653
|
+
format: named ? "name" : "hex"
|
|
4654
|
+
};
|
|
4655
|
+
}
|
|
4656
|
+
if (match = matchers.hex4.exec(color)) {
|
|
4657
|
+
return {
|
|
4658
|
+
r: parseIntFromHex(match[1] + "" + match[1]),
|
|
4659
|
+
g: parseIntFromHex(match[2] + "" + match[2]),
|
|
4660
|
+
b: parseIntFromHex(match[3] + "" + match[3]),
|
|
4661
|
+
a: convertHexToDecimal(match[4] + "" + match[4]),
|
|
4662
|
+
format: named ? "name" : "hex8"
|
|
4663
|
+
};
|
|
4664
|
+
}
|
|
4665
|
+
if (match = matchers.hex3.exec(color)) {
|
|
4666
|
+
return {
|
|
4667
|
+
r: parseIntFromHex(match[1] + "" + match[1]),
|
|
4668
|
+
g: parseIntFromHex(match[2] + "" + match[2]),
|
|
4669
|
+
b: parseIntFromHex(match[3] + "" + match[3]),
|
|
4670
|
+
format: named ? "name" : "hex"
|
|
4671
|
+
};
|
|
4672
|
+
}
|
|
4673
|
+
return false;
|
|
4674
|
+
}
|
|
4675
|
+
function validateWCAG2Parms(parms) {
|
|
4676
|
+
// return valid WCAG2 parms for isReadable.
|
|
4677
|
+
// If input parms are invalid, return {"level":"AA", "size":"small"}
|
|
4678
|
+
var level, size;
|
|
4679
|
+
parms = parms || {
|
|
4680
|
+
level: "AA",
|
|
4681
|
+
size: "small"
|
|
4682
|
+
};
|
|
4683
|
+
level = (parms.level || "AA").toUpperCase();
|
|
4684
|
+
size = (parms.size || "small").toLowerCase();
|
|
4685
|
+
if (level !== "AA" && level !== "AAA") {
|
|
4686
|
+
level = "AA";
|
|
4687
|
+
}
|
|
4688
|
+
if (size !== "small" && size !== "large") {
|
|
4689
|
+
size = "small";
|
|
4690
|
+
}
|
|
4691
|
+
return {
|
|
4692
|
+
level: level,
|
|
4693
|
+
size: size
|
|
4694
|
+
};
|
|
4695
|
+
}
|
|
4696
|
+
|
|
4697
|
+
var WCAG2ContrastOptions={level:'AAA',size:'large'};var getColorWithOpacity=function getColorWithOpacity(color,opacity){return tinycolor(color).setAlpha(opacity).toHslString();};var generateChromaticBrandColors=function generateChromaticBrandColors(baseColorInput){var baseColor=tinycolor(baseColorInput);var baseColorHslString=baseColor.toHslString();if(__DEV__){if(!baseColor.isValid()){throwBladeError({message:'Invalid brandColor passed',moduleName:'createTheme'});}}var palette=[baseColorHslString];var brightness=tinycolor(baseColor).getBrightness();var lightnessFactor=brightness>150?3:6;var darknessFactor=brightness<50?3:5;var currentColor=baseColor;for(var lightShadeIndex=0;lightShadeIndex<6;lightShadeIndex++){currentColor=currentColor.brighten(lightnessFactor);palette.push(currentColor.toHslString());}currentColor=tinycolor(baseColorHslString);for(var darkShadeIndex=0;darkShadeIndex<4;darkShadeIndex++){currentColor=currentColor.darken(darknessFactor);palette.unshift(currentColor.toHslString());}var colorPalette=palette.reverse();var brandPrimaryColor=colorPalette[6];var brandColors={'50':colorPalette[0],'100':colorPalette[1],'200':colorPalette[2],'300':colorPalette[3],'400':colorPalette[4],'500':colorPalette[5],'600':brandPrimaryColor,'700':colorPalette[7],'800':colorPalette[8],'900':colorPalette[9],'950':colorPalette[10],a00:getColorWithOpacity(brandPrimaryColor,opacity[0]),a50:getColorWithOpacity(brandPrimaryColor,opacity[1]),a100:getColorWithOpacity(brandPrimaryColor,opacity[2]),a200:getColorWithOpacity(brandPrimaryColor,opacity[3])};return brandColors;};var getOnLightOverrides=function getOnLightOverrides(brandColors){var foregroundOnBrandColorLight=tinycolor.mostReadable(brandColors[800],[colors$2.neutral.blueGrayLight[1300],colors$2.neutral.blueGrayLight[0]],WCAG2ContrastOptions).toHslString();var foregroundOnSurfaceLight=tinycolor.isReadable(colors$2.neutral.blueGrayLight[50],brandColors[600],WCAG2ContrastOptions)?brandColors[600]:colors$2.neutral.blueGrayLight[1100];var lightThemeOverrides={colors:{onLight:{brand:{primary:{300:brandColors.a50,400:brandColors.a100,500:brandColors[600],600:brandColors[700],700:brandColors[800],800:brandColors[950]},gray:{200:{lowContrast:foregroundOnBrandColorLight}}},action:{background:{primary:{default:brandColors[600],hover:brandColors[700],focus:brandColors[800],active:brandColors[900]},secondary:{default:brandColors.a00,hover:brandColors.a50,focus:brandColors.a100,active:brandColors.a200},tertiary:{default:colors$2.neutral.blueGrayLight[0],hover:colors$2.neutral.blueGrayLight[50],focus:colors$2.neutral.blueGrayLight[100],active:colors$2.neutral.blueGrayLight[200]}},border:{primary:{default:brandColors[600],hover:brandColors[700],focus:brandColors[800],active:brandColors[900]},secondary:{default:brandColors[600],hover:brandColors[600],focus:brandColors[600],active:brandColors[600]},tertiary:{default:colors$2.neutral.blueGrayLight[300],hover:colors$2.neutral.blueGrayLight[300],focus:colors$2.neutral.blueGrayLight[300],active:colors$2.neutral.blueGrayLight[300]}},text:{primary:{default:foregroundOnBrandColorLight,hover:foregroundOnBrandColorLight,focus:foregroundOnBrandColorLight,active:foregroundOnBrandColorLight},secondary:{default:foregroundOnSurfaceLight,hover:foregroundOnSurfaceLight,focus:foregroundOnSurfaceLight,active:foregroundOnSurfaceLight}},icon:{primary:{default:foregroundOnBrandColorLight,hover:foregroundOnBrandColorLight,focus:foregroundOnBrandColorLight,active:foregroundOnBrandColorLight},secondary:{default:foregroundOnSurfaceLight,hover:foregroundOnSurfaceLight,focus:foregroundOnSurfaceLight,active:foregroundOnSurfaceLight}}}}}};return lightThemeOverrides;};var getOnDarkOverrides=function getOnDarkOverrides(brandColors){var foregroundOnBrandColorDark=tinycolor.mostReadable(brandColors[800],[colors$2.neutral.blueGrayDark[800],colors$2.neutral.blueGrayDark[0]],WCAG2ContrastOptions).toHslString();var foregroundOnSurfaceDark=tinycolor.isReadable(colors$2.neutral.blueGrayDark[1100],brandColors[400],WCAG2ContrastOptions)?brandColors[400]:colors$2.neutral.blueGrayDark[0];var darkThemeOverrides={colors:{onDark:{brand:{primary:{300:brandColors.a100,400:brandColors.a200,500:brandColors[400],600:brandColors[500],700:brandColors[600],800:brandColors[900]},gray:{200:{lowContrast:foregroundOnBrandColorDark}}},action:{background:{primary:{default:brandColors[500],hover:brandColors[600],focus:brandColors[700],active:brandColors[800]},secondary:{default:brandColors.a00,hover:brandColors.a50,focus:brandColors.a100,active:brandColors.a200}},border:{primary:{default:brandColors[500],hover:brandColors[600],focus:brandColors[700],active:brandColors[800]},secondary:{default:brandColors[400],hover:brandColors[400],focus:brandColors[400],active:brandColors[400]}},text:{primary:{default:foregroundOnBrandColorDark,hover:foregroundOnBrandColorDark,focus:foregroundOnBrandColorDark,active:foregroundOnBrandColorDark},secondary:{default:foregroundOnSurfaceDark,hover:foregroundOnSurfaceDark,focus:foregroundOnSurfaceDark,active:foregroundOnSurfaceDark}},icon:{primary:{default:foregroundOnBrandColorDark,hover:foregroundOnBrandColorDark,focus:foregroundOnBrandColorDark,active:foregroundOnBrandColorDark},secondary:{default:foregroundOnSurfaceDark,hover:foregroundOnSurfaceDark,focus:foregroundOnSurfaceDark,active:foregroundOnSurfaceDark}}}}}};return darkThemeOverrides;};var createTheme=function createTheme(_ref){var _brandedLightTheme$co,_brandedDarkTheme$col;var brandColor=_ref.brandColor;var chromaticBrandColors=generateChromaticBrandColors(brandColor);var brandedLightTheme=getOnLightOverrides(chromaticBrandColors);var brandedDarkTheme=getOnDarkOverrides(chromaticBrandColors);var brandedThemeTokens=overrideTheme({baseThemeTokens:paymentTheme,overrides:{name:`custom-${tinycolor(brandColor).toHex()}`,colors:{onLight:Object.assign({},brandedLightTheme==null?void 0:(_brandedLightTheme$co=brandedLightTheme.colors)==null?void 0:_brandedLightTheme$co.onLight),onDark:Object.assign({},brandedDarkTheme==null?void 0:(_brandedDarkTheme$col=brandedDarkTheme.colors)==null?void 0:_brandedDarkTheme$col.onDark)}}});return brandedThemeTokens;};
|
|
4098
4698
|
|
|
4099
|
-
export { bankingTheme, border, breakpoints, colors$2 as colors, elevation, motion, opacity, overrideTheme, paymentTheme, size, spacing, typography };
|
|
4699
|
+
export { bankingTheme, border, breakpoints, colors$2 as colors, createTheme, elevation, motion, opacity, overrideTheme, paymentTheme, size, spacing, typography };
|
|
4100
4700
|
//# sourceMappingURL=index.native.js.map
|