@rsbuild/webpack 1.1.0 → 1.1.2
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/15.cjs +88 -206
- package/dist/238.js +85 -200
- package/dist/997.cjs +554 -1115
- package/dist/997.js +553 -1113
- package/dist/index.cjs +297 -721
- package/dist/index.js +179 -368
- package/dist/initConfigs.d.ts +3 -3
- package/dist/inspectConfig.d.ts +1 -1
- package/dist/plugin.d.ts +2 -2
- package/dist/progress/ProgressPlugin.d.ts +2 -0
- package/dist/shared.d.ts +0 -27
- package/dist/webpackConfig.d.ts +3 -3
- package/package.json +5 -4
package/dist/997.js
CHANGED
|
@@ -3,92 +3,42 @@ export const ids = [
|
|
|
3
3
|
];
|
|
4
4
|
export const modules = {
|
|
5
5
|
"../../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js": function(module) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const ESC = '\u001B[';
|
|
10
|
-
const OSC = '\u001B]';
|
|
11
|
-
const BEL = '\u0007';
|
|
12
|
-
const SEP = ';';
|
|
13
|
-
const isTerminalApp = 'Apple_Terminal' === process.env.TERM_PROGRAM;
|
|
6
|
+
let ansiEscapes = module.exports;
|
|
7
|
+
module.exports.default = ansiEscapes;
|
|
8
|
+
let isTerminalApp = 'Apple_Terminal' === process.env.TERM_PROGRAM;
|
|
14
9
|
ansiEscapes.cursorTo = (x, y)=>{
|
|
15
|
-
if ('number' != typeof x) throw
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ansiEscapes.cursorMove = (x, y)=>{
|
|
20
|
-
if ('number' != typeof x) throw new TypeError('The `x` argument is required');
|
|
10
|
+
if ('number' != typeof x) throw TypeError('The `x` argument is required');
|
|
11
|
+
return 'number' != typeof y ? '\u001B[' + (x + 1) + 'G' : '\u001B[' + (y + 1) + ';' + (x + 1) + 'H';
|
|
12
|
+
}, ansiEscapes.cursorMove = (x, y)=>{
|
|
13
|
+
if ('number' != typeof x) throw TypeError('The `x` argument is required');
|
|
21
14
|
let ret = '';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (y < 0) ret += ESC + -y + 'A';
|
|
25
|
-
else if (y > 0) ret += ESC + y + 'B';
|
|
26
|
-
return ret;
|
|
27
|
-
};
|
|
28
|
-
ansiEscapes.cursorUp = (count = 1)=>ESC + count + 'A';
|
|
29
|
-
ansiEscapes.cursorDown = (count = 1)=>ESC + count + 'B';
|
|
30
|
-
ansiEscapes.cursorForward = (count = 1)=>ESC + count + 'C';
|
|
31
|
-
ansiEscapes.cursorBackward = (count = 1)=>ESC + count + 'D';
|
|
32
|
-
ansiEscapes.cursorLeft = ESC + 'G';
|
|
33
|
-
ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's';
|
|
34
|
-
ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u';
|
|
35
|
-
ansiEscapes.cursorGetPosition = ESC + '6n';
|
|
36
|
-
ansiEscapes.cursorNextLine = ESC + 'E';
|
|
37
|
-
ansiEscapes.cursorPrevLine = ESC + 'F';
|
|
38
|
-
ansiEscapes.cursorHide = ESC + '?25l';
|
|
39
|
-
ansiEscapes.cursorShow = ESC + '?25h';
|
|
40
|
-
ansiEscapes.eraseLines = (count)=>{
|
|
15
|
+
return x < 0 ? ret += '\u001B[' + -x + 'D' : x > 0 && (ret += '\u001B[' + x + 'C'), y < 0 ? ret += '\u001B[' + -y + 'A' : y > 0 && (ret += '\u001B[' + y + 'B'), ret;
|
|
16
|
+
}, ansiEscapes.cursorUp = (count = 1)=>'\u001B[' + count + 'A', ansiEscapes.cursorDown = (count = 1)=>'\u001B[' + count + 'B', ansiEscapes.cursorForward = (count = 1)=>'\u001B[' + count + 'C', ansiEscapes.cursorBackward = (count = 1)=>'\u001B[' + count + 'D', ansiEscapes.cursorLeft = "\x1b[G", ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : "\x1b[s", ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : "\x1b[u", ansiEscapes.cursorGetPosition = "\x1b[6n", ansiEscapes.cursorNextLine = "\x1b[E", ansiEscapes.cursorPrevLine = "\x1b[F", ansiEscapes.cursorHide = "\x1b[?25l", ansiEscapes.cursorShow = "\x1b[?25h", ansiEscapes.eraseLines = (count)=>{
|
|
41
17
|
let clear = '';
|
|
42
18
|
for(let i = 0; i < count; i++)clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
ansiEscapes.eraseEndLine = ESC + 'K';
|
|
47
|
-
ansiEscapes.eraseStartLine = ESC + '1K';
|
|
48
|
-
ansiEscapes.eraseLine = ESC + '2K';
|
|
49
|
-
ansiEscapes.eraseDown = ESC + 'J';
|
|
50
|
-
ansiEscapes.eraseUp = ESC + '1J';
|
|
51
|
-
ansiEscapes.eraseScreen = ESC + '2J';
|
|
52
|
-
ansiEscapes.scrollUp = ESC + 'S';
|
|
53
|
-
ansiEscapes.scrollDown = ESC + 'T';
|
|
54
|
-
ansiEscapes.clearScreen = '\u001Bc';
|
|
55
|
-
ansiEscapes.clearTerminal = 'win32' === process.platform ? `${ansiEscapes.eraseScreen}${ESC}0f` : // 1. Erases the screen (Only done in case `2` is not supported)
|
|
56
|
-
// 2. Erases the whole screen including scrollback buffer
|
|
57
|
-
// 3. Moves cursor to the top-left position
|
|
58
|
-
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
59
|
-
`${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
|
|
60
|
-
ansiEscapes.beep = BEL;
|
|
61
|
-
ansiEscapes.link = (text, url)=>[
|
|
62
|
-
OSC,
|
|
19
|
+
return count && (clear += ansiEscapes.cursorLeft), clear;
|
|
20
|
+
}, ansiEscapes.eraseEndLine = "\x1b[K", ansiEscapes.eraseStartLine = "\x1b[1K", ansiEscapes.eraseLine = "\x1b[2K", ansiEscapes.eraseDown = "\x1b[J", ansiEscapes.eraseUp = "\x1b[1J", ansiEscapes.eraseScreen = "\x1b[2J", ansiEscapes.scrollUp = "\x1b[S", ansiEscapes.scrollDown = "\x1b[T", ansiEscapes.clearScreen = '\u001Bc', ansiEscapes.clearTerminal = 'win32' === process.platform ? `${ansiEscapes.eraseScreen}\u001B[0f` : `${ansiEscapes.eraseScreen}\u001B[3J\u001B[H`, ansiEscapes.beep = '\u0007', ansiEscapes.link = (text, url)=>[
|
|
21
|
+
'\u001B]',
|
|
63
22
|
'8',
|
|
64
|
-
|
|
65
|
-
|
|
23
|
+
';',
|
|
24
|
+
';',
|
|
66
25
|
url,
|
|
67
|
-
|
|
26
|
+
'\u0007',
|
|
68
27
|
text,
|
|
69
|
-
|
|
28
|
+
'\u001B]',
|
|
70
29
|
'8',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
].join('')
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (false === options.preserveAspectRatio) ret += ';preserveAspectRatio=0';
|
|
80
|
-
return ret + ':' + buffer.toString('base64') + BEL;
|
|
81
|
-
};
|
|
82
|
-
ansiEscapes.iTerm = {
|
|
83
|
-
setCwd: (cwd = process.cwd())=>`${OSC}50;CurrentDir=${cwd}${BEL}`,
|
|
30
|
+
';',
|
|
31
|
+
';',
|
|
32
|
+
'\u0007'
|
|
33
|
+
].join(''), ansiEscapes.image = (buffer, options = {})=>{
|
|
34
|
+
let ret = `\u001B]1337;File=inline=1`;
|
|
35
|
+
return options.width && (ret += `;width=${options.width}`), options.height && (ret += `;height=${options.height}`), !1 === options.preserveAspectRatio && (ret += ';preserveAspectRatio=0'), ret + ':' + buffer.toString('base64') + '\u0007';
|
|
36
|
+
}, ansiEscapes.iTerm = {
|
|
37
|
+
setCwd: (cwd = process.cwd())=>`\u001B]50;CurrentDir=${cwd}\u0007`,
|
|
84
38
|
annotation: (message, options = {})=>{
|
|
85
|
-
let ret =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if ((hasX || hasY) && !(hasX && hasY && void 0 !== options.length)) throw new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
|
|
89
|
-
message = message.replace(/\|/g, '');
|
|
90
|
-
ret += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
|
|
91
|
-
if (options.length > 0) ret += (hasX ? [
|
|
39
|
+
let ret = `\u001B]1337;`, hasX = void 0 !== options.x, hasY = void 0 !== options.y;
|
|
40
|
+
if ((hasX || hasY) && !(hasX && hasY && void 0 !== options.length)) throw Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
|
|
41
|
+
return message = message.replace(/\|/g, ''), ret += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=', options.length > 0 ? ret += (hasX ? [
|
|
92
42
|
message,
|
|
93
43
|
options.length,
|
|
94
44
|
options.x,
|
|
@@ -96,285 +46,245 @@ export const modules = {
|
|
|
96
46
|
] : [
|
|
97
47
|
options.length,
|
|
98
48
|
message
|
|
99
|
-
]).join('|');
|
|
100
|
-
else ret += message;
|
|
101
|
-
return ret + BEL;
|
|
49
|
+
]).join('|') : ret += message, ret + '\u0007';
|
|
102
50
|
}
|
|
103
51
|
};
|
|
104
52
|
},
|
|
105
53
|
"../../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js": function(module) {
|
|
106
|
-
module.exports = ({ onlyFirst =
|
|
107
|
-
const pattern = "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))";
|
|
108
|
-
return new RegExp(pattern, onlyFirst ? void 0 : 'g');
|
|
109
|
-
};
|
|
54
|
+
module.exports = ({ onlyFirst = !1 } = {})=>RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))", onlyFirst ? void 0 : 'g');
|
|
110
55
|
},
|
|
111
56
|
"../../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
57
|
+
let colorConvert;
|
|
58
|
+
module = __webpack_require__.nmd(module);
|
|
59
|
+
let wrapAnsi16 = (fn, offset)=>(...args)=>{
|
|
60
|
+
let code = fn(...args);
|
|
115
61
|
return `\u001B[${code + offset}m`;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const code = fn(...args);
|
|
62
|
+
}, wrapAnsi256 = (fn, offset)=>(...args)=>{
|
|
63
|
+
let code = fn(...args);
|
|
119
64
|
return `\u001B[${38 + offset};5;${code}m`;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const rgb = fn(...args);
|
|
65
|
+
}, wrapAnsi16m = (fn, offset)=>(...args)=>{
|
|
66
|
+
let rgb = fn(...args);
|
|
123
67
|
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
124
|
-
}
|
|
125
|
-
const ansi2ansi = (n)=>n;
|
|
126
|
-
const rgb2rgb = (r, g, b)=>[
|
|
68
|
+
}, ansi2ansi = (n)=>n, rgb2rgb = (r, g, b)=>[
|
|
127
69
|
r,
|
|
128
70
|
g,
|
|
129
71
|
b
|
|
130
|
-
]
|
|
131
|
-
const setLazyProperty = (object, property, get)=>{
|
|
72
|
+
], setLazyProperty = (object, property, get)=>{
|
|
132
73
|
Object.defineProperty(object, property, {
|
|
133
74
|
get: ()=>{
|
|
134
|
-
|
|
135
|
-
Object.defineProperty(object, property, {
|
|
75
|
+
let value = get();
|
|
76
|
+
return Object.defineProperty(object, property, {
|
|
136
77
|
value,
|
|
137
|
-
enumerable:
|
|
138
|
-
configurable:
|
|
139
|
-
});
|
|
140
|
-
return value;
|
|
78
|
+
enumerable: !0,
|
|
79
|
+
configurable: !0
|
|
80
|
+
}), value;
|
|
141
81
|
},
|
|
142
|
-
enumerable:
|
|
143
|
-
configurable:
|
|
82
|
+
enumerable: !0,
|
|
83
|
+
configurable: !0
|
|
144
84
|
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)){
|
|
152
|
-
const name = 'ansi16' === sourceSpace ? 'ansi' : sourceSpace;
|
|
153
|
-
if (sourceSpace === targetSpace) styles[name] = wrap(identity, offset);
|
|
154
|
-
else if ('object' == typeof suite) styles[name] = wrap(suite[targetSpace], offset);
|
|
85
|
+
}, makeDynamicStyles = (wrap, targetSpace, identity, isBackground)=>{
|
|
86
|
+
void 0 === colorConvert && (colorConvert = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"));
|
|
87
|
+
let offset = isBackground ? 10 : 0, styles = {};
|
|
88
|
+
for (let [sourceSpace, suite] of Object.entries(colorConvert)){
|
|
89
|
+
let name = 'ansi16' === sourceSpace ? 'ansi' : sourceSpace;
|
|
90
|
+
sourceSpace === targetSpace ? styles[name] = wrap(identity, offset) : 'object' == typeof suite && (styles[name] = wrap(suite[targetSpace], offset));
|
|
155
91
|
}
|
|
156
92
|
return styles;
|
|
157
93
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
// Alias bright black as gray (and grey)
|
|
332
|
-
styles.color.gray = styles.color.blackBright;
|
|
333
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
334
|
-
styles.color.grey = styles.color.blackBright;
|
|
335
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
336
|
-
for (const [groupName, group] of Object.entries(styles)){
|
|
337
|
-
for (const [styleName, style] of Object.entries(group)){
|
|
338
|
-
styles[styleName] = {
|
|
94
|
+
Object.defineProperty(module, 'exports', {
|
|
95
|
+
enumerable: !0,
|
|
96
|
+
get: function() {
|
|
97
|
+
let codes = new Map(), styles = {
|
|
98
|
+
modifier: {
|
|
99
|
+
reset: [
|
|
100
|
+
0,
|
|
101
|
+
0
|
|
102
|
+
],
|
|
103
|
+
bold: [
|
|
104
|
+
1,
|
|
105
|
+
22
|
|
106
|
+
],
|
|
107
|
+
dim: [
|
|
108
|
+
2,
|
|
109
|
+
22
|
|
110
|
+
],
|
|
111
|
+
italic: [
|
|
112
|
+
3,
|
|
113
|
+
23
|
|
114
|
+
],
|
|
115
|
+
underline: [
|
|
116
|
+
4,
|
|
117
|
+
24
|
|
118
|
+
],
|
|
119
|
+
inverse: [
|
|
120
|
+
7,
|
|
121
|
+
27
|
|
122
|
+
],
|
|
123
|
+
hidden: [
|
|
124
|
+
8,
|
|
125
|
+
28
|
|
126
|
+
],
|
|
127
|
+
strikethrough: [
|
|
128
|
+
9,
|
|
129
|
+
29
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
color: {
|
|
133
|
+
black: [
|
|
134
|
+
30,
|
|
135
|
+
39
|
|
136
|
+
],
|
|
137
|
+
red: [
|
|
138
|
+
31,
|
|
139
|
+
39
|
|
140
|
+
],
|
|
141
|
+
green: [
|
|
142
|
+
32,
|
|
143
|
+
39
|
|
144
|
+
],
|
|
145
|
+
yellow: [
|
|
146
|
+
33,
|
|
147
|
+
39
|
|
148
|
+
],
|
|
149
|
+
blue: [
|
|
150
|
+
34,
|
|
151
|
+
39
|
|
152
|
+
],
|
|
153
|
+
magenta: [
|
|
154
|
+
35,
|
|
155
|
+
39
|
|
156
|
+
],
|
|
157
|
+
cyan: [
|
|
158
|
+
36,
|
|
159
|
+
39
|
|
160
|
+
],
|
|
161
|
+
white: [
|
|
162
|
+
37,
|
|
163
|
+
39
|
|
164
|
+
],
|
|
165
|
+
blackBright: [
|
|
166
|
+
90,
|
|
167
|
+
39
|
|
168
|
+
],
|
|
169
|
+
redBright: [
|
|
170
|
+
91,
|
|
171
|
+
39
|
|
172
|
+
],
|
|
173
|
+
greenBright: [
|
|
174
|
+
92,
|
|
175
|
+
39
|
|
176
|
+
],
|
|
177
|
+
yellowBright: [
|
|
178
|
+
93,
|
|
179
|
+
39
|
|
180
|
+
],
|
|
181
|
+
blueBright: [
|
|
182
|
+
94,
|
|
183
|
+
39
|
|
184
|
+
],
|
|
185
|
+
magentaBright: [
|
|
186
|
+
95,
|
|
187
|
+
39
|
|
188
|
+
],
|
|
189
|
+
cyanBright: [
|
|
190
|
+
96,
|
|
191
|
+
39
|
|
192
|
+
],
|
|
193
|
+
whiteBright: [
|
|
194
|
+
97,
|
|
195
|
+
39
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
bgColor: {
|
|
199
|
+
bgBlack: [
|
|
200
|
+
40,
|
|
201
|
+
49
|
|
202
|
+
],
|
|
203
|
+
bgRed: [
|
|
204
|
+
41,
|
|
205
|
+
49
|
|
206
|
+
],
|
|
207
|
+
bgGreen: [
|
|
208
|
+
42,
|
|
209
|
+
49
|
|
210
|
+
],
|
|
211
|
+
bgYellow: [
|
|
212
|
+
43,
|
|
213
|
+
49
|
|
214
|
+
],
|
|
215
|
+
bgBlue: [
|
|
216
|
+
44,
|
|
217
|
+
49
|
|
218
|
+
],
|
|
219
|
+
bgMagenta: [
|
|
220
|
+
45,
|
|
221
|
+
49
|
|
222
|
+
],
|
|
223
|
+
bgCyan: [
|
|
224
|
+
46,
|
|
225
|
+
49
|
|
226
|
+
],
|
|
227
|
+
bgWhite: [
|
|
228
|
+
47,
|
|
229
|
+
49
|
|
230
|
+
],
|
|
231
|
+
bgBlackBright: [
|
|
232
|
+
100,
|
|
233
|
+
49
|
|
234
|
+
],
|
|
235
|
+
bgRedBright: [
|
|
236
|
+
101,
|
|
237
|
+
49
|
|
238
|
+
],
|
|
239
|
+
bgGreenBright: [
|
|
240
|
+
102,
|
|
241
|
+
49
|
|
242
|
+
],
|
|
243
|
+
bgYellowBright: [
|
|
244
|
+
103,
|
|
245
|
+
49
|
|
246
|
+
],
|
|
247
|
+
bgBlueBright: [
|
|
248
|
+
104,
|
|
249
|
+
49
|
|
250
|
+
],
|
|
251
|
+
bgMagentaBright: [
|
|
252
|
+
105,
|
|
253
|
+
49
|
|
254
|
+
],
|
|
255
|
+
bgCyanBright: [
|
|
256
|
+
106,
|
|
257
|
+
49
|
|
258
|
+
],
|
|
259
|
+
bgWhiteBright: [
|
|
260
|
+
107,
|
|
261
|
+
49
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
for (let [groupName, group] of (styles.color.gray = styles.color.blackBright, styles.bgColor.bgGray = styles.bgColor.bgBlackBright, styles.color.grey = styles.color.blackBright, styles.bgColor.bgGrey = styles.bgColor.bgBlackBright, Object.entries(styles))){
|
|
266
|
+
for (let [styleName, style] of Object.entries(group))styles[styleName] = {
|
|
339
267
|
open: `\u001B[${style[0]}m`,
|
|
340
268
|
close: `\u001B[${style[1]}m`
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
|
|
269
|
+
}, group[styleName] = styles[styleName], codes.set(style[0], style[1]);
|
|
270
|
+
Object.defineProperty(styles, groupName, {
|
|
271
|
+
value: group,
|
|
272
|
+
enumerable: !1
|
|
273
|
+
});
|
|
344
274
|
}
|
|
345
|
-
Object.defineProperty(styles,
|
|
346
|
-
value:
|
|
347
|
-
enumerable:
|
|
348
|
-
});
|
|
275
|
+
return Object.defineProperty(styles, 'codes', {
|
|
276
|
+
value: codes,
|
|
277
|
+
enumerable: !1
|
|
278
|
+
}), styles.color.close = '\u001B[39m', styles.bgColor.close = '\u001B[49m', setLazyProperty(styles.color, 'ansi', ()=>makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, !1)), setLazyProperty(styles.color, 'ansi256', ()=>makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, !1)), setLazyProperty(styles.color, 'ansi16m', ()=>makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, !1)), setLazyProperty(styles.bgColor, 'ansi', ()=>makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, !0)), setLazyProperty(styles.bgColor, 'ansi256', ()=>makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, !0)), setLazyProperty(styles.bgColor, 'ansi16m', ()=>makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, !0)), styles;
|
|
349
279
|
}
|
|
350
|
-
Object.defineProperty(styles, 'codes', {
|
|
351
|
-
value: codes,
|
|
352
|
-
enumerable: false
|
|
353
|
-
});
|
|
354
|
-
styles.color.close = '\u001B[39m';
|
|
355
|
-
styles.bgColor.close = '\u001B[49m';
|
|
356
|
-
setLazyProperty(styles.color, 'ansi', ()=>makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
|
|
357
|
-
setLazyProperty(styles.color, 'ansi256', ()=>makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
|
|
358
|
-
setLazyProperty(styles.color, 'ansi16m', ()=>makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
|
|
359
|
-
setLazyProperty(styles.bgColor, 'ansi', ()=>makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
|
|
360
|
-
setLazyProperty(styles.bgColor, 'ansi256', ()=>makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
|
|
361
|
-
setLazyProperty(styles.bgColor, 'ansi16m', ()=>makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
|
|
362
|
-
return styles;
|
|
363
|
-
}
|
|
364
|
-
// Make the export immutable
|
|
365
|
-
Object.defineProperty(module, 'exports', {
|
|
366
|
-
enumerable: true,
|
|
367
|
-
get: assembleStyles
|
|
368
280
|
});
|
|
369
281
|
},
|
|
370
282
|
"../../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js": function(module) {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
module.exports = astralRegex;
|
|
283
|
+
let regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]';
|
|
284
|
+
module.exports = (options)=>options && options.exact ? RegExp(`^${regex}$`) : RegExp(regex, 'g');
|
|
374
285
|
},
|
|
375
286
|
"../../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
376
|
-
|
|
377
|
-
const stringWidth = __webpack_require__("../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js");
|
|
287
|
+
let sliceAnsi = __webpack_require__("../../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js"), stringWidth = __webpack_require__("../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js");
|
|
378
288
|
function getIndexOfNearestSpace(string, index, shouldSearchRight) {
|
|
379
289
|
if (' ' === string.charAt(index)) return index;
|
|
380
290
|
for(let i = 1; i <= 3; i++)if (shouldSearchRight) {
|
|
@@ -383,66 +293,47 @@ export const modules = {
|
|
|
383
293
|
return index;
|
|
384
294
|
}
|
|
385
295
|
module.exports = (text, columns, options)=>{
|
|
386
|
-
options = {
|
|
296
|
+
let { position, space, preferTruncationOnSpace } = options = {
|
|
387
297
|
position: 'end',
|
|
388
|
-
preferTruncationOnSpace:
|
|
298
|
+
preferTruncationOnSpace: !1,
|
|
389
299
|
...options
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
let ellipsisWidth = 1;
|
|
394
|
-
if ('string' != typeof text) throw new TypeError(`Expected \`input\` to be a string, got ${typeof text}`);
|
|
395
|
-
if ('number' != typeof columns) throw new TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);
|
|
300
|
+
}, ellipsis = '…', ellipsisWidth = 1;
|
|
301
|
+
if ('string' != typeof text) throw TypeError(`Expected \`input\` to be a string, got ${typeof text}`);
|
|
302
|
+
if ('number' != typeof columns) throw TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);
|
|
396
303
|
if (columns < 1) return '';
|
|
397
304
|
if (1 === columns) return ellipsis;
|
|
398
|
-
|
|
305
|
+
let length = stringWidth(text);
|
|
399
306
|
if (length <= columns) return text;
|
|
400
307
|
if ('start' === position) {
|
|
401
308
|
if (preferTruncationOnSpace) {
|
|
402
|
-
|
|
309
|
+
let nearestSpace = getIndexOfNearestSpace(text, length - columns + 1, !0);
|
|
403
310
|
return ellipsis + sliceAnsi(text, nearestSpace, length).trim();
|
|
404
311
|
}
|
|
405
|
-
|
|
406
|
-
ellipsis += ' ';
|
|
407
|
-
ellipsisWidth = 2;
|
|
408
|
-
}
|
|
409
|
-
return ellipsis + sliceAnsi(text, length - columns + ellipsisWidth, length);
|
|
312
|
+
return !0 === space && (ellipsis += ' ', ellipsisWidth = 2), ellipsis + sliceAnsi(text, length - columns + ellipsisWidth, length);
|
|
410
313
|
}
|
|
411
314
|
if ('middle' === position) {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
ellipsisWidth = 3;
|
|
415
|
-
}
|
|
416
|
-
const half = Math.floor(columns / 2);
|
|
315
|
+
!0 === space && (ellipsis = ' ' + ellipsis + ' ', ellipsisWidth = 3);
|
|
316
|
+
let half = Math.floor(columns / 2);
|
|
417
317
|
if (preferTruncationOnSpace) {
|
|
418
|
-
|
|
419
|
-
const spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, true);
|
|
318
|
+
let spaceNearFirstBreakPoint = getIndexOfNearestSpace(text, half), spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, !0);
|
|
420
319
|
return sliceAnsi(text, 0, spaceNearFirstBreakPoint) + ellipsis + sliceAnsi(text, spaceNearSecondBreakPoint, length).trim();
|
|
421
320
|
}
|
|
422
321
|
return sliceAnsi(text, 0, half) + ellipsis + sliceAnsi(text, length - (columns - half) + ellipsisWidth, length);
|
|
423
322
|
}
|
|
424
323
|
if ('end' === position) {
|
|
425
324
|
if (preferTruncationOnSpace) {
|
|
426
|
-
|
|
325
|
+
let nearestSpace = getIndexOfNearestSpace(text, columns - 1);
|
|
427
326
|
return sliceAnsi(text, 0, nearestSpace) + ellipsis;
|
|
428
327
|
}
|
|
429
|
-
|
|
430
|
-
ellipsis = ' ' + ellipsis;
|
|
431
|
-
ellipsisWidth = 2;
|
|
432
|
-
}
|
|
433
|
-
return sliceAnsi(text, 0, columns - ellipsisWidth) + ellipsis;
|
|
328
|
+
return !0 === space && (ellipsis = ' ' + ellipsis, ellipsisWidth = 2), sliceAnsi(text, 0, columns - ellipsisWidth) + ellipsis;
|
|
434
329
|
}
|
|
435
|
-
throw
|
|
330
|
+
throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
|
|
436
331
|
};
|
|
437
332
|
},
|
|
438
333
|
"../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
// do not use box values types (i.e. Number(), String(), etc.)
|
|
443
|
-
const reverseKeywords = {};
|
|
444
|
-
for (const key of Object.keys(cssKeywords))reverseKeywords[cssKeywords[key]] = key;
|
|
445
|
-
const convert = {
|
|
334
|
+
let cssKeywords = __webpack_require__("../../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"), reverseKeywords = {};
|
|
335
|
+
for (let key of Object.keys(cssKeywords))reverseKeywords[cssKeywords[key]] = key;
|
|
336
|
+
let convert = {
|
|
446
337
|
rgb: {
|
|
447
338
|
channels: 3,
|
|
448
339
|
labels: 'rgb'
|
|
@@ -522,228 +413,109 @@ export const modules = {
|
|
|
522
413
|
]
|
|
523
414
|
}
|
|
524
415
|
};
|
|
525
|
-
module.exports = convert
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
if (
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
const { channels, labels } = convert[model];
|
|
532
|
-
delete convert[model].channels;
|
|
533
|
-
delete convert[model].labels;
|
|
534
|
-
Object.defineProperty(convert[model], 'channels', {
|
|
416
|
+
for (let model of (module.exports = convert, Object.keys(convert))){
|
|
417
|
+
if (!('channels' in convert[model])) throw Error('missing channels property: ' + model);
|
|
418
|
+
if (!('labels' in convert[model])) throw Error('missing channel labels property: ' + model);
|
|
419
|
+
if (convert[model].labels.length !== convert[model].channels) throw Error('channel and label counts mismatch: ' + model);
|
|
420
|
+
let { channels, labels } = convert[model];
|
|
421
|
+
delete convert[model].channels, delete convert[model].labels, Object.defineProperty(convert[model], 'channels', {
|
|
535
422
|
value: channels
|
|
536
|
-
})
|
|
537
|
-
Object.defineProperty(convert[model], 'labels', {
|
|
423
|
+
}), Object.defineProperty(convert[model], 'labels', {
|
|
538
424
|
value: labels
|
|
539
425
|
});
|
|
540
426
|
}
|
|
541
427
|
convert.rgb.hsl = function(rgb) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
const max = Math.max(r, g, b);
|
|
547
|
-
const delta = max - min;
|
|
548
|
-
let h;
|
|
549
|
-
let s;
|
|
550
|
-
if (max === min) h = 0;
|
|
551
|
-
else if (r === max) h = (g - b) / delta;
|
|
552
|
-
else if (g === max) h = 2 + (b - r) / delta;
|
|
553
|
-
else if (b === max) h = 4 + (r - g) / delta;
|
|
554
|
-
h = Math.min(60 * h, 360);
|
|
555
|
-
if (h < 0) h += 360;
|
|
556
|
-
const l = (min + max) / 2;
|
|
557
|
-
s = max === min ? 0 : l <= 0.5 ? delta / (max + min) : delta / (2 - max - min);
|
|
428
|
+
let h, s;
|
|
429
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), delta = max - min;
|
|
430
|
+
max === min ? h = 0 : r === max ? h = (g - b) / delta : g === max ? h = 2 + (b - r) / delta : b === max && (h = 4 + (r - g) / delta), (h = Math.min(60 * h, 360)) < 0 && (h += 360);
|
|
431
|
+
let l = (min + max) / 2;
|
|
558
432
|
return [
|
|
559
433
|
h,
|
|
560
|
-
100 * s,
|
|
434
|
+
100 * (s = max === min ? 0 : l <= 0.5 ? delta / (max + min) : delta / (2 - max - min)),
|
|
561
435
|
100 * l
|
|
562
436
|
];
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
let
|
|
566
|
-
let gdif;
|
|
567
|
-
let bdif;
|
|
568
|
-
let h;
|
|
569
|
-
let s;
|
|
570
|
-
const r = rgb[0] / 255;
|
|
571
|
-
const g = rgb[1] / 255;
|
|
572
|
-
const b = rgb[2] / 255;
|
|
573
|
-
const v = Math.max(r, g, b);
|
|
574
|
-
const diff = v - Math.min(r, g, b);
|
|
575
|
-
const diffc = function(c) {
|
|
437
|
+
}, convert.rgb.hsv = function(rgb) {
|
|
438
|
+
let rdif, gdif, bdif, h, s;
|
|
439
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, v = Math.max(r, g, b), diff = v - Math.min(r, g, b), diffc = function(c) {
|
|
576
440
|
return (v - c) / 6 / diff + 0.5;
|
|
577
441
|
};
|
|
578
|
-
|
|
579
|
-
h = 0;
|
|
580
|
-
s = 0;
|
|
581
|
-
} else {
|
|
582
|
-
s = diff / v;
|
|
583
|
-
rdif = diffc(r);
|
|
584
|
-
gdif = diffc(g);
|
|
585
|
-
bdif = diffc(b);
|
|
586
|
-
if (r === v) h = bdif - gdif;
|
|
587
|
-
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
588
|
-
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
589
|
-
if (h < 0) h += 1;
|
|
590
|
-
else if (h > 1) h -= 1;
|
|
591
|
-
}
|
|
592
|
-
return [
|
|
442
|
+
return 0 === diff ? (h = 0, s = 0) : (s = diff / v, rdif = diffc(r), gdif = diffc(g), bdif = diffc(b), r === v ? h = bdif - gdif : g === v ? h = 1 / 3 + rdif - bdif : b === v && (h = 2 / 3 + gdif - rdif), h < 0 ? h += 1 : h > 1 && (h -= 1)), [
|
|
593
443
|
360 * h,
|
|
594
444
|
100 * s,
|
|
595
445
|
100 * v
|
|
596
446
|
];
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
const r = rgb[0];
|
|
600
|
-
const g = rgb[1];
|
|
601
|
-
let b = rgb[2];
|
|
602
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
603
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
604
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
447
|
+
}, convert.rgb.hwb = function(rgb) {
|
|
448
|
+
let r = rgb[0], g = rgb[1], b = rgb[2], h = convert.rgb.hsl(rgb)[0];
|
|
605
449
|
return [
|
|
606
450
|
h,
|
|
607
|
-
|
|
608
|
-
100 * b
|
|
451
|
+
1 / 255 * Math.min(r, Math.min(g, b)) * 100,
|
|
452
|
+
100 * (b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)))
|
|
609
453
|
];
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
const r = rgb[0] / 255;
|
|
613
|
-
const g = rgb[1] / 255;
|
|
614
|
-
const b = rgb[2] / 255;
|
|
615
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
616
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
617
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
618
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
454
|
+
}, convert.rgb.cmyk = function(rgb) {
|
|
455
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, k = Math.min(1 - r, 1 - g, 1 - b);
|
|
619
456
|
return [
|
|
620
|
-
100 *
|
|
621
|
-
100 *
|
|
622
|
-
100 *
|
|
457
|
+
100 * ((1 - r - k) / (1 - k) || 0),
|
|
458
|
+
100 * ((1 - g - k) / (1 - k) || 0),
|
|
459
|
+
100 * ((1 - b - k) / (1 - k) || 0),
|
|
623
460
|
100 * k
|
|
624
461
|
];
|
|
625
462
|
};
|
|
626
|
-
function comparativeDistance(x, y) {
|
|
627
|
-
/*
|
|
628
|
-
See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
|
|
629
|
-
*/ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
630
|
-
}
|
|
631
463
|
convert.rgb.keyword = function(rgb) {
|
|
632
|
-
|
|
464
|
+
let currentClosestKeyword;
|
|
465
|
+
let reversed = reverseKeywords[rgb];
|
|
633
466
|
if (reversed) return reversed;
|
|
634
467
|
let currentClosestDistance = 1 / 0;
|
|
635
|
-
let
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
// Check if its less, if so set as closest
|
|
641
|
-
if (distance < currentClosestDistance) {
|
|
642
|
-
currentClosestDistance = distance;
|
|
643
|
-
currentClosestKeyword = keyword;
|
|
644
|
-
}
|
|
468
|
+
for (let keyword of Object.keys(cssKeywords)){
|
|
469
|
+
var x, y;
|
|
470
|
+
let value = cssKeywords[keyword];
|
|
471
|
+
let distance = (x = rgb, y = value, (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2);
|
|
472
|
+
distance < currentClosestDistance && (currentClosestDistance = distance, currentClosestKeyword = keyword);
|
|
645
473
|
}
|
|
646
474
|
return currentClosestKeyword;
|
|
647
|
-
}
|
|
648
|
-
convert.keyword.rgb = function(keyword) {
|
|
475
|
+
}, convert.keyword.rgb = function(keyword) {
|
|
649
476
|
return cssKeywords[keyword];
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
let r = rgb[0] / 255;
|
|
653
|
-
let g = rgb[1] / 255;
|
|
654
|
-
let b = rgb[2] / 255;
|
|
655
|
-
// Assume sRGB
|
|
656
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
657
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
658
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
659
|
-
const x = 0.4124 * r + 0.3576 * g + 0.1805 * b;
|
|
660
|
-
const y = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
661
|
-
const z = 0.0193 * r + 0.1192 * g + 0.9505 * b;
|
|
477
|
+
}, convert.rgb.xyz = function(rgb) {
|
|
478
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255;
|
|
662
479
|
return [
|
|
663
|
-
100 *
|
|
664
|
-
100 *
|
|
665
|
-
100 *
|
|
480
|
+
100 * (0.4124 * (r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92) + 0.3576 * (g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92) + 0.1805 * (b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92)),
|
|
481
|
+
100 * (0.2126 * r + 0.7152 * g + 0.0722 * b),
|
|
482
|
+
100 * (0.0193 * r + 0.1192 * g + 0.9505 * b)
|
|
666
483
|
];
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
const b = 200 * (y - z);
|
|
682
|
-
return [
|
|
683
|
-
l,
|
|
684
|
-
a,
|
|
685
|
-
b
|
|
484
|
+
}, convert.rgb.lab = function(rgb) {
|
|
485
|
+
let xyz = convert.rgb.xyz(rgb), x = xyz[0], y = xyz[1], z = xyz[2];
|
|
486
|
+
return x /= 95.047, y /= 100, z /= 108.883, [
|
|
487
|
+
116 * (y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116) - 16,
|
|
488
|
+
500 * ((x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116) - y),
|
|
489
|
+
200 * (y - (z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116))
|
|
490
|
+
];
|
|
491
|
+
}, convert.hsl.rgb = function(hsl) {
|
|
492
|
+
let t2, t3, val;
|
|
493
|
+
let h = hsl[0] / 360, s = hsl[1] / 100, l = hsl[2] / 100;
|
|
494
|
+
if (0 === s) return [
|
|
495
|
+
val = 255 * l,
|
|
496
|
+
val,
|
|
497
|
+
val
|
|
686
498
|
];
|
|
687
|
-
};
|
|
688
|
-
convert.hsl.rgb = function(hsl) {
|
|
689
|
-
const h = hsl[0] / 360;
|
|
690
|
-
const s = hsl[1] / 100;
|
|
691
|
-
const l = hsl[2] / 100;
|
|
692
|
-
let t2;
|
|
693
|
-
let t3;
|
|
694
|
-
let val;
|
|
695
|
-
if (0 === s) {
|
|
696
|
-
val = 255 * l;
|
|
697
|
-
return [
|
|
698
|
-
val,
|
|
699
|
-
val,
|
|
700
|
-
val
|
|
701
|
-
];
|
|
702
|
-
}
|
|
703
499
|
t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
704
|
-
|
|
705
|
-
const rgb = [
|
|
500
|
+
let t1 = 2 * l - t2, rgb = [
|
|
706
501
|
0,
|
|
707
502
|
0,
|
|
708
503
|
0
|
|
709
504
|
];
|
|
710
|
-
for(let i = 0; i < 3; i++)
|
|
711
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
712
|
-
if (t3 < 0) t3++;
|
|
713
|
-
if (t3 > 1) t3--;
|
|
714
|
-
val = 6 * t3 < 1 ? t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? t2 : 3 * t3 < 2 ? t1 + (t2 - t1) * (2 / 3 - t3) * 6 : t1;
|
|
715
|
-
rgb[i] = 255 * val;
|
|
716
|
-
}
|
|
505
|
+
for(let i = 0; i < 3; i++)(t3 = h + -(1 / 3 * (i - 1))) < 0 && t3++, t3 > 1 && t3--, val = 6 * t3 < 1 ? t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? t2 : 3 * t3 < 2 ? t1 + (t2 - t1) * (2 / 3 - t3) * 6 : t1, rgb[i] = 255 * val;
|
|
717
506
|
return rgb;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
let
|
|
722
|
-
let l = hsl[2] / 100;
|
|
723
|
-
let smin = s;
|
|
724
|
-
const lmin = Math.max(l, 0.01);
|
|
725
|
-
l *= 2;
|
|
726
|
-
s *= l <= 1 ? l : 2 - l;
|
|
727
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
728
|
-
const v = (l + s) / 2;
|
|
729
|
-
const sv = 0 === l ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
507
|
+
}, convert.hsl.hsv = function(hsl) {
|
|
508
|
+
let h = hsl[0], s = hsl[1] / 100, l = hsl[2] / 100, smin = s, lmin = Math.max(l, 0.01);
|
|
509
|
+
l *= 2, s *= l <= 1 ? l : 2 - l, smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
510
|
+
let v = (l + s) / 2;
|
|
730
511
|
return [
|
|
731
512
|
h,
|
|
732
|
-
100 *
|
|
513
|
+
100 * (0 === l ? 2 * smin / (lmin + smin) : 2 * s / (l + s)),
|
|
733
514
|
100 * v
|
|
734
515
|
];
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
const s = hsv[1] / 100;
|
|
739
|
-
let v = hsv[2] / 100;
|
|
740
|
-
const hi = Math.floor(h) % 6;
|
|
741
|
-
const f = h - Math.floor(h);
|
|
742
|
-
const p = 255 * v * (1 - s);
|
|
743
|
-
const q = 255 * v * (1 - s * f);
|
|
744
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
745
|
-
v *= 255;
|
|
746
|
-
switch(hi){
|
|
516
|
+
}, convert.hsv.rgb = function(hsv) {
|
|
517
|
+
let h = hsv[0] / 60, s = hsv[1] / 100, v = hsv[2] / 100, hi = Math.floor(h) % 6, f = h - Math.floor(h), p = 255 * v * (1 - s), q = 255 * v * (1 - s * f), t = 255 * v * (1 - s * (1 - f));
|
|
518
|
+
switch(v *= 255, hi){
|
|
747
519
|
case 0:
|
|
748
520
|
return [
|
|
749
521
|
v,
|
|
@@ -781,624 +553,360 @@ export const modules = {
|
|
|
781
553
|
q
|
|
782
554
|
];
|
|
783
555
|
}
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
const s = hsv[1] / 100;
|
|
788
|
-
const v = hsv[2] / 100;
|
|
789
|
-
const vmin = Math.max(v, 0.01);
|
|
790
|
-
let sl;
|
|
791
|
-
let l;
|
|
556
|
+
}, convert.hsv.hsl = function(hsv) {
|
|
557
|
+
let sl, l;
|
|
558
|
+
let h = hsv[0], s = hsv[1] / 100, v = hsv[2] / 100, vmin = Math.max(v, 0.01);
|
|
792
559
|
l = (2 - s) * v;
|
|
793
|
-
|
|
794
|
-
sl = s * vmin
|
|
795
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
796
|
-
sl = sl || 0;
|
|
797
|
-
l /= 2;
|
|
798
|
-
return [
|
|
560
|
+
let lmin = (2 - s) * vmin;
|
|
561
|
+
return sl = (sl = s * vmin / (lmin <= 1 ? lmin : 2 - lmin)) || 0, [
|
|
799
562
|
h,
|
|
800
563
|
100 * sl,
|
|
801
|
-
100 * l
|
|
564
|
+
100 * (l /= 2)
|
|
802
565
|
];
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
let
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
// Wh + bl cant be > 1
|
|
812
|
-
if (ratio > 1) {
|
|
813
|
-
wh /= ratio;
|
|
814
|
-
bl /= ratio;
|
|
815
|
-
}
|
|
816
|
-
const i = Math.floor(6 * h);
|
|
817
|
-
const v = 1 - bl;
|
|
818
|
-
f = 6 * h - i;
|
|
819
|
-
if ((0x01 & i) !== 0) f = 1 - f;
|
|
820
|
-
const n = wh + f * (v - wh); // Linear interpolation
|
|
821
|
-
let r;
|
|
822
|
-
let g;
|
|
823
|
-
let b;
|
|
824
|
-
/* eslint-disable max-statements-per-line,no-multi-spaces */ switch(i){
|
|
566
|
+
}, convert.hwb.rgb = function(hwb) {
|
|
567
|
+
let f, r, g, b;
|
|
568
|
+
let h = hwb[0] / 360, wh = hwb[1] / 100, bl = hwb[2] / 100, ratio = wh + bl;
|
|
569
|
+
ratio > 1 && (wh /= ratio, bl /= ratio);
|
|
570
|
+
let i = Math.floor(6 * h), v = 1 - bl;
|
|
571
|
+
f = 6 * h - i, (0x01 & i) != 0 && (f = 1 - f);
|
|
572
|
+
let n = wh + f * (v - wh);
|
|
573
|
+
switch(i){
|
|
825
574
|
default:
|
|
826
575
|
case 6:
|
|
827
576
|
case 0:
|
|
828
|
-
r = v;
|
|
829
|
-
g = n;
|
|
830
|
-
b = wh;
|
|
577
|
+
r = v, g = n, b = wh;
|
|
831
578
|
break;
|
|
832
579
|
case 1:
|
|
833
|
-
r = n;
|
|
834
|
-
g = v;
|
|
835
|
-
b = wh;
|
|
580
|
+
r = n, g = v, b = wh;
|
|
836
581
|
break;
|
|
837
582
|
case 2:
|
|
838
|
-
r = wh;
|
|
839
|
-
g = v;
|
|
840
|
-
b = n;
|
|
583
|
+
r = wh, g = v, b = n;
|
|
841
584
|
break;
|
|
842
585
|
case 3:
|
|
843
|
-
r = wh;
|
|
844
|
-
g = n;
|
|
845
|
-
b = v;
|
|
586
|
+
r = wh, g = n, b = v;
|
|
846
587
|
break;
|
|
847
588
|
case 4:
|
|
848
|
-
r = n;
|
|
849
|
-
g = wh;
|
|
850
|
-
b = v;
|
|
589
|
+
r = n, g = wh, b = v;
|
|
851
590
|
break;
|
|
852
591
|
case 5:
|
|
853
|
-
r = v;
|
|
854
|
-
g = wh;
|
|
855
|
-
b = n;
|
|
856
|
-
break;
|
|
592
|
+
r = v, g = wh, b = n;
|
|
857
593
|
}
|
|
858
|
-
/* eslint-enable max-statements-per-line,no-multi-spaces */ return [
|
|
859
|
-
255 * r,
|
|
860
|
-
255 * g,
|
|
861
|
-
255 * b
|
|
862
|
-
];
|
|
863
|
-
};
|
|
864
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
865
|
-
const c = cmyk[0] / 100;
|
|
866
|
-
const m = cmyk[1] / 100;
|
|
867
|
-
const y = cmyk[2] / 100;
|
|
868
|
-
const k = cmyk[3] / 100;
|
|
869
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
870
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
871
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
872
594
|
return [
|
|
873
595
|
255 * r,
|
|
874
596
|
255 * g,
|
|
875
597
|
255 * b
|
|
876
598
|
];
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
const x = xyz[0] / 100;
|
|
880
|
-
const y = xyz[1] / 100;
|
|
881
|
-
const z = xyz[2] / 100;
|
|
882
|
-
let r;
|
|
883
|
-
let g;
|
|
884
|
-
let b;
|
|
885
|
-
r = 3.2406 * x + -1.5372 * y + -0.4986 * z;
|
|
886
|
-
g = -0.9689 * x + 1.8758 * y + 0.0415 * z;
|
|
887
|
-
b = 0.0557 * x + -0.204 * y + 1.0570 * z;
|
|
888
|
-
// Assume sRGB
|
|
889
|
-
r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : 12.92 * r;
|
|
890
|
-
g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : 12.92 * g;
|
|
891
|
-
b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : 12.92 * b;
|
|
892
|
-
r = Math.min(Math.max(0, r), 1);
|
|
893
|
-
g = Math.min(Math.max(0, g), 1);
|
|
894
|
-
b = Math.min(Math.max(0, b), 1);
|
|
599
|
+
}, convert.cmyk.rgb = function(cmyk) {
|
|
600
|
+
let c = cmyk[0] / 100, m = cmyk[1] / 100, y = cmyk[2] / 100, k = cmyk[3] / 100;
|
|
895
601
|
return [
|
|
896
|
-
255 *
|
|
897
|
-
255 *
|
|
898
|
-
255 *
|
|
602
|
+
255 * (1 - Math.min(1, c * (1 - k) + k)),
|
|
603
|
+
255 * (1 - Math.min(1, m * (1 - k) + k)),
|
|
604
|
+
255 * (1 - Math.min(1, y * (1 - k) + k))
|
|
899
605
|
];
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
let x = xyz[0];
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
z /= 108.883;
|
|
908
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
909
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
910
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
911
|
-
const l = 116 * y - 16;
|
|
912
|
-
const a = 500 * (x - y);
|
|
913
|
-
const b = 200 * (y - z);
|
|
914
|
-
return [
|
|
915
|
-
l,
|
|
916
|
-
a,
|
|
917
|
-
b
|
|
606
|
+
}, convert.xyz.rgb = function(xyz) {
|
|
607
|
+
let r, g, b;
|
|
608
|
+
let x = xyz[0] / 100, y = xyz[1] / 100, z = xyz[2] / 100;
|
|
609
|
+
return r = (r = 3.2406 * x + -1.5372 * y + -0.4986 * z) > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : 12.92 * r, g = (g = -0.9689 * x + 1.8758 * y + 0.0415 * z) > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : 12.92 * g, b = (b = 0.0557 * x + -0.204 * y + 1.0570 * z) > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : 12.92 * b, [
|
|
610
|
+
255 * (r = Math.min(Math.max(0, r), 1)),
|
|
611
|
+
255 * (g = Math.min(Math.max(0, g), 1)),
|
|
612
|
+
255 * (b = Math.min(Math.max(0, b), 1))
|
|
918
613
|
];
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
z = y - b / 200;
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
934
|
-
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
935
|
-
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
936
|
-
x *= 95.047;
|
|
937
|
-
y *= 100;
|
|
938
|
-
z *= 108.883;
|
|
939
|
-
return [
|
|
940
|
-
x,
|
|
614
|
+
}, convert.xyz.lab = function(xyz) {
|
|
615
|
+
let x = xyz[0], y = xyz[1], z = xyz[2];
|
|
616
|
+
return x /= 95.047, y /= 100, z /= 108.883, [
|
|
617
|
+
116 * (y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116) - 16,
|
|
618
|
+
500 * ((x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116) - y),
|
|
619
|
+
200 * (y - (z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116))
|
|
620
|
+
];
|
|
621
|
+
}, convert.lab.xyz = function(lab) {
|
|
622
|
+
let x, y, z;
|
|
623
|
+
let l = lab[0], a = lab[1], b = lab[2];
|
|
624
|
+
x = a / 500 + (y = (l + 16) / 116), z = y - b / 200;
|
|
625
|
+
let y2 = y ** 3, x2 = x ** 3, z2 = z ** 3;
|
|
626
|
+
return y = (y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787) * 100, [
|
|
627
|
+
x = (x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787) * 95.047,
|
|
941
628
|
y,
|
|
942
|
-
z
|
|
629
|
+
z = (z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787) * 108.883
|
|
943
630
|
];
|
|
944
|
-
}
|
|
945
|
-
convert.lab.lch = function(lab) {
|
|
946
|
-
const l = lab[0];
|
|
947
|
-
const a = lab[1];
|
|
948
|
-
const b = lab[2];
|
|
631
|
+
}, convert.lab.lch = function(lab) {
|
|
949
632
|
let h;
|
|
950
|
-
|
|
951
|
-
h = 360 *
|
|
952
|
-
if (h < 0) h += 360;
|
|
953
|
-
const c = Math.sqrt(a * a + b * b);
|
|
954
|
-
return [
|
|
633
|
+
let l = lab[0], a = lab[1], b = lab[2];
|
|
634
|
+
return (h = 360 * Math.atan2(b, a) / 2 / Math.PI) < 0 && (h += 360), [
|
|
955
635
|
l,
|
|
956
|
-
|
|
636
|
+
Math.sqrt(a * a + b * b),
|
|
957
637
|
h
|
|
958
638
|
];
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
const l = lch[0];
|
|
962
|
-
const c = lch[1];
|
|
963
|
-
const h = lch[2];
|
|
964
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
965
|
-
const a = c * Math.cos(hr);
|
|
966
|
-
const b = c * Math.sin(hr);
|
|
639
|
+
}, convert.lch.lab = function(lch) {
|
|
640
|
+
let l = lch[0], c = lch[1], hr = lch[2] / 360 * 2 * Math.PI;
|
|
967
641
|
return [
|
|
968
642
|
l,
|
|
969
|
-
|
|
970
|
-
|
|
643
|
+
c * Math.cos(hr),
|
|
644
|
+
c * Math.sin(hr)
|
|
971
645
|
];
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
let value = null === saturation ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
|
|
976
|
-
value = Math.round(value / 50);
|
|
977
|
-
if (0 === value) return 30;
|
|
646
|
+
}, convert.rgb.ansi16 = function(args, saturation = null) {
|
|
647
|
+
let [r, g, b] = args, value = null === saturation ? convert.rgb.hsv(args)[2] : saturation;
|
|
648
|
+
if (0 === (value = Math.round(value / 50))) return 30;
|
|
978
649
|
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
};
|
|
982
|
-
convert.hsv.ansi16 = function(args) {
|
|
983
|
-
// Optimization here; we already know the value and don't need to get
|
|
984
|
-
// it converted for us.
|
|
650
|
+
return 2 === value && (ansi += 60), ansi;
|
|
651
|
+
}, convert.hsv.ansi16 = function(args) {
|
|
985
652
|
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
// We use the extended greyscale palette here, with the exception of
|
|
992
|
-
// black and white. normal palette only has 4 greyscale shades.
|
|
993
|
-
if (r === g && g === b) {
|
|
994
|
-
if (r < 8) return 16;
|
|
995
|
-
if (r > 248) return 231;
|
|
996
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
997
|
-
}
|
|
998
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
999
|
-
return ansi;
|
|
1000
|
-
};
|
|
1001
|
-
convert.ansi16.rgb = function(args) {
|
|
653
|
+
}, convert.rgb.ansi256 = function(args) {
|
|
654
|
+
let r = args[0], g = args[1], b = args[2];
|
|
655
|
+
if (r === g && g === b) return r < 8 ? 16 : r > 248 ? 231 : Math.round((r - 8) / 247 * 24) + 232;
|
|
656
|
+
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
657
|
+
}, convert.ansi16.rgb = function(args) {
|
|
1002
658
|
let color = args % 10;
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
color
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
color,
|
|
1010
|
-
color
|
|
1011
|
-
];
|
|
1012
|
-
}
|
|
1013
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
1014
|
-
const r = (1 & color) * mult * 255;
|
|
1015
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
1016
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
659
|
+
if (0 === color || 7 === color) return args > 50 && (color += 3.5), [
|
|
660
|
+
color = color / 10.5 * 255,
|
|
661
|
+
color,
|
|
662
|
+
color
|
|
663
|
+
];
|
|
664
|
+
let mult = (~~(args > 50) + 1) * 0.5;
|
|
1017
665
|
return [
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
666
|
+
(1 & color) * mult * 255,
|
|
667
|
+
(color >> 1 & 1) * mult * 255,
|
|
668
|
+
(color >> 2 & 1) * mult * 255
|
|
1021
669
|
];
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
// Handle greyscale
|
|
670
|
+
}, convert.ansi256.rgb = function(args) {
|
|
671
|
+
let rem;
|
|
1025
672
|
if (args >= 232) {
|
|
1026
|
-
|
|
673
|
+
let c = (args - 232) * 10 + 8;
|
|
1027
674
|
return [
|
|
1028
675
|
c,
|
|
1029
676
|
c,
|
|
1030
677
|
c
|
|
1031
678
|
];
|
|
1032
679
|
}
|
|
1033
|
-
args -= 16;
|
|
1034
|
-
let rem;
|
|
1035
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
1036
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
1037
|
-
const b = rem % 6 / 5 * 255;
|
|
680
|
+
let r = Math.floor((args -= 16) / 36) / 5 * 255, g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
1038
681
|
return [
|
|
1039
682
|
r,
|
|
1040
683
|
g,
|
|
1041
|
-
|
|
684
|
+
rem % 6 / 5 * 255
|
|
1042
685
|
];
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
const integer = ((0xFF & Math.round(args[0])) << 16) + ((0xFF & Math.round(args[1])) << 8) + (0xFF & Math.round(args[2]));
|
|
1046
|
-
const string = integer.toString(16).toUpperCase();
|
|
686
|
+
}, convert.rgb.hex = function(args) {
|
|
687
|
+
let string = (((0xFF & Math.round(args[0])) << 16) + ((0xFF & Math.round(args[1])) << 8) + (0xFF & Math.round(args[2]))).toString(16).toUpperCase();
|
|
1047
688
|
return '000000'.substring(string.length) + string;
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
689
|
+
}, convert.hex.rgb = function(args) {
|
|
690
|
+
let match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1051
691
|
if (!match) return [
|
|
1052
692
|
0,
|
|
1053
693
|
0,
|
|
1054
694
|
0
|
|
1055
695
|
];
|
|
1056
696
|
let colorString = match[0];
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
const r = integer >> 16 & 0xFF;
|
|
1060
|
-
const g = integer >> 8 & 0xFF;
|
|
1061
|
-
const b = 0xFF & integer;
|
|
697
|
+
3 === match[0].length && (colorString = colorString.split('').map((char)=>char + char).join(''));
|
|
698
|
+
let integer = parseInt(colorString, 16);
|
|
1062
699
|
return [
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
700
|
+
integer >> 16 & 0xFF,
|
|
701
|
+
integer >> 8 & 0xFF,
|
|
702
|
+
0xFF & integer
|
|
1066
703
|
];
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
const max = Math.max(Math.max(r, g), b);
|
|
1073
|
-
const min = Math.min(Math.min(r, g), b);
|
|
1074
|
-
const chroma = max - min;
|
|
1075
|
-
let grayscale;
|
|
1076
|
-
let hue;
|
|
1077
|
-
grayscale = chroma < 1 ? min / (1 - chroma) : 0;
|
|
1078
|
-
hue = chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma;
|
|
1079
|
-
hue /= 6;
|
|
1080
|
-
hue %= 1;
|
|
1081
|
-
return [
|
|
1082
|
-
360 * hue,
|
|
704
|
+
}, convert.rgb.hcg = function(rgb) {
|
|
705
|
+
let grayscale, hue;
|
|
706
|
+
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, max = Math.max(Math.max(r, g), b), min = Math.min(Math.min(r, g), b), chroma = max - min;
|
|
707
|
+
return grayscale = chroma < 1 ? min / (1 - chroma) : 0, [
|
|
708
|
+
360 * (hue = (chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma) / 6 % 1),
|
|
1083
709
|
100 * chroma,
|
|
1084
710
|
100 * grayscale
|
|
1085
711
|
];
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
const l = hsl[2] / 100;
|
|
1090
|
-
const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
|
|
1091
|
-
let f = 0;
|
|
1092
|
-
if (c < 1.0) f = (l - 0.5 * c) / (1.0 - c);
|
|
1093
|
-
return [
|
|
712
|
+
}, convert.hsl.hcg = function(hsl) {
|
|
713
|
+
let s = hsl[1] / 100, l = hsl[2] / 100, c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l), f = 0;
|
|
714
|
+
return c < 1.0 && (f = (l - 0.5 * c) / (1.0 - c)), [
|
|
1094
715
|
hsl[0],
|
|
1095
716
|
100 * c,
|
|
1096
717
|
100 * f
|
|
1097
718
|
];
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
const v = hsv[2] / 100;
|
|
1102
|
-
const c = s * v;
|
|
1103
|
-
let f = 0;
|
|
1104
|
-
if (c < 1.0) f = (v - c) / (1 - c);
|
|
1105
|
-
return [
|
|
719
|
+
}, convert.hsv.hcg = function(hsv) {
|
|
720
|
+
let s = hsv[1] / 100, v = hsv[2] / 100, c = s * v, f = 0;
|
|
721
|
+
return c < 1.0 && (f = (v - c) / (1 - c)), [
|
|
1106
722
|
hsv[0],
|
|
1107
723
|
100 * c,
|
|
1108
724
|
100 * f
|
|
1109
725
|
];
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
const h = hcg[0] / 360;
|
|
1113
|
-
const c = hcg[1] / 100;
|
|
1114
|
-
const g = hcg[2] / 100;
|
|
726
|
+
}, convert.hcg.rgb = function(hcg) {
|
|
727
|
+
let h = hcg[0] / 360, c = hcg[1] / 100, g = hcg[2] / 100;
|
|
1115
728
|
if (0.0 === c) return [
|
|
1116
729
|
255 * g,
|
|
1117
730
|
255 * g,
|
|
1118
731
|
255 * g
|
|
1119
732
|
];
|
|
1120
|
-
|
|
733
|
+
let pure = [
|
|
1121
734
|
0,
|
|
1122
735
|
0,
|
|
1123
736
|
0
|
|
1124
|
-
];
|
|
1125
|
-
|
|
1126
|
-
const v = hi % 1;
|
|
1127
|
-
const w = 1 - v;
|
|
1128
|
-
let mg = 0;
|
|
1129
|
-
/* eslint-disable max-statements-per-line */ switch(Math.floor(hi)){
|
|
737
|
+
], hi = h % 1 * 6, v = hi % 1, w = 1 - v, mg = 0;
|
|
738
|
+
switch(Math.floor(hi)){
|
|
1130
739
|
case 0:
|
|
1131
|
-
pure[0] = 1;
|
|
1132
|
-
pure[1] = v;
|
|
1133
|
-
pure[2] = 0;
|
|
740
|
+
pure[0] = 1, pure[1] = v, pure[2] = 0;
|
|
1134
741
|
break;
|
|
1135
742
|
case 1:
|
|
1136
|
-
pure[0] = w;
|
|
1137
|
-
pure[1] = 1;
|
|
1138
|
-
pure[2] = 0;
|
|
743
|
+
pure[0] = w, pure[1] = 1, pure[2] = 0;
|
|
1139
744
|
break;
|
|
1140
745
|
case 2:
|
|
1141
|
-
pure[0] = 0;
|
|
1142
|
-
pure[1] = 1;
|
|
1143
|
-
pure[2] = v;
|
|
746
|
+
pure[0] = 0, pure[1] = 1, pure[2] = v;
|
|
1144
747
|
break;
|
|
1145
748
|
case 3:
|
|
1146
|
-
pure[0] = 0;
|
|
1147
|
-
pure[1] = w;
|
|
1148
|
-
pure[2] = 1;
|
|
749
|
+
pure[0] = 0, pure[1] = w, pure[2] = 1;
|
|
1149
750
|
break;
|
|
1150
751
|
case 4:
|
|
1151
|
-
pure[0] = v;
|
|
1152
|
-
pure[1] = 0;
|
|
1153
|
-
pure[2] = 1;
|
|
752
|
+
pure[0] = v, pure[1] = 0, pure[2] = 1;
|
|
1154
753
|
break;
|
|
1155
754
|
default:
|
|
1156
|
-
pure[0] = 1;
|
|
1157
|
-
pure[1] = 0;
|
|
1158
|
-
pure[2] = w;
|
|
755
|
+
pure[0] = 1, pure[1] = 0, pure[2] = w;
|
|
1159
756
|
}
|
|
1160
|
-
|
|
1161
|
-
return [
|
|
757
|
+
return mg = (1.0 - c) * g, [
|
|
1162
758
|
(c * pure[0] + mg) * 255,
|
|
1163
759
|
(c * pure[1] + mg) * 255,
|
|
1164
760
|
(c * pure[2] + mg) * 255
|
|
1165
761
|
];
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
const g = hcg[2] / 100;
|
|
1170
|
-
const v = c + g * (1.0 - c);
|
|
1171
|
-
let f = 0;
|
|
1172
|
-
if (v > 0.0) f = c / v;
|
|
1173
|
-
return [
|
|
762
|
+
}, convert.hcg.hsv = function(hcg) {
|
|
763
|
+
let c = hcg[1] / 100, v = c + hcg[2] / 100 * (1.0 - c), f = 0;
|
|
764
|
+
return v > 0.0 && (f = c / v), [
|
|
1174
765
|
hcg[0],
|
|
1175
766
|
100 * f,
|
|
1176
767
|
100 * v
|
|
1177
768
|
];
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
const g = hcg[2] / 100;
|
|
1182
|
-
const l = g * (1.0 - c) + 0.5 * c;
|
|
1183
|
-
let s = 0;
|
|
1184
|
-
if (l > 0.0 && l < 0.5) s = c / (2 * l);
|
|
1185
|
-
else if (l >= 0.5 && l < 1.0) s = c / (2 * (1 - l));
|
|
1186
|
-
return [
|
|
769
|
+
}, convert.hcg.hsl = function(hcg) {
|
|
770
|
+
let c = hcg[1] / 100, l = hcg[2] / 100 * (1.0 - c) + 0.5 * c, s = 0;
|
|
771
|
+
return l > 0.0 && l < 0.5 ? s = c / (2 * l) : l >= 0.5 && l < 1.0 && (s = c / (2 * (1 - l))), [
|
|
1187
772
|
hcg[0],
|
|
1188
773
|
100 * s,
|
|
1189
774
|
100 * l
|
|
1190
775
|
];
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
const c = hcg[1] / 100;
|
|
1194
|
-
const g = hcg[2] / 100;
|
|
1195
|
-
const v = c + g * (1.0 - c);
|
|
776
|
+
}, convert.hcg.hwb = function(hcg) {
|
|
777
|
+
let c = hcg[1] / 100, v = c + hcg[2] / 100 * (1.0 - c);
|
|
1196
778
|
return [
|
|
1197
779
|
hcg[0],
|
|
1198
780
|
(v - c) * 100,
|
|
1199
781
|
(1 - v) * 100
|
|
1200
782
|
];
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
const b = hwb[2] / 100;
|
|
1205
|
-
const v = 1 - b;
|
|
1206
|
-
const c = v - w;
|
|
1207
|
-
let g = 0;
|
|
1208
|
-
if (c < 1) g = (v - c) / (1 - c);
|
|
1209
|
-
return [
|
|
783
|
+
}, convert.hwb.hcg = function(hwb) {
|
|
784
|
+
let w = hwb[1] / 100, v = 1 - hwb[2] / 100, c = v - w, g = 0;
|
|
785
|
+
return c < 1 && (g = (v - c) / (1 - c)), [
|
|
1210
786
|
hwb[0],
|
|
1211
787
|
100 * c,
|
|
1212
788
|
100 * g
|
|
1213
789
|
];
|
|
1214
|
-
}
|
|
1215
|
-
convert.apple.rgb = function(apple) {
|
|
790
|
+
}, convert.apple.rgb = function(apple) {
|
|
1216
791
|
return [
|
|
1217
792
|
apple[0] / 65535 * 255,
|
|
1218
793
|
apple[1] / 65535 * 255,
|
|
1219
794
|
apple[2] / 65535 * 255
|
|
1220
795
|
];
|
|
1221
|
-
}
|
|
1222
|
-
convert.rgb.apple = function(rgb) {
|
|
796
|
+
}, convert.rgb.apple = function(rgb) {
|
|
1223
797
|
return [
|
|
1224
798
|
rgb[0] / 255 * 65535,
|
|
1225
799
|
rgb[1] / 255 * 65535,
|
|
1226
800
|
rgb[2] / 255 * 65535
|
|
1227
801
|
];
|
|
1228
|
-
}
|
|
1229
|
-
convert.gray.rgb = function(args) {
|
|
802
|
+
}, convert.gray.rgb = function(args) {
|
|
1230
803
|
return [
|
|
1231
804
|
args[0] / 100 * 255,
|
|
1232
805
|
args[0] / 100 * 255,
|
|
1233
806
|
args[0] / 100 * 255
|
|
1234
807
|
];
|
|
1235
|
-
}
|
|
1236
|
-
convert.gray.hsl = function(args) {
|
|
808
|
+
}, convert.gray.hsl = function(args) {
|
|
1237
809
|
return [
|
|
1238
810
|
0,
|
|
1239
811
|
0,
|
|
1240
812
|
args[0]
|
|
1241
813
|
];
|
|
1242
|
-
}
|
|
1243
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
1244
|
-
convert.gray.hwb = function(gray) {
|
|
814
|
+
}, convert.gray.hsv = convert.gray.hsl, convert.gray.hwb = function(gray) {
|
|
1245
815
|
return [
|
|
1246
816
|
0,
|
|
1247
817
|
100,
|
|
1248
818
|
gray[0]
|
|
1249
819
|
];
|
|
1250
|
-
}
|
|
1251
|
-
convert.gray.cmyk = function(gray) {
|
|
820
|
+
}, convert.gray.cmyk = function(gray) {
|
|
1252
821
|
return [
|
|
1253
822
|
0,
|
|
1254
823
|
0,
|
|
1255
824
|
0,
|
|
1256
825
|
gray[0]
|
|
1257
826
|
];
|
|
1258
|
-
}
|
|
1259
|
-
convert.gray.lab = function(gray) {
|
|
827
|
+
}, convert.gray.lab = function(gray) {
|
|
1260
828
|
return [
|
|
1261
829
|
gray[0],
|
|
1262
830
|
0,
|
|
1263
831
|
0
|
|
1264
832
|
];
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
const val = 0xFF & Math.round(gray[0] / 100 * 255);
|
|
1268
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
1269
|
-
const string = integer.toString(16).toUpperCase();
|
|
833
|
+
}, convert.gray.hex = function(gray) {
|
|
834
|
+
let val = 0xFF & Math.round(gray[0] / 100 * 255), string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
1270
835
|
return '000000'.substring(string.length) + string;
|
|
1271
|
-
}
|
|
1272
|
-
convert.rgb.gray = function(rgb) {
|
|
1273
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
836
|
+
}, convert.rgb.gray = function(rgb) {
|
|
1274
837
|
return [
|
|
1275
|
-
|
|
838
|
+
(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100
|
|
1276
839
|
];
|
|
1277
840
|
};
|
|
1278
841
|
},
|
|
1279
842
|
"../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1280
|
-
|
|
1281
|
-
const route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js");
|
|
1282
|
-
const convert = {};
|
|
1283
|
-
const models = Object.keys(conversions);
|
|
1284
|
-
function wrapRaw(fn) {
|
|
1285
|
-
const wrappedFn = function(...args) {
|
|
1286
|
-
const arg0 = args[0];
|
|
1287
|
-
if (null == arg0) return arg0;
|
|
1288
|
-
if (arg0.length > 1) args = arg0;
|
|
1289
|
-
return fn(args);
|
|
1290
|
-
};
|
|
1291
|
-
// Preserve .conversion property if there is one
|
|
1292
|
-
if ('conversion' in fn) wrappedFn.conversion = fn.conversion;
|
|
1293
|
-
return wrappedFn;
|
|
1294
|
-
}
|
|
1295
|
-
function wrapRounded(fn) {
|
|
1296
|
-
const wrappedFn = function(...args) {
|
|
1297
|
-
const arg0 = args[0];
|
|
1298
|
-
if (null == arg0) return arg0;
|
|
1299
|
-
if (arg0.length > 1) args = arg0;
|
|
1300
|
-
const result = fn(args);
|
|
1301
|
-
// We're assuming the result is an array here.
|
|
1302
|
-
// see notice in conversions.js; don't use box types
|
|
1303
|
-
// in conversion functions.
|
|
1304
|
-
if ('object' == typeof result) for(let len = result.length, i = 0; i < len; i++)result[i] = Math.round(result[i]);
|
|
1305
|
-
return result;
|
|
1306
|
-
};
|
|
1307
|
-
// Preserve .conversion property if there is one
|
|
1308
|
-
if ('conversion' in fn) wrappedFn.conversion = fn.conversion;
|
|
1309
|
-
return wrappedFn;
|
|
1310
|
-
}
|
|
843
|
+
let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {}, models = Object.keys(conversions);
|
|
1311
844
|
models.forEach((fromModel)=>{
|
|
1312
|
-
convert[fromModel] = {}
|
|
1313
|
-
Object.defineProperty(convert[fromModel], 'channels', {
|
|
845
|
+
convert[fromModel] = {}, Object.defineProperty(convert[fromModel], 'channels', {
|
|
1314
846
|
value: conversions[fromModel].channels
|
|
1315
|
-
})
|
|
1316
|
-
Object.defineProperty(convert[fromModel], 'labels', {
|
|
847
|
+
}), Object.defineProperty(convert[fromModel], 'labels', {
|
|
1317
848
|
value: conversions[fromModel].labels
|
|
1318
849
|
});
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
850
|
+
let routes = route(fromModel);
|
|
851
|
+
Object.keys(routes).forEach((toModel)=>{
|
|
852
|
+
let fn = routes[toModel];
|
|
853
|
+
convert[fromModel][toModel] = function(fn) {
|
|
854
|
+
let wrappedFn = function(...args) {
|
|
855
|
+
let arg0 = args[0];
|
|
856
|
+
if (null == arg0) return arg0;
|
|
857
|
+
arg0.length > 1 && (args = arg0);
|
|
858
|
+
let result = fn(args);
|
|
859
|
+
if ('object' == typeof result) for(let len = result.length, i = 0; i < len; i++)result[i] = Math.round(result[i]);
|
|
860
|
+
return result;
|
|
861
|
+
};
|
|
862
|
+
return 'conversion' in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
|
|
863
|
+
}(fn), convert[fromModel][toModel].raw = function(fn) {
|
|
864
|
+
let wrappedFn = function(...args) {
|
|
865
|
+
let arg0 = args[0];
|
|
866
|
+
return null == arg0 ? arg0 : (arg0.length > 1 && (args = arg0), fn(args));
|
|
867
|
+
};
|
|
868
|
+
return 'conversion' in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
|
|
869
|
+
}(fn);
|
|
1325
870
|
});
|
|
1326
|
-
});
|
|
1327
|
-
module.exports = convert;
|
|
871
|
+
}), module.exports = convert;
|
|
1328
872
|
},
|
|
1329
873
|
"../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
parent: null
|
|
1349
|
-
};
|
|
1350
|
-
return graph;
|
|
1351
|
-
}
|
|
1352
|
-
// https://en.wikipedia.org/wiki/Breadth-first_search
|
|
1353
|
-
function deriveBFS(fromModel) {
|
|
1354
|
-
const graph = buildGraph();
|
|
1355
|
-
const queue = [
|
|
1356
|
-
fromModel
|
|
1357
|
-
]; // Unshift -> queue -> pop
|
|
1358
|
-
graph[fromModel].distance = 0;
|
|
1359
|
-
while(queue.length){
|
|
1360
|
-
const current = queue.pop();
|
|
1361
|
-
const adjacents = Object.keys(conversions[current]);
|
|
1362
|
-
for(let len = adjacents.length, i = 0; i < len; i++){
|
|
1363
|
-
const adjacent = adjacents[i];
|
|
1364
|
-
const node = graph[adjacent];
|
|
1365
|
-
if (-1 === node.distance) {
|
|
1366
|
-
node.distance = graph[current].distance + 1;
|
|
1367
|
-
node.parent = current;
|
|
1368
|
-
queue.unshift(adjacent);
|
|
874
|
+
let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js");
|
|
875
|
+
module.exports = function(fromModel) {
|
|
876
|
+
let graph = function(fromModel) {
|
|
877
|
+
let graph = function() {
|
|
878
|
+
let graph = {}, models = Object.keys(conversions);
|
|
879
|
+
for(let len = models.length, i = 0; i < len; i++)graph[models[i]] = {
|
|
880
|
+
distance: -1,
|
|
881
|
+
parent: null
|
|
882
|
+
};
|
|
883
|
+
return graph;
|
|
884
|
+
}(), queue = [
|
|
885
|
+
fromModel
|
|
886
|
+
];
|
|
887
|
+
for(graph[fromModel].distance = 0; queue.length;){
|
|
888
|
+
let current = queue.pop(), adjacents = Object.keys(conversions[current]);
|
|
889
|
+
for(let len = adjacents.length, i = 0; i < len; i++){
|
|
890
|
+
let adjacent = adjacents[i], node = graph[adjacent];
|
|
891
|
+
-1 === node.distance && (node.distance = graph[current].distance + 1, node.parent = current, queue.unshift(adjacent));
|
|
1369
892
|
}
|
|
1370
893
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
}
|
|
1374
|
-
function link(from, to) {
|
|
1375
|
-
return function(args) {
|
|
1376
|
-
return to(from(args));
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1379
|
-
function wrapConversion(toModel, graph) {
|
|
1380
|
-
const path = [
|
|
1381
|
-
graph[toModel].parent,
|
|
1382
|
-
toModel
|
|
1383
|
-
];
|
|
1384
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
1385
|
-
let cur = graph[toModel].parent;
|
|
1386
|
-
while(graph[cur].parent){
|
|
1387
|
-
path.unshift(graph[cur].parent);
|
|
1388
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1389
|
-
cur = graph[cur].parent;
|
|
1390
|
-
}
|
|
1391
|
-
fn.conversion = path;
|
|
1392
|
-
return fn;
|
|
1393
|
-
}
|
|
1394
|
-
module.exports = function(fromModel) {
|
|
1395
|
-
const graph = deriveBFS(fromModel);
|
|
1396
|
-
const conversion = {};
|
|
1397
|
-
const models = Object.keys(graph);
|
|
894
|
+
return graph;
|
|
895
|
+
}(fromModel), conversion = {}, models = Object.keys(graph);
|
|
1398
896
|
for(let len = models.length, i = 0; i < len; i++){
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
897
|
+
let toModel = models[i];
|
|
898
|
+
if (null !== graph[toModel].parent) conversion[toModel] = function(toModel, graph) {
|
|
899
|
+
let path = [
|
|
900
|
+
graph[toModel].parent,
|
|
901
|
+
toModel
|
|
902
|
+
], fn = conversions[graph[toModel].parent][toModel], cur = graph[toModel].parent;
|
|
903
|
+
for(; graph[cur].parent;)path.unshift(graph[cur].parent), fn = function(from, to) {
|
|
904
|
+
return function(args) {
|
|
905
|
+
return to(from(args));
|
|
906
|
+
};
|
|
907
|
+
}(conversions[graph[cur].parent][cur], fn), cur = graph[cur].parent;
|
|
908
|
+
return fn.conversion = path, fn;
|
|
909
|
+
}(toModel, graph);
|
|
1402
910
|
}
|
|
1403
911
|
return conversion;
|
|
1404
912
|
};
|
|
@@ -2149,39 +1657,15 @@ export const modules = {
|
|
|
2149
1657
|
},
|
|
2150
1658
|
"../../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js": function(module) {
|
|
2151
1659
|
module.exports = function() {
|
|
2152
|
-
// https://mths.be/emoji
|
|
2153
1660
|
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
2154
1661
|
};
|
|
2155
1662
|
},
|
|
2156
1663
|
"../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": function(module) {
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
// Code points are derived from:
|
|
2160
|
-
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
|
2161
|
-
if (codePoint >= 0x1100 && (codePoint <= 0x115F || // Hangul Jamo
|
|
2162
|
-
0x2329 === codePoint || // LEFT-POINTING ANGLE BRACKET
|
|
2163
|
-
0x232A === codePoint || // RIGHT-POINTING ANGLE BRACKET
|
|
2164
|
-
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
|
2165
|
-
0x2E80 <= codePoint && codePoint <= 0x3247 && 0x303F !== codePoint || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
|
2166
|
-
0x3250 <= codePoint && codePoint <= 0x4DBF || // CJK Unified Ideographs .. Yi Radicals
|
|
2167
|
-
0x4E00 <= codePoint && codePoint <= 0xA4C6 || // Hangul Jamo Extended-A
|
|
2168
|
-
0xA960 <= codePoint && codePoint <= 0xA97C || // Hangul Syllables
|
|
2169
|
-
0xAC00 <= codePoint && codePoint <= 0xD7A3 || // CJK Compatibility Ideographs
|
|
2170
|
-
0xF900 <= codePoint && codePoint <= 0xFAFF || // Vertical Forms
|
|
2171
|
-
0xFE10 <= codePoint && codePoint <= 0xFE19 || // CJK Compatibility Forms .. Small Form Variants
|
|
2172
|
-
0xFE30 <= codePoint && codePoint <= 0xFE6B || // Halfwidth and Fullwidth Forms
|
|
2173
|
-
0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || // Kana Supplement
|
|
2174
|
-
0x1B000 <= codePoint && codePoint <= 0x1B001 || // Enclosed Ideographic Supplement
|
|
2175
|
-
0x1F200 <= codePoint && codePoint <= 0x1F251 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
|
2176
|
-
0x20000 <= codePoint && codePoint <= 0x3FFFD)) return true;
|
|
2177
|
-
return false;
|
|
2178
|
-
};
|
|
2179
|
-
module.exports = isFullwidthCodePoint;
|
|
2180
|
-
module.exports["default"] = isFullwidthCodePoint;
|
|
1664
|
+
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) && (!!(codePoint >= 0x1100) && (!!(codePoint <= 0x115F) || 0x2329 === codePoint || 0x232A === codePoint || !!(0x2E80 <= codePoint) && !!(codePoint <= 0x3247) && 0x303F !== codePoint || !!(0x3250 <= codePoint) && !!(codePoint <= 0x4DBF) || !!(0x4E00 <= codePoint) && !!(codePoint <= 0xA4C6) || !!(0xA960 <= codePoint) && !!(codePoint <= 0xA97C) || !!(0xAC00 <= codePoint) && !!(codePoint <= 0xD7A3) || !!(0xF900 <= codePoint) && !!(codePoint <= 0xFAFF) || !!(0xFE10 <= codePoint) && !!(codePoint <= 0xFE19) || !!(0xFE30 <= codePoint) && !!(codePoint <= 0xFE6B) || !!(0xFF01 <= codePoint) && !!(codePoint <= 0xFF60) || !!(0xFFE0 <= codePoint) && !!(codePoint <= 0xFFE6) || !!(0x1B000 <= codePoint) && !!(codePoint <= 0x1B001) || !!(0x1F200 <= codePoint) && !!(codePoint <= 0x1F251) || !!(0x20000 <= codePoint) && !!(codePoint <= 0x3FFFD)) || !1);
|
|
1665
|
+
module.exports = isFullwidthCodePoint, module.exports.default = isFullwidthCodePoint;
|
|
2181
1666
|
},
|
|
2182
1667
|
"../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2183
|
-
|
|
2184
|
-
const CONSOLE_METHODS = [
|
|
1668
|
+
let stream_1 = __webpack_require__("stream"), CONSOLE_METHODS = [
|
|
2185
1669
|
'assert',
|
|
2186
1670
|
'count',
|
|
2187
1671
|
'countReset',
|
|
@@ -2200,99 +1684,69 @@ export const modules = {
|
|
|
2200
1684
|
'timeLog',
|
|
2201
1685
|
'trace',
|
|
2202
1686
|
'warn'
|
|
2203
|
-
];
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
stderr.write = (data)=>callback('stderr', data);
|
|
2210
|
-
const internalConsole = new console.Console(stdout, stderr);
|
|
2211
|
-
for (const method of CONSOLE_METHODS){
|
|
2212
|
-
originalMethods[method] = console[method];
|
|
2213
|
-
console[method] = internalConsole[method];
|
|
2214
|
-
}
|
|
1687
|
+
], originalMethods = {};
|
|
1688
|
+
module.exports = (callback)=>{
|
|
1689
|
+
let stdout = new stream_1.PassThrough(), stderr = new stream_1.PassThrough();
|
|
1690
|
+
stdout.write = (data)=>callback('stdout', data), stderr.write = (data)=>callback('stderr', data);
|
|
1691
|
+
let internalConsole = new console.Console(stdout, stderr);
|
|
1692
|
+
for (let method of CONSOLE_METHODS)originalMethods[method] = console[method], console[method] = internalConsole[method];
|
|
2215
1693
|
return ()=>{
|
|
2216
|
-
for (
|
|
1694
|
+
for (let method of CONSOLE_METHODS)console[method] = originalMethods[method];
|
|
2217
1695
|
originalMethods = {};
|
|
2218
1696
|
};
|
|
2219
1697
|
};
|
|
2220
|
-
module.exports = patchConsole;
|
|
2221
|
-
//# sourceMappingURL=index.js.map
|
|
2222
1698
|
},
|
|
2223
1699
|
"../../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2224
|
-
|
|
2225
|
-
const astralRegex = __webpack_require__("../../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js");
|
|
2226
|
-
const ansiStyles = __webpack_require__("../../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js");
|
|
2227
|
-
const ESCAPES = [
|
|
1700
|
+
let isFullwidthCodePoint = __webpack_require__("../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), astralRegex = __webpack_require__("../../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js"), ansiStyles = __webpack_require__("../../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"), ESCAPES = [
|
|
2228
1701
|
'\u001B',
|
|
2229
1702
|
'\u009B'
|
|
2230
|
-
]
|
|
2231
|
-
const wrapAnsi = (code)=>`${ESCAPES[0]}[${code}m`;
|
|
2232
|
-
const checkAnsi = (ansiCodes, isEscapes, endAnsiCode)=>{
|
|
1703
|
+
], wrapAnsi = (code)=>`${ESCAPES[0]}[${code}m`, checkAnsi = (ansiCodes, isEscapes, endAnsiCode)=>{
|
|
2233
1704
|
let output = [];
|
|
2234
|
-
ansiCodes = [
|
|
1705
|
+
for (let ansiCode of ansiCodes = [
|
|
2235
1706
|
...ansiCodes
|
|
2236
|
-
]
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
const item = ansiStyles.codes.get(parseInt(ansiCode, 10));
|
|
1707
|
+
]){
|
|
1708
|
+
let ansiCodeOrigin = ansiCode;
|
|
1709
|
+
ansiCode.match(';') && (ansiCode = ansiCode.split(';')[0][0] + '0');
|
|
1710
|
+
let item = ansiStyles.codes.get(parseInt(ansiCode, 10));
|
|
2241
1711
|
if (item) {
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
else output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
|
|
1712
|
+
let indexEscape = ansiCodes.indexOf(item.toString());
|
|
1713
|
+
indexEscape >= 0 ? ansiCodes.splice(indexEscape, 1) : output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
|
|
2245
1714
|
} else if (isEscapes) {
|
|
2246
1715
|
output.push(wrapAnsi(0));
|
|
2247
1716
|
break;
|
|
2248
1717
|
} else output.push(wrapAnsi(ansiCodeOrigin));
|
|
2249
1718
|
}
|
|
2250
|
-
if (isEscapes) {
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
next
|
|
2260
|
-
], []);
|
|
2261
|
-
}
|
|
1719
|
+
if (isEscapes && (output = output.filter((element, index)=>output.indexOf(element) === index), void 0 !== endAnsiCode)) {
|
|
1720
|
+
let fistEscapeCode = wrapAnsi(ansiStyles.codes.get(parseInt(endAnsiCode, 10)));
|
|
1721
|
+
output = output.reduce((current, next)=>next === fistEscapeCode ? [
|
|
1722
|
+
next,
|
|
1723
|
+
...current
|
|
1724
|
+
] : [
|
|
1725
|
+
...current,
|
|
1726
|
+
next
|
|
1727
|
+
], []);
|
|
2262
1728
|
}
|
|
2263
1729
|
return output.join('');
|
|
2264
1730
|
};
|
|
2265
1731
|
module.exports = (string, begin, end)=>{
|
|
2266
|
-
|
|
1732
|
+
let ansiCode;
|
|
1733
|
+
let characters = [
|
|
2267
1734
|
...string.normalize()
|
|
2268
|
-
];
|
|
2269
|
-
const ansiCodes = [];
|
|
1735
|
+
], ansiCodes = [];
|
|
2270
1736
|
end = 'number' == typeof end ? end : characters.length;
|
|
2271
|
-
let isInsideEscape =
|
|
2272
|
-
let
|
|
2273
|
-
|
|
2274
|
-
let output = '';
|
|
2275
|
-
for (const [index, character] of characters.entries()){
|
|
2276
|
-
let leftEscape = false;
|
|
1737
|
+
let isInsideEscape = !1, visible = 0, output = '';
|
|
1738
|
+
for (let [index, character] of characters.entries()){
|
|
1739
|
+
let leftEscape = !1;
|
|
2277
1740
|
if (ESCAPES.includes(character)) {
|
|
2278
|
-
|
|
2279
|
-
ansiCode = code && code.length > 0 ? code[0] : void 0;
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
} else if (isInsideEscape && 'm' === character) {
|
|
2285
|
-
isInsideEscape = false;
|
|
2286
|
-
leftEscape = true;
|
|
2287
|
-
}
|
|
2288
|
-
if (!isInsideEscape && !leftEscape) ++visible;
|
|
2289
|
-
if (!astralRegex({
|
|
2290
|
-
exact: true
|
|
2291
|
-
}).test(character) && isFullwidthCodePoint(character.codePointAt())) ++visible;
|
|
2292
|
-
if (visible > begin && visible <= end) output += character;
|
|
1741
|
+
let code = /\d[^m]*/.exec(string.slice(index, index + 18));
|
|
1742
|
+
ansiCode = code && code.length > 0 ? code[0] : void 0, visible < end && (isInsideEscape = !0, void 0 !== ansiCode && ansiCodes.push(ansiCode));
|
|
1743
|
+
} else isInsideEscape && 'm' === character && (isInsideEscape = !1, leftEscape = !0);
|
|
1744
|
+
if (!isInsideEscape && !leftEscape && ++visible, !astralRegex({
|
|
1745
|
+
exact: !0
|
|
1746
|
+
}).test(character) && isFullwidthCodePoint(character.codePointAt()) && ++visible, visible > begin && visible <= end) output += character;
|
|
2293
1747
|
else if (visible !== begin || isInsideEscape || void 0 === ansiCode) {
|
|
2294
1748
|
if (visible >= end) {
|
|
2295
|
-
output += checkAnsi(ansiCodes,
|
|
1749
|
+
output += checkAnsi(ansiCodes, !0, ansiCode);
|
|
2296
1750
|
break;
|
|
2297
1751
|
}
|
|
2298
1752
|
} else output = checkAnsi(ansiCodes);
|
|
@@ -2301,34 +1755,20 @@ export const modules = {
|
|
|
2301
1755
|
};
|
|
2302
1756
|
},
|
|
2303
1757
|
"../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
const emojiRegex = __webpack_require__("../../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js");
|
|
2307
|
-
const stringWidth = (string)=>{
|
|
2308
|
-
if ('string' != typeof string || 0 === string.length) return 0;
|
|
2309
|
-
string = stripAnsi(string);
|
|
2310
|
-
if (0 === string.length) return 0;
|
|
1758
|
+
let stripAnsi = __webpack_require__("../../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"), isFullwidthCodePoint = __webpack_require__("../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), emojiRegex = __webpack_require__("../../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"), stringWidth = (string)=>{
|
|
1759
|
+
if ('string' != typeof string || 0 === string.length || 0 === (string = stripAnsi(string)).length) return 0;
|
|
2311
1760
|
string = string.replace(emojiRegex(), ' ');
|
|
2312
1761
|
let width = 0;
|
|
2313
1762
|
for(let i = 0; i < string.length; i++){
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
if (code <= 0x1F || code >= 0x7F && code <= 0x9F) continue;
|
|
2317
|
-
// Ignore combining characters
|
|
2318
|
-
if (!(code >= 0x300) || !(code <= 0x36F)) {
|
|
2319
|
-
// Surrogates
|
|
2320
|
-
if (code > 0xFFFF) i++;
|
|
2321
|
-
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
2322
|
-
}
|
|
1763
|
+
let code = string.codePointAt(i);
|
|
1764
|
+
if (!(code <= 0x1F) && (!(code >= 0x7F) || !(code <= 0x9F)) && (!(code >= 0x300) || !(code <= 0x36F))) code > 0xFFFF && i++, width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
2323
1765
|
}
|
|
2324
1766
|
return width;
|
|
2325
1767
|
};
|
|
2326
|
-
module.exports = stringWidth;
|
|
2327
|
-
// TODO: remove this in the next major version
|
|
2328
|
-
module.exports["default"] = stringWidth;
|
|
1768
|
+
module.exports = stringWidth, module.exports.default = stringWidth;
|
|
2329
1769
|
},
|
|
2330
1770
|
"../../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2331
|
-
|
|
1771
|
+
let ansiRegex = __webpack_require__("../../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js");
|
|
2332
1772
|
module.exports = (string)=>'string' == typeof string ? string.replace(ansiRegex(), '') : string;
|
|
2333
1773
|
}
|
|
2334
1774
|
};
|