@pandacss/node 0.0.0-dev-20221121152823
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/LICENSE.md +21 -0
- package/README.md +208 -0
- package/dist/index.d.ts +395 -0
- package/dist/index.js +3659 -0
- package/dist/index.mjs +3641 -0
- package/package.json +57 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3641 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __esm = (fn, res) => function __init() {
|
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
+
};
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
|
|
26
|
+
// ../../node_modules/.pnpm/tsup@6.5.0_typescript@4.8.4/node_modules/tsup/assets/esm_shims.js
|
|
27
|
+
var init_esm_shims = __esm({
|
|
28
|
+
"../../node_modules/.pnpm/tsup@6.5.0_typescript@4.8.4/node_modules/tsup/assets/esm_shims.js"() {
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js
|
|
33
|
+
var require_eastasianwidth = __commonJS({
|
|
34
|
+
"../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
|
|
35
|
+
init_esm_shims();
|
|
36
|
+
var eaw = {};
|
|
37
|
+
if ("undefined" == typeof module) {
|
|
38
|
+
window.eastasianwidth = eaw;
|
|
39
|
+
} else {
|
|
40
|
+
module.exports = eaw;
|
|
41
|
+
}
|
|
42
|
+
eaw.eastAsianWidth = function(character) {
|
|
43
|
+
var x = character.charCodeAt(0);
|
|
44
|
+
var y = character.length == 2 ? character.charCodeAt(1) : 0;
|
|
45
|
+
var codePoint = x;
|
|
46
|
+
if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
|
|
47
|
+
x &= 1023;
|
|
48
|
+
y &= 1023;
|
|
49
|
+
codePoint = x << 10 | y;
|
|
50
|
+
codePoint += 65536;
|
|
51
|
+
}
|
|
52
|
+
if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
|
|
53
|
+
return "F";
|
|
54
|
+
}
|
|
55
|
+
if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
|
|
56
|
+
return "H";
|
|
57
|
+
}
|
|
58
|
+
if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
|
|
59
|
+
return "W";
|
|
60
|
+
}
|
|
61
|
+
if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
|
|
62
|
+
return "Na";
|
|
63
|
+
}
|
|
64
|
+
if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
|
|
65
|
+
return "A";
|
|
66
|
+
}
|
|
67
|
+
return "N";
|
|
68
|
+
};
|
|
69
|
+
eaw.characterLength = function(character) {
|
|
70
|
+
var code = this.eastAsianWidth(character);
|
|
71
|
+
if (code == "F" || code == "W" || code == "A") {
|
|
72
|
+
return 2;
|
|
73
|
+
} else {
|
|
74
|
+
return 1;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
function stringToArray(string) {
|
|
78
|
+
return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
79
|
+
}
|
|
80
|
+
eaw.length = function(string) {
|
|
81
|
+
var characters = stringToArray(string);
|
|
82
|
+
var len = 0;
|
|
83
|
+
for (var i = 0; i < characters.length; i++) {
|
|
84
|
+
len = len + this.characterLength(characters[i]);
|
|
85
|
+
}
|
|
86
|
+
return len;
|
|
87
|
+
};
|
|
88
|
+
eaw.slice = function(text, start, end) {
|
|
89
|
+
textLen = eaw.length(text);
|
|
90
|
+
start = start ? start : 0;
|
|
91
|
+
end = end ? end : 1;
|
|
92
|
+
if (start < 0) {
|
|
93
|
+
start = textLen + start;
|
|
94
|
+
}
|
|
95
|
+
if (end < 0) {
|
|
96
|
+
end = textLen + end;
|
|
97
|
+
}
|
|
98
|
+
var result = "";
|
|
99
|
+
var eawLen = 0;
|
|
100
|
+
var chars = stringToArray(text);
|
|
101
|
+
for (var i = 0; i < chars.length; i++) {
|
|
102
|
+
var char = chars[i];
|
|
103
|
+
var charLen = eaw.length(char);
|
|
104
|
+
if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
|
|
105
|
+
if (eawLen + charLen <= end) {
|
|
106
|
+
result += char;
|
|
107
|
+
} else {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
eawLen += charLen;
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// ../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js
|
|
119
|
+
var require_emoji_regex = __commonJS({
|
|
120
|
+
"../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports, module) {
|
|
121
|
+
"use strict";
|
|
122
|
+
init_esm_shims();
|
|
123
|
+
module.exports = function() {
|
|
124
|
+
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
|
|
130
|
+
var require_boxes = __commonJS({
|
|
131
|
+
"../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json"(exports, module) {
|
|
132
|
+
module.exports = {
|
|
133
|
+
single: {
|
|
134
|
+
topLeft: "\u250C",
|
|
135
|
+
top: "\u2500",
|
|
136
|
+
topRight: "\u2510",
|
|
137
|
+
right: "\u2502",
|
|
138
|
+
bottomRight: "\u2518",
|
|
139
|
+
bottom: "\u2500",
|
|
140
|
+
bottomLeft: "\u2514",
|
|
141
|
+
left: "\u2502"
|
|
142
|
+
},
|
|
143
|
+
double: {
|
|
144
|
+
topLeft: "\u2554",
|
|
145
|
+
top: "\u2550",
|
|
146
|
+
topRight: "\u2557",
|
|
147
|
+
right: "\u2551",
|
|
148
|
+
bottomRight: "\u255D",
|
|
149
|
+
bottom: "\u2550",
|
|
150
|
+
bottomLeft: "\u255A",
|
|
151
|
+
left: "\u2551"
|
|
152
|
+
},
|
|
153
|
+
round: {
|
|
154
|
+
topLeft: "\u256D",
|
|
155
|
+
top: "\u2500",
|
|
156
|
+
topRight: "\u256E",
|
|
157
|
+
right: "\u2502",
|
|
158
|
+
bottomRight: "\u256F",
|
|
159
|
+
bottom: "\u2500",
|
|
160
|
+
bottomLeft: "\u2570",
|
|
161
|
+
left: "\u2502"
|
|
162
|
+
},
|
|
163
|
+
bold: {
|
|
164
|
+
topLeft: "\u250F",
|
|
165
|
+
top: "\u2501",
|
|
166
|
+
topRight: "\u2513",
|
|
167
|
+
right: "\u2503",
|
|
168
|
+
bottomRight: "\u251B",
|
|
169
|
+
bottom: "\u2501",
|
|
170
|
+
bottomLeft: "\u2517",
|
|
171
|
+
left: "\u2503"
|
|
172
|
+
},
|
|
173
|
+
singleDouble: {
|
|
174
|
+
topLeft: "\u2553",
|
|
175
|
+
top: "\u2500",
|
|
176
|
+
topRight: "\u2556",
|
|
177
|
+
right: "\u2551",
|
|
178
|
+
bottomRight: "\u255C",
|
|
179
|
+
bottom: "\u2500",
|
|
180
|
+
bottomLeft: "\u2559",
|
|
181
|
+
left: "\u2551"
|
|
182
|
+
},
|
|
183
|
+
doubleSingle: {
|
|
184
|
+
topLeft: "\u2552",
|
|
185
|
+
top: "\u2550",
|
|
186
|
+
topRight: "\u2555",
|
|
187
|
+
right: "\u2502",
|
|
188
|
+
bottomRight: "\u255B",
|
|
189
|
+
bottom: "\u2550",
|
|
190
|
+
bottomLeft: "\u2558",
|
|
191
|
+
left: "\u2502"
|
|
192
|
+
},
|
|
193
|
+
classic: {
|
|
194
|
+
topLeft: "+",
|
|
195
|
+
top: "-",
|
|
196
|
+
topRight: "+",
|
|
197
|
+
right: "|",
|
|
198
|
+
bottomRight: "+",
|
|
199
|
+
bottom: "-",
|
|
200
|
+
bottomLeft: "+",
|
|
201
|
+
left: "|"
|
|
202
|
+
},
|
|
203
|
+
arrow: {
|
|
204
|
+
topLeft: "\u2198",
|
|
205
|
+
top: "\u2193",
|
|
206
|
+
topRight: "\u2199",
|
|
207
|
+
right: "\u2190",
|
|
208
|
+
bottomRight: "\u2196",
|
|
209
|
+
bottom: "\u2191",
|
|
210
|
+
bottomLeft: "\u2197",
|
|
211
|
+
left: "\u2192"
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js
|
|
218
|
+
var require_cli_boxes = __commonJS({
|
|
219
|
+
"../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js"(exports, module) {
|
|
220
|
+
"use strict";
|
|
221
|
+
init_esm_shims();
|
|
222
|
+
var cliBoxes2 = require_boxes();
|
|
223
|
+
module.exports = cliBoxes2;
|
|
224
|
+
module.exports.default = cliBoxes2;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
|
|
229
|
+
var require_ansi_regex = __commonJS({
|
|
230
|
+
"../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module) {
|
|
231
|
+
"use strict";
|
|
232
|
+
init_esm_shims();
|
|
233
|
+
module.exports = ({ onlyFirst = false } = {}) => {
|
|
234
|
+
const pattern = [
|
|
235
|
+
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
236
|
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
237
|
+
].join("|");
|
|
238
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
|
|
244
|
+
var require_strip_ansi = __commonJS({
|
|
245
|
+
"../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module) {
|
|
246
|
+
"use strict";
|
|
247
|
+
init_esm_shims();
|
|
248
|
+
var ansiRegex2 = require_ansi_regex();
|
|
249
|
+
module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// ../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
|
|
254
|
+
var require_is_fullwidth_code_point = __commonJS({
|
|
255
|
+
"../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports, module) {
|
|
256
|
+
"use strict";
|
|
257
|
+
init_esm_shims();
|
|
258
|
+
var isFullwidthCodePoint = (codePoint) => {
|
|
259
|
+
if (Number.isNaN(codePoint)) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) {
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
265
|
+
return false;
|
|
266
|
+
};
|
|
267
|
+
module.exports = isFullwidthCodePoint;
|
|
268
|
+
module.exports.default = isFullwidthCodePoint;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// ../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
|
|
273
|
+
var require_emoji_regex2 = __commonJS({
|
|
274
|
+
"../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports, module) {
|
|
275
|
+
"use strict";
|
|
276
|
+
init_esm_shims();
|
|
277
|
+
module.exports = function() {
|
|
278
|
+
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;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
// ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
|
|
284
|
+
var require_string_width = __commonJS({
|
|
285
|
+
"../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports, module) {
|
|
286
|
+
"use strict";
|
|
287
|
+
init_esm_shims();
|
|
288
|
+
var stripAnsi2 = require_strip_ansi();
|
|
289
|
+
var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
290
|
+
var emojiRegex2 = require_emoji_regex2();
|
|
291
|
+
var stringWidth2 = (string) => {
|
|
292
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
293
|
+
return 0;
|
|
294
|
+
}
|
|
295
|
+
string = stripAnsi2(string);
|
|
296
|
+
if (string.length === 0) {
|
|
297
|
+
return 0;
|
|
298
|
+
}
|
|
299
|
+
string = string.replace(emojiRegex2(), " ");
|
|
300
|
+
let width = 0;
|
|
301
|
+
for (let i = 0; i < string.length; i++) {
|
|
302
|
+
const code = string.codePointAt(i);
|
|
303
|
+
if (code <= 31 || code >= 127 && code <= 159) {
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
if (code >= 768 && code <= 879) {
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (code > 65535) {
|
|
310
|
+
i++;
|
|
311
|
+
}
|
|
312
|
+
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
313
|
+
}
|
|
314
|
+
return width;
|
|
315
|
+
};
|
|
316
|
+
module.exports = stringWidth2;
|
|
317
|
+
module.exports.default = stringWidth2;
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// ../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js
|
|
322
|
+
var require_ansi_align = __commonJS({
|
|
323
|
+
"../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js"(exports, module) {
|
|
324
|
+
"use strict";
|
|
325
|
+
init_esm_shims();
|
|
326
|
+
var stringWidth2 = require_string_width();
|
|
327
|
+
function ansiAlign2(text, opts) {
|
|
328
|
+
if (!text)
|
|
329
|
+
return text;
|
|
330
|
+
opts = opts || {};
|
|
331
|
+
const align = opts.align || "center";
|
|
332
|
+
if (align === "left")
|
|
333
|
+
return text;
|
|
334
|
+
const split = opts.split || "\n";
|
|
335
|
+
const pad = opts.pad || " ";
|
|
336
|
+
const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
|
|
337
|
+
let returnString = false;
|
|
338
|
+
if (!Array.isArray(text)) {
|
|
339
|
+
returnString = true;
|
|
340
|
+
text = String(text).split(split);
|
|
341
|
+
}
|
|
342
|
+
let width;
|
|
343
|
+
let maxWidth = 0;
|
|
344
|
+
text = text.map(function(str) {
|
|
345
|
+
str = String(str);
|
|
346
|
+
width = stringWidth2(str);
|
|
347
|
+
maxWidth = Math.max(width, maxWidth);
|
|
348
|
+
return {
|
|
349
|
+
str,
|
|
350
|
+
width
|
|
351
|
+
};
|
|
352
|
+
}).map(function(obj) {
|
|
353
|
+
return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str;
|
|
354
|
+
});
|
|
355
|
+
return returnString ? text.join(split) : text;
|
|
356
|
+
}
|
|
357
|
+
ansiAlign2.left = function left(text) {
|
|
358
|
+
return ansiAlign2(text, { align: "left" });
|
|
359
|
+
};
|
|
360
|
+
ansiAlign2.center = function center(text) {
|
|
361
|
+
return ansiAlign2(text, { align: "center" });
|
|
362
|
+
};
|
|
363
|
+
ansiAlign2.right = function right(text) {
|
|
364
|
+
return ansiAlign2(text, { align: "right" });
|
|
365
|
+
};
|
|
366
|
+
module.exports = ansiAlign2;
|
|
367
|
+
function halfDiff(maxWidth, curWidth) {
|
|
368
|
+
return Math.floor((maxWidth - curWidth) / 2);
|
|
369
|
+
}
|
|
370
|
+
function fullDiff(maxWidth, curWidth) {
|
|
371
|
+
return maxWidth - curWidth;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
// src/index.ts
|
|
377
|
+
init_esm_shims();
|
|
378
|
+
import { discardDuplicate as discardDuplicate3 } from "@pandacss/core";
|
|
379
|
+
|
|
380
|
+
// src/artifacts.ts
|
|
381
|
+
init_esm_shims();
|
|
382
|
+
|
|
383
|
+
// src/chunks.ts
|
|
384
|
+
init_esm_shims();
|
|
385
|
+
import { Stylesheet } from "@pandacss/core";
|
|
386
|
+
import { logger as logger2 } from "@pandacss/logger";
|
|
387
|
+
|
|
388
|
+
// src/extract.ts
|
|
389
|
+
init_esm_shims();
|
|
390
|
+
import { logger, quote } from "@pandacss/logger";
|
|
391
|
+
function extractFile(ctx, file) {
|
|
392
|
+
logger.debug({ type: "file:extract", file });
|
|
393
|
+
let data;
|
|
394
|
+
let result;
|
|
395
|
+
const done = logger.time.debug("Extracted", quote(file));
|
|
396
|
+
try {
|
|
397
|
+
const source = ctx.getSourceFile(file);
|
|
398
|
+
data = ctx.parseSourceFile(source);
|
|
399
|
+
} catch (error) {
|
|
400
|
+
logger.error({ err: error });
|
|
401
|
+
}
|
|
402
|
+
if (data) {
|
|
403
|
+
result = ctx.collectStyles(data, file);
|
|
404
|
+
}
|
|
405
|
+
if (result) {
|
|
406
|
+
done();
|
|
407
|
+
}
|
|
408
|
+
return result;
|
|
409
|
+
}
|
|
410
|
+
function extractFiles(ctx) {
|
|
411
|
+
return ctx.extract(async (file) => {
|
|
412
|
+
const result = extractFile(ctx, file);
|
|
413
|
+
if (result) {
|
|
414
|
+
await ctx.chunks.write(file, result.css);
|
|
415
|
+
return result;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// src/chunks.ts
|
|
421
|
+
async function extractChunks(ctx) {
|
|
422
|
+
const sheet = new Stylesheet(ctx.context(), {
|
|
423
|
+
content: [
|
|
424
|
+
"@layer reset, base, tokens, recipes, utilities;",
|
|
425
|
+
ctx.preflight && "@import './reset.css';",
|
|
426
|
+
!ctx.tokens.isEmpty && "@import './tokens/index.css';",
|
|
427
|
+
ctx.keyframes && "@import './tokens/keyframes.css';"
|
|
428
|
+
].filter(Boolean).join("\n\n")
|
|
429
|
+
});
|
|
430
|
+
const files = ctx.chunks.getFiles();
|
|
431
|
+
await Promise.all(
|
|
432
|
+
files.map(async (file) => {
|
|
433
|
+
const css2 = await ctx.chunks.readFile(file);
|
|
434
|
+
sheet.append(css2);
|
|
435
|
+
})
|
|
436
|
+
);
|
|
437
|
+
return sheet.toCss({ minify: ctx.minify });
|
|
438
|
+
}
|
|
439
|
+
async function bundleChunks(ctx) {
|
|
440
|
+
const css2 = await extractChunks(ctx);
|
|
441
|
+
await ctx.write(ctx.outdir, [{ file: "styles.css", code: css2 }]);
|
|
442
|
+
}
|
|
443
|
+
async function writeFileChunk(ctx, file) {
|
|
444
|
+
logger2.info(`File changed: ${file}`);
|
|
445
|
+
const result = extractFile(ctx, file);
|
|
446
|
+
if (result) {
|
|
447
|
+
await ctx.chunks.write(result.file, result.css);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// src/generators/index.ts
|
|
452
|
+
init_esm_shims();
|
|
453
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
454
|
+
import { lookItUpSync } from "look-it-up";
|
|
455
|
+
import outdent19 from "outdent";
|
|
456
|
+
import { dirname as dirname2 } from "path";
|
|
457
|
+
|
|
458
|
+
// src/generators/conditions.ts
|
|
459
|
+
init_esm_shims();
|
|
460
|
+
import { unionType } from "@pandacss/shared";
|
|
461
|
+
import outdent from "outdent";
|
|
462
|
+
function generateConditions(ctx) {
|
|
463
|
+
const keys = Object.keys(ctx.conditions.values).concat("_", "base");
|
|
464
|
+
return {
|
|
465
|
+
js: outdent`
|
|
466
|
+
const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
|
|
467
|
+
|
|
468
|
+
export function isCondition(value){
|
|
469
|
+
return conditions.has(value) || /^@|&|&$/.test(value)
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export function sortConditions(paths){
|
|
473
|
+
return paths.sort((a, b) => {
|
|
474
|
+
const aa = isCondition(a)
|
|
475
|
+
const bb = isCondition(b)
|
|
476
|
+
if (aa && !bb) return 1
|
|
477
|
+
if (!aa && bb) return -1
|
|
478
|
+
return 0
|
|
479
|
+
})
|
|
480
|
+
}
|
|
481
|
+
`,
|
|
482
|
+
dts: outdent`
|
|
483
|
+
export type Condition = ${unionType(keys)}
|
|
484
|
+
export type Conditions = Record<Condition, string>
|
|
485
|
+
`
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// src/generators/css-fn.ts
|
|
490
|
+
init_esm_shims();
|
|
491
|
+
import { outdent as outdent2 } from "outdent";
|
|
492
|
+
var stringify = (v) => JSON.stringify(Object.fromEntries(v), null, 2);
|
|
493
|
+
function generateCssFn(ctx) {
|
|
494
|
+
const { utility, hash } = ctx;
|
|
495
|
+
const { separator } = utility;
|
|
496
|
+
return {
|
|
497
|
+
dts: outdent2`
|
|
498
|
+
import { CssObject } from '../types'
|
|
499
|
+
export declare function css(styles: CssObject): string
|
|
500
|
+
`,
|
|
501
|
+
js: outdent2`
|
|
502
|
+
import { createCss, withoutSpace } from "../helpers"
|
|
503
|
+
import { sortConditions } from "./conditions"
|
|
504
|
+
|
|
505
|
+
const classNameMap = ${stringify(utility.entries())}
|
|
506
|
+
const shorthands = ${stringify(utility.shorthands)}
|
|
507
|
+
|
|
508
|
+
const hasShorthand = ${utility.hasShorthand ? "true" : "false"}
|
|
509
|
+
|
|
510
|
+
const resolveShorthand = (prop) => shorthands[prop] || prop
|
|
511
|
+
|
|
512
|
+
function transform(prop, value) {
|
|
513
|
+
let key = resolveShorthand(prop)
|
|
514
|
+
let propKey = classNameMap[key] || prop
|
|
515
|
+
let className = \`$\{propKey}${separator}$\{withoutSpace(value)}\`
|
|
516
|
+
return { className }
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
const context = {
|
|
520
|
+
transform,
|
|
521
|
+
conditions: { shift: sortConditions },
|
|
522
|
+
hash: ${hash ? "true" : "false"},
|
|
523
|
+
hasShorthand,
|
|
524
|
+
resolveShorthand,
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
export const css = createCss(context)
|
|
528
|
+
`
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// src/generators/css-map.ts
|
|
533
|
+
init_esm_shims();
|
|
534
|
+
import { outdent as outdent3 } from "outdent";
|
|
535
|
+
function generateCssMap() {
|
|
536
|
+
return {
|
|
537
|
+
js: outdent3`
|
|
538
|
+
import { css } from "./css"
|
|
539
|
+
|
|
540
|
+
export function cssMap(obj){
|
|
541
|
+
return (...args) => {
|
|
542
|
+
const finalCss = args.reduce((acc, arg) => {
|
|
543
|
+
Object.assign(acc, obj[arg]);
|
|
544
|
+
return acc;
|
|
545
|
+
}, {})
|
|
546
|
+
return css(finalCss);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
`,
|
|
550
|
+
dts: outdent3`
|
|
551
|
+
import { CssObject } from "../types"
|
|
552
|
+
|
|
553
|
+
export declare function cssMap<T extends string>(obj: Record<T, CssObject>): (...args: Array<T>) => string;
|
|
554
|
+
`
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
// src/generators/cx.ts
|
|
559
|
+
init_esm_shims();
|
|
560
|
+
import outdent4 from "outdent";
|
|
561
|
+
function generateCx() {
|
|
562
|
+
return {
|
|
563
|
+
js: outdent4`
|
|
564
|
+
function cx() {
|
|
565
|
+
let str = '',
|
|
566
|
+
i = 0,
|
|
567
|
+
arg
|
|
568
|
+
|
|
569
|
+
while (i < arguments.length) {
|
|
570
|
+
if ((arg = arguments[i++]) && typeof arg === 'string') {
|
|
571
|
+
str && (str += ' ')
|
|
572
|
+
str += arg
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
return str
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export { cx }
|
|
579
|
+
`,
|
|
580
|
+
dts: outdent4`
|
|
581
|
+
type Argument = string | boolean | null | undefined
|
|
582
|
+
export declare function cx(...args: Argument[]): string
|
|
583
|
+
`
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// src/generators/get-entrypoint.ts
|
|
588
|
+
init_esm_shims();
|
|
589
|
+
import { createRequire } from "module";
|
|
590
|
+
import { dirname, join } from "path";
|
|
591
|
+
var req = typeof globalThis.require === "function" ? globalThis.require : createRequire(import.meta.url);
|
|
592
|
+
function getEntrypoint(pkg, file) {
|
|
593
|
+
const { dev, prod = dev } = file;
|
|
594
|
+
const entry = req.resolve(pkg);
|
|
595
|
+
const isDist = entry.includes("dist");
|
|
596
|
+
const isType = pkg.includes("/types");
|
|
597
|
+
if (isType) {
|
|
598
|
+
return join(dirname(entry), dev);
|
|
599
|
+
}
|
|
600
|
+
if (!isDist) {
|
|
601
|
+
return join(dirname(entry), "src", dev);
|
|
602
|
+
}
|
|
603
|
+
return join(dirname(entry), prod);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// src/generators/global-css.ts
|
|
607
|
+
init_esm_shims();
|
|
608
|
+
import { outdent as outdent5 } from "outdent";
|
|
609
|
+
function generateGlobalCss() {
|
|
610
|
+
return {
|
|
611
|
+
js: outdent5`
|
|
612
|
+
export function globalCss(styles){
|
|
613
|
+
void styles
|
|
614
|
+
}
|
|
615
|
+
`,
|
|
616
|
+
dts: outdent5`
|
|
617
|
+
import { Properties } from '../types/csstype'
|
|
618
|
+
|
|
619
|
+
export type GlobalCss = Record<string, Properties>
|
|
620
|
+
|
|
621
|
+
export declare function globalCss(styles: GlobalCss): void;
|
|
622
|
+
`
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// src/generators/is-valid-prop.ts
|
|
627
|
+
init_esm_shims();
|
|
628
|
+
import { readFileSync } from "fs";
|
|
629
|
+
function generateisValidProp(ctx) {
|
|
630
|
+
const filePath = getEntrypoint("@pandacss/is-valid-prop", { dev: "index.ts", prod: "index.mjs" });
|
|
631
|
+
let content = readFileSync(filePath, "utf8");
|
|
632
|
+
content = content.replace(
|
|
633
|
+
"var userGenerated = []",
|
|
634
|
+
`var userGenerated = [${ctx.properties.map((key) => JSON.stringify(key)).join(",")}]`
|
|
635
|
+
);
|
|
636
|
+
return {
|
|
637
|
+
js: content
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// src/generators/jsx/index.ts
|
|
642
|
+
init_esm_shims();
|
|
643
|
+
|
|
644
|
+
// src/generators/jsx/preact-jsx.ts
|
|
645
|
+
init_esm_shims();
|
|
646
|
+
import { capitalize } from "@pandacss/shared";
|
|
647
|
+
import { outdent as outdent6 } from "outdent";
|
|
648
|
+
function generatePreactJsxFactory(ctx) {
|
|
649
|
+
const name = ctx.jsxFactory;
|
|
650
|
+
const upperName = capitalize(name);
|
|
651
|
+
return {
|
|
652
|
+
dts: outdent6`
|
|
653
|
+
import type { ComponentProps, JSX } from 'preact'
|
|
654
|
+
import type { CssProperties, CssObject } from '../types'
|
|
655
|
+
|
|
656
|
+
type Element = keyof JSX.IntrinsicElements
|
|
657
|
+
|
|
658
|
+
type Merge<P, T> = Omit<P, 'color'> & T;
|
|
659
|
+
|
|
660
|
+
export type HTML${upperName}Props<T extends Element> = Merge<ComponentProps<T>, CssProperties> & { css?: CssObject }
|
|
661
|
+
|
|
662
|
+
type JSXFactory = {
|
|
663
|
+
[K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export declare const ${name}: JSXFactory
|
|
667
|
+
`,
|
|
668
|
+
js: outdent6`
|
|
669
|
+
import { h } from 'preact';
|
|
670
|
+
import { forwardRef } from 'preact/compat';
|
|
671
|
+
import { isCssProperty } from './is-valid-prop'
|
|
672
|
+
import { css } from '../css'
|
|
673
|
+
|
|
674
|
+
function cx(...args) {
|
|
675
|
+
return args.filter(Boolean).join(' ')
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function splitProps(props) {
|
|
679
|
+
const styleProps = {}
|
|
680
|
+
const elementProps = {}
|
|
681
|
+
|
|
682
|
+
for (const [key, value] of Object.entries(props)) {
|
|
683
|
+
if (isCssProperty(key)) {
|
|
684
|
+
styleProps[key] = value
|
|
685
|
+
} else {
|
|
686
|
+
elementProps[key] = value
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
return [styleProps, elementProps]
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
function styled(Dynamic) {
|
|
694
|
+
const ${upperName}Component = forwardRef((props, ref) => {
|
|
695
|
+
const { as: Element = Dynamic, ...restProps } = props
|
|
696
|
+
|
|
697
|
+
const [styleProps, elementProps] = splitProps(restProps)
|
|
698
|
+
|
|
699
|
+
const classes = () => {
|
|
700
|
+
const { css: cssStyles, ...otherStyles } = styleProps
|
|
701
|
+
const atomicClass = css({ ...otherStyles, ...cssStyles })
|
|
702
|
+
return cx(atomicClass, elementProps.className)
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
return h(Element, { ...elementProps, ref, className: classes() });
|
|
706
|
+
})
|
|
707
|
+
|
|
708
|
+
${upperName}Component.displayName = \`${name}.\${Dynamic}\`
|
|
709
|
+
return ${upperName}Component
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
function createFactory() {
|
|
713
|
+
const cache = new Map()
|
|
714
|
+
|
|
715
|
+
return new Proxy(Object.create(null), {
|
|
716
|
+
get(_, el) {
|
|
717
|
+
if (!cache.has(el)) {
|
|
718
|
+
cache.set(el, styled(el))
|
|
719
|
+
}
|
|
720
|
+
return cache.get(el)
|
|
721
|
+
},
|
|
722
|
+
})
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export const ${name} = createFactory();
|
|
726
|
+
`
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// src/generators/jsx/preact-pattern.ts
|
|
731
|
+
init_esm_shims();
|
|
732
|
+
import { capitalize as capitalize2, dashCase } from "@pandacss/shared";
|
|
733
|
+
import { outdent as outdent7 } from "outdent";
|
|
734
|
+
function generate(name, pattern, jsxFactory) {
|
|
735
|
+
const upperName = capitalize2(name);
|
|
736
|
+
const jsxName = pattern.jsx ?? upperName;
|
|
737
|
+
const keys = Object.keys(pattern.properties ?? {});
|
|
738
|
+
return {
|
|
739
|
+
name: dashCase(name),
|
|
740
|
+
js: outdent7`
|
|
741
|
+
import { forwardRef } from 'preact/compat'
|
|
742
|
+
import { ${jsxFactory} } from './factory'
|
|
743
|
+
import { config } from '../patterns/${dashCase(name)}'
|
|
744
|
+
|
|
745
|
+
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
746
|
+
const { ${keys.join(", ")}, ...restProps } = props
|
|
747
|
+
const styleProps = config.transform({${keys.join(", ")}})
|
|
748
|
+
return <${jsxFactory}.div ref={ref} {...styleProps} {...restProps} />
|
|
749
|
+
})
|
|
750
|
+
`,
|
|
751
|
+
dts: outdent7`
|
|
752
|
+
import { ComponentProps, JSX, ComponentChildren } from 'preact';
|
|
753
|
+
import { ${upperName}Options } from '../patterns/${dashCase(name)}'
|
|
754
|
+
import { CssObject } from '../types'
|
|
755
|
+
|
|
756
|
+
type ElementType = keyof JSX.IntrinsicElements
|
|
757
|
+
type PropsWithChildren<T> = T & { children?: ComponentChildren }
|
|
758
|
+
|
|
759
|
+
type Merge<T, U> = Omit<T, keyof U> & U
|
|
760
|
+
type PropsOf<C extends ElementType> = ComponentProps<C>
|
|
761
|
+
type StyleProps = CssObject & { css?: CssObject }
|
|
762
|
+
|
|
763
|
+
type Polymorphic<C extends ElementType = 'div', P = {}> = StyleProps &
|
|
764
|
+
Merge<PropsWithChildren<PropsOf<C>>, P & { as?: C; color?: string }>
|
|
765
|
+
|
|
766
|
+
type ${jsxName}Props<C extends ElementType> = Polymorphic<C, ${upperName}Options>
|
|
767
|
+
|
|
768
|
+
export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
|
|
769
|
+
`
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
function generatePreactJsxPattern(ctx) {
|
|
773
|
+
if (!ctx.hasPattern)
|
|
774
|
+
return [];
|
|
775
|
+
return Object.entries(ctx.patterns).map(([name, pattern]) => generate(name, pattern, ctx.jsxFactory));
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// src/generators/jsx/react-jsx.ts
|
|
779
|
+
init_esm_shims();
|
|
780
|
+
import { capitalize as capitalize3 } from "@pandacss/shared";
|
|
781
|
+
import { outdent as outdent8 } from "outdent";
|
|
782
|
+
function generateReactJsxFactory(ctx) {
|
|
783
|
+
const name = ctx.jsxFactory;
|
|
784
|
+
const upperName = capitalize3(name);
|
|
785
|
+
return {
|
|
786
|
+
dts: outdent8`
|
|
787
|
+
import type { ComponentProps } from "react"
|
|
788
|
+
import type { CssProperties, CssObject } from "../types"
|
|
789
|
+
|
|
790
|
+
type Element = keyof JSX.IntrinsicElements
|
|
791
|
+
|
|
792
|
+
type Merge<P, T> = Omit<P, "color"> & T;
|
|
793
|
+
|
|
794
|
+
export type HTML${upperName}Props<T extends Element> = Merge<ComponentProps<T>, CssProperties> & { css?: CssObject }
|
|
795
|
+
|
|
796
|
+
type JSXFactory = {
|
|
797
|
+
[K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
export declare const ${name}: JSXFactory
|
|
801
|
+
`,
|
|
802
|
+
js: outdent8`
|
|
803
|
+
import { forwardRef } from 'react'
|
|
804
|
+
import { isCssProperty } from './is-valid-prop'
|
|
805
|
+
import { css } from '../css'
|
|
806
|
+
|
|
807
|
+
function cx(...args) {
|
|
808
|
+
return args.filter(Boolean).join(' ')
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
function splitProps(props) {
|
|
812
|
+
const styleProps = {}
|
|
813
|
+
const elementProps = {}
|
|
814
|
+
|
|
815
|
+
for (const [key, value] of Object.entries(props)) {
|
|
816
|
+
if (isCssProperty(key)) {
|
|
817
|
+
styleProps[key] = value
|
|
818
|
+
} else {
|
|
819
|
+
elementProps[key] = value
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
return [styleProps, elementProps]
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function styled(Dynamic) {
|
|
827
|
+
const ${upperName}Component = forwardRef((props, ref) => {
|
|
828
|
+
const { as: Element = Dynamic, ...restProps } = props
|
|
829
|
+
|
|
830
|
+
const [styleProps, elementProps] = splitProps(restProps)
|
|
831
|
+
|
|
832
|
+
const classes = () => {
|
|
833
|
+
const { css: cssStyles, ...otherStyles } = styleProps
|
|
834
|
+
const atomicClass = css({ ...otherStyles, ...cssStyles })
|
|
835
|
+
return cx(atomicClass, elementProps.className)
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
return <Element ref={ref} {...elementProps} className={classes()} />
|
|
839
|
+
})
|
|
840
|
+
|
|
841
|
+
${upperName}Component.displayName = \`${name}.\${Dynamic}\`
|
|
842
|
+
return ${upperName}Component
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
function createFactory() {
|
|
846
|
+
const cache = new Map()
|
|
847
|
+
|
|
848
|
+
return new Proxy(Object.create(null), {
|
|
849
|
+
get(_, el) {
|
|
850
|
+
if (!cache.has(el)) {
|
|
851
|
+
cache.set(el, styled(el))
|
|
852
|
+
}
|
|
853
|
+
return cache.get(el)
|
|
854
|
+
},
|
|
855
|
+
})
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export const ${name} = createFactory();
|
|
859
|
+
`
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// src/generators/jsx/react-pattern.ts
|
|
864
|
+
init_esm_shims();
|
|
865
|
+
import { capitalize as capitalize4, dashCase as dashCase2 } from "@pandacss/shared";
|
|
866
|
+
import { outdent as outdent9 } from "outdent";
|
|
867
|
+
function generate2(name, pattern, jsxFactory) {
|
|
868
|
+
const upperName = capitalize4(name);
|
|
869
|
+
const jsxName = pattern.jsx ?? upperName;
|
|
870
|
+
const keys = Object.keys(pattern.properties ?? {});
|
|
871
|
+
return {
|
|
872
|
+
name: dashCase2(name),
|
|
873
|
+
js: outdent9`
|
|
874
|
+
import { forwardRef } from 'react'
|
|
875
|
+
import { ${jsxFactory} } from './factory'
|
|
876
|
+
import { config } from '../patterns/${dashCase2(name)}'
|
|
877
|
+
|
|
878
|
+
export const ${jsxName} = forwardRef(function ${jsxName}(props, ref) {
|
|
879
|
+
const { ${keys.join(", ")}, ...restProps } = props
|
|
880
|
+
const styleProps = config.transform({${keys.join(", ")}})
|
|
881
|
+
return <${jsxFactory}.div ref={ref} {...styleProps} {...restProps} />
|
|
882
|
+
})
|
|
883
|
+
`,
|
|
884
|
+
dts: outdent9`
|
|
885
|
+
import { ComponentProps, ElementType, PropsWithChildren } from 'react'
|
|
886
|
+
import { ${upperName}Options } from '../patterns/${dashCase2(name)}'
|
|
887
|
+
import { CssObject } from '../types'
|
|
888
|
+
|
|
889
|
+
type Merge<T, U> = Omit<T, keyof U> & U
|
|
890
|
+
type PropsOf<C extends ElementType> = ComponentProps<C>
|
|
891
|
+
type StyleProps = CssObject & { css?: CssObject }
|
|
892
|
+
|
|
893
|
+
type Polymorphic<C extends ElementType = 'div', P = {}> = StyleProps &
|
|
894
|
+
Merge<PropsWithChildren<PropsOf<C>>, P & { as?: C; color?: string }>
|
|
895
|
+
|
|
896
|
+
type ${jsxName}Props<C extends ElementType> = Polymorphic<C, ${upperName}Options>
|
|
897
|
+
|
|
898
|
+
export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
|
|
899
|
+
`
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
function generateReactJsxPattern(ctx) {
|
|
903
|
+
if (!ctx.hasPattern)
|
|
904
|
+
return [];
|
|
905
|
+
return Object.entries(ctx.patterns).map(([name, pattern]) => generate2(name, pattern, ctx.jsxFactory));
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/generators/jsx/solid-jsx.ts
|
|
909
|
+
init_esm_shims();
|
|
910
|
+
import { capitalize as capitalize5 } from "@pandacss/shared";
|
|
911
|
+
import { outdent as outdent10 } from "outdent";
|
|
912
|
+
function generateSolidJsxFactory(ctx) {
|
|
913
|
+
const name = ctx.jsxFactory;
|
|
914
|
+
const upperName = capitalize5(name);
|
|
915
|
+
return {
|
|
916
|
+
dts: outdent10`
|
|
917
|
+
import type { JSX } from 'solid-js'
|
|
918
|
+
import type { CssProperties, CssObject } from '../types'
|
|
919
|
+
|
|
920
|
+
type Element = keyof JSX.IntrinsicElements
|
|
921
|
+
|
|
922
|
+
type Merge<P, T> = Omit<P, 'color'> & T;
|
|
923
|
+
|
|
924
|
+
export type HTML${upperName}Props<T extends Element> = Merge<JSX.IntrinsicElements[T], CssProperties> & { css?: CssObject }
|
|
925
|
+
|
|
926
|
+
type JSXFactory = {
|
|
927
|
+
[K in Element]: (props: HTML${upperName}Props<K>) => JSX.Element
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
export declare const ${name}: JSXFactory
|
|
931
|
+
`,
|
|
932
|
+
js: outdent10`
|
|
933
|
+
import { Dynamic } from 'solid-js/web';
|
|
934
|
+
import { mergeProps, splitProps } from 'solid-js';
|
|
935
|
+
import { allCssProperties } from './is-valid-prop'
|
|
936
|
+
import { css } from '../css'
|
|
937
|
+
|
|
938
|
+
function cx(...args) {
|
|
939
|
+
return args.filter(Boolean).join(' ')
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
function styled(element) {
|
|
943
|
+
return function ${upperName}Component(props) {
|
|
944
|
+
const mergedProps = mergeProps({ as: element }, props)
|
|
945
|
+
|
|
946
|
+
const [localProps, styleProps, elementProps] = splitProps(
|
|
947
|
+
mergedProps,
|
|
948
|
+
['as', 'class', 'className'],
|
|
949
|
+
allCssProperties
|
|
950
|
+
)
|
|
951
|
+
|
|
952
|
+
const classes = () => {
|
|
953
|
+
const { css: cssStyles, ...otherStyles } = styleProps
|
|
954
|
+
const atomicClass = css({ ...otherStyles, ...cssStyles })
|
|
955
|
+
return cx(atomicClass, localProps.class, localProps.className)
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
return <Dynamic component={localProps.as} {...elementProps} class={classes()} />
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
function createFactory() {
|
|
963
|
+
const cache = new Map();
|
|
964
|
+
|
|
965
|
+
return new Proxy(Object.create(null), {
|
|
966
|
+
get(_, el) {
|
|
967
|
+
if (!cache.has(el)) {
|
|
968
|
+
cache.set(el, styled(el));
|
|
969
|
+
}
|
|
970
|
+
return cache.get(el);
|
|
971
|
+
},
|
|
972
|
+
})
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export const ${name} = createFactory();
|
|
976
|
+
`
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// src/generators/jsx/solid-pattern.ts
|
|
981
|
+
init_esm_shims();
|
|
982
|
+
import { capitalize as capitalize6, dashCase as dashCase3 } from "@pandacss/shared";
|
|
983
|
+
import { outdent as outdent11 } from "outdent";
|
|
984
|
+
function generate3(name, pattern, jsxFactory) {
|
|
985
|
+
const upperName = capitalize6(name);
|
|
986
|
+
const jsxName = pattern.jsx ?? upperName;
|
|
987
|
+
const keys = Object.keys(pattern.properties ?? {});
|
|
988
|
+
return {
|
|
989
|
+
name: dashCase3(name),
|
|
990
|
+
js: outdent11`
|
|
991
|
+
import { splitProps } from 'solid-js'
|
|
992
|
+
import { ${jsxFactory} } from './factory'
|
|
993
|
+
import { config } from '../patterns/${dashCase3(name)}'
|
|
994
|
+
|
|
995
|
+
export function ${jsxName}(props) {
|
|
996
|
+
const [patternProps, restProps] = splitProps(props, [${keys.map((v) => JSON.stringify(v)).join(", ")}]);
|
|
997
|
+
const styleProps = config.transform(patternProps)
|
|
998
|
+
return <${jsxFactory}.div {...styleProps} {...restProps} />
|
|
999
|
+
}
|
|
1000
|
+
`,
|
|
1001
|
+
dts: outdent11`
|
|
1002
|
+
import { ComponentProps, JSX } from 'solid-js'
|
|
1003
|
+
import { ${upperName}Options } from '../patterns/${dashCase3(name)}'
|
|
1004
|
+
import { CssObject } from '../types'
|
|
1005
|
+
|
|
1006
|
+
type ElementType = keyof JSX.IntrinsicElements
|
|
1007
|
+
type PropsOf<C extends ElementType> = ComponentProps<C>
|
|
1008
|
+
type StyleProps = CssObject & { css?: CssObject }
|
|
1009
|
+
type Merge<T, U> = Omit<T, keyof U> & U
|
|
1010
|
+
|
|
1011
|
+
type Polymorphic<C extends ElementType = 'div', P = {}> = StyleProps &
|
|
1012
|
+
Merge<PropsOf<C>, P & { as?: C; color?: string }>
|
|
1013
|
+
|
|
1014
|
+
type ${jsxName}Props<C extends ElementType> = Polymorphic<C, ${upperName}Options>
|
|
1015
|
+
|
|
1016
|
+
export declare function ${jsxName}<V extends ElementType>(props: ${jsxName}Props<V>): JSX.Element
|
|
1017
|
+
`
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
function generateSolidJsxPattern(ctx) {
|
|
1021
|
+
if (!ctx.hasPattern)
|
|
1022
|
+
return [];
|
|
1023
|
+
return Object.entries(ctx.patterns).map(([name, pattern]) => generate3(name, pattern, ctx.jsxFactory));
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
// src/generators/jsx/index.ts
|
|
1027
|
+
var factoryMap = {
|
|
1028
|
+
react: generateReactJsxFactory,
|
|
1029
|
+
solid: generateSolidJsxFactory,
|
|
1030
|
+
preact: generatePreactJsxFactory
|
|
1031
|
+
};
|
|
1032
|
+
function generateJsxFactory(ctx) {
|
|
1033
|
+
return factoryMap[ctx.jsxFramework](ctx);
|
|
1034
|
+
}
|
|
1035
|
+
var patternMap = {
|
|
1036
|
+
react: generateReactJsxPattern,
|
|
1037
|
+
solid: generateSolidJsxPattern,
|
|
1038
|
+
preact: generatePreactJsxPattern
|
|
1039
|
+
};
|
|
1040
|
+
function generateJsxPatterns(ctx) {
|
|
1041
|
+
return patternMap[ctx.jsxFramework](ctx);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// src/generators/pattern.ts
|
|
1045
|
+
init_esm_shims();
|
|
1046
|
+
import { capitalize as capitalize7, dashCase as dashCase4, unionType as unionType2 } from "@pandacss/shared";
|
|
1047
|
+
import { outdent as outdent12 } from "outdent";
|
|
1048
|
+
import { stringify as stringify2 } from "telejson";
|
|
1049
|
+
import { match } from "ts-pattern";
|
|
1050
|
+
function generate4(name, pattern) {
|
|
1051
|
+
const { properties, transform, strict } = pattern;
|
|
1052
|
+
return {
|
|
1053
|
+
name: dashCase4(name),
|
|
1054
|
+
dts: outdent12`
|
|
1055
|
+
import { CssObject, ConditionalValue } from "../types"
|
|
1056
|
+
import { Properties } from "../types/csstype"
|
|
1057
|
+
import { Tokens } from "../types/token"
|
|
1058
|
+
|
|
1059
|
+
export type ${capitalize7(name)}Options = {
|
|
1060
|
+
${Object.keys(properties ?? {}).map((key) => {
|
|
1061
|
+
const value = properties[key];
|
|
1062
|
+
return match(value).with({ type: "property" }, (value2) => {
|
|
1063
|
+
return `${key}?: CssObject["${value2.value}"]`;
|
|
1064
|
+
}).with({ type: "token" }, (value2) => {
|
|
1065
|
+
if (value2.property) {
|
|
1066
|
+
return `${key}?: ConditionalValue<Tokens["${value2.value}"] | Properties["${value2.property}"]>`;
|
|
1067
|
+
}
|
|
1068
|
+
return `${key}?: ConditionalValue<Tokens["${value2.value}"]>`;
|
|
1069
|
+
}).with({ type: "enum" }, (value2) => {
|
|
1070
|
+
return `${key}?: ConditionalValue<${unionType2(value2.value)}>`;
|
|
1071
|
+
}).otherwise(() => {
|
|
1072
|
+
return `${key}?: ConditionalValue<${value.type}>`;
|
|
1073
|
+
});
|
|
1074
|
+
}).join("\n ")}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
${strict ? outdent12`export declare function ${name}(options: ${capitalize7(name)}Options): string` : outdent12`
|
|
1078
|
+
type Merge<T> = Omit<CssObject, keyof T> & T
|
|
1079
|
+
export declare function ${name}(options: Merge<${capitalize7(name)}Options>): string
|
|
1080
|
+
`}
|
|
1081
|
+
|
|
1082
|
+
`,
|
|
1083
|
+
js: outdent12`
|
|
1084
|
+
import { mapObject } from "../helpers"
|
|
1085
|
+
import { css } from "../css"
|
|
1086
|
+
|
|
1087
|
+
export const config = ${stringify2({ transform })}
|
|
1088
|
+
|
|
1089
|
+
export const ${name} = (styles) => css(config.transform(styles, { map: mapObject }))
|
|
1090
|
+
`.replace(/"_function_([^|]*)\|(.*)"/, "$2").replace(/\\"/g, '"').replace("return", "; return").replace(";;", ";")
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
function generatePattern(ctx) {
|
|
1094
|
+
if (!ctx.hasPattern)
|
|
1095
|
+
return;
|
|
1096
|
+
return Object.entries(ctx.patterns).map(([name, pattern]) => generate4(name, pattern));
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// src/generators/prop-types.ts
|
|
1100
|
+
init_esm_shims();
|
|
1101
|
+
import { outdent as outdent13 } from "outdent";
|
|
1102
|
+
function generatePropTypes(utility) {
|
|
1103
|
+
const result = [
|
|
1104
|
+
outdent13`
|
|
1105
|
+
import { Properties as CSSProperties } from "./csstype"
|
|
1106
|
+
|
|
1107
|
+
type BasePropTypes = {`
|
|
1108
|
+
];
|
|
1109
|
+
const types = utility.getTypes();
|
|
1110
|
+
for (const [prop, values] of types.entries()) {
|
|
1111
|
+
result.push(` ${prop}: ${values.join(" | ")};`);
|
|
1112
|
+
}
|
|
1113
|
+
result.push("}", "\n");
|
|
1114
|
+
result.push(`
|
|
1115
|
+
type CssProp<T> = T extends keyof CSSProperties ? CSSProperties[T] : (string & {})
|
|
1116
|
+
|
|
1117
|
+
type BaseProp<T> = T extends keyof BasePropTypes ? BasePropTypes[T] : (string & {})
|
|
1118
|
+
|
|
1119
|
+
type Shorthand<T> = CssProp<T> | BaseProp<T>
|
|
1120
|
+
|
|
1121
|
+
export type PropTypes = BasePropTypes & {
|
|
1122
|
+
`);
|
|
1123
|
+
utility.shorthands.forEach((value, key) => {
|
|
1124
|
+
result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
|
|
1125
|
+
});
|
|
1126
|
+
result.push("}");
|
|
1127
|
+
return result.join("\n");
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
// src/generators/recipe.ts
|
|
1131
|
+
init_esm_shims();
|
|
1132
|
+
import { capitalize as capitalize8, unionType as unionType3 } from "@pandacss/shared";
|
|
1133
|
+
import { outdent as outdent14 } from "outdent";
|
|
1134
|
+
function generateRecipes(ctx) {
|
|
1135
|
+
const { recipes = {}, hash, hasRecipes, utility } = ctx;
|
|
1136
|
+
const { separator } = utility;
|
|
1137
|
+
if (!hasRecipes)
|
|
1138
|
+
return;
|
|
1139
|
+
const js = [
|
|
1140
|
+
outdent14`
|
|
1141
|
+
import { createCss, withoutSpace } from "../helpers"
|
|
1142
|
+
|
|
1143
|
+
const createRecipe = (name) => {
|
|
1144
|
+
return (styles) => {
|
|
1145
|
+
const transform = (prop, value) => {
|
|
1146
|
+
if (value === '__ignore__') {
|
|
1147
|
+
return { className: name }
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
value = withoutSpace(value)
|
|
1151
|
+
return { className: \`\${name}--\${prop}${separator}\${value}\` }
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
const context = ${hash ? "{ transform, hash: true }" : "{ transform }"}
|
|
1155
|
+
const css = createCss(context)
|
|
1156
|
+
|
|
1157
|
+
return css({ [name]: '__ignore__' , ...styles })
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
`
|
|
1161
|
+
];
|
|
1162
|
+
const dts = [""];
|
|
1163
|
+
Object.values(recipes).forEach((recipe) => {
|
|
1164
|
+
js.push(outdent14`
|
|
1165
|
+
export const ${recipe.name} = createRecipe('${recipe.name}')
|
|
1166
|
+
`);
|
|
1167
|
+
dts.push(outdent14`
|
|
1168
|
+
import { ConditionalValue } from "../types"
|
|
1169
|
+
|
|
1170
|
+
export type ${capitalize8(recipe.name)}Value = {
|
|
1171
|
+
${Object.keys(recipe.variants ?? {}).map((key) => {
|
|
1172
|
+
const value = recipe.variants[key];
|
|
1173
|
+
const keys = Object.keys(value);
|
|
1174
|
+
return `${key}?: ConditionalValue<${unionType3(keys)}>`;
|
|
1175
|
+
}).join("\n")}
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
export declare function ${recipe.name}(value: ${capitalize8(recipe.name)}Value): string
|
|
1179
|
+
`);
|
|
1180
|
+
});
|
|
1181
|
+
return {
|
|
1182
|
+
js: outdent14.string(js.join("\n\n")),
|
|
1183
|
+
dts: outdent14.string(dts.join("\n\n"))
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
// src/generators/reset.ts
|
|
1188
|
+
init_esm_shims();
|
|
1189
|
+
var css = (v) => v[0];
|
|
1190
|
+
var reset = css`
|
|
1191
|
+
* {
|
|
1192
|
+
margin: 0;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
*,
|
|
1196
|
+
*::before,
|
|
1197
|
+
*::after {
|
|
1198
|
+
box-sizing: border-box;
|
|
1199
|
+
border-width: 0;
|
|
1200
|
+
border-style: solid;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
html,
|
|
1204
|
+
body {
|
|
1205
|
+
height: 100%;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
body {
|
|
1209
|
+
line-height: 1.5;
|
|
1210
|
+
-webkit-text-size-adjust: 100%;
|
|
1211
|
+
-webkit-font-smoothing: antialiased;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
img {
|
|
1215
|
+
border-style: none;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
img,
|
|
1219
|
+
picture,
|
|
1220
|
+
video,
|
|
1221
|
+
canvas,
|
|
1222
|
+
svg {
|
|
1223
|
+
display: block;
|
|
1224
|
+
max-width: 100%;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
input,
|
|
1228
|
+
button,
|
|
1229
|
+
textarea,
|
|
1230
|
+
select {
|
|
1231
|
+
font: inherit;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
p,
|
|
1235
|
+
h1,
|
|
1236
|
+
h2,
|
|
1237
|
+
h3,
|
|
1238
|
+
h4,
|
|
1239
|
+
h5,
|
|
1240
|
+
h6 {
|
|
1241
|
+
overflow-wrap: break-word;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
::-webkit-search-decoration {
|
|
1245
|
+
-webkit-appearance: none;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
::-webkit-file-upload-button {
|
|
1249
|
+
-webkit-appearance: button;
|
|
1250
|
+
font: inherit;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
::-webkit-inner-spin-button,
|
|
1254
|
+
::-webkit-outer-spin-button {
|
|
1255
|
+
height: auto;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
code,
|
|
1259
|
+
kbd,
|
|
1260
|
+
pre,
|
|
1261
|
+
samp {
|
|
1262
|
+
font-size: 1em;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
table {
|
|
1266
|
+
border-collapse: collapse;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
textarea {
|
|
1270
|
+
resize: vertical;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
sub {
|
|
1274
|
+
bottom: -0.25em;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
sup {
|
|
1278
|
+
top: -0.5em;
|
|
1279
|
+
}
|
|
1280
|
+
`;
|
|
1281
|
+
function generateReset() {
|
|
1282
|
+
return `@layer reset {
|
|
1283
|
+
${reset}
|
|
1284
|
+
}`;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// src/generators/token-css.ts
|
|
1288
|
+
init_esm_shims();
|
|
1289
|
+
import { toCss, toKeyframeCss } from "@pandacss/core";
|
|
1290
|
+
import { outdent as outdent15 } from "outdent";
|
|
1291
|
+
import { match as match2, P } from "ts-pattern";
|
|
1292
|
+
function generateKeyframes(keyframes) {
|
|
1293
|
+
if (keyframes) {
|
|
1294
|
+
return toKeyframeCss(keyframes);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
var getConditionMessage = (value) => outdent15`
|
|
1298
|
+
It seems you provided an invalid condition for semantic tokens.
|
|
1299
|
+
|
|
1300
|
+
- You provided: \`${value}\`
|
|
1301
|
+
|
|
1302
|
+
Valid conditions are those that reference a parent selectors or at-rules.
|
|
1303
|
+
@media (min-width: 768px), or .dark &
|
|
1304
|
+
`;
|
|
1305
|
+
function generateTokenCss(ctx, varRoot) {
|
|
1306
|
+
const root = varRoot ?? ctx.cssVarRoot;
|
|
1307
|
+
const conditions = ctx.conditions;
|
|
1308
|
+
const results = [];
|
|
1309
|
+
for (const [key, values] of ctx.tokens.vars.entries()) {
|
|
1310
|
+
const varsObj = Object.fromEntries(values);
|
|
1311
|
+
if (Object.keys(varsObj).length === 0)
|
|
1312
|
+
continue;
|
|
1313
|
+
if (key === "base") {
|
|
1314
|
+
const { css: css3 } = toCss({ [root]: varsObj });
|
|
1315
|
+
results.push(css3);
|
|
1316
|
+
} else {
|
|
1317
|
+
const cond = conditions.normalize(key);
|
|
1318
|
+
const css3 = match2(cond).with({ type: "parent-nesting" }, (cond2) => {
|
|
1319
|
+
const selector = cond2.value.replace(/\s&/g, "");
|
|
1320
|
+
const { css: css4 } = toCss(varsObj);
|
|
1321
|
+
return `${selector} {
|
|
1322
|
+
${css4};
|
|
1323
|
+
}`;
|
|
1324
|
+
}).with({ type: "at-rule" }, (cond2) => {
|
|
1325
|
+
const selector = cond2.rawValue;
|
|
1326
|
+
const { css: css4 } = toCss(varsObj);
|
|
1327
|
+
return `${selector} {
|
|
1328
|
+
${root} {
|
|
1329
|
+
${css4};
|
|
1330
|
+
}
|
|
1331
|
+
}`;
|
|
1332
|
+
}).with(P.nullish, () => {
|
|
1333
|
+
}).otherwise((cond2) => {
|
|
1334
|
+
if (cond2) {
|
|
1335
|
+
throw new Error(getConditionMessage(cond2.raw));
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1338
|
+
if (css3) {
|
|
1339
|
+
results.push(css3);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
const css2 = results.join("\n\n") + "\n\n";
|
|
1344
|
+
return `@layer tokens {
|
|
1345
|
+
${css2}
|
|
1346
|
+
}
|
|
1347
|
+
`;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
// src/generators/token-dts.ts
|
|
1351
|
+
init_esm_shims();
|
|
1352
|
+
import { unionType as unionType4, capitalize as capitalize9 } from "@pandacss/shared";
|
|
1353
|
+
import { outdent as outdent16 } from "outdent";
|
|
1354
|
+
import { singular } from "pluralize";
|
|
1355
|
+
function generateTokenDts(dict) {
|
|
1356
|
+
const set = /* @__PURE__ */ new Set();
|
|
1357
|
+
set.add(`export type Token = ${dict.isEmpty ? "string" : unionType4(dict.allNames)}`);
|
|
1358
|
+
const interfaceSet = /* @__PURE__ */ new Set(["export interface Tokens {"]);
|
|
1359
|
+
if (dict.isEmpty) {
|
|
1360
|
+
interfaceSet.add("[token: string]: string");
|
|
1361
|
+
} else {
|
|
1362
|
+
for (const [key, value] of dict.categoryMap.entries()) {
|
|
1363
|
+
const typeName = capitalize9(singular(key));
|
|
1364
|
+
set.add(`export type ${typeName} = ${unionType4(value.keys())}`);
|
|
1365
|
+
set.add(`export type Palette = ${unionType4(Object.keys(dict.palettes))}`);
|
|
1366
|
+
interfaceSet.add(` ${key}: ${typeName}`);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
interfaceSet.add("}");
|
|
1370
|
+
set.add(Array.from(interfaceSet).join("\n"));
|
|
1371
|
+
return outdent16.string(Array.from(set).join("\n\n"));
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// src/generators/token-js.ts
|
|
1375
|
+
init_esm_shims();
|
|
1376
|
+
import outdent17 from "outdent";
|
|
1377
|
+
function generateTokenJs(dict) {
|
|
1378
|
+
const map = /* @__PURE__ */ new Map();
|
|
1379
|
+
dict.allTokens.forEach((token) => {
|
|
1380
|
+
const { varRef } = token.extensions;
|
|
1381
|
+
const value = token.isConditional ? varRef : token.value;
|
|
1382
|
+
map.set(token.name, { value, variable: varRef });
|
|
1383
|
+
});
|
|
1384
|
+
const obj = Object.fromEntries(map);
|
|
1385
|
+
return {
|
|
1386
|
+
js: outdent17`
|
|
1387
|
+
const tokens = ${JSON.stringify(obj, null, 2)}
|
|
1388
|
+
|
|
1389
|
+
function getToken(path) {
|
|
1390
|
+
const { value } = tokens[path] || {}
|
|
1391
|
+
return value
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
function getTokenVar(path) {
|
|
1395
|
+
const { variable } = tokens[path] || {}
|
|
1396
|
+
return variable
|
|
1397
|
+
}
|
|
1398
|
+
`,
|
|
1399
|
+
dts: outdent17`
|
|
1400
|
+
import { Token } from "../types/token"
|
|
1401
|
+
export declare function getToken(path: Token): string
|
|
1402
|
+
export declare function getTokenVar(path: Token): string
|
|
1403
|
+
`
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
// src/generators/types.ts
|
|
1408
|
+
init_esm_shims();
|
|
1409
|
+
import { readFileSync as readFileSync2 } from "fs-extra";
|
|
1410
|
+
import outdent18 from "outdent";
|
|
1411
|
+
function getType(file) {
|
|
1412
|
+
const filepath = getEntrypoint("@pandacss/types", { dev: file });
|
|
1413
|
+
return readFileSync2(filepath, "utf8");
|
|
1414
|
+
}
|
|
1415
|
+
function generateCssType(ctx) {
|
|
1416
|
+
const strict = ctx.strictTokens;
|
|
1417
|
+
return {
|
|
1418
|
+
cssType: getType("csstype.d.ts"),
|
|
1419
|
+
pandaCssType: getType("panda-csstype.d.ts"),
|
|
1420
|
+
publicType: outdent18`
|
|
1421
|
+
import { PandaCssObject, PandaConditionalValue, ConditionCssProperties } from './panda-csstype'
|
|
1422
|
+
import { PropTypes } from './prop-type'
|
|
1423
|
+
import { Conditions } from './conditions'
|
|
1424
|
+
|
|
1425
|
+
export type CssObject = ${strict ? "PandaCssObject<Conditions, PropTypes, true>" : "PandaCssObject<Conditions, PropTypes>"}
|
|
1426
|
+
|
|
1427
|
+
export type ConditionalValue<Value> = PandaConditionalValue<Conditions, Value>
|
|
1428
|
+
|
|
1429
|
+
export type CssProperties = ${strict ? "ConditionCssProperties<Conditions, PropTypes, true>" : "ConditionCssProperties<Conditions, PropTypes>"}
|
|
1430
|
+
`
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
// src/generators/index.ts
|
|
1435
|
+
function setupHelpers(ctx) {
|
|
1436
|
+
const sharedMjs = getEntrypoint("@pandacss/shared", { dev: "shared.mjs" });
|
|
1437
|
+
const code = readFileSync3(sharedMjs, "utf-8");
|
|
1438
|
+
return {
|
|
1439
|
+
dir: ctx.outdir,
|
|
1440
|
+
files: [{ file: "helpers.js", code }]
|
|
1441
|
+
};
|
|
1442
|
+
}
|
|
1443
|
+
function setupKeyframes(ctx) {
|
|
1444
|
+
const code = generateKeyframes(ctx.keyframes);
|
|
1445
|
+
return {
|
|
1446
|
+
dir: ctx.paths.token,
|
|
1447
|
+
files: [{ file: "keyframes.css", code }]
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
function setupDesignTokens(ctx) {
|
|
1451
|
+
if (ctx.tokens.isEmpty) {
|
|
1452
|
+
return { files: [] };
|
|
1453
|
+
}
|
|
1454
|
+
const code = generateTokenJs(ctx.tokens);
|
|
1455
|
+
const css2 = generateTokenCss(ctx);
|
|
1456
|
+
return {
|
|
1457
|
+
dir: ctx.paths.token,
|
|
1458
|
+
files: [
|
|
1459
|
+
{ file: "index.css", code: css2 },
|
|
1460
|
+
{ file: "index.d.ts", code: code.dts },
|
|
1461
|
+
{ file: "index.js", code: code.js }
|
|
1462
|
+
]
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
function setupGlobalCss(ctx) {
|
|
1466
|
+
const code = generateGlobalCss();
|
|
1467
|
+
return {
|
|
1468
|
+
dir: ctx.paths.css,
|
|
1469
|
+
files: [
|
|
1470
|
+
{ file: "global-css.js", code: code.js },
|
|
1471
|
+
{ file: "global-css.d.ts", code: code.dts }
|
|
1472
|
+
]
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
function setupTypes(ctx) {
|
|
1476
|
+
const code = generateCssType(ctx);
|
|
1477
|
+
const conditions = generateConditions(ctx);
|
|
1478
|
+
return {
|
|
1479
|
+
dir: ctx.paths.types,
|
|
1480
|
+
files: [
|
|
1481
|
+
{ file: "csstype.d.ts", code: code.cssType },
|
|
1482
|
+
{ file: "panda-csstype.d.ts", code: code.pandaCssType },
|
|
1483
|
+
{ file: "index.d.ts", code: code.publicType },
|
|
1484
|
+
{ file: "token.d.ts", code: generateTokenDts(ctx.tokens) },
|
|
1485
|
+
{ file: "prop-type.d.ts", code: generatePropTypes(ctx.utility) },
|
|
1486
|
+
{ file: "conditions.d.ts", code: conditions.dts }
|
|
1487
|
+
]
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
function setupCss(ctx) {
|
|
1491
|
+
const code = generateCssFn(ctx);
|
|
1492
|
+
const conditions = generateConditions(ctx);
|
|
1493
|
+
return {
|
|
1494
|
+
dir: ctx.paths.css,
|
|
1495
|
+
files: [
|
|
1496
|
+
{ file: "conditions.js", code: conditions.js },
|
|
1497
|
+
{ file: "css.js", code: code.js },
|
|
1498
|
+
{ file: "css.d.ts", code: code.dts }
|
|
1499
|
+
]
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
function setupCssMap(ctx) {
|
|
1503
|
+
const code = generateCssMap();
|
|
1504
|
+
return {
|
|
1505
|
+
dir: ctx.paths.css,
|
|
1506
|
+
files: [
|
|
1507
|
+
{ file: "css-map.js", code: code.js },
|
|
1508
|
+
{ file: "css-map.d.ts", code: code.dts }
|
|
1509
|
+
]
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
function setupCx(ctx) {
|
|
1513
|
+
const code = generateCx();
|
|
1514
|
+
return {
|
|
1515
|
+
dir: ctx.paths.css,
|
|
1516
|
+
files: [
|
|
1517
|
+
{ file: "cx.js", code: code.js },
|
|
1518
|
+
{ file: "cx.d.ts", code: code.dts }
|
|
1519
|
+
]
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
function setupRecipes(ctx) {
|
|
1523
|
+
const code = generateRecipes(ctx);
|
|
1524
|
+
if (!code) {
|
|
1525
|
+
return { files: [] };
|
|
1526
|
+
}
|
|
1527
|
+
return {
|
|
1528
|
+
dir: ctx.paths.recipe,
|
|
1529
|
+
files: [
|
|
1530
|
+
{ file: "index.js", code: code.js },
|
|
1531
|
+
{ file: "index.d.ts", code: code.dts }
|
|
1532
|
+
]
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
function setupPatterns(ctx) {
|
|
1536
|
+
const files = generatePattern(ctx);
|
|
1537
|
+
if (!files) {
|
|
1538
|
+
return { files: [] };
|
|
1539
|
+
}
|
|
1540
|
+
const indexCode = outdent19.string(files.map((file) => `export * from './${file.name}'`).join("\n"));
|
|
1541
|
+
return {
|
|
1542
|
+
dir: ctx.paths.pattern,
|
|
1543
|
+
files: [
|
|
1544
|
+
...files.map((file) => ({ file: `${file.name}.js`, code: file.js })),
|
|
1545
|
+
...files.map((file) => ({ file: `${file.name}.d.ts`, code: file.dts })),
|
|
1546
|
+
{ file: "index.js", code: indexCode },
|
|
1547
|
+
{ file: "index.d.ts", code: indexCode }
|
|
1548
|
+
]
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
function setupJsx(ctx) {
|
|
1552
|
+
if (!ctx.jsxFramework)
|
|
1553
|
+
return { files: [] };
|
|
1554
|
+
const isValidProp = generateisValidProp(ctx);
|
|
1555
|
+
const factory = generateJsxFactory(ctx);
|
|
1556
|
+
const patterns = generateJsxPatterns(ctx);
|
|
1557
|
+
const indexCode = outdent19`
|
|
1558
|
+
export * from './factory'
|
|
1559
|
+
${outdent19.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
|
|
1560
|
+
`;
|
|
1561
|
+
return {
|
|
1562
|
+
dir: ctx.paths.jsx,
|
|
1563
|
+
files: [
|
|
1564
|
+
...patterns.map((file) => ({ file: `${file.name}.jsx`, code: file.js })),
|
|
1565
|
+
...patterns.map((file) => ({ file: `${file.name}.d.ts`, code: file.dts })),
|
|
1566
|
+
{ file: "is-valid-prop.js", code: isValidProp.js },
|
|
1567
|
+
{ file: "factory.d.ts", code: factory.dts },
|
|
1568
|
+
{ file: "factory.jsx", code: factory.js },
|
|
1569
|
+
{ file: "index.d.ts", code: indexCode },
|
|
1570
|
+
{ file: "index.jsx", code: indexCode }
|
|
1571
|
+
]
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
function setupCssIndex(ctx) {
|
|
1575
|
+
const code = outdent19`
|
|
1576
|
+
export * from './css'
|
|
1577
|
+
export * from './cx'
|
|
1578
|
+
export * from './global-css'
|
|
1579
|
+
export * from './css-map'
|
|
1580
|
+
`;
|
|
1581
|
+
return {
|
|
1582
|
+
dir: ctx.paths.css,
|
|
1583
|
+
files: [
|
|
1584
|
+
{ file: "index.js", code },
|
|
1585
|
+
{ file: "index.d.ts", code }
|
|
1586
|
+
]
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
function setupReset(ctx) {
|
|
1590
|
+
if (!ctx.preflight)
|
|
1591
|
+
return { files: [] };
|
|
1592
|
+
const code = generateReset();
|
|
1593
|
+
return { files: [{ file: "reset.css", code }] };
|
|
1594
|
+
}
|
|
1595
|
+
function setupGitIgnore(ctx) {
|
|
1596
|
+
const txt = outdent19`## CSS Panda
|
|
1597
|
+
${ctx.outdir}
|
|
1598
|
+
`;
|
|
1599
|
+
const file = lookItUpSync(".gitignore");
|
|
1600
|
+
if (!file)
|
|
1601
|
+
return {
|
|
1602
|
+
dir: ctx.cwd,
|
|
1603
|
+
files: [{ file: ".gitignore", code: txt }]
|
|
1604
|
+
};
|
|
1605
|
+
let content = readFileSync3(file, "utf-8");
|
|
1606
|
+
if (!content.includes(ctx.outdir)) {
|
|
1607
|
+
content += txt;
|
|
1608
|
+
}
|
|
1609
|
+
return {
|
|
1610
|
+
dir: dirname2(file),
|
|
1611
|
+
files: [{ file: ".gitignore", code: content }]
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1614
|
+
function generateSystem(ctx) {
|
|
1615
|
+
return [
|
|
1616
|
+
setupHelpers(ctx),
|
|
1617
|
+
setupDesignTokens(ctx),
|
|
1618
|
+
setupKeyframes(ctx),
|
|
1619
|
+
setupTypes(ctx),
|
|
1620
|
+
setupCssMap(ctx),
|
|
1621
|
+
setupCx(ctx),
|
|
1622
|
+
setupCss(ctx),
|
|
1623
|
+
setupGlobalCss(ctx),
|
|
1624
|
+
setupRecipes(ctx),
|
|
1625
|
+
setupPatterns(ctx),
|
|
1626
|
+
setupCssIndex(ctx),
|
|
1627
|
+
setupJsx(ctx),
|
|
1628
|
+
setupReset(ctx),
|
|
1629
|
+
setupGitIgnore(ctx)
|
|
1630
|
+
];
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
// src/messages.ts
|
|
1634
|
+
init_esm_shims();
|
|
1635
|
+
import { colors, quote as quote2 } from "@pandacss/logger";
|
|
1636
|
+
import { outdent as outdent20 } from "outdent";
|
|
1637
|
+
|
|
1638
|
+
// src/cli-box.ts
|
|
1639
|
+
init_esm_shims();
|
|
1640
|
+
|
|
1641
|
+
// ../../node_modules/.pnpm/boxen@7.0.0/node_modules/boxen/index.js
|
|
1642
|
+
init_esm_shims();
|
|
1643
|
+
import process3 from "node:process";
|
|
1644
|
+
|
|
1645
|
+
// ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js
|
|
1646
|
+
init_esm_shims();
|
|
1647
|
+
|
|
1648
|
+
// ../../node_modules/.pnpm/strip-ansi@7.0.1/node_modules/strip-ansi/index.js
|
|
1649
|
+
init_esm_shims();
|
|
1650
|
+
|
|
1651
|
+
// ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
|
|
1652
|
+
init_esm_shims();
|
|
1653
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
1654
|
+
const pattern = [
|
|
1655
|
+
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
1656
|
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
1657
|
+
].join("|");
|
|
1658
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
// ../../node_modules/.pnpm/strip-ansi@7.0.1/node_modules/strip-ansi/index.js
|
|
1662
|
+
function stripAnsi(string) {
|
|
1663
|
+
if (typeof string !== "string") {
|
|
1664
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
1665
|
+
}
|
|
1666
|
+
return string.replace(ansiRegex(), "");
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
// ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js
|
|
1670
|
+
var import_eastasianwidth = __toESM(require_eastasianwidth(), 1);
|
|
1671
|
+
var import_emoji_regex = __toESM(require_emoji_regex(), 1);
|
|
1672
|
+
function stringWidth(string, options = {}) {
|
|
1673
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
1674
|
+
return 0;
|
|
1675
|
+
}
|
|
1676
|
+
options = {
|
|
1677
|
+
ambiguousIsNarrow: true,
|
|
1678
|
+
...options
|
|
1679
|
+
};
|
|
1680
|
+
string = stripAnsi(string);
|
|
1681
|
+
if (string.length === 0) {
|
|
1682
|
+
return 0;
|
|
1683
|
+
}
|
|
1684
|
+
string = string.replace((0, import_emoji_regex.default)(), " ");
|
|
1685
|
+
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
|
|
1686
|
+
let width = 0;
|
|
1687
|
+
for (const character of string) {
|
|
1688
|
+
const codePoint = character.codePointAt(0);
|
|
1689
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
1690
|
+
continue;
|
|
1691
|
+
}
|
|
1692
|
+
if (codePoint >= 768 && codePoint <= 879) {
|
|
1693
|
+
continue;
|
|
1694
|
+
}
|
|
1695
|
+
const code = import_eastasianwidth.default.eastAsianWidth(character);
|
|
1696
|
+
switch (code) {
|
|
1697
|
+
case "F":
|
|
1698
|
+
case "W":
|
|
1699
|
+
width += 2;
|
|
1700
|
+
break;
|
|
1701
|
+
case "A":
|
|
1702
|
+
width += ambiguousCharacterWidth;
|
|
1703
|
+
break;
|
|
1704
|
+
default:
|
|
1705
|
+
width += 1;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
return width;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
// ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/index.js
|
|
1712
|
+
init_esm_shims();
|
|
1713
|
+
|
|
1714
|
+
// ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
1715
|
+
init_esm_shims();
|
|
1716
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
1717
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
1718
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
1719
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
1720
|
+
function assembleStyles() {
|
|
1721
|
+
const codes = /* @__PURE__ */ new Map();
|
|
1722
|
+
const styles2 = {
|
|
1723
|
+
modifier: {
|
|
1724
|
+
reset: [0, 0],
|
|
1725
|
+
bold: [1, 22],
|
|
1726
|
+
dim: [2, 22],
|
|
1727
|
+
italic: [3, 23],
|
|
1728
|
+
underline: [4, 24],
|
|
1729
|
+
overline: [53, 55],
|
|
1730
|
+
inverse: [7, 27],
|
|
1731
|
+
hidden: [8, 28],
|
|
1732
|
+
strikethrough: [9, 29]
|
|
1733
|
+
},
|
|
1734
|
+
color: {
|
|
1735
|
+
black: [30, 39],
|
|
1736
|
+
red: [31, 39],
|
|
1737
|
+
green: [32, 39],
|
|
1738
|
+
yellow: [33, 39],
|
|
1739
|
+
blue: [34, 39],
|
|
1740
|
+
magenta: [35, 39],
|
|
1741
|
+
cyan: [36, 39],
|
|
1742
|
+
white: [37, 39],
|
|
1743
|
+
blackBright: [90, 39],
|
|
1744
|
+
redBright: [91, 39],
|
|
1745
|
+
greenBright: [92, 39],
|
|
1746
|
+
yellowBright: [93, 39],
|
|
1747
|
+
blueBright: [94, 39],
|
|
1748
|
+
magentaBright: [95, 39],
|
|
1749
|
+
cyanBright: [96, 39],
|
|
1750
|
+
whiteBright: [97, 39]
|
|
1751
|
+
},
|
|
1752
|
+
bgColor: {
|
|
1753
|
+
bgBlack: [40, 49],
|
|
1754
|
+
bgRed: [41, 49],
|
|
1755
|
+
bgGreen: [42, 49],
|
|
1756
|
+
bgYellow: [43, 49],
|
|
1757
|
+
bgBlue: [44, 49],
|
|
1758
|
+
bgMagenta: [45, 49],
|
|
1759
|
+
bgCyan: [46, 49],
|
|
1760
|
+
bgWhite: [47, 49],
|
|
1761
|
+
bgBlackBright: [100, 49],
|
|
1762
|
+
bgRedBright: [101, 49],
|
|
1763
|
+
bgGreenBright: [102, 49],
|
|
1764
|
+
bgYellowBright: [103, 49],
|
|
1765
|
+
bgBlueBright: [104, 49],
|
|
1766
|
+
bgMagentaBright: [105, 49],
|
|
1767
|
+
bgCyanBright: [106, 49],
|
|
1768
|
+
bgWhiteBright: [107, 49]
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
styles2.color.gray = styles2.color.blackBright;
|
|
1772
|
+
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
1773
|
+
styles2.color.grey = styles2.color.blackBright;
|
|
1774
|
+
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
1775
|
+
for (const [groupName, group] of Object.entries(styles2)) {
|
|
1776
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
1777
|
+
styles2[styleName] = {
|
|
1778
|
+
open: `\x1B[${style[0]}m`,
|
|
1779
|
+
close: `\x1B[${style[1]}m`
|
|
1780
|
+
};
|
|
1781
|
+
group[styleName] = styles2[styleName];
|
|
1782
|
+
codes.set(style[0], style[1]);
|
|
1783
|
+
}
|
|
1784
|
+
Object.defineProperty(styles2, groupName, {
|
|
1785
|
+
value: group,
|
|
1786
|
+
enumerable: false
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1789
|
+
Object.defineProperty(styles2, "codes", {
|
|
1790
|
+
value: codes,
|
|
1791
|
+
enumerable: false
|
|
1792
|
+
});
|
|
1793
|
+
styles2.color.close = "\x1B[39m";
|
|
1794
|
+
styles2.bgColor.close = "\x1B[49m";
|
|
1795
|
+
styles2.color.ansi = wrapAnsi16();
|
|
1796
|
+
styles2.color.ansi256 = wrapAnsi256();
|
|
1797
|
+
styles2.color.ansi16m = wrapAnsi16m();
|
|
1798
|
+
styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
1799
|
+
styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
1800
|
+
styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
1801
|
+
Object.defineProperties(styles2, {
|
|
1802
|
+
rgbToAnsi256: {
|
|
1803
|
+
value: (red, green, blue) => {
|
|
1804
|
+
if (red === green && green === blue) {
|
|
1805
|
+
if (red < 8) {
|
|
1806
|
+
return 16;
|
|
1807
|
+
}
|
|
1808
|
+
if (red > 248) {
|
|
1809
|
+
return 231;
|
|
1810
|
+
}
|
|
1811
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
1812
|
+
}
|
|
1813
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
1814
|
+
},
|
|
1815
|
+
enumerable: false
|
|
1816
|
+
},
|
|
1817
|
+
hexToRgb: {
|
|
1818
|
+
value: (hex) => {
|
|
1819
|
+
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
|
1820
|
+
if (!matches) {
|
|
1821
|
+
return [0, 0, 0];
|
|
1822
|
+
}
|
|
1823
|
+
let { colorString } = matches.groups;
|
|
1824
|
+
if (colorString.length === 3) {
|
|
1825
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
1826
|
+
}
|
|
1827
|
+
const integer = Number.parseInt(colorString, 16);
|
|
1828
|
+
return [
|
|
1829
|
+
integer >> 16 & 255,
|
|
1830
|
+
integer >> 8 & 255,
|
|
1831
|
+
integer & 255
|
|
1832
|
+
];
|
|
1833
|
+
},
|
|
1834
|
+
enumerable: false
|
|
1835
|
+
},
|
|
1836
|
+
hexToAnsi256: {
|
|
1837
|
+
value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
|
|
1838
|
+
enumerable: false
|
|
1839
|
+
},
|
|
1840
|
+
ansi256ToAnsi: {
|
|
1841
|
+
value: (code) => {
|
|
1842
|
+
if (code < 8) {
|
|
1843
|
+
return 30 + code;
|
|
1844
|
+
}
|
|
1845
|
+
if (code < 16) {
|
|
1846
|
+
return 90 + (code - 8);
|
|
1847
|
+
}
|
|
1848
|
+
let red;
|
|
1849
|
+
let green;
|
|
1850
|
+
let blue;
|
|
1851
|
+
if (code >= 232) {
|
|
1852
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
1853
|
+
green = red;
|
|
1854
|
+
blue = red;
|
|
1855
|
+
} else {
|
|
1856
|
+
code -= 16;
|
|
1857
|
+
const remainder = code % 36;
|
|
1858
|
+
red = Math.floor(code / 36) / 5;
|
|
1859
|
+
green = Math.floor(remainder / 6) / 5;
|
|
1860
|
+
blue = remainder % 6 / 5;
|
|
1861
|
+
}
|
|
1862
|
+
const value = Math.max(red, green, blue) * 2;
|
|
1863
|
+
if (value === 0) {
|
|
1864
|
+
return 30;
|
|
1865
|
+
}
|
|
1866
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
1867
|
+
if (value === 2) {
|
|
1868
|
+
result += 60;
|
|
1869
|
+
}
|
|
1870
|
+
return result;
|
|
1871
|
+
},
|
|
1872
|
+
enumerable: false
|
|
1873
|
+
},
|
|
1874
|
+
rgbToAnsi: {
|
|
1875
|
+
value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
|
|
1876
|
+
enumerable: false
|
|
1877
|
+
},
|
|
1878
|
+
hexToAnsi: {
|
|
1879
|
+
value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
|
|
1880
|
+
enumerable: false
|
|
1881
|
+
}
|
|
1882
|
+
});
|
|
1883
|
+
return styles2;
|
|
1884
|
+
}
|
|
1885
|
+
var ansiStyles = assembleStyles();
|
|
1886
|
+
var ansi_styles_default = ansiStyles;
|
|
1887
|
+
|
|
1888
|
+
// ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/vendor/supports-color/index.js
|
|
1889
|
+
init_esm_shims();
|
|
1890
|
+
import process2 from "node:process";
|
|
1891
|
+
import os from "node:os";
|
|
1892
|
+
import tty from "node:tty";
|
|
1893
|
+
function hasFlag(flag, argv = process2.argv) {
|
|
1894
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
1895
|
+
const position = argv.indexOf(prefix + flag);
|
|
1896
|
+
const terminatorPosition = argv.indexOf("--");
|
|
1897
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
1898
|
+
}
|
|
1899
|
+
var { env } = process2;
|
|
1900
|
+
var flagForceColor;
|
|
1901
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
1902
|
+
flagForceColor = 0;
|
|
1903
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
1904
|
+
flagForceColor = 1;
|
|
1905
|
+
}
|
|
1906
|
+
function envForceColor() {
|
|
1907
|
+
if ("FORCE_COLOR" in env) {
|
|
1908
|
+
if (env.FORCE_COLOR === "true") {
|
|
1909
|
+
return 1;
|
|
1910
|
+
}
|
|
1911
|
+
if (env.FORCE_COLOR === "false") {
|
|
1912
|
+
return 0;
|
|
1913
|
+
}
|
|
1914
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
function translateLevel(level) {
|
|
1918
|
+
if (level === 0) {
|
|
1919
|
+
return false;
|
|
1920
|
+
}
|
|
1921
|
+
return {
|
|
1922
|
+
level,
|
|
1923
|
+
hasBasic: true,
|
|
1924
|
+
has256: level >= 2,
|
|
1925
|
+
has16m: level >= 3
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
1929
|
+
const noFlagForceColor = envForceColor();
|
|
1930
|
+
if (noFlagForceColor !== void 0) {
|
|
1931
|
+
flagForceColor = noFlagForceColor;
|
|
1932
|
+
}
|
|
1933
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
1934
|
+
if (forceColor === 0) {
|
|
1935
|
+
return 0;
|
|
1936
|
+
}
|
|
1937
|
+
if (sniffFlags) {
|
|
1938
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
1939
|
+
return 3;
|
|
1940
|
+
}
|
|
1941
|
+
if (hasFlag("color=256")) {
|
|
1942
|
+
return 2;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
1946
|
+
return 0;
|
|
1947
|
+
}
|
|
1948
|
+
const min = forceColor || 0;
|
|
1949
|
+
if (env.TERM === "dumb") {
|
|
1950
|
+
return min;
|
|
1951
|
+
}
|
|
1952
|
+
if (process2.platform === "win32") {
|
|
1953
|
+
const osRelease = os.release().split(".");
|
|
1954
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
1955
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1956
|
+
}
|
|
1957
|
+
return 1;
|
|
1958
|
+
}
|
|
1959
|
+
if ("CI" in env) {
|
|
1960
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
1961
|
+
return 1;
|
|
1962
|
+
}
|
|
1963
|
+
return min;
|
|
1964
|
+
}
|
|
1965
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
1966
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1967
|
+
}
|
|
1968
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
1969
|
+
return 1;
|
|
1970
|
+
}
|
|
1971
|
+
if (env.COLORTERM === "truecolor") {
|
|
1972
|
+
return 3;
|
|
1973
|
+
}
|
|
1974
|
+
if ("TERM_PROGRAM" in env) {
|
|
1975
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1976
|
+
switch (env.TERM_PROGRAM) {
|
|
1977
|
+
case "iTerm.app":
|
|
1978
|
+
return version >= 3 ? 3 : 2;
|
|
1979
|
+
case "Apple_Terminal":
|
|
1980
|
+
return 2;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
1984
|
+
return 2;
|
|
1985
|
+
}
|
|
1986
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
1987
|
+
return 1;
|
|
1988
|
+
}
|
|
1989
|
+
if ("COLORTERM" in env) {
|
|
1990
|
+
return 1;
|
|
1991
|
+
}
|
|
1992
|
+
return min;
|
|
1993
|
+
}
|
|
1994
|
+
function createSupportsColor(stream, options = {}) {
|
|
1995
|
+
const level = _supportsColor(stream, {
|
|
1996
|
+
streamIsTTY: stream && stream.isTTY,
|
|
1997
|
+
...options
|
|
1998
|
+
});
|
|
1999
|
+
return translateLevel(level);
|
|
2000
|
+
}
|
|
2001
|
+
var supportsColor = {
|
|
2002
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
2003
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
2004
|
+
};
|
|
2005
|
+
var supports_color_default = supportsColor;
|
|
2006
|
+
|
|
2007
|
+
// ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/utilities.js
|
|
2008
|
+
init_esm_shims();
|
|
2009
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
2010
|
+
let index = string.indexOf(substring);
|
|
2011
|
+
if (index === -1) {
|
|
2012
|
+
return string;
|
|
2013
|
+
}
|
|
2014
|
+
const substringLength = substring.length;
|
|
2015
|
+
let endIndex = 0;
|
|
2016
|
+
let returnValue = "";
|
|
2017
|
+
do {
|
|
2018
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
2019
|
+
endIndex = index + substringLength;
|
|
2020
|
+
index = string.indexOf(substring, endIndex);
|
|
2021
|
+
} while (index !== -1);
|
|
2022
|
+
returnValue += string.slice(endIndex);
|
|
2023
|
+
return returnValue;
|
|
2024
|
+
}
|
|
2025
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
2026
|
+
let endIndex = 0;
|
|
2027
|
+
let returnValue = "";
|
|
2028
|
+
do {
|
|
2029
|
+
const gotCR = string[index - 1] === "\r";
|
|
2030
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
2031
|
+
endIndex = index + 1;
|
|
2032
|
+
index = string.indexOf("\n", endIndex);
|
|
2033
|
+
} while (index !== -1);
|
|
2034
|
+
returnValue += string.slice(endIndex);
|
|
2035
|
+
return returnValue;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
// ../../node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/index.js
|
|
2039
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
2040
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
2041
|
+
var STYLER = Symbol("STYLER");
|
|
2042
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
2043
|
+
var levelMapping = [
|
|
2044
|
+
"ansi",
|
|
2045
|
+
"ansi",
|
|
2046
|
+
"ansi256",
|
|
2047
|
+
"ansi16m"
|
|
2048
|
+
];
|
|
2049
|
+
var styles = /* @__PURE__ */ Object.create(null);
|
|
2050
|
+
var applyOptions = (object, options = {}) => {
|
|
2051
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
2052
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
2053
|
+
}
|
|
2054
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
2055
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
2056
|
+
};
|
|
2057
|
+
var chalkFactory = (options) => {
|
|
2058
|
+
const chalk2 = (...strings) => strings.join(" ");
|
|
2059
|
+
applyOptions(chalk2, options);
|
|
2060
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
2061
|
+
return chalk2;
|
|
2062
|
+
};
|
|
2063
|
+
function createChalk(options) {
|
|
2064
|
+
return chalkFactory(options);
|
|
2065
|
+
}
|
|
2066
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
2067
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
2068
|
+
styles[styleName] = {
|
|
2069
|
+
get() {
|
|
2070
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
2071
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
2072
|
+
return builder;
|
|
2073
|
+
}
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
styles.visible = {
|
|
2077
|
+
get() {
|
|
2078
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
2079
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
2080
|
+
return builder;
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2083
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
2084
|
+
if (model === "rgb") {
|
|
2085
|
+
if (level === "ansi16m") {
|
|
2086
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
2087
|
+
}
|
|
2088
|
+
if (level === "ansi256") {
|
|
2089
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
2090
|
+
}
|
|
2091
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
2092
|
+
}
|
|
2093
|
+
if (model === "hex") {
|
|
2094
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
2095
|
+
}
|
|
2096
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
2097
|
+
};
|
|
2098
|
+
var usedModels = ["rgb", "hex", "ansi256"];
|
|
2099
|
+
for (const model of usedModels) {
|
|
2100
|
+
styles[model] = {
|
|
2101
|
+
get() {
|
|
2102
|
+
const { level } = this;
|
|
2103
|
+
return function(...arguments_) {
|
|
2104
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
2105
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
};
|
|
2109
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
2110
|
+
styles[bgModel] = {
|
|
2111
|
+
get() {
|
|
2112
|
+
const { level } = this;
|
|
2113
|
+
return function(...arguments_) {
|
|
2114
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
2115
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
var proto = Object.defineProperties(() => {
|
|
2121
|
+
}, {
|
|
2122
|
+
...styles,
|
|
2123
|
+
level: {
|
|
2124
|
+
enumerable: true,
|
|
2125
|
+
get() {
|
|
2126
|
+
return this[GENERATOR].level;
|
|
2127
|
+
},
|
|
2128
|
+
set(level) {
|
|
2129
|
+
this[GENERATOR].level = level;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
});
|
|
2133
|
+
var createStyler = (open, close, parent) => {
|
|
2134
|
+
let openAll;
|
|
2135
|
+
let closeAll;
|
|
2136
|
+
if (parent === void 0) {
|
|
2137
|
+
openAll = open;
|
|
2138
|
+
closeAll = close;
|
|
2139
|
+
} else {
|
|
2140
|
+
openAll = parent.openAll + open;
|
|
2141
|
+
closeAll = close + parent.closeAll;
|
|
2142
|
+
}
|
|
2143
|
+
return {
|
|
2144
|
+
open,
|
|
2145
|
+
close,
|
|
2146
|
+
openAll,
|
|
2147
|
+
closeAll,
|
|
2148
|
+
parent
|
|
2149
|
+
};
|
|
2150
|
+
};
|
|
2151
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
2152
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
2153
|
+
Object.setPrototypeOf(builder, proto);
|
|
2154
|
+
builder[GENERATOR] = self;
|
|
2155
|
+
builder[STYLER] = _styler;
|
|
2156
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
2157
|
+
return builder;
|
|
2158
|
+
};
|
|
2159
|
+
var applyStyle = (self, string) => {
|
|
2160
|
+
if (self.level <= 0 || !string) {
|
|
2161
|
+
return self[IS_EMPTY] ? "" : string;
|
|
2162
|
+
}
|
|
2163
|
+
let styler = self[STYLER];
|
|
2164
|
+
if (styler === void 0) {
|
|
2165
|
+
return string;
|
|
2166
|
+
}
|
|
2167
|
+
const { openAll, closeAll } = styler;
|
|
2168
|
+
if (string.includes("\x1B")) {
|
|
2169
|
+
while (styler !== void 0) {
|
|
2170
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
2171
|
+
styler = styler.parent;
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
const lfIndex = string.indexOf("\n");
|
|
2175
|
+
if (lfIndex !== -1) {
|
|
2176
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
2177
|
+
}
|
|
2178
|
+
return openAll + string + closeAll;
|
|
2179
|
+
};
|
|
2180
|
+
Object.defineProperties(createChalk.prototype, styles);
|
|
2181
|
+
var chalk = createChalk();
|
|
2182
|
+
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
2183
|
+
var source_default = chalk;
|
|
2184
|
+
|
|
2185
|
+
// ../../node_modules/.pnpm/widest-line@4.0.1/node_modules/widest-line/index.js
|
|
2186
|
+
init_esm_shims();
|
|
2187
|
+
function widestLine(string) {
|
|
2188
|
+
let lineWidth = 0;
|
|
2189
|
+
for (const line of string.split("\n")) {
|
|
2190
|
+
lineWidth = Math.max(lineWidth, stringWidth(line));
|
|
2191
|
+
}
|
|
2192
|
+
return lineWidth;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
// ../../node_modules/.pnpm/boxen@7.0.0/node_modules/boxen/index.js
|
|
2196
|
+
var import_cli_boxes = __toESM(require_cli_boxes(), 1);
|
|
2197
|
+
|
|
2198
|
+
// ../../node_modules/.pnpm/camelcase@7.0.0/node_modules/camelcase/index.js
|
|
2199
|
+
init_esm_shims();
|
|
2200
|
+
var UPPERCASE = /[\p{Lu}]/u;
|
|
2201
|
+
var LOWERCASE = /[\p{Ll}]/u;
|
|
2202
|
+
var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
|
|
2203
|
+
var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
|
|
2204
|
+
var SEPARATORS = /[_.\- ]+/;
|
|
2205
|
+
var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
|
|
2206
|
+
var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
|
2207
|
+
var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
|
|
2208
|
+
var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
|
|
2209
|
+
let isLastCharLower = false;
|
|
2210
|
+
let isLastCharUpper = false;
|
|
2211
|
+
let isLastLastCharUpper = false;
|
|
2212
|
+
for (let index = 0; index < string.length; index++) {
|
|
2213
|
+
const character = string[index];
|
|
2214
|
+
if (isLastCharLower && UPPERCASE.test(character)) {
|
|
2215
|
+
string = string.slice(0, index) + "-" + string.slice(index);
|
|
2216
|
+
isLastCharLower = false;
|
|
2217
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
2218
|
+
isLastCharUpper = true;
|
|
2219
|
+
index++;
|
|
2220
|
+
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
|
|
2221
|
+
string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
|
|
2222
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
2223
|
+
isLastCharUpper = false;
|
|
2224
|
+
isLastCharLower = true;
|
|
2225
|
+
} else {
|
|
2226
|
+
isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
|
2227
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
2228
|
+
isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
return string;
|
|
2232
|
+
};
|
|
2233
|
+
var preserveConsecutiveUppercase = (input, toLowerCase) => {
|
|
2234
|
+
LEADING_CAPITAL.lastIndex = 0;
|
|
2235
|
+
return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
|
|
2236
|
+
};
|
|
2237
|
+
var postProcess = (input, toUpperCase) => {
|
|
2238
|
+
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
2239
|
+
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
2240
|
+
return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
|
|
2241
|
+
};
|
|
2242
|
+
function camelCase(input, options) {
|
|
2243
|
+
if (!(typeof input === "string" || Array.isArray(input))) {
|
|
2244
|
+
throw new TypeError("Expected the input to be `string | string[]`");
|
|
2245
|
+
}
|
|
2246
|
+
options = {
|
|
2247
|
+
pascalCase: false,
|
|
2248
|
+
preserveConsecutiveUppercase: false,
|
|
2249
|
+
...options
|
|
2250
|
+
};
|
|
2251
|
+
if (Array.isArray(input)) {
|
|
2252
|
+
input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
|
|
2253
|
+
} else {
|
|
2254
|
+
input = input.trim();
|
|
2255
|
+
}
|
|
2256
|
+
if (input.length === 0) {
|
|
2257
|
+
return "";
|
|
2258
|
+
}
|
|
2259
|
+
const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
|
|
2260
|
+
const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
|
|
2261
|
+
if (input.length === 1) {
|
|
2262
|
+
if (SEPARATORS.test(input)) {
|
|
2263
|
+
return "";
|
|
2264
|
+
}
|
|
2265
|
+
return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
|
2266
|
+
}
|
|
2267
|
+
const hasUpperCase = input !== toLowerCase(input);
|
|
2268
|
+
if (hasUpperCase) {
|
|
2269
|
+
input = preserveCamelCase(input, toLowerCase, toUpperCase);
|
|
2270
|
+
}
|
|
2271
|
+
input = input.replace(LEADING_SEPARATORS, "");
|
|
2272
|
+
input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
|
|
2273
|
+
if (options.pascalCase) {
|
|
2274
|
+
input = toUpperCase(input.charAt(0)) + input.slice(1);
|
|
2275
|
+
}
|
|
2276
|
+
return postProcess(input, toUpperCase);
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
// ../../node_modules/.pnpm/boxen@7.0.0/node_modules/boxen/index.js
|
|
2280
|
+
var import_ansi_align = __toESM(require_ansi_align(), 1);
|
|
2281
|
+
|
|
2282
|
+
// ../../node_modules/.pnpm/wrap-ansi@8.0.1/node_modules/wrap-ansi/index.js
|
|
2283
|
+
init_esm_shims();
|
|
2284
|
+
|
|
2285
|
+
// ../../node_modules/.pnpm/ansi-styles@6.1.1/node_modules/ansi-styles/index.js
|
|
2286
|
+
init_esm_shims();
|
|
2287
|
+
var ANSI_BACKGROUND_OFFSET2 = 10;
|
|
2288
|
+
var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
2289
|
+
var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
2290
|
+
var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
2291
|
+
function assembleStyles2() {
|
|
2292
|
+
const codes = /* @__PURE__ */ new Map();
|
|
2293
|
+
const styles2 = {
|
|
2294
|
+
modifier: {
|
|
2295
|
+
reset: [0, 0],
|
|
2296
|
+
bold: [1, 22],
|
|
2297
|
+
dim: [2, 22],
|
|
2298
|
+
italic: [3, 23],
|
|
2299
|
+
underline: [4, 24],
|
|
2300
|
+
overline: [53, 55],
|
|
2301
|
+
inverse: [7, 27],
|
|
2302
|
+
hidden: [8, 28],
|
|
2303
|
+
strikethrough: [9, 29]
|
|
2304
|
+
},
|
|
2305
|
+
color: {
|
|
2306
|
+
black: [30, 39],
|
|
2307
|
+
red: [31, 39],
|
|
2308
|
+
green: [32, 39],
|
|
2309
|
+
yellow: [33, 39],
|
|
2310
|
+
blue: [34, 39],
|
|
2311
|
+
magenta: [35, 39],
|
|
2312
|
+
cyan: [36, 39],
|
|
2313
|
+
white: [37, 39],
|
|
2314
|
+
blackBright: [90, 39],
|
|
2315
|
+
redBright: [91, 39],
|
|
2316
|
+
greenBright: [92, 39],
|
|
2317
|
+
yellowBright: [93, 39],
|
|
2318
|
+
blueBright: [94, 39],
|
|
2319
|
+
magentaBright: [95, 39],
|
|
2320
|
+
cyanBright: [96, 39],
|
|
2321
|
+
whiteBright: [97, 39]
|
|
2322
|
+
},
|
|
2323
|
+
bgColor: {
|
|
2324
|
+
bgBlack: [40, 49],
|
|
2325
|
+
bgRed: [41, 49],
|
|
2326
|
+
bgGreen: [42, 49],
|
|
2327
|
+
bgYellow: [43, 49],
|
|
2328
|
+
bgBlue: [44, 49],
|
|
2329
|
+
bgMagenta: [45, 49],
|
|
2330
|
+
bgCyan: [46, 49],
|
|
2331
|
+
bgWhite: [47, 49],
|
|
2332
|
+
bgBlackBright: [100, 49],
|
|
2333
|
+
bgRedBright: [101, 49],
|
|
2334
|
+
bgGreenBright: [102, 49],
|
|
2335
|
+
bgYellowBright: [103, 49],
|
|
2336
|
+
bgBlueBright: [104, 49],
|
|
2337
|
+
bgMagentaBright: [105, 49],
|
|
2338
|
+
bgCyanBright: [106, 49],
|
|
2339
|
+
bgWhiteBright: [107, 49]
|
|
2340
|
+
}
|
|
2341
|
+
};
|
|
2342
|
+
styles2.color.gray = styles2.color.blackBright;
|
|
2343
|
+
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
2344
|
+
styles2.color.grey = styles2.color.blackBright;
|
|
2345
|
+
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
2346
|
+
for (const [groupName, group] of Object.entries(styles2)) {
|
|
2347
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
2348
|
+
styles2[styleName] = {
|
|
2349
|
+
open: `\x1B[${style[0]}m`,
|
|
2350
|
+
close: `\x1B[${style[1]}m`
|
|
2351
|
+
};
|
|
2352
|
+
group[styleName] = styles2[styleName];
|
|
2353
|
+
codes.set(style[0], style[1]);
|
|
2354
|
+
}
|
|
2355
|
+
Object.defineProperty(styles2, groupName, {
|
|
2356
|
+
value: group,
|
|
2357
|
+
enumerable: false
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
Object.defineProperty(styles2, "codes", {
|
|
2361
|
+
value: codes,
|
|
2362
|
+
enumerable: false
|
|
2363
|
+
});
|
|
2364
|
+
styles2.color.close = "\x1B[39m";
|
|
2365
|
+
styles2.bgColor.close = "\x1B[49m";
|
|
2366
|
+
styles2.color.ansi = wrapAnsi162();
|
|
2367
|
+
styles2.color.ansi256 = wrapAnsi2562();
|
|
2368
|
+
styles2.color.ansi16m = wrapAnsi16m2();
|
|
2369
|
+
styles2.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
|
|
2370
|
+
styles2.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
|
|
2371
|
+
styles2.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
|
|
2372
|
+
Object.defineProperties(styles2, {
|
|
2373
|
+
rgbToAnsi256: {
|
|
2374
|
+
value: (red, green, blue) => {
|
|
2375
|
+
if (red === green && green === blue) {
|
|
2376
|
+
if (red < 8) {
|
|
2377
|
+
return 16;
|
|
2378
|
+
}
|
|
2379
|
+
if (red > 248) {
|
|
2380
|
+
return 231;
|
|
2381
|
+
}
|
|
2382
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
2383
|
+
}
|
|
2384
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
2385
|
+
},
|
|
2386
|
+
enumerable: false
|
|
2387
|
+
},
|
|
2388
|
+
hexToRgb: {
|
|
2389
|
+
value: (hex) => {
|
|
2390
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
2391
|
+
if (!matches) {
|
|
2392
|
+
return [0, 0, 0];
|
|
2393
|
+
}
|
|
2394
|
+
let [colorString] = matches;
|
|
2395
|
+
if (colorString.length === 3) {
|
|
2396
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
2397
|
+
}
|
|
2398
|
+
const integer = Number.parseInt(colorString, 16);
|
|
2399
|
+
return [
|
|
2400
|
+
integer >> 16 & 255,
|
|
2401
|
+
integer >> 8 & 255,
|
|
2402
|
+
integer & 255
|
|
2403
|
+
];
|
|
2404
|
+
},
|
|
2405
|
+
enumerable: false
|
|
2406
|
+
},
|
|
2407
|
+
hexToAnsi256: {
|
|
2408
|
+
value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
|
|
2409
|
+
enumerable: false
|
|
2410
|
+
},
|
|
2411
|
+
ansi256ToAnsi: {
|
|
2412
|
+
value: (code) => {
|
|
2413
|
+
if (code < 8) {
|
|
2414
|
+
return 30 + code;
|
|
2415
|
+
}
|
|
2416
|
+
if (code < 16) {
|
|
2417
|
+
return 90 + (code - 8);
|
|
2418
|
+
}
|
|
2419
|
+
let red;
|
|
2420
|
+
let green;
|
|
2421
|
+
let blue;
|
|
2422
|
+
if (code >= 232) {
|
|
2423
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
2424
|
+
green = red;
|
|
2425
|
+
blue = red;
|
|
2426
|
+
} else {
|
|
2427
|
+
code -= 16;
|
|
2428
|
+
const remainder = code % 36;
|
|
2429
|
+
red = Math.floor(code / 36) / 5;
|
|
2430
|
+
green = Math.floor(remainder / 6) / 5;
|
|
2431
|
+
blue = remainder % 6 / 5;
|
|
2432
|
+
}
|
|
2433
|
+
const value = Math.max(red, green, blue) * 2;
|
|
2434
|
+
if (value === 0) {
|
|
2435
|
+
return 30;
|
|
2436
|
+
}
|
|
2437
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
2438
|
+
if (value === 2) {
|
|
2439
|
+
result += 60;
|
|
2440
|
+
}
|
|
2441
|
+
return result;
|
|
2442
|
+
},
|
|
2443
|
+
enumerable: false
|
|
2444
|
+
},
|
|
2445
|
+
rgbToAnsi: {
|
|
2446
|
+
value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
|
|
2447
|
+
enumerable: false
|
|
2448
|
+
},
|
|
2449
|
+
hexToAnsi: {
|
|
2450
|
+
value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
|
|
2451
|
+
enumerable: false
|
|
2452
|
+
}
|
|
2453
|
+
});
|
|
2454
|
+
return styles2;
|
|
2455
|
+
}
|
|
2456
|
+
var ansiStyles2 = assembleStyles2();
|
|
2457
|
+
var ansi_styles_default2 = ansiStyles2;
|
|
2458
|
+
|
|
2459
|
+
// ../../node_modules/.pnpm/wrap-ansi@8.0.1/node_modules/wrap-ansi/index.js
|
|
2460
|
+
var ESCAPES = /* @__PURE__ */ new Set([
|
|
2461
|
+
"\x1B",
|
|
2462
|
+
"\x9B"
|
|
2463
|
+
]);
|
|
2464
|
+
var END_CODE = 39;
|
|
2465
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
2466
|
+
var ANSI_CSI = "[";
|
|
2467
|
+
var ANSI_OSC = "]";
|
|
2468
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
2469
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
2470
|
+
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
2471
|
+
var wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
|
|
2472
|
+
var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
|
|
2473
|
+
var wrapWord = (rows, word, columns) => {
|
|
2474
|
+
const characters = [...word];
|
|
2475
|
+
let isInsideEscape = false;
|
|
2476
|
+
let isInsideLinkEscape = false;
|
|
2477
|
+
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
|
|
2478
|
+
for (const [index, character] of characters.entries()) {
|
|
2479
|
+
const characterLength = stringWidth(character);
|
|
2480
|
+
if (visible + characterLength <= columns) {
|
|
2481
|
+
rows[rows.length - 1] += character;
|
|
2482
|
+
} else {
|
|
2483
|
+
rows.push(character);
|
|
2484
|
+
visible = 0;
|
|
2485
|
+
}
|
|
2486
|
+
if (ESCAPES.has(character)) {
|
|
2487
|
+
isInsideEscape = true;
|
|
2488
|
+
isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK);
|
|
2489
|
+
}
|
|
2490
|
+
if (isInsideEscape) {
|
|
2491
|
+
if (isInsideLinkEscape) {
|
|
2492
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
2493
|
+
isInsideEscape = false;
|
|
2494
|
+
isInsideLinkEscape = false;
|
|
2495
|
+
}
|
|
2496
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
2497
|
+
isInsideEscape = false;
|
|
2498
|
+
}
|
|
2499
|
+
continue;
|
|
2500
|
+
}
|
|
2501
|
+
visible += characterLength;
|
|
2502
|
+
if (visible === columns && index < characters.length - 1) {
|
|
2503
|
+
rows.push("");
|
|
2504
|
+
visible = 0;
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
|
2508
|
+
rows[rows.length - 2] += rows.pop();
|
|
2509
|
+
}
|
|
2510
|
+
};
|
|
2511
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
2512
|
+
const words = string.split(" ");
|
|
2513
|
+
let last = words.length;
|
|
2514
|
+
while (last > 0) {
|
|
2515
|
+
if (stringWidth(words[last - 1]) > 0) {
|
|
2516
|
+
break;
|
|
2517
|
+
}
|
|
2518
|
+
last--;
|
|
2519
|
+
}
|
|
2520
|
+
if (last === words.length) {
|
|
2521
|
+
return string;
|
|
2522
|
+
}
|
|
2523
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
2524
|
+
};
|
|
2525
|
+
var exec = (string, columns, options = {}) => {
|
|
2526
|
+
if (options.trim !== false && string.trim() === "") {
|
|
2527
|
+
return "";
|
|
2528
|
+
}
|
|
2529
|
+
let returnValue = "";
|
|
2530
|
+
let escapeCode;
|
|
2531
|
+
let escapeUrl;
|
|
2532
|
+
const lengths = wordLengths(string);
|
|
2533
|
+
let rows = [""];
|
|
2534
|
+
for (const [index, word] of string.split(" ").entries()) {
|
|
2535
|
+
if (options.trim !== false) {
|
|
2536
|
+
rows[rows.length - 1] = rows[rows.length - 1].trimStart();
|
|
2537
|
+
}
|
|
2538
|
+
let rowLength = stringWidth(rows[rows.length - 1]);
|
|
2539
|
+
if (index !== 0) {
|
|
2540
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
2541
|
+
rows.push("");
|
|
2542
|
+
rowLength = 0;
|
|
2543
|
+
}
|
|
2544
|
+
if (rowLength > 0 || options.trim === false) {
|
|
2545
|
+
rows[rows.length - 1] += " ";
|
|
2546
|
+
rowLength++;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
if (options.hard && lengths[index] > columns) {
|
|
2550
|
+
const remainingColumns = columns - rowLength;
|
|
2551
|
+
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
2552
|
+
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
2553
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
2554
|
+
rows.push("");
|
|
2555
|
+
}
|
|
2556
|
+
wrapWord(rows, word, columns);
|
|
2557
|
+
continue;
|
|
2558
|
+
}
|
|
2559
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
2560
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
2561
|
+
wrapWord(rows, word, columns);
|
|
2562
|
+
continue;
|
|
2563
|
+
}
|
|
2564
|
+
rows.push("");
|
|
2565
|
+
}
|
|
2566
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
2567
|
+
wrapWord(rows, word, columns);
|
|
2568
|
+
continue;
|
|
2569
|
+
}
|
|
2570
|
+
rows[rows.length - 1] += word;
|
|
2571
|
+
}
|
|
2572
|
+
if (options.trim !== false) {
|
|
2573
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
2574
|
+
}
|
|
2575
|
+
const pre = [...rows.join("\n")];
|
|
2576
|
+
for (const [index, character] of pre.entries()) {
|
|
2577
|
+
returnValue += character;
|
|
2578
|
+
if (ESCAPES.has(character)) {
|
|
2579
|
+
const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
|
|
2580
|
+
if (groups.code !== void 0) {
|
|
2581
|
+
const code2 = Number.parseFloat(groups.code);
|
|
2582
|
+
escapeCode = code2 === END_CODE ? void 0 : code2;
|
|
2583
|
+
} else if (groups.uri !== void 0) {
|
|
2584
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
const code = ansi_styles_default2.codes.get(Number(escapeCode));
|
|
2588
|
+
if (pre[index + 1] === "\n") {
|
|
2589
|
+
if (escapeUrl) {
|
|
2590
|
+
returnValue += wrapAnsiHyperlink("");
|
|
2591
|
+
}
|
|
2592
|
+
if (escapeCode && code) {
|
|
2593
|
+
returnValue += wrapAnsiCode(code);
|
|
2594
|
+
}
|
|
2595
|
+
} else if (character === "\n") {
|
|
2596
|
+
if (escapeCode && code) {
|
|
2597
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
2598
|
+
}
|
|
2599
|
+
if (escapeUrl) {
|
|
2600
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
return returnValue;
|
|
2605
|
+
};
|
|
2606
|
+
function wrapAnsi(string, columns, options) {
|
|
2607
|
+
return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
// ../../node_modules/.pnpm/boxen@7.0.0/node_modules/boxen/index.js
|
|
2611
|
+
var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
|
|
2612
|
+
var NEWLINE = "\n";
|
|
2613
|
+
var PAD = " ";
|
|
2614
|
+
var BORDERS_WIDTH = 2;
|
|
2615
|
+
var terminalColumns = () => {
|
|
2616
|
+
const { env: env2, stdout, stderr } = process3;
|
|
2617
|
+
if (stdout?.columns) {
|
|
2618
|
+
return stdout.columns;
|
|
2619
|
+
}
|
|
2620
|
+
if (stderr?.columns) {
|
|
2621
|
+
return stderr.columns;
|
|
2622
|
+
}
|
|
2623
|
+
if (env2.COLUMNS) {
|
|
2624
|
+
return Number.parseInt(env2.COLUMNS, 10);
|
|
2625
|
+
}
|
|
2626
|
+
return 80;
|
|
2627
|
+
};
|
|
2628
|
+
var getObject = (detail) => typeof detail === "number" ? {
|
|
2629
|
+
top: detail,
|
|
2630
|
+
right: detail * 3,
|
|
2631
|
+
bottom: detail,
|
|
2632
|
+
left: detail * 3
|
|
2633
|
+
} : {
|
|
2634
|
+
top: 0,
|
|
2635
|
+
right: 0,
|
|
2636
|
+
bottom: 0,
|
|
2637
|
+
left: 0,
|
|
2638
|
+
...detail
|
|
2639
|
+
};
|
|
2640
|
+
var getBorderChars = (borderStyle) => {
|
|
2641
|
+
const sides = [
|
|
2642
|
+
"topLeft",
|
|
2643
|
+
"topRight",
|
|
2644
|
+
"bottomRight",
|
|
2645
|
+
"bottomLeft",
|
|
2646
|
+
"left",
|
|
2647
|
+
"right",
|
|
2648
|
+
"top",
|
|
2649
|
+
"bottom"
|
|
2650
|
+
];
|
|
2651
|
+
let characters;
|
|
2652
|
+
if (typeof borderStyle === "string") {
|
|
2653
|
+
characters = import_cli_boxes.default[borderStyle];
|
|
2654
|
+
if (!characters) {
|
|
2655
|
+
throw new TypeError(`Invalid border style: ${borderStyle}`);
|
|
2656
|
+
}
|
|
2657
|
+
} else {
|
|
2658
|
+
if (typeof borderStyle?.vertical === "string") {
|
|
2659
|
+
borderStyle.left = borderStyle.vertical;
|
|
2660
|
+
borderStyle.right = borderStyle.vertical;
|
|
2661
|
+
}
|
|
2662
|
+
if (typeof borderStyle?.horizontal === "string") {
|
|
2663
|
+
borderStyle.top = borderStyle.horizontal;
|
|
2664
|
+
borderStyle.bottom = borderStyle.horizontal;
|
|
2665
|
+
}
|
|
2666
|
+
for (const side of sides) {
|
|
2667
|
+
if (!borderStyle[side] || typeof borderStyle[side] !== "string") {
|
|
2668
|
+
throw new TypeError(`Invalid border style: ${side}`);
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
characters = borderStyle;
|
|
2672
|
+
}
|
|
2673
|
+
return characters;
|
|
2674
|
+
};
|
|
2675
|
+
var makeTitle = (text, horizontal, alignement) => {
|
|
2676
|
+
let title = "";
|
|
2677
|
+
const textWidth = stringWidth(text);
|
|
2678
|
+
switch (alignement) {
|
|
2679
|
+
case "left":
|
|
2680
|
+
title = text + horizontal.slice(textWidth);
|
|
2681
|
+
break;
|
|
2682
|
+
case "right":
|
|
2683
|
+
title = horizontal.slice(textWidth) + text;
|
|
2684
|
+
break;
|
|
2685
|
+
default:
|
|
2686
|
+
horizontal = horizontal.slice(textWidth);
|
|
2687
|
+
if (horizontal.length % 2 === 1) {
|
|
2688
|
+
horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
|
|
2689
|
+
title = horizontal.slice(1) + text + horizontal;
|
|
2690
|
+
} else {
|
|
2691
|
+
horizontal = horizontal.slice(horizontal.length / 2);
|
|
2692
|
+
title = horizontal + text + horizontal;
|
|
2693
|
+
}
|
|
2694
|
+
break;
|
|
2695
|
+
}
|
|
2696
|
+
return title;
|
|
2697
|
+
};
|
|
2698
|
+
var makeContentText = (text, { padding, width, textAlignment, height }) => {
|
|
2699
|
+
text = (0, import_ansi_align.default)(text, { align: textAlignment });
|
|
2700
|
+
let lines = text.split(NEWLINE);
|
|
2701
|
+
const textWidth = widestLine(text);
|
|
2702
|
+
const max = width - padding.left - padding.right;
|
|
2703
|
+
if (textWidth > max) {
|
|
2704
|
+
const newLines = [];
|
|
2705
|
+
for (const line of lines) {
|
|
2706
|
+
const createdLines = wrapAnsi(line, max, { hard: true });
|
|
2707
|
+
const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
|
|
2708
|
+
const alignedLinesArray = alignedLines.split("\n");
|
|
2709
|
+
const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
|
|
2710
|
+
for (const alignedLine of alignedLinesArray) {
|
|
2711
|
+
let paddedLine;
|
|
2712
|
+
switch (textAlignment) {
|
|
2713
|
+
case "center":
|
|
2714
|
+
paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
|
|
2715
|
+
break;
|
|
2716
|
+
case "right":
|
|
2717
|
+
paddedLine = PAD.repeat(max - longestLength) + alignedLine;
|
|
2718
|
+
break;
|
|
2719
|
+
default:
|
|
2720
|
+
paddedLine = alignedLine;
|
|
2721
|
+
break;
|
|
2722
|
+
}
|
|
2723
|
+
newLines.push(paddedLine);
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
lines = newLines;
|
|
2727
|
+
}
|
|
2728
|
+
if (textAlignment === "center" && textWidth < max) {
|
|
2729
|
+
lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
|
|
2730
|
+
} else if (textAlignment === "right" && textWidth < max) {
|
|
2731
|
+
lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
|
|
2732
|
+
}
|
|
2733
|
+
const paddingLeft = PAD.repeat(padding.left);
|
|
2734
|
+
const paddingRight = PAD.repeat(padding.right);
|
|
2735
|
+
lines = lines.map((line) => paddingLeft + line + paddingRight);
|
|
2736
|
+
lines = lines.map((line) => {
|
|
2737
|
+
if (width - stringWidth(line) > 0) {
|
|
2738
|
+
switch (textAlignment) {
|
|
2739
|
+
case "center":
|
|
2740
|
+
return line + PAD.repeat(width - stringWidth(line));
|
|
2741
|
+
case "right":
|
|
2742
|
+
return line + PAD.repeat(width - stringWidth(line));
|
|
2743
|
+
default:
|
|
2744
|
+
return line + PAD.repeat(width - stringWidth(line));
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
return line;
|
|
2748
|
+
});
|
|
2749
|
+
if (padding.top > 0) {
|
|
2750
|
+
lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
|
|
2751
|
+
}
|
|
2752
|
+
if (padding.bottom > 0) {
|
|
2753
|
+
lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
|
|
2754
|
+
}
|
|
2755
|
+
if (height && lines.length > height) {
|
|
2756
|
+
lines = lines.slice(0, height);
|
|
2757
|
+
} else if (height && lines.length < height) {
|
|
2758
|
+
lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
|
|
2759
|
+
}
|
|
2760
|
+
return lines.join(NEWLINE);
|
|
2761
|
+
};
|
|
2762
|
+
var boxContent = (content, contentWidth, options) => {
|
|
2763
|
+
const colorizeBorder = (border) => {
|
|
2764
|
+
const newBorder = options.borderColor ? getColorFn(options.borderColor)(border) : border;
|
|
2765
|
+
return options.dimBorder ? source_default.dim(newBorder) : newBorder;
|
|
2766
|
+
};
|
|
2767
|
+
const colorizeContent = (content2) => options.backgroundColor ? getBGColorFn(options.backgroundColor)(content2) : content2;
|
|
2768
|
+
const chars = getBorderChars(options.borderStyle);
|
|
2769
|
+
const columns = terminalColumns();
|
|
2770
|
+
let marginLeft = PAD.repeat(options.margin.left);
|
|
2771
|
+
if (options.float === "center") {
|
|
2772
|
+
const marginWidth = Math.max((columns - contentWidth - BORDERS_WIDTH) / 2, 0);
|
|
2773
|
+
marginLeft = PAD.repeat(marginWidth);
|
|
2774
|
+
} else if (options.float === "right") {
|
|
2775
|
+
const marginWidth = Math.max(columns - contentWidth - options.margin.right - BORDERS_WIDTH, 0);
|
|
2776
|
+
marginLeft = PAD.repeat(marginWidth);
|
|
2777
|
+
}
|
|
2778
|
+
const top = colorizeBorder(NEWLINE.repeat(options.margin.top) + marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight);
|
|
2779
|
+
const bottom = colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight + NEWLINE.repeat(options.margin.bottom));
|
|
2780
|
+
const LINE_SEPARATOR = contentWidth + BORDERS_WIDTH + options.margin.left >= columns ? "" : NEWLINE;
|
|
2781
|
+
const lines = content.split(NEWLINE);
|
|
2782
|
+
const middle = lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(LINE_SEPARATOR);
|
|
2783
|
+
return top + LINE_SEPARATOR + middle + LINE_SEPARATOR + bottom;
|
|
2784
|
+
};
|
|
2785
|
+
var sanitizeOptions = (options) => {
|
|
2786
|
+
if (options.fullscreen && process3?.stdout) {
|
|
2787
|
+
let newDimensions = [process3.stdout.columns, process3.stdout.rows];
|
|
2788
|
+
if (typeof options.fullscreen === "function") {
|
|
2789
|
+
newDimensions = options.fullscreen(...newDimensions);
|
|
2790
|
+
}
|
|
2791
|
+
if (!options.width) {
|
|
2792
|
+
options.width = newDimensions[0];
|
|
2793
|
+
}
|
|
2794
|
+
if (!options.height) {
|
|
2795
|
+
options.height = newDimensions[1];
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
if (options.width) {
|
|
2799
|
+
options.width = Math.max(1, options.width - BORDERS_WIDTH);
|
|
2800
|
+
}
|
|
2801
|
+
if (options.height) {
|
|
2802
|
+
options.height = Math.max(1, options.height - BORDERS_WIDTH);
|
|
2803
|
+
}
|
|
2804
|
+
return options;
|
|
2805
|
+
};
|
|
2806
|
+
var determineDimensions = (text, options) => {
|
|
2807
|
+
options = sanitizeOptions(options);
|
|
2808
|
+
const widthOverride = options.width !== void 0;
|
|
2809
|
+
const columns = terminalColumns();
|
|
2810
|
+
const maxWidth = columns - options.margin.left - options.margin.right - BORDERS_WIDTH;
|
|
2811
|
+
const widest = widestLine(wrapAnsi(text, columns - BORDERS_WIDTH, { hard: true, trim: false })) + options.padding.left + options.padding.right;
|
|
2812
|
+
if (options.title && widthOverride) {
|
|
2813
|
+
options.title = options.title.slice(0, Math.max(0, options.width - 2));
|
|
2814
|
+
if (options.title) {
|
|
2815
|
+
options.title = ` ${options.title} `;
|
|
2816
|
+
}
|
|
2817
|
+
} else if (options.title) {
|
|
2818
|
+
options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
|
|
2819
|
+
if (options.title) {
|
|
2820
|
+
options.title = ` ${options.title} `;
|
|
2821
|
+
if (stringWidth(options.title) > widest) {
|
|
2822
|
+
options.width = stringWidth(options.title);
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
options.width = options.width ? options.width : widest;
|
|
2827
|
+
if (!widthOverride) {
|
|
2828
|
+
if (options.margin.left && options.margin.right && options.width > maxWidth) {
|
|
2829
|
+
const spaceForMargins = columns - options.width - BORDERS_WIDTH;
|
|
2830
|
+
const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
|
|
2831
|
+
options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
|
|
2832
|
+
options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
|
|
2833
|
+
}
|
|
2834
|
+
options.width = Math.min(options.width, columns - BORDERS_WIDTH - options.margin.left - options.margin.right);
|
|
2835
|
+
}
|
|
2836
|
+
if (options.width - (options.padding.left + options.padding.right) <= 0) {
|
|
2837
|
+
options.padding.left = 0;
|
|
2838
|
+
options.padding.right = 0;
|
|
2839
|
+
}
|
|
2840
|
+
if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
|
|
2841
|
+
options.padding.top = 0;
|
|
2842
|
+
options.padding.bottom = 0;
|
|
2843
|
+
}
|
|
2844
|
+
return options;
|
|
2845
|
+
};
|
|
2846
|
+
var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
|
|
2847
|
+
var isColorValid = (color) => typeof color === "string" && (source_default[color] ?? isHex(color));
|
|
2848
|
+
var getColorFn = (color) => isHex(color) ? source_default.hex(color) : source_default[color];
|
|
2849
|
+
var getBGColorFn = (color) => isHex(color) ? source_default.bgHex(color) : source_default[camelCase(["bg", color])];
|
|
2850
|
+
function boxen(text, options) {
|
|
2851
|
+
options = {
|
|
2852
|
+
padding: 0,
|
|
2853
|
+
borderStyle: "single",
|
|
2854
|
+
dimBorder: false,
|
|
2855
|
+
textAlignment: "left",
|
|
2856
|
+
float: "left",
|
|
2857
|
+
titleAlignment: "left",
|
|
2858
|
+
...options
|
|
2859
|
+
};
|
|
2860
|
+
if (options.align) {
|
|
2861
|
+
options.textAlignment = options.align;
|
|
2862
|
+
}
|
|
2863
|
+
if (options.borderColor && !isColorValid(options.borderColor)) {
|
|
2864
|
+
throw new Error(`${options.borderColor} is not a valid borderColor`);
|
|
2865
|
+
}
|
|
2866
|
+
if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
|
|
2867
|
+
throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
|
|
2868
|
+
}
|
|
2869
|
+
options.padding = getObject(options.padding);
|
|
2870
|
+
options.margin = getObject(options.margin);
|
|
2871
|
+
options = determineDimensions(text, options);
|
|
2872
|
+
text = makeContentText(text, options);
|
|
2873
|
+
return boxContent(text, options.width, options);
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
// src/cli-box.ts
|
|
2877
|
+
function cliBox(str, title) {
|
|
2878
|
+
return boxen(str, {
|
|
2879
|
+
padding: { left: 3, right: 3, top: 1, bottom: 1 },
|
|
2880
|
+
borderColor: "magenta",
|
|
2881
|
+
borderStyle: "round",
|
|
2882
|
+
title,
|
|
2883
|
+
titleAlignment: "center"
|
|
2884
|
+
});
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
// src/messages.ts
|
|
2888
|
+
var tick = colors.green().bold("\u2714\uFE0F");
|
|
2889
|
+
function artifactsGeneratedMessage(ctx) {
|
|
2890
|
+
return [
|
|
2891
|
+
outdent20`
|
|
2892
|
+
${tick} ${quote2(ctx.outdir, "/css")}: the css function to author styles
|
|
2893
|
+
`,
|
|
2894
|
+
ctx.hasTokens && outdent20`
|
|
2895
|
+
${tick} ${quote2(ctx.outdir, "/tokens")}: the css variables and js function to query your tokens
|
|
2896
|
+
`,
|
|
2897
|
+
ctx.hasPattern && outdent20`
|
|
2898
|
+
${tick} ${quote2(ctx.outdir, "/patterns")}: functions to implement common css patterns
|
|
2899
|
+
`,
|
|
2900
|
+
ctx.hasRecipes && outdent20`
|
|
2901
|
+
${tick} ${quote2(ctx.outdir, "/recipes")}: functions to create multi-variant styles
|
|
2902
|
+
`,
|
|
2903
|
+
ctx.jsxFramework && outdent20`
|
|
2904
|
+
${tick} ${quote2(ctx.outdir, "/jsx")}: style prop powered elements for ${ctx.jsxFramework}
|
|
2905
|
+
`,
|
|
2906
|
+
"\n"
|
|
2907
|
+
].filter(Boolean).join("\n");
|
|
2908
|
+
}
|
|
2909
|
+
function configExistsMessage(cmd) {
|
|
2910
|
+
return outdent20`
|
|
2911
|
+
\n
|
|
2912
|
+
It looks like you already have panda created\`.
|
|
2913
|
+
|
|
2914
|
+
You can now run ${quote2(cmd, " panda --watch")}.
|
|
2915
|
+
|
|
2916
|
+
`;
|
|
2917
|
+
}
|
|
2918
|
+
function thankYouMessage() {
|
|
2919
|
+
return outdent20`
|
|
2920
|
+
|
|
2921
|
+
🚀 Thanks for choosing ${colors.cyan("Panda")} to write your css.
|
|
2922
|
+
|
|
2923
|
+
You are set up to start using Panda!
|
|
2924
|
+
|
|
2925
|
+
`;
|
|
2926
|
+
}
|
|
2927
|
+
var randomWords = ["Sweet", "Divine", "Pandalicious", "Super"];
|
|
2928
|
+
var pickRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
|
2929
|
+
function scaffoldCompleteMessage() {
|
|
2930
|
+
return cliBox(
|
|
2931
|
+
outdent20`
|
|
2932
|
+
|
|
2933
|
+
${colors.bold().cyan("Next steps:")}
|
|
2934
|
+
|
|
2935
|
+
[1] Create a ${quote2("index.css")} file in your project that contains:
|
|
2936
|
+
|
|
2937
|
+
@layer reset, base, tokens, recipes, utilities;
|
|
2938
|
+
|
|
2939
|
+
|
|
2940
|
+
[2] Import the ${quote2("index.css")} file at the root of your project.
|
|
2941
|
+
|
|
2942
|
+
`,
|
|
2943
|
+
`\u{1F43C} ${pickRandom(randomWords)}! \u2728`
|
|
2944
|
+
);
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
// src/artifacts.ts
|
|
2948
|
+
async function emitArtifacts(ctx) {
|
|
2949
|
+
if (ctx.clean)
|
|
2950
|
+
await ctx.cleanOutdir();
|
|
2951
|
+
const tasks = generateSystem(ctx).map((file) => ctx.writeOutput(file));
|
|
2952
|
+
await Promise.all(tasks);
|
|
2953
|
+
return artifactsGeneratedMessage(ctx) + scaffoldCompleteMessage();
|
|
2954
|
+
}
|
|
2955
|
+
async function emitAndExtract(ctx) {
|
|
2956
|
+
await emitArtifacts(ctx);
|
|
2957
|
+
await extractFiles(ctx);
|
|
2958
|
+
await bundleChunks(ctx);
|
|
2959
|
+
}
|
|
2960
|
+
function getBaseCss(ctx) {
|
|
2961
|
+
const css2 = [generateReset(), generateTokenCss(ctx), generateKeyframes(ctx.keyframes)];
|
|
2962
|
+
return css2.join("\n");
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
// src/builder.ts
|
|
2966
|
+
init_esm_shims();
|
|
2967
|
+
import { discardDuplicate as discardDuplicate2 } from "@pandacss/core";
|
|
2968
|
+
import { ConfigNotFoundError } from "@pandacss/error";
|
|
2969
|
+
import { logger as logger4 } from "@pandacss/logger";
|
|
2970
|
+
import { toHash } from "@pandacss/shared";
|
|
2971
|
+
import { existsSync as existsSync2, readFileSync as readFileSync4 } from "fs";
|
|
2972
|
+
import { statSync } from "fs-extra";
|
|
2973
|
+
import { resolve as resolve3 } from "path";
|
|
2974
|
+
|
|
2975
|
+
// src/config.ts
|
|
2976
|
+
init_esm_shims();
|
|
2977
|
+
import { loadConfigFile } from "@pandacss/config";
|
|
2978
|
+
import { lookItUpSync as lookItUpSync2 } from "look-it-up";
|
|
2979
|
+
|
|
2980
|
+
// src/context.ts
|
|
2981
|
+
init_esm_shims();
|
|
2982
|
+
import { createParser, createProject } from "@pandacss/ast";
|
|
2983
|
+
import {
|
|
2984
|
+
assignCompositions,
|
|
2985
|
+
Conditions,
|
|
2986
|
+
discardDuplicate,
|
|
2987
|
+
Stylesheet as Stylesheet2,
|
|
2988
|
+
Utility
|
|
2989
|
+
} from "@pandacss/core";
|
|
2990
|
+
import { NotFoundError } from "@pandacss/error";
|
|
2991
|
+
import { logger as logger3 } from "@pandacss/logger";
|
|
2992
|
+
import { capitalize as capitalize10, compact, mapObject, uncapitalize } from "@pandacss/shared";
|
|
2993
|
+
import { TokenDictionary } from "@pandacss/token-dictionary";
|
|
2994
|
+
import glob from "fast-glob";
|
|
2995
|
+
import { readdirSync } from "fs";
|
|
2996
|
+
import { emptyDir, ensureDir, existsSync } from "fs-extra";
|
|
2997
|
+
import { readFile, unlink, writeFile } from "fs/promises";
|
|
2998
|
+
import { extname, isAbsolute, join as join2, relative, resolve, sep } from "path";
|
|
2999
|
+
import postcss from "postcss";
|
|
3000
|
+
var helpers = {
|
|
3001
|
+
map: mapObject
|
|
3002
|
+
};
|
|
3003
|
+
var fileSystem = {
|
|
3004
|
+
read: (path) => {
|
|
3005
|
+
return readFile(path, "utf-8");
|
|
3006
|
+
},
|
|
3007
|
+
write: (path, code) => {
|
|
3008
|
+
return writeFile(path, code);
|
|
3009
|
+
},
|
|
3010
|
+
rm: (path) => {
|
|
3011
|
+
return unlink(path);
|
|
3012
|
+
}
|
|
3013
|
+
};
|
|
3014
|
+
function createContext(conf, io = fileSystem) {
|
|
3015
|
+
const { config } = conf;
|
|
3016
|
+
const {
|
|
3017
|
+
cwd: _cwd = process.cwd(),
|
|
3018
|
+
breakpoints = {},
|
|
3019
|
+
conditions: _conditions = {},
|
|
3020
|
+
tokens: _tokens = {},
|
|
3021
|
+
semanticTokens = {},
|
|
3022
|
+
cssVar,
|
|
3023
|
+
outdir,
|
|
3024
|
+
exclude: _exclude = [],
|
|
3025
|
+
patterns = {},
|
|
3026
|
+
recipes = {},
|
|
3027
|
+
utilities = {},
|
|
3028
|
+
textStyles,
|
|
3029
|
+
layerStyles,
|
|
3030
|
+
hash,
|
|
3031
|
+
jsxFactory = "panda",
|
|
3032
|
+
jsxFramework,
|
|
3033
|
+
globalCss,
|
|
3034
|
+
separator
|
|
3035
|
+
} = config;
|
|
3036
|
+
const cwd = resolve(_cwd);
|
|
3037
|
+
const exclude = [".git", "node_modules", "test-results"].concat(_exclude);
|
|
3038
|
+
const tokens = new TokenDictionary({
|
|
3039
|
+
tokens: _tokens,
|
|
3040
|
+
semanticTokens,
|
|
3041
|
+
prefix: cssVar?.prefix
|
|
3042
|
+
});
|
|
3043
|
+
const utility = new Utility({
|
|
3044
|
+
tokens,
|
|
3045
|
+
config: utilities,
|
|
3046
|
+
separator
|
|
3047
|
+
});
|
|
3048
|
+
const conditions = new Conditions({
|
|
3049
|
+
conditions: _conditions,
|
|
3050
|
+
breakpoints
|
|
3051
|
+
});
|
|
3052
|
+
assignCompositions(
|
|
3053
|
+
{ conditions, utility },
|
|
3054
|
+
compact({
|
|
3055
|
+
textStyle: textStyles,
|
|
3056
|
+
layerStyle: layerStyles
|
|
3057
|
+
})
|
|
3058
|
+
);
|
|
3059
|
+
const context = () => ({
|
|
3060
|
+
root: postcss.root(),
|
|
3061
|
+
breakpoints,
|
|
3062
|
+
conditions,
|
|
3063
|
+
hash,
|
|
3064
|
+
helpers,
|
|
3065
|
+
utility,
|
|
3066
|
+
hasShorthand: utility.hasShorthand,
|
|
3067
|
+
resolveShorthand(prop) {
|
|
3068
|
+
return utility.resolveShorthand(prop);
|
|
3069
|
+
},
|
|
3070
|
+
transform(prop, value) {
|
|
3071
|
+
return utility.resolve(prop, value);
|
|
3072
|
+
}
|
|
3073
|
+
});
|
|
3074
|
+
function getPattern(name) {
|
|
3075
|
+
const pattern = patterns[name];
|
|
3076
|
+
if (!pattern) {
|
|
3077
|
+
throw new NotFoundError({ type: "pattern", name });
|
|
3078
|
+
}
|
|
3079
|
+
return pattern;
|
|
3080
|
+
}
|
|
3081
|
+
function execPattern(name, data) {
|
|
3082
|
+
const pattern = getPattern(name);
|
|
3083
|
+
return pattern.transform?.(data, helpers) ?? {};
|
|
3084
|
+
}
|
|
3085
|
+
const patternNodes = Object.entries(patterns).map(([name, pattern]) => ({
|
|
3086
|
+
name: pattern.jsx ?? capitalize10(name),
|
|
3087
|
+
props: Object.keys(pattern.properties),
|
|
3088
|
+
baseName: name
|
|
3089
|
+
}));
|
|
3090
|
+
function getPatternFnName(jsx) {
|
|
3091
|
+
return patternNodes.find((node) => node.name === jsx)?.baseName ?? uncapitalize(jsx);
|
|
3092
|
+
}
|
|
3093
|
+
function getRecipe(name) {
|
|
3094
|
+
const recipe = recipes[name];
|
|
3095
|
+
if (!recipe) {
|
|
3096
|
+
throw new NotFoundError({ type: "recipe", name });
|
|
3097
|
+
}
|
|
3098
|
+
return recipe;
|
|
3099
|
+
}
|
|
3100
|
+
const properties = Array.from(/* @__PURE__ */ new Set(["css", ...utility.keys(), ...conditions.keys()]));
|
|
3101
|
+
function isProperty(prop) {
|
|
3102
|
+
const regex = new RegExp("^(?:" + properties.join("|") + ")$");
|
|
3103
|
+
return regex.test(prop);
|
|
3104
|
+
}
|
|
3105
|
+
function getPath(str) {
|
|
3106
|
+
return join2(cwd, outdir, str);
|
|
3107
|
+
}
|
|
3108
|
+
function absPath(str) {
|
|
3109
|
+
return isAbsolute(str) ? str : join2(cwd, str);
|
|
3110
|
+
}
|
|
3111
|
+
const paths = {
|
|
3112
|
+
config: getPath("config.js"),
|
|
3113
|
+
css: getPath("css"),
|
|
3114
|
+
token: getPath("tokens"),
|
|
3115
|
+
types: getPath("types"),
|
|
3116
|
+
recipe: getPath("recipes"),
|
|
3117
|
+
pattern: getPath("patterns"),
|
|
3118
|
+
chunk: getPath("chunks"),
|
|
3119
|
+
outCss: getPath("styles.css"),
|
|
3120
|
+
jsx: getPath("jsx")
|
|
3121
|
+
};
|
|
3122
|
+
async function write(dir, options) {
|
|
3123
|
+
await ensureDir(dir);
|
|
3124
|
+
return Promise.all(
|
|
3125
|
+
options.map(async ({ file, code }) => {
|
|
3126
|
+
const absPath2 = join2(dir, file);
|
|
3127
|
+
if (code) {
|
|
3128
|
+
return io.write(absPath2, code);
|
|
3129
|
+
}
|
|
3130
|
+
})
|
|
3131
|
+
);
|
|
3132
|
+
}
|
|
3133
|
+
function cleanOutdir() {
|
|
3134
|
+
return emptyDir(outdir);
|
|
3135
|
+
}
|
|
3136
|
+
function writeOutput(output) {
|
|
3137
|
+
const { dir = outdir, files: files2 } = output;
|
|
3138
|
+
return write(dir, files2);
|
|
3139
|
+
}
|
|
3140
|
+
const chunks = {
|
|
3141
|
+
dir: paths.chunk,
|
|
3142
|
+
readFile(file) {
|
|
3143
|
+
let fileName = chunks.format(file);
|
|
3144
|
+
fileName = join2(paths.chunk, fileName);
|
|
3145
|
+
if (!existsSync(fileName)) {
|
|
3146
|
+
return Promise.resolve("");
|
|
3147
|
+
}
|
|
3148
|
+
return io.read(fileName);
|
|
3149
|
+
},
|
|
3150
|
+
getFiles() {
|
|
3151
|
+
return readdirSync(chunks.dir);
|
|
3152
|
+
},
|
|
3153
|
+
format(file) {
|
|
3154
|
+
return relative(cwd, file).replaceAll(sep, "__").replace(extname(file), ".css");
|
|
3155
|
+
},
|
|
3156
|
+
async write(file, css2) {
|
|
3157
|
+
const fileName = chunks.format(file);
|
|
3158
|
+
const oldCss = await chunks.readFile(file);
|
|
3159
|
+
const newCss = discardDuplicate([oldCss.trim(), css2.trim()].filter(Boolean).join("\n\n"));
|
|
3160
|
+
logger3.debug({ type: "chunk:write", file, path: fileName });
|
|
3161
|
+
return write(paths.chunk, [{ file: fileName, code: newCss }]);
|
|
3162
|
+
},
|
|
3163
|
+
rm(file) {
|
|
3164
|
+
const fileName = chunks.format(file);
|
|
3165
|
+
return io.rm(join2(paths.chunk, fileName));
|
|
3166
|
+
},
|
|
3167
|
+
glob: [`${paths.chunk}/**/*.css`]
|
|
3168
|
+
};
|
|
3169
|
+
function getFiles() {
|
|
3170
|
+
return glob.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
|
|
3171
|
+
}
|
|
3172
|
+
const files = getFiles();
|
|
3173
|
+
const importMap = {
|
|
3174
|
+
css: `${outdir}/css`,
|
|
3175
|
+
recipe: `${outdir}/recipes`,
|
|
3176
|
+
pattern: `${outdir}/patterns`,
|
|
3177
|
+
jsx: `${outdir}/jsx`
|
|
3178
|
+
};
|
|
3179
|
+
const tsProject = createProject();
|
|
3180
|
+
tsProject.addSourceFilesAtPaths(files);
|
|
3181
|
+
const parseSourceFile = createParser({
|
|
3182
|
+
importMap,
|
|
3183
|
+
jsx: {
|
|
3184
|
+
factory: jsxFactory,
|
|
3185
|
+
isStyleProp: isProperty,
|
|
3186
|
+
nodes: patternNodes
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3189
|
+
function collectStyles(collector, file) {
|
|
3190
|
+
const sheet = new Stylesheet2(context());
|
|
3191
|
+
if (globalCss) {
|
|
3192
|
+
sheet.addGlobalCss(globalCss);
|
|
3193
|
+
}
|
|
3194
|
+
collector.globalCss.forEach((result) => {
|
|
3195
|
+
sheet.processGlobalCss(result.data);
|
|
3196
|
+
});
|
|
3197
|
+
collector.css.forEach((result) => {
|
|
3198
|
+
sheet.processAtomic(result.data);
|
|
3199
|
+
});
|
|
3200
|
+
collector.cssMap.forEach((result) => {
|
|
3201
|
+
for (const data of Object.values(result.data)) {
|
|
3202
|
+
sheet.processAtomic(data);
|
|
3203
|
+
}
|
|
3204
|
+
});
|
|
3205
|
+
collector.jsx.forEach((result) => {
|
|
3206
|
+
const { data, type, name } = result;
|
|
3207
|
+
const { css: css2 = {}, ...rest } = data;
|
|
3208
|
+
const styles2 = { ...css2, ...rest };
|
|
3209
|
+
if (name && type === "pattern") {
|
|
3210
|
+
collector.setPattern(getPatternFnName(name), { data: styles2 });
|
|
3211
|
+
} else {
|
|
3212
|
+
sheet.processAtomic(styles2);
|
|
3213
|
+
}
|
|
3214
|
+
});
|
|
3215
|
+
collector.recipe.forEach((result, name) => {
|
|
3216
|
+
try {
|
|
3217
|
+
for (const item of result) {
|
|
3218
|
+
sheet.processRecipe(getRecipe(name), item.data);
|
|
3219
|
+
}
|
|
3220
|
+
} catch (error) {
|
|
3221
|
+
logger3.error({ err: error });
|
|
3222
|
+
}
|
|
3223
|
+
});
|
|
3224
|
+
collector.pattern.forEach((result, name) => {
|
|
3225
|
+
try {
|
|
3226
|
+
for (const item of result) {
|
|
3227
|
+
const styles2 = execPattern(name, item.data);
|
|
3228
|
+
sheet.processAtomic(styles2);
|
|
3229
|
+
}
|
|
3230
|
+
} catch (error) {
|
|
3231
|
+
logger3.error({ err: error });
|
|
3232
|
+
}
|
|
3233
|
+
});
|
|
3234
|
+
if (collector.isEmpty) {
|
|
3235
|
+
return;
|
|
3236
|
+
}
|
|
3237
|
+
return {
|
|
3238
|
+
css: sheet.toCss({ minify: config.minify }),
|
|
3239
|
+
file: chunks.format(file)
|
|
3240
|
+
};
|
|
3241
|
+
}
|
|
3242
|
+
function extract(fn) {
|
|
3243
|
+
return Promise.all(files.map(fn));
|
|
3244
|
+
}
|
|
3245
|
+
return {
|
|
3246
|
+
...config,
|
|
3247
|
+
config,
|
|
3248
|
+
configPath: conf.path,
|
|
3249
|
+
cwd,
|
|
3250
|
+
conf,
|
|
3251
|
+
chunks,
|
|
3252
|
+
files,
|
|
3253
|
+
helpers,
|
|
3254
|
+
context,
|
|
3255
|
+
exclude,
|
|
3256
|
+
conditions,
|
|
3257
|
+
importMap,
|
|
3258
|
+
reloadSourceFiles() {
|
|
3259
|
+
const files2 = getFiles();
|
|
3260
|
+
for (const file of files2) {
|
|
3261
|
+
const source = tsProject.getSourceFile(file);
|
|
3262
|
+
if (source) {
|
|
3263
|
+
source.refreshFromFileSystemSync();
|
|
3264
|
+
} else {
|
|
3265
|
+
tsProject.addSourceFileAtPath(file);
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
},
|
|
3269
|
+
getSourceFile(file) {
|
|
3270
|
+
return tsProject.getSourceFile(absPath(file));
|
|
3271
|
+
},
|
|
3272
|
+
addSourceFile(file) {
|
|
3273
|
+
return tsProject.addSourceFileAtPath(absPath(file));
|
|
3274
|
+
},
|
|
3275
|
+
removeSourceFile(file) {
|
|
3276
|
+
const sourceFile = tsProject.getSourceFile(absPath(file));
|
|
3277
|
+
if (sourceFile) {
|
|
3278
|
+
return tsProject.removeSourceFile(sourceFile);
|
|
3279
|
+
}
|
|
3280
|
+
},
|
|
3281
|
+
parseSourceFile,
|
|
3282
|
+
getPath,
|
|
3283
|
+
paths,
|
|
3284
|
+
write,
|
|
3285
|
+
writeOutput,
|
|
3286
|
+
cleanOutdir,
|
|
3287
|
+
tokens,
|
|
3288
|
+
hasTokens: !tokens.isEmpty,
|
|
3289
|
+
utility,
|
|
3290
|
+
collectStyles,
|
|
3291
|
+
patterns,
|
|
3292
|
+
hasPattern: Object.keys(patterns).length > 0,
|
|
3293
|
+
getPattern,
|
|
3294
|
+
execPattern,
|
|
3295
|
+
patternNodes,
|
|
3296
|
+
getPatternFnName,
|
|
3297
|
+
recipes,
|
|
3298
|
+
getRecipe,
|
|
3299
|
+
hasRecipes: Object.keys(recipes).length > 0,
|
|
3300
|
+
jsxFramework,
|
|
3301
|
+
jsxFactory,
|
|
3302
|
+
cssVarRoot: config.cssVar?.root ?? ":where(:root, :host)",
|
|
3303
|
+
properties,
|
|
3304
|
+
isProperty,
|
|
3305
|
+
extract
|
|
3306
|
+
};
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
// src/config.ts
|
|
3310
|
+
var configs = [".ts", ".js", ".mjs", ".cjs"];
|
|
3311
|
+
function findConfig() {
|
|
3312
|
+
for (const config of configs) {
|
|
3313
|
+
const result = lookItUpSync2(`panda.config${config}`);
|
|
3314
|
+
if (result) {
|
|
3315
|
+
return result;
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
async function loadConfigAndCreateContext(options = {}) {
|
|
3320
|
+
const { cwd = process.cwd(), config, configPath } = options;
|
|
3321
|
+
const conf = await loadConfigFile({ cwd, file: configPath });
|
|
3322
|
+
if (config) {
|
|
3323
|
+
Object.assign(conf.config, config);
|
|
3324
|
+
}
|
|
3325
|
+
return createContext(conf);
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
// src/glob.ts
|
|
3329
|
+
init_esm_shims();
|
|
3330
|
+
import globParent from "glob-parent";
|
|
3331
|
+
import isGlob from "is-glob";
|
|
3332
|
+
import { resolve as resolve2 } from "path";
|
|
3333
|
+
function parseGlob(pattern) {
|
|
3334
|
+
let glob2 = pattern;
|
|
3335
|
+
const base = globParent(pattern);
|
|
3336
|
+
if (base !== ".") {
|
|
3337
|
+
glob2 = pattern.substring(base.length);
|
|
3338
|
+
if (glob2.charAt(0) === "/") {
|
|
3339
|
+
glob2 = glob2.substring(1);
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
if (glob2.substring(0, 2) === "./") {
|
|
3343
|
+
glob2 = glob2.substring(2);
|
|
3344
|
+
}
|
|
3345
|
+
if (glob2.charAt(0) === "/") {
|
|
3346
|
+
glob2 = glob2.substring(1);
|
|
3347
|
+
}
|
|
3348
|
+
return { base, glob: glob2 };
|
|
3349
|
+
}
|
|
3350
|
+
function parseDependency(fileOrGlob) {
|
|
3351
|
+
if (fileOrGlob.startsWith("!")) {
|
|
3352
|
+
return null;
|
|
3353
|
+
}
|
|
3354
|
+
let message = null;
|
|
3355
|
+
if (isGlob(fileOrGlob)) {
|
|
3356
|
+
const { base, glob: glob2 } = parseGlob(fileOrGlob);
|
|
3357
|
+
message = { type: "dir-dependency", dir: resolve2(base), glob: glob2 };
|
|
3358
|
+
} else {
|
|
3359
|
+
message = { type: "dependency", file: resolve2(fileOrGlob) };
|
|
3360
|
+
}
|
|
3361
|
+
if (message.type === "dir-dependency" && process.env.ROLLUP_WATCH === "true") {
|
|
3362
|
+
message = { type: "dependency", file: message.dir };
|
|
3363
|
+
}
|
|
3364
|
+
return message;
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
// src/builder.ts
|
|
3368
|
+
var contextCache = /* @__PURE__ */ new Map();
|
|
3369
|
+
var builderCache = /* @__PURE__ */ new WeakMap();
|
|
3370
|
+
function getConfigHash() {
|
|
3371
|
+
const file = findConfig();
|
|
3372
|
+
if (!file) {
|
|
3373
|
+
throw new ConfigNotFoundError();
|
|
3374
|
+
}
|
|
3375
|
+
return toHash(readFileSync4(file, "utf-8"));
|
|
3376
|
+
}
|
|
3377
|
+
var Builder = class {
|
|
3378
|
+
fileModifiedMap = /* @__PURE__ */ new Map();
|
|
3379
|
+
fileMap = /* @__PURE__ */ new Map();
|
|
3380
|
+
context;
|
|
3381
|
+
configChanged = true;
|
|
3382
|
+
updateFile(file, css2) {
|
|
3383
|
+
const oldCss = this.fileMap?.get(file) ?? "";
|
|
3384
|
+
const newCss = discardDuplicate2(oldCss + css2);
|
|
3385
|
+
this.fileMap?.set(file, newCss);
|
|
3386
|
+
}
|
|
3387
|
+
async setup() {
|
|
3388
|
+
const configHash = getConfigHash();
|
|
3389
|
+
const cachedContext = contextCache.get(configHash);
|
|
3390
|
+
if (cachedContext) {
|
|
3391
|
+
cachedContext.reloadSourceFiles();
|
|
3392
|
+
this.context = cachedContext;
|
|
3393
|
+
this.fileMap = builderCache.get(cachedContext).fileMap;
|
|
3394
|
+
this.fileModifiedMap = builderCache.get(cachedContext).fileModifiedMap;
|
|
3395
|
+
} else {
|
|
3396
|
+
this.context = await loadConfigAndCreateContext();
|
|
3397
|
+
this.fileMap = /* @__PURE__ */ new Map([["base.css", getBaseCss(this.context)]]);
|
|
3398
|
+
this.fileModifiedMap = /* @__PURE__ */ new Map();
|
|
3399
|
+
contextCache.set(configHash, this.context);
|
|
3400
|
+
builderCache.set(this.context, { fileMap: this.fileMap, fileModifiedMap: this.fileModifiedMap });
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
ensure() {
|
|
3404
|
+
if (!this.context)
|
|
3405
|
+
throw new Error("context not loaded");
|
|
3406
|
+
return this.context;
|
|
3407
|
+
}
|
|
3408
|
+
async extract() {
|
|
3409
|
+
const ctx = this.ensure();
|
|
3410
|
+
const done = logger4.time.info("Extracted in");
|
|
3411
|
+
await ctx.extract(async (file) => {
|
|
3412
|
+
const mtime = existsSync2(file) ? statSync(file).mtimeMs : -Infinity;
|
|
3413
|
+
const isUnchanged = this.fileModifiedMap.has(file) && mtime === this.fileModifiedMap.get(file);
|
|
3414
|
+
if (isUnchanged)
|
|
3415
|
+
return;
|
|
3416
|
+
const result = extractFile(ctx, file);
|
|
3417
|
+
if (!result)
|
|
3418
|
+
return;
|
|
3419
|
+
this.fileModifiedMap.set(file, mtime);
|
|
3420
|
+
this.updateFile(file, result.css);
|
|
3421
|
+
return result;
|
|
3422
|
+
});
|
|
3423
|
+
done();
|
|
3424
|
+
}
|
|
3425
|
+
toString() {
|
|
3426
|
+
return Array.from(this.fileMap.values()).join("");
|
|
3427
|
+
}
|
|
3428
|
+
write(root) {
|
|
3429
|
+
const prev = root.toString();
|
|
3430
|
+
root.removeAll();
|
|
3431
|
+
const css2 = discardDuplicate2(prev + this.toString());
|
|
3432
|
+
root.append(css2);
|
|
3433
|
+
}
|
|
3434
|
+
registerDependency(fn) {
|
|
3435
|
+
const ctx = this.ensure();
|
|
3436
|
+
for (const fileOrGlob of ctx.config.include) {
|
|
3437
|
+
const dependency = parseDependency(fileOrGlob);
|
|
3438
|
+
if (dependency) {
|
|
3439
|
+
fn(dependency);
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
for (const file of ctx.conf.dependencies) {
|
|
3443
|
+
fn({ type: "dependency", file: resolve3(file) });
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
};
|
|
3447
|
+
|
|
3448
|
+
// src/exec.ts
|
|
3449
|
+
init_esm_shims();
|
|
3450
|
+
import { logger as logger5 } from "@pandacss/logger";
|
|
3451
|
+
import { spawnSync } from "child_process";
|
|
3452
|
+
import getPackageManager from "preferred-pm";
|
|
3453
|
+
async function execCommand(cmd, cwd) {
|
|
3454
|
+
const manager = await getPackageManager(cwd);
|
|
3455
|
+
const pm = manager?.name ?? "npm";
|
|
3456
|
+
const args = cmd.split(" ");
|
|
3457
|
+
if (pm === "npm") {
|
|
3458
|
+
args.unshift("run");
|
|
3459
|
+
}
|
|
3460
|
+
const check = spawnSync(pm, args, { cwd, stdio: "pipe" });
|
|
3461
|
+
if (check.status !== 0) {
|
|
3462
|
+
logger5.error(check.stderr.toString());
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
// src/generate.ts
|
|
3467
|
+
init_esm_shims();
|
|
3468
|
+
|
|
3469
|
+
// src/watch.ts
|
|
3470
|
+
init_esm_shims();
|
|
3471
|
+
import { logger as logger6 } from "@pandacss/logger";
|
|
3472
|
+
import chokidar from "chokidar";
|
|
3473
|
+
import { join as join3 } from "path";
|
|
3474
|
+
function createWatcher(files, options = {}) {
|
|
3475
|
+
const { ignore, cwd = process.cwd(), poll } = options;
|
|
3476
|
+
const coalesce = poll || process.platform === "win32";
|
|
3477
|
+
const watcher = chokidar.watch(files, {
|
|
3478
|
+
usePolling: poll,
|
|
3479
|
+
cwd,
|
|
3480
|
+
ignoreInitial: true,
|
|
3481
|
+
ignorePermissionErrors: true,
|
|
3482
|
+
ignored: ignore,
|
|
3483
|
+
awaitWriteFinish: coalesce ? { stabilityThreshold: 50, pollInterval: 10 } : false
|
|
3484
|
+
});
|
|
3485
|
+
logger6.debug({
|
|
3486
|
+
type: "file:watcher",
|
|
3487
|
+
msg: `watching [${files}]`
|
|
3488
|
+
});
|
|
3489
|
+
process.once("SIGINT", async () => {
|
|
3490
|
+
await watcher.close();
|
|
3491
|
+
});
|
|
3492
|
+
return watcher;
|
|
3493
|
+
}
|
|
3494
|
+
async function createConfigWatcher(conf) {
|
|
3495
|
+
return createWatcher(conf.dependencies);
|
|
3496
|
+
}
|
|
3497
|
+
async function createContentWatcher(ctx, callback) {
|
|
3498
|
+
const { include, cwd, exclude } = ctx;
|
|
3499
|
+
const watcher = createWatcher(include, {
|
|
3500
|
+
cwd,
|
|
3501
|
+
ignore: exclude
|
|
3502
|
+
});
|
|
3503
|
+
watcher.on("all", async (event, file) => {
|
|
3504
|
+
logger6.debug({ type: `file:${event}`, file });
|
|
3505
|
+
ctx.removeSourceFile(file);
|
|
3506
|
+
if (event === "unlink") {
|
|
3507
|
+
ctx.chunks.rm(file);
|
|
3508
|
+
} else {
|
|
3509
|
+
ctx.addSourceFile(file);
|
|
3510
|
+
await callback(file);
|
|
3511
|
+
}
|
|
3512
|
+
});
|
|
3513
|
+
return watcher;
|
|
3514
|
+
}
|
|
3515
|
+
async function createAssetWatcher(ctx, callback) {
|
|
3516
|
+
const { cwd } = ctx;
|
|
3517
|
+
const watcher = createWatcher([join3(ctx.paths.chunk, "**/*.css")], { cwd });
|
|
3518
|
+
watcher.on("all", async (event, file) => {
|
|
3519
|
+
logger6.debug({ type: `asset:${event}`, file });
|
|
3520
|
+
await callback();
|
|
3521
|
+
});
|
|
3522
|
+
return watcher;
|
|
3523
|
+
}
|
|
3524
|
+
process.setMaxListeners(Infinity);
|
|
3525
|
+
async function watch(ctx, options) {
|
|
3526
|
+
const chunkDirWatcher = await createAssetWatcher(ctx, options.onAssetChange);
|
|
3527
|
+
const contentWatcher = await createContentWatcher(ctx, options.onContentChange);
|
|
3528
|
+
const configWatcher = await createConfigWatcher(ctx.conf);
|
|
3529
|
+
async function close() {
|
|
3530
|
+
await configWatcher.close();
|
|
3531
|
+
await chunkDirWatcher.close();
|
|
3532
|
+
await contentWatcher.close();
|
|
3533
|
+
}
|
|
3534
|
+
configWatcher.on("change", async () => {
|
|
3535
|
+
await close();
|
|
3536
|
+
logger6.info("Config changed, restarting...");
|
|
3537
|
+
await options.onConfigChange();
|
|
3538
|
+
});
|
|
3539
|
+
}
|
|
3540
|
+
process.on("unhandledRejection", (reason) => {
|
|
3541
|
+
logger6.error({ err: reason });
|
|
3542
|
+
});
|
|
3543
|
+
process.on("uncaughtException", (err) => {
|
|
3544
|
+
logger6.error({ err });
|
|
3545
|
+
});
|
|
3546
|
+
|
|
3547
|
+
// src/generate.ts
|
|
3548
|
+
async function generate5(config, configPath) {
|
|
3549
|
+
const ctx = await loadConfigAndCreateContext({ config, configPath });
|
|
3550
|
+
await emitAndExtract(ctx);
|
|
3551
|
+
if (ctx.watch) {
|
|
3552
|
+
process.stdin.on("end", () => process.exit());
|
|
3553
|
+
await watch(ctx, {
|
|
3554
|
+
onConfigChange: () => {
|
|
3555
|
+
return generate5(config, configPath);
|
|
3556
|
+
},
|
|
3557
|
+
onAssetChange() {
|
|
3558
|
+
return bundleChunks(ctx);
|
|
3559
|
+
},
|
|
3560
|
+
onContentChange: (file) => {
|
|
3561
|
+
return writeFileChunk(ctx, file);
|
|
3562
|
+
}
|
|
3563
|
+
});
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
// src/scaffold.ts
|
|
3568
|
+
init_esm_shims();
|
|
3569
|
+
import { logger as logger7, quote as quote3 } from "@pandacss/logger";
|
|
3570
|
+
import { writeFile as writeFile2 } from "fs-extra";
|
|
3571
|
+
import { lookItUpSync as lookItUpSync3 } from "look-it-up";
|
|
3572
|
+
import { outdent as outdent21 } from "outdent";
|
|
3573
|
+
import { join as join4 } from "path";
|
|
3574
|
+
import getPackageManager2 from "preferred-pm";
|
|
3575
|
+
async function setupConfig(cwd, { force }) {
|
|
3576
|
+
const configFile = findConfig();
|
|
3577
|
+
const pmResult = await getPackageManager2(cwd);
|
|
3578
|
+
const pm = pmResult?.name ?? "npm";
|
|
3579
|
+
const cmd = pm === "npm" ? "npm run" : pm;
|
|
3580
|
+
const isTs = lookItUpSync3("tsconfig.json", cwd);
|
|
3581
|
+
const file = isTs ? "panda.config.ts" : "panda.config.mjs";
|
|
3582
|
+
logger7.info({ type: "init", msg: `creating panda config file: ${quote3(file)}` });
|
|
3583
|
+
if (!force && configFile) {
|
|
3584
|
+
logger7.warn("config exists", configExistsMessage(cmd));
|
|
3585
|
+
} else {
|
|
3586
|
+
const content = outdent21`
|
|
3587
|
+
import { defineConfig } from "css-panda"
|
|
3588
|
+
import { utilities, breakpoints, conditions, keyframes, tokens, patterns } from "css-panda/presets"
|
|
3589
|
+
|
|
3590
|
+
export default defineConfig({
|
|
3591
|
+
// whether to use css reset
|
|
3592
|
+
preflight: true,
|
|
3593
|
+
// where to look for your css declarations
|
|
3594
|
+
include: ["./src/**/*.{tsx,jsx}", "./pages/**/*.{jsx,tsx}"],
|
|
3595
|
+
// files to exclude
|
|
3596
|
+
exclude: [],
|
|
3597
|
+
// The output directory for system
|
|
3598
|
+
outdir: "design-system",
|
|
3599
|
+
// Add your css conditions here (&:hover, &:focus, etc)
|
|
3600
|
+
conditions,
|
|
3601
|
+
// Add your tokens here
|
|
3602
|
+
tokens,
|
|
3603
|
+
// Add your semantic tokens here
|
|
3604
|
+
semanticTokens: {},
|
|
3605
|
+
// Add your keyframes here (spin, fade, etc)
|
|
3606
|
+
keyframes,
|
|
3607
|
+
// Add your breakpoints here (sm, md, lg, xl)
|
|
3608
|
+
breakpoints,
|
|
3609
|
+
// Add your css property utilities here (mt, ml, etc)
|
|
3610
|
+
utilities,
|
|
3611
|
+
// Add your css patterns here (stack, grid, etc)
|
|
3612
|
+
patterns,
|
|
3613
|
+
})
|
|
3614
|
+
`;
|
|
3615
|
+
await writeFile2(join4(cwd, file), content);
|
|
3616
|
+
logger7.log(thankYouMessage());
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
async function setupPostcss(cwd) {
|
|
3620
|
+
logger7.info({ type: "init", msg: `creating postcss config file: ${quote3("postcss.config.cjs")}` });
|
|
3621
|
+
const content = outdent21`
|
|
3622
|
+
module.exports = {
|
|
3623
|
+
plugins: {
|
|
3624
|
+
'css-panda/postcss': {},
|
|
3625
|
+
},
|
|
3626
|
+
}
|
|
3627
|
+
`;
|
|
3628
|
+
await writeFile2(join4(cwd, "postcss.config.cjs"), content);
|
|
3629
|
+
}
|
|
3630
|
+
export {
|
|
3631
|
+
Builder,
|
|
3632
|
+
createContext,
|
|
3633
|
+
discardDuplicate3 as discardDuplicate,
|
|
3634
|
+
emitAndExtract,
|
|
3635
|
+
emitArtifacts,
|
|
3636
|
+
execCommand,
|
|
3637
|
+
generate5 as generate,
|
|
3638
|
+
loadConfigAndCreateContext,
|
|
3639
|
+
setupConfig,
|
|
3640
|
+
setupPostcss
|
|
3641
|
+
};
|