@unpackjs/core 1.6.2 → 1.6.3
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/compiled/css-loader/index.js +20 -20
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/sass-loader/index.js +8 -8
- package/dist/bundler-config/experimentCss.cjs +2 -2
- package/dist/bundler-config/experimentCss.js +1 -1
- package/dist/bundler-config/index.cjs +4 -3
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +3 -2
- package/dist/createUnpack.cjs +3 -3
- package/dist/createUnpack.js +4 -4
- package/dist/plugin-progress/rspack.cjs +12 -11
- package/dist/plugin-progress/rspack.js +12 -11
- package/dist/plugin-progress/webpack.cjs +12 -11
- package/dist/plugin-progress/webpack.js +12 -11
- package/dist/progressBar.cjs +5 -5
- package/dist/progressBar.js +4 -4
- package/dist/run/dev.cjs +1 -1
- package/dist/run/dev.js +1 -1
- package/dist/thread-loader/worker.js +1 -1
- package/dist/utils.cjs +14 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +12 -0
- package/package.json +2 -7
- package/compiled/log-update/index.d.ts +0 -1
- package/compiled/log-update/index.js +0 -1970
- package/compiled/log-update/package.json +0 -1
- package/dist/lightningcss/index.cjs +0 -21
- package/dist/lightningcss/index.d.ts +0 -2
- package/dist/lightningcss/index.d.ts.map +0 -1
- package/dist/lightningcss/index.js +0 -10
- package/dist/typed-css-modules/index.cjs +0 -21
- package/dist/typed-css-modules/index.d.ts +0 -2
- package/dist/typed-css-modules/index.d.ts.map +0 -1
- package/dist/typed-css-modules/index.js +0 -10
|
@@ -1,1970 +0,0 @@
|
|
|
1
|
-
(() => {
|
|
2
|
-
var __webpack_modules__ = {
|
|
3
|
-
153: (module) => {
|
|
4
|
-
"use strict";
|
|
5
|
-
const ansiEscapes = module.exports;
|
|
6
|
-
module.exports["default"] = ansiEscapes;
|
|
7
|
-
const ESC = "[";
|
|
8
|
-
const OSC = "]";
|
|
9
|
-
const BEL = "";
|
|
10
|
-
const SEP = ";";
|
|
11
|
-
const isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
|
|
12
|
-
ansiEscapes.cursorTo = (x, y) => {
|
|
13
|
-
if (typeof x !== "number") {
|
|
14
|
-
throw new TypeError("The `x` argument is required");
|
|
15
|
-
}
|
|
16
|
-
if (typeof y !== "number") {
|
|
17
|
-
return ESC + (x + 1) + "G";
|
|
18
|
-
}
|
|
19
|
-
return ESC + (y + 1) + ";" + (x + 1) + "H";
|
|
20
|
-
};
|
|
21
|
-
ansiEscapes.cursorMove = (x, y) => {
|
|
22
|
-
if (typeof x !== "number") {
|
|
23
|
-
throw new TypeError("The `x` argument is required");
|
|
24
|
-
}
|
|
25
|
-
let ret = "";
|
|
26
|
-
if (x < 0) {
|
|
27
|
-
ret += ESC + -x + "D";
|
|
28
|
-
} else if (x > 0) {
|
|
29
|
-
ret += ESC + x + "C";
|
|
30
|
-
}
|
|
31
|
-
if (y < 0) {
|
|
32
|
-
ret += ESC + -y + "A";
|
|
33
|
-
} else if (y > 0) {
|
|
34
|
-
ret += ESC + y + "B";
|
|
35
|
-
}
|
|
36
|
-
return ret;
|
|
37
|
-
};
|
|
38
|
-
ansiEscapes.cursorUp = (count = 1) => ESC + count + "A";
|
|
39
|
-
ansiEscapes.cursorDown = (count = 1) => ESC + count + "B";
|
|
40
|
-
ansiEscapes.cursorForward = (count = 1) => ESC + count + "C";
|
|
41
|
-
ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D";
|
|
42
|
-
ansiEscapes.cursorLeft = ESC + "G";
|
|
43
|
-
ansiEscapes.cursorSavePosition = isTerminalApp ? "7" : ESC + "s";
|
|
44
|
-
ansiEscapes.cursorRestorePosition = isTerminalApp ? "8" : ESC + "u";
|
|
45
|
-
ansiEscapes.cursorGetPosition = ESC + "6n";
|
|
46
|
-
ansiEscapes.cursorNextLine = ESC + "E";
|
|
47
|
-
ansiEscapes.cursorPrevLine = ESC + "F";
|
|
48
|
-
ansiEscapes.cursorHide = ESC + "?25l";
|
|
49
|
-
ansiEscapes.cursorShow = ESC + "?25h";
|
|
50
|
-
ansiEscapes.eraseLines = (count) => {
|
|
51
|
-
let clear = "";
|
|
52
|
-
for (let i = 0; i < count; i++) {
|
|
53
|
-
clear +=
|
|
54
|
-
ansiEscapes.eraseLine +
|
|
55
|
-
(i < count - 1 ? ansiEscapes.cursorUp() : "");
|
|
56
|
-
}
|
|
57
|
-
if (count) {
|
|
58
|
-
clear += ansiEscapes.cursorLeft;
|
|
59
|
-
}
|
|
60
|
-
return clear;
|
|
61
|
-
};
|
|
62
|
-
ansiEscapes.eraseEndLine = ESC + "K";
|
|
63
|
-
ansiEscapes.eraseStartLine = ESC + "1K";
|
|
64
|
-
ansiEscapes.eraseLine = ESC + "2K";
|
|
65
|
-
ansiEscapes.eraseDown = ESC + "J";
|
|
66
|
-
ansiEscapes.eraseUp = ESC + "1J";
|
|
67
|
-
ansiEscapes.eraseScreen = ESC + "2J";
|
|
68
|
-
ansiEscapes.scrollUp = ESC + "S";
|
|
69
|
-
ansiEscapes.scrollDown = ESC + "T";
|
|
70
|
-
ansiEscapes.clearScreen = "c";
|
|
71
|
-
ansiEscapes.clearTerminal =
|
|
72
|
-
process.platform === "win32"
|
|
73
|
-
? `${ansiEscapes.eraseScreen}${ESC}0f`
|
|
74
|
-
: `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
|
|
75
|
-
ansiEscapes.beep = BEL;
|
|
76
|
-
ansiEscapes.link = (text, url) =>
|
|
77
|
-
[OSC, "8", SEP, SEP, url, BEL, text, OSC, "8", SEP, SEP, BEL].join("");
|
|
78
|
-
ansiEscapes.image = (buffer, options = {}) => {
|
|
79
|
-
let ret = `${OSC}1337;File=inline=1`;
|
|
80
|
-
if (options.width) {
|
|
81
|
-
ret += `;width=${options.width}`;
|
|
82
|
-
}
|
|
83
|
-
if (options.height) {
|
|
84
|
-
ret += `;height=${options.height}`;
|
|
85
|
-
}
|
|
86
|
-
if (options.preserveAspectRatio === false) {
|
|
87
|
-
ret += ";preserveAspectRatio=0";
|
|
88
|
-
}
|
|
89
|
-
return ret + ":" + buffer.toString("base64") + BEL;
|
|
90
|
-
};
|
|
91
|
-
ansiEscapes.iTerm = {
|
|
92
|
-
setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
|
|
93
|
-
annotation: (message, options = {}) => {
|
|
94
|
-
let ret = `${OSC}1337;`;
|
|
95
|
-
const hasX = typeof options.x !== "undefined";
|
|
96
|
-
const hasY = typeof options.y !== "undefined";
|
|
97
|
-
if (
|
|
98
|
-
(hasX || hasY) &&
|
|
99
|
-
!(hasX && hasY && typeof options.length !== "undefined")
|
|
100
|
-
) {
|
|
101
|
-
throw new Error(
|
|
102
|
-
"`x`, `y` and `length` must be defined when `x` or `y` is defined",
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
message = message.replace(/\|/g, "");
|
|
106
|
-
ret += options.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation=";
|
|
107
|
-
if (options.length > 0) {
|
|
108
|
-
ret += (
|
|
109
|
-
hasX
|
|
110
|
-
? [message, options.length, options.x, options.y]
|
|
111
|
-
: [options.length, message]
|
|
112
|
-
).join("|");
|
|
113
|
-
} else {
|
|
114
|
-
ret += message;
|
|
115
|
-
}
|
|
116
|
-
return ret + BEL;
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
548: (module) => {
|
|
121
|
-
"use strict";
|
|
122
|
-
module.exports = ({ onlyFirst = false } = {}) => {
|
|
123
|
-
const pattern = [
|
|
124
|
-
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
125
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))",
|
|
126
|
-
].join("|");
|
|
127
|
-
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
131: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
131
|
-
"use strict";
|
|
132
|
-
module = __nccwpck_require__.nmd(module);
|
|
133
|
-
const wrapAnsi16 =
|
|
134
|
-
(fn, offset) =>
|
|
135
|
-
(...args) => {
|
|
136
|
-
const code = fn(...args);
|
|
137
|
-
return `[${code + offset}m`;
|
|
138
|
-
};
|
|
139
|
-
const wrapAnsi256 =
|
|
140
|
-
(fn, offset) =>
|
|
141
|
-
(...args) => {
|
|
142
|
-
const code = fn(...args);
|
|
143
|
-
return `[${38 + offset};5;${code}m`;
|
|
144
|
-
};
|
|
145
|
-
const wrapAnsi16m =
|
|
146
|
-
(fn, offset) =>
|
|
147
|
-
(...args) => {
|
|
148
|
-
const rgb = fn(...args);
|
|
149
|
-
return `[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
150
|
-
};
|
|
151
|
-
const ansi2ansi = (n) => n;
|
|
152
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
153
|
-
const setLazyProperty = (object, property, get) => {
|
|
154
|
-
Object.defineProperty(object, property, {
|
|
155
|
-
get: () => {
|
|
156
|
-
const value = get();
|
|
157
|
-
Object.defineProperty(object, property, {
|
|
158
|
-
value,
|
|
159
|
-
enumerable: true,
|
|
160
|
-
configurable: true,
|
|
161
|
-
});
|
|
162
|
-
return value;
|
|
163
|
-
},
|
|
164
|
-
enumerable: true,
|
|
165
|
-
configurable: true,
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
let colorConvert;
|
|
169
|
-
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
170
|
-
if (colorConvert === undefined) {
|
|
171
|
-
colorConvert = __nccwpck_require__(285);
|
|
172
|
-
}
|
|
173
|
-
const offset = isBackground ? 10 : 0;
|
|
174
|
-
const styles = {};
|
|
175
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
176
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
177
|
-
if (sourceSpace === targetSpace) {
|
|
178
|
-
styles[name] = wrap(identity, offset);
|
|
179
|
-
} else if (typeof suite === "object") {
|
|
180
|
-
styles[name] = wrap(suite[targetSpace], offset);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return styles;
|
|
184
|
-
};
|
|
185
|
-
function assembleStyles() {
|
|
186
|
-
const codes = new Map();
|
|
187
|
-
const styles = {
|
|
188
|
-
modifier: {
|
|
189
|
-
reset: [0, 0],
|
|
190
|
-
bold: [1, 22],
|
|
191
|
-
dim: [2, 22],
|
|
192
|
-
italic: [3, 23],
|
|
193
|
-
underline: [4, 24],
|
|
194
|
-
inverse: [7, 27],
|
|
195
|
-
hidden: [8, 28],
|
|
196
|
-
strikethrough: [9, 29],
|
|
197
|
-
},
|
|
198
|
-
color: {
|
|
199
|
-
black: [30, 39],
|
|
200
|
-
red: [31, 39],
|
|
201
|
-
green: [32, 39],
|
|
202
|
-
yellow: [33, 39],
|
|
203
|
-
blue: [34, 39],
|
|
204
|
-
magenta: [35, 39],
|
|
205
|
-
cyan: [36, 39],
|
|
206
|
-
white: [37, 39],
|
|
207
|
-
blackBright: [90, 39],
|
|
208
|
-
redBright: [91, 39],
|
|
209
|
-
greenBright: [92, 39],
|
|
210
|
-
yellowBright: [93, 39],
|
|
211
|
-
blueBright: [94, 39],
|
|
212
|
-
magentaBright: [95, 39],
|
|
213
|
-
cyanBright: [96, 39],
|
|
214
|
-
whiteBright: [97, 39],
|
|
215
|
-
},
|
|
216
|
-
bgColor: {
|
|
217
|
-
bgBlack: [40, 49],
|
|
218
|
-
bgRed: [41, 49],
|
|
219
|
-
bgGreen: [42, 49],
|
|
220
|
-
bgYellow: [43, 49],
|
|
221
|
-
bgBlue: [44, 49],
|
|
222
|
-
bgMagenta: [45, 49],
|
|
223
|
-
bgCyan: [46, 49],
|
|
224
|
-
bgWhite: [47, 49],
|
|
225
|
-
bgBlackBright: [100, 49],
|
|
226
|
-
bgRedBright: [101, 49],
|
|
227
|
-
bgGreenBright: [102, 49],
|
|
228
|
-
bgYellowBright: [103, 49],
|
|
229
|
-
bgBlueBright: [104, 49],
|
|
230
|
-
bgMagentaBright: [105, 49],
|
|
231
|
-
bgCyanBright: [106, 49],
|
|
232
|
-
bgWhiteBright: [107, 49],
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
styles.color.gray = styles.color.blackBright;
|
|
236
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
237
|
-
styles.color.grey = styles.color.blackBright;
|
|
238
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
239
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
240
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
241
|
-
styles[styleName] = {
|
|
242
|
-
open: `[${style[0]}m`,
|
|
243
|
-
close: `[${style[1]}m`,
|
|
244
|
-
};
|
|
245
|
-
group[styleName] = styles[styleName];
|
|
246
|
-
codes.set(style[0], style[1]);
|
|
247
|
-
}
|
|
248
|
-
Object.defineProperty(styles, groupName, {
|
|
249
|
-
value: group,
|
|
250
|
-
enumerable: false,
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
Object.defineProperty(styles, "codes", {
|
|
254
|
-
value: codes,
|
|
255
|
-
enumerable: false,
|
|
256
|
-
});
|
|
257
|
-
styles.color.close = "[39m";
|
|
258
|
-
styles.bgColor.close = "[49m";
|
|
259
|
-
setLazyProperty(styles.color, "ansi", () =>
|
|
260
|
-
makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false),
|
|
261
|
-
);
|
|
262
|
-
setLazyProperty(styles.color, "ansi256", () =>
|
|
263
|
-
makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false),
|
|
264
|
-
);
|
|
265
|
-
setLazyProperty(styles.color, "ansi16m", () =>
|
|
266
|
-
makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false),
|
|
267
|
-
);
|
|
268
|
-
setLazyProperty(styles.bgColor, "ansi", () =>
|
|
269
|
-
makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true),
|
|
270
|
-
);
|
|
271
|
-
setLazyProperty(styles.bgColor, "ansi256", () =>
|
|
272
|
-
makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true),
|
|
273
|
-
);
|
|
274
|
-
setLazyProperty(styles.bgColor, "ansi16m", () =>
|
|
275
|
-
makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true),
|
|
276
|
-
);
|
|
277
|
-
return styles;
|
|
278
|
-
}
|
|
279
|
-
Object.defineProperty(module, "exports", {
|
|
280
|
-
enumerable: true,
|
|
281
|
-
get: assembleStyles,
|
|
282
|
-
});
|
|
283
|
-
},
|
|
284
|
-
68: (module) => {
|
|
285
|
-
"use strict";
|
|
286
|
-
const regex = "[\ud800-\udbff][\udc00-\udfff]";
|
|
287
|
-
const astralRegex = (options) =>
|
|
288
|
-
options && options.exact
|
|
289
|
-
? new RegExp(`^${regex}$`)
|
|
290
|
-
: new RegExp(regex, "g");
|
|
291
|
-
module.exports = astralRegex;
|
|
292
|
-
},
|
|
293
|
-
205: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
294
|
-
"use strict";
|
|
295
|
-
const restoreCursor = __nccwpck_require__(375);
|
|
296
|
-
let isHidden = false;
|
|
297
|
-
exports.show = (writableStream = process.stderr) => {
|
|
298
|
-
if (!writableStream.isTTY) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
isHidden = false;
|
|
302
|
-
writableStream.write("[?25h");
|
|
303
|
-
};
|
|
304
|
-
exports.hide = (writableStream = process.stderr) => {
|
|
305
|
-
if (!writableStream.isTTY) {
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
restoreCursor();
|
|
309
|
-
isHidden = true;
|
|
310
|
-
writableStream.write("[?25l");
|
|
311
|
-
};
|
|
312
|
-
exports.toggle = (force, writableStream) => {
|
|
313
|
-
if (force !== undefined) {
|
|
314
|
-
isHidden = force;
|
|
315
|
-
}
|
|
316
|
-
if (isHidden) {
|
|
317
|
-
exports.show(writableStream);
|
|
318
|
-
} else {
|
|
319
|
-
exports.hide(writableStream);
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
},
|
|
323
|
-
668: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
324
|
-
const cssKeywords = __nccwpck_require__(667);
|
|
325
|
-
const reverseKeywords = {};
|
|
326
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
327
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
328
|
-
}
|
|
329
|
-
const convert = {
|
|
330
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
331
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
332
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
333
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
334
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
335
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
336
|
-
lab: { channels: 3, labels: "lab" },
|
|
337
|
-
lch: { channels: 3, labels: "lch" },
|
|
338
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
339
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
340
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
341
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
342
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
343
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
344
|
-
gray: { channels: 1, labels: ["gray"] },
|
|
345
|
-
};
|
|
346
|
-
module.exports = convert;
|
|
347
|
-
for (const model of Object.keys(convert)) {
|
|
348
|
-
if (!("channels" in convert[model])) {
|
|
349
|
-
throw new Error("missing channels property: " + model);
|
|
350
|
-
}
|
|
351
|
-
if (!("labels" in convert[model])) {
|
|
352
|
-
throw new Error("missing channel labels property: " + model);
|
|
353
|
-
}
|
|
354
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
355
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
356
|
-
}
|
|
357
|
-
const { channels, labels } = convert[model];
|
|
358
|
-
delete convert[model].channels;
|
|
359
|
-
delete convert[model].labels;
|
|
360
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
361
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
362
|
-
}
|
|
363
|
-
convert.rgb.hsl = function (rgb) {
|
|
364
|
-
const r = rgb[0] / 255;
|
|
365
|
-
const g = rgb[1] / 255;
|
|
366
|
-
const b = rgb[2] / 255;
|
|
367
|
-
const min = Math.min(r, g, b);
|
|
368
|
-
const max = Math.max(r, g, b);
|
|
369
|
-
const delta = max - min;
|
|
370
|
-
let h;
|
|
371
|
-
let s;
|
|
372
|
-
if (max === min) {
|
|
373
|
-
h = 0;
|
|
374
|
-
} else if (r === max) {
|
|
375
|
-
h = (g - b) / delta;
|
|
376
|
-
} else if (g === max) {
|
|
377
|
-
h = 2 + (b - r) / delta;
|
|
378
|
-
} else if (b === max) {
|
|
379
|
-
h = 4 + (r - g) / delta;
|
|
380
|
-
}
|
|
381
|
-
h = Math.min(h * 60, 360);
|
|
382
|
-
if (h < 0) {
|
|
383
|
-
h += 360;
|
|
384
|
-
}
|
|
385
|
-
const l = (min + max) / 2;
|
|
386
|
-
if (max === min) {
|
|
387
|
-
s = 0;
|
|
388
|
-
} else if (l <= 0.5) {
|
|
389
|
-
s = delta / (max + min);
|
|
390
|
-
} else {
|
|
391
|
-
s = delta / (2 - max - min);
|
|
392
|
-
}
|
|
393
|
-
return [h, s * 100, l * 100];
|
|
394
|
-
};
|
|
395
|
-
convert.rgb.hsv = function (rgb) {
|
|
396
|
-
let rdif;
|
|
397
|
-
let gdif;
|
|
398
|
-
let bdif;
|
|
399
|
-
let h;
|
|
400
|
-
let s;
|
|
401
|
-
const r = rgb[0] / 255;
|
|
402
|
-
const g = rgb[1] / 255;
|
|
403
|
-
const b = rgb[2] / 255;
|
|
404
|
-
const v = Math.max(r, g, b);
|
|
405
|
-
const diff = v - Math.min(r, g, b);
|
|
406
|
-
const diffc = function (c) {
|
|
407
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
408
|
-
};
|
|
409
|
-
if (diff === 0) {
|
|
410
|
-
h = 0;
|
|
411
|
-
s = 0;
|
|
412
|
-
} else {
|
|
413
|
-
s = diff / v;
|
|
414
|
-
rdif = diffc(r);
|
|
415
|
-
gdif = diffc(g);
|
|
416
|
-
bdif = diffc(b);
|
|
417
|
-
if (r === v) {
|
|
418
|
-
h = bdif - gdif;
|
|
419
|
-
} else if (g === v) {
|
|
420
|
-
h = 1 / 3 + rdif - bdif;
|
|
421
|
-
} else if (b === v) {
|
|
422
|
-
h = 2 / 3 + gdif - rdif;
|
|
423
|
-
}
|
|
424
|
-
if (h < 0) {
|
|
425
|
-
h += 1;
|
|
426
|
-
} else if (h > 1) {
|
|
427
|
-
h -= 1;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
return [h * 360, s * 100, v * 100];
|
|
431
|
-
};
|
|
432
|
-
convert.rgb.hwb = function (rgb) {
|
|
433
|
-
const r = rgb[0];
|
|
434
|
-
const g = rgb[1];
|
|
435
|
-
let b = rgb[2];
|
|
436
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
437
|
-
const w = (1 / 255) * Math.min(r, Math.min(g, b));
|
|
438
|
-
b = 1 - (1 / 255) * Math.max(r, Math.max(g, b));
|
|
439
|
-
return [h, w * 100, b * 100];
|
|
440
|
-
};
|
|
441
|
-
convert.rgb.cmyk = function (rgb) {
|
|
442
|
-
const r = rgb[0] / 255;
|
|
443
|
-
const g = rgb[1] / 255;
|
|
444
|
-
const b = rgb[2] / 255;
|
|
445
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
446
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
447
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
448
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
449
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
450
|
-
};
|
|
451
|
-
function comparativeDistance(x, y) {
|
|
452
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
453
|
-
}
|
|
454
|
-
convert.rgb.keyword = function (rgb) {
|
|
455
|
-
const reversed = reverseKeywords[rgb];
|
|
456
|
-
if (reversed) {
|
|
457
|
-
return reversed;
|
|
458
|
-
}
|
|
459
|
-
let currentClosestDistance = Infinity;
|
|
460
|
-
let currentClosestKeyword;
|
|
461
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
462
|
-
const value = cssKeywords[keyword];
|
|
463
|
-
const distance = comparativeDistance(rgb, value);
|
|
464
|
-
if (distance < currentClosestDistance) {
|
|
465
|
-
currentClosestDistance = distance;
|
|
466
|
-
currentClosestKeyword = keyword;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
return currentClosestKeyword;
|
|
470
|
-
};
|
|
471
|
-
convert.keyword.rgb = function (keyword) {
|
|
472
|
-
return cssKeywords[keyword];
|
|
473
|
-
};
|
|
474
|
-
convert.rgb.xyz = function (rgb) {
|
|
475
|
-
let r = rgb[0] / 255;
|
|
476
|
-
let g = rgb[1] / 255;
|
|
477
|
-
let b = rgb[2] / 255;
|
|
478
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
479
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
480
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
481
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
482
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
483
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
484
|
-
return [x * 100, y * 100, z * 100];
|
|
485
|
-
};
|
|
486
|
-
convert.rgb.lab = function (rgb) {
|
|
487
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
488
|
-
let x = xyz[0];
|
|
489
|
-
let y = xyz[1];
|
|
490
|
-
let z = xyz[2];
|
|
491
|
-
x /= 95.047;
|
|
492
|
-
y /= 100;
|
|
493
|
-
z /= 108.883;
|
|
494
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
495
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
496
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
497
|
-
const l = 116 * y - 16;
|
|
498
|
-
const a = 500 * (x - y);
|
|
499
|
-
const b = 200 * (y - z);
|
|
500
|
-
return [l, a, b];
|
|
501
|
-
};
|
|
502
|
-
convert.hsl.rgb = function (hsl) {
|
|
503
|
-
const h = hsl[0] / 360;
|
|
504
|
-
const s = hsl[1] / 100;
|
|
505
|
-
const l = hsl[2] / 100;
|
|
506
|
-
let t2;
|
|
507
|
-
let t3;
|
|
508
|
-
let val;
|
|
509
|
-
if (s === 0) {
|
|
510
|
-
val = l * 255;
|
|
511
|
-
return [val, val, val];
|
|
512
|
-
}
|
|
513
|
-
if (l < 0.5) {
|
|
514
|
-
t2 = l * (1 + s);
|
|
515
|
-
} else {
|
|
516
|
-
t2 = l + s - l * s;
|
|
517
|
-
}
|
|
518
|
-
const t1 = 2 * l - t2;
|
|
519
|
-
const rgb = [0, 0, 0];
|
|
520
|
-
for (let i = 0; i < 3; i++) {
|
|
521
|
-
t3 = h + (1 / 3) * -(i - 1);
|
|
522
|
-
if (t3 < 0) {
|
|
523
|
-
t3++;
|
|
524
|
-
}
|
|
525
|
-
if (t3 > 1) {
|
|
526
|
-
t3--;
|
|
527
|
-
}
|
|
528
|
-
if (6 * t3 < 1) {
|
|
529
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
530
|
-
} else if (2 * t3 < 1) {
|
|
531
|
-
val = t2;
|
|
532
|
-
} else if (3 * t3 < 2) {
|
|
533
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
534
|
-
} else {
|
|
535
|
-
val = t1;
|
|
536
|
-
}
|
|
537
|
-
rgb[i] = val * 255;
|
|
538
|
-
}
|
|
539
|
-
return rgb;
|
|
540
|
-
};
|
|
541
|
-
convert.hsl.hsv = function (hsl) {
|
|
542
|
-
const h = hsl[0];
|
|
543
|
-
let s = hsl[1] / 100;
|
|
544
|
-
let l = hsl[2] / 100;
|
|
545
|
-
let smin = s;
|
|
546
|
-
const lmin = Math.max(l, 0.01);
|
|
547
|
-
l *= 2;
|
|
548
|
-
s *= l <= 1 ? l : 2 - l;
|
|
549
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
550
|
-
const v = (l + s) / 2;
|
|
551
|
-
const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
|
|
552
|
-
return [h, sv * 100, v * 100];
|
|
553
|
-
};
|
|
554
|
-
convert.hsv.rgb = function (hsv) {
|
|
555
|
-
const h = hsv[0] / 60;
|
|
556
|
-
const s = hsv[1] / 100;
|
|
557
|
-
let v = hsv[2] / 100;
|
|
558
|
-
const hi = Math.floor(h) % 6;
|
|
559
|
-
const f = h - Math.floor(h);
|
|
560
|
-
const p = 255 * v * (1 - s);
|
|
561
|
-
const q = 255 * v * (1 - s * f);
|
|
562
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
563
|
-
v *= 255;
|
|
564
|
-
switch (hi) {
|
|
565
|
-
case 0:
|
|
566
|
-
return [v, t, p];
|
|
567
|
-
case 1:
|
|
568
|
-
return [q, v, p];
|
|
569
|
-
case 2:
|
|
570
|
-
return [p, v, t];
|
|
571
|
-
case 3:
|
|
572
|
-
return [p, q, v];
|
|
573
|
-
case 4:
|
|
574
|
-
return [t, p, v];
|
|
575
|
-
case 5:
|
|
576
|
-
return [v, p, q];
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
convert.hsv.hsl = function (hsv) {
|
|
580
|
-
const h = hsv[0];
|
|
581
|
-
const s = hsv[1] / 100;
|
|
582
|
-
const v = hsv[2] / 100;
|
|
583
|
-
const vmin = Math.max(v, 0.01);
|
|
584
|
-
let sl;
|
|
585
|
-
let l;
|
|
586
|
-
l = (2 - s) * v;
|
|
587
|
-
const lmin = (2 - s) * vmin;
|
|
588
|
-
sl = s * vmin;
|
|
589
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
590
|
-
sl = sl || 0;
|
|
591
|
-
l /= 2;
|
|
592
|
-
return [h, sl * 100, l * 100];
|
|
593
|
-
};
|
|
594
|
-
convert.hwb.rgb = function (hwb) {
|
|
595
|
-
const h = hwb[0] / 360;
|
|
596
|
-
let wh = hwb[1] / 100;
|
|
597
|
-
let bl = hwb[2] / 100;
|
|
598
|
-
const ratio = wh + bl;
|
|
599
|
-
let f;
|
|
600
|
-
if (ratio > 1) {
|
|
601
|
-
wh /= ratio;
|
|
602
|
-
bl /= ratio;
|
|
603
|
-
}
|
|
604
|
-
const i = Math.floor(6 * h);
|
|
605
|
-
const v = 1 - bl;
|
|
606
|
-
f = 6 * h - i;
|
|
607
|
-
if ((i & 1) !== 0) {
|
|
608
|
-
f = 1 - f;
|
|
609
|
-
}
|
|
610
|
-
const n = wh + f * (v - wh);
|
|
611
|
-
let r;
|
|
612
|
-
let g;
|
|
613
|
-
let b;
|
|
614
|
-
switch (i) {
|
|
615
|
-
default:
|
|
616
|
-
case 6:
|
|
617
|
-
case 0:
|
|
618
|
-
r = v;
|
|
619
|
-
g = n;
|
|
620
|
-
b = wh;
|
|
621
|
-
break;
|
|
622
|
-
case 1:
|
|
623
|
-
r = n;
|
|
624
|
-
g = v;
|
|
625
|
-
b = wh;
|
|
626
|
-
break;
|
|
627
|
-
case 2:
|
|
628
|
-
r = wh;
|
|
629
|
-
g = v;
|
|
630
|
-
b = n;
|
|
631
|
-
break;
|
|
632
|
-
case 3:
|
|
633
|
-
r = wh;
|
|
634
|
-
g = n;
|
|
635
|
-
b = v;
|
|
636
|
-
break;
|
|
637
|
-
case 4:
|
|
638
|
-
r = n;
|
|
639
|
-
g = wh;
|
|
640
|
-
b = v;
|
|
641
|
-
break;
|
|
642
|
-
case 5:
|
|
643
|
-
r = v;
|
|
644
|
-
g = wh;
|
|
645
|
-
b = n;
|
|
646
|
-
break;
|
|
647
|
-
}
|
|
648
|
-
return [r * 255, g * 255, b * 255];
|
|
649
|
-
};
|
|
650
|
-
convert.cmyk.rgb = function (cmyk) {
|
|
651
|
-
const c = cmyk[0] / 100;
|
|
652
|
-
const m = cmyk[1] / 100;
|
|
653
|
-
const y = cmyk[2] / 100;
|
|
654
|
-
const k = cmyk[3] / 100;
|
|
655
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
656
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
657
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
658
|
-
return [r * 255, g * 255, b * 255];
|
|
659
|
-
};
|
|
660
|
-
convert.xyz.rgb = function (xyz) {
|
|
661
|
-
const x = xyz[0] / 100;
|
|
662
|
-
const y = xyz[1] / 100;
|
|
663
|
-
const z = xyz[2] / 100;
|
|
664
|
-
let r;
|
|
665
|
-
let g;
|
|
666
|
-
let b;
|
|
667
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
668
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
669
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
670
|
-
r = r > 0.0031308 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
671
|
-
g = g > 0.0031308 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
672
|
-
b = b > 0.0031308 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
673
|
-
r = Math.min(Math.max(0, r), 1);
|
|
674
|
-
g = Math.min(Math.max(0, g), 1);
|
|
675
|
-
b = Math.min(Math.max(0, b), 1);
|
|
676
|
-
return [r * 255, g * 255, b * 255];
|
|
677
|
-
};
|
|
678
|
-
convert.xyz.lab = function (xyz) {
|
|
679
|
-
let x = xyz[0];
|
|
680
|
-
let y = xyz[1];
|
|
681
|
-
let z = xyz[2];
|
|
682
|
-
x /= 95.047;
|
|
683
|
-
y /= 100;
|
|
684
|
-
z /= 108.883;
|
|
685
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
686
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
687
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
688
|
-
const l = 116 * y - 16;
|
|
689
|
-
const a = 500 * (x - y);
|
|
690
|
-
const b = 200 * (y - z);
|
|
691
|
-
return [l, a, b];
|
|
692
|
-
};
|
|
693
|
-
convert.lab.xyz = function (lab) {
|
|
694
|
-
const l = lab[0];
|
|
695
|
-
const a = lab[1];
|
|
696
|
-
const b = lab[2];
|
|
697
|
-
let x;
|
|
698
|
-
let y;
|
|
699
|
-
let z;
|
|
700
|
-
y = (l + 16) / 116;
|
|
701
|
-
x = a / 500 + y;
|
|
702
|
-
z = y - b / 200;
|
|
703
|
-
const y2 = y ** 3;
|
|
704
|
-
const x2 = x ** 3;
|
|
705
|
-
const z2 = z ** 3;
|
|
706
|
-
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
707
|
-
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
708
|
-
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
709
|
-
x *= 95.047;
|
|
710
|
-
y *= 100;
|
|
711
|
-
z *= 108.883;
|
|
712
|
-
return [x, y, z];
|
|
713
|
-
};
|
|
714
|
-
convert.lab.lch = function (lab) {
|
|
715
|
-
const l = lab[0];
|
|
716
|
-
const a = lab[1];
|
|
717
|
-
const b = lab[2];
|
|
718
|
-
let h;
|
|
719
|
-
const hr = Math.atan2(b, a);
|
|
720
|
-
h = (hr * 360) / 2 / Math.PI;
|
|
721
|
-
if (h < 0) {
|
|
722
|
-
h += 360;
|
|
723
|
-
}
|
|
724
|
-
const c = Math.sqrt(a * a + b * b);
|
|
725
|
-
return [l, c, h];
|
|
726
|
-
};
|
|
727
|
-
convert.lch.lab = function (lch) {
|
|
728
|
-
const l = lch[0];
|
|
729
|
-
const c = lch[1];
|
|
730
|
-
const h = lch[2];
|
|
731
|
-
const hr = (h / 360) * 2 * Math.PI;
|
|
732
|
-
const a = c * Math.cos(hr);
|
|
733
|
-
const b = c * Math.sin(hr);
|
|
734
|
-
return [l, a, b];
|
|
735
|
-
};
|
|
736
|
-
convert.rgb.ansi16 = function (args, saturation = null) {
|
|
737
|
-
const [r, g, b] = args;
|
|
738
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
739
|
-
value = Math.round(value / 50);
|
|
740
|
-
if (value === 0) {
|
|
741
|
-
return 30;
|
|
742
|
-
}
|
|
743
|
-
let ansi =
|
|
744
|
-
30 +
|
|
745
|
-
((Math.round(b / 255) << 2) |
|
|
746
|
-
(Math.round(g / 255) << 1) |
|
|
747
|
-
Math.round(r / 255));
|
|
748
|
-
if (value === 2) {
|
|
749
|
-
ansi += 60;
|
|
750
|
-
}
|
|
751
|
-
return ansi;
|
|
752
|
-
};
|
|
753
|
-
convert.hsv.ansi16 = function (args) {
|
|
754
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
755
|
-
};
|
|
756
|
-
convert.rgb.ansi256 = function (args) {
|
|
757
|
-
const r = args[0];
|
|
758
|
-
const g = args[1];
|
|
759
|
-
const b = args[2];
|
|
760
|
-
if (r === g && g === b) {
|
|
761
|
-
if (r < 8) {
|
|
762
|
-
return 16;
|
|
763
|
-
}
|
|
764
|
-
if (r > 248) {
|
|
765
|
-
return 231;
|
|
766
|
-
}
|
|
767
|
-
return Math.round(((r - 8) / 247) * 24) + 232;
|
|
768
|
-
}
|
|
769
|
-
const ansi =
|
|
770
|
-
16 +
|
|
771
|
-
36 * Math.round((r / 255) * 5) +
|
|
772
|
-
6 * Math.round((g / 255) * 5) +
|
|
773
|
-
Math.round((b / 255) * 5);
|
|
774
|
-
return ansi;
|
|
775
|
-
};
|
|
776
|
-
convert.ansi16.rgb = function (args) {
|
|
777
|
-
let color = args % 10;
|
|
778
|
-
if (color === 0 || color === 7) {
|
|
779
|
-
if (args > 50) {
|
|
780
|
-
color += 3.5;
|
|
781
|
-
}
|
|
782
|
-
color = (color / 10.5) * 255;
|
|
783
|
-
return [color, color, color];
|
|
784
|
-
}
|
|
785
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
786
|
-
const r = (color & 1) * mult * 255;
|
|
787
|
-
const g = ((color >> 1) & 1) * mult * 255;
|
|
788
|
-
const b = ((color >> 2) & 1) * mult * 255;
|
|
789
|
-
return [r, g, b];
|
|
790
|
-
};
|
|
791
|
-
convert.ansi256.rgb = function (args) {
|
|
792
|
-
if (args >= 232) {
|
|
793
|
-
const c = (args - 232) * 10 + 8;
|
|
794
|
-
return [c, c, c];
|
|
795
|
-
}
|
|
796
|
-
args -= 16;
|
|
797
|
-
let rem;
|
|
798
|
-
const r = (Math.floor(args / 36) / 5) * 255;
|
|
799
|
-
const g = (Math.floor((rem = args % 36) / 6) / 5) * 255;
|
|
800
|
-
const b = ((rem % 6) / 5) * 255;
|
|
801
|
-
return [r, g, b];
|
|
802
|
-
};
|
|
803
|
-
convert.rgb.hex = function (args) {
|
|
804
|
-
const integer =
|
|
805
|
-
((Math.round(args[0]) & 255) << 16) +
|
|
806
|
-
((Math.round(args[1]) & 255) << 8) +
|
|
807
|
-
(Math.round(args[2]) & 255);
|
|
808
|
-
const string = integer.toString(16).toUpperCase();
|
|
809
|
-
return "000000".substring(string.length) + string;
|
|
810
|
-
};
|
|
811
|
-
convert.hex.rgb = function (args) {
|
|
812
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
813
|
-
if (!match) {
|
|
814
|
-
return [0, 0, 0];
|
|
815
|
-
}
|
|
816
|
-
let colorString = match[0];
|
|
817
|
-
if (match[0].length === 3) {
|
|
818
|
-
colorString = colorString
|
|
819
|
-
.split("")
|
|
820
|
-
.map((char) => char + char)
|
|
821
|
-
.join("");
|
|
822
|
-
}
|
|
823
|
-
const integer = parseInt(colorString, 16);
|
|
824
|
-
const r = (integer >> 16) & 255;
|
|
825
|
-
const g = (integer >> 8) & 255;
|
|
826
|
-
const b = integer & 255;
|
|
827
|
-
return [r, g, b];
|
|
828
|
-
};
|
|
829
|
-
convert.rgb.hcg = function (rgb) {
|
|
830
|
-
const r = rgb[0] / 255;
|
|
831
|
-
const g = rgb[1] / 255;
|
|
832
|
-
const b = rgb[2] / 255;
|
|
833
|
-
const max = Math.max(Math.max(r, g), b);
|
|
834
|
-
const min = Math.min(Math.min(r, g), b);
|
|
835
|
-
const chroma = max - min;
|
|
836
|
-
let grayscale;
|
|
837
|
-
let hue;
|
|
838
|
-
if (chroma < 1) {
|
|
839
|
-
grayscale = min / (1 - chroma);
|
|
840
|
-
} else {
|
|
841
|
-
grayscale = 0;
|
|
842
|
-
}
|
|
843
|
-
if (chroma <= 0) {
|
|
844
|
-
hue = 0;
|
|
845
|
-
} else if (max === r) {
|
|
846
|
-
hue = ((g - b) / chroma) % 6;
|
|
847
|
-
} else if (max === g) {
|
|
848
|
-
hue = 2 + (b - r) / chroma;
|
|
849
|
-
} else {
|
|
850
|
-
hue = 4 + (r - g) / chroma;
|
|
851
|
-
}
|
|
852
|
-
hue /= 6;
|
|
853
|
-
hue %= 1;
|
|
854
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
855
|
-
};
|
|
856
|
-
convert.hsl.hcg = function (hsl) {
|
|
857
|
-
const s = hsl[1] / 100;
|
|
858
|
-
const l = hsl[2] / 100;
|
|
859
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
860
|
-
let f = 0;
|
|
861
|
-
if (c < 1) {
|
|
862
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
863
|
-
}
|
|
864
|
-
return [hsl[0], c * 100, f * 100];
|
|
865
|
-
};
|
|
866
|
-
convert.hsv.hcg = function (hsv) {
|
|
867
|
-
const s = hsv[1] / 100;
|
|
868
|
-
const v = hsv[2] / 100;
|
|
869
|
-
const c = s * v;
|
|
870
|
-
let f = 0;
|
|
871
|
-
if (c < 1) {
|
|
872
|
-
f = (v - c) / (1 - c);
|
|
873
|
-
}
|
|
874
|
-
return [hsv[0], c * 100, f * 100];
|
|
875
|
-
};
|
|
876
|
-
convert.hcg.rgb = function (hcg) {
|
|
877
|
-
const h = hcg[0] / 360;
|
|
878
|
-
const c = hcg[1] / 100;
|
|
879
|
-
const g = hcg[2] / 100;
|
|
880
|
-
if (c === 0) {
|
|
881
|
-
return [g * 255, g * 255, g * 255];
|
|
882
|
-
}
|
|
883
|
-
const pure = [0, 0, 0];
|
|
884
|
-
const hi = (h % 1) * 6;
|
|
885
|
-
const v = hi % 1;
|
|
886
|
-
const w = 1 - v;
|
|
887
|
-
let mg = 0;
|
|
888
|
-
switch (Math.floor(hi)) {
|
|
889
|
-
case 0:
|
|
890
|
-
pure[0] = 1;
|
|
891
|
-
pure[1] = v;
|
|
892
|
-
pure[2] = 0;
|
|
893
|
-
break;
|
|
894
|
-
case 1:
|
|
895
|
-
pure[0] = w;
|
|
896
|
-
pure[1] = 1;
|
|
897
|
-
pure[2] = 0;
|
|
898
|
-
break;
|
|
899
|
-
case 2:
|
|
900
|
-
pure[0] = 0;
|
|
901
|
-
pure[1] = 1;
|
|
902
|
-
pure[2] = v;
|
|
903
|
-
break;
|
|
904
|
-
case 3:
|
|
905
|
-
pure[0] = 0;
|
|
906
|
-
pure[1] = w;
|
|
907
|
-
pure[2] = 1;
|
|
908
|
-
break;
|
|
909
|
-
case 4:
|
|
910
|
-
pure[0] = v;
|
|
911
|
-
pure[1] = 0;
|
|
912
|
-
pure[2] = 1;
|
|
913
|
-
break;
|
|
914
|
-
default:
|
|
915
|
-
pure[0] = 1;
|
|
916
|
-
pure[1] = 0;
|
|
917
|
-
pure[2] = w;
|
|
918
|
-
}
|
|
919
|
-
mg = (1 - c) * g;
|
|
920
|
-
return [
|
|
921
|
-
(c * pure[0] + mg) * 255,
|
|
922
|
-
(c * pure[1] + mg) * 255,
|
|
923
|
-
(c * pure[2] + mg) * 255,
|
|
924
|
-
];
|
|
925
|
-
};
|
|
926
|
-
convert.hcg.hsv = function (hcg) {
|
|
927
|
-
const c = hcg[1] / 100;
|
|
928
|
-
const g = hcg[2] / 100;
|
|
929
|
-
const v = c + g * (1 - c);
|
|
930
|
-
let f = 0;
|
|
931
|
-
if (v > 0) {
|
|
932
|
-
f = c / v;
|
|
933
|
-
}
|
|
934
|
-
return [hcg[0], f * 100, v * 100];
|
|
935
|
-
};
|
|
936
|
-
convert.hcg.hsl = function (hcg) {
|
|
937
|
-
const c = hcg[1] / 100;
|
|
938
|
-
const g = hcg[2] / 100;
|
|
939
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
940
|
-
let s = 0;
|
|
941
|
-
if (l > 0 && l < 0.5) {
|
|
942
|
-
s = c / (2 * l);
|
|
943
|
-
} else if (l >= 0.5 && l < 1) {
|
|
944
|
-
s = c / (2 * (1 - l));
|
|
945
|
-
}
|
|
946
|
-
return [hcg[0], s * 100, l * 100];
|
|
947
|
-
};
|
|
948
|
-
convert.hcg.hwb = function (hcg) {
|
|
949
|
-
const c = hcg[1] / 100;
|
|
950
|
-
const g = hcg[2] / 100;
|
|
951
|
-
const v = c + g * (1 - c);
|
|
952
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
953
|
-
};
|
|
954
|
-
convert.hwb.hcg = function (hwb) {
|
|
955
|
-
const w = hwb[1] / 100;
|
|
956
|
-
const b = hwb[2] / 100;
|
|
957
|
-
const v = 1 - b;
|
|
958
|
-
const c = v - w;
|
|
959
|
-
let g = 0;
|
|
960
|
-
if (c < 1) {
|
|
961
|
-
g = (v - c) / (1 - c);
|
|
962
|
-
}
|
|
963
|
-
return [hwb[0], c * 100, g * 100];
|
|
964
|
-
};
|
|
965
|
-
convert.apple.rgb = function (apple) {
|
|
966
|
-
return [
|
|
967
|
-
(apple[0] / 65535) * 255,
|
|
968
|
-
(apple[1] / 65535) * 255,
|
|
969
|
-
(apple[2] / 65535) * 255,
|
|
970
|
-
];
|
|
971
|
-
};
|
|
972
|
-
convert.rgb.apple = function (rgb) {
|
|
973
|
-
return [
|
|
974
|
-
(rgb[0] / 255) * 65535,
|
|
975
|
-
(rgb[1] / 255) * 65535,
|
|
976
|
-
(rgb[2] / 255) * 65535,
|
|
977
|
-
];
|
|
978
|
-
};
|
|
979
|
-
convert.gray.rgb = function (args) {
|
|
980
|
-
return [
|
|
981
|
-
(args[0] / 100) * 255,
|
|
982
|
-
(args[0] / 100) * 255,
|
|
983
|
-
(args[0] / 100) * 255,
|
|
984
|
-
];
|
|
985
|
-
};
|
|
986
|
-
convert.gray.hsl = function (args) {
|
|
987
|
-
return [0, 0, args[0]];
|
|
988
|
-
};
|
|
989
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
990
|
-
convert.gray.hwb = function (gray) {
|
|
991
|
-
return [0, 100, gray[0]];
|
|
992
|
-
};
|
|
993
|
-
convert.gray.cmyk = function (gray) {
|
|
994
|
-
return [0, 0, 0, gray[0]];
|
|
995
|
-
};
|
|
996
|
-
convert.gray.lab = function (gray) {
|
|
997
|
-
return [gray[0], 0, 0];
|
|
998
|
-
};
|
|
999
|
-
convert.gray.hex = function (gray) {
|
|
1000
|
-
const val = Math.round((gray[0] / 100) * 255) & 255;
|
|
1001
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
1002
|
-
const string = integer.toString(16).toUpperCase();
|
|
1003
|
-
return "000000".substring(string.length) + string;
|
|
1004
|
-
};
|
|
1005
|
-
convert.rgb.gray = function (rgb) {
|
|
1006
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
1007
|
-
return [(val / 255) * 100];
|
|
1008
|
-
};
|
|
1009
|
-
},
|
|
1010
|
-
285: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1011
|
-
const conversions = __nccwpck_require__(668);
|
|
1012
|
-
const route = __nccwpck_require__(385);
|
|
1013
|
-
const convert = {};
|
|
1014
|
-
const models = Object.keys(conversions);
|
|
1015
|
-
function wrapRaw(fn) {
|
|
1016
|
-
const wrappedFn = function (...args) {
|
|
1017
|
-
const arg0 = args[0];
|
|
1018
|
-
if (arg0 === undefined || arg0 === null) {
|
|
1019
|
-
return arg0;
|
|
1020
|
-
}
|
|
1021
|
-
if (arg0.length > 1) {
|
|
1022
|
-
args = arg0;
|
|
1023
|
-
}
|
|
1024
|
-
return fn(args);
|
|
1025
|
-
};
|
|
1026
|
-
if ("conversion" in fn) {
|
|
1027
|
-
wrappedFn.conversion = fn.conversion;
|
|
1028
|
-
}
|
|
1029
|
-
return wrappedFn;
|
|
1030
|
-
}
|
|
1031
|
-
function wrapRounded(fn) {
|
|
1032
|
-
const wrappedFn = function (...args) {
|
|
1033
|
-
const arg0 = args[0];
|
|
1034
|
-
if (arg0 === undefined || arg0 === null) {
|
|
1035
|
-
return arg0;
|
|
1036
|
-
}
|
|
1037
|
-
if (arg0.length > 1) {
|
|
1038
|
-
args = arg0;
|
|
1039
|
-
}
|
|
1040
|
-
const result = fn(args);
|
|
1041
|
-
if (typeof result === "object") {
|
|
1042
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
1043
|
-
result[i] = Math.round(result[i]);
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
return result;
|
|
1047
|
-
};
|
|
1048
|
-
if ("conversion" in fn) {
|
|
1049
|
-
wrappedFn.conversion = fn.conversion;
|
|
1050
|
-
}
|
|
1051
|
-
return wrappedFn;
|
|
1052
|
-
}
|
|
1053
|
-
models.forEach((fromModel) => {
|
|
1054
|
-
convert[fromModel] = {};
|
|
1055
|
-
Object.defineProperty(convert[fromModel], "channels", {
|
|
1056
|
-
value: conversions[fromModel].channels,
|
|
1057
|
-
});
|
|
1058
|
-
Object.defineProperty(convert[fromModel], "labels", {
|
|
1059
|
-
value: conversions[fromModel].labels,
|
|
1060
|
-
});
|
|
1061
|
-
const routes = route(fromModel);
|
|
1062
|
-
const routeModels = Object.keys(routes);
|
|
1063
|
-
routeModels.forEach((toModel) => {
|
|
1064
|
-
const fn = routes[toModel];
|
|
1065
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1066
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1067
|
-
});
|
|
1068
|
-
});
|
|
1069
|
-
module.exports = convert;
|
|
1070
|
-
},
|
|
1071
|
-
385: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1072
|
-
const conversions = __nccwpck_require__(668);
|
|
1073
|
-
function buildGraph() {
|
|
1074
|
-
const graph = {};
|
|
1075
|
-
const models = Object.keys(conversions);
|
|
1076
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
1077
|
-
graph[models[i]] = { distance: -1, parent: null };
|
|
1078
|
-
}
|
|
1079
|
-
return graph;
|
|
1080
|
-
}
|
|
1081
|
-
function deriveBFS(fromModel) {
|
|
1082
|
-
const graph = buildGraph();
|
|
1083
|
-
const queue = [fromModel];
|
|
1084
|
-
graph[fromModel].distance = 0;
|
|
1085
|
-
while (queue.length) {
|
|
1086
|
-
const current = queue.pop();
|
|
1087
|
-
const adjacents = Object.keys(conversions[current]);
|
|
1088
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1089
|
-
const adjacent = adjacents[i];
|
|
1090
|
-
const node = graph[adjacent];
|
|
1091
|
-
if (node.distance === -1) {
|
|
1092
|
-
node.distance = graph[current].distance + 1;
|
|
1093
|
-
node.parent = current;
|
|
1094
|
-
queue.unshift(adjacent);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
return graph;
|
|
1099
|
-
}
|
|
1100
|
-
function link(from, to) {
|
|
1101
|
-
return function (args) {
|
|
1102
|
-
return to(from(args));
|
|
1103
|
-
};
|
|
1104
|
-
}
|
|
1105
|
-
function wrapConversion(toModel, graph) {
|
|
1106
|
-
const path = [graph[toModel].parent, toModel];
|
|
1107
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
1108
|
-
let cur = graph[toModel].parent;
|
|
1109
|
-
while (graph[cur].parent) {
|
|
1110
|
-
path.unshift(graph[cur].parent);
|
|
1111
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1112
|
-
cur = graph[cur].parent;
|
|
1113
|
-
}
|
|
1114
|
-
fn.conversion = path;
|
|
1115
|
-
return fn;
|
|
1116
|
-
}
|
|
1117
|
-
module.exports = function (fromModel) {
|
|
1118
|
-
const graph = deriveBFS(fromModel);
|
|
1119
|
-
const conversion = {};
|
|
1120
|
-
const models = Object.keys(graph);
|
|
1121
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
1122
|
-
const toModel = models[i];
|
|
1123
|
-
const node = graph[toModel];
|
|
1124
|
-
if (node.parent === null) {
|
|
1125
|
-
continue;
|
|
1126
|
-
}
|
|
1127
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
1128
|
-
}
|
|
1129
|
-
return conversion;
|
|
1130
|
-
};
|
|
1131
|
-
},
|
|
1132
|
-
667: (module) => {
|
|
1133
|
-
"use strict";
|
|
1134
|
-
module.exports = {
|
|
1135
|
-
aliceblue: [240, 248, 255],
|
|
1136
|
-
antiquewhite: [250, 235, 215],
|
|
1137
|
-
aqua: [0, 255, 255],
|
|
1138
|
-
aquamarine: [127, 255, 212],
|
|
1139
|
-
azure: [240, 255, 255],
|
|
1140
|
-
beige: [245, 245, 220],
|
|
1141
|
-
bisque: [255, 228, 196],
|
|
1142
|
-
black: [0, 0, 0],
|
|
1143
|
-
blanchedalmond: [255, 235, 205],
|
|
1144
|
-
blue: [0, 0, 255],
|
|
1145
|
-
blueviolet: [138, 43, 226],
|
|
1146
|
-
brown: [165, 42, 42],
|
|
1147
|
-
burlywood: [222, 184, 135],
|
|
1148
|
-
cadetblue: [95, 158, 160],
|
|
1149
|
-
chartreuse: [127, 255, 0],
|
|
1150
|
-
chocolate: [210, 105, 30],
|
|
1151
|
-
coral: [255, 127, 80],
|
|
1152
|
-
cornflowerblue: [100, 149, 237],
|
|
1153
|
-
cornsilk: [255, 248, 220],
|
|
1154
|
-
crimson: [220, 20, 60],
|
|
1155
|
-
cyan: [0, 255, 255],
|
|
1156
|
-
darkblue: [0, 0, 139],
|
|
1157
|
-
darkcyan: [0, 139, 139],
|
|
1158
|
-
darkgoldenrod: [184, 134, 11],
|
|
1159
|
-
darkgray: [169, 169, 169],
|
|
1160
|
-
darkgreen: [0, 100, 0],
|
|
1161
|
-
darkgrey: [169, 169, 169],
|
|
1162
|
-
darkkhaki: [189, 183, 107],
|
|
1163
|
-
darkmagenta: [139, 0, 139],
|
|
1164
|
-
darkolivegreen: [85, 107, 47],
|
|
1165
|
-
darkorange: [255, 140, 0],
|
|
1166
|
-
darkorchid: [153, 50, 204],
|
|
1167
|
-
darkred: [139, 0, 0],
|
|
1168
|
-
darksalmon: [233, 150, 122],
|
|
1169
|
-
darkseagreen: [143, 188, 143],
|
|
1170
|
-
darkslateblue: [72, 61, 139],
|
|
1171
|
-
darkslategray: [47, 79, 79],
|
|
1172
|
-
darkslategrey: [47, 79, 79],
|
|
1173
|
-
darkturquoise: [0, 206, 209],
|
|
1174
|
-
darkviolet: [148, 0, 211],
|
|
1175
|
-
deeppink: [255, 20, 147],
|
|
1176
|
-
deepskyblue: [0, 191, 255],
|
|
1177
|
-
dimgray: [105, 105, 105],
|
|
1178
|
-
dimgrey: [105, 105, 105],
|
|
1179
|
-
dodgerblue: [30, 144, 255],
|
|
1180
|
-
firebrick: [178, 34, 34],
|
|
1181
|
-
floralwhite: [255, 250, 240],
|
|
1182
|
-
forestgreen: [34, 139, 34],
|
|
1183
|
-
fuchsia: [255, 0, 255],
|
|
1184
|
-
gainsboro: [220, 220, 220],
|
|
1185
|
-
ghostwhite: [248, 248, 255],
|
|
1186
|
-
gold: [255, 215, 0],
|
|
1187
|
-
goldenrod: [218, 165, 32],
|
|
1188
|
-
gray: [128, 128, 128],
|
|
1189
|
-
green: [0, 128, 0],
|
|
1190
|
-
greenyellow: [173, 255, 47],
|
|
1191
|
-
grey: [128, 128, 128],
|
|
1192
|
-
honeydew: [240, 255, 240],
|
|
1193
|
-
hotpink: [255, 105, 180],
|
|
1194
|
-
indianred: [205, 92, 92],
|
|
1195
|
-
indigo: [75, 0, 130],
|
|
1196
|
-
ivory: [255, 255, 240],
|
|
1197
|
-
khaki: [240, 230, 140],
|
|
1198
|
-
lavender: [230, 230, 250],
|
|
1199
|
-
lavenderblush: [255, 240, 245],
|
|
1200
|
-
lawngreen: [124, 252, 0],
|
|
1201
|
-
lemonchiffon: [255, 250, 205],
|
|
1202
|
-
lightblue: [173, 216, 230],
|
|
1203
|
-
lightcoral: [240, 128, 128],
|
|
1204
|
-
lightcyan: [224, 255, 255],
|
|
1205
|
-
lightgoldenrodyellow: [250, 250, 210],
|
|
1206
|
-
lightgray: [211, 211, 211],
|
|
1207
|
-
lightgreen: [144, 238, 144],
|
|
1208
|
-
lightgrey: [211, 211, 211],
|
|
1209
|
-
lightpink: [255, 182, 193],
|
|
1210
|
-
lightsalmon: [255, 160, 122],
|
|
1211
|
-
lightseagreen: [32, 178, 170],
|
|
1212
|
-
lightskyblue: [135, 206, 250],
|
|
1213
|
-
lightslategray: [119, 136, 153],
|
|
1214
|
-
lightslategrey: [119, 136, 153],
|
|
1215
|
-
lightsteelblue: [176, 196, 222],
|
|
1216
|
-
lightyellow: [255, 255, 224],
|
|
1217
|
-
lime: [0, 255, 0],
|
|
1218
|
-
limegreen: [50, 205, 50],
|
|
1219
|
-
linen: [250, 240, 230],
|
|
1220
|
-
magenta: [255, 0, 255],
|
|
1221
|
-
maroon: [128, 0, 0],
|
|
1222
|
-
mediumaquamarine: [102, 205, 170],
|
|
1223
|
-
mediumblue: [0, 0, 205],
|
|
1224
|
-
mediumorchid: [186, 85, 211],
|
|
1225
|
-
mediumpurple: [147, 112, 219],
|
|
1226
|
-
mediumseagreen: [60, 179, 113],
|
|
1227
|
-
mediumslateblue: [123, 104, 238],
|
|
1228
|
-
mediumspringgreen: [0, 250, 154],
|
|
1229
|
-
mediumturquoise: [72, 209, 204],
|
|
1230
|
-
mediumvioletred: [199, 21, 133],
|
|
1231
|
-
midnightblue: [25, 25, 112],
|
|
1232
|
-
mintcream: [245, 255, 250],
|
|
1233
|
-
mistyrose: [255, 228, 225],
|
|
1234
|
-
moccasin: [255, 228, 181],
|
|
1235
|
-
navajowhite: [255, 222, 173],
|
|
1236
|
-
navy: [0, 0, 128],
|
|
1237
|
-
oldlace: [253, 245, 230],
|
|
1238
|
-
olive: [128, 128, 0],
|
|
1239
|
-
olivedrab: [107, 142, 35],
|
|
1240
|
-
orange: [255, 165, 0],
|
|
1241
|
-
orangered: [255, 69, 0],
|
|
1242
|
-
orchid: [218, 112, 214],
|
|
1243
|
-
palegoldenrod: [238, 232, 170],
|
|
1244
|
-
palegreen: [152, 251, 152],
|
|
1245
|
-
paleturquoise: [175, 238, 238],
|
|
1246
|
-
palevioletred: [219, 112, 147],
|
|
1247
|
-
papayawhip: [255, 239, 213],
|
|
1248
|
-
peachpuff: [255, 218, 185],
|
|
1249
|
-
peru: [205, 133, 63],
|
|
1250
|
-
pink: [255, 192, 203],
|
|
1251
|
-
plum: [221, 160, 221],
|
|
1252
|
-
powderblue: [176, 224, 230],
|
|
1253
|
-
purple: [128, 0, 128],
|
|
1254
|
-
rebeccapurple: [102, 51, 153],
|
|
1255
|
-
red: [255, 0, 0],
|
|
1256
|
-
rosybrown: [188, 143, 143],
|
|
1257
|
-
royalblue: [65, 105, 225],
|
|
1258
|
-
saddlebrown: [139, 69, 19],
|
|
1259
|
-
salmon: [250, 128, 114],
|
|
1260
|
-
sandybrown: [244, 164, 96],
|
|
1261
|
-
seagreen: [46, 139, 87],
|
|
1262
|
-
seashell: [255, 245, 238],
|
|
1263
|
-
sienna: [160, 82, 45],
|
|
1264
|
-
silver: [192, 192, 192],
|
|
1265
|
-
skyblue: [135, 206, 235],
|
|
1266
|
-
slateblue: [106, 90, 205],
|
|
1267
|
-
slategray: [112, 128, 144],
|
|
1268
|
-
slategrey: [112, 128, 144],
|
|
1269
|
-
snow: [255, 250, 250],
|
|
1270
|
-
springgreen: [0, 255, 127],
|
|
1271
|
-
steelblue: [70, 130, 180],
|
|
1272
|
-
tan: [210, 180, 140],
|
|
1273
|
-
teal: [0, 128, 128],
|
|
1274
|
-
thistle: [216, 191, 216],
|
|
1275
|
-
tomato: [255, 99, 71],
|
|
1276
|
-
turquoise: [64, 224, 208],
|
|
1277
|
-
violet: [238, 130, 238],
|
|
1278
|
-
wheat: [245, 222, 179],
|
|
1279
|
-
white: [255, 255, 255],
|
|
1280
|
-
whitesmoke: [245, 245, 245],
|
|
1281
|
-
yellow: [255, 255, 0],
|
|
1282
|
-
yellowgreen: [154, 205, 50],
|
|
1283
|
-
};
|
|
1284
|
-
},
|
|
1285
|
-
461: (module) => {
|
|
1286
|
-
"use strict";
|
|
1287
|
-
module.exports = function () {
|
|
1288
|
-
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;
|
|
1289
|
-
};
|
|
1290
|
-
},
|
|
1291
|
-
383: (module) => {
|
|
1292
|
-
"use strict";
|
|
1293
|
-
const isFullwidthCodePoint = (codePoint) => {
|
|
1294
|
-
if (Number.isNaN(codePoint)) {
|
|
1295
|
-
return false;
|
|
1296
|
-
}
|
|
1297
|
-
if (
|
|
1298
|
-
codePoint >= 4352 &&
|
|
1299
|
-
(codePoint <= 4447 ||
|
|
1300
|
-
codePoint === 9001 ||
|
|
1301
|
-
codePoint === 9002 ||
|
|
1302
|
-
(11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351) ||
|
|
1303
|
-
(12880 <= codePoint && codePoint <= 19903) ||
|
|
1304
|
-
(19968 <= codePoint && codePoint <= 42182) ||
|
|
1305
|
-
(43360 <= codePoint && codePoint <= 43388) ||
|
|
1306
|
-
(44032 <= codePoint && codePoint <= 55203) ||
|
|
1307
|
-
(63744 <= codePoint && codePoint <= 64255) ||
|
|
1308
|
-
(65040 <= codePoint && codePoint <= 65049) ||
|
|
1309
|
-
(65072 <= codePoint && codePoint <= 65131) ||
|
|
1310
|
-
(65281 <= codePoint && codePoint <= 65376) ||
|
|
1311
|
-
(65504 <= codePoint && codePoint <= 65510) ||
|
|
1312
|
-
(110592 <= codePoint && codePoint <= 110593) ||
|
|
1313
|
-
(127488 <= codePoint && codePoint <= 127569) ||
|
|
1314
|
-
(131072 <= codePoint && codePoint <= 262141))
|
|
1315
|
-
) {
|
|
1316
|
-
return true;
|
|
1317
|
-
}
|
|
1318
|
-
return false;
|
|
1319
|
-
};
|
|
1320
|
-
module.exports = isFullwidthCodePoint;
|
|
1321
|
-
module.exports["default"] = isFullwidthCodePoint;
|
|
1322
|
-
},
|
|
1323
|
-
795: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1324
|
-
"use strict";
|
|
1325
|
-
const ansiEscapes = __nccwpck_require__(153);
|
|
1326
|
-
const cliCursor = __nccwpck_require__(205);
|
|
1327
|
-
const wrapAnsi = __nccwpck_require__(685);
|
|
1328
|
-
const sliceAnsi = __nccwpck_require__(314);
|
|
1329
|
-
const defaultTerminalHeight = 24;
|
|
1330
|
-
const getWidth = (stream) => {
|
|
1331
|
-
const { columns } = stream;
|
|
1332
|
-
if (!columns) {
|
|
1333
|
-
return 80;
|
|
1334
|
-
}
|
|
1335
|
-
return columns;
|
|
1336
|
-
};
|
|
1337
|
-
const fitToTerminalHeight = (stream, text) => {
|
|
1338
|
-
const terminalHeight = stream.rows || defaultTerminalHeight;
|
|
1339
|
-
const lines = text.split("\n");
|
|
1340
|
-
const toRemove = lines.length - terminalHeight;
|
|
1341
|
-
if (toRemove <= 0) {
|
|
1342
|
-
return text;
|
|
1343
|
-
}
|
|
1344
|
-
return sliceAnsi(
|
|
1345
|
-
text,
|
|
1346
|
-
lines.slice(0, toRemove).join("\n").length + 1,
|
|
1347
|
-
text.length,
|
|
1348
|
-
);
|
|
1349
|
-
};
|
|
1350
|
-
const main = (stream, { showCursor = false } = {}) => {
|
|
1351
|
-
let previousLineCount = 0;
|
|
1352
|
-
let previousWidth = getWidth(stream);
|
|
1353
|
-
let previousOutput = "";
|
|
1354
|
-
const render = (...args) => {
|
|
1355
|
-
if (!showCursor) {
|
|
1356
|
-
cliCursor.hide();
|
|
1357
|
-
}
|
|
1358
|
-
let output = args.join(" ") + "\n";
|
|
1359
|
-
output = fitToTerminalHeight(stream, output);
|
|
1360
|
-
const width = getWidth(stream);
|
|
1361
|
-
if (output === previousOutput && previousWidth === width) {
|
|
1362
|
-
return;
|
|
1363
|
-
}
|
|
1364
|
-
previousOutput = output;
|
|
1365
|
-
previousWidth = width;
|
|
1366
|
-
output = wrapAnsi(output, width, {
|
|
1367
|
-
trim: false,
|
|
1368
|
-
hard: true,
|
|
1369
|
-
wordWrap: false,
|
|
1370
|
-
});
|
|
1371
|
-
stream.write(ansiEscapes.eraseLines(previousLineCount) + output);
|
|
1372
|
-
previousLineCount = output.split("\n").length;
|
|
1373
|
-
};
|
|
1374
|
-
render.clear = () => {
|
|
1375
|
-
stream.write(ansiEscapes.eraseLines(previousLineCount));
|
|
1376
|
-
previousOutput = "";
|
|
1377
|
-
previousWidth = getWidth(stream);
|
|
1378
|
-
previousLineCount = 0;
|
|
1379
|
-
};
|
|
1380
|
-
render.done = () => {
|
|
1381
|
-
previousOutput = "";
|
|
1382
|
-
previousWidth = getWidth(stream);
|
|
1383
|
-
previousLineCount = 0;
|
|
1384
|
-
if (!showCursor) {
|
|
1385
|
-
cliCursor.show();
|
|
1386
|
-
}
|
|
1387
|
-
};
|
|
1388
|
-
return render;
|
|
1389
|
-
};
|
|
1390
|
-
module.exports = main(process.stdout);
|
|
1391
|
-
module.exports.stderr = main(process.stderr);
|
|
1392
|
-
module.exports.create = main;
|
|
1393
|
-
},
|
|
1394
|
-
406: (module) => {
|
|
1395
|
-
"use strict";
|
|
1396
|
-
const mimicFn = (to, from) => {
|
|
1397
|
-
for (const prop of Reflect.ownKeys(from)) {
|
|
1398
|
-
Object.defineProperty(
|
|
1399
|
-
to,
|
|
1400
|
-
prop,
|
|
1401
|
-
Object.getOwnPropertyDescriptor(from, prop),
|
|
1402
|
-
);
|
|
1403
|
-
}
|
|
1404
|
-
return to;
|
|
1405
|
-
};
|
|
1406
|
-
module.exports = mimicFn;
|
|
1407
|
-
module.exports["default"] = mimicFn;
|
|
1408
|
-
},
|
|
1409
|
-
80: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1410
|
-
"use strict";
|
|
1411
|
-
const mimicFn = __nccwpck_require__(406);
|
|
1412
|
-
const calledFunctions = new WeakMap();
|
|
1413
|
-
const onetime = (function_, options = {}) => {
|
|
1414
|
-
if (typeof function_ !== "function") {
|
|
1415
|
-
throw new TypeError("Expected a function");
|
|
1416
|
-
}
|
|
1417
|
-
let returnValue;
|
|
1418
|
-
let callCount = 0;
|
|
1419
|
-
const functionName =
|
|
1420
|
-
function_.displayName || function_.name || "<anonymous>";
|
|
1421
|
-
const onetime = function (...arguments_) {
|
|
1422
|
-
calledFunctions.set(onetime, ++callCount);
|
|
1423
|
-
if (callCount === 1) {
|
|
1424
|
-
returnValue = function_.apply(this, arguments_);
|
|
1425
|
-
function_ = null;
|
|
1426
|
-
} else if (options.throw === true) {
|
|
1427
|
-
throw new Error(
|
|
1428
|
-
`Function \`${functionName}\` can only be called once`,
|
|
1429
|
-
);
|
|
1430
|
-
}
|
|
1431
|
-
return returnValue;
|
|
1432
|
-
};
|
|
1433
|
-
mimicFn(onetime, function_);
|
|
1434
|
-
calledFunctions.set(onetime, callCount);
|
|
1435
|
-
return onetime;
|
|
1436
|
-
};
|
|
1437
|
-
module.exports = onetime;
|
|
1438
|
-
module.exports["default"] = onetime;
|
|
1439
|
-
module.exports.callCount = (function_) => {
|
|
1440
|
-
if (!calledFunctions.has(function_)) {
|
|
1441
|
-
throw new Error(
|
|
1442
|
-
`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`,
|
|
1443
|
-
);
|
|
1444
|
-
}
|
|
1445
|
-
return calledFunctions.get(function_);
|
|
1446
|
-
};
|
|
1447
|
-
},
|
|
1448
|
-
375: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1449
|
-
"use strict";
|
|
1450
|
-
const onetime = __nccwpck_require__(80);
|
|
1451
|
-
const signalExit = __nccwpck_require__(300);
|
|
1452
|
-
module.exports = onetime(() => {
|
|
1453
|
-
signalExit(
|
|
1454
|
-
() => {
|
|
1455
|
-
process.stderr.write("[?25h");
|
|
1456
|
-
},
|
|
1457
|
-
{ alwaysLast: true },
|
|
1458
|
-
);
|
|
1459
|
-
});
|
|
1460
|
-
},
|
|
1461
|
-
300: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1462
|
-
var process = global.process;
|
|
1463
|
-
const processOk = function (process) {
|
|
1464
|
-
return (
|
|
1465
|
-
process &&
|
|
1466
|
-
typeof process === "object" &&
|
|
1467
|
-
typeof process.removeListener === "function" &&
|
|
1468
|
-
typeof process.emit === "function" &&
|
|
1469
|
-
typeof process.reallyExit === "function" &&
|
|
1470
|
-
typeof process.listeners === "function" &&
|
|
1471
|
-
typeof process.kill === "function" &&
|
|
1472
|
-
typeof process.pid === "number" &&
|
|
1473
|
-
typeof process.on === "function"
|
|
1474
|
-
);
|
|
1475
|
-
};
|
|
1476
|
-
if (!processOk(process)) {
|
|
1477
|
-
module.exports = function () {
|
|
1478
|
-
return function () {};
|
|
1479
|
-
};
|
|
1480
|
-
} else {
|
|
1481
|
-
var assert = __nccwpck_require__(491);
|
|
1482
|
-
var signals = __nccwpck_require__(871);
|
|
1483
|
-
var isWin = /^win/i.test(process.platform);
|
|
1484
|
-
var EE = __nccwpck_require__(361);
|
|
1485
|
-
if (typeof EE !== "function") {
|
|
1486
|
-
EE = EE.EventEmitter;
|
|
1487
|
-
}
|
|
1488
|
-
var emitter;
|
|
1489
|
-
if (process.__signal_exit_emitter__) {
|
|
1490
|
-
emitter = process.__signal_exit_emitter__;
|
|
1491
|
-
} else {
|
|
1492
|
-
emitter = process.__signal_exit_emitter__ = new EE();
|
|
1493
|
-
emitter.count = 0;
|
|
1494
|
-
emitter.emitted = {};
|
|
1495
|
-
}
|
|
1496
|
-
if (!emitter.infinite) {
|
|
1497
|
-
emitter.setMaxListeners(Infinity);
|
|
1498
|
-
emitter.infinite = true;
|
|
1499
|
-
}
|
|
1500
|
-
module.exports = function (cb, opts) {
|
|
1501
|
-
if (!processOk(global.process)) {
|
|
1502
|
-
return function () {};
|
|
1503
|
-
}
|
|
1504
|
-
assert.equal(
|
|
1505
|
-
typeof cb,
|
|
1506
|
-
"function",
|
|
1507
|
-
"a callback must be provided for exit handler",
|
|
1508
|
-
);
|
|
1509
|
-
if (loaded === false) {
|
|
1510
|
-
load();
|
|
1511
|
-
}
|
|
1512
|
-
var ev = "exit";
|
|
1513
|
-
if (opts && opts.alwaysLast) {
|
|
1514
|
-
ev = "afterexit";
|
|
1515
|
-
}
|
|
1516
|
-
var remove = function () {
|
|
1517
|
-
emitter.removeListener(ev, cb);
|
|
1518
|
-
if (
|
|
1519
|
-
emitter.listeners("exit").length === 0 &&
|
|
1520
|
-
emitter.listeners("afterexit").length === 0
|
|
1521
|
-
) {
|
|
1522
|
-
unload();
|
|
1523
|
-
}
|
|
1524
|
-
};
|
|
1525
|
-
emitter.on(ev, cb);
|
|
1526
|
-
return remove;
|
|
1527
|
-
};
|
|
1528
|
-
var unload = function unload() {
|
|
1529
|
-
if (!loaded || !processOk(global.process)) {
|
|
1530
|
-
return;
|
|
1531
|
-
}
|
|
1532
|
-
loaded = false;
|
|
1533
|
-
signals.forEach(function (sig) {
|
|
1534
|
-
try {
|
|
1535
|
-
process.removeListener(sig, sigListeners[sig]);
|
|
1536
|
-
} catch (er) {}
|
|
1537
|
-
});
|
|
1538
|
-
process.emit = originalProcessEmit;
|
|
1539
|
-
process.reallyExit = originalProcessReallyExit;
|
|
1540
|
-
emitter.count -= 1;
|
|
1541
|
-
};
|
|
1542
|
-
module.exports.unload = unload;
|
|
1543
|
-
var emit = function emit(event, code, signal) {
|
|
1544
|
-
if (emitter.emitted[event]) {
|
|
1545
|
-
return;
|
|
1546
|
-
}
|
|
1547
|
-
emitter.emitted[event] = true;
|
|
1548
|
-
emitter.emit(event, code, signal);
|
|
1549
|
-
};
|
|
1550
|
-
var sigListeners = {};
|
|
1551
|
-
signals.forEach(function (sig) {
|
|
1552
|
-
sigListeners[sig] = function listener() {
|
|
1553
|
-
if (!processOk(global.process)) {
|
|
1554
|
-
return;
|
|
1555
|
-
}
|
|
1556
|
-
var listeners = process.listeners(sig);
|
|
1557
|
-
if (listeners.length === emitter.count) {
|
|
1558
|
-
unload();
|
|
1559
|
-
emit("exit", null, sig);
|
|
1560
|
-
emit("afterexit", null, sig);
|
|
1561
|
-
if (isWin && sig === "SIGHUP") {
|
|
1562
|
-
sig = "SIGINT";
|
|
1563
|
-
}
|
|
1564
|
-
process.kill(process.pid, sig);
|
|
1565
|
-
}
|
|
1566
|
-
};
|
|
1567
|
-
});
|
|
1568
|
-
module.exports.signals = function () {
|
|
1569
|
-
return signals;
|
|
1570
|
-
};
|
|
1571
|
-
var loaded = false;
|
|
1572
|
-
var load = function load() {
|
|
1573
|
-
if (loaded || !processOk(global.process)) {
|
|
1574
|
-
return;
|
|
1575
|
-
}
|
|
1576
|
-
loaded = true;
|
|
1577
|
-
emitter.count += 1;
|
|
1578
|
-
signals = signals.filter(function (sig) {
|
|
1579
|
-
try {
|
|
1580
|
-
process.on(sig, sigListeners[sig]);
|
|
1581
|
-
return true;
|
|
1582
|
-
} catch (er) {
|
|
1583
|
-
return false;
|
|
1584
|
-
}
|
|
1585
|
-
});
|
|
1586
|
-
process.emit = processEmit;
|
|
1587
|
-
process.reallyExit = processReallyExit;
|
|
1588
|
-
};
|
|
1589
|
-
module.exports.load = load;
|
|
1590
|
-
var originalProcessReallyExit = process.reallyExit;
|
|
1591
|
-
var processReallyExit = function processReallyExit(code) {
|
|
1592
|
-
if (!processOk(global.process)) {
|
|
1593
|
-
return;
|
|
1594
|
-
}
|
|
1595
|
-
process.exitCode = code || 0;
|
|
1596
|
-
emit("exit", process.exitCode, null);
|
|
1597
|
-
emit("afterexit", process.exitCode, null);
|
|
1598
|
-
originalProcessReallyExit.call(process, process.exitCode);
|
|
1599
|
-
};
|
|
1600
|
-
var originalProcessEmit = process.emit;
|
|
1601
|
-
var processEmit = function processEmit(ev, arg) {
|
|
1602
|
-
if (ev === "exit" && processOk(global.process)) {
|
|
1603
|
-
if (arg !== undefined) {
|
|
1604
|
-
process.exitCode = arg;
|
|
1605
|
-
}
|
|
1606
|
-
var ret = originalProcessEmit.apply(this, arguments);
|
|
1607
|
-
emit("exit", process.exitCode, null);
|
|
1608
|
-
emit("afterexit", process.exitCode, null);
|
|
1609
|
-
return ret;
|
|
1610
|
-
} else {
|
|
1611
|
-
return originalProcessEmit.apply(this, arguments);
|
|
1612
|
-
}
|
|
1613
|
-
};
|
|
1614
|
-
}
|
|
1615
|
-
},
|
|
1616
|
-
871: (module) => {
|
|
1617
|
-
module.exports = ["SIGABRT", "SIGALRM", "SIGHUP", "SIGINT", "SIGTERM"];
|
|
1618
|
-
if (process.platform !== "win32") {
|
|
1619
|
-
module.exports.push(
|
|
1620
|
-
"SIGVTALRM",
|
|
1621
|
-
"SIGXCPU",
|
|
1622
|
-
"SIGXFSZ",
|
|
1623
|
-
"SIGUSR2",
|
|
1624
|
-
"SIGTRAP",
|
|
1625
|
-
"SIGSYS",
|
|
1626
|
-
"SIGQUIT",
|
|
1627
|
-
"SIGIOT",
|
|
1628
|
-
);
|
|
1629
|
-
}
|
|
1630
|
-
if (process.platform === "linux") {
|
|
1631
|
-
module.exports.push(
|
|
1632
|
-
"SIGIO",
|
|
1633
|
-
"SIGPOLL",
|
|
1634
|
-
"SIGPWR",
|
|
1635
|
-
"SIGSTKFLT",
|
|
1636
|
-
"SIGUNUSED",
|
|
1637
|
-
);
|
|
1638
|
-
}
|
|
1639
|
-
},
|
|
1640
|
-
314: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1641
|
-
"use strict";
|
|
1642
|
-
const isFullwidthCodePoint = __nccwpck_require__(383);
|
|
1643
|
-
const astralRegex = __nccwpck_require__(68);
|
|
1644
|
-
const ansiStyles = __nccwpck_require__(131);
|
|
1645
|
-
const ESCAPES = ["", ""];
|
|
1646
|
-
const wrapAnsi = (code) => `${ESCAPES[0]}[${code}m`;
|
|
1647
|
-
const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {
|
|
1648
|
-
let output = [];
|
|
1649
|
-
ansiCodes = [...ansiCodes];
|
|
1650
|
-
for (let ansiCode of ansiCodes) {
|
|
1651
|
-
const ansiCodeOrigin = ansiCode;
|
|
1652
|
-
if (ansiCode.includes(";")) {
|
|
1653
|
-
ansiCode = ansiCode.split(";")[0][0] + "0";
|
|
1654
|
-
}
|
|
1655
|
-
const item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10));
|
|
1656
|
-
if (item) {
|
|
1657
|
-
const indexEscape = ansiCodes.indexOf(item.toString());
|
|
1658
|
-
if (indexEscape === -1) {
|
|
1659
|
-
output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
|
|
1660
|
-
} else {
|
|
1661
|
-
ansiCodes.splice(indexEscape, 1);
|
|
1662
|
-
}
|
|
1663
|
-
} else if (isEscapes) {
|
|
1664
|
-
output.push(wrapAnsi(0));
|
|
1665
|
-
break;
|
|
1666
|
-
} else {
|
|
1667
|
-
output.push(wrapAnsi(ansiCodeOrigin));
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
if (isEscapes) {
|
|
1671
|
-
output = output.filter(
|
|
1672
|
-
(element, index) => output.indexOf(element) === index,
|
|
1673
|
-
);
|
|
1674
|
-
if (endAnsiCode !== undefined) {
|
|
1675
|
-
const fistEscapeCode = wrapAnsi(
|
|
1676
|
-
ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10)),
|
|
1677
|
-
);
|
|
1678
|
-
output = output.reduce(
|
|
1679
|
-
(current, next) =>
|
|
1680
|
-
next === fistEscapeCode
|
|
1681
|
-
? [next, ...current]
|
|
1682
|
-
: [...current, next],
|
|
1683
|
-
[],
|
|
1684
|
-
);
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
return output.join("");
|
|
1688
|
-
};
|
|
1689
|
-
module.exports = (string, begin, end) => {
|
|
1690
|
-
const characters = [...string];
|
|
1691
|
-
const ansiCodes = [];
|
|
1692
|
-
let stringEnd = typeof end === "number" ? end : characters.length;
|
|
1693
|
-
let isInsideEscape = false;
|
|
1694
|
-
let ansiCode;
|
|
1695
|
-
let visible = 0;
|
|
1696
|
-
let output = "";
|
|
1697
|
-
for (const [index, character] of characters.entries()) {
|
|
1698
|
-
let leftEscape = false;
|
|
1699
|
-
if (ESCAPES.includes(character)) {
|
|
1700
|
-
const code = /\d[^m]*/.exec(string.slice(index, index + 18));
|
|
1701
|
-
ansiCode = code && code.length > 0 ? code[0] : undefined;
|
|
1702
|
-
if (visible < stringEnd) {
|
|
1703
|
-
isInsideEscape = true;
|
|
1704
|
-
if (ansiCode !== undefined) {
|
|
1705
|
-
ansiCodes.push(ansiCode);
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
} else if (isInsideEscape && character === "m") {
|
|
1709
|
-
isInsideEscape = false;
|
|
1710
|
-
leftEscape = true;
|
|
1711
|
-
}
|
|
1712
|
-
if (!isInsideEscape && !leftEscape) {
|
|
1713
|
-
visible++;
|
|
1714
|
-
}
|
|
1715
|
-
if (
|
|
1716
|
-
!astralRegex({ exact: true }).test(character) &&
|
|
1717
|
-
isFullwidthCodePoint(character.codePointAt())
|
|
1718
|
-
) {
|
|
1719
|
-
visible++;
|
|
1720
|
-
if (typeof end !== "number") {
|
|
1721
|
-
stringEnd++;
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
if (visible > begin && visible <= stringEnd) {
|
|
1725
|
-
output += character;
|
|
1726
|
-
} else if (
|
|
1727
|
-
visible === begin &&
|
|
1728
|
-
!isInsideEscape &&
|
|
1729
|
-
ansiCode !== undefined
|
|
1730
|
-
) {
|
|
1731
|
-
output = checkAnsi(ansiCodes);
|
|
1732
|
-
} else if (visible >= stringEnd) {
|
|
1733
|
-
output += checkAnsi(ansiCodes, true, ansiCode);
|
|
1734
|
-
break;
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
return output;
|
|
1738
|
-
};
|
|
1739
|
-
},
|
|
1740
|
-
421: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1741
|
-
"use strict";
|
|
1742
|
-
const stripAnsi = __nccwpck_require__(34);
|
|
1743
|
-
const isFullwidthCodePoint = __nccwpck_require__(383);
|
|
1744
|
-
const emojiRegex = __nccwpck_require__(461);
|
|
1745
|
-
const stringWidth = (string) => {
|
|
1746
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
1747
|
-
return 0;
|
|
1748
|
-
}
|
|
1749
|
-
string = stripAnsi(string);
|
|
1750
|
-
if (string.length === 0) {
|
|
1751
|
-
return 0;
|
|
1752
|
-
}
|
|
1753
|
-
string = string.replace(emojiRegex(), " ");
|
|
1754
|
-
let width = 0;
|
|
1755
|
-
for (let i = 0; i < string.length; i++) {
|
|
1756
|
-
const code = string.codePointAt(i);
|
|
1757
|
-
if (code <= 31 || (code >= 127 && code <= 159)) {
|
|
1758
|
-
continue;
|
|
1759
|
-
}
|
|
1760
|
-
if (code >= 768 && code <= 879) {
|
|
1761
|
-
continue;
|
|
1762
|
-
}
|
|
1763
|
-
if (code > 65535) {
|
|
1764
|
-
i++;
|
|
1765
|
-
}
|
|
1766
|
-
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
1767
|
-
}
|
|
1768
|
-
return width;
|
|
1769
|
-
};
|
|
1770
|
-
module.exports = stringWidth;
|
|
1771
|
-
module.exports["default"] = stringWidth;
|
|
1772
|
-
},
|
|
1773
|
-
34: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1774
|
-
"use strict";
|
|
1775
|
-
const ansiRegex = __nccwpck_require__(548);
|
|
1776
|
-
module.exports = (string) =>
|
|
1777
|
-
typeof string === "string" ? string.replace(ansiRegex(), "") : string;
|
|
1778
|
-
},
|
|
1779
|
-
685: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1780
|
-
"use strict";
|
|
1781
|
-
const stringWidth = __nccwpck_require__(421);
|
|
1782
|
-
const stripAnsi = __nccwpck_require__(34);
|
|
1783
|
-
const ansiStyles = __nccwpck_require__(131);
|
|
1784
|
-
const ESCAPES = new Set(["", ""]);
|
|
1785
|
-
const END_CODE = 39;
|
|
1786
|
-
const wrapAnsi = (code) => `${ESCAPES.values().next().value}[${code}m`;
|
|
1787
|
-
const wordLengths = (string) =>
|
|
1788
|
-
string.split(" ").map((character) => stringWidth(character));
|
|
1789
|
-
const wrapWord = (rows, word, columns) => {
|
|
1790
|
-
const characters = [...word];
|
|
1791
|
-
let isInsideEscape = false;
|
|
1792
|
-
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
|
|
1793
|
-
for (const [index, character] of characters.entries()) {
|
|
1794
|
-
const characterLength = stringWidth(character);
|
|
1795
|
-
if (visible + characterLength <= columns) {
|
|
1796
|
-
rows[rows.length - 1] += character;
|
|
1797
|
-
} else {
|
|
1798
|
-
rows.push(character);
|
|
1799
|
-
visible = 0;
|
|
1800
|
-
}
|
|
1801
|
-
if (ESCAPES.has(character)) {
|
|
1802
|
-
isInsideEscape = true;
|
|
1803
|
-
} else if (isInsideEscape && character === "m") {
|
|
1804
|
-
isInsideEscape = false;
|
|
1805
|
-
continue;
|
|
1806
|
-
}
|
|
1807
|
-
if (isInsideEscape) {
|
|
1808
|
-
continue;
|
|
1809
|
-
}
|
|
1810
|
-
visible += characterLength;
|
|
1811
|
-
if (visible === columns && index < characters.length - 1) {
|
|
1812
|
-
rows.push("");
|
|
1813
|
-
visible = 0;
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
|
1817
|
-
rows[rows.length - 2] += rows.pop();
|
|
1818
|
-
}
|
|
1819
|
-
};
|
|
1820
|
-
const stringVisibleTrimSpacesRight = (str) => {
|
|
1821
|
-
const words = str.split(" ");
|
|
1822
|
-
let last = words.length;
|
|
1823
|
-
while (last > 0) {
|
|
1824
|
-
if (stringWidth(words[last - 1]) > 0) {
|
|
1825
|
-
break;
|
|
1826
|
-
}
|
|
1827
|
-
last--;
|
|
1828
|
-
}
|
|
1829
|
-
if (last === words.length) {
|
|
1830
|
-
return str;
|
|
1831
|
-
}
|
|
1832
|
-
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
1833
|
-
};
|
|
1834
|
-
const exec = (string, columns, options = {}) => {
|
|
1835
|
-
if (options.trim !== false && string.trim() === "") {
|
|
1836
|
-
return "";
|
|
1837
|
-
}
|
|
1838
|
-
let pre = "";
|
|
1839
|
-
let ret = "";
|
|
1840
|
-
let escapeCode;
|
|
1841
|
-
const lengths = wordLengths(string);
|
|
1842
|
-
let rows = [""];
|
|
1843
|
-
for (const [index, word] of string.split(" ").entries()) {
|
|
1844
|
-
if (options.trim !== false) {
|
|
1845
|
-
rows[rows.length - 1] = rows[rows.length - 1].trimLeft();
|
|
1846
|
-
}
|
|
1847
|
-
let rowLength = stringWidth(rows[rows.length - 1]);
|
|
1848
|
-
if (index !== 0) {
|
|
1849
|
-
if (
|
|
1850
|
-
rowLength >= columns &&
|
|
1851
|
-
(options.wordWrap === false || options.trim === false)
|
|
1852
|
-
) {
|
|
1853
|
-
rows.push("");
|
|
1854
|
-
rowLength = 0;
|
|
1855
|
-
}
|
|
1856
|
-
if (rowLength > 0 || options.trim === false) {
|
|
1857
|
-
rows[rows.length - 1] += " ";
|
|
1858
|
-
rowLength++;
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
if (options.hard && lengths[index] > columns) {
|
|
1862
|
-
const remainingColumns = columns - rowLength;
|
|
1863
|
-
const breaksStartingThisLine =
|
|
1864
|
-
1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
1865
|
-
const breaksStartingNextLine = Math.floor(
|
|
1866
|
-
(lengths[index] - 1) / columns,
|
|
1867
|
-
);
|
|
1868
|
-
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
1869
|
-
rows.push("");
|
|
1870
|
-
}
|
|
1871
|
-
wrapWord(rows, word, columns);
|
|
1872
|
-
continue;
|
|
1873
|
-
}
|
|
1874
|
-
if (
|
|
1875
|
-
rowLength + lengths[index] > columns &&
|
|
1876
|
-
rowLength > 0 &&
|
|
1877
|
-
lengths[index] > 0
|
|
1878
|
-
) {
|
|
1879
|
-
if (options.wordWrap === false && rowLength < columns) {
|
|
1880
|
-
wrapWord(rows, word, columns);
|
|
1881
|
-
continue;
|
|
1882
|
-
}
|
|
1883
|
-
rows.push("");
|
|
1884
|
-
}
|
|
1885
|
-
if (
|
|
1886
|
-
rowLength + lengths[index] > columns &&
|
|
1887
|
-
options.wordWrap === false
|
|
1888
|
-
) {
|
|
1889
|
-
wrapWord(rows, word, columns);
|
|
1890
|
-
continue;
|
|
1891
|
-
}
|
|
1892
|
-
rows[rows.length - 1] += word;
|
|
1893
|
-
}
|
|
1894
|
-
if (options.trim !== false) {
|
|
1895
|
-
rows = rows.map(stringVisibleTrimSpacesRight);
|
|
1896
|
-
}
|
|
1897
|
-
pre = rows.join("\n");
|
|
1898
|
-
for (const [index, character] of [...pre].entries()) {
|
|
1899
|
-
ret += character;
|
|
1900
|
-
if (ESCAPES.has(character)) {
|
|
1901
|
-
const code = parseFloat(
|
|
1902
|
-
/\d[^m]*/.exec(pre.slice(index, index + 4)),
|
|
1903
|
-
);
|
|
1904
|
-
escapeCode = code === END_CODE ? null : code;
|
|
1905
|
-
}
|
|
1906
|
-
const code = ansiStyles.codes.get(Number(escapeCode));
|
|
1907
|
-
if (escapeCode && code) {
|
|
1908
|
-
if (pre[index + 1] === "\n") {
|
|
1909
|
-
ret += wrapAnsi(code);
|
|
1910
|
-
} else if (character === "\n") {
|
|
1911
|
-
ret += wrapAnsi(escapeCode);
|
|
1912
|
-
}
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
return ret;
|
|
1916
|
-
};
|
|
1917
|
-
module.exports = (string, columns, options) =>
|
|
1918
|
-
String(string)
|
|
1919
|
-
.normalize()
|
|
1920
|
-
.replace(/\r\n/g, "\n")
|
|
1921
|
-
.split("\n")
|
|
1922
|
-
.map((line) => exec(line, columns, options))
|
|
1923
|
-
.join("\n");
|
|
1924
|
-
},
|
|
1925
|
-
491: (module) => {
|
|
1926
|
-
"use strict";
|
|
1927
|
-
module.exports = require("assert");
|
|
1928
|
-
},
|
|
1929
|
-
361: (module) => {
|
|
1930
|
-
"use strict";
|
|
1931
|
-
module.exports = require("events");
|
|
1932
|
-
},
|
|
1933
|
-
};
|
|
1934
|
-
var __webpack_module_cache__ = {};
|
|
1935
|
-
function __nccwpck_require__(moduleId) {
|
|
1936
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
1937
|
-
if (cachedModule !== undefined) {
|
|
1938
|
-
return cachedModule.exports;
|
|
1939
|
-
}
|
|
1940
|
-
var module = (__webpack_module_cache__[moduleId] = {
|
|
1941
|
-
id: moduleId,
|
|
1942
|
-
loaded: false,
|
|
1943
|
-
exports: {},
|
|
1944
|
-
});
|
|
1945
|
-
var threw = true;
|
|
1946
|
-
try {
|
|
1947
|
-
__webpack_modules__[moduleId](
|
|
1948
|
-
module,
|
|
1949
|
-
module.exports,
|
|
1950
|
-
__nccwpck_require__,
|
|
1951
|
-
);
|
|
1952
|
-
threw = false;
|
|
1953
|
-
} finally {
|
|
1954
|
-
if (threw) delete __webpack_module_cache__[moduleId];
|
|
1955
|
-
}
|
|
1956
|
-
module.loaded = true;
|
|
1957
|
-
return module.exports;
|
|
1958
|
-
}
|
|
1959
|
-
(() => {
|
|
1960
|
-
__nccwpck_require__.nmd = (module) => {
|
|
1961
|
-
module.paths = [];
|
|
1962
|
-
if (!module.children) module.children = [];
|
|
1963
|
-
return module;
|
|
1964
|
-
};
|
|
1965
|
-
})();
|
|
1966
|
-
if (typeof __nccwpck_require__ !== "undefined")
|
|
1967
|
-
__nccwpck_require__.ab = __dirname + "/";
|
|
1968
|
-
var __webpack_exports__ = __nccwpck_require__(795);
|
|
1969
|
-
module.exports = __webpack_exports__;
|
|
1970
|
-
})();
|