babel-plugin-react-compiler 0.0.0-experimental-1e8c174-20241215 → 0.0.0-experimental-22c6e49-20241218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +447 -1994
- package/package.json +1 -3
package/dist/index.js
CHANGED
@@ -12895,13 +12895,13 @@ function requireAncestry$1() {
|
|
12895
12895
|
var inference$1 = {};
|
12896
12896
|
var inferers$1 = {};
|
12897
12897
|
var infererReference$1 = {};
|
12898
|
-
var util$
|
12898
|
+
var util$6 = {};
|
12899
12899
|
var hasRequiredUtil$1;
|
12900
12900
|
function requireUtil$1() {
|
12901
|
-
if (hasRequiredUtil$1) return util$
|
12901
|
+
if (hasRequiredUtil$1) return util$6;
|
12902
12902
|
hasRequiredUtil$1 = 1;
|
12903
|
-
Object.defineProperty(util$
|
12904
|
-
util$
|
12903
|
+
Object.defineProperty(util$6, '__esModule', {value: true});
|
12904
|
+
util$6.createUnionType = createUnionType;
|
12905
12905
|
var _t = t$d;
|
12906
12906
|
const {
|
12907
12907
|
createFlowUnionType: createFlowUnionType,
|
@@ -12924,7 +12924,7 @@ function requireUtil$1() {
|
|
12924
12924
|
}
|
12925
12925
|
}
|
12926
12926
|
}
|
12927
|
-
return util$
|
12927
|
+
return util$6;
|
12928
12928
|
}
|
12929
12929
|
var hasRequiredInfererReference$1;
|
12930
12930
|
function requireInfererReference$1() {
|
@@ -50740,7 +50740,7 @@ function requireLib$g() {
|
|
50740
50740
|
})(lib$d);
|
50741
50741
|
return lib$d;
|
50742
50742
|
}
|
50743
|
-
var chalk$
|
50743
|
+
var chalk$1 = {exports: {}};
|
50744
50744
|
var escapeStringRegexp$1;
|
50745
50745
|
var hasRequiredEscapeStringRegexp$1;
|
50746
50746
|
function requireEscapeStringRegexp$1() {
|
@@ -50755,14 +50755,14 @@ function requireEscapeStringRegexp$1() {
|
|
50755
50755
|
};
|
50756
50756
|
return escapeStringRegexp$1;
|
50757
50757
|
}
|
50758
|
-
var ansiStyles$
|
50759
|
-
var conversions$
|
50760
|
-
var colorName$
|
50761
|
-
var hasRequiredColorName
|
50762
|
-
function requireColorName
|
50763
|
-
if (hasRequiredColorName
|
50764
|
-
hasRequiredColorName
|
50765
|
-
colorName$
|
50758
|
+
var ansiStyles$1 = {exports: {}};
|
50759
|
+
var conversions$3 = {exports: {}};
|
50760
|
+
var colorName$1;
|
50761
|
+
var hasRequiredColorName;
|
50762
|
+
function requireColorName() {
|
50763
|
+
if (hasRequiredColorName) return colorName$1;
|
50764
|
+
hasRequiredColorName = 1;
|
50765
|
+
colorName$1 = {
|
50766
50766
|
aliceblue: [240, 248, 255],
|
50767
50767
|
antiquewhite: [250, 235, 215],
|
50768
50768
|
aqua: [0, 255, 255],
|
@@ -50912,20 +50912,20 @@ function requireColorName$1() {
|
|
50912
50912
|
yellow: [255, 255, 0],
|
50913
50913
|
yellowgreen: [154, 205, 50],
|
50914
50914
|
};
|
50915
|
-
return colorName$
|
50915
|
+
return colorName$1;
|
50916
50916
|
}
|
50917
|
-
var hasRequiredConversions
|
50918
|
-
function requireConversions
|
50919
|
-
if (hasRequiredConversions
|
50920
|
-
hasRequiredConversions
|
50921
|
-
var cssKeywords = requireColorName
|
50917
|
+
var hasRequiredConversions;
|
50918
|
+
function requireConversions() {
|
50919
|
+
if (hasRequiredConversions) return conversions$3.exports;
|
50920
|
+
hasRequiredConversions = 1;
|
50921
|
+
var cssKeywords = requireColorName();
|
50922
50922
|
var reverseKeywords = {};
|
50923
50923
|
for (var key in cssKeywords) {
|
50924
50924
|
if (cssKeywords.hasOwnProperty(key)) {
|
50925
50925
|
reverseKeywords[cssKeywords[key]] = key;
|
50926
50926
|
}
|
50927
50927
|
}
|
50928
|
-
var convert = (conversions$
|
50928
|
+
var convert = (conversions$3.exports = {
|
50929
50929
|
rgb: {channels: 3, labels: 'rgb'},
|
50930
50930
|
hsl: {channels: 3, labels: 'hsl'},
|
50931
50931
|
hsv: {channels: 3, labels: 'hsv'},
|
@@ -51647,14 +51647,14 @@ function requireConversions$1() {
|
|
51647
51647
|
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
51648
51648
|
return [(val / 255) * 100];
|
51649
51649
|
};
|
51650
|
-
return conversions$
|
51651
|
-
}
|
51652
|
-
var route$
|
51653
|
-
var hasRequiredRoute
|
51654
|
-
function requireRoute
|
51655
|
-
if (hasRequiredRoute
|
51656
|
-
hasRequiredRoute
|
51657
|
-
var conversions = requireConversions
|
51650
|
+
return conversions$3.exports;
|
51651
|
+
}
|
51652
|
+
var route$2;
|
51653
|
+
var hasRequiredRoute;
|
51654
|
+
function requireRoute() {
|
51655
|
+
if (hasRequiredRoute) return route$2;
|
51656
|
+
hasRequiredRoute = 1;
|
51657
|
+
var conversions = requireConversions();
|
51658
51658
|
function buildGraph() {
|
51659
51659
|
var graph = {};
|
51660
51660
|
var models = Object.keys(conversions);
|
@@ -51699,7 +51699,7 @@ function requireRoute$1() {
|
|
51699
51699
|
fn.conversion = path;
|
51700
51700
|
return fn;
|
51701
51701
|
}
|
51702
|
-
route$
|
51702
|
+
route$2 = function (fromModel) {
|
51703
51703
|
var graph = deriveBFS(fromModel);
|
51704
51704
|
var conversion = {};
|
51705
51705
|
var models = Object.keys(graph);
|
@@ -51713,15 +51713,15 @@ function requireRoute$1() {
|
|
51713
51713
|
}
|
51714
51714
|
return conversion;
|
51715
51715
|
};
|
51716
|
-
return route$
|
51717
|
-
}
|
51718
|
-
var colorConvert$
|
51719
|
-
var hasRequiredColorConvert
|
51720
|
-
function requireColorConvert
|
51721
|
-
if (hasRequiredColorConvert
|
51722
|
-
hasRequiredColorConvert
|
51723
|
-
var conversions = requireConversions
|
51724
|
-
var route = requireRoute
|
51716
|
+
return route$2;
|
51717
|
+
}
|
51718
|
+
var colorConvert$1;
|
51719
|
+
var hasRequiredColorConvert;
|
51720
|
+
function requireColorConvert() {
|
51721
|
+
if (hasRequiredColorConvert) return colorConvert$1;
|
51722
|
+
hasRequiredColorConvert = 1;
|
51723
|
+
var conversions = requireConversions();
|
51724
|
+
var route = requireRoute();
|
51725
51725
|
var convert = {};
|
51726
51726
|
var models = Object.keys(conversions);
|
51727
51727
|
function wrapRaw(fn) {
|
@@ -51776,16 +51776,16 @@ function requireColorConvert$1() {
|
|
51776
51776
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
51777
51777
|
});
|
51778
51778
|
});
|
51779
|
-
colorConvert$
|
51780
|
-
return colorConvert$
|
51779
|
+
colorConvert$1 = convert;
|
51780
|
+
return colorConvert$1;
|
51781
51781
|
}
|
51782
|
-
ansiStyles$
|
51782
|
+
ansiStyles$1.exports;
|
51783
51783
|
var hasRequiredAnsiStyles;
|
51784
51784
|
function requireAnsiStyles() {
|
51785
|
-
if (hasRequiredAnsiStyles) return ansiStyles$
|
51785
|
+
if (hasRequiredAnsiStyles) return ansiStyles$1.exports;
|
51786
51786
|
hasRequiredAnsiStyles = 1;
|
51787
51787
|
(function (module) {
|
51788
|
-
const colorConvert = requireColorConvert
|
51788
|
+
const colorConvert = requireColorConvert();
|
51789
51789
|
const wrapAnsi16 = (fn, offset) =>
|
51790
51790
|
function () {
|
51791
51791
|
const code = fn.apply(colorConvert, arguments);
|
@@ -51906,27 +51906,27 @@ function requireAnsiStyles() {
|
|
51906
51906
|
enumerable: true,
|
51907
51907
|
get: assembleStyles,
|
51908
51908
|
});
|
51909
|
-
})(ansiStyles$
|
51910
|
-
return ansiStyles$
|
51909
|
+
})(ansiStyles$1);
|
51910
|
+
return ansiStyles$1.exports;
|
51911
51911
|
}
|
51912
|
-
var hasFlag$
|
51912
|
+
var hasFlag$1;
|
51913
51913
|
var hasRequiredHasFlag$1;
|
51914
51914
|
function requireHasFlag$1() {
|
51915
|
-
if (hasRequiredHasFlag$1) return hasFlag$
|
51915
|
+
if (hasRequiredHasFlag$1) return hasFlag$1;
|
51916
51916
|
hasRequiredHasFlag$1 = 1;
|
51917
|
-
hasFlag$
|
51917
|
+
hasFlag$1 = (flag, argv) => {
|
51918
51918
|
argv = argv || process.argv;
|
51919
51919
|
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
51920
51920
|
const pos = argv.indexOf(prefix + flag);
|
51921
51921
|
const terminatorPos = argv.indexOf('--');
|
51922
51922
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
51923
51923
|
};
|
51924
|
-
return hasFlag$
|
51924
|
+
return hasFlag$1;
|
51925
51925
|
}
|
51926
|
-
var supportsColor_1$
|
51926
|
+
var supportsColor_1$1;
|
51927
51927
|
var hasRequiredSupportsColor$1;
|
51928
51928
|
function requireSupportsColor$1() {
|
51929
|
-
if (hasRequiredSupportsColor$1) return supportsColor_1$
|
51929
|
+
if (hasRequiredSupportsColor$1) return supportsColor_1$1;
|
51930
51930
|
hasRequiredSupportsColor$1 = 1;
|
51931
51931
|
const os = require$$0$3;
|
51932
51932
|
const hasFlag = requireHasFlag$1();
|
@@ -52037,18 +52037,18 @@ function requireSupportsColor$1() {
|
|
52037
52037
|
const level = supportsColor(stream);
|
52038
52038
|
return translateLevel(level);
|
52039
52039
|
}
|
52040
|
-
supportsColor_1$
|
52040
|
+
supportsColor_1$1 = {
|
52041
52041
|
supportsColor: getSupportLevel,
|
52042
52042
|
stdout: getSupportLevel(process.stdout),
|
52043
52043
|
stderr: getSupportLevel(process.stderr),
|
52044
52044
|
};
|
52045
|
-
return supportsColor_1$
|
52045
|
+
return supportsColor_1$1;
|
52046
52046
|
}
|
52047
|
-
var templates$
|
52048
|
-
var hasRequiredTemplates$
|
52049
|
-
function requireTemplates$
|
52050
|
-
if (hasRequiredTemplates$
|
52051
|
-
hasRequiredTemplates$
|
52047
|
+
var templates$1;
|
52048
|
+
var hasRequiredTemplates$1;
|
52049
|
+
function requireTemplates$1() {
|
52050
|
+
if (hasRequiredTemplates$1) return templates$1;
|
52051
|
+
hasRequiredTemplates$1 = 1;
|
52052
52052
|
const TEMPLATE_REGEX =
|
52053
52053
|
/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
52054
52054
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
@@ -52130,7 +52130,7 @@ function requireTemplates$2() {
|
|
52130
52130
|
}
|
52131
52131
|
return current;
|
52132
52132
|
}
|
52133
|
-
templates$
|
52133
|
+
templates$1 = (chalk, tmp) => {
|
52134
52134
|
const styles = [];
|
52135
52135
|
const chunks = [];
|
52136
52136
|
let chunk = [];
|
@@ -52160,17 +52160,17 @@ function requireTemplates$2() {
|
|
52160
52160
|
}
|
52161
52161
|
return chunks.join('');
|
52162
52162
|
};
|
52163
|
-
return templates$
|
52163
|
+
return templates$1;
|
52164
52164
|
}
|
52165
52165
|
var hasRequiredChalk$1;
|
52166
52166
|
function requireChalk$1() {
|
52167
|
-
if (hasRequiredChalk$1) return chalk$
|
52167
|
+
if (hasRequiredChalk$1) return chalk$1.exports;
|
52168
52168
|
hasRequiredChalk$1 = 1;
|
52169
52169
|
(function (module) {
|
52170
52170
|
const escapeStringRegexp = requireEscapeStringRegexp$1();
|
52171
52171
|
const ansiStyles = requireAnsiStyles();
|
52172
52172
|
const stdoutColor = requireSupportsColor$1().stdout;
|
52173
|
-
const template = requireTemplates$
|
52173
|
+
const template = requireTemplates$1();
|
52174
52174
|
const isSimpleWindowsTerm =
|
52175
52175
|
process.platform === 'win32' &&
|
52176
52176
|
!(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
@@ -52358,8 +52358,8 @@ function requireChalk$1() {
|
|
52358
52358
|
module.exports = Chalk();
|
52359
52359
|
module.exports.supportsColor = stdoutColor;
|
52360
52360
|
module.exports.default = module.exports;
|
52361
|
-
})(chalk$
|
52362
|
-
return chalk$
|
52361
|
+
})(chalk$1);
|
52362
|
+
return chalk$1.exports;
|
52363
52363
|
}
|
52364
52364
|
var hasRequiredLib$f;
|
52365
52365
|
function requireLib$f() {
|
@@ -65086,7 +65086,7 @@ function requireLib$9() {
|
|
65086
65086
|
})(lib$7);
|
65087
65087
|
return lib$7;
|
65088
65088
|
}
|
65089
|
-
var chalk
|
65089
|
+
var chalk = {exports: {}};
|
65090
65090
|
var escapeStringRegexp;
|
65091
65091
|
var hasRequiredEscapeStringRegexp;
|
65092
65092
|
function requireEscapeStringRegexp() {
|
@@ -65101,9 +65101,9 @@ function requireEscapeStringRegexp() {
|
|
65101
65101
|
};
|
65102
65102
|
return escapeStringRegexp;
|
65103
65103
|
}
|
65104
|
-
var ansiStyles
|
65105
|
-
var conversions$
|
65106
|
-
var colorName
|
65104
|
+
var ansiStyles = {exports: {}};
|
65105
|
+
var conversions$2 = {exports: {}};
|
65106
|
+
var colorName = {
|
65107
65107
|
aliceblue: [240, 248, 255],
|
65108
65108
|
antiquewhite: [250, 235, 215],
|
65109
65109
|
aqua: [0, 255, 255],
|
@@ -65253,14 +65253,14 @@ var colorName$1 = {
|
|
65253
65253
|
yellow: [255, 255, 0],
|
65254
65254
|
yellowgreen: [154, 205, 50],
|
65255
65255
|
};
|
65256
|
-
var cssKeywords = colorName
|
65256
|
+
var cssKeywords = colorName;
|
65257
65257
|
var reverseKeywords = {};
|
65258
65258
|
for (var key$1 in cssKeywords) {
|
65259
65259
|
if (cssKeywords.hasOwnProperty(key$1)) {
|
65260
65260
|
reverseKeywords[cssKeywords[key$1]] = key$1;
|
65261
65261
|
}
|
65262
65262
|
}
|
65263
|
-
var convert$1 = (conversions$
|
65263
|
+
var convert$1 = (conversions$2.exports = {
|
65264
65264
|
rgb: {channels: 3, labels: 'rgb'},
|
65265
65265
|
hsl: {channels: 3, labels: 'hsl'},
|
65266
65266
|
hsv: {channels: 3, labels: 'hsv'},
|
@@ -65978,11 +65978,11 @@ convert$1.rgb.gray = function (rgb) {
|
|
65978
65978
|
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
65979
65979
|
return [(val / 255) * 100];
|
65980
65980
|
};
|
65981
|
-
var conversionsExports = conversions$
|
65982
|
-
var conversions$
|
65981
|
+
var conversionsExports = conversions$2.exports;
|
65982
|
+
var conversions$1 = conversionsExports;
|
65983
65983
|
function buildGraph() {
|
65984
65984
|
var graph = {};
|
65985
|
-
var models = Object.keys(conversions$
|
65985
|
+
var models = Object.keys(conversions$1);
|
65986
65986
|
for (var len = models.length, i = 0; i < len; i++) {
|
65987
65987
|
graph[models[i]] = {distance: -1, parent: null};
|
65988
65988
|
}
|
@@ -65994,7 +65994,7 @@ function deriveBFS(fromModel) {
|
|
65994
65994
|
graph[fromModel].distance = 0;
|
65995
65995
|
while (queue.length) {
|
65996
65996
|
var current = queue.pop();
|
65997
|
-
var adjacents = Object.keys(conversions$
|
65997
|
+
var adjacents = Object.keys(conversions$1[current]);
|
65998
65998
|
for (var len = adjacents.length, i = 0; i < len; i++) {
|
65999
65999
|
var adjacent = adjacents[i];
|
66000
66000
|
var node = graph[adjacent];
|
@@ -66014,17 +66014,17 @@ function link(from, to) {
|
|
66014
66014
|
}
|
66015
66015
|
function wrapConversion(toModel, graph) {
|
66016
66016
|
var path = [graph[toModel].parent, toModel];
|
66017
|
-
var fn = conversions$
|
66017
|
+
var fn = conversions$1[graph[toModel].parent][toModel];
|
66018
66018
|
var cur = graph[toModel].parent;
|
66019
66019
|
while (graph[cur].parent) {
|
66020
66020
|
path.unshift(graph[cur].parent);
|
66021
|
-
fn = link(conversions$
|
66021
|
+
fn = link(conversions$1[graph[cur].parent][cur], fn);
|
66022
66022
|
cur = graph[cur].parent;
|
66023
66023
|
}
|
66024
66024
|
fn.conversion = path;
|
66025
66025
|
return fn;
|
66026
66026
|
}
|
66027
|
-
var route$
|
66027
|
+
var route$1 = function (fromModel) {
|
66028
66028
|
var graph = deriveBFS(fromModel);
|
66029
66029
|
var conversion = {};
|
66030
66030
|
var models = Object.keys(graph);
|
@@ -66038,10 +66038,10 @@ var route$2 = function (fromModel) {
|
|
66038
66038
|
}
|
66039
66039
|
return conversion;
|
66040
66040
|
};
|
66041
|
-
var conversions
|
66042
|
-
var route
|
66041
|
+
var conversions = conversionsExports;
|
66042
|
+
var route = route$1;
|
66043
66043
|
var convert = {};
|
66044
|
-
var models = Object.keys(conversions
|
66044
|
+
var models = Object.keys(conversions);
|
66045
66045
|
function wrapRaw(fn) {
|
66046
66046
|
var wrappedFn = function (args) {
|
66047
66047
|
if (args === undefined || args === null) {
|
@@ -66081,12 +66081,12 @@ function wrapRounded(fn) {
|
|
66081
66081
|
models.forEach(function (fromModel) {
|
66082
66082
|
convert[fromModel] = {};
|
66083
66083
|
Object.defineProperty(convert[fromModel], 'channels', {
|
66084
|
-
value: conversions
|
66084
|
+
value: conversions[fromModel].channels,
|
66085
66085
|
});
|
66086
66086
|
Object.defineProperty(convert[fromModel], 'labels', {
|
66087
|
-
value: conversions
|
66087
|
+
value: conversions[fromModel].labels,
|
66088
66088
|
});
|
66089
|
-
var routes = route
|
66089
|
+
var routes = route(fromModel);
|
66090
66090
|
var routeModels = Object.keys(routes);
|
66091
66091
|
routeModels.forEach(function (toModel) {
|
66092
66092
|
var fn = routes[toModel];
|
@@ -66094,23 +66094,23 @@ models.forEach(function (fromModel) {
|
|
66094
66094
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
66095
66095
|
});
|
66096
66096
|
});
|
66097
|
-
var colorConvert
|
66098
|
-
ansiStyles
|
66097
|
+
var colorConvert = convert;
|
66098
|
+
ansiStyles.exports;
|
66099
66099
|
(function (module) {
|
66100
|
-
const colorConvert = colorConvert
|
66100
|
+
const colorConvert$1 = colorConvert;
|
66101
66101
|
const wrapAnsi16 = (fn, offset) =>
|
66102
66102
|
function () {
|
66103
|
-
const code = fn.apply(colorConvert, arguments);
|
66103
|
+
const code = fn.apply(colorConvert$1, arguments);
|
66104
66104
|
return `[${code + offset}m`;
|
66105
66105
|
};
|
66106
66106
|
const wrapAnsi256 = (fn, offset) =>
|
66107
66107
|
function () {
|
66108
|
-
const code = fn.apply(colorConvert, arguments);
|
66108
|
+
const code = fn.apply(colorConvert$1, arguments);
|
66109
66109
|
return `[${38 + offset};5;${code}m`;
|
66110
66110
|
};
|
66111
66111
|
const wrapAnsi16m = (fn, offset) =>
|
66112
66112
|
function () {
|
66113
|
-
const rgb = fn.apply(colorConvert, arguments);
|
66113
|
+
const rgb = fn.apply(colorConvert$1, arguments);
|
66114
66114
|
return `[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
66115
66115
|
};
|
66116
66116
|
function assembleStyles() {
|
@@ -66188,11 +66188,11 @@ ansiStyles$2.exports;
|
|
66188
66188
|
styles.bgColor.ansi = {ansi: wrapAnsi16(ansi2ansi, 10)};
|
66189
66189
|
styles.bgColor.ansi256 = {ansi256: wrapAnsi256(ansi2ansi, 10)};
|
66190
66190
|
styles.bgColor.ansi16m = {rgb: wrapAnsi16m(rgb2rgb, 10)};
|
66191
|
-
for (let key of Object.keys(colorConvert)) {
|
66192
|
-
if (typeof colorConvert[key] !== 'object') {
|
66191
|
+
for (let key of Object.keys(colorConvert$1)) {
|
66192
|
+
if (typeof colorConvert$1[key] !== 'object') {
|
66193
66193
|
continue;
|
66194
66194
|
}
|
66195
|
-
const suite = colorConvert[key];
|
66195
|
+
const suite = colorConvert$1[key];
|
66196
66196
|
if (key === 'ansi16') {
|
66197
66197
|
key = 'ansi';
|
66198
66198
|
}
|
@@ -66215,26 +66215,26 @@ ansiStyles$2.exports;
|
|
66215
66215
|
enumerable: true,
|
66216
66216
|
get: assembleStyles,
|
66217
66217
|
});
|
66218
|
-
})(ansiStyles
|
66219
|
-
var ansiStylesExports
|
66220
|
-
var hasFlag
|
66218
|
+
})(ansiStyles);
|
66219
|
+
var ansiStylesExports = ansiStyles.exports;
|
66220
|
+
var hasFlag;
|
66221
66221
|
var hasRequiredHasFlag;
|
66222
66222
|
function requireHasFlag() {
|
66223
|
-
if (hasRequiredHasFlag) return hasFlag
|
66223
|
+
if (hasRequiredHasFlag) return hasFlag;
|
66224
66224
|
hasRequiredHasFlag = 1;
|
66225
|
-
hasFlag
|
66225
|
+
hasFlag = (flag, argv) => {
|
66226
66226
|
argv = argv || process.argv;
|
66227
66227
|
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
66228
66228
|
const pos = argv.indexOf(prefix + flag);
|
66229
66229
|
const terminatorPos = argv.indexOf('--');
|
66230
66230
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
66231
66231
|
};
|
66232
|
-
return hasFlag
|
66232
|
+
return hasFlag;
|
66233
66233
|
}
|
66234
|
-
var supportsColor_1
|
66234
|
+
var supportsColor_1;
|
66235
66235
|
var hasRequiredSupportsColor;
|
66236
66236
|
function requireSupportsColor() {
|
66237
|
-
if (hasRequiredSupportsColor) return supportsColor_1
|
66237
|
+
if (hasRequiredSupportsColor) return supportsColor_1;
|
66238
66238
|
hasRequiredSupportsColor = 1;
|
66239
66239
|
const os = require$$0$3;
|
66240
66240
|
const hasFlag = requireHasFlag();
|
@@ -66345,18 +66345,18 @@ function requireSupportsColor() {
|
|
66345
66345
|
const level = supportsColor(stream);
|
66346
66346
|
return translateLevel(level);
|
66347
66347
|
}
|
66348
|
-
supportsColor_1
|
66348
|
+
supportsColor_1 = {
|
66349
66349
|
supportsColor: getSupportLevel,
|
66350
66350
|
stdout: getSupportLevel(process.stdout),
|
66351
66351
|
stderr: getSupportLevel(process.stderr),
|
66352
66352
|
};
|
66353
|
-
return supportsColor_1
|
66353
|
+
return supportsColor_1;
|
66354
66354
|
}
|
66355
|
-
var templates
|
66356
|
-
var hasRequiredTemplates
|
66357
|
-
function requireTemplates
|
66358
|
-
if (hasRequiredTemplates
|
66359
|
-
hasRequiredTemplates
|
66355
|
+
var templates;
|
66356
|
+
var hasRequiredTemplates;
|
66357
|
+
function requireTemplates() {
|
66358
|
+
if (hasRequiredTemplates) return templates;
|
66359
|
+
hasRequiredTemplates = 1;
|
66360
66360
|
const TEMPLATE_REGEX =
|
66361
66361
|
/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
66362
66362
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
@@ -66438,7 +66438,7 @@ function requireTemplates$1() {
|
|
66438
66438
|
}
|
66439
66439
|
return current;
|
66440
66440
|
}
|
66441
|
-
templates
|
66441
|
+
templates = (chalk, tmp) => {
|
66442
66442
|
const styles = [];
|
66443
66443
|
const chunks = [];
|
66444
66444
|
let chunk = [];
|
@@ -66468,17 +66468,17 @@ function requireTemplates$1() {
|
|
66468
66468
|
}
|
66469
66469
|
return chunks.join('');
|
66470
66470
|
};
|
66471
|
-
return templates
|
66471
|
+
return templates;
|
66472
66472
|
}
|
66473
66473
|
var hasRequiredChalk;
|
66474
66474
|
function requireChalk() {
|
66475
|
-
if (hasRequiredChalk) return chalk
|
66475
|
+
if (hasRequiredChalk) return chalk.exports;
|
66476
66476
|
hasRequiredChalk = 1;
|
66477
66477
|
(function (module) {
|
66478
66478
|
const escapeStringRegexp = requireEscapeStringRegexp();
|
66479
|
-
const ansiStyles = ansiStylesExports
|
66479
|
+
const ansiStyles = ansiStylesExports;
|
66480
66480
|
const stdoutColor = requireSupportsColor().stdout;
|
66481
|
-
const template = requireTemplates
|
66481
|
+
const template = requireTemplates();
|
66482
66482
|
const isSimpleWindowsTerm =
|
66483
66483
|
process.platform === 'win32' &&
|
66484
66484
|
!(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
@@ -66666,8 +66666,8 @@ function requireChalk() {
|
|
66666
66666
|
module.exports = Chalk();
|
66667
66667
|
module.exports.supportsColor = stdoutColor;
|
66668
66668
|
module.exports.default = module.exports;
|
66669
|
-
})(chalk
|
66670
|
-
return chalk
|
66669
|
+
})(chalk);
|
66670
|
+
return chalk.exports;
|
66671
66671
|
}
|
66672
66672
|
var hasRequiredLib$8;
|
66673
66673
|
function requireLib$8() {
|
@@ -107002,10 +107002,10 @@ function requireBase64Vlq() {
|
|
107002
107002
|
};
|
107003
107003
|
return base64Vlq;
|
107004
107004
|
}
|
107005
|
-
var util$
|
107005
|
+
var util$5 = {};
|
107006
107006
|
var hasRequiredUtil;
|
107007
107007
|
function requireUtil() {
|
107008
|
-
if (hasRequiredUtil) return util$
|
107008
|
+
if (hasRequiredUtil) return util$5;
|
107009
107009
|
hasRequiredUtil = 1;
|
107010
107010
|
(function (exports) {
|
107011
107011
|
function getArg(aArgs, aName, aDefaultValue) {
|
@@ -107293,8 +107293,8 @@ function requireUtil() {
|
|
107293
107293
|
}
|
107294
107294
|
exports.compareByGeneratedPositionsInflated =
|
107295
107295
|
compareByGeneratedPositionsInflated;
|
107296
|
-
})(util$
|
107297
|
-
return util$
|
107296
|
+
})(util$5);
|
107297
|
+
return util$5;
|
107298
107298
|
}
|
107299
107299
|
var arraySet = {};
|
107300
107300
|
var hasRequiredArraySet;
|
@@ -113645,7 +113645,7 @@ var unicode = {
|
|
113645
113645
|
ID_Start: ID_Start,
|
113646
113646
|
ID_Continue: ID_Continue,
|
113647
113647
|
};
|
113648
|
-
var util$
|
113648
|
+
var util$4 = {
|
113649
113649
|
isSpaceSeparator(c) {
|
113650
113650
|
return typeof c === 'string' && unicode.Space_Separator.test(c);
|
113651
113651
|
},
|
@@ -113804,7 +113804,7 @@ const lexStates = {
|
|
113804
113804
|
read$1();
|
113805
113805
|
return newToken('eof');
|
113806
113806
|
}
|
113807
|
-
if (util$
|
113807
|
+
if (util$4.isSpaceSeparator(c)) {
|
113808
113808
|
read$1();
|
113809
113809
|
return;
|
113810
113810
|
}
|
@@ -113936,7 +113936,7 @@ const lexStates = {
|
|
113936
113936
|
case '_':
|
113937
113937
|
break;
|
113938
113938
|
default:
|
113939
|
-
if (!util$
|
113939
|
+
if (!util$4.isIdStartChar(u)) {
|
113940
113940
|
throw invalidIdentifier();
|
113941
113941
|
}
|
113942
113942
|
break;
|
@@ -113957,7 +113957,7 @@ const lexStates = {
|
|
113957
113957
|
lexState = 'identifierNameEscape';
|
113958
113958
|
return;
|
113959
113959
|
}
|
113960
|
-
if (util$
|
113960
|
+
if (util$4.isIdContinueChar(c)) {
|
113961
113961
|
buffer$2 += read$1();
|
113962
113962
|
return;
|
113963
113963
|
}
|
@@ -113976,7 +113976,7 @@ const lexStates = {
|
|
113976
113976
|
case '':
|
113977
113977
|
break;
|
113978
113978
|
default:
|
113979
|
-
if (!util$
|
113979
|
+
if (!util$4.isIdContinueChar(u)) {
|
113980
113980
|
throw invalidIdentifier();
|
113981
113981
|
}
|
113982
113982
|
break;
|
@@ -114048,14 +114048,14 @@ const lexStates = {
|
|
114048
114048
|
lexState = 'decimalExponent';
|
114049
114049
|
return;
|
114050
114050
|
}
|
114051
|
-
if (util$
|
114051
|
+
if (util$4.isDigit(c)) {
|
114052
114052
|
buffer$2 += read$1();
|
114053
114053
|
return;
|
114054
114054
|
}
|
114055
114055
|
return newToken('numeric', sign * Number(buffer$2));
|
114056
114056
|
},
|
114057
114057
|
decimalPointLeading() {
|
114058
|
-
if (util$
|
114058
|
+
if (util$4.isDigit(c)) {
|
114059
114059
|
buffer$2 += read$1();
|
114060
114060
|
lexState = 'decimalFraction';
|
114061
114061
|
return;
|
@@ -114070,7 +114070,7 @@ const lexStates = {
|
|
114070
114070
|
lexState = 'decimalExponent';
|
114071
114071
|
return;
|
114072
114072
|
}
|
114073
|
-
if (util$
|
114073
|
+
if (util$4.isDigit(c)) {
|
114074
114074
|
buffer$2 += read$1();
|
114075
114075
|
lexState = 'decimalFraction';
|
114076
114076
|
return;
|
@@ -114085,7 +114085,7 @@ const lexStates = {
|
|
114085
114085
|
lexState = 'decimalExponent';
|
114086
114086
|
return;
|
114087
114087
|
}
|
114088
|
-
if (util$
|
114088
|
+
if (util$4.isDigit(c)) {
|
114089
114089
|
buffer$2 += read$1();
|
114090
114090
|
return;
|
114091
114091
|
}
|
@@ -114099,7 +114099,7 @@ const lexStates = {
|
|
114099
114099
|
lexState = 'decimalExponentSign';
|
114100
114100
|
return;
|
114101
114101
|
}
|
114102
|
-
if (util$
|
114102
|
+
if (util$4.isDigit(c)) {
|
114103
114103
|
buffer$2 += read$1();
|
114104
114104
|
lexState = 'decimalExponentInteger';
|
114105
114105
|
return;
|
@@ -114107,7 +114107,7 @@ const lexStates = {
|
|
114107
114107
|
throw invalidChar(read$1());
|
114108
114108
|
},
|
114109
114109
|
decimalExponentSign() {
|
114110
|
-
if (util$
|
114110
|
+
if (util$4.isDigit(c)) {
|
114111
114111
|
buffer$2 += read$1();
|
114112
114112
|
lexState = 'decimalExponentInteger';
|
114113
114113
|
return;
|
@@ -114115,14 +114115,14 @@ const lexStates = {
|
|
114115
114115
|
throw invalidChar(read$1());
|
114116
114116
|
},
|
114117
114117
|
decimalExponentInteger() {
|
114118
|
-
if (util$
|
114118
|
+
if (util$4.isDigit(c)) {
|
114119
114119
|
buffer$2 += read$1();
|
114120
114120
|
return;
|
114121
114121
|
}
|
114122
114122
|
return newToken('numeric', sign * Number(buffer$2));
|
114123
114123
|
},
|
114124
114124
|
hexadecimal() {
|
114125
|
-
if (util$
|
114125
|
+
if (util$4.isHexDigit(c)) {
|
114126
114126
|
buffer$2 += read$1();
|
114127
114127
|
lexState = 'hexadecimalInteger';
|
114128
114128
|
return;
|
@@ -114130,7 +114130,7 @@ const lexStates = {
|
|
114130
114130
|
throw invalidChar(read$1());
|
114131
114131
|
},
|
114132
114132
|
hexadecimalInteger() {
|
114133
|
-
if (util$
|
114133
|
+
if (util$4.isHexDigit(c)) {
|
114134
114134
|
buffer$2 += read$1();
|
114135
114135
|
return;
|
114136
114136
|
}
|
@@ -114195,7 +114195,7 @@ const lexStates = {
|
|
114195
114195
|
lexState = 'string';
|
114196
114196
|
return;
|
114197
114197
|
}
|
114198
|
-
if (util$
|
114198
|
+
if (util$4.isIdStartChar(c)) {
|
114199
114199
|
buffer$2 += read$1();
|
114200
114200
|
lexState = 'identifierName';
|
114201
114201
|
return;
|
@@ -114272,7 +114272,7 @@ function escape() {
|
|
114272
114272
|
return '\v';
|
114273
114273
|
case '0':
|
114274
114274
|
read$1();
|
114275
|
-
if (util$
|
114275
|
+
if (util$4.isDigit(peek())) {
|
114276
114276
|
throw invalidChar(read$1());
|
114277
114277
|
}
|
114278
114278
|
return '\0';
|
@@ -114311,12 +114311,12 @@ function escape() {
|
|
114311
114311
|
function hexEscape() {
|
114312
114312
|
let buffer = '';
|
114313
114313
|
let c = peek();
|
114314
|
-
if (!util$
|
114314
|
+
if (!util$4.isHexDigit(c)) {
|
114315
114315
|
throw invalidChar(read$1());
|
114316
114316
|
}
|
114317
114317
|
buffer += read$1();
|
114318
114318
|
c = peek();
|
114319
|
-
if (!util$
|
114319
|
+
if (!util$4.isHexDigit(c)) {
|
114320
114320
|
throw invalidChar(read$1());
|
114321
114321
|
}
|
114322
114322
|
buffer += read$1();
|
@@ -114327,7 +114327,7 @@ function unicodeEscape() {
|
|
114327
114327
|
let count = 4;
|
114328
114328
|
while (count-- > 0) {
|
114329
114329
|
const c = peek();
|
114330
|
-
if (!util$
|
114330
|
+
if (!util$4.isHexDigit(c)) {
|
114331
114331
|
throw invalidChar(read$1());
|
114332
114332
|
}
|
114333
114333
|
buffer += read$1();
|
@@ -114635,7 +114635,7 @@ var stringify = function stringify(value, replacer, space) {
|
|
114635
114635
|
product += c;
|
114636
114636
|
continue;
|
114637
114637
|
case '\0':
|
114638
|
-
if (util$
|
114638
|
+
if (util$4.isDigit(value[i + 1])) {
|
114639
114639
|
product += '\\x00';
|
114640
114640
|
continue;
|
114641
114641
|
}
|
@@ -114703,11 +114703,11 @@ var stringify = function stringify(value, replacer, space) {
|
|
114703
114703
|
return quoteString(key);
|
114704
114704
|
}
|
114705
114705
|
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
114706
|
-
if (!util$
|
114706
|
+
if (!util$4.isIdStartChar(firstChar)) {
|
114707
114707
|
return quoteString(key);
|
114708
114708
|
}
|
114709
114709
|
for (let i = firstChar.length; i < key.length; i++) {
|
114710
|
-
if (!util$
|
114710
|
+
if (!util$4.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
114711
114711
|
return quoteString(key);
|
114712
114712
|
}
|
114713
114713
|
}
|
@@ -115014,7 +115014,7 @@ var inspector$1 = '>= 8';
|
|
115014
115014
|
var _linklist$1 = '< 8';
|
115015
115015
|
var module$2 = true;
|
115016
115016
|
var net$1 = true;
|
115017
|
-
var os$
|
115017
|
+
var os$1 = true;
|
115018
115018
|
var path$1 = true;
|
115019
115019
|
var perf_hooks$1 = '>= 8.5';
|
115020
115020
|
var process$3 = '>= 1';
|
@@ -115038,9 +115038,9 @@ var _tls_legacy$1 = '>= 0.11.3 && < 10';
|
|
115038
115038
|
var _tls_wrap$1 = '>= 0.11.3';
|
115039
115039
|
var tls$1 = true;
|
115040
115040
|
var trace_events$1 = '>= 10';
|
115041
|
-
var tty$
|
115041
|
+
var tty$1 = true;
|
115042
115042
|
var url$1 = true;
|
115043
|
-
var util$
|
115043
|
+
var util$3 = true;
|
115044
115044
|
var v8$1 = '>= 1';
|
115045
115045
|
var vm$1 = true;
|
115046
115046
|
var wasi$1 = '>= 13.4 && < 13.5';
|
@@ -115113,7 +115113,7 @@ var require$$1 = {
|
|
115113
115113
|
'node-inspect/lib/_inspect': '>= 7.6 && < 12',
|
115114
115114
|
'node-inspect/lib/internal/inspect_client': '>= 7.6 && < 12',
|
115115
115115
|
'node-inspect/lib/internal/inspect_repl': '>= 7.6 && < 12',
|
115116
|
-
os: os$
|
115116
|
+
os: os$1,
|
115117
115117
|
'node:os': ['>= 14.18 && < 15', '>= 16'],
|
115118
115118
|
path: path$1,
|
115119
115119
|
'node:path': ['>= 14.18 && < 15', '>= 16'],
|
@@ -115174,11 +115174,11 @@ var require$$1 = {
|
|
115174
115174
|
'node:tls': ['>= 14.18 && < 15', '>= 16'],
|
115175
115175
|
trace_events: trace_events$1,
|
115176
115176
|
'node:trace_events': ['>= 14.18 && < 15', '>= 16'],
|
115177
|
-
tty: tty$
|
115177
|
+
tty: tty$1,
|
115178
115178
|
'node:tty': ['>= 14.18 && < 15', '>= 16'],
|
115179
115179
|
url: url$1,
|
115180
115180
|
'node:url': ['>= 14.18 && < 15', '>= 16'],
|
115181
|
-
util: util$
|
115181
|
+
util: util$3,
|
115182
115182
|
'node:util': ['>= 14.18 && < 15', '>= 16'],
|
115183
115183
|
'util/types': '>= 15.3',
|
115184
115184
|
'node:util/types': '>= 16',
|
@@ -115613,7 +115613,7 @@ var inspector = '>= 8';
|
|
115613
115613
|
var _linklist = '< 8';
|
115614
115614
|
var module$1 = true;
|
115615
115615
|
var net = true;
|
115616
|
-
var os
|
115616
|
+
var os = true;
|
115617
115617
|
var path = true;
|
115618
115618
|
var perf_hooks = '>= 8.5';
|
115619
115619
|
var process$2 = '>= 1';
|
@@ -115637,9 +115637,9 @@ var _tls_legacy = '>= 0.11.3 && < 10';
|
|
115637
115637
|
var _tls_wrap = '>= 0.11.3';
|
115638
115638
|
var tls = true;
|
115639
115639
|
var trace_events = '>= 10';
|
115640
|
-
var tty
|
115640
|
+
var tty = true;
|
115641
115641
|
var url = true;
|
115642
|
-
var util$
|
115642
|
+
var util$2 = true;
|
115643
115643
|
var v8 = '>= 1';
|
115644
115644
|
var vm = true;
|
115645
115645
|
var wasi = '>= 13.4 && < 13.5';
|
@@ -115712,7 +115712,7 @@ var require$$0 = {
|
|
115712
115712
|
'node-inspect/lib/_inspect': '>= 7.6 && < 12',
|
115713
115713
|
'node-inspect/lib/internal/inspect_client': '>= 7.6 && < 12',
|
115714
115714
|
'node-inspect/lib/internal/inspect_repl': '>= 7.6 && < 12',
|
115715
|
-
os: os
|
115715
|
+
os: os,
|
115716
115716
|
'node:os': ['>= 14.18 && < 15', '>= 16'],
|
115717
115717
|
path: path,
|
115718
115718
|
'node:path': ['>= 14.18 && < 15', '>= 16'],
|
@@ -115773,11 +115773,11 @@ var require$$0 = {
|
|
115773
115773
|
'node:tls': ['>= 14.18 && < 15', '>= 16'],
|
115774
115774
|
trace_events: trace_events,
|
115775
115775
|
'node:trace_events': ['>= 14.18 && < 15', '>= 16'],
|
115776
|
-
tty: tty
|
115776
|
+
tty: tty,
|
115777
115777
|
'node:tty': ['>= 14.18 && < 15', '>= 16'],
|
115778
115778
|
url: url,
|
115779
115779
|
'node:url': ['>= 14.18 && < 15', '>= 16'],
|
115780
|
-
util: util$
|
115780
|
+
util: util$2,
|
115781
115781
|
'node:util': ['>= 14.18 && < 15', '>= 16'],
|
115782
115782
|
'util/types': '>= 15.3',
|
115783
115783
|
'node:util/types': '>= 16',
|
@@ -117063,9 +117063,9 @@ function requireItem() {
|
|
117063
117063
|
}
|
117064
117064
|
var config = {};
|
117065
117065
|
var full = {};
|
117066
|
-
var util$
|
117067
|
-
Object.defineProperty(util$
|
117068
|
-
util$
|
117066
|
+
var util$1 = {};
|
117067
|
+
Object.defineProperty(util$1, '__esModule', {value: true});
|
117068
|
+
util$1.mergeOptions = mergeOptions;
|
117069
117069
|
function mergeOptions(target, source) {
|
117070
117070
|
for (const k of Object.keys(source)) {
|
117071
117071
|
if (k === 'parserOpts' && source.parserOpts) {
|
@@ -118223,7 +118223,7 @@ function requirePartial() {
|
|
118223
118223
|
return data;
|
118224
118224
|
}
|
118225
118225
|
var _plugin = _interopRequireDefault(plugin$7);
|
118226
|
-
var _util = util$
|
118226
|
+
var _util = util$1;
|
118227
118227
|
var _item = requireItem();
|
118228
118228
|
var _configChain = requireConfigChain();
|
118229
118229
|
var _environment = environment;
|
@@ -118360,7 +118360,7 @@ function requireFull() {
|
|
118360
118360
|
hasRequiredFull = 1;
|
118361
118361
|
Object.defineProperty(full, '__esModule', {value: true});
|
118362
118362
|
full.default = loadFullConfig;
|
118363
|
-
var _util = util$
|
118363
|
+
var _util = util$1;
|
118364
118364
|
var context = _interopRequireWildcard(requireLib());
|
118365
118365
|
var _plugin = _interopRequireDefault(plugin$7);
|
118366
118366
|
var _item = requireItem();
|
@@ -121963,7 +121963,7 @@ function phiTypeEquals(tA, tB) {
|
|
121963
121963
|
}
|
121964
121964
|
return false;
|
121965
121965
|
}
|
121966
|
-
var util
|
121966
|
+
var util;
|
121967
121967
|
(function (util) {
|
121968
121968
|
util.assertEqual = val => val;
|
121969
121969
|
function assertIs(_arg) {}
|
@@ -122028,12 +122028,12 @@ var util$1;
|
|
122028
122028
|
}
|
122029
122029
|
return value;
|
122030
122030
|
};
|
122031
|
-
})(util
|
122031
|
+
})(util || (util = {}));
|
122032
122032
|
var objectUtil;
|
122033
122033
|
(function (objectUtil) {
|
122034
122034
|
objectUtil.mergeShapes = (first, second) => ({...first, ...second});
|
122035
122035
|
})(objectUtil || (objectUtil = {}));
|
122036
|
-
const ZodParsedType = util
|
122036
|
+
const ZodParsedType = util.arrayToEnum([
|
122037
122037
|
'string',
|
122038
122038
|
'nan',
|
122039
122039
|
'number',
|
@@ -122101,7 +122101,7 @@ const getParsedType = data => {
|
|
122101
122101
|
return ZodParsedType.unknown;
|
122102
122102
|
}
|
122103
122103
|
};
|
122104
|
-
const ZodIssueCode = util
|
122104
|
+
const ZodIssueCode = util.arrayToEnum([
|
122105
122105
|
'invalid_type',
|
122106
122106
|
'invalid_literal',
|
122107
122107
|
'custom',
|
@@ -122187,7 +122187,7 @@ class ZodError extends Error {
|
|
122187
122187
|
return this.message;
|
122188
122188
|
}
|
122189
122189
|
get message() {
|
122190
|
-
return JSON.stringify(this.issues, util
|
122190
|
+
return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
|
122191
122191
|
}
|
122192
122192
|
get isEmpty() {
|
122193
122193
|
return this.issues.length === 0;
|
@@ -122224,19 +122224,19 @@ const errorMap = (issue, _ctx) => {
|
|
122224
122224
|
}
|
122225
122225
|
break;
|
122226
122226
|
case ZodIssueCode.invalid_literal:
|
122227
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util
|
122227
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
|
122228
122228
|
break;
|
122229
122229
|
case ZodIssueCode.unrecognized_keys:
|
122230
|
-
message = `Unrecognized key(s) in object: ${util
|
122230
|
+
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ', ')}`;
|
122231
122231
|
break;
|
122232
122232
|
case ZodIssueCode.invalid_union:
|
122233
122233
|
message = `Invalid input`;
|
122234
122234
|
break;
|
122235
122235
|
case ZodIssueCode.invalid_union_discriminator:
|
122236
|
-
message = `Invalid discriminator value. Expected ${util
|
122236
|
+
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
122237
122237
|
break;
|
122238
122238
|
case ZodIssueCode.invalid_enum_value:
|
122239
|
-
message = `Invalid enum value. Expected ${util
|
122239
|
+
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
122240
122240
|
break;
|
122241
122241
|
case ZodIssueCode.invalid_arguments:
|
122242
122242
|
message = `Invalid function arguments`;
|
@@ -122259,7 +122259,7 @@ const errorMap = (issue, _ctx) => {
|
|
122259
122259
|
} else if ('endsWith' in issue.validation) {
|
122260
122260
|
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
122261
122261
|
} else {
|
122262
|
-
util
|
122262
|
+
util.assertNever(issue.validation);
|
122263
122263
|
}
|
122264
122264
|
} else if (issue.validation !== 'regex') {
|
122265
122265
|
message = `Invalid ${issue.validation}`;
|
@@ -122305,7 +122305,7 @@ const errorMap = (issue, _ctx) => {
|
|
122305
122305
|
break;
|
122306
122306
|
default:
|
122307
122307
|
message = _ctx.defaultError;
|
122308
|
-
util
|
122308
|
+
util.assertNever(issue);
|
122309
122309
|
}
|
122310
122310
|
return {message: message};
|
122311
122311
|
};
|
@@ -123012,7 +123012,7 @@ class ZodString extends ZodType {
|
|
123012
123012
|
status.dirty();
|
123013
123013
|
}
|
123014
123014
|
} else {
|
123015
|
-
util
|
123015
|
+
util.assertNever(check);
|
123016
123016
|
}
|
123017
123017
|
}
|
123018
123018
|
return {status: status.value, value: input.data};
|
@@ -123248,7 +123248,7 @@ class ZodNumber extends ZodType {
|
|
123248
123248
|
const status = new ParseStatus();
|
123249
123249
|
for (const check of this._def.checks) {
|
123250
123250
|
if (check.kind === 'int') {
|
123251
|
-
if (!util
|
123251
|
+
if (!util.isInteger(input.data)) {
|
123252
123252
|
ctx = this._getOrReturnCtx(input, ctx);
|
123253
123253
|
addIssueToContext(ctx, {
|
123254
123254
|
code: ZodIssueCode.invalid_type,
|
@@ -123310,7 +123310,7 @@ class ZodNumber extends ZodType {
|
|
123310
123310
|
status.dirty();
|
123311
123311
|
}
|
123312
123312
|
} else {
|
123313
|
-
util
|
123313
|
+
util.assertNever(check);
|
123314
123314
|
}
|
123315
123315
|
}
|
123316
123316
|
return {status: status.value, value: input.data};
|
@@ -123427,7 +123427,7 @@ class ZodNumber extends ZodType {
|
|
123427
123427
|
return !!this._def.checks.find(
|
123428
123428
|
ch =>
|
123429
123429
|
ch.kind === 'int' ||
|
123430
|
-
(ch.kind === 'multipleOf' && util
|
123430
|
+
(ch.kind === 'multipleOf' && util.isInteger(ch.value))
|
123431
123431
|
);
|
123432
123432
|
}
|
123433
123433
|
get isFinite() {
|
@@ -123521,7 +123521,7 @@ class ZodBigInt extends ZodType {
|
|
123521
123521
|
status.dirty();
|
123522
123522
|
}
|
123523
123523
|
} else {
|
123524
|
-
util
|
123524
|
+
util.assertNever(check);
|
123525
123525
|
}
|
123526
123526
|
}
|
123527
123527
|
return {status: status.value, value: input.data};
|
@@ -123701,7 +123701,7 @@ class ZodDate extends ZodType {
|
|
123701
123701
|
status.dirty();
|
123702
123702
|
}
|
123703
123703
|
} else {
|
123704
|
-
util
|
123704
|
+
util.assertNever(check);
|
123705
123705
|
}
|
123706
123706
|
}
|
123707
123707
|
return {status: status.value, value: new Date(input.data.getTime())};
|
@@ -124004,7 +124004,7 @@ class ZodObject extends ZodType {
|
|
124004
124004
|
_getCached() {
|
124005
124005
|
if (this._cached !== null) return this._cached;
|
124006
124006
|
const shape = this._def.shape();
|
124007
|
-
const keys = util
|
124007
|
+
const keys = util.objectKeys(shape);
|
124008
124008
|
return (this._cached = {shape: shape, keys: keys});
|
124009
124009
|
}
|
124010
124010
|
_parse(input) {
|
@@ -124160,7 +124160,7 @@ class ZodObject extends ZodType {
|
|
124160
124160
|
}
|
124161
124161
|
pick(mask) {
|
124162
124162
|
const shape = {};
|
124163
|
-
util
|
124163
|
+
util.objectKeys(mask).forEach(key => {
|
124164
124164
|
if (mask[key] && this.shape[key]) {
|
124165
124165
|
shape[key] = this.shape[key];
|
124166
124166
|
}
|
@@ -124169,7 +124169,7 @@ class ZodObject extends ZodType {
|
|
124169
124169
|
}
|
124170
124170
|
omit(mask) {
|
124171
124171
|
const shape = {};
|
124172
|
-
util
|
124172
|
+
util.objectKeys(this.shape).forEach(key => {
|
124173
124173
|
if (!mask[key]) {
|
124174
124174
|
shape[key] = this.shape[key];
|
124175
124175
|
}
|
@@ -124181,7 +124181,7 @@ class ZodObject extends ZodType {
|
|
124181
124181
|
}
|
124182
124182
|
partial(mask) {
|
124183
124183
|
const newShape = {};
|
124184
|
-
util
|
124184
|
+
util.objectKeys(this.shape).forEach(key => {
|
124185
124185
|
const fieldSchema = this.shape[key];
|
124186
124186
|
if (mask && !mask[key]) {
|
124187
124187
|
newShape[key] = fieldSchema;
|
@@ -124193,7 +124193,7 @@ class ZodObject extends ZodType {
|
|
124193
124193
|
}
|
124194
124194
|
required(mask) {
|
124195
124195
|
const newShape = {};
|
124196
|
-
util
|
124196
|
+
util.objectKeys(this.shape).forEach(key => {
|
124197
124197
|
if (mask && !mask[key]) {
|
124198
124198
|
newShape[key] = this.shape[key];
|
124199
124199
|
} else {
|
@@ -124208,7 +124208,7 @@ class ZodObject extends ZodType {
|
|
124208
124208
|
return new ZodObject({...this._def, shape: () => newShape});
|
124209
124209
|
}
|
124210
124210
|
keyof() {
|
124211
|
-
return createZodEnum(util
|
124211
|
+
return createZodEnum(util.objectKeys(this.shape));
|
124212
124212
|
}
|
124213
124213
|
}
|
124214
124214
|
ZodObject.create = (shape, params) =>
|
@@ -124414,8 +124414,8 @@ function mergeValues$1(a, b) {
|
|
124414
124414
|
if (a === b) {
|
124415
124415
|
return {valid: true, data: a};
|
124416
124416
|
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
124417
|
-
const bKeys = util
|
124418
|
-
const sharedKeys = util
|
124417
|
+
const bKeys = util.objectKeys(b);
|
124418
|
+
const sharedKeys = util
|
124419
124419
|
.objectKeys(a)
|
124420
124420
|
.filter(key => bKeys.indexOf(key) !== -1);
|
124421
124421
|
const newObj = {...a, ...b};
|
@@ -124945,7 +124945,7 @@ class ZodEnum extends ZodType {
|
|
124945
124945
|
const ctx = this._getOrReturnCtx(input);
|
124946
124946
|
const expectedValues = this._def.values;
|
124947
124947
|
addIssueToContext(ctx, {
|
124948
|
-
expected: util
|
124948
|
+
expected: util.joinValues(expectedValues),
|
124949
124949
|
received: ctx.parsedType,
|
124950
124950
|
code: ZodIssueCode.invalid_type,
|
124951
124951
|
});
|
@@ -124997,22 +124997,22 @@ class ZodEnum extends ZodType {
|
|
124997
124997
|
ZodEnum.create = createZodEnum;
|
124998
124998
|
class ZodNativeEnum extends ZodType {
|
124999
124999
|
_parse(input) {
|
125000
|
-
const nativeEnumValues = util
|
125000
|
+
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
125001
125001
|
const ctx = this._getOrReturnCtx(input);
|
125002
125002
|
if (
|
125003
125003
|
ctx.parsedType !== ZodParsedType.string &&
|
125004
125004
|
ctx.parsedType !== ZodParsedType.number
|
125005
125005
|
) {
|
125006
|
-
const expectedValues = util
|
125006
|
+
const expectedValues = util.objectValues(nativeEnumValues);
|
125007
125007
|
addIssueToContext(ctx, {
|
125008
|
-
expected: util
|
125008
|
+
expected: util.joinValues(expectedValues),
|
125009
125009
|
received: ctx.parsedType,
|
125010
125010
|
code: ZodIssueCode.invalid_type,
|
125011
125011
|
});
|
125012
125012
|
return INVALID;
|
125013
125013
|
}
|
125014
125014
|
if (nativeEnumValues.indexOf(input.data) === -1) {
|
125015
|
-
const expectedValues = util
|
125015
|
+
const expectedValues = util.objectValues(nativeEnumValues);
|
125016
125016
|
addIssueToContext(ctx, {
|
125017
125017
|
received: ctx.data,
|
125018
125018
|
code: ZodIssueCode.invalid_enum_value,
|
@@ -125178,7 +125178,7 @@ class ZodEffects extends ZodType {
|
|
125178
125178
|
});
|
125179
125179
|
}
|
125180
125180
|
}
|
125181
|
-
util
|
125181
|
+
util.assertNever(effect);
|
125182
125182
|
}
|
125183
125183
|
}
|
125184
125184
|
ZodEffects.create = (schema, effect, params) =>
|
@@ -125531,7 +125531,7 @@ var z = Object.freeze({
|
|
125531
125531
|
isValid: isValid,
|
125532
125532
|
isAsync: isAsync,
|
125533
125533
|
get util() {
|
125534
|
-
return util
|
125534
|
+
return util;
|
125535
125535
|
},
|
125536
125536
|
get objectUtil() {
|
125537
125537
|
return objectUtil;
|
@@ -129294,6 +129294,7 @@ const BuiltInDispatchId = 'BuiltInDispatch';
|
|
129294
129294
|
const BuiltInUseContextHookId = 'BuiltInUseContextHook';
|
129295
129295
|
const BuiltInUseTransitionId = 'BuiltInUseTransition';
|
129296
129296
|
const BuiltInStartTransitionId = 'BuiltInStartTransition';
|
129297
|
+
const BuiltInFireId = 'BuiltInFire';
|
129297
129298
|
const BUILTIN_SHAPES = new Map();
|
129298
129299
|
addObject(BUILTIN_SHAPES, BuiltInPropsId, [
|
129299
129300
|
['ref', {kind: 'Object', shapeId: BuiltInUseRefId}],
|
@@ -134205,7 +134206,7 @@ var ansiRegex = options => {
|
|
134205
134206
|
Object.defineProperty(ConvertAnsi, '__esModule', {value: true});
|
134206
134207
|
ConvertAnsi.default = ConvertAnsi.serialize = ConvertAnsi.test = void 0;
|
134207
134208
|
var _ansiRegex = _interopRequireDefault$2(ansiRegex);
|
134208
|
-
var _ansiStyles$1 = _interopRequireDefault$2(ansiStylesExports
|
134209
|
+
var _ansiStyles$1 = _interopRequireDefault$2(ansiStylesExports);
|
134209
134210
|
function _interopRequireDefault$2(obj) {
|
134210
134211
|
return obj && obj.__esModule ? obj : {default: obj};
|
134211
134212
|
}
|
@@ -135262,7 +135263,7 @@ ReactTestComponent.test = test;
|
|
135262
135263
|
const plugin = {serialize: serialize, test: test};
|
135263
135264
|
var _default = plugin;
|
135264
135265
|
ReactTestComponent.default = _default;
|
135265
|
-
var _ansiStyles = _interopRequireDefault(ansiStylesExports
|
135266
|
+
var _ansiStyles = _interopRequireDefault(ansiStylesExports);
|
135266
135267
|
var _collections = collections;
|
135267
135268
|
var _AsymmetricMatcher = _interopRequireDefault(AsymmetricMatcher);
|
135268
135269
|
var _ConvertAnsi = _interopRequireDefault(ConvertAnsi);
|
@@ -136014,6 +136015,21 @@ const UNTYPED_GLOBALS = new Set([
|
|
136014
136015
|
'decodeURIComponent',
|
136015
136016
|
]);
|
136016
136017
|
const TYPED_GLOBALS = [
|
136018
|
+
[
|
136019
|
+
'Object',
|
136020
|
+
addObject(DEFAULT_SHAPES, 'Object', [
|
136021
|
+
[
|
136022
|
+
'keys',
|
136023
|
+
addFunction(DEFAULT_SHAPES, [], {
|
136024
|
+
positionalParams: [exports.Effect.Read],
|
136025
|
+
restParam: null,
|
136026
|
+
returnType: {kind: 'Object', shapeId: BuiltInArrayId},
|
136027
|
+
calleeEffect: exports.Effect.Read,
|
136028
|
+
returnValueKind: exports.ValueKind.Mutable,
|
136029
|
+
}),
|
136030
|
+
],
|
136031
|
+
]),
|
136032
|
+
],
|
136017
136033
|
[
|
136018
136034
|
'Array',
|
136019
136035
|
addObject(DEFAULT_SHAPES, 'Array', [
|
@@ -136371,6 +136387,21 @@ const REACT_APIS = [
|
|
136371
136387
|
BuiltInUseOperatorId
|
136372
136388
|
),
|
136373
136389
|
],
|
136390
|
+
[
|
136391
|
+
'fire',
|
136392
|
+
addFunction(
|
136393
|
+
DEFAULT_SHAPES,
|
136394
|
+
[],
|
136395
|
+
{
|
136396
|
+
positionalParams: [],
|
136397
|
+
restParam: null,
|
136398
|
+
returnType: {kind: 'Primitive'},
|
136399
|
+
calleeEffect: exports.Effect.Read,
|
136400
|
+
returnValueKind: exports.ValueKind.Frozen,
|
136401
|
+
},
|
136402
|
+
BuiltInFireId
|
136403
|
+
),
|
136404
|
+
],
|
136374
136405
|
];
|
136375
136406
|
TYPED_GLOBALS.push(
|
136376
136407
|
[
|
@@ -136720,7 +136751,7 @@ const EnvironmentConfigSchema = z.object({
|
|
136720
136751
|
customHooks: z.map(z.string(), HookSchema).default(new Map()),
|
136721
136752
|
moduleTypeProvider: z.nullable(z.function().args(z.string())).default(null),
|
136722
136753
|
customMacros: z.nullable(z.array(MacroSchema)).default(null),
|
136723
|
-
enableResetCacheOnSourceFileChanges: z.boolean().default(
|
136754
|
+
enableResetCacheOnSourceFileChanges: z.nullable(z.boolean()).default(null),
|
136724
136755
|
enablePreserveExistingMemoizationGuarantees: z.boolean().default(false),
|
136725
136756
|
validatePreserveExistingMemoizationGuarantees: z.boolean().default(true),
|
136726
136757
|
enablePreserveExistingManualUseMemo: z.boolean().default(false),
|
@@ -136728,6 +136759,7 @@ const EnvironmentConfigSchema = z.object({
|
|
136728
136759
|
enableUseTypeAnnotations: z.boolean().default(false),
|
136729
136760
|
enableFunctionDependencyRewrite: z.boolean().default(true),
|
136730
136761
|
enableOptionalDependencies: z.boolean().default(true),
|
136762
|
+
enableFire: z.boolean().default(false),
|
136731
136763
|
inferEffectDependencies: z
|
136732
136764
|
.nullable(
|
136733
136765
|
z.array(
|
@@ -136848,7 +136880,10 @@ function parseConfigPragmaForTests(pragma) {
|
|
136848
136880
|
}
|
136849
136881
|
continue;
|
136850
136882
|
}
|
136851
|
-
if (
|
136883
|
+
if (
|
136884
|
+
key !== 'enableResetCacheOnSourceFileChanges' &&
|
136885
|
+
typeof defaultConfig[key] !== 'boolean'
|
136886
|
+
) {
|
136852
136887
|
continue;
|
136853
136888
|
}
|
136854
136889
|
if (val === undefined || val === 'true') {
|
@@ -136859,6 +136894,9 @@ function parseConfigPragmaForTests(pragma) {
|
|
136859
136894
|
}
|
136860
136895
|
const config = EnvironmentConfigSchema.safeParse(maybeConfig);
|
136861
136896
|
if (config.success) {
|
136897
|
+
if (config.data.enableResetCacheOnSourceFileChanges == null) {
|
136898
|
+
config.data.enableResetCacheOnSourceFileChanges = false;
|
136899
|
+
}
|
136862
136900
|
return config.data;
|
136863
136901
|
}
|
136864
136902
|
CompilerError.invariant(false, {
|
@@ -137596,1634 +137634,8 @@ class DisjointSet {
|
|
137596
137634
|
}
|
137597
137635
|
}
|
137598
137636
|
_DisjointSet_entries = new WeakMap();
|
137599
|
-
var ansiStyles$1 = {exports: {}};
|
137600
|
-
var colorName;
|
137601
|
-
var hasRequiredColorName;
|
137602
|
-
function requireColorName() {
|
137603
|
-
if (hasRequiredColorName) return colorName;
|
137604
|
-
hasRequiredColorName = 1;
|
137605
|
-
colorName = {
|
137606
|
-
aliceblue: [240, 248, 255],
|
137607
|
-
antiquewhite: [250, 235, 215],
|
137608
|
-
aqua: [0, 255, 255],
|
137609
|
-
aquamarine: [127, 255, 212],
|
137610
|
-
azure: [240, 255, 255],
|
137611
|
-
beige: [245, 245, 220],
|
137612
|
-
bisque: [255, 228, 196],
|
137613
|
-
black: [0, 0, 0],
|
137614
|
-
blanchedalmond: [255, 235, 205],
|
137615
|
-
blue: [0, 0, 255],
|
137616
|
-
blueviolet: [138, 43, 226],
|
137617
|
-
brown: [165, 42, 42],
|
137618
|
-
burlywood: [222, 184, 135],
|
137619
|
-
cadetblue: [95, 158, 160],
|
137620
|
-
chartreuse: [127, 255, 0],
|
137621
|
-
chocolate: [210, 105, 30],
|
137622
|
-
coral: [255, 127, 80],
|
137623
|
-
cornflowerblue: [100, 149, 237],
|
137624
|
-
cornsilk: [255, 248, 220],
|
137625
|
-
crimson: [220, 20, 60],
|
137626
|
-
cyan: [0, 255, 255],
|
137627
|
-
darkblue: [0, 0, 139],
|
137628
|
-
darkcyan: [0, 139, 139],
|
137629
|
-
darkgoldenrod: [184, 134, 11],
|
137630
|
-
darkgray: [169, 169, 169],
|
137631
|
-
darkgreen: [0, 100, 0],
|
137632
|
-
darkgrey: [169, 169, 169],
|
137633
|
-
darkkhaki: [189, 183, 107],
|
137634
|
-
darkmagenta: [139, 0, 139],
|
137635
|
-
darkolivegreen: [85, 107, 47],
|
137636
|
-
darkorange: [255, 140, 0],
|
137637
|
-
darkorchid: [153, 50, 204],
|
137638
|
-
darkred: [139, 0, 0],
|
137639
|
-
darksalmon: [233, 150, 122],
|
137640
|
-
darkseagreen: [143, 188, 143],
|
137641
|
-
darkslateblue: [72, 61, 139],
|
137642
|
-
darkslategray: [47, 79, 79],
|
137643
|
-
darkslategrey: [47, 79, 79],
|
137644
|
-
darkturquoise: [0, 206, 209],
|
137645
|
-
darkviolet: [148, 0, 211],
|
137646
|
-
deeppink: [255, 20, 147],
|
137647
|
-
deepskyblue: [0, 191, 255],
|
137648
|
-
dimgray: [105, 105, 105],
|
137649
|
-
dimgrey: [105, 105, 105],
|
137650
|
-
dodgerblue: [30, 144, 255],
|
137651
|
-
firebrick: [178, 34, 34],
|
137652
|
-
floralwhite: [255, 250, 240],
|
137653
|
-
forestgreen: [34, 139, 34],
|
137654
|
-
fuchsia: [255, 0, 255],
|
137655
|
-
gainsboro: [220, 220, 220],
|
137656
|
-
ghostwhite: [248, 248, 255],
|
137657
|
-
gold: [255, 215, 0],
|
137658
|
-
goldenrod: [218, 165, 32],
|
137659
|
-
gray: [128, 128, 128],
|
137660
|
-
green: [0, 128, 0],
|
137661
|
-
greenyellow: [173, 255, 47],
|
137662
|
-
grey: [128, 128, 128],
|
137663
|
-
honeydew: [240, 255, 240],
|
137664
|
-
hotpink: [255, 105, 180],
|
137665
|
-
indianred: [205, 92, 92],
|
137666
|
-
indigo: [75, 0, 130],
|
137667
|
-
ivory: [255, 255, 240],
|
137668
|
-
khaki: [240, 230, 140],
|
137669
|
-
lavender: [230, 230, 250],
|
137670
|
-
lavenderblush: [255, 240, 245],
|
137671
|
-
lawngreen: [124, 252, 0],
|
137672
|
-
lemonchiffon: [255, 250, 205],
|
137673
|
-
lightblue: [173, 216, 230],
|
137674
|
-
lightcoral: [240, 128, 128],
|
137675
|
-
lightcyan: [224, 255, 255],
|
137676
|
-
lightgoldenrodyellow: [250, 250, 210],
|
137677
|
-
lightgray: [211, 211, 211],
|
137678
|
-
lightgreen: [144, 238, 144],
|
137679
|
-
lightgrey: [211, 211, 211],
|
137680
|
-
lightpink: [255, 182, 193],
|
137681
|
-
lightsalmon: [255, 160, 122],
|
137682
|
-
lightseagreen: [32, 178, 170],
|
137683
|
-
lightskyblue: [135, 206, 250],
|
137684
|
-
lightslategray: [119, 136, 153],
|
137685
|
-
lightslategrey: [119, 136, 153],
|
137686
|
-
lightsteelblue: [176, 196, 222],
|
137687
|
-
lightyellow: [255, 255, 224],
|
137688
|
-
lime: [0, 255, 0],
|
137689
|
-
limegreen: [50, 205, 50],
|
137690
|
-
linen: [250, 240, 230],
|
137691
|
-
magenta: [255, 0, 255],
|
137692
|
-
maroon: [128, 0, 0],
|
137693
|
-
mediumaquamarine: [102, 205, 170],
|
137694
|
-
mediumblue: [0, 0, 205],
|
137695
|
-
mediumorchid: [186, 85, 211],
|
137696
|
-
mediumpurple: [147, 112, 219],
|
137697
|
-
mediumseagreen: [60, 179, 113],
|
137698
|
-
mediumslateblue: [123, 104, 238],
|
137699
|
-
mediumspringgreen: [0, 250, 154],
|
137700
|
-
mediumturquoise: [72, 209, 204],
|
137701
|
-
mediumvioletred: [199, 21, 133],
|
137702
|
-
midnightblue: [25, 25, 112],
|
137703
|
-
mintcream: [245, 255, 250],
|
137704
|
-
mistyrose: [255, 228, 225],
|
137705
|
-
moccasin: [255, 228, 181],
|
137706
|
-
navajowhite: [255, 222, 173],
|
137707
|
-
navy: [0, 0, 128],
|
137708
|
-
oldlace: [253, 245, 230],
|
137709
|
-
olive: [128, 128, 0],
|
137710
|
-
olivedrab: [107, 142, 35],
|
137711
|
-
orange: [255, 165, 0],
|
137712
|
-
orangered: [255, 69, 0],
|
137713
|
-
orchid: [218, 112, 214],
|
137714
|
-
palegoldenrod: [238, 232, 170],
|
137715
|
-
palegreen: [152, 251, 152],
|
137716
|
-
paleturquoise: [175, 238, 238],
|
137717
|
-
palevioletred: [219, 112, 147],
|
137718
|
-
papayawhip: [255, 239, 213],
|
137719
|
-
peachpuff: [255, 218, 185],
|
137720
|
-
peru: [205, 133, 63],
|
137721
|
-
pink: [255, 192, 203],
|
137722
|
-
plum: [221, 160, 221],
|
137723
|
-
powderblue: [176, 224, 230],
|
137724
|
-
purple: [128, 0, 128],
|
137725
|
-
rebeccapurple: [102, 51, 153],
|
137726
|
-
red: [255, 0, 0],
|
137727
|
-
rosybrown: [188, 143, 143],
|
137728
|
-
royalblue: [65, 105, 225],
|
137729
|
-
saddlebrown: [139, 69, 19],
|
137730
|
-
salmon: [250, 128, 114],
|
137731
|
-
sandybrown: [244, 164, 96],
|
137732
|
-
seagreen: [46, 139, 87],
|
137733
|
-
seashell: [255, 245, 238],
|
137734
|
-
sienna: [160, 82, 45],
|
137735
|
-
silver: [192, 192, 192],
|
137736
|
-
skyblue: [135, 206, 235],
|
137737
|
-
slateblue: [106, 90, 205],
|
137738
|
-
slategray: [112, 128, 144],
|
137739
|
-
slategrey: [112, 128, 144],
|
137740
|
-
snow: [255, 250, 250],
|
137741
|
-
springgreen: [0, 255, 127],
|
137742
|
-
steelblue: [70, 130, 180],
|
137743
|
-
tan: [210, 180, 140],
|
137744
|
-
teal: [0, 128, 128],
|
137745
|
-
thistle: [216, 191, 216],
|
137746
|
-
tomato: [255, 99, 71],
|
137747
|
-
turquoise: [64, 224, 208],
|
137748
|
-
violet: [238, 130, 238],
|
137749
|
-
wheat: [245, 222, 179],
|
137750
|
-
white: [255, 255, 255],
|
137751
|
-
whitesmoke: [245, 245, 245],
|
137752
|
-
yellow: [255, 255, 0],
|
137753
|
-
yellowgreen: [154, 205, 50],
|
137754
|
-
};
|
137755
|
-
return colorName;
|
137756
|
-
}
|
137757
|
-
var conversions;
|
137758
|
-
var hasRequiredConversions;
|
137759
|
-
function requireConversions() {
|
137760
|
-
if (hasRequiredConversions) return conversions;
|
137761
|
-
hasRequiredConversions = 1;
|
137762
|
-
const cssKeywords = requireColorName();
|
137763
|
-
const reverseKeywords = {};
|
137764
|
-
for (const key of Object.keys(cssKeywords)) {
|
137765
|
-
reverseKeywords[cssKeywords[key]] = key;
|
137766
|
-
}
|
137767
|
-
const convert = {
|
137768
|
-
rgb: {channels: 3, labels: 'rgb'},
|
137769
|
-
hsl: {channels: 3, labels: 'hsl'},
|
137770
|
-
hsv: {channels: 3, labels: 'hsv'},
|
137771
|
-
hwb: {channels: 3, labels: 'hwb'},
|
137772
|
-
cmyk: {channels: 4, labels: 'cmyk'},
|
137773
|
-
xyz: {channels: 3, labels: 'xyz'},
|
137774
|
-
lab: {channels: 3, labels: 'lab'},
|
137775
|
-
lch: {channels: 3, labels: 'lch'},
|
137776
|
-
hex: {channels: 1, labels: ['hex']},
|
137777
|
-
keyword: {channels: 1, labels: ['keyword']},
|
137778
|
-
ansi16: {channels: 1, labels: ['ansi16']},
|
137779
|
-
ansi256: {channels: 1, labels: ['ansi256']},
|
137780
|
-
hcg: {channels: 3, labels: ['h', 'c', 'g']},
|
137781
|
-
apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
|
137782
|
-
gray: {channels: 1, labels: ['gray']},
|
137783
|
-
};
|
137784
|
-
conversions = convert;
|
137785
|
-
for (const model of Object.keys(convert)) {
|
137786
|
-
if (!('channels' in convert[model])) {
|
137787
|
-
throw new Error('missing channels property: ' + model);
|
137788
|
-
}
|
137789
|
-
if (!('labels' in convert[model])) {
|
137790
|
-
throw new Error('missing channel labels property: ' + model);
|
137791
|
-
}
|
137792
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
137793
|
-
throw new Error('channel and label counts mismatch: ' + model);
|
137794
|
-
}
|
137795
|
-
const {channels: channels, labels: labels} = convert[model];
|
137796
|
-
delete convert[model].channels;
|
137797
|
-
delete convert[model].labels;
|
137798
|
-
Object.defineProperty(convert[model], 'channels', {value: channels});
|
137799
|
-
Object.defineProperty(convert[model], 'labels', {value: labels});
|
137800
|
-
}
|
137801
|
-
convert.rgb.hsl = function (rgb) {
|
137802
|
-
const r = rgb[0] / 255;
|
137803
|
-
const g = rgb[1] / 255;
|
137804
|
-
const b = rgb[2] / 255;
|
137805
|
-
const min = Math.min(r, g, b);
|
137806
|
-
const max = Math.max(r, g, b);
|
137807
|
-
const delta = max - min;
|
137808
|
-
let h;
|
137809
|
-
let s;
|
137810
|
-
if (max === min) {
|
137811
|
-
h = 0;
|
137812
|
-
} else if (r === max) {
|
137813
|
-
h = (g - b) / delta;
|
137814
|
-
} else if (g === max) {
|
137815
|
-
h = 2 + (b - r) / delta;
|
137816
|
-
} else if (b === max) {
|
137817
|
-
h = 4 + (r - g) / delta;
|
137818
|
-
}
|
137819
|
-
h = Math.min(h * 60, 360);
|
137820
|
-
if (h < 0) {
|
137821
|
-
h += 360;
|
137822
|
-
}
|
137823
|
-
const l = (min + max) / 2;
|
137824
|
-
if (max === min) {
|
137825
|
-
s = 0;
|
137826
|
-
} else if (l <= 0.5) {
|
137827
|
-
s = delta / (max + min);
|
137828
|
-
} else {
|
137829
|
-
s = delta / (2 - max - min);
|
137830
|
-
}
|
137831
|
-
return [h, s * 100, l * 100];
|
137832
|
-
};
|
137833
|
-
convert.rgb.hsv = function (rgb) {
|
137834
|
-
let rdif;
|
137835
|
-
let gdif;
|
137836
|
-
let bdif;
|
137837
|
-
let h;
|
137838
|
-
let s;
|
137839
|
-
const r = rgb[0] / 255;
|
137840
|
-
const g = rgb[1] / 255;
|
137841
|
-
const b = rgb[2] / 255;
|
137842
|
-
const v = Math.max(r, g, b);
|
137843
|
-
const diff = v - Math.min(r, g, b);
|
137844
|
-
const diffc = function (c) {
|
137845
|
-
return (v - c) / 6 / diff + 1 / 2;
|
137846
|
-
};
|
137847
|
-
if (diff === 0) {
|
137848
|
-
h = 0;
|
137849
|
-
s = 0;
|
137850
|
-
} else {
|
137851
|
-
s = diff / v;
|
137852
|
-
rdif = diffc(r);
|
137853
|
-
gdif = diffc(g);
|
137854
|
-
bdif = diffc(b);
|
137855
|
-
if (r === v) {
|
137856
|
-
h = bdif - gdif;
|
137857
|
-
} else if (g === v) {
|
137858
|
-
h = 1 / 3 + rdif - bdif;
|
137859
|
-
} else if (b === v) {
|
137860
|
-
h = 2 / 3 + gdif - rdif;
|
137861
|
-
}
|
137862
|
-
if (h < 0) {
|
137863
|
-
h += 1;
|
137864
|
-
} else if (h > 1) {
|
137865
|
-
h -= 1;
|
137866
|
-
}
|
137867
|
-
}
|
137868
|
-
return [h * 360, s * 100, v * 100];
|
137869
|
-
};
|
137870
|
-
convert.rgb.hwb = function (rgb) {
|
137871
|
-
const r = rgb[0];
|
137872
|
-
const g = rgb[1];
|
137873
|
-
let b = rgb[2];
|
137874
|
-
const h = convert.rgb.hsl(rgb)[0];
|
137875
|
-
const w = (1 / 255) * Math.min(r, Math.min(g, b));
|
137876
|
-
b = 1 - (1 / 255) * Math.max(r, Math.max(g, b));
|
137877
|
-
return [h, w * 100, b * 100];
|
137878
|
-
};
|
137879
|
-
convert.rgb.cmyk = function (rgb) {
|
137880
|
-
const r = rgb[0] / 255;
|
137881
|
-
const g = rgb[1] / 255;
|
137882
|
-
const b = rgb[2] / 255;
|
137883
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
137884
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
137885
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
137886
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
137887
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
137888
|
-
};
|
137889
|
-
function comparativeDistance(x, y) {
|
137890
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
137891
|
-
}
|
137892
|
-
convert.rgb.keyword = function (rgb) {
|
137893
|
-
const reversed = reverseKeywords[rgb];
|
137894
|
-
if (reversed) {
|
137895
|
-
return reversed;
|
137896
|
-
}
|
137897
|
-
let currentClosestDistance = Infinity;
|
137898
|
-
let currentClosestKeyword;
|
137899
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
137900
|
-
const value = cssKeywords[keyword];
|
137901
|
-
const distance = comparativeDistance(rgb, value);
|
137902
|
-
if (distance < currentClosestDistance) {
|
137903
|
-
currentClosestDistance = distance;
|
137904
|
-
currentClosestKeyword = keyword;
|
137905
|
-
}
|
137906
|
-
}
|
137907
|
-
return currentClosestKeyword;
|
137908
|
-
};
|
137909
|
-
convert.keyword.rgb = function (keyword) {
|
137910
|
-
return cssKeywords[keyword];
|
137911
|
-
};
|
137912
|
-
convert.rgb.xyz = function (rgb) {
|
137913
|
-
let r = rgb[0] / 255;
|
137914
|
-
let g = rgb[1] / 255;
|
137915
|
-
let b = rgb[2] / 255;
|
137916
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
137917
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
137918
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
137919
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
137920
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
137921
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
137922
|
-
return [x * 100, y * 100, z * 100];
|
137923
|
-
};
|
137924
|
-
convert.rgb.lab = function (rgb) {
|
137925
|
-
const xyz = convert.rgb.xyz(rgb);
|
137926
|
-
let x = xyz[0];
|
137927
|
-
let y = xyz[1];
|
137928
|
-
let z = xyz[2];
|
137929
|
-
x /= 95.047;
|
137930
|
-
y /= 100;
|
137931
|
-
z /= 108.883;
|
137932
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
137933
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
137934
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
137935
|
-
const l = 116 * y - 16;
|
137936
|
-
const a = 500 * (x - y);
|
137937
|
-
const b = 200 * (y - z);
|
137938
|
-
return [l, a, b];
|
137939
|
-
};
|
137940
|
-
convert.hsl.rgb = function (hsl) {
|
137941
|
-
const h = hsl[0] / 360;
|
137942
|
-
const s = hsl[1] / 100;
|
137943
|
-
const l = hsl[2] / 100;
|
137944
|
-
let t2;
|
137945
|
-
let t3;
|
137946
|
-
let val;
|
137947
|
-
if (s === 0) {
|
137948
|
-
val = l * 255;
|
137949
|
-
return [val, val, val];
|
137950
|
-
}
|
137951
|
-
if (l < 0.5) {
|
137952
|
-
t2 = l * (1 + s);
|
137953
|
-
} else {
|
137954
|
-
t2 = l + s - l * s;
|
137955
|
-
}
|
137956
|
-
const t1 = 2 * l - t2;
|
137957
|
-
const rgb = [0, 0, 0];
|
137958
|
-
for (let i = 0; i < 3; i++) {
|
137959
|
-
t3 = h + (1 / 3) * -(i - 1);
|
137960
|
-
if (t3 < 0) {
|
137961
|
-
t3++;
|
137962
|
-
}
|
137963
|
-
if (t3 > 1) {
|
137964
|
-
t3--;
|
137965
|
-
}
|
137966
|
-
if (6 * t3 < 1) {
|
137967
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
137968
|
-
} else if (2 * t3 < 1) {
|
137969
|
-
val = t2;
|
137970
|
-
} else if (3 * t3 < 2) {
|
137971
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
137972
|
-
} else {
|
137973
|
-
val = t1;
|
137974
|
-
}
|
137975
|
-
rgb[i] = val * 255;
|
137976
|
-
}
|
137977
|
-
return rgb;
|
137978
|
-
};
|
137979
|
-
convert.hsl.hsv = function (hsl) {
|
137980
|
-
const h = hsl[0];
|
137981
|
-
let s = hsl[1] / 100;
|
137982
|
-
let l = hsl[2] / 100;
|
137983
|
-
let smin = s;
|
137984
|
-
const lmin = Math.max(l, 0.01);
|
137985
|
-
l *= 2;
|
137986
|
-
s *= l <= 1 ? l : 2 - l;
|
137987
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
137988
|
-
const v = (l + s) / 2;
|
137989
|
-
const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
|
137990
|
-
return [h, sv * 100, v * 100];
|
137991
|
-
};
|
137992
|
-
convert.hsv.rgb = function (hsv) {
|
137993
|
-
const h = hsv[0] / 60;
|
137994
|
-
const s = hsv[1] / 100;
|
137995
|
-
let v = hsv[2] / 100;
|
137996
|
-
const hi = Math.floor(h) % 6;
|
137997
|
-
const f = h - Math.floor(h);
|
137998
|
-
const p = 255 * v * (1 - s);
|
137999
|
-
const q = 255 * v * (1 - s * f);
|
138000
|
-
const t = 255 * v * (1 - s * (1 - f));
|
138001
|
-
v *= 255;
|
138002
|
-
switch (hi) {
|
138003
|
-
case 0:
|
138004
|
-
return [v, t, p];
|
138005
|
-
case 1:
|
138006
|
-
return [q, v, p];
|
138007
|
-
case 2:
|
138008
|
-
return [p, v, t];
|
138009
|
-
case 3:
|
138010
|
-
return [p, q, v];
|
138011
|
-
case 4:
|
138012
|
-
return [t, p, v];
|
138013
|
-
case 5:
|
138014
|
-
return [v, p, q];
|
138015
|
-
}
|
138016
|
-
};
|
138017
|
-
convert.hsv.hsl = function (hsv) {
|
138018
|
-
const h = hsv[0];
|
138019
|
-
const s = hsv[1] / 100;
|
138020
|
-
const v = hsv[2] / 100;
|
138021
|
-
const vmin = Math.max(v, 0.01);
|
138022
|
-
let sl;
|
138023
|
-
let l;
|
138024
|
-
l = (2 - s) * v;
|
138025
|
-
const lmin = (2 - s) * vmin;
|
138026
|
-
sl = s * vmin;
|
138027
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
138028
|
-
sl = sl || 0;
|
138029
|
-
l /= 2;
|
138030
|
-
return [h, sl * 100, l * 100];
|
138031
|
-
};
|
138032
|
-
convert.hwb.rgb = function (hwb) {
|
138033
|
-
const h = hwb[0] / 360;
|
138034
|
-
let wh = hwb[1] / 100;
|
138035
|
-
let bl = hwb[2] / 100;
|
138036
|
-
const ratio = wh + bl;
|
138037
|
-
let f;
|
138038
|
-
if (ratio > 1) {
|
138039
|
-
wh /= ratio;
|
138040
|
-
bl /= ratio;
|
138041
|
-
}
|
138042
|
-
const i = Math.floor(6 * h);
|
138043
|
-
const v = 1 - bl;
|
138044
|
-
f = 6 * h - i;
|
138045
|
-
if ((i & 1) !== 0) {
|
138046
|
-
f = 1 - f;
|
138047
|
-
}
|
138048
|
-
const n = wh + f * (v - wh);
|
138049
|
-
let r;
|
138050
|
-
let g;
|
138051
|
-
let b;
|
138052
|
-
switch (i) {
|
138053
|
-
default:
|
138054
|
-
case 6:
|
138055
|
-
case 0:
|
138056
|
-
r = v;
|
138057
|
-
g = n;
|
138058
|
-
b = wh;
|
138059
|
-
break;
|
138060
|
-
case 1:
|
138061
|
-
r = n;
|
138062
|
-
g = v;
|
138063
|
-
b = wh;
|
138064
|
-
break;
|
138065
|
-
case 2:
|
138066
|
-
r = wh;
|
138067
|
-
g = v;
|
138068
|
-
b = n;
|
138069
|
-
break;
|
138070
|
-
case 3:
|
138071
|
-
r = wh;
|
138072
|
-
g = n;
|
138073
|
-
b = v;
|
138074
|
-
break;
|
138075
|
-
case 4:
|
138076
|
-
r = n;
|
138077
|
-
g = wh;
|
138078
|
-
b = v;
|
138079
|
-
break;
|
138080
|
-
case 5:
|
138081
|
-
r = v;
|
138082
|
-
g = wh;
|
138083
|
-
b = n;
|
138084
|
-
break;
|
138085
|
-
}
|
138086
|
-
return [r * 255, g * 255, b * 255];
|
138087
|
-
};
|
138088
|
-
convert.cmyk.rgb = function (cmyk) {
|
138089
|
-
const c = cmyk[0] / 100;
|
138090
|
-
const m = cmyk[1] / 100;
|
138091
|
-
const y = cmyk[2] / 100;
|
138092
|
-
const k = cmyk[3] / 100;
|
138093
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
138094
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
138095
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
138096
|
-
return [r * 255, g * 255, b * 255];
|
138097
|
-
};
|
138098
|
-
convert.xyz.rgb = function (xyz) {
|
138099
|
-
const x = xyz[0] / 100;
|
138100
|
-
const y = xyz[1] / 100;
|
138101
|
-
const z = xyz[2] / 100;
|
138102
|
-
let r;
|
138103
|
-
let g;
|
138104
|
-
let b;
|
138105
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
138106
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
138107
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
138108
|
-
r = r > 0.0031308 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
138109
|
-
g = g > 0.0031308 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
138110
|
-
b = b > 0.0031308 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
138111
|
-
r = Math.min(Math.max(0, r), 1);
|
138112
|
-
g = Math.min(Math.max(0, g), 1);
|
138113
|
-
b = Math.min(Math.max(0, b), 1);
|
138114
|
-
return [r * 255, g * 255, b * 255];
|
138115
|
-
};
|
138116
|
-
convert.xyz.lab = function (xyz) {
|
138117
|
-
let x = xyz[0];
|
138118
|
-
let y = xyz[1];
|
138119
|
-
let z = xyz[2];
|
138120
|
-
x /= 95.047;
|
138121
|
-
y /= 100;
|
138122
|
-
z /= 108.883;
|
138123
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
138124
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
138125
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
138126
|
-
const l = 116 * y - 16;
|
138127
|
-
const a = 500 * (x - y);
|
138128
|
-
const b = 200 * (y - z);
|
138129
|
-
return [l, a, b];
|
138130
|
-
};
|
138131
|
-
convert.lab.xyz = function (lab) {
|
138132
|
-
const l = lab[0];
|
138133
|
-
const a = lab[1];
|
138134
|
-
const b = lab[2];
|
138135
|
-
let x;
|
138136
|
-
let y;
|
138137
|
-
let z;
|
138138
|
-
y = (l + 16) / 116;
|
138139
|
-
x = a / 500 + y;
|
138140
|
-
z = y - b / 200;
|
138141
|
-
const y2 = y ** 3;
|
138142
|
-
const x2 = x ** 3;
|
138143
|
-
const z2 = z ** 3;
|
138144
|
-
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
138145
|
-
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
138146
|
-
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
138147
|
-
x *= 95.047;
|
138148
|
-
y *= 100;
|
138149
|
-
z *= 108.883;
|
138150
|
-
return [x, y, z];
|
138151
|
-
};
|
138152
|
-
convert.lab.lch = function (lab) {
|
138153
|
-
const l = lab[0];
|
138154
|
-
const a = lab[1];
|
138155
|
-
const b = lab[2];
|
138156
|
-
let h;
|
138157
|
-
const hr = Math.atan2(b, a);
|
138158
|
-
h = (hr * 360) / 2 / Math.PI;
|
138159
|
-
if (h < 0) {
|
138160
|
-
h += 360;
|
138161
|
-
}
|
138162
|
-
const c = Math.sqrt(a * a + b * b);
|
138163
|
-
return [l, c, h];
|
138164
|
-
};
|
138165
|
-
convert.lch.lab = function (lch) {
|
138166
|
-
const l = lch[0];
|
138167
|
-
const c = lch[1];
|
138168
|
-
const h = lch[2];
|
138169
|
-
const hr = (h / 360) * 2 * Math.PI;
|
138170
|
-
const a = c * Math.cos(hr);
|
138171
|
-
const b = c * Math.sin(hr);
|
138172
|
-
return [l, a, b];
|
138173
|
-
};
|
138174
|
-
convert.rgb.ansi16 = function (args, saturation = null) {
|
138175
|
-
const [r, g, b] = args;
|
138176
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
138177
|
-
value = Math.round(value / 50);
|
138178
|
-
if (value === 0) {
|
138179
|
-
return 30;
|
138180
|
-
}
|
138181
|
-
let ansi =
|
138182
|
-
30 +
|
138183
|
-
((Math.round(b / 255) << 2) |
|
138184
|
-
(Math.round(g / 255) << 1) |
|
138185
|
-
Math.round(r / 255));
|
138186
|
-
if (value === 2) {
|
138187
|
-
ansi += 60;
|
138188
|
-
}
|
138189
|
-
return ansi;
|
138190
|
-
};
|
138191
|
-
convert.hsv.ansi16 = function (args) {
|
138192
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
138193
|
-
};
|
138194
|
-
convert.rgb.ansi256 = function (args) {
|
138195
|
-
const r = args[0];
|
138196
|
-
const g = args[1];
|
138197
|
-
const b = args[2];
|
138198
|
-
if (r === g && g === b) {
|
138199
|
-
if (r < 8) {
|
138200
|
-
return 16;
|
138201
|
-
}
|
138202
|
-
if (r > 248) {
|
138203
|
-
return 231;
|
138204
|
-
}
|
138205
|
-
return Math.round(((r - 8) / 247) * 24) + 232;
|
138206
|
-
}
|
138207
|
-
const ansi =
|
138208
|
-
16 +
|
138209
|
-
36 * Math.round((r / 255) * 5) +
|
138210
|
-
6 * Math.round((g / 255) * 5) +
|
138211
|
-
Math.round((b / 255) * 5);
|
138212
|
-
return ansi;
|
138213
|
-
};
|
138214
|
-
convert.ansi16.rgb = function (args) {
|
138215
|
-
let color = args % 10;
|
138216
|
-
if (color === 0 || color === 7) {
|
138217
|
-
if (args > 50) {
|
138218
|
-
color += 3.5;
|
138219
|
-
}
|
138220
|
-
color = (color / 10.5) * 255;
|
138221
|
-
return [color, color, color];
|
138222
|
-
}
|
138223
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
138224
|
-
const r = (color & 1) * mult * 255;
|
138225
|
-
const g = ((color >> 1) & 1) * mult * 255;
|
138226
|
-
const b = ((color >> 2) & 1) * mult * 255;
|
138227
|
-
return [r, g, b];
|
138228
|
-
};
|
138229
|
-
convert.ansi256.rgb = function (args) {
|
138230
|
-
if (args >= 232) {
|
138231
|
-
const c = (args - 232) * 10 + 8;
|
138232
|
-
return [c, c, c];
|
138233
|
-
}
|
138234
|
-
args -= 16;
|
138235
|
-
let rem;
|
138236
|
-
const r = (Math.floor(args / 36) / 5) * 255;
|
138237
|
-
const g = (Math.floor((rem = args % 36) / 6) / 5) * 255;
|
138238
|
-
const b = ((rem % 6) / 5) * 255;
|
138239
|
-
return [r, g, b];
|
138240
|
-
};
|
138241
|
-
convert.rgb.hex = function (args) {
|
138242
|
-
const integer =
|
138243
|
-
((Math.round(args[0]) & 255) << 16) +
|
138244
|
-
((Math.round(args[1]) & 255) << 8) +
|
138245
|
-
(Math.round(args[2]) & 255);
|
138246
|
-
const string = integer.toString(16).toUpperCase();
|
138247
|
-
return '000000'.substring(string.length) + string;
|
138248
|
-
};
|
138249
|
-
convert.hex.rgb = function (args) {
|
138250
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
138251
|
-
if (!match) {
|
138252
|
-
return [0, 0, 0];
|
138253
|
-
}
|
138254
|
-
let colorString = match[0];
|
138255
|
-
if (match[0].length === 3) {
|
138256
|
-
colorString = colorString
|
138257
|
-
.split('')
|
138258
|
-
.map(char => char + char)
|
138259
|
-
.join('');
|
138260
|
-
}
|
138261
|
-
const integer = parseInt(colorString, 16);
|
138262
|
-
const r = (integer >> 16) & 255;
|
138263
|
-
const g = (integer >> 8) & 255;
|
138264
|
-
const b = integer & 255;
|
138265
|
-
return [r, g, b];
|
138266
|
-
};
|
138267
|
-
convert.rgb.hcg = function (rgb) {
|
138268
|
-
const r = rgb[0] / 255;
|
138269
|
-
const g = rgb[1] / 255;
|
138270
|
-
const b = rgb[2] / 255;
|
138271
|
-
const max = Math.max(Math.max(r, g), b);
|
138272
|
-
const min = Math.min(Math.min(r, g), b);
|
138273
|
-
const chroma = max - min;
|
138274
|
-
let grayscale;
|
138275
|
-
let hue;
|
138276
|
-
if (chroma < 1) {
|
138277
|
-
grayscale = min / (1 - chroma);
|
138278
|
-
} else {
|
138279
|
-
grayscale = 0;
|
138280
|
-
}
|
138281
|
-
if (chroma <= 0) {
|
138282
|
-
hue = 0;
|
138283
|
-
} else if (max === r) {
|
138284
|
-
hue = ((g - b) / chroma) % 6;
|
138285
|
-
} else if (max === g) {
|
138286
|
-
hue = 2 + (b - r) / chroma;
|
138287
|
-
} else {
|
138288
|
-
hue = 4 + (r - g) / chroma;
|
138289
|
-
}
|
138290
|
-
hue /= 6;
|
138291
|
-
hue %= 1;
|
138292
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
138293
|
-
};
|
138294
|
-
convert.hsl.hcg = function (hsl) {
|
138295
|
-
const s = hsl[1] / 100;
|
138296
|
-
const l = hsl[2] / 100;
|
138297
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
138298
|
-
let f = 0;
|
138299
|
-
if (c < 1) {
|
138300
|
-
f = (l - 0.5 * c) / (1 - c);
|
138301
|
-
}
|
138302
|
-
return [hsl[0], c * 100, f * 100];
|
138303
|
-
};
|
138304
|
-
convert.hsv.hcg = function (hsv) {
|
138305
|
-
const s = hsv[1] / 100;
|
138306
|
-
const v = hsv[2] / 100;
|
138307
|
-
const c = s * v;
|
138308
|
-
let f = 0;
|
138309
|
-
if (c < 1) {
|
138310
|
-
f = (v - c) / (1 - c);
|
138311
|
-
}
|
138312
|
-
return [hsv[0], c * 100, f * 100];
|
138313
|
-
};
|
138314
|
-
convert.hcg.rgb = function (hcg) {
|
138315
|
-
const h = hcg[0] / 360;
|
138316
|
-
const c = hcg[1] / 100;
|
138317
|
-
const g = hcg[2] / 100;
|
138318
|
-
if (c === 0) {
|
138319
|
-
return [g * 255, g * 255, g * 255];
|
138320
|
-
}
|
138321
|
-
const pure = [0, 0, 0];
|
138322
|
-
const hi = (h % 1) * 6;
|
138323
|
-
const v = hi % 1;
|
138324
|
-
const w = 1 - v;
|
138325
|
-
let mg = 0;
|
138326
|
-
switch (Math.floor(hi)) {
|
138327
|
-
case 0:
|
138328
|
-
pure[0] = 1;
|
138329
|
-
pure[1] = v;
|
138330
|
-
pure[2] = 0;
|
138331
|
-
break;
|
138332
|
-
case 1:
|
138333
|
-
pure[0] = w;
|
138334
|
-
pure[1] = 1;
|
138335
|
-
pure[2] = 0;
|
138336
|
-
break;
|
138337
|
-
case 2:
|
138338
|
-
pure[0] = 0;
|
138339
|
-
pure[1] = 1;
|
138340
|
-
pure[2] = v;
|
138341
|
-
break;
|
138342
|
-
case 3:
|
138343
|
-
pure[0] = 0;
|
138344
|
-
pure[1] = w;
|
138345
|
-
pure[2] = 1;
|
138346
|
-
break;
|
138347
|
-
case 4:
|
138348
|
-
pure[0] = v;
|
138349
|
-
pure[1] = 0;
|
138350
|
-
pure[2] = 1;
|
138351
|
-
break;
|
138352
|
-
default:
|
138353
|
-
pure[0] = 1;
|
138354
|
-
pure[1] = 0;
|
138355
|
-
pure[2] = w;
|
138356
|
-
}
|
138357
|
-
mg = (1 - c) * g;
|
138358
|
-
return [
|
138359
|
-
(c * pure[0] + mg) * 255,
|
138360
|
-
(c * pure[1] + mg) * 255,
|
138361
|
-
(c * pure[2] + mg) * 255,
|
138362
|
-
];
|
138363
|
-
};
|
138364
|
-
convert.hcg.hsv = function (hcg) {
|
138365
|
-
const c = hcg[1] / 100;
|
138366
|
-
const g = hcg[2] / 100;
|
138367
|
-
const v = c + g * (1 - c);
|
138368
|
-
let f = 0;
|
138369
|
-
if (v > 0) {
|
138370
|
-
f = c / v;
|
138371
|
-
}
|
138372
|
-
return [hcg[0], f * 100, v * 100];
|
138373
|
-
};
|
138374
|
-
convert.hcg.hsl = function (hcg) {
|
138375
|
-
const c = hcg[1] / 100;
|
138376
|
-
const g = hcg[2] / 100;
|
138377
|
-
const l = g * (1 - c) + 0.5 * c;
|
138378
|
-
let s = 0;
|
138379
|
-
if (l > 0 && l < 0.5) {
|
138380
|
-
s = c / (2 * l);
|
138381
|
-
} else if (l >= 0.5 && l < 1) {
|
138382
|
-
s = c / (2 * (1 - l));
|
138383
|
-
}
|
138384
|
-
return [hcg[0], s * 100, l * 100];
|
138385
|
-
};
|
138386
|
-
convert.hcg.hwb = function (hcg) {
|
138387
|
-
const c = hcg[1] / 100;
|
138388
|
-
const g = hcg[2] / 100;
|
138389
|
-
const v = c + g * (1 - c);
|
138390
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
138391
|
-
};
|
138392
|
-
convert.hwb.hcg = function (hwb) {
|
138393
|
-
const w = hwb[1] / 100;
|
138394
|
-
const b = hwb[2] / 100;
|
138395
|
-
const v = 1 - b;
|
138396
|
-
const c = v - w;
|
138397
|
-
let g = 0;
|
138398
|
-
if (c < 1) {
|
138399
|
-
g = (v - c) / (1 - c);
|
138400
|
-
}
|
138401
|
-
return [hwb[0], c * 100, g * 100];
|
138402
|
-
};
|
138403
|
-
convert.apple.rgb = function (apple) {
|
138404
|
-
return [
|
138405
|
-
(apple[0] / 65535) * 255,
|
138406
|
-
(apple[1] / 65535) * 255,
|
138407
|
-
(apple[2] / 65535) * 255,
|
138408
|
-
];
|
138409
|
-
};
|
138410
|
-
convert.rgb.apple = function (rgb) {
|
138411
|
-
return [
|
138412
|
-
(rgb[0] / 255) * 65535,
|
138413
|
-
(rgb[1] / 255) * 65535,
|
138414
|
-
(rgb[2] / 255) * 65535,
|
138415
|
-
];
|
138416
|
-
};
|
138417
|
-
convert.gray.rgb = function (args) {
|
138418
|
-
return [
|
138419
|
-
(args[0] / 100) * 255,
|
138420
|
-
(args[0] / 100) * 255,
|
138421
|
-
(args[0] / 100) * 255,
|
138422
|
-
];
|
138423
|
-
};
|
138424
|
-
convert.gray.hsl = function (args) {
|
138425
|
-
return [0, 0, args[0]];
|
138426
|
-
};
|
138427
|
-
convert.gray.hsv = convert.gray.hsl;
|
138428
|
-
convert.gray.hwb = function (gray) {
|
138429
|
-
return [0, 100, gray[0]];
|
138430
|
-
};
|
138431
|
-
convert.gray.cmyk = function (gray) {
|
138432
|
-
return [0, 0, 0, gray[0]];
|
138433
|
-
};
|
138434
|
-
convert.gray.lab = function (gray) {
|
138435
|
-
return [gray[0], 0, 0];
|
138436
|
-
};
|
138437
|
-
convert.gray.hex = function (gray) {
|
138438
|
-
const val = Math.round((gray[0] / 100) * 255) & 255;
|
138439
|
-
const integer = (val << 16) + (val << 8) + val;
|
138440
|
-
const string = integer.toString(16).toUpperCase();
|
138441
|
-
return '000000'.substring(string.length) + string;
|
138442
|
-
};
|
138443
|
-
convert.rgb.gray = function (rgb) {
|
138444
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
138445
|
-
return [(val / 255) * 100];
|
138446
|
-
};
|
138447
|
-
return conversions;
|
138448
|
-
}
|
138449
|
-
var route;
|
138450
|
-
var hasRequiredRoute;
|
138451
|
-
function requireRoute() {
|
138452
|
-
if (hasRequiredRoute) return route;
|
138453
|
-
hasRequiredRoute = 1;
|
138454
|
-
const conversions = requireConversions();
|
138455
|
-
function buildGraph() {
|
138456
|
-
const graph = {};
|
138457
|
-
const models = Object.keys(conversions);
|
138458
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
138459
|
-
graph[models[i]] = {distance: -1, parent: null};
|
138460
|
-
}
|
138461
|
-
return graph;
|
138462
|
-
}
|
138463
|
-
function deriveBFS(fromModel) {
|
138464
|
-
const graph = buildGraph();
|
138465
|
-
const queue = [fromModel];
|
138466
|
-
graph[fromModel].distance = 0;
|
138467
|
-
while (queue.length) {
|
138468
|
-
const current = queue.pop();
|
138469
|
-
const adjacents = Object.keys(conversions[current]);
|
138470
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
138471
|
-
const adjacent = adjacents[i];
|
138472
|
-
const node = graph[adjacent];
|
138473
|
-
if (node.distance === -1) {
|
138474
|
-
node.distance = graph[current].distance + 1;
|
138475
|
-
node.parent = current;
|
138476
|
-
queue.unshift(adjacent);
|
138477
|
-
}
|
138478
|
-
}
|
138479
|
-
}
|
138480
|
-
return graph;
|
138481
|
-
}
|
138482
|
-
function link(from, to) {
|
138483
|
-
return function (args) {
|
138484
|
-
return to(from(args));
|
138485
|
-
};
|
138486
|
-
}
|
138487
|
-
function wrapConversion(toModel, graph) {
|
138488
|
-
const path = [graph[toModel].parent, toModel];
|
138489
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
138490
|
-
let cur = graph[toModel].parent;
|
138491
|
-
while (graph[cur].parent) {
|
138492
|
-
path.unshift(graph[cur].parent);
|
138493
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
138494
|
-
cur = graph[cur].parent;
|
138495
|
-
}
|
138496
|
-
fn.conversion = path;
|
138497
|
-
return fn;
|
138498
|
-
}
|
138499
|
-
route = function (fromModel) {
|
138500
|
-
const graph = deriveBFS(fromModel);
|
138501
|
-
const conversion = {};
|
138502
|
-
const models = Object.keys(graph);
|
138503
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
138504
|
-
const toModel = models[i];
|
138505
|
-
const node = graph[toModel];
|
138506
|
-
if (node.parent === null) {
|
138507
|
-
continue;
|
138508
|
-
}
|
138509
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
138510
|
-
}
|
138511
|
-
return conversion;
|
138512
|
-
};
|
138513
|
-
return route;
|
138514
|
-
}
|
138515
|
-
var colorConvert;
|
138516
|
-
var hasRequiredColorConvert;
|
138517
|
-
function requireColorConvert() {
|
138518
|
-
if (hasRequiredColorConvert) return colorConvert;
|
138519
|
-
hasRequiredColorConvert = 1;
|
138520
|
-
const conversions = requireConversions();
|
138521
|
-
const route = requireRoute();
|
138522
|
-
const convert = {};
|
138523
|
-
const models = Object.keys(conversions);
|
138524
|
-
function wrapRaw(fn) {
|
138525
|
-
const wrappedFn = function (...args) {
|
138526
|
-
const arg0 = args[0];
|
138527
|
-
if (arg0 === undefined || arg0 === null) {
|
138528
|
-
return arg0;
|
138529
|
-
}
|
138530
|
-
if (arg0.length > 1) {
|
138531
|
-
args = arg0;
|
138532
|
-
}
|
138533
|
-
return fn(args);
|
138534
|
-
};
|
138535
|
-
if ('conversion' in fn) {
|
138536
|
-
wrappedFn.conversion = fn.conversion;
|
138537
|
-
}
|
138538
|
-
return wrappedFn;
|
138539
|
-
}
|
138540
|
-
function wrapRounded(fn) {
|
138541
|
-
const wrappedFn = function (...args) {
|
138542
|
-
const arg0 = args[0];
|
138543
|
-
if (arg0 === undefined || arg0 === null) {
|
138544
|
-
return arg0;
|
138545
|
-
}
|
138546
|
-
if (arg0.length > 1) {
|
138547
|
-
args = arg0;
|
138548
|
-
}
|
138549
|
-
const result = fn(args);
|
138550
|
-
if (typeof result === 'object') {
|
138551
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
138552
|
-
result[i] = Math.round(result[i]);
|
138553
|
-
}
|
138554
|
-
}
|
138555
|
-
return result;
|
138556
|
-
};
|
138557
|
-
if ('conversion' in fn) {
|
138558
|
-
wrappedFn.conversion = fn.conversion;
|
138559
|
-
}
|
138560
|
-
return wrappedFn;
|
138561
|
-
}
|
138562
|
-
models.forEach(fromModel => {
|
138563
|
-
convert[fromModel] = {};
|
138564
|
-
Object.defineProperty(convert[fromModel], 'channels', {
|
138565
|
-
value: conversions[fromModel].channels,
|
138566
|
-
});
|
138567
|
-
Object.defineProperty(convert[fromModel], 'labels', {
|
138568
|
-
value: conversions[fromModel].labels,
|
138569
|
-
});
|
138570
|
-
const routes = route(fromModel);
|
138571
|
-
const routeModels = Object.keys(routes);
|
138572
|
-
routeModels.forEach(toModel => {
|
138573
|
-
const fn = routes[toModel];
|
138574
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
138575
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
138576
|
-
});
|
138577
|
-
});
|
138578
|
-
colorConvert = convert;
|
138579
|
-
return colorConvert;
|
138580
|
-
}
|
138581
|
-
ansiStyles$1.exports;
|
138582
|
-
(function (module) {
|
138583
|
-
const wrapAnsi16 =
|
138584
|
-
(fn, offset) =>
|
138585
|
-
(...args) => {
|
138586
|
-
const code = fn(...args);
|
138587
|
-
return `[${code + offset}m`;
|
138588
|
-
};
|
138589
|
-
const wrapAnsi256 =
|
138590
|
-
(fn, offset) =>
|
138591
|
-
(...args) => {
|
138592
|
-
const code = fn(...args);
|
138593
|
-
return `[${38 + offset};5;${code}m`;
|
138594
|
-
};
|
138595
|
-
const wrapAnsi16m =
|
138596
|
-
(fn, offset) =>
|
138597
|
-
(...args) => {
|
138598
|
-
const rgb = fn(...args);
|
138599
|
-
return `[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
138600
|
-
};
|
138601
|
-
const ansi2ansi = n => n;
|
138602
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
138603
|
-
const setLazyProperty = (object, property, get) => {
|
138604
|
-
Object.defineProperty(object, property, {
|
138605
|
-
get: () => {
|
138606
|
-
const value = get();
|
138607
|
-
Object.defineProperty(object, property, {
|
138608
|
-
value: value,
|
138609
|
-
enumerable: true,
|
138610
|
-
configurable: true,
|
138611
|
-
});
|
138612
|
-
return value;
|
138613
|
-
},
|
138614
|
-
enumerable: true,
|
138615
|
-
configurable: true,
|
138616
|
-
});
|
138617
|
-
};
|
138618
|
-
let colorConvert;
|
138619
|
-
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
138620
|
-
if (colorConvert === undefined) {
|
138621
|
-
colorConvert = requireColorConvert();
|
138622
|
-
}
|
138623
|
-
const offset = isBackground ? 10 : 0;
|
138624
|
-
const styles = {};
|
138625
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
138626
|
-
const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
|
138627
|
-
if (sourceSpace === targetSpace) {
|
138628
|
-
styles[name] = wrap(identity, offset);
|
138629
|
-
} else if (typeof suite === 'object') {
|
138630
|
-
styles[name] = wrap(suite[targetSpace], offset);
|
138631
|
-
}
|
138632
|
-
}
|
138633
|
-
return styles;
|
138634
|
-
};
|
138635
|
-
function assembleStyles() {
|
138636
|
-
const codes = new Map();
|
138637
|
-
const styles = {
|
138638
|
-
modifier: {
|
138639
|
-
reset: [0, 0],
|
138640
|
-
bold: [1, 22],
|
138641
|
-
dim: [2, 22],
|
138642
|
-
italic: [3, 23],
|
138643
|
-
underline: [4, 24],
|
138644
|
-
inverse: [7, 27],
|
138645
|
-
hidden: [8, 28],
|
138646
|
-
strikethrough: [9, 29],
|
138647
|
-
},
|
138648
|
-
color: {
|
138649
|
-
black: [30, 39],
|
138650
|
-
red: [31, 39],
|
138651
|
-
green: [32, 39],
|
138652
|
-
yellow: [33, 39],
|
138653
|
-
blue: [34, 39],
|
138654
|
-
magenta: [35, 39],
|
138655
|
-
cyan: [36, 39],
|
138656
|
-
white: [37, 39],
|
138657
|
-
blackBright: [90, 39],
|
138658
|
-
redBright: [91, 39],
|
138659
|
-
greenBright: [92, 39],
|
138660
|
-
yellowBright: [93, 39],
|
138661
|
-
blueBright: [94, 39],
|
138662
|
-
magentaBright: [95, 39],
|
138663
|
-
cyanBright: [96, 39],
|
138664
|
-
whiteBright: [97, 39],
|
138665
|
-
},
|
138666
|
-
bgColor: {
|
138667
|
-
bgBlack: [40, 49],
|
138668
|
-
bgRed: [41, 49],
|
138669
|
-
bgGreen: [42, 49],
|
138670
|
-
bgYellow: [43, 49],
|
138671
|
-
bgBlue: [44, 49],
|
138672
|
-
bgMagenta: [45, 49],
|
138673
|
-
bgCyan: [46, 49],
|
138674
|
-
bgWhite: [47, 49],
|
138675
|
-
bgBlackBright: [100, 49],
|
138676
|
-
bgRedBright: [101, 49],
|
138677
|
-
bgGreenBright: [102, 49],
|
138678
|
-
bgYellowBright: [103, 49],
|
138679
|
-
bgBlueBright: [104, 49],
|
138680
|
-
bgMagentaBright: [105, 49],
|
138681
|
-
bgCyanBright: [106, 49],
|
138682
|
-
bgWhiteBright: [107, 49],
|
138683
|
-
},
|
138684
|
-
};
|
138685
|
-
styles.color.gray = styles.color.blackBright;
|
138686
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
138687
|
-
styles.color.grey = styles.color.blackBright;
|
138688
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
138689
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
138690
|
-
for (const [styleName, style] of Object.entries(group)) {
|
138691
|
-
styles[styleName] = {open: `[${style[0]}m`, close: `[${style[1]}m`};
|
138692
|
-
group[styleName] = styles[styleName];
|
138693
|
-
codes.set(style[0], style[1]);
|
138694
|
-
}
|
138695
|
-
Object.defineProperty(styles, groupName, {
|
138696
|
-
value: group,
|
138697
|
-
enumerable: false,
|
138698
|
-
});
|
138699
|
-
}
|
138700
|
-
Object.defineProperty(styles, 'codes', {value: codes, enumerable: false});
|
138701
|
-
styles.color.close = '[39m';
|
138702
|
-
styles.bgColor.close = '[49m';
|
138703
|
-
setLazyProperty(styles.color, 'ansi', () =>
|
138704
|
-
makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)
|
138705
|
-
);
|
138706
|
-
setLazyProperty(styles.color, 'ansi256', () =>
|
138707
|
-
makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)
|
138708
|
-
);
|
138709
|
-
setLazyProperty(styles.color, 'ansi16m', () =>
|
138710
|
-
makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)
|
138711
|
-
);
|
138712
|
-
setLazyProperty(styles.bgColor, 'ansi', () =>
|
138713
|
-
makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)
|
138714
|
-
);
|
138715
|
-
setLazyProperty(styles.bgColor, 'ansi256', () =>
|
138716
|
-
makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)
|
138717
|
-
);
|
138718
|
-
setLazyProperty(styles.bgColor, 'ansi16m', () =>
|
138719
|
-
makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)
|
138720
|
-
);
|
138721
|
-
return styles;
|
138722
|
-
}
|
138723
|
-
Object.defineProperty(module, 'exports', {
|
138724
|
-
enumerable: true,
|
138725
|
-
get: assembleStyles,
|
138726
|
-
});
|
138727
|
-
})(ansiStyles$1);
|
138728
|
-
var ansiStylesExports = ansiStyles$1.exports;
|
138729
|
-
var hasFlag$1 = (flag, argv = process.argv) => {
|
138730
|
-
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
138731
|
-
const position = argv.indexOf(prefix + flag);
|
138732
|
-
const terminatorPosition = argv.indexOf('--');
|
138733
|
-
return (
|
138734
|
-
position !== -1 &&
|
138735
|
-
(terminatorPosition === -1 || position < terminatorPosition)
|
138736
|
-
);
|
138737
|
-
};
|
138738
|
-
const os = require$$0$3;
|
138739
|
-
const tty = require$$0$2;
|
138740
|
-
const hasFlag = hasFlag$1;
|
138741
|
-
const {env: env} = process;
|
138742
|
-
let forceColor;
|
138743
|
-
if (
|
138744
|
-
hasFlag('no-color') ||
|
138745
|
-
hasFlag('no-colors') ||
|
138746
|
-
hasFlag('color=false') ||
|
138747
|
-
hasFlag('color=never')
|
138748
|
-
) {
|
138749
|
-
forceColor = 0;
|
138750
|
-
} else if (
|
138751
|
-
hasFlag('color') ||
|
138752
|
-
hasFlag('colors') ||
|
138753
|
-
hasFlag('color=true') ||
|
138754
|
-
hasFlag('color=always')
|
138755
|
-
) {
|
138756
|
-
forceColor = 1;
|
138757
|
-
}
|
138758
|
-
if ('FORCE_COLOR' in env) {
|
138759
|
-
if (env.FORCE_COLOR === 'true') {
|
138760
|
-
forceColor = 1;
|
138761
|
-
} else if (env.FORCE_COLOR === 'false') {
|
138762
|
-
forceColor = 0;
|
138763
|
-
} else {
|
138764
|
-
forceColor =
|
138765
|
-
env.FORCE_COLOR.length === 0
|
138766
|
-
? 1
|
138767
|
-
: Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
138768
|
-
}
|
138769
|
-
}
|
138770
|
-
function translateLevel(level) {
|
138771
|
-
if (level === 0) {
|
138772
|
-
return false;
|
138773
|
-
}
|
138774
|
-
return {level: level, hasBasic: true, has256: level >= 2, has16m: level >= 3};
|
138775
|
-
}
|
138776
|
-
function supportsColor(haveStream, streamIsTTY) {
|
138777
|
-
if (forceColor === 0) {
|
138778
|
-
return 0;
|
138779
|
-
}
|
138780
|
-
if (
|
138781
|
-
hasFlag('color=16m') ||
|
138782
|
-
hasFlag('color=full') ||
|
138783
|
-
hasFlag('color=truecolor')
|
138784
|
-
) {
|
138785
|
-
return 3;
|
138786
|
-
}
|
138787
|
-
if (hasFlag('color=256')) {
|
138788
|
-
return 2;
|
138789
|
-
}
|
138790
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
138791
|
-
return 0;
|
138792
|
-
}
|
138793
|
-
const min = forceColor || 0;
|
138794
|
-
if (env.TERM === 'dumb') {
|
138795
|
-
return min;
|
138796
|
-
}
|
138797
|
-
if (process.platform === 'win32') {
|
138798
|
-
const osRelease = os.release().split('.');
|
138799
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
138800
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
138801
|
-
}
|
138802
|
-
return 1;
|
138803
|
-
}
|
138804
|
-
if ('CI' in env) {
|
138805
|
-
if (
|
138806
|
-
[
|
138807
|
-
'TRAVIS',
|
138808
|
-
'CIRCLECI',
|
138809
|
-
'APPVEYOR',
|
138810
|
-
'GITLAB_CI',
|
138811
|
-
'GITHUB_ACTIONS',
|
138812
|
-
'BUILDKITE',
|
138813
|
-
].some(sign => sign in env) ||
|
138814
|
-
env.CI_NAME === 'codeship'
|
138815
|
-
) {
|
138816
|
-
return 1;
|
138817
|
-
}
|
138818
|
-
return min;
|
138819
|
-
}
|
138820
|
-
if ('TEAMCITY_VERSION' in env) {
|
138821
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
138822
|
-
}
|
138823
|
-
if (env.COLORTERM === 'truecolor') {
|
138824
|
-
return 3;
|
138825
|
-
}
|
138826
|
-
if ('TERM_PROGRAM' in env) {
|
138827
|
-
const version = parseInt(
|
138828
|
-
(env.TERM_PROGRAM_VERSION || '').split('.')[0],
|
138829
|
-
10
|
138830
|
-
);
|
138831
|
-
switch (env.TERM_PROGRAM) {
|
138832
|
-
case 'iTerm.app':
|
138833
|
-
return version >= 3 ? 3 : 2;
|
138834
|
-
case 'Apple_Terminal':
|
138835
|
-
return 2;
|
138836
|
-
}
|
138837
|
-
}
|
138838
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
138839
|
-
return 2;
|
138840
|
-
}
|
138841
|
-
if (
|
138842
|
-
/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)
|
138843
|
-
) {
|
138844
|
-
return 1;
|
138845
|
-
}
|
138846
|
-
if ('COLORTERM' in env) {
|
138847
|
-
return 1;
|
138848
|
-
}
|
138849
|
-
return min;
|
138850
|
-
}
|
138851
|
-
function getSupportLevel(stream) {
|
138852
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
138853
|
-
return translateLevel(level);
|
138854
|
-
}
|
138855
|
-
var supportsColor_1 = {
|
138856
|
-
supportsColor: getSupportLevel,
|
138857
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
138858
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2))),
|
138859
|
-
};
|
138860
|
-
const stringReplaceAll$1 = (string, substring, replacer) => {
|
138861
|
-
let index = string.indexOf(substring);
|
138862
|
-
if (index === -1) {
|
138863
|
-
return string;
|
138864
|
-
}
|
138865
|
-
const substringLength = substring.length;
|
138866
|
-
let endIndex = 0;
|
138867
|
-
let returnValue = '';
|
138868
|
-
do {
|
138869
|
-
returnValue +=
|
138870
|
-
string.substr(endIndex, index - endIndex) + substring + replacer;
|
138871
|
-
endIndex = index + substringLength;
|
138872
|
-
index = string.indexOf(substring, endIndex);
|
138873
|
-
} while (index !== -1);
|
138874
|
-
returnValue += string.substr(endIndex);
|
138875
|
-
return returnValue;
|
138876
|
-
};
|
138877
|
-
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
138878
|
-
let endIndex = 0;
|
138879
|
-
let returnValue = '';
|
138880
|
-
do {
|
138881
|
-
const gotCR = string[index - 1] === '\r';
|
138882
|
-
returnValue +=
|
138883
|
-
string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) +
|
138884
|
-
prefix +
|
138885
|
-
(gotCR ? '\r\n' : '\n') +
|
138886
|
-
postfix;
|
138887
|
-
endIndex = index + 1;
|
138888
|
-
index = string.indexOf('\n', endIndex);
|
138889
|
-
} while (index !== -1);
|
138890
|
-
returnValue += string.substr(endIndex);
|
138891
|
-
return returnValue;
|
138892
|
-
};
|
138893
|
-
var util = {
|
138894
|
-
stringReplaceAll: stringReplaceAll$1,
|
138895
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1,
|
138896
|
-
};
|
138897
|
-
var templates;
|
138898
|
-
var hasRequiredTemplates;
|
138899
|
-
function requireTemplates() {
|
138900
|
-
if (hasRequiredTemplates) return templates;
|
138901
|
-
hasRequiredTemplates = 1;
|
138902
|
-
const TEMPLATE_REGEX =
|
138903
|
-
/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
138904
|
-
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
138905
|
-
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
138906
|
-
const ESCAPE_REGEX =
|
138907
|
-
/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
138908
|
-
const ESCAPES = new Map([
|
138909
|
-
['n', '\n'],
|
138910
|
-
['r', '\r'],
|
138911
|
-
['t', '\t'],
|
138912
|
-
['b', '\b'],
|
138913
|
-
['f', '\f'],
|
138914
|
-
['v', '\v'],
|
138915
|
-
['0', '\0'],
|
138916
|
-
['\\', '\\'],
|
138917
|
-
['e', ''],
|
138918
|
-
['a', ''],
|
138919
|
-
]);
|
138920
|
-
function unescape(c) {
|
138921
|
-
const u = c[0] === 'u';
|
138922
|
-
const bracket = c[1] === '{';
|
138923
|
-
if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
|
138924
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
138925
|
-
}
|
138926
|
-
if (u && bracket) {
|
138927
|
-
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
138928
|
-
}
|
138929
|
-
return ESCAPES.get(c) || c;
|
138930
|
-
}
|
138931
|
-
function parseArguments(name, arguments_) {
|
138932
|
-
const results = [];
|
138933
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
138934
|
-
let matches;
|
138935
|
-
for (const chunk of chunks) {
|
138936
|
-
const number = Number(chunk);
|
138937
|
-
if (!Number.isNaN(number)) {
|
138938
|
-
results.push(number);
|
138939
|
-
} else if ((matches = chunk.match(STRING_REGEX))) {
|
138940
|
-
results.push(
|
138941
|
-
matches[2].replace(ESCAPE_REGEX, (m, escape, character) =>
|
138942
|
-
escape ? unescape(escape) : character
|
138943
|
-
)
|
138944
|
-
);
|
138945
|
-
} else {
|
138946
|
-
throw new Error(
|
138947
|
-
`Invalid Chalk template style argument: ${chunk} (in style '${name}')`
|
138948
|
-
);
|
138949
|
-
}
|
138950
|
-
}
|
138951
|
-
return results;
|
138952
|
-
}
|
138953
|
-
function parseStyle(style) {
|
138954
|
-
STYLE_REGEX.lastIndex = 0;
|
138955
|
-
const results = [];
|
138956
|
-
let matches;
|
138957
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
138958
|
-
const name = matches[1];
|
138959
|
-
if (matches[2]) {
|
138960
|
-
const args = parseArguments(name, matches[2]);
|
138961
|
-
results.push([name].concat(args));
|
138962
|
-
} else {
|
138963
|
-
results.push([name]);
|
138964
|
-
}
|
138965
|
-
}
|
138966
|
-
return results;
|
138967
|
-
}
|
138968
|
-
function buildStyle(chalk, styles) {
|
138969
|
-
const enabled = {};
|
138970
|
-
for (const layer of styles) {
|
138971
|
-
for (const style of layer.styles) {
|
138972
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
138973
|
-
}
|
138974
|
-
}
|
138975
|
-
let current = chalk;
|
138976
|
-
for (const [styleName, styles] of Object.entries(enabled)) {
|
138977
|
-
if (!Array.isArray(styles)) {
|
138978
|
-
continue;
|
138979
|
-
}
|
138980
|
-
if (!(styleName in current)) {
|
138981
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
138982
|
-
}
|
138983
|
-
current =
|
138984
|
-
styles.length > 0 ? current[styleName](...styles) : current[styleName];
|
138985
|
-
}
|
138986
|
-
return current;
|
138987
|
-
}
|
138988
|
-
templates = (chalk, temporary) => {
|
138989
|
-
const styles = [];
|
138990
|
-
const chunks = [];
|
138991
|
-
let chunk = [];
|
138992
|
-
temporary.replace(
|
138993
|
-
TEMPLATE_REGEX,
|
138994
|
-
(m, escapeCharacter, inverse, style, close, character) => {
|
138995
|
-
if (escapeCharacter) {
|
138996
|
-
chunk.push(unescape(escapeCharacter));
|
138997
|
-
} else if (style) {
|
138998
|
-
const string = chunk.join('');
|
138999
|
-
chunk = [];
|
139000
|
-
chunks.push(
|
139001
|
-
styles.length === 0 ? string : buildStyle(chalk, styles)(string)
|
139002
|
-
);
|
139003
|
-
styles.push({inverse: inverse, styles: parseStyle(style)});
|
139004
|
-
} else if (close) {
|
139005
|
-
if (styles.length === 0) {
|
139006
|
-
throw new Error('Found extraneous } in Chalk template literal');
|
139007
|
-
}
|
139008
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join('')));
|
139009
|
-
chunk = [];
|
139010
|
-
styles.pop();
|
139011
|
-
} else {
|
139012
|
-
chunk.push(character);
|
139013
|
-
}
|
139014
|
-
}
|
139015
|
-
);
|
139016
|
-
chunks.push(chunk.join(''));
|
139017
|
-
if (styles.length > 0) {
|
139018
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
|
139019
|
-
throw new Error(errMessage);
|
139020
|
-
}
|
139021
|
-
return chunks.join('');
|
139022
|
-
};
|
139023
|
-
return templates;
|
139024
|
-
}
|
139025
|
-
const ansiStyles = ansiStylesExports;
|
139026
|
-
const {stdout: stdoutColor, stderr: stderrColor} = supportsColor_1;
|
139027
|
-
const {
|
139028
|
-
stringReplaceAll: stringReplaceAll,
|
139029
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex,
|
139030
|
-
} = util;
|
139031
|
-
const {isArray: isArray} = Array;
|
139032
|
-
const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
|
139033
|
-
const styles = Object.create(null);
|
139034
|
-
const applyOptions = (object, options = {}) => {
|
139035
|
-
if (
|
139036
|
-
options.level &&
|
139037
|
-
!(
|
139038
|
-
Number.isInteger(options.level) &&
|
139039
|
-
options.level >= 0 &&
|
139040
|
-
options.level <= 3
|
139041
|
-
)
|
139042
|
-
) {
|
139043
|
-
throw new Error('The `level` option should be an integer from 0 to 3');
|
139044
|
-
}
|
139045
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
139046
|
-
object.level = options.level === undefined ? colorLevel : options.level;
|
139047
|
-
};
|
139048
|
-
class ChalkClass {
|
139049
|
-
constructor(options) {
|
139050
|
-
return chalkFactory(options);
|
139051
|
-
}
|
139052
|
-
}
|
139053
|
-
const chalkFactory = options => {
|
139054
|
-
const chalk = {};
|
139055
|
-
applyOptions(chalk, options);
|
139056
|
-
chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
|
139057
|
-
Object.setPrototypeOf(chalk, Chalk.prototype);
|
139058
|
-
Object.setPrototypeOf(chalk.template, chalk);
|
139059
|
-
chalk.template.constructor = () => {
|
139060
|
-
throw new Error(
|
139061
|
-
'`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'
|
139062
|
-
);
|
139063
|
-
};
|
139064
|
-
chalk.template.Instance = ChalkClass;
|
139065
|
-
return chalk.template;
|
139066
|
-
};
|
139067
|
-
function Chalk(options) {
|
139068
|
-
return chalkFactory(options);
|
139069
|
-
}
|
139070
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
139071
|
-
styles[styleName] = {
|
139072
|
-
get() {
|
139073
|
-
const builder = createBuilder(
|
139074
|
-
this,
|
139075
|
-
createStyler(style.open, style.close, this._styler),
|
139076
|
-
this._isEmpty
|
139077
|
-
);
|
139078
|
-
Object.defineProperty(this, styleName, {value: builder});
|
139079
|
-
return builder;
|
139080
|
-
},
|
139081
|
-
};
|
139082
|
-
}
|
139083
|
-
styles.visible = {
|
139084
|
-
get() {
|
139085
|
-
const builder = createBuilder(this, this._styler, true);
|
139086
|
-
Object.defineProperty(this, 'visible', {value: builder});
|
139087
|
-
return builder;
|
139088
|
-
},
|
139089
|
-
};
|
139090
|
-
const usedModels = [
|
139091
|
-
'rgb',
|
139092
|
-
'hex',
|
139093
|
-
'keyword',
|
139094
|
-
'hsl',
|
139095
|
-
'hsv',
|
139096
|
-
'hwb',
|
139097
|
-
'ansi',
|
139098
|
-
'ansi256',
|
139099
|
-
];
|
139100
|
-
for (const model of usedModels) {
|
139101
|
-
styles[model] = {
|
139102
|
-
get() {
|
139103
|
-
const {level: level} = this;
|
139104
|
-
return function (...arguments_) {
|
139105
|
-
const styler = createStyler(
|
139106
|
-
ansiStyles.color[levelMapping[level]][model](...arguments_),
|
139107
|
-
ansiStyles.color.close,
|
139108
|
-
this._styler
|
139109
|
-
);
|
139110
|
-
return createBuilder(this, styler, this._isEmpty);
|
139111
|
-
};
|
139112
|
-
},
|
139113
|
-
};
|
139114
|
-
}
|
139115
|
-
for (const model of usedModels) {
|
139116
|
-
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
|
139117
|
-
styles[bgModel] = {
|
139118
|
-
get() {
|
139119
|
-
const {level: level} = this;
|
139120
|
-
return function (...arguments_) {
|
139121
|
-
const styler = createStyler(
|
139122
|
-
ansiStyles.bgColor[levelMapping[level]][model](...arguments_),
|
139123
|
-
ansiStyles.bgColor.close,
|
139124
|
-
this._styler
|
139125
|
-
);
|
139126
|
-
return createBuilder(this, styler, this._isEmpty);
|
139127
|
-
};
|
139128
|
-
},
|
139129
|
-
};
|
139130
|
-
}
|
139131
|
-
const proto = Object.defineProperties(() => {}, {
|
139132
|
-
...styles,
|
139133
|
-
level: {
|
139134
|
-
enumerable: true,
|
139135
|
-
get() {
|
139136
|
-
return this._generator.level;
|
139137
|
-
},
|
139138
|
-
set(level) {
|
139139
|
-
this._generator.level = level;
|
139140
|
-
},
|
139141
|
-
},
|
139142
|
-
});
|
139143
|
-
const createStyler = (open, close, parent) => {
|
139144
|
-
let openAll;
|
139145
|
-
let closeAll;
|
139146
|
-
if (parent === undefined) {
|
139147
|
-
openAll = open;
|
139148
|
-
closeAll = close;
|
139149
|
-
} else {
|
139150
|
-
openAll = parent.openAll + open;
|
139151
|
-
closeAll = close + parent.closeAll;
|
139152
|
-
}
|
139153
|
-
return {
|
139154
|
-
open: open,
|
139155
|
-
close: close,
|
139156
|
-
openAll: openAll,
|
139157
|
-
closeAll: closeAll,
|
139158
|
-
parent: parent,
|
139159
|
-
};
|
139160
|
-
};
|
139161
|
-
const createBuilder = (self, _styler, _isEmpty) => {
|
139162
|
-
const builder = (...arguments_) => {
|
139163
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
139164
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
139165
|
-
}
|
139166
|
-
return applyStyle(
|
139167
|
-
builder,
|
139168
|
-
arguments_.length === 1 ? '' + arguments_[0] : arguments_.join(' ')
|
139169
|
-
);
|
139170
|
-
};
|
139171
|
-
Object.setPrototypeOf(builder, proto);
|
139172
|
-
builder._generator = self;
|
139173
|
-
builder._styler = _styler;
|
139174
|
-
builder._isEmpty = _isEmpty;
|
139175
|
-
return builder;
|
139176
|
-
};
|
139177
|
-
const applyStyle = (self, string) => {
|
139178
|
-
if (self.level <= 0 || !string) {
|
139179
|
-
return self._isEmpty ? '' : string;
|
139180
|
-
}
|
139181
|
-
let styler = self._styler;
|
139182
|
-
if (styler === undefined) {
|
139183
|
-
return string;
|
139184
|
-
}
|
139185
|
-
const {openAll: openAll, closeAll: closeAll} = styler;
|
139186
|
-
if (string.indexOf('') !== -1) {
|
139187
|
-
while (styler !== undefined) {
|
139188
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
139189
|
-
styler = styler.parent;
|
139190
|
-
}
|
139191
|
-
}
|
139192
|
-
const lfIndex = string.indexOf('\n');
|
139193
|
-
if (lfIndex !== -1) {
|
139194
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
139195
|
-
}
|
139196
|
-
return openAll + string + closeAll;
|
139197
|
-
};
|
139198
|
-
let template;
|
139199
|
-
const chalkTag = (chalk, ...strings) => {
|
139200
|
-
const [firstString] = strings;
|
139201
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
139202
|
-
return strings.join(' ');
|
139203
|
-
}
|
139204
|
-
const arguments_ = strings.slice(1);
|
139205
|
-
const parts = [firstString.raw[0]];
|
139206
|
-
for (let i = 1; i < firstString.length; i++) {
|
139207
|
-
parts.push(
|
139208
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
|
139209
|
-
String(firstString.raw[i])
|
139210
|
-
);
|
139211
|
-
}
|
139212
|
-
if (template === undefined) {
|
139213
|
-
template = requireTemplates();
|
139214
|
-
}
|
139215
|
-
return template(chalk, parts.join(''));
|
139216
|
-
};
|
139217
|
-
Object.defineProperties(Chalk.prototype, styles);
|
139218
|
-
const chalk = Chalk();
|
139219
|
-
chalk.supportsColor = stdoutColor;
|
139220
|
-
chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0});
|
139221
|
-
chalk.stderr.supportsColor = stderrColor;
|
139222
|
-
function logDebug(step, value) {}
|
139223
|
-
function logCodegenFunction(step, fn) {}
|
139224
|
-
function logHIRFunction(step, fn) {}
|
139225
|
-
function logReactiveFunction(step, fn) {}
|
139226
137637
|
function inferReactiveScopeVariables(fn) {
|
137638
|
+
var _a, _b;
|
139227
137639
|
const scopeIdentifiers = findDisjointMutableValues(fn);
|
139228
137640
|
const scopes = new Map();
|
139229
137641
|
scopeIdentifiers.forEach((identifier, groupIdentifier) => {
|
@@ -139272,6 +137684,16 @@ function inferReactiveScopeVariables(fn) {
|
|
139272
137684
|
maxInstruction === 0 ||
|
139273
137685
|
scope.range.end > maxInstruction + 1
|
139274
137686
|
) {
|
137687
|
+
(_b =
|
137688
|
+
(_a = fn.env.logger) === null || _a === void 0
|
137689
|
+
? void 0
|
137690
|
+
: _a.debugLogIRs) === null || _b === void 0
|
137691
|
+
? void 0
|
137692
|
+
: _b.call(_a, {
|
137693
|
+
kind: 'hir',
|
137694
|
+
name: 'InferReactiveScopeVariables (invalid scope)',
|
137695
|
+
value: fn,
|
137696
|
+
});
|
139275
137697
|
CompilerError.invariant(false, {
|
139276
137698
|
reason: `Invalid mutable range for scope`,
|
139277
137699
|
loc: GeneratedSource,
|
@@ -146428,7 +144850,7 @@ function mergeReactiveScopesThatInvalidateTogether(fn) {
|
|
146428
144850
|
visitReactiveFunction(fn, lastUsageVisitor, undefined);
|
146429
144851
|
visitReactiveFunction(fn, new Transform$4(lastUsageVisitor.lastUsage), null);
|
146430
144852
|
}
|
146431
|
-
function log
|
144853
|
+
function log(msg) {}
|
146432
144854
|
class FindLastUsageVisitor extends ReactiveFunctionVisitor {
|
146433
144855
|
constructor() {
|
146434
144856
|
super(...arguments);
|
@@ -146481,7 +144903,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146481
144903
|
switch (instr.kind) {
|
146482
144904
|
case 'terminal': {
|
146483
144905
|
if (current !== null) {
|
146484
|
-
log
|
144906
|
+
log(
|
146485
144907
|
`Reset scope @${current.block.scope.id} from terminal [${instr.terminal.id}]`
|
146486
144908
|
);
|
146487
144909
|
reset();
|
@@ -146490,7 +144912,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146490
144912
|
}
|
146491
144913
|
case 'pruned-scope': {
|
146492
144914
|
if (current !== null) {
|
146493
|
-
log
|
144915
|
+
log(
|
146494
144916
|
`Reset scope @${current.block.scope.id} from pruned scope @${instr.scope.id}`
|
146495
144917
|
);
|
146496
144918
|
reset();
|
@@ -146526,7 +144948,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146526
144948
|
current.lvalues.add(lvalue.identifier.declarationId);
|
146527
144949
|
}
|
146528
144950
|
} else {
|
146529
|
-
log
|
144951
|
+
log(
|
146530
144952
|
`Reset scope @${current.block.scope.id} from StoreLocal in [${instr.instruction.id}]`
|
146531
144953
|
);
|
146532
144954
|
reset();
|
@@ -146536,7 +144958,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146536
144958
|
}
|
146537
144959
|
default: {
|
146538
144960
|
if (current !== null) {
|
146539
|
-
log
|
144961
|
+
log(
|
146540
144962
|
`Reset scope @${current.block.scope.id} from instruction [${instr.instruction.id}]`
|
146541
144963
|
);
|
146542
144964
|
reset();
|
@@ -146555,7 +144977,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146555
144977
|
this.lastUsage
|
146556
144978
|
)
|
146557
144979
|
) {
|
146558
|
-
log
|
144980
|
+
log(
|
146559
144981
|
`Can merge scope @${current.block.scope.id} with @${instr.scope.id}`
|
146560
144982
|
);
|
146561
144983
|
current.block.scope.range.end = makeInstructionId(
|
@@ -146568,14 +144990,14 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146568
144990
|
current.to = i + 1;
|
146569
144991
|
current.lvalues.clear();
|
146570
144992
|
if (!scopeIsEligibleForMerging(instr)) {
|
146571
|
-
log
|
144993
|
+
log(
|
146572
144994
|
` but scope @${instr.scope.id} doesnt guaranteed invalidate so it cannot merge further`
|
146573
144995
|
);
|
146574
144996
|
reset();
|
146575
144997
|
}
|
146576
144998
|
} else {
|
146577
144999
|
if (current !== null) {
|
146578
|
-
log
|
145000
|
+
log(
|
146579
145001
|
`Reset scope @${current.block.scope.id}, not mergeable with subsequent scope @${instr.scope.id}`
|
146580
145002
|
);
|
146581
145003
|
reset();
|
@@ -146583,7 +145005,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146583
145005
|
if (scopeIsEligibleForMerging(instr)) {
|
146584
145006
|
current = {block: instr, from: i, to: i + 1, lvalues: new Set()};
|
146585
145007
|
} else {
|
146586
|
-
log
|
145008
|
+
log(
|
146587
145009
|
`scope @${instr.scope.id} doesnt guaranteed invalidate so it cannot merge further`
|
146588
145010
|
);
|
146589
145011
|
}
|
@@ -146602,9 +145024,9 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146602
145024
|
reset();
|
146603
145025
|
}
|
146604
145026
|
if (merged.length) {
|
146605
|
-
log
|
145027
|
+
log(`merged ${merged.length} scopes:`);
|
146606
145028
|
for (const entry of merged) {
|
146607
|
-
log
|
145029
|
+
log(
|
146608
145030
|
printReactiveScopeSummary(entry.block.scope) +
|
146609
145031
|
` from=${entry.from} to=${entry.to}`
|
146610
145032
|
);
|
@@ -146659,7 +145081,7 @@ function areLValuesLastUsedByScope(scope, lvalues, lastUsage) {
|
|
146659
145081
|
for (const lvalue of lvalues) {
|
146660
145082
|
const lastUsedAt = lastUsage.get(lvalue);
|
146661
145083
|
if (lastUsedAt >= scope.range.end) {
|
146662
|
-
log
|
145084
|
+
log(` lvalue ${lvalue} used after scope @${scope.id}, cannot merge`);
|
146663
145085
|
return false;
|
146664
145086
|
}
|
146665
145087
|
}
|
@@ -146700,8 +145122,8 @@ function canMergeScopes(current, next) {
|
|
146700
145122
|
) {
|
146701
145123
|
return true;
|
146702
145124
|
}
|
146703
|
-
log
|
146704
|
-
log
|
145125
|
+
log(` ${printReactiveScopeSummary(current.scope)}`);
|
145126
|
+
log(` ${printReactiveScopeSummary(next.scope)}`);
|
146705
145127
|
return false;
|
146706
145128
|
}
|
146707
145129
|
function isAlwaysInvalidatingType(type) {
|
@@ -150805,6 +149227,7 @@ function analyseFunctions(func) {
|
|
150805
149227
|
}
|
150806
149228
|
}
|
150807
149229
|
function lower(func) {
|
149230
|
+
var _a, _b;
|
150808
149231
|
analyseFunctions(func);
|
150809
149232
|
inferReferenceEffects(func, {isFunctionExpression: true});
|
150810
149233
|
deadCodeElimination(func);
|
@@ -150812,6 +149235,12 @@ function lower(func) {
|
|
150812
149235
|
rewriteInstructionKindsBasedOnReassignment(func);
|
150813
149236
|
inferReactiveScopeVariables(func);
|
150814
149237
|
inferMutableContextVariables(func);
|
149238
|
+
(_b =
|
149239
|
+
(_a = func.env.logger) === null || _a === void 0
|
149240
|
+
? void 0
|
149241
|
+
: _a.debugLogIRs) === null || _b === void 0
|
149242
|
+
? void 0
|
149243
|
+
: _b.call(_a, {kind: 'hir', name: 'AnalyseFunction (inner)', value: func});
|
150815
149244
|
}
|
150816
149245
|
function infer(loweredFunc, state, context) {
|
150817
149246
|
const mutations = new Map();
|
@@ -156371,6 +154800,8 @@ var _Context_instances,
|
|
156371
154800
|
_Context_dependencies,
|
156372
154801
|
_Context_temporaries,
|
156373
154802
|
_Context_temporariesUsedOutsideScope,
|
154803
|
+
_Context_processedInstrsInOptional,
|
154804
|
+
_Context_innerFnContext,
|
156374
154805
|
_Context_checkValidDependency,
|
156375
154806
|
_Context_isScopeActive;
|
156376
154807
|
function propagateScopeDependenciesHIR(fn) {
|
@@ -156480,24 +154911,43 @@ function collectTemporariesSidemap(fn, usedOutsideDeclaringScope) {
|
|
156480
154911
|
fn,
|
156481
154912
|
usedOutsideDeclaringScope,
|
156482
154913
|
temporaries,
|
156483
|
-
|
154914
|
+
null
|
156484
154915
|
);
|
156485
154916
|
return temporaries;
|
156486
154917
|
}
|
154918
|
+
function isLoadContextMutable(instrValue, id) {
|
154919
|
+
if (instrValue.kind === 'LoadContext') {
|
154920
|
+
CompilerError.invariant(instrValue.place.identifier.scope != null, {
|
154921
|
+
reason:
|
154922
|
+
'[PropagateScopeDependencies] Expected all context variables to be assigned a scope',
|
154923
|
+
loc: instrValue.loc,
|
154924
|
+
});
|
154925
|
+
return id >= instrValue.place.identifier.scope.range.end;
|
154926
|
+
}
|
154927
|
+
return false;
|
154928
|
+
}
|
156487
154929
|
function collectTemporariesSidemapImpl(
|
156488
154930
|
fn,
|
156489
154931
|
usedOutsideDeclaringScope,
|
156490
154932
|
temporaries,
|
156491
|
-
|
154933
|
+
innerFnContext
|
156492
154934
|
) {
|
156493
154935
|
for (const [_, block] of fn.body.blocks) {
|
156494
|
-
for (const
|
156495
|
-
|
154936
|
+
for (const {
|
154937
|
+
value: value,
|
154938
|
+
lvalue: lvalue,
|
154939
|
+
id: origInstrId,
|
154940
|
+
} of block.instructions) {
|
154941
|
+
const instrId =
|
154942
|
+
innerFnContext != null ? innerFnContext.instrId : origInstrId;
|
156496
154943
|
const usedOutside = usedOutsideDeclaringScope.has(
|
156497
154944
|
lvalue.identifier.declarationId
|
156498
154945
|
);
|
156499
154946
|
if (value.kind === 'PropertyLoad' && !usedOutside) {
|
156500
|
-
if (
|
154947
|
+
if (
|
154948
|
+
innerFnContext == null ||
|
154949
|
+
temporaries.has(value.object.identifier.id)
|
154950
|
+
) {
|
156501
154951
|
const property = getProperty(
|
156502
154952
|
value.object,
|
156503
154953
|
value.property,
|
@@ -156507,13 +154957,13 @@ function collectTemporariesSidemapImpl(
|
|
156507
154957
|
temporaries.set(lvalue.identifier.id, property);
|
156508
154958
|
}
|
156509
154959
|
} else if (
|
156510
|
-
value.kind === 'LoadLocal' &&
|
154960
|
+
(value.kind === 'LoadLocal' || isLoadContextMutable(value, instrId)) &&
|
156511
154961
|
lvalue.identifier.name == null &&
|
156512
154962
|
value.place.identifier.name !== null &&
|
156513
154963
|
!usedOutside
|
156514
154964
|
) {
|
156515
154965
|
if (
|
156516
|
-
|
154966
|
+
innerFnContext == null ||
|
156517
154967
|
fn.context.some(
|
156518
154968
|
context => context.identifier.id === value.place.identifier.id
|
156519
154969
|
)
|
@@ -156531,7 +154981,9 @@ function collectTemporariesSidemapImpl(
|
|
156531
154981
|
value.loweredFunc.func,
|
156532
154982
|
usedOutsideDeclaringScope,
|
156533
154983
|
temporaries,
|
156534
|
-
|
154984
|
+
innerFnContext !== null && innerFnContext !== void 0
|
154985
|
+
? innerFnContext
|
154986
|
+
: {instrId: instrId}
|
156535
154987
|
);
|
156536
154988
|
}
|
156537
154989
|
}
|
@@ -156557,7 +155009,11 @@ function getProperty(object, propertyName, optional, temporaries) {
|
|
156557
155009
|
return property;
|
156558
155010
|
}
|
156559
155011
|
class Context {
|
156560
|
-
constructor(
|
155012
|
+
constructor(
|
155013
|
+
temporariesUsedOutsideScope,
|
155014
|
+
temporaries,
|
155015
|
+
processedInstrsInOptional
|
155016
|
+
) {
|
156561
155017
|
_Context_instances.add(this);
|
156562
155018
|
_Context_declarations.set(this, new Map());
|
156563
155019
|
_Context_reassignments.set(this, new Map());
|
@@ -156566,7 +155022,8 @@ class Context {
|
|
156566
155022
|
this.deps = new Map();
|
156567
155023
|
_Context_temporaries.set(this, void 0);
|
156568
155024
|
_Context_temporariesUsedOutsideScope.set(this, void 0);
|
156569
|
-
this
|
155025
|
+
_Context_processedInstrsInOptional.set(this, void 0);
|
155026
|
+
_Context_innerFnContext.set(this, null);
|
156570
155027
|
__classPrivateFieldSet(
|
156571
155028
|
this,
|
156572
155029
|
_Context_temporariesUsedOutsideScope,
|
@@ -156574,6 +155031,12 @@ class Context {
|
|
156574
155031
|
'f'
|
156575
155032
|
);
|
156576
155033
|
__classPrivateFieldSet(this, _Context_temporaries, temporaries, 'f');
|
155034
|
+
__classPrivateFieldSet(
|
155035
|
+
this,
|
155036
|
+
_Context_processedInstrsInOptional,
|
155037
|
+
processedInstrsInOptional,
|
155038
|
+
'f'
|
155039
|
+
);
|
156577
155040
|
}
|
156578
155041
|
enterScope(scope) {
|
156579
155042
|
__classPrivateFieldSet(
|
@@ -156642,7 +155105,8 @@ class Context {
|
|
156642
155105
|
).has(place.identifier.declarationId);
|
156643
155106
|
}
|
156644
155107
|
declare(identifier, decl) {
|
156645
|
-
if (this
|
155108
|
+
if (__classPrivateFieldGet(this, _Context_innerFnContext, 'f') != null)
|
155109
|
+
return;
|
156646
155110
|
if (
|
156647
155111
|
!__classPrivateFieldGet(this, _Context_declarations, 'f').has(
|
156648
155112
|
identifier.declarationId
|
@@ -156753,6 +155217,37 @@ class Context {
|
|
156753
155217
|
currentScope.reassignments.add(place.identifier);
|
156754
155218
|
}
|
156755
155219
|
}
|
155220
|
+
enterInnerFn(innerFn, cb) {
|
155221
|
+
var _a;
|
155222
|
+
const prevContext = __classPrivateFieldGet(
|
155223
|
+
this,
|
155224
|
+
_Context_innerFnContext,
|
155225
|
+
'f'
|
155226
|
+
);
|
155227
|
+
__classPrivateFieldSet(
|
155228
|
+
this,
|
155229
|
+
_Context_innerFnContext,
|
155230
|
+
(_a = __classPrivateFieldGet(this, _Context_innerFnContext, 'f')) !==
|
155231
|
+
null && _a !== void 0
|
155232
|
+
? _a
|
155233
|
+
: {outerInstrId: innerFn.id},
|
155234
|
+
'f'
|
155235
|
+
);
|
155236
|
+
const result = cb();
|
155237
|
+
__classPrivateFieldSet(this, _Context_innerFnContext, prevContext, 'f');
|
155238
|
+
return result;
|
155239
|
+
}
|
155240
|
+
isDeferredDependency(instr) {
|
155241
|
+
return (
|
155242
|
+
__classPrivateFieldGet(this, _Context_processedInstrsInOptional, 'f').has(
|
155243
|
+
instr.value
|
155244
|
+
) ||
|
155245
|
+
(instr.kind === HIRValue.Instruction &&
|
155246
|
+
__classPrivateFieldGet(this, _Context_temporaries, 'f').has(
|
155247
|
+
instr.value.lvalue.identifier.id
|
155248
|
+
))
|
155249
|
+
);
|
155250
|
+
}
|
156756
155251
|
}
|
156757
155252
|
(_Context_declarations = new WeakMap()),
|
156758
155253
|
(_Context_reassignments = new WeakMap()),
|
@@ -156760,6 +155255,8 @@ class Context {
|
|
156760
155255
|
(_Context_dependencies = new WeakMap()),
|
156761
155256
|
(_Context_temporaries = new WeakMap()),
|
156762
155257
|
(_Context_temporariesUsedOutsideScope = new WeakMap()),
|
155258
|
+
(_Context_processedInstrsInOptional = new WeakMap()),
|
155259
|
+
(_Context_innerFnContext = new WeakMap()),
|
156763
155260
|
(_Context_instances = new WeakSet()),
|
156764
155261
|
(_Context_checkValidDependency = function _Context_checkValidDependency(
|
156765
155262
|
maybeDependency
|
@@ -156795,20 +155292,21 @@ class Context {
|
|
156795
155292
|
state => state === scope
|
156796
155293
|
);
|
156797
155294
|
});
|
155295
|
+
var HIRValue;
|
155296
|
+
(function (HIRValue) {
|
155297
|
+
HIRValue[(HIRValue['Instruction'] = 1)] = 'Instruction';
|
155298
|
+
HIRValue[(HIRValue['Terminal'] = 2)] = 'Terminal';
|
155299
|
+
})(HIRValue || (HIRValue = {}));
|
156798
155300
|
function handleInstruction(instr, context) {
|
156799
155301
|
const {id: id, value: value, lvalue: lvalue} = instr;
|
156800
|
-
|
156801
|
-
|
156802
|
-
|
156803
|
-
|
156804
|
-
|
156805
|
-
|
156806
|
-
|
156807
|
-
|
156808
|
-
} else if (value.kind === 'PropertyLoad') {
|
156809
|
-
if (context.isUsedOutsideDeclaringScope(lvalue)) {
|
156810
|
-
context.visitProperty(value.object, value.property, false);
|
156811
|
-
}
|
155302
|
+
context.declare(lvalue.identifier, {id: id, scope: context.currentScope});
|
155303
|
+
if (
|
155304
|
+
context.isDeferredDependency({kind: HIRValue.Instruction, value: instr})
|
155305
|
+
) {
|
155306
|
+
return;
|
155307
|
+
}
|
155308
|
+
if (value.kind === 'PropertyLoad') {
|
155309
|
+
context.visitProperty(value.object, value.property, false);
|
156812
155310
|
} else if (value.kind === 'StoreLocal') {
|
156813
155311
|
context.visitOperand(value.value);
|
156814
155312
|
if (value.lvalue.kind === InstructionKind.Reassign) {
|
@@ -156836,7 +155334,6 @@ function handleInstruction(instr, context) {
|
|
156836
155334
|
context.visitOperand(operand);
|
156837
155335
|
}
|
156838
155336
|
}
|
156839
|
-
context.declare(lvalue.identifier, {id: id, scope: context.currentScope});
|
156840
155337
|
}
|
156841
155338
|
function collectDependencies(
|
156842
155339
|
fn,
|
@@ -156844,7 +155341,11 @@ function collectDependencies(
|
|
156844
155341
|
temporaries,
|
156845
155342
|
processedInstrsInOptional
|
156846
155343
|
) {
|
156847
|
-
const context = new Context(
|
155344
|
+
const context = new Context(
|
155345
|
+
usedOutsideDeclaringScope,
|
155346
|
+
temporaries,
|
155347
|
+
processedInstrsInOptional
|
155348
|
+
);
|
156848
155349
|
for (const param of fn.params) {
|
156849
155350
|
if (param.kind === 'Identifier') {
|
156850
155351
|
context.declare(param.identifier, {
|
@@ -156894,15 +155395,20 @@ function collectDependencies(
|
|
156894
155395
|
id: instr.id,
|
156895
155396
|
scope: context.currentScope,
|
156896
155397
|
});
|
156897
|
-
const
|
156898
|
-
context.
|
156899
|
-
|
156900
|
-
|
156901
|
-
} else
|
155398
|
+
const innerFn = instr.value.loweredFunc.func;
|
155399
|
+
context.enterInnerFn(instr, () => {
|
155400
|
+
handleFunction(innerFn);
|
155401
|
+
});
|
155402
|
+
} else {
|
156902
155403
|
handleInstruction(instr, context);
|
156903
155404
|
}
|
156904
155405
|
}
|
156905
|
-
if (
|
155406
|
+
if (
|
155407
|
+
!context.isDeferredDependency({
|
155408
|
+
kind: HIRValue.Terminal,
|
155409
|
+
value: block.terminal,
|
155410
|
+
})
|
155411
|
+
) {
|
156906
155412
|
for (const place of eachTerminalOperand(block.terminal)) {
|
156907
155413
|
context.visitOperand(place);
|
156908
155414
|
}
|
@@ -157290,7 +155796,7 @@ function optimizePropsMethodCalls(fn) {
|
|
157290
155796
|
}
|
157291
155797
|
}
|
157292
155798
|
}
|
157293
|
-
function
|
155799
|
+
function run(
|
157294
155800
|
func,
|
157295
155801
|
config,
|
157296
155802
|
fnType,
|
@@ -157299,6 +155805,7 @@ function* run(
|
|
157299
155805
|
filename,
|
157300
155806
|
code
|
157301
155807
|
) {
|
155808
|
+
var _a, _b;
|
157302
155809
|
const contextIdentifiers = findContextIdentifiers(func);
|
157303
155810
|
const env = new Environment(
|
157304
155811
|
func.scope,
|
@@ -157310,19 +155817,30 @@ function* run(
|
|
157310
155817
|
code,
|
157311
155818
|
useMemoCacheIdentifier
|
157312
155819
|
);
|
157313
|
-
|
157314
|
-
|
157315
|
-
|
157316
|
-
|
157317
|
-
|
157318
|
-
|
157319
|
-
|
155820
|
+
(_b =
|
155821
|
+
(_a = env.logger) === null || _a === void 0 ? void 0 : _a.debugLogIRs) ===
|
155822
|
+
null || _b === void 0
|
155823
|
+
? void 0
|
155824
|
+
: _b.call(_a, {
|
155825
|
+
kind: 'debug',
|
155826
|
+
name: 'EnvironmentConfig',
|
155827
|
+
value: prettyFormat$1(env.config),
|
155828
|
+
});
|
155829
|
+
return runWithEnvironment(func, env);
|
157320
155830
|
}
|
157321
|
-
function
|
155831
|
+
function runWithEnvironment(func, env) {
|
155832
|
+
const log = value => {
|
155833
|
+
var _a, _b;
|
155834
|
+
(_b =
|
155835
|
+
(_a = env.logger) === null || _a === void 0 ? void 0 : _a.debugLogIRs) ===
|
155836
|
+
null || _b === void 0
|
155837
|
+
? void 0
|
155838
|
+
: _b.call(_a, value);
|
155839
|
+
};
|
157322
155840
|
const hir = lower$1(func, env).unwrap();
|
157323
|
-
|
155841
|
+
log({kind: 'hir', name: 'HIR', value: hir});
|
157324
155842
|
pruneMaybeThrows(hir);
|
157325
|
-
|
155843
|
+
log({kind: 'hir', name: 'PruneMaybeThrows', value: hir});
|
157326
155844
|
validateContextVariableLValues(hir);
|
157327
155845
|
validateUseMemo(hir);
|
157328
155846
|
if (
|
@@ -157331,27 +155849,27 @@ function* runWithEnvironment(func, env) {
|
|
157331
155849
|
!env.config.enableChangeDetectionForDebugging
|
157332
155850
|
) {
|
157333
155851
|
dropManualMemoization(hir);
|
157334
|
-
|
155852
|
+
log({kind: 'hir', name: 'DropManualMemoization', value: hir});
|
157335
155853
|
}
|
157336
155854
|
inlineImmediatelyInvokedFunctionExpressions(hir);
|
157337
|
-
|
155855
|
+
log({
|
157338
155856
|
kind: 'hir',
|
157339
155857
|
name: 'InlineImmediatelyInvokedFunctionExpressions',
|
157340
155858
|
value: hir,
|
157341
155859
|
});
|
157342
155860
|
mergeConsecutiveBlocks(hir);
|
157343
|
-
|
155861
|
+
log({kind: 'hir', name: 'MergeConsecutiveBlocks', value: hir});
|
157344
155862
|
assertConsistentIdentifiers(hir);
|
157345
155863
|
assertTerminalSuccessorsExist(hir);
|
157346
155864
|
enterSSA(hir);
|
157347
|
-
|
155865
|
+
log({kind: 'hir', name: 'SSA', value: hir});
|
157348
155866
|
eliminateRedundantPhi(hir);
|
157349
|
-
|
155867
|
+
log({kind: 'hir', name: 'EliminateRedundantPhi', value: hir});
|
157350
155868
|
assertConsistentIdentifiers(hir);
|
157351
155869
|
constantPropagation(hir);
|
157352
|
-
|
155870
|
+
log({kind: 'hir', name: 'ConstantPropagation', value: hir});
|
157353
155871
|
inferTypes(hir);
|
157354
|
-
|
155872
|
+
log({kind: 'hir', name: 'InferTypes', value: hir});
|
157355
155873
|
if (env.config.validateHooksUsage) {
|
157356
155874
|
validateHooksUsage(hir);
|
157357
155875
|
}
|
@@ -157362,22 +155880,22 @@ function* runWithEnvironment(func, env) {
|
|
157362
155880
|
lowerContextAccess(hir, env.config.lowerContextAccess);
|
157363
155881
|
}
|
157364
155882
|
optimizePropsMethodCalls(hir);
|
157365
|
-
|
155883
|
+
log({kind: 'hir', name: 'OptimizePropsMethodCalls', value: hir});
|
157366
155884
|
analyseFunctions(hir);
|
157367
|
-
|
155885
|
+
log({kind: 'hir', name: 'AnalyseFunctions', value: hir});
|
157368
155886
|
inferReferenceEffects(hir);
|
157369
|
-
|
155887
|
+
log({kind: 'hir', name: 'InferReferenceEffects', value: hir});
|
157370
155888
|
validateLocalsNotReassignedAfterRender(hir);
|
157371
155889
|
deadCodeElimination(hir);
|
157372
|
-
|
155890
|
+
log({kind: 'hir', name: 'DeadCodeElimination', value: hir});
|
157373
155891
|
if (env.config.enableInstructionReordering) {
|
157374
155892
|
instructionReordering(hir);
|
157375
|
-
|
155893
|
+
log({kind: 'hir', name: 'InstructionReordering', value: hir});
|
157376
155894
|
}
|
157377
155895
|
pruneMaybeThrows(hir);
|
157378
|
-
|
155896
|
+
log({kind: 'hir', name: 'PruneMaybeThrows', value: hir});
|
157379
155897
|
inferMutableRanges(hir);
|
157380
|
-
|
155898
|
+
log({kind: 'hir', name: 'InferMutableRanges', value: hir});
|
157381
155899
|
if (env.config.assertValidMutableRanges) {
|
157382
155900
|
assertValidMutableRanges(hir);
|
157383
155901
|
}
|
@@ -157394,157 +155912,125 @@ function* runWithEnvironment(func, env) {
|
|
157394
155912
|
validateNoJSXInTryStatement(hir);
|
157395
155913
|
}
|
157396
155914
|
inferReactivePlaces(hir);
|
157397
|
-
|
155915
|
+
log({kind: 'hir', name: 'InferReactivePlaces', value: hir});
|
157398
155916
|
rewriteInstructionKindsBasedOnReassignment(hir);
|
157399
|
-
|
155917
|
+
log({
|
157400
155918
|
kind: 'hir',
|
157401
155919
|
name: 'RewriteInstructionKindsBasedOnReassignment',
|
157402
155920
|
value: hir,
|
157403
155921
|
});
|
157404
155922
|
propagatePhiTypes(hir);
|
157405
|
-
|
155923
|
+
log({kind: 'hir', name: 'PropagatePhiTypes', value: hir});
|
157406
155924
|
inferReactiveScopeVariables(hir);
|
157407
|
-
|
155925
|
+
log({kind: 'hir', name: 'InferReactiveScopeVariables', value: hir});
|
157408
155926
|
const fbtOperands = memoizeFbtAndMacroOperandsInSameScope(hir);
|
157409
|
-
|
157410
|
-
kind: 'hir',
|
157411
|
-
name: 'MemoizeFbtAndMacroOperandsInSameScope',
|
157412
|
-
value: hir,
|
157413
|
-
});
|
155927
|
+
log({kind: 'hir', name: 'MemoizeFbtAndMacroOperandsInSameScope', value: hir});
|
157414
155928
|
if (env.config.enableJsxOutlining) {
|
157415
155929
|
outlineJSX(hir);
|
157416
155930
|
}
|
157417
155931
|
if (env.config.enableFunctionOutlining) {
|
157418
155932
|
outlineFunctions(hir, fbtOperands);
|
157419
|
-
|
155933
|
+
log({kind: 'hir', name: 'OutlineFunctions', value: hir});
|
157420
155934
|
}
|
157421
155935
|
alignMethodCallScopes(hir);
|
157422
|
-
|
155936
|
+
log({kind: 'hir', name: 'AlignMethodCallScopes', value: hir});
|
157423
155937
|
alignObjectMethodScopes(hir);
|
157424
|
-
|
155938
|
+
log({kind: 'hir', name: 'AlignObjectMethodScopes', value: hir});
|
157425
155939
|
pruneUnusedLabelsHIR(hir);
|
157426
|
-
|
155940
|
+
log({kind: 'hir', name: 'PruneUnusedLabelsHIR', value: hir});
|
157427
155941
|
alignReactiveScopesToBlockScopesHIR(hir);
|
157428
|
-
|
157429
|
-
kind: 'hir',
|
157430
|
-
name: 'AlignReactiveScopesToBlockScopesHIR',
|
157431
|
-
value: hir,
|
157432
|
-
});
|
155942
|
+
log({kind: 'hir', name: 'AlignReactiveScopesToBlockScopesHIR', value: hir});
|
157433
155943
|
mergeOverlappingReactiveScopesHIR(hir);
|
157434
|
-
|
157435
|
-
kind: 'hir',
|
157436
|
-
name: 'MergeOverlappingReactiveScopesHIR',
|
157437
|
-
value: hir,
|
157438
|
-
});
|
155944
|
+
log({kind: 'hir', name: 'MergeOverlappingReactiveScopesHIR', value: hir});
|
157439
155945
|
assertValidBlockNesting(hir);
|
157440
155946
|
buildReactiveScopeTerminalsHIR(hir);
|
157441
|
-
|
155947
|
+
log({kind: 'hir', name: 'BuildReactiveScopeTerminalsHIR', value: hir});
|
157442
155948
|
assertValidBlockNesting(hir);
|
157443
155949
|
flattenReactiveLoopsHIR(hir);
|
157444
|
-
|
155950
|
+
log({kind: 'hir', name: 'FlattenReactiveLoopsHIR', value: hir});
|
157445
155951
|
flattenScopesWithHooksOrUseHIR(hir);
|
157446
|
-
|
155952
|
+
log({kind: 'hir', name: 'FlattenScopesWithHooksOrUseHIR', value: hir});
|
157447
155953
|
assertTerminalSuccessorsExist(hir);
|
157448
155954
|
assertTerminalPredsExist(hir);
|
157449
155955
|
propagateScopeDependenciesHIR(hir);
|
157450
|
-
|
155956
|
+
log({kind: 'hir', name: 'PropagateScopeDependenciesHIR', value: hir});
|
157451
155957
|
if (env.config.inferEffectDependencies) {
|
157452
155958
|
inferEffectDependencies(hir);
|
157453
155959
|
}
|
157454
155960
|
if (env.config.inlineJsxTransform) {
|
157455
155961
|
inlineJsxTransform(hir, env.config.inlineJsxTransform);
|
157456
|
-
|
155962
|
+
log({kind: 'hir', name: 'inlineJsxTransform', value: hir});
|
157457
155963
|
}
|
157458
155964
|
const reactiveFunction = buildReactiveFunction(hir);
|
157459
|
-
|
155965
|
+
log({
|
157460
155966
|
kind: 'reactive',
|
157461
155967
|
name: 'BuildReactiveFunction',
|
157462
155968
|
value: reactiveFunction,
|
157463
155969
|
});
|
157464
155970
|
assertWellFormedBreakTargets(reactiveFunction);
|
157465
155971
|
pruneUnusedLabels(reactiveFunction);
|
157466
|
-
|
157467
|
-
kind: 'reactive',
|
157468
|
-
name: 'PruneUnusedLabels',
|
157469
|
-
value: reactiveFunction,
|
157470
|
-
});
|
155972
|
+
log({kind: 'reactive', name: 'PruneUnusedLabels', value: reactiveFunction});
|
157471
155973
|
assertScopeInstructionsWithinScopes(reactiveFunction);
|
157472
155974
|
pruneNonEscapingScopes(reactiveFunction);
|
157473
|
-
|
155975
|
+
log({
|
157474
155976
|
kind: 'reactive',
|
157475
155977
|
name: 'PruneNonEscapingScopes',
|
157476
155978
|
value: reactiveFunction,
|
157477
155979
|
});
|
157478
155980
|
pruneNonReactiveDependencies(reactiveFunction);
|
157479
|
-
|
155981
|
+
log({
|
157480
155982
|
kind: 'reactive',
|
157481
155983
|
name: 'PruneNonReactiveDependencies',
|
157482
155984
|
value: reactiveFunction,
|
157483
155985
|
});
|
157484
155986
|
pruneUnusedScopes(reactiveFunction);
|
157485
|
-
|
157486
|
-
kind: 'reactive',
|
157487
|
-
name: 'PruneUnusedScopes',
|
157488
|
-
value: reactiveFunction,
|
157489
|
-
});
|
155987
|
+
log({kind: 'reactive', name: 'PruneUnusedScopes', value: reactiveFunction});
|
157490
155988
|
mergeReactiveScopesThatInvalidateTogether(reactiveFunction);
|
157491
|
-
|
155989
|
+
log({
|
157492
155990
|
kind: 'reactive',
|
157493
155991
|
name: 'MergeReactiveScopesThatInvalidateTogether',
|
157494
155992
|
value: reactiveFunction,
|
157495
155993
|
});
|
157496
155994
|
pruneAlwaysInvalidatingScopes(reactiveFunction);
|
157497
|
-
|
155995
|
+
log({
|
157498
155996
|
kind: 'reactive',
|
157499
155997
|
name: 'PruneAlwaysInvalidatingScopes',
|
157500
155998
|
value: reactiveFunction,
|
157501
155999
|
});
|
157502
156000
|
if (env.config.enableChangeDetectionForDebugging != null) {
|
157503
156001
|
pruneInitializationDependencies(reactiveFunction);
|
157504
|
-
|
156002
|
+
log({
|
157505
156003
|
kind: 'reactive',
|
157506
156004
|
name: 'PruneInitializationDependencies',
|
157507
156005
|
value: reactiveFunction,
|
157508
156006
|
});
|
157509
156007
|
}
|
157510
156008
|
propagateEarlyReturns(reactiveFunction);
|
157511
|
-
|
156009
|
+
log({
|
157512
156010
|
kind: 'reactive',
|
157513
156011
|
name: 'PropagateEarlyReturns',
|
157514
156012
|
value: reactiveFunction,
|
157515
156013
|
});
|
157516
156014
|
pruneUnusedLValues(reactiveFunction);
|
157517
|
-
|
157518
|
-
kind: 'reactive',
|
157519
|
-
name: 'PruneUnusedLValues',
|
157520
|
-
value: reactiveFunction,
|
157521
|
-
});
|
156015
|
+
log({kind: 'reactive', name: 'PruneUnusedLValues', value: reactiveFunction});
|
157522
156016
|
promoteUsedTemporaries(reactiveFunction);
|
157523
|
-
|
156017
|
+
log({
|
157524
156018
|
kind: 'reactive',
|
157525
156019
|
name: 'PromoteUsedTemporaries',
|
157526
156020
|
value: reactiveFunction,
|
157527
156021
|
});
|
157528
156022
|
extractScopeDeclarationsFromDestructuring(reactiveFunction);
|
157529
|
-
|
156023
|
+
log({
|
157530
156024
|
kind: 'reactive',
|
157531
156025
|
name: 'ExtractScopeDeclarationsFromDestructuring',
|
157532
156026
|
value: reactiveFunction,
|
157533
156027
|
});
|
157534
156028
|
stabilizeBlockIds(reactiveFunction);
|
157535
|
-
|
157536
|
-
kind: 'reactive',
|
157537
|
-
name: 'StabilizeBlockIds',
|
157538
|
-
value: reactiveFunction,
|
157539
|
-
});
|
156029
|
+
log({kind: 'reactive', name: 'StabilizeBlockIds', value: reactiveFunction});
|
157540
156030
|
const uniqueIdentifiers = renameVariables(reactiveFunction);
|
157541
|
-
|
157542
|
-
kind: 'reactive',
|
157543
|
-
name: 'RenameVariables',
|
157544
|
-
value: reactiveFunction,
|
157545
|
-
});
|
156031
|
+
log({kind: 'reactive', name: 'RenameVariables', value: reactiveFunction});
|
157546
156032
|
pruneHoistedContexts(reactiveFunction);
|
157547
|
-
|
156033
|
+
log({
|
157548
156034
|
kind: 'reactive',
|
157549
156035
|
name: 'PruneHoistedContexts',
|
157550
156036
|
value: reactiveFunction,
|
@@ -157562,9 +156048,9 @@ function* runWithEnvironment(func, env) {
|
|
157562
156048
|
uniqueIdentifiers: uniqueIdentifiers,
|
157563
156049
|
fbtOperands: fbtOperands,
|
157564
156050
|
}).unwrap();
|
157565
|
-
|
156051
|
+
log({kind: 'ast', name: 'Codegen', value: ast});
|
157566
156052
|
for (const outlined of ast.outlined) {
|
157567
|
-
|
156053
|
+
log({kind: 'ast', name: 'Codegen (outlined)', value: outlined.fn});
|
157568
156054
|
}
|
157569
156055
|
if (env.config.throwUnknownException__testonly) {
|
157570
156056
|
throw new Error('unexpected error');
|
@@ -157580,7 +156066,7 @@ function compileFn(
|
|
157580
156066
|
filename,
|
157581
156067
|
code
|
157582
156068
|
) {
|
157583
|
-
|
156069
|
+
return run(
|
157584
156070
|
func,
|
157585
156071
|
config,
|
157586
156072
|
fnType,
|
@@ -157589,40 +156075,6 @@ function compileFn(
|
|
157589
156075
|
filename,
|
157590
156076
|
code
|
157591
156077
|
);
|
157592
|
-
while (true) {
|
157593
|
-
const next = generator.next();
|
157594
|
-
if (next.done) {
|
157595
|
-
return next.value;
|
157596
|
-
}
|
157597
|
-
}
|
157598
|
-
}
|
157599
|
-
function log(value) {
|
157600
|
-
switch (value.kind) {
|
157601
|
-
case 'ast': {
|
157602
|
-
logCodegenFunction(value.name, value.value);
|
157603
|
-
break;
|
157604
|
-
}
|
157605
|
-
case 'hir': {
|
157606
|
-
logHIRFunction(value.name, value.value);
|
157607
|
-
break;
|
157608
|
-
}
|
157609
|
-
case 'reactive': {
|
157610
|
-
logReactiveFunction(value.name, value.value);
|
157611
|
-
break;
|
157612
|
-
}
|
157613
|
-
case 'debug': {
|
157614
|
-
logDebug(value.name, value.value);
|
157615
|
-
break;
|
157616
|
-
}
|
157617
|
-
default: {
|
157618
|
-
assertExhaustive(value, 'Unexpected compilation kind');
|
157619
|
-
}
|
157620
|
-
}
|
157621
|
-
return value;
|
157622
|
-
}
|
157623
|
-
function* runPlayground(func, config, fnType) {
|
157624
|
-
const ast = yield* run(func, config, fnType, '_c', null, null, null);
|
157625
|
-
return ast;
|
157626
156078
|
}
|
157627
156079
|
function isComponentDeclaration(node) {
|
157628
156080
|
return Object.prototype.hasOwnProperty.call(node, '__componentDeclaration');
|
@@ -158641,7 +157093,10 @@ function BabelPluginReactCompiler(_babel) {
|
|
158641
157093
|
) {
|
158642
157094
|
opts = injectReanimatedFlag(opts);
|
158643
157095
|
}
|
158644
|
-
if (
|
157096
|
+
if (
|
157097
|
+
opts.environment.enableResetCacheOnSourceFileChanges !== false &&
|
157098
|
+
isDev
|
157099
|
+
) {
|
158645
157100
|
opts = Object.assign(Object.assign({}, opts), {
|
158646
157101
|
environment: Object.assign(Object.assign({}, opts.environment), {
|
158647
157102
|
enableResetCacheOnSourceFileChanges: true,
|
@@ -158704,7 +157159,5 @@ exports.parseConfigPragmaForTests = parseConfigPragmaForTests;
|
|
158704
157159
|
exports.parsePluginOptions = parsePluginOptions;
|
158705
157160
|
exports.printHIR = printHIR;
|
158706
157161
|
exports.printReactiveFunction = printReactiveFunction;
|
158707
|
-
exports.run = run;
|
158708
157162
|
exports.runBabelPluginReactCompiler = runBabelPluginReactCompiler;
|
158709
|
-
exports.runPlayground = runPlayground;
|
158710
157163
|
exports.validateEnvironmentConfig = validateEnvironmentConfig;
|