Compare commits
622
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a50f13b36 | ||
|
|
495bd5a35e | ||
|
|
0cef6dfae6 | ||
|
|
481dad4e02 | ||
|
|
fb9bfcb6b6 | ||
|
|
5ce2c4db38 | ||
|
|
bc48d3c7ce | ||
|
|
d651241c72 | ||
|
|
138b2e5b56 | ||
|
|
238d984f44 | ||
|
|
24f0e0db7f | ||
|
|
aa2f866006 | ||
|
|
63b7bf7184 | ||
|
|
ab5e164d27 | ||
|
|
e07ce505ce | ||
|
|
e96dfd38be | ||
|
|
018f067bbe | ||
|
|
adaa2f3bf9 | ||
|
|
90501f76a9 | ||
|
|
400451ee40 | ||
|
|
9866d61658 | ||
|
|
77f424f327 | ||
|
|
69f65cb92f | ||
|
|
2745c25b1d | ||
|
|
f5a71acb7e | ||
|
|
247e2395e6 | ||
|
|
3305477d7b | ||
|
|
4e86fb3285 | ||
|
|
52e9e946c9 | ||
|
|
87f9349a8b | ||
|
|
fbbebd8ad0 | ||
|
|
acecd8cf37 | ||
|
|
ec9350c34c | ||
|
|
396966dcbf | ||
|
|
8821deda12 | ||
|
|
5a5a24f0c4 | ||
|
|
02029a3f70 | ||
|
|
55928e7f99 | ||
|
|
4661fdcefd | ||
|
|
79a8a8c306 | ||
|
|
5ef1f4f941 | ||
|
|
6ecec81e4e | ||
|
|
fe68e8ca4d | ||
|
|
d3afe12a16 | ||
|
|
718a3fb106 | ||
|
|
f480812ba5 | ||
|
|
e4910dfd10 | ||
|
|
11e4eb9cf5 | ||
|
|
506f66197e | ||
|
|
f2b2346fa9 | ||
|
|
b1ded92b08 | ||
|
|
3bceedecad | ||
|
|
1ba319d5a0 | ||
|
|
f2e24a766c | ||
|
|
a2f4f9fbf0 | ||
|
|
cd6f9fe477 | ||
|
|
9c80b2889f | ||
|
|
96d04de4c2 | ||
|
|
b99029c9b5 | ||
|
|
a45e2b5ad6 | ||
|
|
164d3f82c2 | ||
|
|
d4865a2637 | ||
|
|
185bc2c849 | ||
|
|
8f7c6e4f9d | ||
|
|
d7762ed984 | ||
|
|
f1d7de5eea | ||
|
|
e2f6094fb5 | ||
|
|
a846cc46f6 | ||
|
|
8550efee19 | ||
|
|
5e07d8fc38 | ||
|
|
13a52a3b5d | ||
|
|
6ffb0f3f2f | ||
|
|
76994edb29 | ||
|
|
8846ebd1c6 | ||
|
|
8330f4adb0 | ||
|
|
dfe4544700 | ||
|
|
8e35e0598a | ||
|
|
d30d5b7563 | ||
|
|
23a2e94b9f | ||
|
|
4ee6d70ad9 | ||
|
|
42c85f0247 | ||
|
|
c688349ff7 | ||
|
|
4db620b6d0 | ||
|
|
e342c6871d | ||
|
|
21f1809681 | ||
|
|
caa4e2a34d | ||
|
|
aaea183e31 | ||
|
|
1255d9a222 | ||
|
|
a4e81faaeb | ||
|
|
b667c2eaeb | ||
|
|
52a22fc9bb | ||
|
|
db8b6c499f | ||
|
|
f299c65eb5 | ||
|
|
e1f08b7c47 | ||
|
|
69be2dfab6 | ||
|
|
d8d74b5727 | ||
|
|
10f092f23f | ||
|
|
050ce21cd8 | ||
|
|
f032bbb714 | ||
|
|
04350516fd | ||
|
|
42dc8475f2 | ||
|
|
3155917066 | ||
|
|
88c4a1e6b0 | ||
|
|
d6d7f210dc | ||
|
|
7a22b9d036 | ||
|
|
02d50c667d | ||
|
|
fb14e821b5 | ||
|
|
30d32f18fa | ||
|
|
6281af8c03 | ||
|
|
8a4a167208 | ||
|
|
dcd8d8fd7d | ||
|
|
6882509420 | ||
|
|
30ef122051 | ||
|
|
6db8ffc8b1 | ||
|
|
0cfa027f0c | ||
|
|
e6c05e5ad7 | ||
|
|
4ddef8c12f | ||
|
|
2fa0da1d8c | ||
|
|
78abaa51f9 | ||
|
|
154d675583 | ||
|
|
f4238a313e | ||
|
|
41baa1dd3b | ||
|
|
67363dce38 | ||
|
|
c652ff5f07 | ||
|
|
3063dbf92e | ||
|
|
620dc9e048 | ||
|
|
5df7d2c6bd | ||
|
|
bfd25ce1b8 | ||
|
|
1cedefcda8 | ||
|
|
948c50f9e3 | ||
|
|
4edb80fadb | ||
|
|
900c8df665 | ||
|
|
76800a43e8 | ||
|
|
ee700d5ac8 | ||
|
|
f8983fce7b | ||
|
|
1ba615185d | ||
|
|
ee3d082451 | ||
|
|
af8422526d | ||
|
|
e33de2871c | ||
|
|
8ead9ff190 | ||
|
|
3fabd2d402 | ||
|
|
e1a94facba | ||
|
|
223a8b5f48 | ||
|
|
38d8bf7a30 | ||
|
|
4d412a7798 | ||
|
|
706b6d34c8 | ||
|
|
f16dd22fc7 | ||
|
|
2def6a185f | ||
|
|
30de9175ff | ||
|
|
94322a14ef | ||
|
|
9a39358846 | ||
|
|
db51cfb336 | ||
|
|
feae15446f | ||
|
|
57b06cf2fb | ||
|
|
1859732f89 | ||
|
|
57501b57a1 | ||
|
|
7aa9e5c33a | ||
|
|
e011fc76ec | ||
|
|
4c6ee6edb8 | ||
|
|
bc7af3e136 | ||
|
|
e5d88aa2dd | ||
|
|
b405c5f709 | ||
|
|
6435b66c14 | ||
|
|
bb90680e3c | ||
|
|
804bee8f8d | ||
|
|
3e442c5623 | ||
|
|
675c63f69a | ||
|
|
3242edd365 | ||
|
|
340b624dde | ||
|
|
9eebc4005a | ||
|
|
2cec3ec621 | ||
|
|
c62072bc68 | ||
|
|
db5b7e0045 | ||
|
|
75c3c61c3a | ||
|
|
55a6a03228 | ||
|
|
6a6cf4b295 | ||
|
|
f2192633c4 | ||
|
|
c29556536f | ||
|
|
73f8570840 | ||
|
|
d619dbd24c | ||
|
|
ba78da3a66 | ||
|
|
e9129b47b4 | ||
|
|
0ecaa48612 | ||
|
|
1574056169 | ||
|
|
813a1b84e0 | ||
|
|
174c2e0a08 | ||
|
|
1d027a1c48 | ||
|
|
f0b1c548fd | ||
|
|
381c441d9a | ||
|
|
aed367a8f9 | ||
|
|
ee7de49fa2 | ||
|
|
903d46d263 | ||
|
|
6bfed73579 | ||
|
|
7c7419b361 | ||
|
|
5d22278fce | ||
|
|
752da81900 | ||
|
|
9044a9c024 | ||
|
|
79e69295d6 | ||
|
|
5d5586b94b | ||
|
|
816ed145b9 | ||
|
|
112041cdae | ||
|
|
bcd93a8e64 | ||
|
|
05f317adc0 | ||
|
|
a290a828cf | ||
|
|
1d399dac0b | ||
|
|
1f38c753ad | ||
|
|
93488932d8 | ||
|
|
b5599ad551 | ||
|
|
f0b3ea30b1 | ||
|
|
1992670f7d | ||
|
|
e85f7b044c | ||
|
|
484ae34bfb | ||
|
|
f8d34b538e | ||
|
|
56c53e1387 | ||
|
|
7dcf159c44 | ||
|
|
55e359e276 | ||
|
|
ca8e886c94 | ||
|
|
0db3b0f0f0 | ||
|
|
8047428274 | ||
|
|
24d423969f | ||
|
|
d77a6d9dd3 | ||
|
|
31f1845e75 | ||
|
|
a263c60f2d | ||
|
|
1491e360bf | ||
|
|
1996a10115 | ||
|
|
88846175be | ||
|
|
d4e1f77dfa | ||
|
|
154fca3532 | ||
|
|
0332b830e0 | ||
|
|
24b956c576 | ||
|
|
b3822724f7 | ||
|
|
a36a607b6d | ||
|
|
05e639ccba | ||
|
|
c2f939e5d5 | ||
|
|
6aed2fe21b | ||
|
|
e338f83a5d | ||
|
|
8278fc6a1b | ||
|
|
15eb1674a4 | ||
|
|
48ded11524 | ||
|
|
e435233acf | ||
|
|
9b9343e686 | ||
|
|
a12c081d4c | ||
|
|
f11cac9f4c | ||
|
|
fd7a18f5c4 | ||
|
|
be5407f081 | ||
|
|
7d177cb9da | ||
|
|
29829ba42f | ||
|
|
49e2fe0d7b | ||
|
|
5e39f679f6 | ||
|
|
c65c1f7fbd | ||
|
|
677fa4dbba | ||
|
|
0f51984307 | ||
|
|
5b2ff30bf0 | ||
|
|
bbb0bc7894 | ||
|
|
bfcd6bef8a | ||
|
|
79c5451e36 | ||
|
|
0a7befad56 | ||
|
|
f12ccc54e9 | ||
|
|
e3ebe99409 | ||
|
|
dbaed5dfba | ||
|
|
6e39afbcd4 | ||
|
|
a25c178c20 | ||
|
|
2b31ded7ff | ||
|
|
eb0c2d5ac0 | ||
|
|
73e89e1639 | ||
|
|
2db72b127f | ||
|
|
fbb6c1e1f1 | ||
|
|
cc1619345f | ||
|
|
b2dd43c99c | ||
|
|
5d505d2aa4 | ||
|
|
14e2eb71ed | ||
|
|
4b1b5bc4c6 | ||
|
|
c536f3f1d4 | ||
|
|
7432c0d639 | ||
|
|
65bce1fc4f | ||
|
|
5a50c252c9 | ||
|
|
96b6e4b587 | ||
|
|
559c88d3ae | ||
|
|
b65d394d2d | ||
|
|
a83e828781 | ||
|
|
a4ba323ba1 | ||
|
|
a0236b98d0 | ||
|
|
df21fd06f6 | ||
|
|
66c848b541 | ||
|
|
0897d79330 | ||
|
|
60009bf928 | ||
|
|
b7b9d6fee1 | ||
|
|
ce0d013cf4 | ||
|
|
009b1d7484 | ||
|
|
abb1cf0eff | ||
|
|
76702d72c4 | ||
|
|
87f681ee46 | ||
|
|
4cef72fc5e | ||
|
|
e9f5192c03 | ||
|
|
4e218f5a57 | ||
|
|
328712b4d0 | ||
|
|
f660f372ab | ||
|
|
597fc25a87 | ||
|
|
e0a0071a4b | ||
|
|
546e6c059d | ||
|
|
a1ee748ae1 | ||
|
|
278622bc4e | ||
|
|
4db9b37303 | ||
|
|
2832f32d36 | ||
|
|
f10bf6543e | ||
|
|
3bcafd69ab | ||
|
|
4a198d259a | ||
|
|
af66323ee1 | ||
|
|
fbaf700da3 | ||
|
|
dc1d274afa | ||
|
|
8922fa7aae | ||
|
|
af6f870bf0 | ||
|
|
ad5fd83b10 | ||
|
|
e90b08a5b9 | ||
|
|
7551681b5f | ||
|
|
feb1d15ba2 | ||
|
|
a554e8298e | ||
|
|
a897291b18 | ||
|
|
ca95046247 | ||
|
|
cc5b9ddbd0 | ||
|
|
b5b372dcb3 | ||
|
|
c4cc8e3ef2 | ||
|
|
cc20db8a6e | ||
|
|
f5aec59bfa | ||
|
|
4b8879831c | ||
|
|
00e3712f93 | ||
|
|
1c84a7be0a | ||
|
|
780e99f5a5 | ||
|
|
4f9feb0934 | ||
|
|
571af28609 | ||
|
|
b881903dc1 | ||
|
|
8c3b2f33c2 | ||
|
|
12931d0bfc | ||
|
|
60dad7a009 | ||
|
|
772140d3d6 | ||
|
|
a26d488fa0 | ||
|
|
2772f13070 | ||
|
|
3f5404bc7f | ||
|
|
b98d8f0ff3 | ||
|
|
2de08bd117 | ||
|
|
1509c9d61e | ||
|
|
5e3b3b82ae | ||
|
|
ba0d174162 | ||
|
|
642b069461 | ||
|
|
d9b1010c23 | ||
|
|
9fa58fc19e | ||
|
|
4db066bad7 | ||
|
|
4169b220a1 | ||
|
|
5083df27a8 | ||
|
|
19fc186414 | ||
|
|
eaa7cfc956 | ||
|
|
a4c4fc48a8 | ||
|
|
cbc18fc4a3 | ||
|
|
7dc0fb85bb | ||
|
|
2fa2b1d8c3 | ||
|
|
783aaa9c0f | ||
|
|
7e589205c8 | ||
|
|
0765d15e13 | ||
|
|
4ef4e4bf40 | ||
|
|
d4eab1edfa | ||
|
|
0e2f9722b3 | ||
|
|
138574ab11 | ||
|
|
5fe4b9e942 | ||
|
|
b8a9d499e8 | ||
|
|
024d8cd51e | ||
|
|
565568ecc9 | ||
|
|
5afab93eda | ||
|
|
9f2040a5d5 | ||
|
|
f90a7f0a47 | ||
|
|
c6076756c1 | ||
|
|
eb5051e37b | ||
|
|
4a4396a2e6 | ||
|
|
bff84b96dc | ||
|
|
03e22ac421 | ||
|
|
0fedfcca62 | ||
|
|
b20632dbb5 | ||
|
|
5ef1a7d023 | ||
|
|
4c8ce16f46 | ||
|
|
68ebd3c74f | ||
|
|
c59712d6d0 | ||
|
|
a43343307c | ||
|
|
8263e71dca | ||
|
|
2c51c3236b | ||
|
|
7cf4fd80fa | ||
|
|
2900668419 | ||
|
|
a0825490c8 | ||
|
|
38d36e31ae | ||
|
|
2d6f3c6259 | ||
|
|
4e8a47b715 | ||
|
|
a35c8c2bf9 | ||
|
|
0c5b8a53c6 | ||
|
|
782ca4921d | ||
|
|
3ca41865f4 | ||
|
|
31a9345e53 | ||
|
|
a826d01528 | ||
|
|
178620c9fe | ||
|
|
58d928addf | ||
|
|
9c835b1c0f | ||
|
|
5441ab29bf | ||
|
|
eaf4bd199c | ||
|
|
ef37be796a | ||
|
|
2c02a87f77 | ||
|
|
8fa75b612e | ||
|
|
8b9a5f9d3c | ||
|
|
781e9c784c | ||
|
|
0c3073fc3c | ||
|
|
eca546c079 | ||
|
|
16e5741be7 | ||
|
|
a25d08924a | ||
|
|
88d084b1a7 | ||
|
|
3be706190f | ||
|
|
e2b368d61a | ||
|
|
1fdfb10a3c | ||
|
|
0bbce1bca2 | ||
|
|
a99f52d00e | ||
|
|
041635afcb | ||
|
|
bfe14b10a9 | ||
|
|
5cda67b649 | ||
|
|
89b94e36ff | ||
|
|
c2e612f28a | ||
|
|
34de1a6301 | ||
|
|
db0907be2e | ||
|
|
e15c1dcbda | ||
|
|
c86437abb6 | ||
|
|
94476aba23 | ||
|
|
a7906946b3 | ||
|
|
5f181fcfb0 | ||
|
|
f51be3438f | ||
|
|
0e4ba59595 | ||
|
|
00de0b243d | ||
|
|
5cf99566f7 | ||
|
|
a3b6f235f1 | ||
|
|
2089a50cc8 | ||
|
|
88d356dcef | ||
|
|
415b2a5fc8 | ||
|
|
cf9e88a240 | ||
|
|
80574fd68e | ||
|
|
e76078c642 | ||
|
|
c150933b14 | ||
|
|
5bff7c5130 | ||
|
|
fdb489dda4 | ||
|
|
86171f094a | ||
|
|
6208b70c48 | ||
|
|
b550c38dd9 | ||
|
|
b1918efcce | ||
|
|
3a454209ef | ||
|
|
a5751feddb | ||
|
|
390973b567 | ||
|
|
9b81cea1e2 | ||
|
|
0f951d3328 | ||
|
|
8b229f5ee1 | ||
|
|
3a71abb41d | ||
|
|
62881798f2 | ||
|
|
a12e648392 | ||
|
|
94f580ea3a | ||
|
|
b88964891a | ||
|
|
f93e50fd0b | ||
|
|
fe59f9bb35 | ||
|
|
9eb6efe6df | ||
|
|
e4e2a554af | ||
|
|
ad5dfdc899 | ||
|
|
adb55dc4d0 | ||
|
|
bf91c9a480 | ||
|
|
976f259106 | ||
|
|
041ba48a41 | ||
|
|
1930c780b3 | ||
|
|
2070558704 | ||
|
|
9717965418 | ||
|
|
d041b8f345 | ||
|
|
3d3f26e735 | ||
|
|
05d4974aab | ||
|
|
bf3d054dc3 | ||
|
|
7b5bdf0f14 | ||
|
|
cea65745b5 | ||
|
|
a56c2d8615 | ||
|
|
411269bb8b | ||
|
|
a461112a0b | ||
|
|
90cbc9c3a0 | ||
|
|
dd0a6500af | ||
|
|
0a1dbefe78 | ||
|
|
7713b13dd7 | ||
|
|
0e52b28b60 | ||
|
|
ebeb52c1c9 | ||
|
|
3f4a323aa2 | ||
|
|
a469c85622 | ||
|
|
cac0a1491e | ||
|
|
53a3384ecd | ||
|
|
7ea3058a8a | ||
|
|
2707172524 | ||
|
|
ce68e00620 | ||
|
|
bcc66fd103 | ||
|
|
04d4b826f2 | ||
|
|
cbbd517783 | ||
|
|
761d323bab | ||
|
|
c1d2b3c9bc | ||
|
|
b34410c153 | ||
|
|
f7c7f6dee7 | ||
|
|
5085ba0bcc | ||
|
|
95abc6e250 | ||
|
|
292c8b60ea | ||
|
|
131f12b3cb | ||
|
|
8991a41b78 | ||
|
|
deda31859a | ||
|
|
c19cc13d62 | ||
|
|
ff5ff96613 | ||
|
|
c82606234c | ||
|
|
c7b06ce27d | ||
|
|
cd9228a6fc | ||
|
|
19b665c9e5 | ||
|
|
0f6c6c8ee9 | ||
|
|
debe0388fa | ||
|
|
ac01db92c5 | ||
|
|
3563f3acbc | ||
|
|
ed8bf2aa37 | ||
|
|
d34639e13a | ||
|
|
1825c37b64 | ||
|
|
19846af284 | ||
|
|
47584e42a7 | ||
|
|
ea1dd677e0 | ||
|
|
7138b6e9bb | ||
|
|
f6aaa3f6b8 | ||
|
|
0ef2a091cd | ||
|
|
6d0e2feb9e | ||
|
|
7f3998e831 | ||
|
|
bc63259285 | ||
|
|
99f6f19a43 | ||
|
|
4460820814 | ||
|
|
d548bb7a8b | ||
|
|
19442ef64c | ||
|
|
4e8e02dfb9 | ||
|
|
d7594743ab | ||
|
|
3ec49eec80 | ||
|
|
1aa1fa366e | ||
|
|
e38a4f83c0 | ||
|
|
96f141eb0f | ||
|
|
073d099645 | ||
|
|
0e63ecc955 | ||
|
|
60bb9be9fa | ||
|
|
d5edbdc9c3 | ||
|
|
c21f1e479d | ||
|
|
5fefe84ee6 | ||
|
|
f1069d7e18 | ||
|
|
12714421fb | ||
|
|
4c70188eb8 | ||
|
|
6fe375aab5 | ||
|
|
004824e7cb | ||
|
|
09ec31cf94 | ||
|
|
f7d6bb9d4d | ||
|
|
df72fa2690 | ||
|
|
b25a137d41 | ||
|
|
129c5be62d | ||
|
|
1080d6a663 | ||
|
|
c678b86c40 | ||
|
|
e32bff7425 | ||
|
|
d3bd82b91b | ||
|
|
dc0d7fc706 | ||
|
|
70cb9f4ac2 | ||
|
|
98a6282c95 | ||
|
|
24a6c6bd09 | ||
|
|
a5d7e62d79 | ||
|
|
76507ff05f | ||
|
|
d824ca6e70 | ||
|
|
5abc6dfc8c | ||
|
|
90b783cfd5 | ||
|
|
65c95e6221 | ||
|
|
0394fe3984 | ||
|
|
ddcb41b6a0 | ||
|
|
66ee3e1f79 | ||
|
|
f1dc815b04 | ||
|
|
610b6ae11f | ||
|
|
1c294e05df | ||
|
|
3fcd28122b | ||
|
|
56c6c11f52 | ||
|
|
dbb0b86599 | ||
|
|
c98e7efc55 | ||
|
|
febb844153 | ||
|
|
07eee96e8f | ||
|
|
e56b9a849b | ||
|
|
8398e02205 | ||
|
|
e5c68e5985 | ||
|
|
faa1578258 | ||
|
|
04052c3889 | ||
|
|
d25953076b | ||
|
|
ebd62a20b2 | ||
|
|
04b7d10415 | ||
|
|
d479205bae | ||
|
|
51724a580b | ||
|
|
5bb3d36e91 | ||
|
|
67f14c9df2 | ||
|
|
a863a00582 | ||
|
|
6397114f33 | ||
|
|
0c182622be | ||
|
|
6b3e7fa9ea | ||
|
|
19774fc5fc | ||
|
|
77ceb9b242 | ||
|
|
942ff7840e | ||
|
|
8c42fb7219 | ||
|
|
27fd0ea086 | ||
|
|
d7a49bd541 | ||
|
|
97b65f8c39 | ||
|
|
a83e5d62de | ||
|
|
8640b7f69a | ||
|
|
f217d6d20b | ||
|
|
da04f7dc25 | ||
|
|
7f00155c65 | ||
|
|
15712cace1 | ||
|
|
989a4f99b5 | ||
|
|
246e24cedb | ||
|
|
4f3ac52784 | ||
|
|
5695ba2703 | ||
|
|
7f3ea159db | ||
|
|
e5af60cfba | ||
|
|
f0fadf2cd2 | ||
|
|
0f6df898a2 | ||
|
|
f004c7f9fe | ||
|
|
0025e902c1 | ||
|
|
51a1760945 | ||
|
|
c8bac0ca8d | ||
|
|
50a0eac2ce | ||
|
|
e27b88db60 | ||
|
|
9a73ceaff0 | ||
|
|
38fdf8d4c4 |
No files matched your search
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: Arthi-chaud
|
||||
@@ -4,12 +4,12 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22.x
|
||||
node-version: 24.x
|
||||
package-manager-cache: false
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
./front/node_modules
|
||||
|
||||
@@ -8,7 +8,7 @@ runs:
|
||||
- run: mkdir ./pip-cache
|
||||
shell: sh
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
./pip-cache
|
||||
|
||||
@@ -14,4 +14,3 @@ runs:
|
||||
check-latest: true
|
||||
go-version-file: "scanner/go.mod"
|
||||
cache-dependency-path: scanner/go.sum
|
||||
go-version: "1.24.1"
|
||||
@@ -7,7 +7,7 @@ runs:
|
||||
shell: sh
|
||||
run: apk add --update --no-progress tar
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
./server/node_modules
|
||||
|
||||
@@ -24,7 +24,7 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Get Tag
|
||||
shell: bash
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
@@ -34,29 +34,29 @@ runs:
|
||||
if: ${{ github.event_name != 'release' }}
|
||||
run: echo "VERSION=$(git rev-parse --short ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }})" >> $GITHUB_ENV
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ inputs.docker-username }}
|
||||
password: ${{ inputs.docker-token }}
|
||||
- name: Log in to the GitHub Container registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ inputs.github-token }}
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: |
|
||||
arthichaud/meelo-${{ inputs.image-suffix }}
|
||||
ghcr.io/${{ github.repository }}-${{ inputs.image-suffix }}
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: ${{ inputs.context }}
|
||||
platforms: ${{ (inputs.publish == 'true' || inputs.publish == true) && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
|
||||
|
||||
+12
-10
@@ -2,26 +2,28 @@
|
||||
|
||||
changelog:
|
||||
categories:
|
||||
- title: Exciting New Features 🎉
|
||||
- title: 🎉 New Features
|
||||
labels:
|
||||
- Feature
|
||||
- title: Improvements, Optimisations & Enhancements 👍
|
||||
- title: 👍 Improvements, Optimisations & Enhancements
|
||||
labels:
|
||||
- Enhancement/Optimization
|
||||
- Layout
|
||||
- title: Fixes & Patches 🩹
|
||||
- title: 🐛 Bug Fixes
|
||||
labels:
|
||||
- Bug
|
||||
- Fixes
|
||||
- title: Security 🛡
|
||||
- title: 🌐 Translations
|
||||
labels:
|
||||
- Translation
|
||||
- title: 🛡 Security
|
||||
labels:
|
||||
- Security
|
||||
- title: Documentation 📖
|
||||
- title: 📖 Documentation
|
||||
labels:
|
||||
- Documentation
|
||||
- title: Deployment ⚙
|
||||
- title: 📤 Deployment
|
||||
labels:
|
||||
- CI/CD
|
||||
- title: Other Changes 🔀
|
||||
labels:
|
||||
- "*"
|
||||
exclude:
|
||||
labels:
|
||||
- release-note-ignore
|
||||
@@ -1,5 +1,6 @@
|
||||
name: "Front (Mobile)"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
@@ -24,7 +25,7 @@ jobs:
|
||||
front: ${{ steps.filter.outputs.front }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
@@ -36,44 +37,43 @@ jobs:
|
||||
- 'front/packages/**'
|
||||
- '.github/workflows/front-mobile.yml'
|
||||
- '.github/actions/cache-front/**'
|
||||
# TODO Does not work, reports errors about unknown props
|
||||
# Typecheck:
|
||||
# needs: changes
|
||||
# if: ${{ needs.changes.outputs.front == 'true' && github.event_name == 'pull_request' }}
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Check out the repo
|
||||
# uses: actions/checkout@v5
|
||||
# - name: Restore Dependencies
|
||||
# uses: ./.github/actions/cache-front
|
||||
# - name: Install Dependencies
|
||||
# run: yarn workspaces focus mobile
|
||||
# - name: Run tsc
|
||||
# run: yarn workspace mobile tsc
|
||||
Biome:
|
||||
Typecheck:
|
||||
needs: changes
|
||||
# Note: We don't need Biome to be run, however, since Build needs it
|
||||
# We have no choice but to run it anyway :(
|
||||
if: ${{ github.event_name == 'release' || (needs.changes.outputs.front == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' || (needs.changes.outputs.front == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-front
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
- name: Run tsc
|
||||
run: yarn workspace mobile tsc
|
||||
Biome:
|
||||
needs: changes
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' || (needs.changes.outputs.front == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-front
|
||||
- name: Install Dependencies
|
||||
run: yarn workspaces focus -A
|
||||
- name: Run Linter
|
||||
run: yarn run -T biome ci . ../../packages
|
||||
Build:
|
||||
needs: [Biome]
|
||||
Android:
|
||||
name: Build (Android)
|
||||
needs: [Biome, Typecheck]
|
||||
permissions:
|
||||
contents: write
|
||||
if: ${{ github.event_name == 'release' || (needs.changes.outputs.front == 'true' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
|
||||
# Only run if manually requested, pushed on main or on release
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' || (needs.changes.outputs.front == 'true' && ((github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Get Tag
|
||||
shell: bash
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
with:
|
||||
eas-version: latest
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
- name: Build
|
||||
- name: Remove unused packages
|
||||
run: |
|
||||
# Source: https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
|
||||
sudo apt-get remove -y '^llvm-.*' ;
|
||||
@@ -108,11 +108,12 @@ jobs:
|
||||
sudo apt-get autoremove -y ;
|
||||
sudo apt-get clean ;
|
||||
rm -rf /usr/share/dotnet/
|
||||
|
||||
eas build --platform android --profile ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} --local --non-interactive && mv *.apk ${{ env.APK_NAME }}
|
||||
- name: Build
|
||||
run: |
|
||||
DISABLE_SVG=1 eas build --platform android --profile ${{ github.event_name == 'pull_request' && 'preview' || 'production' }} --local --non-interactive && mv *.apk ${{ env.APK_NAME }}
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: ${{ env.APK_NAME }}
|
||||
@@ -123,3 +124,141 @@ jobs:
|
||||
with:
|
||||
files: |
|
||||
./front/apps/mobile/${{ env.APK_NAME }}
|
||||
IOS:
|
||||
name: Build (iOS)
|
||||
runs-on: macos-26
|
||||
needs: [Biome, Typecheck]
|
||||
permissions:
|
||||
contents: write
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'release' || (needs.changes.outputs.front == 'true' && ((github.event_name == 'push' && github.ref == 'refs/heads/main'))) }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v6
|
||||
- name: Get Tag & Build Changelog
|
||||
shell: bash
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
run: |
|
||||
echo "EXPO_PUBLIC_BUILD_COMMIT=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
||||
|
||||
echo "WHATS_NEW=This version of the app is compatible with Meelo ${{ github.event.release.tag_name }}. Using the app with a mismatched version may cause unexpected behaviour. For more information, check out the changelog on GitHub." >> $GITHUB_ENV
|
||||
- name: Get Commit & Build Changelog
|
||||
shell: bash
|
||||
if: ${{ github.event_name != 'release' }}
|
||||
run: |
|
||||
export BUILD_COMMIT=$(git rev-parse --short ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }})
|
||||
echo "EXPO_PUBLIC_BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV
|
||||
|
||||
{
|
||||
echo "WHATS_NEW<<EOF_"
|
||||
printf '%s\n\n' "${{ github.event_name == 'pull_request' && github.event.pull_request.title || github.event.head_commit.message }}."
|
||||
echo "Warning: This version of the app was built from the main branch (commit $BUILD_COMMIT). Make sure to update your instance using the edge tag, and pull the latest images."
|
||||
echo "EOF_"
|
||||
} >> $GITHUB_ENV
|
||||
- name: Import Certs
|
||||
uses: apple-actions/import-codesign-certs@v3
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.APPSTORE_CERTIFICATES_FILE_BASE64 }}
|
||||
p12-password: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }}
|
||||
- name: Download Store Provisioning Profile
|
||||
id: dl_store_prof
|
||||
uses: apple-actions/download-provisioning-profiles@v4
|
||||
with:
|
||||
bundle-id: "com.arthichaud.meelo"
|
||||
profile-type: "IOS_APP_STORE"
|
||||
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
|
||||
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
|
||||
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
|
||||
- name: Get Profile Info
|
||||
run: |
|
||||
echo "PROFILE_UUID=$(echo '${{ steps.dl_store_prof.outputs.profiles }}' | jq -r '.[-1].udid')" >> $GITHUB_ENV
|
||||
echo "PROFILE_NAME=$(echo '${{ steps.dl_store_prof.outputs.profiles }}' | jq -r '.[-1].name')" >> $GITHUB_ENV
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-front
|
||||
- name: Install Dependencies
|
||||
run: yarn workspaces focus -A
|
||||
- name: Setup EAS
|
||||
uses: expo/expo-github-action@v8
|
||||
with:
|
||||
eas-version: latest
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
- name: Prebuild
|
||||
run: yarn run expo prebuild -p ios
|
||||
- name: Build
|
||||
run: CI=1 yarn run ios --no-bundler
|
||||
# NOTE: Caching Pods does not seem to improve compilation time
|
||||
- name: Set Version and Build number
|
||||
run: |
|
||||
cd ios
|
||||
xcrun agvtool new-marketing-version "$(echo ${{ github.event_name == 'release' && '$EXPO_PUBLIC_BUILD_COMMIT' || '0.1' }} | tr -d v)"
|
||||
xcrun agvtool new-version "$(date '+%Y%m%d')${{ github.run_number }}"
|
||||
- name: Define Export Options
|
||||
run: |
|
||||
cd ios
|
||||
cat > ExportOptions.plist <<EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>method</key>
|
||||
<string>app-store-connect</string>
|
||||
<key>provisioningProfiles</key>
|
||||
<dict>
|
||||
<key>com.arthichaud.meelo</key>
|
||||
<string>${{ env.PROFILE_NAME }}</string>
|
||||
</dict>
|
||||
<key>signingStyle</key>
|
||||
<string>manual</string>
|
||||
<key>uploadSymbols</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
- name: Archive
|
||||
run: |
|
||||
cd ios
|
||||
xcodebuild \
|
||||
-workspace Meelo.xcworkspace \
|
||||
-scheme Meelo \
|
||||
-configuration Release \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-sdk iphoneos \
|
||||
-archivePath build/Meelo.xcarchive \
|
||||
archive \
|
||||
CODE_SIGN_STYLE=Manual \
|
||||
PROVISIONING_PROFILE=${{ env.PROFILE_UUID }} \
|
||||
CODE_SIGN_IDENTITY="iPhone Distribution"
|
||||
|
||||
- name: Export IPA
|
||||
run: |
|
||||
cd ios
|
||||
xcodebuild \
|
||||
-exportArchive \
|
||||
-archivePath build/Meelo.xcarchive \
|
||||
-exportOptionsPlist ExportOptions.plist \
|
||||
-exportPath build/Meelo
|
||||
- name: Get IPA Path
|
||||
run: echo "IPA_PATH=${{ format('{0}/front/apps/mobile/ios/build/Meelo/Meelo.ipa', github.workspace) }}" >> $GITHUB_ENV
|
||||
- name: Upload app to TestFlight
|
||||
uses: apple-actions/upload-testflight-build@v4
|
||||
if: ${{ github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||
with:
|
||||
app-path: ${{ env.IPA_PATH }}
|
||||
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
|
||||
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
|
||||
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
|
||||
release-notes: ${{ env.WHATS_NEW }}
|
||||
# NOTE: When false, release notes are not uploaded :/
|
||||
wait-for-processing: "true"
|
||||
backend: AppStoreAPI
|
||||
- name: Upload IPA
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: Meelo.ipa
|
||||
path: ${{ env.IPA_PATH }}
|
||||
- name: Add IPA to release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
with:
|
||||
files: |
|
||||
${{ env.IPA_PATH }}
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
front: ${{ steps.filter.outputs.front }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-front
|
||||
- name: Install Dependencies
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-front
|
||||
- name: Install Dependencies
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ needs.changes.outputs.front == 'true' && always() }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
# - name: Downlad Coverage artifact
|
||||
# uses: actions/download-artifact@v4
|
||||
# with:
|
||||
@@ -94,7 +94,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: ./.github/actions/dockerize
|
||||
with:
|
||||
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
matcher: ${{ steps.filter.outputs.matcher }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
@@ -37,24 +37,24 @@ jobs:
|
||||
Typecheck:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.matcher == 'true' && github.event_name == 'pull_request' }}
|
||||
container: python:3.13-alpine
|
||||
container: python:3.14-alpine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-matcher
|
||||
- uses: jakebailey/pyright-action@v2
|
||||
- uses: jakebailey/pyright-action@v3
|
||||
with:
|
||||
working-directory: "./matcher/matcher"
|
||||
Lint:
|
||||
if: ${{ needs.changes.outputs.matcher == 'true' && github.event_name == 'pull_request' }}
|
||||
container: python:3.13-alpine
|
||||
container: python:3.14-alpine
|
||||
runs-on: ubuntu-latest
|
||||
needs: [Typecheck]
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-matcher
|
||||
- run: pip install ruff
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [Typecheck]
|
||||
container: python:3.13-alpine
|
||||
container: python:3.14-alpine
|
||||
if: ${{ needs.changes.outputs.matcher == 'true' && always() }}
|
||||
env:
|
||||
GENIUS_ACCESS_TOKEN: "${{ secrets.GENIUS_ACCESS_TOKEN }}"
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
CI: "1"
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-matcher
|
||||
- run: python3 -m pytest
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: ./.github/actions/dockerize
|
||||
with:
|
||||
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/labeler@v6
|
||||
with:
|
||||
configuration-path: .github/pr_labeler.yml
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Set Tag env var
|
||||
run: |
|
||||
VERSION=${{ github.event.release.tag_name }}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
name: Renovate
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 */6 * * *"
|
||||
push: # To rebase pending branches/PRs
|
||||
branches: [main]
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/renovate.yml"
|
||||
- ".github/renovate-entrypoint.sh"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v46.1.6
|
||||
with:
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
env:
|
||||
RENOVATE_REPOSITORIES: ${{ github.repository }}
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
scanner: ${{ steps.filter.outputs.scanner }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup Go
|
||||
uses: ./.github/actions/cache-scanner
|
||||
- name: Install Dependencies and Build
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
needs: [Build]
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup Go
|
||||
uses: ./.github/actions/cache-scanner
|
||||
- uses: Jerome1337/gofmt-action@v1.0.5
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
if: ${{ needs.changes.outputs.scanner == 'true' && always() }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup Go
|
||||
uses: ./.github/actions/cache-scanner
|
||||
- run: apt-get update -y && apt-get install -y ffmpeg
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
run: go test ./... -coverprofile=coverage.out
|
||||
- name: Upload Unit Tests artifact
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: coverage-report-scanner
|
||||
path: ./scanner/coverage.out
|
||||
@@ -91,9 +91,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ needs.changes.outputs.scanner == 'true' && always() }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- name: Downlad Coverage artifact
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: coverage-report-scanner
|
||||
path: ./scanner
|
||||
@@ -113,7 +113,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: ./.github/actions/dockerize
|
||||
with:
|
||||
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
server: ${{ steps.filter.outputs.server }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
@@ -37,20 +37,24 @@ jobs:
|
||||
Build:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.server == 'true' && github.event_name == 'pull_request' }}
|
||||
container: node:22-alpine3.20
|
||||
container: node:24-alpine3.23
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# NOTE: Necessary for prisma's code gen
|
||||
DATABASE_URL: "postgresql://test:test@postgres:5432/test?schema=public"
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-server
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
Biome:
|
||||
if: ${{ needs.changes.outputs.server == 'true' && github.event_name == 'pull_request' }}
|
||||
container: node:22-alpine3.20
|
||||
container: node:24-alpine3.23
|
||||
runs-on: ubuntu-latest
|
||||
needs: [Build]
|
||||
permissions:
|
||||
@@ -58,7 +62,7 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-server
|
||||
- name: Install Dependencies
|
||||
@@ -67,7 +71,7 @@ jobs:
|
||||
run: yarn run biome ci .
|
||||
Tests:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:22-alpine3.20
|
||||
container: node:24-alpine3.23
|
||||
needs: [Build]
|
||||
if: ${{ needs.changes.outputs.server == 'true' && always() }}
|
||||
env:
|
||||
@@ -99,18 +103,18 @@ jobs:
|
||||
MEILI_MASTER_KEY: 1234
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- name: Restore Dependencies
|
||||
uses: ./.github/actions/cache-server
|
||||
- name: Install Dependencies
|
||||
run: yarn install
|
||||
- name: Migrate DB Schema
|
||||
run: yarn run prisma migrate dev
|
||||
run: yarn run prisma generate && yarn run prisma migrate dev
|
||||
- name: Run unit tests with coverage
|
||||
run: yarn --cwd server test --coverage --ci --no-cache --maxConcurrency=1
|
||||
run: yarn --cwd server test:cov
|
||||
- name: Upload Unit Tests artifact
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: coverage-report-server
|
||||
path: ./server/coverage
|
||||
@@ -120,9 +124,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ needs.changes.outputs.server == 'true' && always() }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- name: Downlad Coverage artifact
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: coverage-report-server
|
||||
path: ./server/coverage
|
||||
@@ -142,7 +146,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
- uses: ./.github/actions/dockerize
|
||||
with:
|
||||
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
|
||||
+4
-1
@@ -20,4 +20,7 @@ docs/generated
|
||||
meelo/
|
||||
data/
|
||||
|
||||
.env
|
||||
.env
|
||||
|
||||
**/.direnv
|
||||
**/.envrc
|
||||
+7
-1
@@ -4,6 +4,13 @@ Hi! Thanks for considering contributing to Meelo. The project is open-source and
|
||||
|
||||
Be aware that your code contributions will be published under the [GPL-3.0 license](https://github.com/Arthi-chaud/Meelo/blob/main/LICENSE).
|
||||
|
||||
## Stance on generative AI
|
||||
|
||||
Less than 1% of Meelo's code has been generated by AI. We would like to keep it that way.
|
||||
However, we are not opposed to AI-_powered_ contributions and value transparency.
|
||||
|
||||
**Please disclose any use of AI when contributing. Failure to do so could lead to a reject of your contribution.**
|
||||
|
||||
## Kinds of contributions
|
||||
|
||||
In this document we consider three kinds of contributions:
|
||||
@@ -60,4 +67,3 @@ Some apps have unit tests. If it is doable, please write tests for your code. Th
|
||||
### CI
|
||||
|
||||
If you opened a pull request, the `Dockerisation` steps of the CI might fail. This is expected and should be addressed at some point. All other CI steps should pass (with one exception: the Matcher's tests might fail randomly).
|
||||
|
||||
@@ -45,31 +45,35 @@ Meelo has all the basic features you might expect from a music player/server (pl
|
||||
- Push Scrobbles to ListenBrainz and LastFM!
|
||||
- Download (synced) lyrics or get them from embedded metadata and `.lrc` files
|
||||
|
||||
Keep track of the upcoming features [here](https://github.com/Arthi-chaud/Meelo/issues)
|
||||
Keep track of the upcoming features [here](https://github.com/Arthi-chaud/Meelo/issues).
|
||||
|
||||
<img src="https://github.com/user-attachments/assets/7e1fe7df-638c-42f1-978d-e1cb59f91324" />
|
||||
|
||||
## :iphone: Mobile App
|
||||
|
||||
Meelo has a mobile app for both Android and iOS :tada:.
|
||||
|
||||
You can find the known issues and the list of upcoming features [here](https://github.com/Arthi-chaud/Meelo/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Front%20(Mobile)%22).
|
||||
|
||||
- **Android**: You can download the latest stable APK on the release page. More info [here](https://github.com/Arthi-chaud/Meelo/discussions/1130)
|
||||
- **iOS**: The app is distributed using TestFlight. More info [here](https://github.com/Arthi-chaud/Meelo/discussions/1533)
|
||||
|
||||
APKs and IPAs are also built whenever code is pushed to the main branch. Check out [this worklow](https://github.com/Arthi-chaud/Meelo/actions/workflows/front-mobile.yml?query=branch%3Amain)
|
||||
|
||||
## 🔧 Setup
|
||||
|
||||
:whale: Meelo is shipped though Docker images.
|
||||
|
||||
:point_right: To get started, follow the dedicated [wiki](https://github.com/Arthi-chaud/Meelo/wiki)
|
||||
|
||||
You'll need a 'clean' collection: either with embedded metadata or standard file/folder architecture. Using iTunes or Beets is a great way to start.
|
||||
We love embedded metadata here. Make sure your music is correctly tagged before getting started!
|
||||
|
||||
> [!NOTE]
|
||||
> Meelo is shipped though Docker images. You might need to know a bit about Regexes.
|
||||
|
||||
## :iphone: Android App
|
||||
|
||||
Meelo now has an Android app :tada:. However, it is still in alpha and lacks some important features.
|
||||
|
||||
Go [here](https://github.com/Arthi-chaud/Meelo/discussions/1130) for more information.
|
||||
You can find the known issues and the list of missing/upcoming features [here](https://github.com/Arthi-chaud/Meelo/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Front%20(Mobile)%22)
|
||||
|
||||
While the app is in alpha, we recommend using the web app. With its responsive design, it works perfectly on mobile devices.
|
||||
> [!NOTE]
|
||||
> If you want to rely on the file paths as metadata sources, you might need to be familiar with Regexes!
|
||||
|
||||
## :camera: Screenshots
|
||||
|
||||
[](https://github.com/user-attachments/assets/48141241-25ec-4570-a4f1-696c0cdfcaaa)
|
||||
[](https://github.com/user-attachments/assets/03d0d877-fc76-4078-96d5-af8e2bec3ad0)
|
||||
|
||||
:point_right: You can find more screenshots of the UI [here](./docs/screenshots/)
|
||||
|
||||
@@ -77,6 +81,7 @@ While the app is in alpha, we recommend using the web app. With its responsive d
|
||||
> Some screenshots may be outdated and may not show the state of the latest version of the app. Some minor details may change (e.g. logo, spacing, etc.)
|
||||
</details>
|
||||
|
||||
|
||||
## :desktop_computer: Live Demo
|
||||
|
||||
We are actively working on a public demo, so that you can try out Meelo. Stay tuned...
|
||||
@@ -88,6 +93,8 @@ Feel free to contribute [here](https://hosted.weblate.org/engage/meelo/)!
|
||||
|
||||
[](https://hosted.weblate.org/engage/meelo/)
|
||||
|
||||
🫂 A big thank you to all the translators who contributed!
|
||||
|
||||
Any questions about this? Open a discussion [here](https://github.com/Arthi-chaud/Meelo/discussions/categories/translation)!
|
||||
|
||||
## :handshake: Contributing and Bugs reporting
|
||||
@@ -100,6 +107,29 @@ Any questions about this? Open a discussion [here](https://github.com/Arthi-chau
|
||||
|
||||
:hammer: Would you like to contribute to Meelo? Feel free to [open a pull request](https://github.com/Arthi-chaud/Meelo/compare).
|
||||
|
||||
## 💖 Our Sponsors
|
||||
|
||||
Thanks to the amazing folks who support this project:
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Laflamme">
|
||||
<img src="https://avatars.githubusercontent.com/u/3687644?v=4" height="40"/>
|
||||
</a>
|
||||
<a href="https://github.com/alik-agaev">
|
||||
<img src="https://avatars.githubusercontent.com/u/2662697?v=4" height="40"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
Want to support Meelo? [Become a sponsor](https://github.com/sponsors/Arthi-chaud)
|
||||
|
||||
## :warning: Disclaimer
|
||||
|
||||
> [!WARNING]
|
||||
> Meelo is intended for private use only! Do not use your instance as a public downloading platform.
|
||||
> It is not intended to support heavy traffic, and it should not be used to illegally share/download copyrighted media.
|
||||
>
|
||||
> The maintainers are not responsible for any misuse of the software.
|
||||
|
||||
---
|
||||
|
||||
Get ready to make the most out of you music collection!
|
||||
|
||||
@@ -17,7 +17,7 @@ services:
|
||||
test: ["CMD-SHELL", "wget -qO- localhost:4000"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 20
|
||||
volumes:
|
||||
- ./server/src:/app/src
|
||||
- ./server/prisma:/app/prisma
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
test: ["CMD-SHELL", "wget -qO- localhost:8133"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 20
|
||||
ports:
|
||||
- "8133:8133"
|
||||
environment:
|
||||
@@ -132,7 +132,7 @@ services:
|
||||
"http://0.0.0.0:7700/health",
|
||||
]
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
retries: 10
|
||||
transcoder:
|
||||
image: ghcr.io/zoriya/kyoo_transcoder:master
|
||||
ports:
|
||||
@@ -158,12 +158,12 @@ services:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
retries: 10
|
||||
env_file:
|
||||
- .env
|
||||
mq:
|
||||
hostname: meelo-mq
|
||||
image: rabbitmq:4.0-alpine
|
||||
image: rabbitmq:4.3-alpine
|
||||
environment:
|
||||
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
|
||||
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
|
||||
|
||||
+14
-13
@@ -25,9 +25,9 @@ services:
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- localhost:4000"]
|
||||
interval: 5s
|
||||
interval: 3s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
retries: 20
|
||||
scanner:
|
||||
image: arthichaud/meelo-scanner:${TAG}
|
||||
expose:
|
||||
@@ -37,9 +37,9 @@ services:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- localhost:8133"]
|
||||
interval: 5s
|
||||
interval: 3s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 20
|
||||
environment:
|
||||
- API_URL=http://server:4000
|
||||
- INTERNAL_CONFIG_DIR=${INTERNAL_CONFIG_DIR}
|
||||
@@ -62,7 +62,7 @@ services:
|
||||
- SSR_SERVER_URL=http://server:4000
|
||||
- PUBLIC_SCANNER_URL=${PUBLIC_URL}/scanner
|
||||
- SSR_SCANNER_URL=http://scanner:8133
|
||||
- PUBLIC_MATCHER_URL=http://{PUBLIC_URL}/matcher
|
||||
- PUBLIC_MATCHER_URL=${PUBLIC_URL}/matcher
|
||||
- SSR_MATCHER_URL=http://matcher:6789
|
||||
matcher:
|
||||
image: arthichaud/meelo-matcher:${TAG}
|
||||
@@ -85,9 +85,9 @@ services:
|
||||
image: postgres:alpine3.14
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
@@ -112,8 +112,9 @@ services:
|
||||
"--spider",
|
||||
"http://0.0.0.0:7700/health",
|
||||
]
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
transcoder:
|
||||
image: ghcr.io/zoriya/kyoo_transcoder:master
|
||||
restart: on-failure
|
||||
@@ -134,7 +135,7 @@ services:
|
||||
db:
|
||||
condition: service_healthy
|
||||
mq:
|
||||
image: rabbitmq:4.0-alpine
|
||||
image: rabbitmq:4.3-alpine
|
||||
hostname: meelo-mq
|
||||
environment:
|
||||
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
|
||||
@@ -143,12 +144,12 @@ services:
|
||||
test: rabbitmq-diagnostics -q ping
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 20
|
||||
volumes:
|
||||
- rabbitmq_data:/var/lib/rabbitmq
|
||||
nginx:
|
||||
restart: on-failure
|
||||
image: nginx:1.24.0-alpine
|
||||
image: nginx:1.31.2-alpine
|
||||
depends_on:
|
||||
server:
|
||||
condition: service_started
|
||||
|
||||
+14
-13
@@ -28,9 +28,9 @@ services:
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- localhost:4000"]
|
||||
interval: 5s
|
||||
interval: 3s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
retries: 20
|
||||
front:
|
||||
build:
|
||||
context: ./front
|
||||
@@ -48,7 +48,7 @@ services:
|
||||
- SSR_SERVER_URL=http://server:4000
|
||||
- PUBLIC_SCANNER_URL=${PUBLIC_URL}/scanner
|
||||
- SSR_SCANNER_URL=http://scanner:8133
|
||||
- PUBLIC_MATCHER_URL=http://{PUBLIC_URL}/matcher
|
||||
- PUBLIC_MATCHER_URL=${PUBLIC_URL}/matcher
|
||||
- SSR_MATCHER_URL=http://matcher:6789
|
||||
scanner:
|
||||
build:
|
||||
@@ -62,9 +62,9 @@ services:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- localhost:8133"]
|
||||
interval: 5s
|
||||
interval: 3s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 20
|
||||
environment:
|
||||
- API_URL=http://server:4000
|
||||
- INTERNAL_CONFIG_DIR=${INTERNAL_CONFIG_DIR}
|
||||
@@ -116,9 +116,9 @@ services:
|
||||
image: postgres:alpine3.14
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
@@ -143,10 +143,11 @@ services:
|
||||
"--spider",
|
||||
"http://0.0.0.0:7700/health",
|
||||
]
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
mq:
|
||||
image: rabbitmq:4.0-alpine
|
||||
image: rabbitmq:4.3-alpine
|
||||
hostname: meelo-mq
|
||||
environment:
|
||||
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
|
||||
@@ -155,12 +156,12 @@ services:
|
||||
test: rabbitmq-diagnostics -q ping
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
retries: 20
|
||||
volumes:
|
||||
- rabbitmq_data:/var/lib/rabbitmq
|
||||
nginx:
|
||||
restart: on-failure
|
||||
image: nginx:1.24.0-alpine
|
||||
image: nginx:1.31.2-alpine
|
||||
depends_on:
|
||||
server:
|
||||
condition: service_started
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -1,414 +0,0 @@
|
||||
diff --git a/cpp/core/HybridFunction.hpp b/cpp/core/HybridFunction.hpp
|
||||
index efcea05a248540806cfefd04efb44920ed941228..d8604ffb8cf4c4d6ed42d8238f8012a9d6ca0bd7 100644
|
||||
--- a/cpp/core/HybridFunction.hpp
|
||||
+++ b/cpp/core/HybridFunction.hpp
|
||||
@@ -8,8 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
namespace margelo::nitro {
|
||||
-template <typename T, typename Enable>
|
||||
-struct JSIConverter;
|
||||
+template <typename T, typename Enable> struct JSIConverter;
|
||||
} // namespace margelo::nitro
|
||||
|
||||
#include "CountTrailingOptionals.hpp"
|
||||
@@ -23,13 +22,17 @@ struct JSIConverter;
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
+#ifdef ANDROID
|
||||
+#include <fbjni/fbjni.h>
|
||||
+#endif
|
||||
+
|
||||
namespace margelo::nitro {
|
||||
|
||||
using namespace facebook;
|
||||
|
||||
/**
|
||||
- * Represents the kind of a function - it can be either a normal function ("METHOD"),
|
||||
- * or a property ("GETTER" + "SETTER")
|
||||
+ * Represents the kind of a function - it can be either a normal function
|
||||
+ * ("METHOD"), or a property ("GETTER" + "SETTER")
|
||||
*/
|
||||
enum class FunctionKind { METHOD, GETTER, SETTER };
|
||||
|
||||
@@ -44,76 +47,108 @@ private:
|
||||
|
||||
public:
|
||||
// getters
|
||||
- inline const std::string& getName() const {
|
||||
- return _name;
|
||||
- }
|
||||
- inline size_t getParamCount() const {
|
||||
- return _paramCount;
|
||||
- }
|
||||
- inline const jsi::HostFunctionType& getHostFunction() const {
|
||||
+ inline const std::string &getName() const { return _name; }
|
||||
+ inline size_t getParamCount() const { return _paramCount; }
|
||||
+ inline const jsi::HostFunctionType &getHostFunction() const {
|
||||
return _function;
|
||||
}
|
||||
|
||||
public:
|
||||
// functions
|
||||
- inline jsi::Function toJSFunction(jsi::Runtime& runtime) const {
|
||||
- return jsi::Function::createFromHostFunction(runtime, jsi::PropNameID::forUtf8(runtime, _name), static_cast<unsigned int>(_paramCount),
|
||||
- _function);
|
||||
+ inline jsi::Function toJSFunction(jsi::Runtime &runtime) const {
|
||||
+ return jsi::Function::createFromHostFunction(
|
||||
+ runtime, jsi::PropNameID::forUtf8(runtime, _name),
|
||||
+ static_cast<unsigned int>(_paramCount), _function);
|
||||
}
|
||||
|
||||
private:
|
||||
- HybridFunction(jsi::HostFunctionType&& function, size_t paramCount, const std::string& name)
|
||||
+ HybridFunction(jsi::HostFunctionType &&function, size_t paramCount,
|
||||
+ const std::string &name)
|
||||
: _function(std::move(function)), _paramCount(paramCount), _name(name) {}
|
||||
|
||||
public:
|
||||
/**
|
||||
* Create a new `HybridFunction` that can be called from JS.
|
||||
* This performs proper JSI -> C++ conversion using `JSIConverter<T>`,
|
||||
- * and assumes that the object this is called on has a proper `this` configured.
|
||||
- * The object's `this` needs to be a `NativeState`.
|
||||
+ * and assumes that the object this is called on has a proper `this`
|
||||
+ * configured. The object's `this` needs to be a `NativeState`.
|
||||
*/
|
||||
template <typename THybrid, typename ReturnType, typename... Args>
|
||||
- static inline HybridFunction createHybridFunction(const std::string& name, ReturnType (THybrid::*method)(Args...), FunctionKind kind) {
|
||||
- jsi::HostFunctionType hostFunction = [name, method, kind](/* JS Runtime */ jsi::Runtime& runtime,
|
||||
- /* HybridObject */ const jsi::Value& thisValue,
|
||||
- /* JS arguments */ const jsi::Value* args,
|
||||
- /* argument size */ size_t count) -> jsi::Value {
|
||||
- // 1. Get actual `HybridObject` instance from `thisValue` (it's stored as `NativeState`)
|
||||
- std::shared_ptr<THybrid> hybridInstance = getHybridObjectNativeState<THybrid>(runtime, thisValue, kind, name);
|
||||
-
|
||||
- // 2. Make sure the given arguments match, either with a static size, or with potentially optional arguments size.
|
||||
+ static inline HybridFunction
|
||||
+ createHybridFunction(const std::string &name,
|
||||
+ ReturnType (THybrid::*method)(Args...),
|
||||
+ FunctionKind kind) {
|
||||
+ jsi::HostFunctionType hostFunction =
|
||||
+ [name, method, kind](/* JS Runtime */ jsi::Runtime &runtime,
|
||||
+ /* HybridObject */ const jsi::Value &thisValue,
|
||||
+ /* JS arguments */ const jsi::Value *args,
|
||||
+ /* argument size */ size_t count) -> jsi::Value {
|
||||
+ // 1. Get actual `HybridObject` instance from `thisValue` (it's stored as
|
||||
+ // `NativeState`)
|
||||
+ std::shared_ptr<THybrid> hybridInstance =
|
||||
+ getHybridObjectNativeState<THybrid>(runtime, thisValue, kind, name);
|
||||
+
|
||||
+ // 2. Make sure the given arguments match, either with a static size, or
|
||||
+ // with potentially optional arguments size.
|
||||
constexpr size_t optionalArgsCount = trailing_optionals_count_v<Args...>;
|
||||
constexpr size_t maxArgsCount = sizeof...(Args);
|
||||
constexpr size_t minArgsCount = maxArgsCount - optionalArgsCount;
|
||||
bool isWithinArgsRange = (count >= minArgsCount && count <= maxArgsCount);
|
||||
if (!isWithinArgsRange) [[unlikely]] {
|
||||
// invalid amount of arguments passed!
|
||||
- std::string funcName = getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
||||
+ std::string funcName =
|
||||
+ getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
||||
if constexpr (minArgsCount == maxArgsCount) {
|
||||
- // min and max args length is the same, so we don't have any optional parameters. fixed count
|
||||
- throw jsi::JSError(runtime, "`" + funcName + "` expected " + std::to_string(maxArgsCount) + " arguments, but received " +
|
||||
+ // min and max args length is the same, so we don't have any optional
|
||||
+ // parameters. fixed count
|
||||
+ throw jsi::JSError(runtime, "`" + funcName + "` expected " +
|
||||
+ std::to_string(maxArgsCount) +
|
||||
+ " arguments, but received " +
|
||||
std::to_string(count) + "!");
|
||||
} else {
|
||||
- // min and max args length are different, so we have optional parameters - variable length arguments.
|
||||
- throw jsi::JSError(runtime, "`" + funcName + "` expected between " + std::to_string(minArgsCount) + " and " +
|
||||
- std::to_string(maxArgsCount) + " arguments, but received " + std::to_string(count) + "!");
|
||||
+ // min and max args length are different, so we have optional
|
||||
+ // parameters - variable length arguments.
|
||||
+ throw jsi::JSError(runtime, "`" + funcName + "` expected between " +
|
||||
+ std::to_string(minArgsCount) +
|
||||
+ " and " +
|
||||
+ std::to_string(maxArgsCount) +
|
||||
+ " arguments, but received " +
|
||||
+ std::to_string(count) + "!");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
- // 3. Actually call the method with JSI values as arguments and return a JSI value again.
|
||||
- // Internally, this method converts the JSI values to C++ values using `JSIConverter<T>`.
|
||||
- return callMethod(hybridInstance.get(), method, runtime, args, count, std::index_sequence_for<Args...>{});
|
||||
- } catch (const std::exception& exception) {
|
||||
- // Some exception was thrown - add method name information and re-throw as `JSError`.
|
||||
- std::string funcName = getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
||||
+ // 3. Actually call the method with JSI values as arguments and return a
|
||||
+ // JSI value again.
|
||||
+ // Internally, this method converts the JSI values to C++ values
|
||||
+ // using `JSIConverter<T>`.
|
||||
+ return callMethod(hybridInstance.get(), method, runtime, args, count,
|
||||
+ std::index_sequence_for<Args...>{});
|
||||
+ } catch (const std::exception &exception) {
|
||||
+ // Some exception was thrown - add method name information and re-throw
|
||||
+ // as `JSError`.
|
||||
+ std::string funcName =
|
||||
+ getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
||||
+ std::string message = exception.what();
|
||||
+ throw jsi::JSError(runtime, funcName + ": " + message);
|
||||
+#ifdef ANDROID
|
||||
+#pragma clang diagnostic push
|
||||
+#pragma clang diagnostic ignored "-Wexceptions"
|
||||
+ } catch (const jni::JniException &exception) {
|
||||
+ std::string funcName =
|
||||
+ getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
||||
std::string message = exception.what();
|
||||
throw jsi::JSError(runtime, funcName + ": " + message);
|
||||
+#pragma clang diagnostic pop
|
||||
+#endif
|
||||
} catch (...) {
|
||||
- // Some unknown exception was thrown - add method name information and re-throw as `JSError`.
|
||||
- std::string funcName = getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
||||
+ // Some unknown exception was thrown - add method name information and
|
||||
+ // re-throw as `JSError`.
|
||||
+ std::string funcName =
|
||||
+ getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
||||
std::string errorName = TypeInfo::getCurrentExceptionName();
|
||||
- throw jsi::JSError(runtime, "`" + funcName + "` threw an unknown " + errorName + " error.");
|
||||
+ throw jsi::JSError(runtime, "`" + funcName + "` threw an unknown " +
|
||||
+ errorName + " error.");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -122,46 +157,64 @@ public:
|
||||
|
||||
/**
|
||||
* Create a new `HybridFunction` that can be called from JS.
|
||||
- * Unlike `createHybridFunction(...)`, this method does **not** perform any argument parsing or size checking.
|
||||
- * It is a raw-, untyped JSI method, and the user is expected to manually handle arguments and return values.
|
||||
+ * Unlike `createHybridFunction(...)`, this method does **not** perform any
|
||||
+ * argument parsing or size checking. It is a raw-, untyped JSI method, and
|
||||
+ * the user is expected to manually handle arguments and return values.
|
||||
*/
|
||||
template <typename Derived>
|
||||
- static inline HybridFunction createRawHybridFunction(const std::string& name, size_t expectedArgumentsCount,
|
||||
- jsi::Value (Derived::*method)(jsi::Runtime& runtime, const jsi::Value& thisArg,
|
||||
- const jsi::Value* args, size_t count)) {
|
||||
- jsi::HostFunctionType hostFunction = [name, method](/* JS Runtime */ jsi::Runtime& runtime,
|
||||
- /* HybridObject */ const jsi::Value& thisValue,
|
||||
- /* JS arguments */ const jsi::Value* args,
|
||||
- /* argument size */ size_t count) -> jsi::Value {
|
||||
- // 1. Get actual `HybridObject` instance from `thisValue` (it's stored as `NativeState`)
|
||||
- std::shared_ptr<Derived> hybridInstance = getHybridObjectNativeState<Derived>(runtime, thisValue, FunctionKind::METHOD, name);
|
||||
-
|
||||
- // 2. Call the raw JSI method using raw JSI Values. Exceptions are also expected to be handled by the user.
|
||||
- Derived* pointer = hybridInstance.get();
|
||||
+ static inline HybridFunction createRawHybridFunction(
|
||||
+ const std::string &name, size_t expectedArgumentsCount,
|
||||
+ jsi::Value (Derived::*method)(jsi::Runtime &runtime,
|
||||
+ const jsi::Value &thisArg,
|
||||
+ const jsi::Value *args, size_t count)) {
|
||||
+ jsi::HostFunctionType hostFunction =
|
||||
+ [name, method](/* JS Runtime */ jsi::Runtime &runtime,
|
||||
+ /* HybridObject */ const jsi::Value &thisValue,
|
||||
+ /* JS arguments */ const jsi::Value *args,
|
||||
+ /* argument size */ size_t count) -> jsi::Value {
|
||||
+ // 1. Get actual `HybridObject` instance from `thisValue` (it's stored as
|
||||
+ // `NativeState`)
|
||||
+ std::shared_ptr<Derived> hybridInstance =
|
||||
+ getHybridObjectNativeState<Derived>(runtime, thisValue,
|
||||
+ FunctionKind::METHOD, name);
|
||||
+
|
||||
+ // 2. Call the raw JSI method using raw JSI Values. Exceptions are also
|
||||
+ // expected to be handled by the user.
|
||||
+ Derived *pointer = hybridInstance.get();
|
||||
return (pointer->*method)(runtime, thisValue, args, count);
|
||||
};
|
||||
|
||||
- return HybridFunction(std::move(hostFunction), expectedArgumentsCount, name);
|
||||
+ return HybridFunction(std::move(hostFunction), expectedArgumentsCount,
|
||||
+ name);
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
- * Calls the given method on the given instance with the given `jsi::Value` arguments by converting them to the desired target types.
|
||||
- * The given method's return value will be converted to a `jsi::Value` again.
|
||||
+ * Calls the given method on the given instance with the given `jsi::Value`
|
||||
+ * arguments by converting them to the desired target types. The given
|
||||
+ * method's return value will be converted to a `jsi::Value` again.
|
||||
*/
|
||||
- template <typename Derived, typename ReturnType, typename... Args, size_t... Is>
|
||||
- static inline jsi::Value callMethod(Derived* obj, ReturnType (Derived::*method)(Args...), jsi::Runtime& runtime, const jsi::Value* args,
|
||||
- size_t argsSize, std::index_sequence<Is...>) {
|
||||
+ template <typename Derived, typename ReturnType, typename... Args,
|
||||
+ size_t... Is>
|
||||
+ static inline jsi::Value
|
||||
+ callMethod(Derived *obj, ReturnType (Derived::*method)(Args...),
|
||||
+ jsi::Runtime &runtime, const jsi::Value *args, size_t argsSize,
|
||||
+ std::index_sequence<Is...>) {
|
||||
static const jsi::Value defaultValue;
|
||||
|
||||
if constexpr (std::is_void_v<ReturnType>) {
|
||||
// It's a void method.
|
||||
- (obj->*method)(JSIConverter<std::decay_t<Args>>::fromJSI(runtime, Is < argsSize ? args[Is] : defaultValue)...);
|
||||
+ (obj->*method)(JSIConverter<std::decay_t<Args>>::fromJSI(
|
||||
+ runtime, Is < argsSize ? args[Is] : defaultValue)...);
|
||||
return jsi::Value::undefined();
|
||||
} else {
|
||||
- // It's returning some C++ type, we need to convert that to a JSI value now.
|
||||
- ReturnType result = (obj->*method)(JSIConverter<std::decay_t<Args>>::fromJSI(runtime, Is < argsSize ? args[Is] : defaultValue)...);
|
||||
- return JSIConverter<ReturnType>::toJSI(runtime, std::forward<ReturnType>(result));
|
||||
+ // It's returning some C++ type, we need to convert that to a JSI value
|
||||
+ // now.
|
||||
+ ReturnType result =
|
||||
+ (obj->*method)(JSIConverter<std::decay_t<Args>>::fromJSI(
|
||||
+ runtime, Is < argsSize ? args[Is] : defaultValue)...);
|
||||
+ return JSIConverter<ReturnType>::toJSI(runtime,
|
||||
+ std::forward<ReturnType>(result));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,20 +223,24 @@ private:
|
||||
* Get the `NativeState` of the given `value`.
|
||||
*/
|
||||
template <typename THybrid>
|
||||
- static inline std::shared_ptr<THybrid> getHybridObjectNativeState(jsi::Runtime& runtime, const jsi::Value& value,
|
||||
- [[maybe_unused]] FunctionKind funcKind,
|
||||
- [[maybe_unused]] const std::string& funcName) {
|
||||
+ static inline std::shared_ptr<THybrid>
|
||||
+ getHybridObjectNativeState(jsi::Runtime &runtime, const jsi::Value &value,
|
||||
+ [[maybe_unused]] FunctionKind funcKind,
|
||||
+ [[maybe_unused]] const std::string &funcName) {
|
||||
// 1. Convert jsi::Value to jsi::Object
|
||||
#ifdef NITRO_DEBUG
|
||||
if (!value.isObject()) [[unlikely]] {
|
||||
- throw jsi::JSError(runtime, "Cannot " + getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
- " - `this` is not bound! Suggestions:\n"
|
||||
- "- Did you accidentally destructure the `HybridObject`? (`const { " +
|
||||
- funcName +
|
||||
- " } = ...`)\n"
|
||||
- "- Did you call `dispose()` on the `HybridObject` before?"
|
||||
- "- Did you accidentally call `" +
|
||||
- funcName + "` on the prototype directly?");
|
||||
+ throw jsi::JSError(
|
||||
+ runtime,
|
||||
+ "Cannot " + getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
+ " - `this` is not bound! Suggestions:\n"
|
||||
+ "- Did you accidentally destructure the `HybridObject`? (`const "
|
||||
+ "{ " +
|
||||
+ funcName +
|
||||
+ " } = ...`)\n"
|
||||
+ "- Did you call `dispose()` on the `HybridObject` before?"
|
||||
+ "- Did you accidentally call `" +
|
||||
+ funcName + "` on the prototype directly?");
|
||||
}
|
||||
#endif
|
||||
jsi::Object object = value.getObject(runtime);
|
||||
@@ -191,33 +248,42 @@ private:
|
||||
// 2. Check if it even has any kind of `NativeState`
|
||||
#ifdef NITRO_DEBUG
|
||||
if (!object.hasNativeState(runtime)) [[unlikely]] {
|
||||
- throw jsi::JSError(runtime, "Cannot " + getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
- " - `this` does not have a NativeState! Suggestions:\n"
|
||||
- "- Did you accidentally destructure the `HybridObject`? (`const { " +
|
||||
- funcName +
|
||||
- " } = ...`)\n"
|
||||
- "- Did you call `dispose()` on the `HybridObject` before?"
|
||||
- "- Did you accidentally call `" +
|
||||
- funcName + "` on the prototype directly?");
|
||||
+ throw jsi::JSError(
|
||||
+ runtime,
|
||||
+ "Cannot " + getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
+ " - `this` does not have a NativeState! Suggestions:\n"
|
||||
+ "- Did you accidentally destructure the `HybridObject`? (`const "
|
||||
+ "{ " +
|
||||
+ funcName +
|
||||
+ " } = ...`)\n"
|
||||
+ "- Did you call `dispose()` on the `HybridObject` before?"
|
||||
+ "- Did you accidentally call `" +
|
||||
+ funcName + "` on the prototype directly?");
|
||||
}
|
||||
#endif
|
||||
|
||||
// 3. Get `NativeState` from the jsi::Object and check if it is non-null
|
||||
- std::shared_ptr<jsi::NativeState> nativeState = object.getNativeState(runtime);
|
||||
+ std::shared_ptr<jsi::NativeState> nativeState =
|
||||
+ object.getNativeState(runtime);
|
||||
#ifdef NITRO_DEBUG
|
||||
if (nativeState == nullptr) [[unlikely]] {
|
||||
- throw jsi::JSError(runtime, "Cannot " + getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
- " - `this`'s `NativeState` is `null`, "
|
||||
- "did you accidentally call `dispose()` on this object?");
|
||||
+ throw jsi::JSError(
|
||||
+ runtime, "Cannot " +
|
||||
+ getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
+ " - `this`'s `NativeState` is `null`, "
|
||||
+ "did you accidentally call `dispose()` on this object?");
|
||||
}
|
||||
#endif
|
||||
|
||||
// 4. Try casting it to our desired target type.
|
||||
- std::shared_ptr<THybrid> hybridInstance = std::dynamic_pointer_cast<THybrid>(nativeState);
|
||||
+ std::shared_ptr<THybrid> hybridInstance =
|
||||
+ std::dynamic_pointer_cast<THybrid>(nativeState);
|
||||
#ifdef NITRO_DEBUG
|
||||
if (hybridInstance == nullptr) [[unlikely]] {
|
||||
- throw jsi::JSError(runtime, "Cannot " + getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
- " - `this` has a NativeState, but it's the wrong type!");
|
||||
+ throw jsi::JSError(
|
||||
+ runtime, "Cannot " +
|
||||
+ getHybridFuncDebugInfo<THybrid>(funcKind, funcName) +
|
||||
+ " - `this` has a NativeState, but it's the wrong type!");
|
||||
}
|
||||
#endif
|
||||
return hybridInstance;
|
||||
@@ -225,28 +291,33 @@ private:
|
||||
|
||||
private:
|
||||
template <typename THybrid>
|
||||
- static inline std::string getHybridFuncFullName(FunctionKind kind, const std::string& registrationName,
|
||||
- THybrid* hybridInstance = nullptr) {
|
||||
- std::string typeName = hybridInstance != nullptr ? hybridInstance->getName() : TypeInfo::getFriendlyTypename<THybrid>(true);
|
||||
+ static inline std::string
|
||||
+ getHybridFuncFullName(FunctionKind kind, const std::string ®istrationName,
|
||||
+ THybrid *hybridInstance = nullptr) {
|
||||
+ std::string typeName = hybridInstance != nullptr
|
||||
+ ? hybridInstance->getName()
|
||||
+ : TypeInfo::getFriendlyTypename<THybrid>(true);
|
||||
switch (kind) {
|
||||
- case FunctionKind::METHOD:
|
||||
- return typeName + "." + registrationName + "(...)";
|
||||
- case FunctionKind::GETTER:
|
||||
- case FunctionKind::SETTER:
|
||||
- return typeName + "." + registrationName;
|
||||
+ case FunctionKind::METHOD:
|
||||
+ return typeName + "." + registrationName + "(...)";
|
||||
+ case FunctionKind::GETTER:
|
||||
+ case FunctionKind::SETTER:
|
||||
+ return typeName + "." + registrationName;
|
||||
}
|
||||
}
|
||||
template <typename THybrid>
|
||||
- static inline std::string getHybridFuncDebugInfo(FunctionKind kind, const std::string& registrationName,
|
||||
- THybrid* hybridInstance = nullptr) {
|
||||
- auto funcName = getHybridFuncFullName<THybrid>(kind, registrationName, hybridInstance);
|
||||
+ static inline std::string
|
||||
+ getHybridFuncDebugInfo(FunctionKind kind, const std::string ®istrationName,
|
||||
+ THybrid *hybridInstance = nullptr) {
|
||||
+ auto funcName =
|
||||
+ getHybridFuncFullName<THybrid>(kind, registrationName, hybridInstance);
|
||||
switch (kind) {
|
||||
- case FunctionKind::METHOD:
|
||||
- return "call hybrid function `" + funcName + "`";
|
||||
- case FunctionKind::GETTER:
|
||||
- return "get hybrid property `" + funcName + "`";
|
||||
- case FunctionKind::SETTER:
|
||||
- return "set hybrid property `" + funcName + "`";
|
||||
+ case FunctionKind::METHOD:
|
||||
+ return "call hybrid function `" + funcName + "`";
|
||||
+ case FunctionKind::GETTER:
|
||||
+ return "get hybrid property `" + funcName + "`";
|
||||
+ case FunctionKind::SETTER:
|
||||
+ return "set hybrid property `" + funcName + "`";
|
||||
}
|
||||
}
|
||||
};
|
||||
+944
@@ -0,0 +1,944 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable */
|
||||
//prettier-ignore
|
||||
(()=>{var Oje=Object.create;var uU=Object.defineProperty;var Lje=Object.getOwnPropertyDescriptor;var Mje=Object.getOwnPropertyNames;var Uje=Object.getPrototypeOf,_je=Object.prototype.hasOwnProperty;var Ce=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ze=(e,t)=>()=>(e&&(t=e(e=0)),t);var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vt=(e,t)=>{for(var r in t)uU(e,r,{get:t[r],enumerable:!0})},Hje=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Mje(t))!_je.call(e,a)&&a!==r&&uU(e,a,{get:()=>t[a],enumerable:!(s=Lje(t,a))||s.enumerable});return e};var et=(e,t,r)=>(r=e!=null?Oje(Uje(e)):{},Hje(t||!e||!e.__esModule?uU(r,"default",{value:e,enumerable:!0}):r,e));var pi={};Vt(pi,{SAFE_TIME:()=>SX,S_IFDIR:()=>ex,S_IFLNK:()=>tx,S_IFMT:()=>Hf,S_IFREG:()=>R2});var Hf,ex,R2,tx,SX,bX=Ze(()=>{Hf=61440,ex=16384,R2=32768,tx=40960,SX=456789e3});var or={};Vt(or,{EBADF:()=>Yo,EBUSY:()=>jje,EEXIST:()=>Kje,EINVAL:()=>qje,EISDIR:()=>Vje,ENOENT:()=>Yje,ENOSYS:()=>Gje,ENOTDIR:()=>Wje,ENOTEMPTY:()=>zje,EOPNOTSUPP:()=>Zje,EROFS:()=>Jje,ERR_DIR_CLOSED:()=>fU});function vc(e,t){return Object.assign(new Error(`${e}: ${t}`),{code:e})}function jje(e){return vc("EBUSY",e)}function Gje(e,t){return vc("ENOSYS",`${e}, ${t}`)}function qje(e){return vc("EINVAL",`invalid argument, ${e}`)}function Yo(e){return vc("EBADF",`bad file descriptor, ${e}`)}function Yje(e){return vc("ENOENT",`no such file or directory, ${e}`)}function Wje(e){return vc("ENOTDIR",`not a directory, ${e}`)}function Vje(e){return vc("EISDIR",`illegal operation on a directory, ${e}`)}function Kje(e){return vc("EEXIST",`file already exists, ${e}`)}function Jje(e){return vc("EROFS",`read-only filesystem, ${e}`)}function zje(e){return vc("ENOTEMPTY",`directory not empty, ${e}`)}function Zje(e){return vc("EOPNOTSUPP",`operation not supported, ${e}`)}function fU(){return vc("ERR_DIR_CLOSED","Directory handle was closed")}var rx=Ze(()=>{});var ll={};Vt(ll,{BigIntStatsEntry:()=>uE,DEFAULT_MODE:()=>hU,DirEntry:()=>AU,StatEntry:()=>cE,areStatsEqual:()=>dU,clearStats:()=>nx,convertToBigIntStats:()=>$je,makeDefaultStats:()=>DX,makeEmptyStats:()=>Xje});function DX(){return new cE}function Xje(){return nx(DX())}function nx(e){for(let t in e)if(Object.hasOwn(e,t)){let r=e[t];typeof r=="number"?e[t]=0:typeof r=="bigint"?e[t]=BigInt(0):pU.types.isDate(r)&&(e[t]=new Date(0))}return e}function $je(e){let t=new uE;for(let r in e)if(Object.hasOwn(e,r)){let s=e[r];typeof s=="number"?t[r]=BigInt(Math.floor(s)):pU.types.isDate(s)&&(t[r]=new Date(s))}return t.atimeNs=t.atimeMs*BigInt(1e6)+BigInt(Math.floor(e.atimeMs%1*1e3))*BigInt(1e3),t.mtimeNs=t.mtimeMs*BigInt(1e6)+BigInt(Math.floor(e.mtimeMs%1*1e3))*BigInt(1e3),t.ctimeNs=t.ctimeMs*BigInt(1e6)+BigInt(Math.floor(e.ctimeMs%1*1e3))*BigInt(1e3),t.birthtimeNs=t.birthtimeMs*BigInt(1e6)+BigInt(Math.floor(e.birthtimeMs%1*1e3))*BigInt(1e3),t}function dU(e,t){if(e.atimeMs!==t.atimeMs||e.birthtimeMs!==t.birthtimeMs||e.blksize!==t.blksize||e.blocks!==t.blocks||e.ctimeMs!==t.ctimeMs||e.dev!==t.dev||e.gid!==t.gid||e.ino!==t.ino||e.isBlockDevice()!==t.isBlockDevice()||e.isCharacterDevice()!==t.isCharacterDevice()||e.isDirectory()!==t.isDirectory()||e.isFIFO()!==t.isFIFO()||e.isFile()!==t.isFile()||e.isSocket()!==t.isSocket()||e.isSymbolicLink()!==t.isSymbolicLink()||e.mode!==t.mode||e.mtimeMs!==t.mtimeMs||e.nlink!==t.nlink||e.rdev!==t.rdev||e.size!==t.size||e.uid!==t.uid)return!1;let r=e,s=t;return!(r.atimeNs!==s.atimeNs||r.mtimeNs!==s.mtimeNs||r.ctimeNs!==s.ctimeNs||r.birthtimeNs!==s.birthtimeNs)}var pU,hU,AU,cE,uE,gU=Ze(()=>{pU=et(Ce("util")),hU=33188,AU=class{constructor(){this.name="";this.path="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},cE=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=hU;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},uE=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtLine truncated
|
||||
`).length,s=t.length-r;return r>s?`\r
|
||||
`:`
|
||||
`}function I0(e,t){return t.replace(/\r?\n/g,A6e(e))}var OX,LX,Ip,jf,C0=Ze(()=>{OX=Ce("crypto"),LX=Ce("os");EU();cl();Ip=class{constructor(t){this.pathUtils=t}async*genTraversePromise(t,{stableSort:r=!1}={}){let s=[t];for(;s.length>0;){let a=s.shift();if((await this.lstatPromise(a)).isDirectory()){let c=await this.readdirPromise(a);if(r)for(let f of c.sort())s.push(this.pathUtils.join(a,f));else throw new Error("Not supported")}else yield a}}async checksumFilePromise(t,{algorithm:r="sha512"}={}){let s=await this.openPromise(t,"r");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,OX.createHash)(r),f=0;for(;(f=await this.readPromise(s,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest("hex")}finally{await this.closePromise(s)}}async removePromise(t,{recursive:r=!0,maxRetries:s=5}={}){let a;try{a=await this.lstatPromise(t)}catch(n){if(n.code==="ENOENT")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(t);await Promise.all(n.map(c=>this.removePromise(this.pathUtils.resolve(t,c))))}for(let n=0;n<=s;n++)try{await this.rmdirPromise(t);break}catch(c){if(c.code!=="EBUSY"&&c.code!=="ENOTEMPTY")throw c;n<s&&await new Promise(f=>setTimeout(f,n*100))}}else await this.unlinkPromise(t)}removeSync(t,{recursive:r=!0}={}){let s;try{s=this.lstatSync(t)}catch(a){if(a.code==="ENOENT")return;throw a}if(s.isDirectory()){if(r)for(let a of this.readdirSync(t))this.removeSync(this.pathUtils.resolve(t,a));this.rmdirSync(t)}else this.unlinkSync(t)}async mkdirpPromise(t,{chmod:r,utimes:s}={}){if(t=this.resolve(t),t===this.pathUtils.dirname(t))return;let a=t.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{await this.mkdirPromise(f)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=f,r!=null&&await this.chmodPromise(f,r),s!=null)await this.utimesPromise(f,s[0],s[1]);else{let p=await this.statPromise(this.pathUtils.dirname(f));await this.utimesPromise(f,p.atime,p.mtime)}}}return n}mkdirpSync(t,{chmod:r,utimes:s}={}){if(t=this.resolve(t),t===this.pathUtils.dirname(t))return;let a=t.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{this.mkdirSync(f)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=f,r!=null&&this.chmodSync(f,r),s!=null)this.utimesSync(f,s[0],s[1]);else{let p=this.statSync(this.pathUtils.dirname(f));this.utimesSync(f,p.atime,p.mtime)}}}return n}async copyPromise(t,r,{baseFs:s=this,overwrite:a=!0,stableSort:n=!1,stableTime:c=!1,linkStrategy:f=null}={}){return await kX(this,t,s,r,{overwrite:a,stableSort:n,stableTime:c,linkStrategy:f})}copySync(t,r,{baseFs:s=this,overwrite:a=!0}={}){let n=s.lstatSync(r),c=this.existsSync(t);if(n.isDirectory()){this.mkdirpSync(t);let p=s.readdirSync(r);for(let h of p)this.copySync(this.pathUtils.join(t,h),s.pathUtils.join(r,h),{baseFs:s,overwrite:a})}else if(n.isFile()){if(!c||a){c&&this.removeSync(t);let p=s.readFileSync(r);this.writeFileSync(t,p)}}else if(n.isSymbolicLink()){if(!c||a){c&&this.removeSync(t);let p=s.readlinkSync(r);this.symlinkSync(ix(this.pathUtils,p),t)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,"0")})`);let f=n.mode&511;this.chmodSync(t,f)}async changeFilePromise(t,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(t,r,s):this.changeFileTextPromise(t,r,s)}async changeFileBufferPromise(t,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(t)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(t,r,{mode:s})}async changeFileTextPromise(t,r,{automaticNewlines:s,mode:a}={}){let n="";try{n=await this.readFilePromise(t,"utf8")}catch{}let c=s?I0(n,r):r;n!==c&&await this.writeFilePromise(t,c,{mode:a})}changeFileSync(t,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(t,r,s):this.changeFileTextSync(t,r,s)}changeFileBufferSync(t,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(t)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(t,r,{mode:s})}changeFileTextSync(t,r,{automaticNewlines:s=!1,mode:a}={}){let n="";try{n=this.readFileSync(t,"utf8")}catch{}let c=s?I0(n,r):r;n!==c&&this.writeFileSync(t,c,{mode:a})}async movePromise(t,r){try{await this.renamePromise(t,r)}catch(s){if(s.code==="EXDEV")await this.copyPromise(r,t),await this.removePromise(t);else throw s}}moveSync(t,r){try{this.renameSync(t,r)}catch(s){if(s.code==="EXDEV")this.copySync(r,t),this.removeSync(t);else throw s}}async lockPromise(t,r){let s=`${t}.flock`,a=1e3/60,n=Date.now(),c=null,f=async()=>{let p;try{[p]=await this.readJsonPromise(s)}catch{return Date.now()-n<500}try{return process.kill(p,0),!0}catch{return!1}};for(;c===null;)try{c=await this.openPromise(s,"wx")}catch(p){if(p.code==="EEXIST"){if(!await f())try{await this.unlinkPromise(s);continue}catch{}if(Date.now()-n<60*1e3)await new Promise(h=>setTimeout(h,a));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${s})`)}else throw
Line truncated
|
||||
`)}writeJsonSync(t,r,{compact:s=!1}={}){let a=s?0:2;return this.writeFileSync(t,`${JSON.stringify(r,null,a)}
|
||||
`)}async preserveTimePromise(t,r){let s=await this.lstatPromise(t),a=await r();typeof a<"u"&&(t=a),await this.lutimesPromise(t,s.atime,s.mtime)}async preserveTimeSync(t,r){let s=this.lstatSync(t),a=r();typeof a<"u"&&(t=a),this.lutimesSync(t,s.atime,s.mtime)}},jf=class extends Ip{constructor(){super(Y)}}});var Gs,Cp=Ze(()=>{C0();Gs=class extends Ip{getExtractHint(t){return this.baseFs.getExtractHint(t)}resolve(t){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(t)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(t,r,s){return this.baseFs.openPromise(this.mapToBase(t),r,s)}openSync(t,r,s){return this.baseFs.openSync(this.mapToBase(t),r,s)}async opendirPromise(t,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(t),r),{path:t})}opendirSync(t,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(t),r),{path:t})}async readPromise(t,r,s,a,n){return await this.baseFs.readPromise(t,r,s,a,n)}readSync(t,r,s,a,n){return this.baseFs.readSync(t,r,s,a,n)}async writePromise(t,r,s,a,n){return typeof r=="string"?await this.baseFs.writePromise(t,r,s):await this.baseFs.writePromise(t,r,s,a,n)}writeSync(t,r,s,a,n){return typeof r=="string"?this.baseFs.writeSync(t,r,s):this.baseFs.writeSync(t,r,s,a,n)}async closePromise(t){return this.baseFs.closePromise(t)}closeSync(t){this.baseFs.closeSync(t)}createReadStream(t,r){return this.baseFs.createReadStream(t!==null?this.mapToBase(t):t,r)}createWriteStream(t,r){return this.baseFs.createWriteStream(t!==null?this.mapToBase(t):t,r)}async realpathPromise(t){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(t)))}realpathSync(t){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(t)))}async existsPromise(t){return this.baseFs.existsPromise(this.mapToBase(t))}existsSync(t){return this.baseFs.existsSync(this.mapToBase(t))}accessSync(t,r){return this.baseFs.accessSync(this.mapToBase(t),r)}async accessPromise(t,r){return this.baseFs.accessPromise(this.mapToBase(t),r)}async statPromise(t,r){return this.baseFs.statPromise(this.mapToBase(t),r)}statSync(t,r){return this.baseFs.statSync(this.mapToBase(t),r)}async fstatPromise(t,r){return this.baseFs.fstatPromise(t,r)}fstatSync(t,r){return this.baseFs.fstatSync(t,r)}lstatPromise(t,r){return this.baseFs.lstatPromise(this.mapToBase(t),r)}lstatSync(t,r){return this.baseFs.lstatSync(this.mapToBase(t),r)}async fchmodPromise(t,r){return this.baseFs.fchmodPromise(t,r)}fchmodSync(t,r){return this.baseFs.fchmodSync(t,r)}async chmodPromise(t,r){return this.baseFs.chmodPromise(this.mapToBase(t),r)}chmodSync(t,r){return this.baseFs.chmodSync(this.mapToBase(t),r)}async fchownPromise(t,r,s){return this.baseFs.fchownPromise(t,r,s)}fchownSync(t,r,s){return this.baseFs.fchownSync(t,r,s)}async chownPromise(t,r,s){return this.baseFs.chownPromise(this.mapToBase(t),r,s)}chownSync(t,r,s){return this.baseFs.chownSync(this.mapToBase(t),r,s)}async renamePromise(t,r){return this.baseFs.renamePromise(this.mapToBase(t),this.mapToBase(r))}renameSync(t,r){return this.baseFs.renameSync(this.mapToBase(t),this.mapToBase(r))}async copyFilePromise(t,r,s=0){return this.baseFs.copyFilePromise(this.mapToBase(t),this.mapToBase(r),s)}copyFileSync(t,r,s=0){return this.baseFs.copyFileSync(this.mapToBase(t),this.mapToBase(r),s)}async appendFilePromise(t,r,s){return this.baseFs.appendFilePromise(this.fsMapToBase(t),r,s)}appendFileSync(t,r,s){return this.baseFs.appendFileSync(this.fsMapToBase(t),r,s)}async writeFilePromise(t,r,s){return this.baseFs.writeFilePromise(this.fsMapToBase(t),r,s)}writeFileSync(t,r,s){return this.baseFs.writeFileSync(this.fsMapToBase(t),r,s)}async unlinkPromise(t){return this.baseFs.unlinkPromise(this.mapToBase(t))}unlinkSync(t){return this.baseFs.unlinkSync(this.mapToBase(t))}async utimesPromise(t,r,s){return this.baseFs.utimesPromise(this.mapToBase(t),r,s)}utimesSync(t,r,s){return this.baseFs.utimesSync(this.mapToBase(t),r,s)}async lutimesPromise(t,r,s){return this.baseFs.lutimesPromise(this.mapToBase(t),r,s)}lutimesSync(t,r,s){return this.baseFs.lutimesSync(this.mapToBase(t),r,s)}async mkdirPromise(t,r){return this.baseFs.mkdirPromise(this.mapToBase(t),r)}mkdirSync(t,r){return this.baseFs.mkdirSync(this.mapToBase(t),r)}async rmdirPromise(t,r){return this.baseFs.rmdirPromise(this.mapToBase(t),r)}rmdirSync(t,r){return this.baseFs.rmdirSync(this.mapToBase(t),r)}async rmPromise(t,r){return this.baseFs.rmPromise(this.mapToBase(t),r)}rmSync(t,r){return this.baseFs.rmSync(this.mapToBase(t),r)}async linkPromise(t,r){return this.baseFs.linkPromise(this.mapToBase(t),this.mapToBase(r))}linkSync(t,r){return this.baseFs.linkSync(this.mapToBase(t),this.mapToBase(r))}async symlinkPromise(t,r,s){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(t))return this.baseFs.symlinkPromise(this.mapToBase(t),a,s);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),t)),c=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkP
Line truncated
|
||||
`,NA=ur(`\\
|
||||
`,!1),OA=function(){return""},Aa="\\",pa=ur("\\",!1),LA=/^[\\$"`]/,gr=zi(["\\","$",'"',"`"],!1,!1),ko=function(O){return O},qa="\\a",Ue=ur("\\a",!1),wr=function(){return"a"},gf="\\b",MA=ur("\\b",!1),UA=function(){return"\b"},cu=/^[Ee]/,uu=zi(["E","e"],!1,!1),cc=function(){return"\x1B"},we="\\f",Ot=ur("\\f",!1),uc=function(){return"\f"},Oi="\\n",fo=ur("\\n",!1),Rt=function(){return`
|
||||
`},Tn="\\r",ha=ur("\\r",!1),Gi=function(){return"\r"},Li="\\t",Ya=ur("\\t",!1),yn=function(){return" "},Xn="\\v",fu=ur("\\v",!1),Eh=function(){return"\v"},Wa=/^[\\'"?]/,Va=zi(["\\","'",'"',"?"],!1,!1),Ka=function(O){return String.fromCharCode(parseInt(O,16))},$e="\\x",Ja=ur("\\x",!1),mf="\\u",fc=ur("\\u",!1),Sn="\\U",da=ur("\\U",!1),_A=function(O){return String.fromCodePoint(parseInt(O,16))},HA=/^[0-7]/,ga=zi([["0","7"]],!1,!1),Ql=/^[0-9a-fA-f]/,Ut=zi([["0","9"],["a","f"],["A","f"]],!1,!1),Rn=Cf(),ma="{}",za=ur("{}",!1),ss=function(){return"{}"},Ac="-",Au=ur("-",!1),pc="+",Za=ur("+",!1),Mi=".",vs=ur(".",!1),Tl=function(O,J,re){return{type:"number",value:(O==="-"?-1:1)*parseFloat(J.join("")+"."+re.join(""))}},yf=function(O,J){return{type:"number",value:(O==="-"?-1:1)*parseInt(J.join(""))}},hc=function(O){return{type:"variable",...O}},vi=function(O){return{type:"variable",name:O}},Fn=function(O){return O},dc="*",ze=ur("*",!1),at="/",St=ur("/",!1),lr=function(O,J,re){return{type:J==="*"?"multiplication":"division",right:re}},te=function(O,J){return J.reduce((re,de)=>({left:re,...de}),O)},Ee=function(O,J,re){return{type:J==="+"?"addition":"subtraction",right:re}},Oe="$((",mt=ur("$((",!1),Et="))",Dt=ur("))",!1),tr=function(O){return O},pn="$(",ui=ur("$(",!1),qi=function(O){return O},Nn="${",Xa=ur("${",!1),By=":-",z1=ur(":-",!1),Qo=function(O,J){return{name:O,defaultValue:J}},vy=":-}",Ih=ur(":-}",!1),Z1=function(O){return{name:O,defaultValue:[]}},To=":+",Ch=ur(":+",!1),wh=function(O,J){return{name:O,alternativeValue:J}},pu=":+}",Bh=ur(":+}",!1),Ng=function(O){return{name:O,alternativeValue:[]}},Og=function(O){return{name:O}},Lg="$",Sy=ur("$",!1),Ef=function(O){return t.isGlobPattern(O)},Ro=function(O){return O},Rl=/^[a-zA-Z0-9_]/,vh=zi([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Mg=function(){return xy()},Fl=/^[$@*?#a-zA-Z0-9_\-]/,Nl=zi(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),by=/^[()}<>$|&; \t"']/,jA=zi(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),Dy=/^[<>&; \t"']/,Py=zi(["<",">","&",";"," "," ",'"',"'"],!1,!1),GA=/^[ \t]/,qA=zi([" "," "],!1,!1),W=0,xt=0,YA=[{line:1,column:1}],Fo=0,If=[],yt=0,hu;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function xy(){return e.substring(xt,W)}function Ug(){return wf(xt,W)}function X1(O,J){throw J=J!==void 0?J:wf(xt,W),WA([_g(O)],e.substring(xt,W),J)}function Sh(O,J){throw J=J!==void 0?J:wf(xt,W),mi(O,J)}function ur(O,J){return{type:"literal",text:O,ignoreCase:J}}function zi(O,J,re){return{type:"class",parts:O,inverted:J,ignoreCase:re}}function Cf(){return{type:"any"}}function $a(){return{type:"end"}}function _g(O){return{type:"other",description:O}}function du(O){var J=YA[O],re;if(J)return J;for(re=O-1;!YA[re];)re--;for(J=YA[re],J={line:J.line,column:J.column};re<O;)e.charCodeAt(re)===10?(J.line++,J.column=1):J.column++,re++;return YA[O]=J,J}function wf(O,J){var re=du(O),de=du(J);return{start:{offset:O,line:re.line,column:re.column},end:{offset:J,line:de.line,column:de.column}}}function Bt(O){W<Fo||(W>Fo&&(Fo=W,If=[]),If.push(O))}function mi(O,J){return new v0(O,null,null,J)}function WA(O,J,re){return new v0(v0.buildMessage(O,J),O,J,re)}function el(){var O,J,re;for(O=W,J=[],re=kt();re!==r;)J.push(re),re=kt();return J!==r?(re=ya(),re===r&&(re=null),re!==r?(xt=O,J=n(re),O=J):(W=O,O=r)):(W=O,O=r),O}function ya(){var O,J,re,de,Ke;if(O=W,J=bh(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hg(),de!==r?(Ke=tl(),Ke===r&&(Ke=null),Ke!==r?(xt=O,J=c(J,de,Ke),O=J):(W=O,O=r)):(W=O,O=r)):(W=O,O=r)}else W=O,O=r;if(O===r)if(O=W,J=bh(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hg(),de===r&&(de=null),de!==r?(xt=O,J=f(J,de),O=J):(W=O,O=r)):(W=O,O=r)}else W=O,O=r;return O}function tl(){var O,J,re,de,Ke;for(O=W,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)if(re=ya(),re!==r){for(de=[],Ke=kt();Ke!==r;)de.push(Ke),Ke=kt();de!==r?(xt=O,J=p(re),O=J):(W=O,O=r)}else W=O,O=r;else W=O,O=r;return O}function Hg(){var O;return e.charCodeAt(W)===59?(O=h,W++):(O=r,yt===0&&Bt(E)),O===r&&(e.charCodeAt(W)===38?(O=C,W++):(O=r,yt===0&&Bt(S))),O}function bh(){var O,J,re;return O=W,J=VA(),J!==r?(re=jg(),re===r&&(re=null),re!==r?(xt=O,J=x(J,re),O=J):(W=O,O=r)):(W=O,O=r),O}function jg(){var O,J,re,de,Ke,pt,mr;for(O=W,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)if(re=ky(),re!==r){for(de=[],Ke=kt();Ke!==r;)de.push(Ke),Ke=kt();if(de!==r)if(Ke=bh(),Ke!==r){for(pt=[],mr=kt();mr!==r;)pt.push(mr),mr=kt();pt!==r?(xt=O,J=I(re,Ke),O=J):(W=O,O=r)}else W=O,O=r;else W=O,O=r}else W=O,O=r;else W=O,O=r;return O}function ky(){var O;return e.substr(W,2)===R?(O=R,W+=2):(O=r,yt===0&&Bt(N)),O===r&&(e.substr(W,2)===U?(O=U,W+=2):(O=r,yt===0&&Bt(K))),O}function VA(){var O,J,re;return O=W,J=Bf(),J!==r?(re=Gg(),re===r&&(re=null),re!==r?(xt=O,J=$(J,re),O=J):(W=O,O=r)):(W=O,O=r),O}function Gg(){var O,J,re,de,Ke,pt,mr;for(O=W,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)iLine truncated
|
||||
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),Y6e=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(eee,([e,t])=>[e,`"$'${t}'"`])]),tee=e=>eee.get(e)??`\\x${e.charCodeAt(0).toString(16).padStart(2,"0")}`,W6e=e=>Y6e.get(e)??`"$'${tee(e)}'"`});var iee=G((ZPt,nee)=>{"use strict";function V6e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function b0(e,t,r,s){this.message=e,this.expected=t,this.found=r,this.location=s,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,b0)}V6e(b0,Error);b0.buildMessage=function(e,t){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+"-"+n(h.parts[C][1]):n(h.parts[C]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+f(e)+" but "+p(t)+" found."};function K6e(e,t){t=t!==void 0?t:{};var r={},s={resolution:Qe},a=Qe,n="/",c=Ie("/",!1),f=function(Me,P){return{from:Me,descriptor:P}},p=function(Me){return{descriptor:Me}},h="@",E=Ie("@",!1),C=function(Me,P){return{fullName:Me,description:P}},S=function(Me){return{fullName:Me}},x=function(){return De()},I=/^[^\/@]/,R=me(["/","@"],!0,!1),N=/^[^\/]/,U=me(["/"],!0,!1),K=0,$=0,ie=[{line:1,column:1}],fe=0,le=[],ge=0,pe;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function De(){return e.substring($,K)}function ye(){return it($,K)}function d(Me,P){throw P=P!==void 0?P:it($,K),Fe([be(Me)],e.substring($,K),P)}function ve(Me,P){throw P=P!==void 0?P:it($,K),tt(Me,P)}function Ie(Me,P){return{type:"literal",text:Me,ignoreCase:P}}function me(Me,P,w){return{type:"class",parts:Me,inverted:P,ignoreCase:w}}function ce(){return{type:"any"}}function X(){return{type:"end"}}function be(Me){return{type:"other",description:Me}}function ke(Me){var P=ie[Me],w;if(P)return P;for(w=Me-1;!ie[w];)w--;for(P=ie[w],P={line:P.line,column:P.column};w<Me;)e.charCodeAt(w)===10?(P.line++,P.column=1):P.column++,w++;return ie[Me]=P,P}function it(Me,P){var w=ke(Me),D=ke(P);return{start:{offset:Me,line:w.line,column:w.column},end:{offset:P,line:D.line,column:D.column}}}function _(Me){K<fe||(K>fe&&(fe=K,le=[]),le.push(Me))}function tt(Me,P){return new b0(Me,null,null,P)}function Fe(Me,P,w){return new b0(b0.buildMessage(Me,P),Me,P,w)}function Qe(){var Me,P,w,D;return Me=K,P=Se(),P!==r?(e.charCodeAt(K)===47?(w=n,K++):(w=r,ge===0&&_(c)),w!==r?(D=Se(),D!==r?($=Me,P=f(P,D),Me=P):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r),Me===r&&(Me=K,P=Se(),P!==r&&($=Me,P=p(P)),Me=P),Me}function Se(){var Me,P,w,D;return Me=K,P=je(),P!==r?(e.charCodeAt(K)===64?(w=h,K++):(w=r,ge===0&&_(E)),w!==r?(D=ct(),D!==r?($=Me,P=C(P,D),Me=P):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r),Me===r&&(Me=K,P=je(),P!==r&&($=Me,P=S(P)),Me=P),Me}function je(){var Me,P,w,D,y;return Me=K,e.charCodeAt(K)===64?(P=h,K++):(P=r,ge===0&&_(E)),P!==r?(w=Te(),w!==r?(e.charCodeAt(K)===47?(D=n,K++):(D=r,ge===0&&_(c)),D!==r?(y=Te(),y!==r?($=Me,P=x(),Me=P):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r),Me===r&&(Me=K,P=Te(),P!==r&&($=Me,P=x()),Me=P),Me}function Te(){var Me,P,w;if(Me=K,P=[],I.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(R)),w!==r)for(;w!==r;)P.push(w),I.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(R));else P=r;return P!==r&&($=Me,P=x()),Me=P,Me}function ct(){var Me,P,w;if(Me=K,P=[],N.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(U)),w!==r)for(;w!==r;)P.push(w),N.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(U));else P=r;return P!==r&&($=Me,P=x()),Me=P,Me}if(pe=a(),pe!==r&&K===e.length)return pe;throw pe!==r&&K<e.length&&_(X()),Fe(le,fe<e.length?e.charAt(fe):null,fe<e.length?it(fe,fe+1):it(fe,fe))}nee.exports={SyntaxError:b0,parse:K6e}});function Ex(e){let t=e.match(/^\*{1,2}\/(.*)/);if(Line truncated
|
||||
\x85\u2028\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){s=" ... ",a+=5;break}for(n="",c=this.position;c<this.buffer.length&&`\0\r
|
||||
\x85\u2028\u2029`.indexOf(this.buffer.charAt(c))===-1;)if(c+=1,c-this.position>r/2-1){n=" ... ",c-=5;break}return f=this.buffer.slice(a,c),cee.repeat(" ",t)+s+f+n+`
|
||||
`+cee.repeat(" ",t+this.position-a+s.length)+"^"};UU.prototype.toString=function(t){var r,s="";return this.name&&(s+='in "'+this.name+'" '),s+="at line "+(this.line+1)+", column "+(this.column+1),t||(r=this.getSnippet(),r&&(s+=`:
|
||||
`+r)),s};uee.exports=UU});var xs=G((rxt,pee)=>{"use strict";var Aee=EE(),eGe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],tGe=["scalar","sequence","mapping"];function rGe(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(s){t[String(s)]=r})}),t}function nGe(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(eGe.indexOf(r)===-1)throw new Aee('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=rGe(t.styleAliases||null),tGe.indexOf(this.kind)===-1)throw new Aee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}pee.exports=nGe});var x0=G((nxt,dee)=>{"use strict";var hee=P0(),Cx=EE(),iGe=xs();function _U(e,t,r){var s=[];return e.include.forEach(function(a){r=_U(a,t,r)}),e[t].forEach(function(a){r.forEach(function(n,c){n.tag===a.tag&&n.kind===a.kind&&s.push(c)}),r.push(a)}),r.filter(function(a,n){return s.indexOf(n)===-1})}function sGe(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,r;function s(a){e[a.kind][a.tag]=e.fallback[a.tag]=a}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(s);return e}function IE(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new Cx("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=_U(this,"implicit",[]),this.compiledExplicit=_U(this,"explicit",[]),this.compiledTypeMap=sGe(this.compiledImplicit,this.compiledExplicit)}IE.DEFAULT=null;IE.create=function(){var t,r;switch(arguments.length){case 1:t=IE.DEFAULT,r=arguments[0];break;case 2:t=arguments[0],r=arguments[1];break;default:throw new Cx("Wrong number of arguments for Schema.create function")}if(t=hee.toArray(t),r=hee.toArray(r),!t.every(function(s){return s instanceof IE}))throw new Cx("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(s){return s instanceof iGe}))throw new Cx("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new IE({include:t,explicit:r})};dee.exports=IE});var mee=G((ixt,gee)=>{"use strict";var oGe=xs();gee.exports=new oGe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var Eee=G((sxt,yee)=>{"use strict";var aGe=xs();yee.exports=new aGe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var Cee=G((oxt,Iee)=>{"use strict";var lGe=xs();Iee.exports=new lGe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var wx=G((axt,wee)=>{"use strict";var cGe=x0();wee.exports=new cGe({explicit:[mee(),Eee(),Cee()]})});var vee=G((lxt,Bee)=>{"use strict";var uGe=xs();function fGe(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function AGe(){return null}function pGe(e){return e===null}Bee.exports=new uGe("tag:yaml.org,2002:null",{kind:"scalar",resolve:fGe,construct:AGe,predicate:pGe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var bee=G((cxt,See)=>{"use strict";var hGe=xs();function dGe(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function gGe(e){return e==="true"||e==="True"||e==="TRUE"}function mGe(e){return Object.prototype.toString.call(e)==="[object Boolean]"}See.exports=new hGe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:dGe,construct:gGe,predicate:mGe,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})});var Pee=G((uxt,Dee)=>{"use strict";var yGe=P0(),EGe=xs();function IGe(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function CGe(e){return 48<=e&&e<=55}function wGe(e){return 48<=e&&e<=57}function BGe(e){if(e===null)return!1;var t=e.length,r=0,s=!1,a;if(!t)return!1;if(a=e[r],(a==="-"||a==="+")&&(a=e[++r]),a==="0"){if(r+1===t)return!0;if(a=e[++r],a==="b"){for(r++;r<t;r++)if(a=e[r],a!=="_"){if(a!=="0"&&a!=="1")return!1;s=!0}return s&&a!=="_"}if(a==="x"){for(r++;r<t;r++)if(a=e[r],a!=="_"){if(!IGe(e.charCodeAt(r)))return!1;s=!0}return s&&a!=="_"}for(;r<t;r++)if(a=e[r],a!=="_"){if(!CGe(e.charCodeAt(r)))return!1;s=!0}return s&&a!=="_"}if(a==="_")return!1;for(;r<t;r++)if(a=e[r],a!=="_"){if(a===":")break;if(!wGe(e.charCodeAt(r)))return!1;s=!0}return!s||a==="_"?!1:a!==":"?!0:/^(
Line truncated
|
||||
\r`;function jGe(e){if(e===null)return!1;var t,r,s=0,a=e.length,n=GU;for(r=0;r<a;r++)if(t=n.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;s+=6}return s%8===0}function GGe(e){var t,r,s=e.replace(/[\r\n=]/g,""),a=s.length,n=GU,c=0,f=[];for(t=0;t<a;t++)t%4===0&&t&&(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)),c=c<<6|n.indexOf(s.charAt(t));return r=a%4*6,r===0?(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)):r===18?(f.push(c>>10&255),f.push(c>>2&255)):r===12&&f.push(c>>4&255),k0?k0.from?k0.from(f):new k0(f):f}function qGe(e){var t="",r=0,s,a,n=e.length,c=GU;for(s=0;s<n;s++)s%3===0&&s&&(t+=c[r>>18&63],t+=c[r>>12&63],t+=c[r>>6&63],t+=c[r&63]),r=(r<<8)+e[s];return a=n%3,a===0?(t+=c[r>>18&63],t+=c[r>>12&63],t+=c[r>>6&63],t+=c[r&63]):a===2?(t+=c[r>>10&63],t+=c[r>>4&63],t+=c[r<<2&63],t+=c[64]):a===1&&(t+=c[r>>2&63],t+=c[r<<4&63],t+=c[64],t+=c[64]),t}function YGe(e){return k0&&k0.isBuffer(e)}Hee.exports=new HGe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:jGe,construct:GGe,predicate:YGe,represent:qGe})});var qee=G((yxt,Gee)=>{"use strict";var WGe=xs(),VGe=Object.prototype.hasOwnProperty,KGe=Object.prototype.toString;function JGe(e){if(e===null)return!0;var t=[],r,s,a,n,c,f=e;for(r=0,s=f.length;r<s;r+=1){if(a=f[r],c=!1,KGe.call(a)!=="[object Object]")return!1;for(n in a)if(VGe.call(a,n))if(!c)c=!0;else return!1;if(!c)return!1;if(t.indexOf(n)===-1)t.push(n);else return!1}return!0}function zGe(e){return e!==null?e:[]}Gee.exports=new WGe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:JGe,construct:zGe})});var Wee=G((Ext,Yee)=>{"use strict";var ZGe=xs(),XGe=Object.prototype.toString;function $Ge(e){if(e===null)return!0;var t,r,s,a,n,c=e;for(n=new Array(c.length),t=0,r=c.length;t<r;t+=1){if(s=c[t],XGe.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;n[t]=[a[0],s[a[0]]]}return!0}function e5e(e){if(e===null)return[];var t,r,s,a,n,c=e;for(n=new Array(c.length),t=0,r=c.length;t<r;t+=1)s=c[t],a=Object.keys(s),n[t]=[a[0],s[a[0]]];return n}Yee.exports=new ZGe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:$Ge,construct:e5e})});var Kee=G((Ixt,Vee)=>{"use strict";var t5e=xs(),r5e=Object.prototype.hasOwnProperty;function n5e(e){if(e===null)return!0;var t,r=e;for(t in r)if(r5e.call(r,t)&&r[t]!==null)return!1;return!0}function i5e(e){return e!==null?e:{}}Vee.exports=new t5e("tag:yaml.org,2002:set",{kind:"mapping",resolve:n5e,construct:i5e})});var CE=G((Cxt,Jee)=>{"use strict";var s5e=x0();Jee.exports=new s5e({include:[jU()],implicit:[Lee(),Uee()],explicit:[jee(),qee(),Wee(),Kee()]})});var Zee=G((wxt,zee)=>{"use strict";var o5e=xs();function a5e(){return!0}function l5e(){}function c5e(){return""}function u5e(e){return typeof e>"u"}zee.exports=new o5e("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:a5e,construct:l5e,predicate:u5e,represent:c5e})});var $ee=G((Bxt,Xee)=>{"use strict";var f5e=xs();function A5e(e){if(e===null||e.length===0)return!1;var t=e,r=/\/([gim]*)$/.exec(e),s="";return!(t[0]==="/"&&(r&&(s=r[1]),s.length>3||t[t.length-s.length-1]!=="/"))}function p5e(e){var t=e,r=/\/([gim]*)$/.exec(e),s="";return t[0]==="/"&&(r&&(s=r[1]),t=t.slice(1,t.length-s.length-1)),new RegExp(t,s)}function h5e(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function d5e(e){return Object.prototype.toString.call(e)==="[object RegExp]"}Xee.exports=new f5e("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:A5e,construct:p5e,predicate:d5e,represent:h5e})});var rte=G((vxt,tte)=>{"use strict";var Bx;try{ete=Ce,Bx=ete("esprima")}catch{typeof window<"u"&&(Bx=window.esprima)}var ete,g5e=xs();function m5e(e){if(e===null)return!1;try{var t="("+e+")",r=Bx.parse(t,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function y5e(e){var t="("+e+")",r=Bx.parse(t,{range:!0}),s=[],a;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(n){s.push(n.name)}),a=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement"?new Function(s,t.slice(a[0]+1,a[1]-1)):new Function(s,"return "+t.slice(a[0],a[1]))}function E5e(e){return e.toString()}function I5e(e){return Object.prototype.toString.call(e)==="[object Function]"}tte.exports=new g5e("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:m5e,construct:y5e,predicate:I5e,represent:E5e})});var H2=G((bxt,ite)=>{"use strict";var nte=x0();ite.exports=nte.DEFAULT=new nte({include:[CE()],explicit:[Zee(),$ee(),rte()]})});var Bte=G((Dxt,j2)=>{"use strict";var Bp=P0(),fte=EE(),C5e=fee(),Ate=CE(),w5e=H2(),sd=Object.prototype.hasOwnProperty,vx=1,pte=2,hte=3,Sx=4,qU=1,B5e=2,ste=3,v5e=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84
Line truncated
|
||||
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function k5e(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var mte=new Array(256),yte=new Array(256);for(Q0=0;Q0<256;Q0++)mte[Q0]=ate(Q0)?1:0,yte[Q0]=ate(Q0);var Q0;function Q5e(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||w5e,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function Ete(e,t){return new fte(t,new C5e(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Nr(e,t){throw Ete(e,t)}function bx(e,t){e.onWarning&&e.onWarning.call(null,Ete(e,t))}var lte={YAML:function(t,r,s){var a,n,c;t.version!==null&&Nr(t,"duplication of %YAML directive"),s.length!==1&&Nr(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),a===null&&Nr(t,"ill-formed argument of the YAML directive"),n=parseInt(a[1],10),c=parseInt(a[2],10),n!==1&&Nr(t,"unacceptable YAML version of the document"),t.version=s[0],t.checkLineBreaks=c<2,c!==1&&c!==2&&bx(t,"unsupported YAML version of the document")},TAG:function(t,r,s){var a,n;s.length!==2&&Nr(t,"TAG directive accepts exactly two arguments"),a=s[0],n=s[1],dte.test(a)||Nr(t,"ill-formed tag handle (first argument) of the TAG directive"),sd.call(t.tagMap,a)&&Nr(t,'there is a previously declared suffix for "'+a+'" tag handle'),gte.test(n)||Nr(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[a]=n}};function id(e,t,r,s){var a,n,c,f;if(t<r){if(f=e.input.slice(t,r),s)for(a=0,n=f.length;a<n;a+=1)c=f.charCodeAt(a),c===9||32<=c&&c<=1114111||Nr(e,"expected valid JSON character");else v5e.test(f)&&Nr(e,"the stream contains non-printable characters");e.result+=f}}function cte(e,t,r,s){var a,n,c,f;for(Bp.isObject(r)||Nr(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(r),c=0,f=a.length;c<f;c+=1)n=a[c],sd.call(t,n)||(t[n]=r[n],s[n]=!0)}function BE(e,t,r,s,a,n,c,f){var p,h;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),p=0,h=a.length;p<h;p+=1)Array.isArray(a[p])&&Nr(e,"nested arrays are not supported inside keys"),typeof a=="object"&&ote(a[p])==="[object Object]"&&(a[p]="[object Object]");if(typeof a=="object"&&ote(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(n))for(p=0,h=n.length;p<h;p+=1)cte(e,t,n[p],r);else cte(e,t,n,r);else!e.json&&!sd.call(r,a)&&sd.call(t,a)&&(e.line=c||e.line,e.position=f||e.position,Nr(e,"duplicated mapping key")),t[a]=n,delete r[a];return t}function YU(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Nr(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function cs(e,t,r){for(var s=0,a=e.input.charCodeAt(e.position);a!==0;){for(;T0(a);)a=e.input.charCodeAt(++e.position);if(t&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(Yf(a))for(YU(e),a=e.input.charCodeAt(e.position),s++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return r!==-1&&s!==0&&e.lineIndent<r&&bx(e,"deficient indentation"),s}function Dx(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||fl(r)))}function WU(e,t){t===1?e.result+=" ":t>1&&(e.result+=Bp.repeat(`
|
||||
`,t-1))}function T5e(e,t,r){var s,a,n,c,f,p,h,E,C=e.kind,S=e.result,x;if(x=e.input.charCodeAt(e.position),fl(x)||wE(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(a=e.input.charCodeAt(e.position+1),fl(a)||r&&wE(a)))return!1;for(e.kind="scalar",e.result="",n=c=e.position,f=!1;x!==0;){if(x===58){if(a=e.input.charCodeAt(e.position+1),fl(a)||r&&wE(a))break}else if(x===35){if(s=e.input.charCodeAt(e.position-1),fl(s))break}else{if(e.position===e.lineStart&&Dx(e)||r&&wE(x))break;if(Yf(x))if(p=e.line,h=e.lineStart,E=e.lineIndent,cs(e,!1,-1),e.lineIndent>=t){f=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=c,e.line=p,e.lineStart=h,e.lineIndent=E;break}}f&&(id(e,n,c,!1),WU(e,e.line-p),n=c=e.position,f=!1),T0(x)||(c=e.position+1),x=e.input.charCodeAt(++e.position)}return id(e,n,c,!1),e.result?!0:(e.kind=C,e.result=S,!1)}function R5e(e,t){var r,s,a;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,s=a=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(id(e,s,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)s=e.position,e.position++,a=e.position;else return!0;else Yf(r)?(id(e,s,a,!0),WU(e,cs(e,!1,t)),s=a=e.position):e.position===e.lineStart&&Dx(e)?Nr(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);Nr(e,"unexpected end of the stream within a single quoted scalar")}function F5e(e,t){var r,s,a,n,c,f;if(f=e.input.charCodeAt(e.position),f!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=s=e.position;(f=e.input.charCodeAt(e.position))!==0;){if(f===34)return id(e,r,e.position,!0),e.position++,!0;if(f===92){if(id(e,r,e.position,!0),f=e.input.charCodeAt(++e.position),Yf(f))cs(e,!1,t);else if(f<256&&mte[f])e.result+=yte[f],e.position++;else if((c=P5e(f))>0){for(a=c,n=0;a>0;a--)f=e.input.charCodeAt(++e.position),(c=D5e(f))>=0?n=(n<<4)+c:Nr(e,"expected hexadecimal character");e.result+=k5e(n),e.position++}else Nr(e,"unknown escape sequence");r=s=e.position}else Yf(f)?(id(e,r,s,!0),WU(e,cs(e,!1,t)),r=s=e.position):e.position===e.lineStart&&Dx(e)?Nr(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}Nr(e,"unexpected end of the stream within a double quoted scalar")}function N5e(e,t){var r=!0,s,a=e.tag,n,c=e.anchor,f,p,h,E,C,S={},x,I,R,N;if(N=e.input.charCodeAt(e.position),N===91)p=93,C=!1,n=[];else if(N===123)p=125,C=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),N=e.input.charCodeAt(++e.position);N!==0;){if(cs(e,!0,t),N=e.input.charCodeAt(e.position),N===p)return e.position++,e.tag=a,e.anchor=c,e.kind=C?"mapping":"sequence",e.result=n,!0;r||Nr(e,"missed comma between flow collection entries"),I=x=R=null,h=E=!1,N===63&&(f=e.input.charCodeAt(e.position+1),fl(f)&&(h=E=!0,e.position++,cs(e,!0,t))),s=e.line,vE(e,t,vx,!1,!0),I=e.tag,x=e.result,cs(e,!0,t),N=e.input.charCodeAt(e.position),(E||e.line===s)&&N===58&&(h=!0,N=e.input.charCodeAt(++e.position),cs(e,!0,t),vE(e,t,vx,!1,!0),R=e.result),C?BE(e,n,S,I,x,R):h?n.push(BE(e,null,S,I,x,R)):n.push(x),cs(e,!0,t),N=e.input.charCodeAt(e.position),N===44?(r=!0,N=e.input.charCodeAt(++e.position)):r=!1}Nr(e,"unexpected end of the stream within a flow collection")}function O5e(e,t){var r,s,a=qU,n=!1,c=!1,f=t,p=0,h=!1,E,C;if(C=e.input.charCodeAt(e.position),C===124)s=!1;else if(C===62)s=!0;else return!1;for(e.kind="scalar",e.result="";C!==0;)if(C=e.input.charCodeAt(++e.position),C===43||C===45)qU===a?a=C===43?ste:B5e:Nr(e,"repeat of a chomping mode identifier");else if((E=x5e(C))>=0)E===0?Nr(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Nr(e,"repeat of an indentation width identifier"):(f=t+E-1,c=!0);else break;if(T0(C)){do C=e.input.charCodeAt(++e.position);while(T0(C));if(C===35)do C=e.input.charCodeAt(++e.position);while(!Yf(C)&&C!==0)}for(;C!==0;){for(YU(e),e.lineIndent=0,C=e.input.charCodeAt(e.position);(!c||e.lineIndent<f)&&C===32;)e.lineIndent++,C=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>f&&(f=e.lineIndent),Yf(C)){p++;continue}if(e.lineIndent<f){a===ste?e.result+=Bp.repeat(`
|
||||
`,n?1+p:p):a===qU&&n&&(e.result+=`
|
||||
`);break}for(s?T0(C)?(h=!0,e.result+=Bp.repeat(`
|
||||
`,n?1+p:p)):h?(h=!1,e.result+=Bp.repeat(`
|
||||
`,p+1)):p===0?n&&(e.result+=" "):e.result+=Bp.repeat(`
|
||||
`,p):e.result+=Bp.repeat(`
|
||||
`,n?1+p:p),n=!0,c=!0,p=0,r=e.position;!Yf(C)&&C!==0;)C=e.input.charCodeAt(++e.position);id(e,r,e.position,!1)}return!0}function ute(e,t){var r,s=e.tag,a=e.anchor,n=[],c,f=!1,p;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),p=e.input.charCodeAt(e.position);p!==0&&!(p!==45||(c=e.input.charCodeAt(e.position+1),!fl(c)));){if(f=!0,e.position++,cs(e,!0,-1)&&e.lineIndent<=t){n.push(null),p=e.input.charCodeAt(e.position);continue}if(r=e.line,vE(e,t,hte,!1,!0),n.push(e.result),cs(e,!0,-1),p=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&p!==0)Nr(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return f?(e.tag=s,e.anchor=a,e.kind="sequence",e.result=n,!0):!1}function L5e(e,t,r){var s,a,n,c,f=e.tag,p=e.anchor,h={},E={},C=null,S=null,x=null,I=!1,R=!1,N;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),N=e.input.charCodeAt(e.position);N!==0;){if(s=e.input.charCodeAt(e.position+1),n=e.line,c=e.position,(N===63||N===58)&&fl(s))N===63?(I&&(BE(e,h,E,C,S,null),C=S=x=null),R=!0,I=!0,a=!0):I?(I=!1,a=!0):Nr(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,N=s;else if(vE(e,r,pte,!1,!0))if(e.line===n){for(N=e.input.charCodeAt(e.position);T0(N);)N=e.input.charCodeAt(++e.position);if(N===58)N=e.input.charCodeAt(++e.position),fl(N)||Nr(e,"a whitespace character is expected after the key-value separator within a block mapping"),I&&(BE(e,h,E,C,S,null),C=S=x=null),R=!0,I=!1,a=!1,C=e.tag,S=e.result;else if(R)Nr(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=p,!0}else if(R)Nr(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=p,!0;else break;if((e.line===n||e.lineIndent>t)&&(vE(e,t,Sx,!0,a)&&(I?S=e.result:x=e.result),I||(BE(e,h,E,C,S,x,n,c),C=S=x=null),cs(e,!0,-1),N=e.input.charCodeAt(e.position)),e.lineIndent>t&&N!==0)Nr(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return I&&BE(e,h,E,C,S,null),R&&(e.tag=f,e.anchor=p,e.kind="mapping",e.result=h),R}function M5e(e){var t,r=!1,s=!1,a,n,c;if(c=e.input.charCodeAt(e.position),c!==33)return!1;if(e.tag!==null&&Nr(e,"duplication of a tag property"),c=e.input.charCodeAt(++e.position),c===60?(r=!0,c=e.input.charCodeAt(++e.position)):c===33?(s=!0,a="!!",c=e.input.charCodeAt(++e.position)):a="!",t=e.position,r){do c=e.input.charCodeAt(++e.position);while(c!==0&&c!==62);e.position<e.length?(n=e.input.slice(t,e.position),c=e.input.charCodeAt(++e.position)):Nr(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!fl(c);)c===33&&(s?Nr(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),dte.test(a)||Nr(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),c=e.input.charCodeAt(++e.position);n=e.input.slice(t,e.position),b5e.test(n)&&Nr(e,"tag suffix cannot contain flow indicator characters")}return n&&!gte.test(n)&&Nr(e,"tag name cannot contain such characters: "+n),r?e.tag=n:sd.call(e.tagMap,a)?e.tag=e.tagMap[a]+n:a==="!"?e.tag="!"+n:a==="!!"?e.tag="tag:yaml.org,2002:"+n:Nr(e,'undeclared tag handle "'+a+'"'),!0}function U5e(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Nr(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!fl(r)&&!wE(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Nr(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function _5e(e){var t,r,s;if(s=e.input.charCodeAt(e.position),s!==42)return!1;for(s=e.input.charCodeAt(++e.position),t=e.position;s!==0&&!fl(s)&&!wE(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&Nr(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),sd.call(e.anchorMap,r)||Nr(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],cs(e,!0,-1),!0}function vE(e,t,r,s,a){var n,c,f,p=1,h=!1,E=!1,C,S,x,I,R;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,n=c=f=Sx===r||hte===r,s&&cs(e,!0,-1)&&(h=!0,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)),p===1)for(;M5e(e)||U5e(e);)cs(e,!0,-1)?(h=!0,f=n,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)):f=!1;if(f&&(f=h||a),(p===1||Sx===r)&&(vx===r||pte===r?I=t:I=t+1,R=e.position-e.lineStart,p===1?f&&(ute(e,R)||L5e(e,R,I))||N5e(e,I)?E=!0:(c&&O5e(e,I)||R5e(e,I)||F5e(e,I)?E=!0:_5e(e)?(E=!0,(e.tag!==null||e.anchor!==null)&&Nr(e,"alias node should not have any properties")):T5e(e,I,vx===r)&&(E=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):p===0&&(E=f&&ute(e,R))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Nr(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),C=0,S=e.implicitTypes.length;C<S;C+=1)if(x=e.implicitTypes[C],x.resolve(e.result)){e.result=x.construct(e.result),e.
Line truncated
|
||||
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Q5e(e,t),s=e.indexOf("\0");for(s!==-1&&(r.position=s,Nr(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)H5e(r);return r.documents}function Cte(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var s=Ite(e,r);if(typeof t!="function")return s;for(var a=0,n=s.length;a<n;a+=1)t(s[a])}function wte(e,t){var r=Ite(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new fte("expected a single document in the stream, but found more")}}function j5e(e,t,r){return typeof t=="object"&&t!==null&&typeof r>"u"&&(r=t,t=null),Cte(e,t,Bp.extend({schema:Ate},r))}function G5e(e,t){return wte(e,Bp.extend({schema:Ate},t))}j2.exports.loadAll=Cte;j2.exports.load=wte;j2.exports.safeLoadAll=j5e;j2.exports.safeLoad=G5e});var Wte=G((Pxt,zU)=>{"use strict";var q2=P0(),Y2=EE(),q5e=H2(),Y5e=CE(),Qte=Object.prototype.toString,Tte=Object.prototype.hasOwnProperty,W5e=9,G2=10,V5e=13,K5e=32,J5e=33,z5e=34,Rte=35,Z5e=37,X5e=38,$5e=39,e9e=42,Fte=44,t9e=45,Nte=58,r9e=61,n9e=62,i9e=63,s9e=64,Ote=91,Lte=93,o9e=96,Mte=123,a9e=124,Ute=125,Vo={};Vo[0]="\\0";Vo[7]="\\a";Vo[8]="\\b";Vo[9]="\\t";Vo[10]="\\n";Vo[11]="\\v";Vo[12]="\\f";Vo[13]="\\r";Vo[27]="\\e";Vo[34]='\\"';Vo[92]="\\\\";Vo[133]="\\N";Vo[160]="\\_";Vo[8232]="\\L";Vo[8233]="\\P";var l9e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function c9e(e,t){var r,s,a,n,c,f,p;if(t===null)return{};for(r={},s=Object.keys(t),a=0,n=s.length;a<n;a+=1)c=s[a],f=String(t[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),p=e.compiledTypeMap.fallback[c],p&&Tte.call(p.styleAliases,f)&&(f=p.styleAliases[f]),r[c]=f;return r}function vte(e){var t,r,s;if(t=e.toString(16).toUpperCase(),e<=255)r="x",s=2;else if(e<=65535)r="u",s=4;else if(e<=4294967295)r="U",s=8;else throw new Y2("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+q2.repeat("0",s-t.length)+t}function u9e(e){this.schema=e.schema||q5e,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=q2.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=c9e(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ste(e,t){for(var r=q2.repeat(" ",t),s=0,a=-1,n="",c,f=e.length;s<f;)a=e.indexOf(`
|
||||
`,s),a===-1?(c=e.slice(s),s=f):(c=e.slice(s,a+1),s=a+1),c.length&&c!==`
|
||||
`&&(n+=r),n+=c;return n}function VU(e,t){return`
|
||||
`+q2.repeat(" ",e.indent*t)}function f9e(e,t){var r,s,a;for(r=0,s=e.implicitTypes.length;r<s;r+=1)if(a=e.implicitTypes[r],a.resolve(t))return!0;return!1}function JU(e){return e===K5e||e===W5e}function SE(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function A9e(e){return SE(e)&&!JU(e)&&e!==65279&&e!==V5e&&e!==G2}function bte(e,t){return SE(e)&&e!==65279&&e!==Fte&&e!==Ote&&e!==Lte&&e!==Mte&&e!==Ute&&e!==Nte&&(e!==Rte||t&&A9e(t))}function p9e(e){return SE(e)&&e!==65279&&!JU(e)&&e!==t9e&&e!==i9e&&e!==Nte&&e!==Fte&&e!==Ote&&e!==Lte&&e!==Mte&&e!==Ute&&e!==Rte&&e!==X5e&&e!==e9e&&e!==J5e&&e!==a9e&&e!==r9e&&e!==n9e&&e!==$5e&&e!==z5e&&e!==Z5e&&e!==s9e&&e!==o9e}function _te(e){var t=/^\n* /;return t.test(e)}var Hte=1,jte=2,Gte=3,qte=4,Px=5;function h9e(e,t,r,s,a){var n,c,f,p=!1,h=!1,E=s!==-1,C=-1,S=p9e(e.charCodeAt(0))&&!JU(e.charCodeAt(e.length-1));if(t)for(n=0;n<e.length;n++){if(c=e.charCodeAt(n),!SE(c))return Px;f=n>0?e.charCodeAt(n-1):null,S=S&&bte(c,f)}else{for(n=0;n<e.length;n++){if(c=e.charCodeAt(n),c===G2)p=!0,E&&(h=h||n-C-1>s&&e[C+1]!==" ",C=n);else if(!SE(c))return Px;f=n>0?e.charCodeAt(n-1):null,S=S&&bte(c,f)}h=h||E&&n-C-1>s&&e[C+1]!==" "}return!p&&!h?S&&!a(e)?Hte:jte:r>9&&_te(e)?Px:h?qte:Gte}function d9e(e,t,r,s){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&l9e.indexOf(t)!==-1)return"'"+t+"'";var a=e.indent*Math.max(1,r),n=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=s||e.flowLevel>-1&&r>=e.flowLevel;function f(p){return f9e(e,p)}switch(h9e(t,c,e.indent,n,f)){case Hte:return t;case jte:return"'"+t.replace(/'/g,"''")+"'";case Gte:return"|"+Dte(t,e.indent)+Pte(Ste(t,a));case qte:return">"+Dte(t,e.indent)+Pte(Ste(g9e(t,n),a));case Px:return'"'+m9e(t,n)+'"';default:throw new Y2("impossible error: invalid scalar style")}}()}function Dte(e,t){var r=_te(e)?String(t):"",s=e[e.length-1]===`
|
||||
`,a=s&&(e[e.length-2]===`
|
||||
`||e===`
|
||||
`),n=a?"+":s?"":"-";return r+n+`
|
||||
`}function Pte(e){return e[e.length-1]===`
|
||||
`?e.slice(0,-1):e}function g9e(e,t){for(var r=/(\n+)([^\n]*)/g,s=function(){var h=e.indexOf(`
|
||||
`);return h=h!==-1?h:e.length,r.lastIndex=h,xte(e.slice(0,h),t)}(),a=e[0]===`
|
||||
`||e[0]===" ",n,c;c=r.exec(e);){var f=c[1],p=c[2];n=p[0]===" ",s+=f+(!a&&!n&&p!==""?`
|
||||
`:"")+xte(p,t),a=n}return s}function xte(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,s,a=0,n,c=0,f=0,p="";s=r.exec(e);)f=s.index,f-a>t&&(n=c>a?c:f,p+=`
|
||||
`+e.slice(a,n),a=n+1),c=f;return p+=`
|
||||
`,e.length-a>t&&c>a?p+=e.slice(a,c)+`
|
||||
`+e.slice(c+1):p+=e.slice(a),p.slice(1)}function m9e(e){for(var t="",r,s,a,n=0;n<e.length;n++){if(r=e.charCodeAt(n),r>=55296&&r<=56319&&(s=e.charCodeAt(n+1),s>=56320&&s<=57343)){t+=vte((r-55296)*1024+s-56320+65536),n++;continue}a=Vo[r],t+=!a&&SE(r)?e[n]:a||vte(r)}return t}function y9e(e,t,r){var s="",a=e.tag,n,c;for(n=0,c=r.length;n<c;n+=1)R0(e,t,r[n],!1,!1)&&(n!==0&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function E9e(e,t,r,s){var a="",n=e.tag,c,f;for(c=0,f=r.length;c<f;c+=1)R0(e,t+1,r[c],!0,!0)&&((!s||c!==0)&&(a+=VU(e,t)),e.dump&&G2===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=n,e.dump=a||"[]"}function I9e(e,t,r){var s="",a=e.tag,n=Object.keys(r),c,f,p,h,E;for(c=0,f=n.length;c<f;c+=1)E="",c!==0&&(E+=", "),e.condenseFlow&&(E+='"'),p=n[c],h=r[p],R0(e,t,p,!1,!1)&&(e.dump.length>1024&&(E+="? "),E+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),R0(e,t,h,!1,!1)&&(E+=e.dump,s+=E));e.tag=a,e.dump="{"+s+"}"}function C9e(e,t,r,s){var a="",n=e.tag,c=Object.keys(r),f,p,h,E,C,S;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new Y2("sortKeys must be a boolean or a function");for(f=0,p=c.length;f<p;f+=1)S="",(!s||f!==0)&&(S+=VU(e,t)),h=c[f],E=r[h],R0(e,t+1,h,!0,!0,!0)&&(C=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,C&&(e.dump&&G2===e.dump.charCodeAt(0)?S+="?":S+="? "),S+=e.dump,C&&(S+=VU(e,t)),R0(e,t+1,E,!0,C)&&(e.dump&&G2===e.dump.charCodeAt(0)?S+=":":S+=": ",S+=e.dump,a+=S));e.tag=n,e.dump=a||"{}"}function kte(e,t,r){var s,a,n,c,f,p;for(a=r?e.explicitTypes:e.implicitTypes,n=0,c=a.length;n<c;n+=1)if(f=a[n],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof t=="object"&&t instanceof f.instanceOf)&&(!f.predicate||f.predicate(t))){if(e.tag=r?f.tag:"?",f.represent){if(p=e.styleMap[f.tag]||f.defaultStyle,Qte.call(f.represent)==="[object Function]")s=f.represent(t,p);else if(Tte.call(f.represent,p))s=f.represent[p](t,p);else throw new Y2("!<"+f.tag+'> tag resolver accepts not "'+p+'" style');e.dump=s}return!0}return!1}function R0(e,t,r,s,a,n){e.tag=null,e.dump=r,kte(e,r,!1)||kte(e,r,!0);var c=Qte.call(e.dump);s&&(s=e.flowLevel<0||e.flowLevel>t);var f=c==="[object Object]"||c==="[object Array]",p,h;if(f&&(p=e.duplicates.indexOf(r),h=p!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)&&(a=!1),h&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(f&&h&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")s&&Object.keys(e.dump).length!==0?(C9e(e,t,e.dump,a),h&&(e.dump="&ref_"+p+e.dump)):(I9e(e,t,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]"){var E=e.noArrayIndent&&t>0?t-1:t;s&&e.dump.length!==0?(E9e(e,E,e.dump,a),h&&(e.dump="&ref_"+p+e.dump)):(y9e(e,E,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump))}else if(c==="[object String]")e.tag!=="?"&&d9e(e,e.dump,t,n);else{if(e.skipInvalid)return!1;throw new Y2("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function w9e(e,t){var r=[],s=[],a,n;for(KU(e,r,s),a=0,n=s.length;a<n;a+=1)t.duplicates.push(r[s[a]]);t.usedDuplicates=new Array(n)}function KU(e,t,r){var s,a,n;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(t.push(e),Array.isArray(e))for(a=0,n=e.length;a<n;a+=1)KU(e[a],t,r);else for(s=Object.keys(e),a=0,n=s.length;a<n;a+=1)KU(e[s[a]],t,r)}function Yte(e,t){t=t||{};var r=new u9e(t);return r.noRefs||w9e(e,r),R0(r,0,e,!0,!0)?r.dump+`
|
||||
`:""}function B9e(e,t){return Yte(e,q2.extend({schema:Y5e},t))}zU.exports.dump=Yte;zU.exports.safeDump=B9e});var Kte=G((xxt,Yi)=>{"use strict";var xx=Bte(),Vte=Wte();function kx(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}Yi.exports.Type=xs();Yi.exports.Schema=x0();Yi.exports.FAILSAFE_SCHEMA=wx();Yi.exports.JSON_SCHEMA=HU();Yi.exports.CORE_SCHEMA=jU();Yi.exports.DEFAULT_SAFE_SCHEMA=CE();Yi.exports.DEFAULT_FULL_SCHEMA=H2();Yi.exports.load=xx.load;Yi.exports.loadAll=xx.loadAll;Yi.exports.safeLoad=xx.safeLoad;Yi.exports.safeLoadAll=xx.safeLoadAll;Yi.exports.dump=Vte.dump;Yi.exports.safeDump=Vte.safeDump;Yi.exports.YAMLException=EE();Yi.exports.MINIMAL_SCHEMA=wx();Yi.exports.SAFE_SCHEMA=CE();Yi.exports.DEFAULT_SCHEMA=H2();Yi.exports.scan=kx("scan");Yi.exports.parse=kx("parse");Yi.exports.compose=kx("compose");Yi.exports.addConstructor=kx("addConstructor")});var zte=G((kxt,Jte)=>{"use strict";var v9e=Kte();Jte.exports=v9e});var Xte=G((Qxt,Zte)=>{"use strict";function S9e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function F0(e,t,r,s){this.message=e,this.expected=t,this.found=r,this.location=s,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,F0)}S9e(F0,Error);F0.buildMessage=function(e,t){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+"-"+n(h.parts[C][1]):n(h.parts[C]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+f(e)+" but "+p(t)+" found."};function b9e(e,t){t=t!==void 0?t:{};var r={},s={Start:fc},a=fc,n=function(te){return[].concat(...te)},c="-",f=yn("-",!1),p=function(te){return te},h=function(te){return Object.assign({},...te)},E="#",C=yn("#",!1),S=fu(),x=function(){return{}},I=":",R=yn(":",!1),N=function(te,Ee){return{[te]:Ee}},U=",",K=yn(",",!1),$=function(te,Ee){return Ee},ie=function(te,Ee,Oe){return Object.assign({},...[te].concat(Ee).map(mt=>({[mt]:Oe})))},fe=function(te){return te},le=function(te){return te},ge=Wa("correct indentation"),pe=" ",De=yn(" ",!1),ye=function(te){return te.length===lr*St},d=function(te){return te.length===(lr+1)*St},ve=function(){return lr++,!0},Ie=function(){return lr--,!0},me=function(){return ha()},ce=Wa("pseudostring"),X=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,be=Xn(["\r",`
|
||||
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),ke=/^[^\r\n\t ,\][{}:#"']/,it=Xn(["\r",`
|
||||
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),_=function(){return ha().replace(/^ *| *$/g,"")},tt="--",Fe=yn("--",!1),Qe=/^[a-zA-Z\/0-9]/,Se=Xn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),je=/^[^\r\n\t :,]/,Te=Xn(["\r",`
|
||||
`," "," ",":",","],!0,!1),ct="null",Me=yn("null",!1),P=function(){return null},w="true",D=yn("true",!1),y=function(){return!0},F="false",z=yn("false",!1),Z=function(){return!1},ee=Wa("string"),se='"',xe=yn('"',!1),Ne=function(){return""},ut=function(te){return te},Ct=function(te){return te.join("")},Yt=/^[^"\\\0-\x1F\x7F]/,ir=Xn(['"',"\\",["\0",""],"\x7F"],!0,!1),Pt='\\"',mn=yn('\\"',!1),Pr=function(){return'"'},Cr="\\\\",Lr=yn("\\\\",!1),on=function(){return"\\"},ci="\\/",Do=yn("\\/",!1),is=function(){return"/"},ao="\\b",Po=yn("\\b",!1),ji=function(){return"\b"},lo="\\f",xo=yn("\\f",!1),FA=function(){return"\f"},df="\\n",mh=yn("\\n",!1),yh=function(){return`
|
||||
`},co="\\r",qn=yn("\\r",!1),Ns=function(){return"\r"},uo="\\t",ou=yn("\\t",!1),au=function(){return" "},lu="\\u",NA=yn("\\u",!1),OA=function(te,Ee,Oe,mt){return String.fromCharCode(parseInt(`0x${te}${Ee}${Oe}${mt}`))},Aa=/^[0-9a-fA-F]/,pa=Xn([["0","9"],["a","f"],["A","F"]],!1,!1),LA=Wa("blank space"),gr=/^[ \t]/,ko=Xn([" "," "],!1,!1),qa=Wa("white space"),Ue=/^[ \t\n\r]/,wr=Xn([" "," ",`
|
||||
`,"\r"],!1,!1),gf=`\r
|
||||
`,MA=yn(`\r
|
||||
`,!1),UA=`
|
||||
`,cu=yn(`
|
||||
`,!1),uu="\r",cc=yn("\r",!1),we=0,Ot=0,uc=[{line:1,column:1}],Oi=0,fo=[],Rt=0,Tn;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function ha(){return e.substring(Ot,we)}function Gi(){return Ka(Ot,we)}function Li(te,Ee){throw Ee=Ee!==void 0?Ee:Ka(Ot,we),mf([Wa(te)],e.substring(Ot,we),Ee)}function Ya(te,Ee){throw Ee=Ee!==void 0?Ee:Ka(Ot,we),Ja(te,Ee)}function yn(te,Ee){return{type:"literal",text:te,ignoreCase:Ee}}function Xn(te,Ee,Oe){return{type:"class",parts:te,inverted:Ee,ignoreCase:Oe}}function fu(){return{type:"any"}}function Eh(){return{type:"end"}}function Wa(te){return{type:"other",description:te}}function Va(te){var Ee=uc[te],Oe;if(Ee)return Ee;for(Oe=te-1;!uc[Oe];)Oe--;for(Ee=uc[Oe],Ee={line:Ee.line,column:Ee.column};Oe<te;)e.charCodeAt(Oe)===10?(Ee.line++,Ee.column=1):Ee.column++,Oe++;return uc[te]=Ee,Ee}function Ka(te,Ee){var Oe=Va(te),mt=Va(Ee);return{start:{offset:te,line:Oe.line,column:Oe.column},end:{offset:Ee,line:mt.line,column:mt.column}}}function $e(te){we<Oi||(we>Oi&&(Oi=we,fo=[]),fo.push(te))}function Ja(te,Ee){return new F0(te,null,null,Ee)}function mf(te,Ee,Oe){return new F0(F0.buildMessage(te,Ee),te,Ee,Oe)}function fc(){var te;return te=_A(),te}function Sn(){var te,Ee,Oe;for(te=we,Ee=[],Oe=da();Oe!==r;)Ee.push(Oe),Oe=da();return Ee!==r&&(Ot=te,Ee=n(Ee)),te=Ee,te}function da(){var te,Ee,Oe,mt,Et;return te=we,Ee=Ql(),Ee!==r?(e.charCodeAt(we)===45?(Oe=c,we++):(Oe=r,Rt===0&&$e(f)),Oe!==r?(mt=Fn(),mt!==r?(Et=ga(),Et!==r?(Ot=te,Ee=p(Et),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te}function _A(){var te,Ee,Oe;for(te=we,Ee=[],Oe=HA();Oe!==r;)Ee.push(Oe),Oe=HA();return Ee!==r&&(Ot=te,Ee=h(Ee)),te=Ee,te}function HA(){var te,Ee,Oe,mt,Et,Dt,tr,pn,ui;if(te=we,Ee=Fn(),Ee===r&&(Ee=null),Ee!==r){if(Oe=we,e.charCodeAt(we)===35?(mt=E,we++):(mt=r,Rt===0&&$e(C)),mt!==r){if(Et=[],Dt=we,tr=we,Rt++,pn=at(),Rt--,pn===r?tr=void 0:(we=tr,tr=r),tr!==r?(e.length>we?(pn=e.charAt(we),we++):(pn=r,Rt===0&&$e(S)),pn!==r?(tr=[tr,pn],Dt=tr):(we=Dt,Dt=r)):(we=Dt,Dt=r),Dt!==r)for(;Dt!==r;)Et.push(Dt),Dt=we,tr=we,Rt++,pn=at(),Rt--,pn===r?tr=void 0:(we=tr,tr=r),tr!==r?(e.length>we?(pn=e.charAt(we),we++):(pn=r,Rt===0&&$e(S)),pn!==r?(tr=[tr,pn],Dt=tr):(we=Dt,Dt=r)):(we=Dt,Dt=r);else Et=r;Et!==r?(mt=[mt,Et],Oe=mt):(we=Oe,Oe=r)}else we=Oe,Oe=r;if(Oe===r&&(Oe=null),Oe!==r){if(mt=[],Et=ze(),Et!==r)for(;Et!==r;)mt.push(Et),Et=ze();else mt=r;mt!==r?(Ot=te,Ee=x(),te=Ee):(we=te,te=r)}else we=te,te=r}else we=te,te=r;if(te===r&&(te=we,Ee=Ql(),Ee!==r?(Oe=za(),Oe!==r?(mt=Fn(),mt===r&&(mt=null),mt!==r?(e.charCodeAt(we)===58?(Et=I,we++):(Et=r,Rt===0&&$e(R)),Et!==r?(Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(tr=ga(),tr!==r?(Ot=te,Ee=N(Oe,tr),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r&&(te=we,Ee=Ql(),Ee!==r?(Oe=ss(),Oe!==r?(mt=Fn(),mt===r&&(mt=null),mt!==r?(e.charCodeAt(we)===58?(Et=I,we++):(Et=r,Rt===0&&$e(R)),Et!==r?(Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(tr=ga(),tr!==r?(Ot=te,Ee=N(Oe,tr),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r))){if(te=we,Ee=Ql(),Ee!==r)if(Oe=ss(),Oe!==r)if(mt=Fn(),mt!==r)if(Et=Au(),Et!==r){if(Dt=[],tr=ze(),tr!==r)for(;tr!==r;)Dt.push(tr),tr=ze();else Dt=r;Dt!==r?(Ot=te,Ee=N(Oe,Et),te=Ee):(we=te,te=r)}else we=te,te=r;else we=te,te=r;else we=te,te=r;else we=te,te=r;if(te===r)if(te=we,Ee=Ql(),Ee!==r)if(Oe=ss(),Oe!==r){if(mt=[],Et=we,Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(e.charCodeAt(we)===44?(tr=U,we++):(tr=r,Rt===0&&$e(K)),tr!==r?(pn=Fn(),pn===r&&(pn=null),pn!==r?(ui=ss(),ui!==r?(Ot=Et,Dt=$(Oe,ui),Et=Dt):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r),Et!==r)for(;Et!==r;)mt.push(Et),Et=we,Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(e.charCodeAt(we)===44?(tr=U,we++):(tr=r,Rt===0&&$e(K)),tr!==r?(pn=Fn(),pn===r&&(pn=null),pn!==r?(ui=ss(),ui!==r?(Ot=Et,Dt=$(Oe,ui),Et=Dt):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r);else mt=r;mt!==r?(Et=Fn(),Et===r&&(Et=null),Et!==r?(e.charCodeAt(we)===58?(Dt=I,we++):(Dt=r,Rt===0&&$e(R)),Dt!==r?(tr=Fn(),tr===r&&(tr=null),tr!==r?(pn=ga(),pn!==r?(Ot=te,Ee=ie(Oe,mt,pn),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)}else we=te,te=r;else we=te,te=r}return te}function ga(){var te,Ee,Oe,mt,Et,Dt,tr;if(te=we,Ee=we,Rt++,Oe=we,mt=at(),mt!==r?(Et=Ut(),Et!==r?(e.charCodeAt(we)===45?(Dt=c,we++):(Dt=r,Rt===0&&$e(f)),Dt!==r?(tr=Fn(),tr!==r?(mt=[mt,Et,Dt,tr],Oe=mt):(we=Oe,Oe=r)):(we=Oe,Oe=r)):(we=Oe,Oe=r)):(we=Oe,Oe=r),Rt--,Oe!==r?(we=Ee,Ee=void 0):Ee=r,Ee!==r?(Oe=ze(),Oe!==r?(mt=Rn(),mt!==r?(Et=Sn(),Et!==r?(Dt=ma(),Dt!==r?(Ot=te,Ee=fe(Et),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r&&(te=we,Ee=at(),Ee!==r?(Oe=Rn(),Oe!==r?(mt=_A(),mt!==r?(Et=ma(),Et!==r?(Ot=te,Ee=fe(mt),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r))if(te=we,Ee=Ac(),Ee!==r){if(Oe=[],mt=ze(),mt!==r)for(;mt!==r;)Oe.push(mt),mt=ze();else Oe=r;Oe!==r?(Ot=te,Ee=lLine truncated
|
||||
`;if(typeof e=="number"||typeof e=="boolean")return`${e.toString()}
|
||||
`;if(typeof e=="string")return`${ere(e)}
|
||||
`;if(Array.isArray(e)){if(e.length===0)return`[]
|
||||
`;let s=" ".repeat(t);return`
|
||||
${e.map(n=>`${s}- ${ZU(n,t+1,!1)}`).join("")}`}if(typeof e=="object"&&e){let[s,a]=e instanceof Qx?[e.data,!1]:[e,!0],n=" ".repeat(t),c=Object.keys(s);a&&c.sort((p,h)=>{let E=$te.indexOf(p),C=$te.indexOf(h);return E===-1&&C===-1?p<h?-1:p>h?1:0:E!==-1&&C===-1?-1:E===-1&&C!==-1?1:E-C});let f=c.filter(p=>!rre(s[p])).map((p,h)=>{let E=s[p],C=ere(p),S=ZU(E,t+1,!0),x=h>0||r?n:"",I=C.length>1024?`? ${C}
|
||||
${x}:`:`${C}:`,R=S.startsWith(`
|
||||
`)?S:` ${S}`;return`${x}${I}${R}`}).join(t===0?`
|
||||
`:"")||`
|
||||
`;return r?`
|
||||
${f}`:`${f}`}throw new Error(`Unsupported value type (${e})`)}function Al(e){try{let t=ZU(e,0,!1);return t!==`
|
||||
`?t:""}catch(t){throw t.location&&(t.message=t.message.replace(/(\.)?$/,` (line ${t.location.start.line}, column ${t.location.start.column})$1`)),t}}function P9e(e){return e.endsWith(`
|
||||
`)||(e+=`
|
||||
`),(0,tre.parse)(e)}function k9e(e){if(x9e.test(e))return P9e(e);let t=(0,Tx.safeLoad)(e,{schema:Tx.FAILSAFE_SCHEMA,json:!0});if(t==null)return{};if(typeof t!="object")throw new Error(`Expected an indexed object, got a ${typeof t} instead. Does your file follow Yaml's rules?`);if(Array.isArray(t))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return t}function us(e){return k9e(e)}var Tx,tre,D9e,$te,Qx,x9e,nre=Ze(()=>{Tx=et(zte()),tre=et(Xte()),D9e=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,$te=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],Qx=class{constructor(t){this.data=t}};Al.PreserveOrdering=Qx;x9e=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i});var W2={};Vt(W2,{parseResolution:()=>Ex,parseShell:()=>gx,parseSyml:()=>us,stringifyArgument:()=>LU,stringifyArgumentSegment:()=>MU,stringifyArithmeticExpression:()=>yx,stringifyCommand:()=>OU,stringifyCommandChain:()=>yE,stringifyCommandChainThen:()=>NU,stringifyCommandLine:()=>mx,stringifyCommandLineThen:()=>FU,stringifyEnvSegment:()=>dx,stringifyRedirectArgument:()=>U2,stringifyResolution:()=>Ix,stringifyShell:()=>mE,stringifyShellLine:()=>mE,stringifySyml:()=>Al,stringifyValueArgument:()=>S0});var Sc=Ze(()=>{ree();oee();nre()});var sre=G((Oxt,XU)=>{"use strict";var Q9e=e=>{let t=!1,r=!1,s=!1;for(let a=0;a<e.length;a++){let n=e[a];t&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(e=e.slice(0,a)+"-"+e.slice(a),t=!1,s=r,r=!0,a++):r&&s&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(e=e.slice(0,a-1)+"-"+e.slice(a-1),s=r,r=!1,t=!0):(t=n.toLowerCase()===n&&n.toUpperCase()!==n,s=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return e},ire=(e,t)=>{if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);let r=a=>t.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(e)?e=e.map(a=>a.trim()).filter(a=>a.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=Q9e(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\d+(\w|$)/g,a=>a.toUpperCase()),r(e))};XU.exports=ire;XU.exports.default=ire});var ore=G((Lxt,T9e)=>{T9e.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEH
Line truncated
|
||||
|
||||
${this.candidates.map(({usage:a})=>`$ ${a}`).join(`
|
||||
`)}`}else if(this.candidates.length===1){let[{usage:s}]=this.candidates;this.message=`Command not found; did you mean:
|
||||
|
||||
$ ${s}
|
||||
${r_(t)}`}else this.message=`Command not found; did you mean one of:
|
||||
|
||||
${this.candidates.map(({usage:s},a)=>`${`${a}.`.padStart(4)} ${s}`).join(`
|
||||
`)}
|
||||
|
||||
${r_(t)}`}},Nx=class extends Error{constructor(t,r){super(),this.input=t,this.usages=r,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
|
||||
|
||||
${this.usages.map((s,a)=>`${`${a}.`.padStart(4)} ${s}`).join(`
|
||||
`)}
|
||||
|
||||
${r_(t)}`}},r_=e=>`While running ${e.filter(t=>t!==ii.EndOfInput&&t!==ii.EndOfPartialInput).map(t=>{let r=JSON.stringify(t);return t.match(/\s/)||t.length===0||r!==`"${t}"`?r:t}).join(" ")}`});function R9e(e){let t=e.split(`
|
||||
`),r=t.filter(a=>a.match(/\S/)),s=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return t.map(a=>a.slice(s).trimRight()).join(`
|
||||
`)}function Ko(e,{format:t,paragraphs:r}){return e=e.replace(/\r\n?/g,`
|
||||
`),e=R9e(e),e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
|
||||
|
||||
`),e=e.replace(/\n(\n)?\n*/g,(s,a)=>a||" "),r&&(e=e.split(/\n/).map(s=>{let a=s.match(/^\s*[*-][\t ]+(.*)/);if(!a)return s.match(/(.{1,80})(?: |$)/g).join(`
|
||||
`);let n=s.length-s.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,"g")).map((c,f)=>" ".repeat(n)+(f===0?"- ":" ")+c).join(`
|
||||
`)}).join(`
|
||||
|
||||
`)),e=e.replace(/(`+)((?:.|[\n])*?)\1/g,(s,a,n)=>t.code(a+n+a)),e=e.replace(/(\*\*)((?:.|[\n])*?)\1/g,(s,a,n)=>t.bold(a+n+a)),e?`${e}
|
||||
`:""}var n_,ure,fre,i_=Ze(()=>{n_=Array(80).fill("\u2501");for(let e=0;e<=24;++e)n_[n_.length-e]=`\x1B[38;5;${232+e}m\u2501`;ure={header:e=>`\x1B[1m\u2501\u2501\u2501 ${e}${e.length<75?` ${n_.slice(e.length+5).join("")}`:":"}\x1B[0m`,bold:e=>`\x1B[1m${e}\x1B[22m`,error:e=>`\x1B[31m\x1B[1m${e}\x1B[22m\x1B[39m`,code:e=>`\x1B[36m${e}\x1B[39m`},fre={header:e=>e,bold:e=>e,error:e=>e,code:e=>e}});function va(e){return{...e,[V2]:!0}}function Wf(e,t){return typeof e>"u"?[e,t]:typeof e=="object"&&e!==null&&!Array.isArray(e)?[void 0,e]:[e,t]}function Lx(e,{mergeName:t=!1}={}){let r=e.match(/^([^:]+): (.*)$/m);if(!r)return"validation failed";let[,s,a]=r;return t&&(a=a[0].toLowerCase()+a.slice(1)),a=s!=="."||!t?`${s.replace(/^\.(\[|$)/,"$1")}: ${a}`:`: ${a}`,a}function K2(e,t){return t.length===1?new ot(`${e}${Lx(t[0],{mergeName:!0})}`):new ot(`${e}:
|
||||
${t.map(r=>`
|
||||
- ${Lx(r)}`).join("")}`)}function L0(e,t,r){if(typeof r>"u")return t;let s=[],a=[],n=f=>{let p=t;return t=f,n.bind(null,p)};if(!r(t,{errors:s,coercions:a,coercion:n}))throw K2(`Invalid value for ${e}`,s);for(let[,f]of a)f();return t}var V2,vp=Ze(()=>{Ox();V2=Symbol("clipanion/isOption")});var qs={};Vt(qs,{KeyRelationship:()=>Vf,TypeAssertionError:()=>ad,applyCascade:()=>z2,as:()=>X9e,assert:()=>J9e,assertWithErrors:()=>z9e,cascade:()=>ld,fn:()=>$9e,hasAtLeastOneKey:()=>f_,hasExactLength:()=>gre,hasForbiddenKeys:()=>yqe,hasKeyRelationship:()=>X2,hasMaxLength:()=>tqe,hasMinLength:()=>eqe,hasMutuallyExclusiveKeys:()=>Eqe,hasRequiredKeys:()=>mqe,hasUniqueItems:()=>rqe,isArray:()=>Mx,isAtLeast:()=>c_,isAtMost:()=>sqe,isBase64:()=>pqe,isBoolean:()=>H9e,isDate:()=>G9e,isDict:()=>W9e,isEnum:()=>Qs,isHexColor:()=>Aqe,isISO8601:()=>fqe,isInExclusiveRange:()=>aqe,isInInclusiveRange:()=>oqe,isInstanceOf:()=>K9e,isInteger:()=>u_,isJSON:()=>hqe,isLiteral:()=>pre,isLowerCase:()=>lqe,isMap:()=>Y9e,isNegative:()=>nqe,isNullable:()=>gqe,isNumber:()=>a_,isObject:()=>hre,isOneOf:()=>l_,isOptional:()=>dqe,isPartial:()=>V9e,isPayload:()=>j9e,isPositive:()=>iqe,isRecord:()=>_x,isSet:()=>q9e,isString:()=>Jf,isTuple:()=>Ux,isUUID4:()=>uqe,isUnknown:()=>o_,isUpperCase:()=>cqe,makeTrait:()=>dre,makeValidator:()=>Wr,matchesRegExp:()=>Sp,softAssert:()=>Z9e});function si(e){return e===null?"null":e===void 0?"undefined":e===""?"an empty string":typeof e=="symbol"?`<${e.toString()}>`:Array.isArray(e)?"an array":JSON.stringify(e)}function DE(e,t){if(e.length===0)return"nothing";if(e.length===1)return si(e[0]);let r=e.slice(0,-1),s=e[e.length-1],a=e.length>2?`, ${t} `:` ${t} `;return`${r.map(n=>si(n)).join(", ")}${a}${si(s)}`}function od(e,t){var r,s,a;return typeof t=="number"?`${(r=e?.p)!==null&&r!==void 0?r:"."}[${t}]`:F9e.test(t)?`${(s=e?.p)!==null&&s!==void 0?s:""}.${t}`:`${(a=e?.p)!==null&&a!==void 0?a:"."}[${JSON.stringify(t)}]`}function s_(e,t,r){return e===1?t:r}function Er({errors:e,p:t}={},r){return e?.push(`${t??"."}: ${r}`),!1}function U9e(e,t){return r=>{e[t]=r}}function Kf(e,t){return r=>{let s=e[t];return e[t]=r,Kf(e,t).bind(null,s)}}function J2(e,t,r){let s=()=>(e(r()),a),a=()=>(e(t),s);return s}function o_(){return Wr({test:(e,t)=>!0})}function pre(e){return Wr({test:(t,r)=>t!==e?Er(r,`Expected ${si(e)} (got ${si(t)})`):!0})}function Jf(){return Wr({test:(e,t)=>typeof e!="string"?Er(t,`Expected a string (got ${si(e)})`):!0})}function Qs(e){let t=Array.isArray(e)?e:Object.values(e),r=t.every(a=>typeof a=="string"||typeof a=="number"),s=new Set(t);return s.size===1?pre([...s][0]):Wr({test:(a,n)=>s.has(a)?!0:r?Er(n,`Expected one of ${DE(t,"or")} (got ${si(a)})`):Er(n,`Expected a valid enumeration value (got ${si(a)})`)})}function H9e(){return Wr({test:(e,t)=>{var r;if(typeof e!="boolean"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return Er(t,"Unbound coercion result");let s=_9e.get(e);if(typeof s<"u")return t.coercions.push([(r=t.p)!==null&&r!==void 0?r:".",t.coercion.bind(null,s)]),!0}return Er(t,`Expected a boolean (got ${si(e)})`)}return!0}})}function a_(){return Wr({test:(e,t)=>{var r;if(typeof e!="number"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return Er(t,"Unbound coercion result");let s;if(typeof e=="string"){let a;try{a=JSON.parse(e)}catch{}if(typeof a=="number")if(JSON.stringify(a)===e)s=a;else return Er(t,`Received a number that can't be safely represented by the runtime (${e})`)}if(typeof s<"u")return t.coercions.push([(r=t.p)!==null&&r!==void 0?r:".",t.coercion.bind(null,s)]),!0}return Er(t,`Expected a number (got ${si(e)})`)}return!0}})}function j9e(e){return Wr({test:(t,r)=>{var s;if(typeof r?.coercions>"u")return Er(r,"The isPayload predicate can only be used with coercion enabled");if(typeof r.coercion>"u")return Er(r,"Unbound coercion result");if(typeof t!="string")return Er(r,`Expected a string (got ${si(t)})`);let a;try{a=JSON.parse(t)}catch{return Er(r,`Expected a JSON string (got ${si(t)})`)}let n={value:a};return e(a,Object.assign(Object.assign({},r),{coercion:Kf(n,"value")}))?(r.coercions.push([(s=r.p)!==null&&s!==void 0?s:".",r.coercion.bind(null,n.value)]),!0):!1}})}function G9e(){return Wr({test:(e,t)=>{var r;if(!(e instanceof Date)){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return Er(t,"Unbound coercion result");let s;if(typeof e=="string"&&Are.test(e))s=new Date(e);else{let a;if(typeof e=="string"){let n;try{n=JSON.parse(e)}catch{}typeof n=="number"&&(a=n)}else typeof e=="number"&&(a=e);if(typeof a<"u")if(Number.isSafeInteger(a)||!Number.isSafeInteger(a*1e3))s=new Date(a*1e3);else return Er(t,`Received a timestamp that can't be safely represented by the runtime (${e})`)}if(typeof s<"u")return t.coercions.push([(r=t.p)!==null&&r!==void 0?r:".",t.coercion.bind(null,s)]),!0}return Er(t,`Expected a date (got ${si(e)})`)}return!0}})}function Mx(e,{delimiter:t}={}){return Wr({test:(r,s)=>{var a;let n=r;if(typeof r=="string"&&typeof t<"u"&&typeof s?.coercions<"u"){iLine truncated
|
||||
`;for(let s of t)r+=`
|
||||
- ${s}`}super(r)}};Z2={missing:(e,t)=>e.has(t),undefined:(e,t,r)=>e.has(t)&&typeof r[t]<"u",nil:(e,t,r)=>e.has(t)&&r[t]!=null,falsy:(e,t,r)=>e.has(t)&&!!r[t]};(function(e){e.Forbids="Forbids",e.Requires="Requires"})(Vf||(Vf={}));Iqe={[Vf.Forbids]:{expect:!1,message:"forbids using"},[Vf.Requires]:{expect:!0,message:"requires using"}}});var st,cd=Ze(()=>{vp();st=class{constructor(){this.help=!1}static Usage(t){return t}async catch(t){throw t}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:a,isUnknown:n,applyCascade:c}=await Promise.resolve().then(()=>(Jo(),qs)),f=c(a(n()),r),p=[],h=[];if(!f(this,{errors:p,coercions:h}))throw K2("Invalid option schema",p);for(let[,C]of h)C()}else if(r!=null)throw new Error("Invalid command schema");let s=await this.execute();return typeof s<"u"?s:0}};st.isOption=V2;st.Default=[]});function pl(e){t_&&console.log(e)}function yre(){let e={nodes:[]};for(let t=0;t<Cn.CustomNode;++t)e.nodes.push(Vl());return e}function Cqe(e){let t=yre(),r=[],s=t.nodes.length;for(let a of e){r.push(s);for(let n=0;n<a.nodes.length;++n)Ire(n)||t.nodes.push(xqe(a.nodes[n],s));s+=a.nodes.length-Cn.CustomNode+1}for(let a of r)PE(t,Cn.InitialNode,a);return t}function Nu(e,t){return e.nodes.push(t),e.nodes.length-1}function wqe(e){let t=new Set,r=s=>{if(t.has(s))return;t.add(s);let a=e.nodes[s];for(let c of Object.values(a.statics))for(let{to:f}of c)r(f);for(let[,{to:c}]of a.dynamics)r(c);for(let{to:c}of a.shortcuts)r(c);let n=new Set(a.shortcuts.map(({to:c})=>c));for(;a.shortcuts.length>0;){let{to:c}=a.shortcuts.shift(),f=e.nodes[c];for(let[p,h]of Object.entries(f.statics)){let E=Object.prototype.hasOwnProperty.call(a.statics,p)?a.statics[p]:a.statics[p]=[];for(let C of h)E.some(({to:S})=>C.to===S)||E.push(C)}for(let[p,h]of f.dynamics)a.dynamics.some(([E,{to:C}])=>p===E&&h.to===C)||a.dynamics.push([p,h]);for(let p of f.shortcuts)n.has(p.to)||(a.shortcuts.push(p),n.add(p.to))}};r(Cn.InitialNode)}function Bqe(e,{prefix:t=""}={}){if(t_){pl(`${t}Nodes are:`);for(let r=0;r<e.nodes.length;++r)pl(`${t} ${r}: ${JSON.stringify(e.nodes[r])}`)}}function vqe(e,t,r=!1){pl(`Running a vm on ${JSON.stringify(t)}`);let s=[{node:Cn.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,partial:!1,tokens:[]}}];Bqe(e,{prefix:" "});let a=[ii.StartOfInput,...t];for(let n=0;n<a.length;++n){let c=a[n],f=c===ii.EndOfInput||c===ii.EndOfPartialInput,p=n-1;pl(` Processing ${JSON.stringify(c)}`);let h=[];for(let{node:E,state:C}of s){pl(` Current node is ${E}`);let S=e.nodes[E];if(E===Cn.ErrorNode){h.push({node:E,state:C});continue}console.assert(S.shortcuts.length===0,"Shortcuts should have been eliminated by now");let x=Object.prototype.hasOwnProperty.call(S.statics,c);if(!r||n<a.length-1||x)if(x){let I=S.statics[c];for(let{to:R,reducer:N}of I)h.push({node:R,state:typeof N<"u"?Hx(p_,N,C,c,p):C}),pl(` Static transition to ${R} found`)}else pl(" No static transition found");else{let I=!1;for(let R of Object.keys(S.statics))if(R.startsWith(c)){if(c===R)for(let{to:N,reducer:U}of S.statics[R])h.push({node:N,state:typeof U<"u"?Hx(p_,U,C,c,p):C}),pl(` Static transition to ${N} found`);else for(let{to:N}of S.statics[R])h.push({node:N,state:{...C,remainder:R.slice(c.length)}}),pl(` Static transition to ${N} found (partial match)`);I=!0}I||pl(" No partial static transition found")}if(!f)for(let[I,{to:R,reducer:N}]of S.dynamics)Hx(kqe,I,C,c,p)&&(h.push({node:R,state:typeof N<"u"?Hx(p_,N,C,c,p):C}),pl(` Dynamic transition to ${R} found (via ${I})`))}if(h.length===0&&f&&t.length===1)return[{node:Cn.InitialNode,state:mre}];if(h.length===0)throw new bE(t,s.filter(({node:E})=>E!==Cn.ErrorNode).map(({state:E})=>({usage:E.candidateUsage,reason:null})));if(h.every(({node:E})=>E===Cn.ErrorNode))throw new bE(t,h.map(({state:E})=>({usage:E.candidateUsage,reason:E.errorMessage})));s=bqe(h)}if(s.length>0){pl(" Results:");for(let n of s)pl(` - ${n.node} -> ${JSON.stringify(n.state)}`)}else pl(" No results");return s}function Sqe(e,t,{endToken:r=ii.EndOfInput}={}){let s=vqe(e,[...t,r]);return Dqe(t,s.map(({state:a})=>a))}function bqe(e){let t=0;for(let{state:r}of e)r.path.length>t&&(t=r.path.length);return e.filter(({state:r})=>r.path.length===t)}function Dqe(e,t){let r=t.filter(S=>S.selectedIndex!==null),s=r.filter(S=>!S.partial);if(s.length>0&&(r=s),r.length===0)throw new Error;let a=r.filter(S=>S.selectedIndex===O0||S.requiredOptions.every(x=>x.some(I=>S.options.find(R=>R.name===I))));if(a.length===0)throw new bE(e,r.map(S=>({usage:S.candidateUsage,reason:null})));let n=0;for(let S of a)S.path.length>n&&(n=S.path.length);let c=a.filter(S=>S.path.length===n),f=S=>S.positionals.filter(({extra:x})=>!x).length+S.options.length,p=c.map(S=>({state:S,positionalCount:f(S)})),h=0;for(let{positionalCount:S}of p)S>h&&(h=S);let E=p.filter(({positionalCount:S})=>S===h).map(({state:S
Line truncated
|
||||
`),this.context.stdout.write(`
|
||||
`);let r=0;for(let s of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[s].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`
|
||||
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
|
||||
`)}}}});async function Pre(...e){let{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=kre(e);return ba.from(r,t).runExit(s,a)}async function xre(...e){let{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=kre(e);return ba.from(r,t).run(s,a)}function kre(e){let t,r,s,a;switch(typeof process<"u"&&typeof process.argv<"u"&&(s=process.argv.slice(2)),e.length){case 1:r=e[0];break;case 2:e[0]&&e[0].prototype instanceof st||Array.isArray(e[0])?(r=e[0],Array.isArray(e[1])?s=e[1]:a=e[1]):(t=e[0],r=e[1]);break;case 3:Array.isArray(e[2])?(t=e[0],r=e[1],s=e[2]):e[0]&&e[0].prototype instanceof st||Array.isArray(e[0])?(r=e[0],s=e[1],a=e[2]):(t=e[0],r=e[1],a=e[2]);break;default:t=e[0],r=e[1],s=e[2],a=e[3];break}if(typeof s>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}}function Dre(e){return e()}var bre,ba,Qre=Ze(()=>{Fx();Gx();i_();vre();cd();Sre();bre=Symbol("clipanion/errorCommand");ba=class e{constructor({binaryLabel:t,binaryName:r="...",binaryVersion:s,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new jx({binaryName:r}),this.binaryLabel=t,this.binaryName=r,this.binaryVersion=s,this.enableCapture=a,this.enableColors=n}static from(t,r={}){let s=new e(r),a=Array.isArray(t)?t:[t];for(let n of a)s.register(n);return s}register(t){var r;let s=new Map,a=new t;for(let p in a){let h=a[p];typeof h=="object"&&h!==null&&h[st.isOption]&&s.set(p,h)}let n=this.builder.command(),c=n.cliIndex,f=(r=t.paths)!==null&&r!==void 0?r:a.paths;if(typeof f<"u")for(let p of f)n.addPath(p);this.registrations.set(t,{specs:s,builder:n,index:c});for(let[p,{definition:h}]of s.entries())h(n,p);n.setContext({commandClass:t})}process(t,r){let{input:s,context:a,partial:n}=typeof t=="object"&&Array.isArray(t)?{input:t,context:r}:t,{contexts:c,process:f}=this.builder.compile(),p=f(s,{partial:n}),h={...e.defaultContext,...a};switch(p.selectedIndex){case O0:{let E=Yx.from(p,c);return E.context=h,E.tokens=p.tokens,E}default:{let{commandClass:E}=c[p.selectedIndex],C=this.registrations.get(E);if(typeof C>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let S=new E;S.context=h,S.tokens=p.tokens,S.path=p.path;try{for(let[x,{transformer:I}]of C.specs.entries())S[x]=I(C.builder,x,p,h);return S}catch(x){throw x[bre]=S,x}}break}}async run(t,r){var s,a;let n,c={...e.defaultContext,...r},f=(s=this.enableColors)!==null&&s!==void 0?s:c.colorDepth>1;if(!Array.isArray(t))n=t;else try{n=this.process(t,c)}catch(E){return c.stdout.write(this.error(E,{colored:f})),1}if(n.help)return c.stdout.write(this.usage(n,{colored:f,detailed:!0})),0;n.context=c,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:E=>this.definition(E),error:(E,C)=>this.error(E,C),format:E=>this.format(E),process:(E,C)=>this.process(E,{...c,...C}),run:(E,C)=>this.run(E,{...c,...C}),usage:(E,C)=>this.usage(E,C)};let p=this.enableCapture&&(a=Bre(c))!==null&&a!==void 0?a:Dre,h;try{h=await p(()=>n.validateAndExecute().catch(E=>n.catch(E).then(()=>0)))}catch(E){return c.stdout.write(this.error(E,{colored:f,command:n})),1}return h}async runExit(t,r){process.exitCode=await this.run(t,r)}definition(t,{colored:r=!1}={}){if(!t.usage)return null;let{usage:s}=this.getUsageByRegistration(t,{detailed:!1}),{usage:a,options:n}=this.getUsageByRegistration(t,{detailed:!0,inlineOptions:!1}),c=typeof t.usage.category<"u"?Ko(t.usage.category,{format:this.format(r),paragraphs:!1}):void 0,f=typeof t.usage.description<"u"?Ko(t.usage.description,{format:this.format(r),paragraphs:!1}):void 0,p=typeof t.usage.details<"u"?Ko(t.usage.details,{format:this.format(r),paragraphs:!0}):void 0,h=typeof t.usage.examples<"u"?t.usage.examples.map(([E,C])=>[Ko(E,{format:this.format(r),paragraphs:!1}),C.replace(/\$0/g,this.binaryName)]):void 0;return{path:s,usage:a,category:c,description:f,details:p,examples:h,options:n}}definitions({colored:t=!1}={}){let r=[];for(let s of this.registrations.keys()){let a=this.definition(s,{colored:t});a&&r.push(a)}return r}usage(t=null,{colored:r,detailed:s=!1,prefix:a="$ "}={}){var n;if(t===null){for(let p of this.registrations.keys()){let h=p.paths,E=typeof p.usage<"u";if(!h||h.length===0||h.length===1&&h[0].length===0||((n=h?.some(x=>x.length===0))!==null&&n!==void 0?n:!1))if(t){t=null;break}else t=p;else if(E){t=null;continue}}t&&(s=!0)}let c=t!==null&&t instanceof st?t.constructor:t,f="";if(c)if(s){let{description:p="",details:h="",examples:E=[]}=c.usage||{};p!==""&&(f+=Ko(p,{format:this.format(r),paragraphs:!1}).replace(/^./,x=>x.toUpperCase()),f+=`
|
||||
`),(h!==""||E.length>0)&&(f+=`${this.format(r).header("Usage")}
|
||||
`,f+=`
|
||||
`);let{usage:C,options:S}=this.getUsageByRegistration(c,{inlineOptions:!1});if(f+=`${this.format(r).bold(a)}${C}
|
||||
`,S.length>0){f+=`
|
||||
`,f+=`${this.format(r).header("Options")}
|
||||
`;let x=S.reduce((I,R)=>Math.max(I,R.definition.length),0);f+=`
|
||||
`;for(let{definition:I,description:R}of S)f+=` ${this.format(r).bold(I.padEnd(x))} ${Ko(R,{format:this.format(r),paragraphs:!1})}`}if(h!==""&&(f+=`
|
||||
`,f+=`${this.format(r).header("Details")}
|
||||
`,f+=`
|
||||
`,f+=Ko(h,{format:this.format(r),paragraphs:!0})),E.length>0){f+=`
|
||||
`,f+=`${this.format(r).header("Examples")}
|
||||
`;for(let[x,I]of E)f+=`
|
||||
`,f+=Ko(x,{format:this.format(r),paragraphs:!1}),f+=`${I.replace(/^/m,` ${this.format(r).bold(a)}`).replace(/\$0/g,this.binaryName)}
|
||||
`}}else{let{usage:p}=this.getUsageByRegistration(c);f+=`${this.format(r).bold(a)}${p}
|
||||
`}else{let p=new Map;for(let[S,{index:x}]of this.registrations.entries()){if(typeof S.usage>"u")continue;let I=typeof S.usage.category<"u"?Ko(S.usage.category,{format:this.format(r),paragraphs:!1}):null,R=p.get(I);typeof R>"u"&&p.set(I,R=[]);let{usage:N}=this.getUsageByIndex(x);R.push({commandClass:S,usage:N})}let h=Array.from(p.keys()).sort((S,x)=>S===null?-1:x===null?1:S.localeCompare(x,"en",{usage:"sort",caseFirst:"upper"})),E=typeof this.binaryLabel<"u",C=typeof this.binaryVersion<"u";E||C?(E&&C?f+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
|
||||
|
||||
`:E?f+=`${this.format(r).header(`${this.binaryLabel}`)}
|
||||
`:f+=`${this.format(r).header(`${this.binaryVersion}`)}
|
||||
`,f+=` ${this.format(r).bold(a)}${this.binaryName} <command>
|
||||
`):f+=`${this.format(r).bold(a)}${this.binaryName} <command>
|
||||
`;for(let S of h){let x=p.get(S).slice().sort((R,N)=>R.usage.localeCompare(N.usage,"en",{usage:"sort",caseFirst:"upper"})),I=S!==null?S.trim():"General commands";f+=`
|
||||
`,f+=`${this.format(r).header(`${I}`)}
|
||||
`;for(let{commandClass:R,usage:N}of x){let U=R.usage.description||"undocumented";f+=`
|
||||
`,f+=` ${this.format(r).bold(N)}
|
||||
`,f+=` ${Ko(U,{format:this.format(r),paragraphs:!1})}`}}f+=`
|
||||
`,f+=Ko("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(r),paragraphs:!0})}return f}error(t,r){var s,{colored:a,command:n=(s=t[bre])!==null&&s!==void 0?s:null}=r===void 0?{}:r;(!t||typeof t!="object"||!("stack"in t))&&(t=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(t)})`));let c="",f=t.name.replace(/([a-z])([A-Z])/g,"$1 $2");f==="Error"&&(f="Internal Error"),c+=`${this.format(a).error(f)}: ${t.message}
|
||||
`;let p=t.clipanion;return typeof p<"u"?p.type==="usage"&&(c+=`
|
||||
`,c+=this.usage(n)):t.stack&&(c+=`${t.stack.replace(/^.*\n/,"")}
|
||||
`),c}format(t){var r;return((r=t??this.enableColors)!==null&&r!==void 0?r:e.defaultContext.colorDepth>1)?ure:fre}getUsageByRegistration(t,r){let s=this.registrations.get(t);if(typeof s>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(s.index,r)}getUsageByIndex(t,r){return this.builder.getBuilderByIndex(t).usage(r)}};ba.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:wre()}});var $2,Tre=Ze(()=>{cd();$2=class extends st{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
|
||||
`)}};$2.paths=[["--clipanion=definitions"]]});var eB,Rre=Ze(()=>{cd();eB=class extends st{async execute(){this.context.stdout.write(this.cli.usage())}};eB.paths=[["-h"],["--help"]]});function Wx(e={}){return va({definition(t,r){var s;t.addProxy({name:(s=e.name)!==null&&s!==void 0?s:r,required:e.required})},transformer(t,r,s){return s.positionals.map(({value:a})=>a)}})}var d_=Ze(()=>{vp()});var tB,Fre=Ze(()=>{cd();d_();tB=class extends st{constructor(){super(...arguments),this.args=Wx()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}
|
||||
`)}};tB.paths=[["--clipanion=tokens"]]});var rB,Nre=Ze(()=>{cd();rB=class extends st{async execute(){var t;this.context.stdout.write(`${(t=this.cli.binaryVersion)!==null&&t!==void 0?t:"<unknown>"}
|
||||
`)}};rB.paths=[["-v"],["--version"]]});var g_={};Vt(g_,{DefinitionsCommand:()=>$2,HelpCommand:()=>eB,TokensCommand:()=>tB,VersionCommand:()=>rB});var Ore=Ze(()=>{Tre();Rre();Fre();Nre()});function Lre(e,t,r){let[s,a]=Wf(t,r??{}),{arity:n=1}=a,c=e.split(","),f=new Set(c);return va({definition(p){p.addOption({names:c,arity:n,hidden:a?.hidden,description:a?.description,required:a.required})},transformer(p,h,E){let C,S=typeof s<"u"?[...s]:void 0;for(let{name:x,value:I}of E.options)f.has(x)&&(C=x,S=S??[],S.push(I));return typeof S<"u"?L0(C??h,S,a.validator):S}})}var Mre=Ze(()=>{vp()});function Ure(e,t,r){let[s,a]=Wf(t,r??{}),n=e.split(","),c=new Set(n);return va({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E=S);return E}})}var _re=Ze(()=>{vp()});function Hre(e,t,r){let[s,a]=Wf(t,r??{}),n=e.split(","),c=new Set(n);return va({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E??(E=0),S?E+=1:E=0);return E}})}var jre=Ze(()=>{vp()});function Gre(e={}){return va({definition(t,r){var s;t.addRest({name:(s=e.name)!==null&&s!==void 0?s:r,required:e.required})},transformer(t,r,s){let a=c=>{let f=s.positionals[c];return f.extra===Kl||f.extra===!1&&c<t.arity.leading.length},n=0;for(;n<s.positionals.length&&a(n);)n+=1;return s.positionals.splice(0,n).map(({value:c})=>c)}})}var qre=Ze(()=>{Gx();vp()});function Qqe(e,t,r){let[s,a]=Wf(t,r??{}),{arity:n=1}=a,c=e.split(","),f=new Set(c);return va({definition(p){p.addOption({names:c,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(p,h,E,C){let S,x=s;typeof a.env<"u"&&C.env[a.env]&&(S=a.env,x=C.env[a.env]);for(let{name:I,value:R}of E.options)f.has(I)&&(S=I,x=R);return typeof x=="string"?L0(S??h,x,a.validator):x}})}function Tqe(e={}){let{required:t=!0}=e;return va({definition(r,s){var a;r.addPositional({name:(a=e.name)!==null&&a!==void 0?a:s,required:e.required})},transformer(r,s,a){var n;for(let c=0;c<a.positionals.length;++c){if(a.positionals[c].extra===Kl||t&&a.positionals[c].extra===!0||!t&&a.positionals[c].extra===!1)continue;let[f]=a.positionals.splice(c,1);return L0((n=e.name)!==null&&n!==void 0?n:s,f.value,e.validator)}}})}function Yre(e,...t){return typeof e=="string"?Qqe(e,...t):Tqe(e)}var Wre=Ze(()=>{Gx();vp()});var he={};Vt(he,{Array:()=>Lre,Boolean:()=>Ure,Counter:()=>Hre,Proxy:()=>Wx,Rest:()=>Gre,String:()=>Yre,applyValidator:()=>L0,cleanValidationError:()=>Lx,formatError:()=>K2,isOptionSymbol:()=>V2,makeCommandOption:()=>va,rerouteArguments:()=>Wf});var Vre=Ze(()=>{vp();d_();Mre();_re();jre();qre();Wre()});var nB={};Vt(nB,{Builtins:()=>g_,Cli:()=>ba,Command:()=>st,Option:()=>he,UsageError:()=>ot,formatMarkdownish:()=>Ko,run:()=>xre,runExit:()=>Pre});var jt=Ze(()=>{Ox();i_();cd();Qre();Ore();Vre()});var Kre=G((qkt,Rqe)=>{Rqe.exports={name:"dotenv",version:"16.3.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Xre=G((Ykt,bp)=>{var Jre=Ce("fs"),y_=Ce("path"),Fqe=Ce("os"),Nqe=Ce("crypto"),Oqe=Kre(),E_=Oqe.version,Lqe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Mqe(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
||||
`);let s;for(;(s=Lqe.exec(r))!=null;){let a=s[1],n=s[2]||"";n=n.trim();let c=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(n=n.replace(/\\n/g,`
|
||||
`),n=n.replace(/\\r/g,"\r")),t[a]=n}return t}function Uqe(e){let t=Zre(e),r=Ws.configDotenv({path:t});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);let s=zre(e).split(","),a=s.length,n;for(let c=0;c<a;c++)try{let f=s[c].trim(),p=jqe(r,f);n=Ws.decrypt(p.ciphertext,p.key);break}catch(f){if(c+1>=a)throw f}return Ws.parse(n)}function _qe(e){console.log(`[dotenv@${E_}][INFO] ${e}`)}function Hqe(e){console.log(`[dotenv@${E_}][WARN] ${e}`)}function m_(e){console.log(`[dotenv@${E_}][DEBUG] ${e}`)}function zre(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function jqe(e,t){let r;try{r=new URL(t)}catch(f){throw f.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):f}let s=r.password;if(!s)throw new Error("INVALID_DOTENV_KEY: Missing key part");let a=r.searchParams.get("environment");if(!a)throw new Error("INVALID_DOTENV_KEY: Missing environment part");let n=`DOTENV_VAULT_${a.toUpperCase()}`,c=e.parsed[n];if(!c)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:c,key:s}}function Zre(e){let t=y_.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:`${t}.vault`}function Gqe(e){return e[0]==="~"?y_.join(Fqe.homedir(),e.slice(1)):e}function qqe(e){_qe("Loading env from encrypted .env.vault");let t=Ws._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),Ws.populate(r,t,e),{parsed:t}}function Yqe(e){let t=y_.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug);e&&(e.path!=null&&(t=Gqe(e.path)),e.encoding!=null&&(r=e.encoding));try{let a=Ws.parse(Jre.readFileSync(t,{encoding:r})),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),Ws.populate(n,a,e),{parsed:a}}catch(a){return s&&m_(`Failed to load ${t} ${a.message}`),{error:a}}}function Wqe(e){let t=Zre(e);return zre(e).length===0?Ws.configDotenv(e):Jre.existsSync(t)?Ws._configVault(e):(Hqe(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),Ws.configDotenv(e))}function Vqe(e,t){let r=Buffer.from(t.slice(-64),"hex"),s=Buffer.from(e,"base64"),a=s.slice(0,12),n=s.slice(-16);s=s.slice(12,-16);try{let c=Nqe.createDecipheriv("aes-256-gcm",r,a);return c.setAuthTag(n),`${c.update(s)}${c.final()}`}catch(c){let f=c instanceof RangeError,p=c.message==="Invalid key length",h=c.message==="Unsupported state or unable to authenticate data";if(f||p){let E="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(E)}else if(h){let E="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(E)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function Kqe(e,t,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof t!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e,n)?(a===!0&&(e[n]=t[n]),s&&m_(a===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):e[n]=t[n]}var Ws={configDotenv:Yqe,_configVault:qqe,_parseVault:Uqe,config:Wqe,decrypt:Vqe,parse:Mqe,populate:Kqe};bp.exports.configDotenv=Ws.configDotenv;bp.exports._configVault=Ws._configVault;bp.exports._parseVault=Ws._parseVault;bp.exports.config=Ws.config;bp.exports.decrypt=Ws.decrypt;bp.exports.parse=Ws.parse;bp.exports.populate=Ws.populate;bp.exports=Ws});var ene=G((Wkt,$re)=>{"use strict";$re.exports=(e,...t)=>new Promise(r=>{r(e(...t))})});var M0=G((Vkt,I_)=>{"use strict";var Jqe=ene(),tne=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=[],r=0,s=()=>{r--,t.length>0&&t.shift()()},a=(f,p,...h)=>{r++;let E=Jqe(f,...h);p(E),E.then(s,s)},n=(f,p,...h)=>{r<e?a(f,p,...h):t.push(a.bind(null,f,p,...h))},c=(f,...p)=>new Promise(h=>n(f,h,...p));return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>t.length}}),c};I_.exports=tne;I_.exports.default=tne});function zf(e){return`YN${e.toString(10).padStart(4,"0")}`}function Vx(e){let t=Number(e.slice(2));if(typeof pr[t]>"u")throw new Error(`Unknown message name: "${e}"`);return t}var pr,Kx=Ze(()=>{pr=(Ue=>(Ue[Ue.UNNAMED=0]="UNNAMED",Ue[Ue.EXCEPTION=1]="EXCEPTION",Ue[Ue.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",Ue[Ue.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",Ue[Ue.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",Ue[Ue.BUILD_DISABLED=5]="BUILD_DISABLED",Ue[Ue.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",Ue[Ue.MUST_BUILD=7]="MUST_BUILD",Ue[Ue.MUST_REBUILD=8]="MUST_REBUILD",Ue[Ue.BUILD_FAILED=9]="BUILD_FAILED",Ue[Ue.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",Ue[Ue.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",Ue[Ue.LINKER_NOT_FOUND=12]="LINKER_NOT_FO
Line truncated
|
||||
`,"\r","(",")","!","|","&","^"],!0,!1),le=function(ee){return t.queryPattern.test(ee)},ge=function(ee){return t.checkFn(ee)},pe=Te("whitespace"),De=/^[ \t\n\r]/,ye=Qe([" "," ",`
|
||||
`,"\r"],!1,!1),d=0,ve=0,Ie=[{line:1,column:1}],me=0,ce=[],X=0,be;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function ke(){return e.substring(ve,d)}function it(){return Me(ve,d)}function _(ee,se){throw se=se!==void 0?se:Me(ve,d),D([Te(ee)],e.substring(ve,d),se)}function tt(ee,se){throw se=se!==void 0?se:Me(ve,d),w(ee,se)}function Fe(ee,se){return{type:"literal",text:ee,ignoreCase:se}}function Qe(ee,se,xe){return{type:"class",parts:ee,inverted:se,ignoreCase:xe}}function Se(){return{type:"any"}}function je(){return{type:"end"}}function Te(ee){return{type:"other",description:ee}}function ct(ee){var se=Ie[ee],xe;if(se)return se;for(xe=ee-1;!Ie[xe];)xe--;for(se=Ie[xe],se={line:se.line,column:se.column};xe<ee;)e.charCodeAt(xe)===10?(se.line++,se.column=1):se.column++,xe++;return Ie[ee]=se,se}function Me(ee,se){var xe=ct(ee),Ne=ct(se);return{start:{offset:ee,line:xe.line,column:xe.column},end:{offset:se,line:Ne.line,column:Ne.column}}}function P(ee){d<me||(d>me&&(me=d,ce=[]),ce.push(ee))}function w(ee,se){return new G0(ee,null,null,se)}function D(ee,se,xe){return new G0(G0.buildMessage(ee,se),ee,se,xe)}function y(){var ee,se,xe,Ne,ut,Ct,Yt,ir;if(ee=d,se=F(),se!==r){for(xe=[],Ne=d,ut=Z(),ut!==r?(e.charCodeAt(d)===124?(Ct=n,d++):(Ct=r,X===0&&P(c)),Ct===r&&(e.charCodeAt(d)===38?(Ct=f,d++):(Ct=r,X===0&&P(p)),Ct===r&&(e.charCodeAt(d)===94?(Ct=h,d++):(Ct=r,X===0&&P(E)))),Ct!==r?(Yt=Z(),Yt!==r?(ir=F(),ir!==r?(ut=[ut,Ct,Yt,ir],Ne=ut):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r);Ne!==r;)xe.push(Ne),Ne=d,ut=Z(),ut!==r?(e.charCodeAt(d)===124?(Ct=n,d++):(Ct=r,X===0&&P(c)),Ct===r&&(e.charCodeAt(d)===38?(Ct=f,d++):(Ct=r,X===0&&P(p)),Ct===r&&(e.charCodeAt(d)===94?(Ct=h,d++):(Ct=r,X===0&&P(E)))),Ct!==r?(Yt=Z(),Yt!==r?(ir=F(),ir!==r?(ut=[ut,Ct,Yt,ir],Ne=ut):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r);xe!==r?(ve=ee,se=C(se,xe),ee=se):(d=ee,ee=r)}else d=ee,ee=r;return ee}function F(){var ee,se,xe,Ne,ut,Ct;return ee=d,e.charCodeAt(d)===33?(se=S,d++):(se=r,X===0&&P(x)),se!==r?(xe=F(),xe!==r?(ve=ee,se=I(xe),ee=se):(d=ee,ee=r)):(d=ee,ee=r),ee===r&&(ee=d,e.charCodeAt(d)===40?(se=R,d++):(se=r,X===0&&P(N)),se!==r?(xe=Z(),xe!==r?(Ne=y(),Ne!==r?(ut=Z(),ut!==r?(e.charCodeAt(d)===41?(Ct=U,d++):(Ct=r,X===0&&P(K)),Ct!==r?(ve=ee,se=$(Ne),ee=se):(d=ee,ee=r)):(d=ee,ee=r)):(d=ee,ee=r)):(d=ee,ee=r)):(d=ee,ee=r),ee===r&&(ee=z())),ee}function z(){var ee,se,xe,Ne,ut;if(ee=d,se=Z(),se!==r){if(xe=d,Ne=[],ie.test(e.charAt(d))?(ut=e.charAt(d),d++):(ut=r,X===0&&P(fe)),ut!==r)for(;ut!==r;)Ne.push(ut),ie.test(e.charAt(d))?(ut=e.charAt(d),d++):(ut=r,X===0&&P(fe));else Ne=r;Ne!==r?xe=e.substring(xe,d):xe=Ne,xe!==r?(ve=d,Ne=le(xe),Ne?Ne=void 0:Ne=r,Ne!==r?(ve=ee,se=ge(xe),ee=se):(d=ee,ee=r)):(d=ee,ee=r)}else d=ee,ee=r;return ee}function Z(){var ee,se;for(X++,ee=[],De.test(e.charAt(d))?(se=e.charAt(d),d++):(se=r,X===0&&P(ye));se!==r;)ee.push(se),De.test(e.charAt(d))?(se=e.charAt(d),d++):(se=r,X===0&&P(ye));return X--,ee===r&&(se=r,X===0&&P(pe)),ee}if(be=a(),be!==r&&d===e.length)return be;throw be!==r&&d<e.length&&P(je()),D(ce,me<e.length?e.charAt(me):null,me<e.length?Me(me,me+1):Me(me,me))}$ie.exports={SyntaxError:G0,parse:KVe}});var tse=G(ok=>{var{parse:JVe}=ese();ok.makeParser=(e=/[a-z]+/)=>(t,r)=>JVe(t,{queryPattern:e,checkFn:r});ok.parse=ok.makeParser()});var nse=G((GQt,rse)=>{"use strict";rse.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyLine truncated
|
||||
`:`
|
||||
`)+r,a=s+1,s=e.indexOf(`
|
||||
`,a)}while(s!==-1);return n+=e.substr(a),n};Ise.exports={stringReplaceAll:l7e,stringEncaseCRLFWithFirstIndex:c7e}});var bse=G((ZQt,Sse)=>{"use strict";var u7e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,wse=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,f7e=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,A7e=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,p7e=new Map([["n",`
|
||||
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function vse(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):p7e.get(e)||e}function h7e(e,t){let r=[],s=t.trim().split(/\s*,\s*/g),a;for(let n of s){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(f7e))r.push(a[2].replace(A7e,(f,p,h)=>p?vse(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${e}')`)}return r}function d7e(e){wse.lastIndex=0;let t=[],r;for(;(r=wse.exec(e))!==null;){let s=r[1];if(r[2]){let a=h7e(s,r[2]);t.push([s].concat(a))}else t.push([s])}return t}function Bse(e,t){let r={};for(let a of t)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let s=e;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in s))throw new Error(`Unknown Chalk style: ${a}`);s=n.length>0?s[a](...n):s[a]}return s}Sse.exports=(e,t)=>{let r=[],s=[],a=[];if(t.replace(u7e,(n,c,f,p,h,E)=>{if(c)a.push(vse(c));else if(p){let C=a.join("");a=[],s.push(r.length===0?C:Bse(e,r)(C)),r.push({inverse:f,styles:d7e(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(Bse(e,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),s.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return s.join("")}});var LE=G((XQt,Tse)=>{"use strict";var hB=ck(),{stdout:K_,stderr:J_}=Ese(),{stringReplaceAll:g7e,stringEncaseCRLFWithFirstIndex:m7e}=Cse(),{isArray:uk}=Array,Pse=["ansi","ansi","ansi256","ansi16m"],OE=Object.create(null),y7e=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=K_?K_.level:0;e.level=t.level===void 0?r:t.level},z_=class{constructor(t){return xse(t)}},xse=e=>{let t={};return y7e(t,e),t.template=(...r)=>Qse(t.template,...r),Object.setPrototypeOf(t,fk.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=z_,t.template};function fk(e){return xse(e)}for(let[e,t]of Object.entries(hB))OE[e]={get(){let r=Ak(this,Z_(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};OE.visible={get(){let e=Ak(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var kse=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of kse)OE[e]={get(){let{level:t}=this;return function(...r){let s=Z_(hB.color[Pse[t]][e](...r),hB.color.close,this._styler);return Ak(this,s,this._isEmpty)}}};for(let e of kse){let t="bg"+e[0].toUpperCase()+e.slice(1);OE[t]={get(){let{level:r}=this;return function(...s){let a=Z_(hB.bgColor[Pse[r]][e](...s),hB.bgColor.close,this._styler);return Ak(this,a,this._isEmpty)}}}}var E7e=Object.defineProperties(()=>{},{...OE,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Z_=(e,t,r)=>{let s,a;return r===void 0?(s=e,a=t):(s=r.openAll+e,a=t+r.closeAll),{open:e,close:t,openAll:s,closeAll:a,parent:r}},Ak=(e,t,r)=>{let s=(...a)=>uk(a[0])&&uk(a[0].raw)?Dse(s,Qse(s,...a)):Dse(s,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(s,E7e),s._generator=e,s._styler=t,s._isEmpty=r,s},Dse=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:s,closeAll:a}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=g7e(t,r.close,r.open),r=r.parent;let n=t.indexOf(`
|
||||
`);return n!==-1&&(t=m7e(t,a,s,n)),s+t+a},V_,Qse=(e,...t)=>{let[r]=t;if(!uk(r)||!uk(r.raw))return t.join(" ");let s=t.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(s[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return V_===void 0&&(V_=bse()),V_(e,a.join(""))};Object.defineProperties(fk.prototype,OE);var pk=fk();pk.supportsColor=K_;pk.stderr=fk({level:J_?J_.level:0});pk.stderr.supportsColor=J_;Tse.exports=pk});var hk=G(xc=>{"use strict";xc.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;xc.find=(e,t)=>e.nodes.find(r=>r.type===t);xc.exceedsLimit=(e,t,r=1,s)=>s===!1||!xc.isInteger(e)||!xc.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=s;xc.escapeNode=(e,t=0,r)=>{let s=e.nodes[t];s&&(r&&s.type===r||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)};xc.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0);xc.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;xc.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;xc.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);xc.flatten=(...e)=>{let t=[],r=s=>{for(let a=0;a<s.length;a++){let n=s[a];Array.isArray(n)?r(n,t):n!==void 0&&t.push(n)}return t};return r(e),t}});var dk=G((eTt,Fse)=>{"use strict";var Rse=hk();Fse.exports=(e,t={})=>{let r=(s,a={})=>{let n=t.escapeInvalid&&Rse.isInvalidBrace(a),c=s.invalid===!0&&t.escapeInvalid===!0,f="";if(s.value)return(n||c)&&Rse.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let p of s.nodes)f+=r(p);return f};return r(e)}});var Ose=G((tTt,Nse)=>{"use strict";Nse.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Yse=G((rTt,qse)=>{"use strict";var Lse=Ose(),q0=(e,t,r)=>{if(Lse(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Lse(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...r};typeof s.strictZeros=="boolean"&&(s.relaxZeros=s.strictZeros===!1);let a=String(s.relaxZeros),n=String(s.shorthand),c=String(s.capture),f=String(s.wrap),p=e+":"+t+"="+a+n+c+f;if(q0.cache.hasOwnProperty(p))return q0.cache[p].result;let h=Math.min(e,t),E=Math.max(e,t);if(Math.abs(h-E)===1){let R=e+"|"+t;return s.capture?`(${R})`:s.wrap===!1?R:`(?:${R})`}let C=Gse(e)||Gse(t),S={min:e,max:t,a:h,b:E},x=[],I=[];if(C&&(S.isPadded=C,S.maxLen=String(S.max).length),h<0){let R=E<0?Math.abs(E):1;I=Mse(R,Math.abs(h),S,s),h=S.a=0}return E>=0&&(x=Mse(h,E,S,s)),S.negatives=I,S.positives=x,S.result=I7e(I,x,s),s.capture===!0?S.result=`(${S.result})`:s.wrap!==!1&&x.length+I.length>1&&(S.result=`(?:${S.result})`),q0.cache[p]=S,S.result};function I7e(e,t,r){let s=X_(e,t,"-",!1,r)||[],a=X_(t,e,"",!1,r)||[],n=X_(e,t,"-?",!0,r)||[];return s.concat(n).concat(a).join("|")}function C7e(e,t){let r=1,s=1,a=_se(e,r),n=new Set([t]);for(;e<=a&&a<=t;)n.add(a),r+=1,a=_se(e,r);for(a=Hse(t+1,s)-1;e<a&&a<=t;)n.add(a),s+=1,a=Hse(t+1,s)-1;return n=[...n],n.sort(v7e),n}function w7e(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let s=B7e(e,t),a=s.length,n="",c=0;for(let f=0;f<a;f++){let[p,h]=s[f];p===h?n+=p:p!=="0"||h!=="9"?n+=S7e(p,h,r):c++}return c&&(n+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[c],digits:a}}function Mse(e,t,r,s){let a=C7e(e,t),n=[],c=e,f;for(let p=0;p<a.length;p++){let h=a[p],E=w7e(String(c),String(h),s),C="";if(!r.isPadded&&f&&f.pattern===E.pattern){f.count.length>1&&f.count.pop(),f.count.push(E.count[0]),f.string=f.pattern+jse(f.count),c=h+1;continue}r.isPadded&&(C=b7e(h,r,s)),E.string=C+E.pattern+jse(E.count),n.push(E),c=h+1,f=E}return n}function X_(e,t,r,s,a){let n=[];for(let c of e){let{string:f}=c;!s&&!Use(t,"string",f)&&n.push(r+f),s&&Use(t,"string",f)&&n.push(r+f)}return n}function B7e(e,t){let r=[];for(let s=0;s<e.length;s++)r.push([e[s],t[s]]);return r}function v7e(e,t){return e>t?1:t>e?-1:0}function Use(e,t,r){return e.some(s=>s[t]===r)}function _se(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Hse(e,t){return e-e%Math.pow(10,t)}function jse(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function S7e(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Gse(e){return/^-?(0+)\d/.test(e)}function b7e(e,t,r){if(!t.isPadded)return e;let s=Math.abs(t.maxLen-String(e).length),a=r.relaxZeros!==!1;switch(s){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:return a?`0{0,${s}}`:`0{${s}}`}}q0.cache={};q0.clearCache=()=>q0.cache={};qse.exports=q0});var t4=G((nTt,$se)=>{"use strict";var D7e=Ce("util"),Kse=Yse(),Wse=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),P7e=e=>t=>e===!0?Number(t):String(t),$_=e=>typeof e=="numb
Line truncated
|
||||
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Aoe=G((aTt,foe)=>{"use strict";var U7e=dk(),{MAX_LENGTH:loe,CHAR_BACKSLASH:r4,CHAR_BACKTICK:_7e,CHAR_COMMA:H7e,CHAR_DOT:j7e,CHAR_LEFT_PARENTHESES:G7e,CHAR_RIGHT_PARENTHESES:q7e,CHAR_LEFT_CURLY_BRACE:Y7e,CHAR_RIGHT_CURLY_BRACE:W7e,CHAR_LEFT_SQUARE_BRACKET:coe,CHAR_RIGHT_SQUARE_BRACKET:uoe,CHAR_DOUBLE_QUOTE:V7e,CHAR_SINGLE_QUOTE:K7e,CHAR_NO_BREAK_SPACE:J7e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:z7e}=aoe(),Z7e=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},s=typeof r.maxLength=="number"?Math.min(loe,r.maxLength):loe;if(e.length>s)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${s})`);let a={type:"root",input:e,nodes:[]},n=[a],c=a,f=a,p=0,h=e.length,E=0,C=0,S,x={},I=()=>e[E++],R=N=>{if(N.type==="text"&&f.type==="dot"&&(f.type="text"),f&&f.type==="text"&&N.type==="text"){f.value+=N.value;return}return c.nodes.push(N),N.parent=c,N.prev=f,f=N,N};for(R({type:"bos"});E<h;)if(c=n[n.length-1],S=I(),!(S===z7e||S===J7e)){if(S===r4){R({type:"text",value:(t.keepEscaping?S:"")+I()});continue}if(S===uoe){R({type:"text",value:"\\"+S});continue}if(S===coe){p++;let N=!0,U;for(;E<h&&(U=I());){if(S+=U,U===coe){p++;continue}if(U===r4){S+=I();continue}if(U===uoe&&(p--,p===0))break}R({type:"text",value:S});continue}if(S===G7e){c=R({type:"paren",nodes:[]}),n.push(c),R({type:"text",value:S});continue}if(S===q7e){if(c.type!=="paren"){R({type:"text",value:S});continue}c=n.pop(),R({type:"text",value:S}),c=n[n.length-1];continue}if(S===V7e||S===K7e||S===_7e){let N=S,U;for(t.keepQuotes!==!0&&(S="");E<h&&(U=I());){if(U===r4){S+=U+I();continue}if(U===N){t.keepQuotes===!0&&(S+=U);break}S+=U}R({type:"text",value:S});continue}if(S===Y7e){C++;let U={type:"brace",open:!0,close:!1,dollar:f.value&&f.value.slice(-1)==="$"||c.dollar===!0,depth:C,commas:0,ranges:0,nodes:[]};c=R(U),n.push(c),R({type:"open",value:S});continue}if(S===W7e){if(c.type!=="brace"){R({type:"text",value:S});continue}let N="close";c=n.pop(),c.close=!0,R({type:N,value:S}),C--,c=n[n.length-1];continue}if(S===H7e&&C>0){if(c.ranges>0){c.ranges=0;let N=c.nodes.shift();c.nodes=[N,{type:"text",value:U7e(c)}]}R({type:"comma",value:S}),c.commas++;continue}if(S===j7e&&C>0&&c.commas===0){let N=c.nodes;if(C===0||N.length===0){R({type:"text",value:S});continue}if(f.type==="dot"){if(c.range=[],f.value+=S,f.type="range",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,f.type="text";continue}c.ranges++,c.args=[];continue}if(f.type==="range"){N.pop();let U=N[N.length-1];U.value+=f.value+S,f=U,c.ranges--;continue}R({type:"dot",value:S});continue}R({type:"text",value:S})}do if(c=n.pop(),c.type!=="root"){c.nodes.forEach(K=>{K.nodes||(K.type==="open"&&(K.isOpen=!0),K.type==="close"&&(K.isClose=!0),K.nodes||(K.type="text"),K.invalid=!0)});let N=n[n.length-1],U=N.nodes.indexOf(c);N.nodes.splice(U,1,...c.nodes)}while(n.length>0);return R({type:"eos"}),a};foe.exports=Z7e});var doe=G((lTt,hoe)=>{"use strict";var poe=dk(),X7e=roe(),$7e=soe(),eKe=Aoe(),Jl=(e,t={})=>{let r=[];if(Array.isArray(e))for(let s of e){let a=Jl.create(s,t);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(Jl.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Jl.parse=(e,t={})=>eKe(e,t);Jl.stringify=(e,t={})=>poe(typeof e=="string"?Jl.parse(e,t):e,t);Jl.compile=(e,t={})=>(typeof e=="string"&&(e=Jl.parse(e,t)),X7e(e,t));Jl.expand=(e,t={})=>{typeof e=="string"&&(e=Jl.parse(e,t));let r=$7e(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Jl.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Jl.compile(e,t):Jl.expand(e,t);hoe.exports=Jl});var gB=G((cTt,Ioe)=>{"use strict";var tKe=Ce("path"),Zf="\\\\/",goe=`[^${Zf}]`,kp="\\.",rKe="\\+",nKe="\\?",mk="\\/",iKe="(?=.)",moe="[^/]",n4=`(?:${mk}|$)`,yoe=`(?:^|${mk})`,i4=`${kp}{1,2}${n4}`,sKe=`(?!${kp})`,oKe=`(?!${yoe}${i4})`,aKe=`(?!${kp}{0,1}${n4})`,lKe=`(?!${i4})`,cKe=`[^.${mk}]`,uKe=`${moe}*?`,Eoe={DOT_LITERAL:kp,PLUS_LITERAL:rKe,QMARK_LITERAL:nKe,SLASH_LITERAL:mk,ONE_CHAR:iKe,QMARK:moe,END_ANCHOR:n4,DOTS_SLASH:i4,NO_DOT:sKe,NO_DOTS:oKe,NO_DOT_SLASH:aKe,NO_DOTS_SLASH:lKe,QMARK_NO_DOT:cKe,STAR:uKe,START_ANCHOR:yoe},fKe={...Eoe,SLASH_LITERAL:`[${Zf}]`,QMARK:goe,STAR:`${goe}*?`,DOTS_SLASH:`${kp}{1,2}(?:[${Zf}]|$)`,NO_DOT:`(?!${kp})`,NO_DOTS:`(?!(?:^|[${Zf}])${kp}{1,2}(?:[${Zf}]|$))`,NO_DOT_SLASH:`(?!${kp}{0,1}(?:[${Zf}]|$))`,NO_DOTS_SLASH:`(?!${kp}{1,2}(?:[${Zf}]|$))`,QMARK_NO_DOT:`[^.${Zf}]`,START_ANCHOR:`(?:^|[${Zf}])`,END_ANCHOR:`(?:[${Zf}]|$)`},AKe={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'
Line truncated
|
||||
`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a="",t!==null?this.reportInfo(null,`${t} ${p}`):this.reportInfo(null,p)}while(f!==-1);a+=c}),r.on("end",()=>{let n=s.end();n!==""&&(t!==null?this.reportInfo(null,`${t} ${n}`):this.reportInfo(null,n))}),r}}});var AI,P8=Ze(()=>{Nc();$o();AI=class{constructor(t){this.fetchers=t}supports(t,r){return!!this.tryFetcher(t,r)}getLocalPath(t,r){return this.getFetcher(t,r).getLocalPath(t,r)}async fetch(t,r){return await this.getFetcher(t,r).fetch(t,r)}tryFetcher(t,r){let s=this.fetchers.find(a=>a.supports(t,r));return s||null}getFetcher(t,r){let s=this.fetchers.find(a=>a.supports(t,r));if(!s)throw new Lt(11,`${Vr(r.project.configuration,t)} isn't supported by any available fetcher`);return s}}});var nm,x8=Ze(()=>{$o();nm=class{constructor(t){this.resolvers=t.filter(r=>r)}supportsDescriptor(t,r){return!!this.tryResolverByDescriptor(t,r)}supportsLocator(t,r){return!!this.tryResolverByLocator(t,r)}shouldPersistResolution(t,r){return this.getResolverByLocator(t,r).shouldPersistResolution(t,r)}bindDescriptor(t,r,s){return this.getResolverByDescriptor(t,s).bindDescriptor(t,r,s)}getResolutionDependencies(t,r){return this.getResolverByDescriptor(t,r).getResolutionDependencies(t,r)}async getCandidates(t,r,s){return await this.getResolverByDescriptor(t,s).getCandidates(t,r,s)}async getSatisfying(t,r,s,a){return this.getResolverByDescriptor(t,a).getSatisfying(t,r,s,a)}async resolve(t,r){return await this.getResolverByLocator(t,r).resolve(t,r)}tryResolverByDescriptor(t,r){let s=this.resolvers.find(a=>a.supportsDescriptor(t,r));return s||null}getResolverByDescriptor(t,r){let s=this.resolvers.find(a=>a.supportsDescriptor(t,r));if(!s)throw new Error(`${ai(r.project.configuration,t)} isn't supported by any available resolver`);return s}tryResolverByLocator(t,r){let s=this.resolvers.find(a=>a.supportsLocator(t,r));return s||null}getResolverByLocator(t,r){let s=this.resolvers.find(a=>a.supportsLocator(t,r));if(!s)throw new Error(`${Vr(r.project.configuration,t)} isn't supported by any available resolver`);return s}}});var pI,k8=Ze(()=>{bt();$o();pI=class{supports(t){return!!t.reference.startsWith("virtual:")}getLocalPath(t,r){let s=t.reference.indexOf("#");if(s===-1)throw new Error("Invalid virtual package reference");let a=t.reference.slice(s+1),n=Js(t,a);return r.fetcher.getLocalPath(n,r)}async fetch(t,r){let s=t.reference.indexOf("#");if(s===-1)throw new Error("Invalid virtual package reference");let a=t.reference.slice(s+1),n=Js(t,a),c=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(t,c,r)}getLocatorFilename(t){return lI(t)}async ensureVirtualLink(t,r,s){let a=r.packageFs.getRealPath(),n=s.project.configuration.get("virtualFolder"),c=this.getLocatorFilename(t),f=Eo.makeVirtualPath(n,c,a),p=new Gf(f,{baseFs:r.packageFs,pathUtils:Y});return{...r,packageFs:p}}}});var MQ,Jce=Ze(()=>{MQ=class e{static{this.protocol="virtual:"}static isVirtualDescriptor(t){return!!t.range.startsWith(e.protocol)}static isVirtualLocator(t){return!!t.reference.startsWith(e.protocol)}supportsDescriptor(t,r){return e.isVirtualDescriptor(t)}supportsLocator(t,r){return e.isVirtualLocator(t)}shouldPersistResolution(t,r){return!1}bindDescriptor(t,r,s){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(t,r){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(t,r,s){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(t,r,s,a){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(t,r){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}}});var hI,Q8=Ze(()=>{bt();rm();hI=class{supports(t){return!!t.reference.startsWith(Ii.protocol)}getLocalPath(t,r){return this.getWorkspace(t,r).cwd}async fetch(t,r){let s=this.getWorkspace(t,r).cwd;return{packageFs:new Pn(s),prefixPath:wt.dot,localPath:s}}getWorkspace(t,r){return r.project.getWorkspaceByCwd(t.reference.slice(Ii.protocol.length))}}});function jB(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zce(e){return typeof e>"u"?3:jB(e)?0:Array.isArray(e)?1:2}function F8(e,t){return Object.hasOwn(e,t)}function CXe(e){return jB(e)&&F8(e,"onConflict")&&typeof e.onConflict=="string"}function wXe(e){if(typeof e>"u")return{onConflict:"default",value:e};if(!CXe(e))return{onConflict:"default",value:e};if(F8(e,"value"))return e;let{onConflict:t,...r}=e;return{onConflict:t,value:r}}function Zce(e,t){let r=jB(e)&&F8(e,t)?e[t]:void 0;return wXe(r)}function dI(e,t){return[e,t,Xce]}function N8(e){return Array.isArray(e)?e[2]===Xce:!1}function T8(e,t){if(jB(e)){let r={};for(let s of Object.keys(e))r[s]=T8(e[s],t);return dI(t,r)}return Array.isArray(e)?dI(t,e.map(r=>T8(r,t))):dI(t,e)}function R8(e,t,r,s,a){let n,c=[],f=a,p=0;for(let E=a-Line truncated
|
||||
Please report this to https://github.com/szmarczak/http2-wrapper/`);I(R)}return}s[0].resolve(x);return}}if(c in this.queue){if(f in this.queue[c]){this.queue[c][f].listeners.push(...s),this._tryToCreateNewSession(c,f);return}}else this.queue[c]={};let p=()=>{c in this.queue&&this.queue[c][f]===h&&(delete this.queue[c][f],Object.keys(this.queue[c]).length===0&&delete this.queue[c])},h=()=>{let E=`${f}:${c}`,C=!1;try{let S=U$e.connect(t,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});S[Ra]=0,S[II]=!1;let x=()=>S[Ra]<S.remoteSettings.maxConcurrentStreams,I=!0;S.socket.once("session",N=>{this.tlsSessionCache.set(E,N)}),S.once("error",N=>{for(let{reject:U}of s)U(N);this.tlsSessionCache.delete(E)}),S.setTimeout(this.timeout,()=>{S.destroy()}),S.once("close",()=>{if(C){I&&this._freeSessionsCount--,this._sessionsCount--;let N=this.sessions[c];N.splice(N.indexOf(S),1),N.length===0&&delete this.sessions[c]}else{let N=new Error("Session closed without receiving a SETTINGS frame");N.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:U}of s)U(N);p()}this._tryToCreateNewSession(c,f)});let R=()=>{if(!(!(c in this.queue)||!x())){for(let N of S[Oc])if(N in this.queue[c]){let{listeners:U}=this.queue[c][N];for(;U.length!==0&&x();)U.shift().resolve(S);let K=this.queue[c];if(K[N].listeners.length===0&&(delete K[N],Object.keys(K).length===0)){delete this.queue[c];break}if(!x())break}}};S.on("origin",()=>{S[Oc]=S.originSet,x()&&(R(),dH(this.sessions[c],S))}),S.once("remoteSettings",()=>{if(S.ref(),S.unref(),this._sessionsCount++,h.destroyed){let N=new Error("Agent has been destroyed");for(let U of s)U.reject(N);S.destroy();return}S[Oc]=S.originSet;{let N=this.sessions;if(c in N){let U=N[c];U.splice(j$e(U,S,G$e),0,S)}else N[c]=[S]}this._freeSessionsCount+=1,C=!0,this.emit("session",S),R(),p(),S[Ra]===0&&this._freeSessionsCount>this.maxFreeSessions&&S.close(),s.length!==0&&(this.getSession(f,r,s),s.length=0),S.on("remoteSettings",()=>{R(),dH(this.sessions[c],S)})}),S[sfe]=S.request,S.request=(N,U)=>{if(S[II])throw new Error("The session is gracefully closing. No new streams are allowed.");let K=S[sfe](N,U);return S.ref(),++S[Ra],S[Ra]===S.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,K.once("close",()=>{if(I=x(),--S[Ra],!S.destroyed&&!S.closed&&(q$e(this.sessions[c],S),x()&&!S.closed)){I||(this._freeSessionsCount++,I=!0);let $=S[Ra]===0;$&&S.unref(),$&&(this._freeSessionsCount>this.maxFreeSessions||S[II])?S.close():(dH(this.sessions[c],S),R())}}),K}}catch(S){for(let x of s)x.reject(S);p()}};h.listeners=s,h.completed=!1,h.destroyed=!1,this.queue[c][f]=h,this._tryToCreateNewSession(c,f)})}request(t,r,s,a){return new Promise((n,c)=>{this.getSession(t,r,[{reject:c,resolve:f=>{try{n(f.request(s,a))}catch(p){c(p)}}}])})}createConnection(t,r){return e.connect(t,r)}static connect(t,r){r.ALPNProtocols=["h2"];let s=t.port||443,a=t.hostname||t.host;return typeof r.servername>"u"&&(r.servername=a),M$e.connect(s,a,r)}closeFreeSessions(){for(let t of Object.values(this.sessions))for(let r of t)r[Ra]===0&&r.close()}destroy(t){for(let r of Object.values(this.sessions))for(let s of r)s.destroy(t);for(let r of Object.values(this.queue))for(let s of Object.values(r))s.destroyed=!0;this.queue={}}get freeSessions(){return ofe({agent:this,isFree:!0})}get busySessions(){return ofe({agent:this,isFree:!1})}};sm.kCurrentStreamsCount=Ra;sm.kGracefullyClosing=II;lfe.exports={Agent:sm,globalAgent:new sm}});var yH=G((GOt,cfe)=>{"use strict";var{Readable:Y$e}=Ce("stream"),mH=class extends Y$e{constructor(t,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=t,this.connection=t,this._dumped=!1}_destroy(t){this.req._request.destroy(t)}setTimeout(t,r){return this.req.setTimeout(t,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};cfe.exports=mH});var EH=G((qOt,ufe)=>{"use strict";ufe.exports=e=>{let t={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};return typeof e.port=="string"&&e.port.length!==0&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username||""}:${e.password||""}`),t}});var Afe=G((YOt,ffe)=>{"use strict";ffe.exports=(e,t,r)=>{for(let s of r)e.on(s,(...a)=>t.emit(s,...a))}});var hfe=G((WOt,pfe)=>{"use strict";pfe.exports=e=>{switch(e){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var gfe=G((KOt,dfe)=>{"use strict";var CI=(e,t,r)=>{dfe.exports[t]=class extends e{constructor(...a){super(typeof r=="string"?r:r(a
Line truncated
|
||||
`).reverse(),f=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
|
||||
`).reverse();for(;f.length!==0&&f[0]===c[0];)c.shift();this.stack=`${this.stack.slice(0,n)}${c.reverse().join(`
|
||||
`)}${f.reverse().join(`
|
||||
`)}`}}};_n.RequestError=ps;var sT=class extends ps{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t),this.name="MaxRedirectsError"}};_n.MaxRedirectsError=sT;var oT=class extends ps{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request),this.name="HTTPError"}};_n.HTTPError=oT;var aT=class extends ps{constructor(t,r){super(t.message,t,r),this.name="CacheError"}};_n.CacheError=aT;var lT=class extends ps{constructor(t,r){super(t.message,t,r),this.name="UploadError"}};_n.UploadError=lT;var cT=class extends ps{constructor(t,r,s){super(t.message,t,s),this.name="TimeoutError",this.event=t.event,this.timings=r}};_n.TimeoutError=cT;var XB=class extends ps{constructor(t,r){super(t.message,t,r),this.name="ReadError"}};_n.ReadError=XB;var uT=class extends ps{constructor(t){super(`Unsupported protocol "${t.url.protocol}"`,{},t),this.name="UnsupportedProtocolError"}};_n.UnsupportedProtocolError=uT;var ett=["socket","connect","continue","information","upgrade","timeout"],fT=class extends Xfe.Duplex{constructor(t,r={},s){super({autoDestroy:!1,highWaterMark:0}),this[BI]=0,this[SI]=0,this.requestInitialized=!1,this[rT]=new Set,this.redirects=[],this[bI]=!1,this[nT]=!1,this[ZB]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on("pipe",h=>{h.prependListener("data",a),h.on("data",n),h.prependListener("end",a),h.on("end",n)}),this.on("unpipe",h=>{h.off("data",a),h.off("data",n),h.off("end",a),h.off("end",n)}),this.on("pipe",h=>{h instanceof GH.IncomingMessage&&(this.options.headers={...h.headers,...this.options.headers})});let{json:c,body:f,form:p}=r;if((c||f||p)&&this._lockWrite(),_n.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(t,r,s)}catch(h){lt.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(h);return}(async()=>{var h;try{this.options.body instanceof Ret.ReadStream&&await Zet(this.options.body);let{url:E}=this.options;if(!E)throw new TypeError("Missing `url` property");if(this.requestUrl=E.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(h=this[Co])===null||h===void 0||h.destroy();return}for(let C of this[ZB])C();this[ZB].length=0,this.requestInitialized=!0}catch(E){if(E instanceof ps){this._beforeError(E);return}this.destroyed||this.destroy(E)}})()}static normalizeArguments(t,r,s){var a,n,c,f,p;let h=r;if(lt.default.object(t)&&!lt.default.urlInstance(t))r={...s,...t,...r};else{if(t&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...s,...r},t!==void 0&&(r.url=t),lt.default.urlInstance(r.url)&&(r.url=new vd.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),lt.assert.any([lt.default.string,lt.default.undefined],r.method),lt.assert.any([lt.default.object,lt.default.undefined],r.headers),lt.assert.any([lt.default.string,lt.default.urlInstance,lt.default.undefined],r.prefixUrl),lt.assert.any([lt.default.object,lt.default.undefined],r.cookieJar),lt.assert.any([lt.default.object,lt.default.string,lt.default.undefined],r.searchParams),lt.assert.any([lt.default.object,lt.default.string,lt.default.undefined],r.cache),lt.assert.any([lt.default.object,lt.default.number,lt.default.undefined],r.timeout),lt.assert.any([lt.default.object,lt.default.undefined],r.context),lt.assert.any([lt.default.object,lt.default.undefined],r.hooks),lt.assert.any([lt.default.boolean,lt.default.undefined],r.decompress),lt.assert.any([lt.default.boolean,lt.default.undefined],r.ignoreInvalidCookies),lt.assert.any([lt.default.boolean,lt.default.undefined],r.followRedirect),lt.assert.any([lt.default.number,lt.default.undefined],r.maxRedirects),lt.assert.any([lt.default.boolean,lt.default.undefined],r.throwHttpErrors),lt.assert.any([lt.default.boolean,lt.default.undefined],r.http2),lt.assert.any([lt.default.boolean,lt.default.undefined],r.allowGetBody),lt.assert.any([lt.default.string,lt.default.undefined],r.localAddress),lt.assert.any([iAe.isDnsLookupIpVersion,lt.default.undefined],r.dnsLookupIpVersion),lt.assert.any([lt.default.object,lt.default.undefined],r.https),lt.assert.any([lt.default.boolean,lt.default.undefined],r.rejectUnauthorized),r.https&&(lt.assert.any([lt.default.boolean,lt.default.undefined],r.https.rejectUnauthorized),lt.assert.any([lt.default.function_,lt.default.undefined],r.https.checkServerIdentity),lt.assert.any([lt.default.string,lt.default.object,lt.default.array,lt.default.undefined],r.https.certificateAuthority),lt.assert.any([lt.default.string,lt.default.object,lt.default.array,lt.default.undefined],r.https.key),lt.assert.any([lt.default.string,lt.default.object,lt.default.array,lt.default.undefined],r.https.certificate),lt.assert.any([lt.default.string,lt.default.undefined],r.https.passphrase),lt.assert.any([lt.default.string,lt.default.buffer,lt.default.array,lt.default.undefined],r.httpLine truncated
|
||||
`)[3];return Utt(t)}function oj(){return typeof yT.default.availableParallelism<"u"?yT.default.availableParallelism():Math.max(1,yT.default.cpus().length)}var yT,Ttt,OAe,Rtt,Ftt,LAe,MAe,Ltt,Mtt,ET=Ze(()=>{bt();yT=et(Ce("os"));IT();Qc();Ttt=Number(process.versions.node.split(".")[0]),OAe=new Map([["darwin","open"],["linux","xdg-open"],["win32","explorer.exe"]]).get(process.platform),Rtt=typeof OAe<"u"?async e=>{try{return await aj(OAe,[e],{cwd:Y.cwd()}),!0}catch{return!1}}:void 0,Ftt="/usr/bin/ldd";Ltt=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mtt=/\((\S*)(?::(\d+))(?::(\d+))\)/});function pj(e,t,r,s,a){let n=GB(r);if(s.isArray||s.type==="ANY"&&Array.isArray(n))return Array.isArray(n)?n.map((c,f)=>lj(e,`${t}[${f}]`,c,s,a)):String(n).split(/,/).map(c=>lj(e,t,c,s,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings "${t}" cannot be an array`);return lj(e,t,r,s,a)}function lj(e,t,r,s,a){let n=GB(r);switch(s.type){case"ANY":return UQ(n);case"SHAPE":return qtt(e,t,r,s,a);case"MAP":return Ytt(e,t,r,s,a)}if(n===null&&!s.isNullable&&s.default!==null)throw new Error(`Non-nullable configuration settings "${t}" cannot be set to null`);if("values"in s&&s.values?.includes(n))return n;let f=(()=>{if(s.type==="BOOLEAN"&&typeof n!="string")return DB(n);if(typeof n!="string")throw new Error(`Expected configuration setting "${t}" to be a string, got ${typeof n}`);let p=Zk(n,{env:e.env});switch(s.type){case"ABSOLUTE_PATH":{let h=a,E=O8(r);return E&&E[0]!=="<"&&(h=Y.dirname(E)),Y.resolve(h,Ae.toPortablePath(p))}case"LOCATOR_LOOSE":return Np(p,!1);case"NUMBER":return parseInt(p);case"LOCATOR":return Np(p);case"BOOLEAN":return DB(p);case"DURATION":return Xk(p,s.unit);default:return p}})();if("values"in s&&s.values&&!s.values.includes(f))throw new Error(`Invalid value, expected one of ${s.values.join(", ")}`);return f}function qtt(e,t,r,s,a){let n=GB(r);if(typeof n!="object"||Array.isArray(n))throw new ot(`Object configuration settings "${t}" must be an object`);let c=hj(e,s,{ignoreArrays:!0});if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=`${t}.${f}`;if(!s.properties[f])throw new ot(`Unrecognized configuration settings found: ${t}.${f} - run "yarn config" to see the list of settings supported in Yarn`);c.set(f,pj(e,h,p,s.properties[f],a))}return c}function Ytt(e,t,r,s,a){let n=GB(r),c=new Map;if(typeof n!="object"||Array.isArray(n))throw new ot(`Map configuration settings "${t}" must be an object`);if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=s.normalizeKeys?s.normalizeKeys(f):f,E=`${t}['${h}']`,C=s.valueDefinition;c.set(h,pj(e,E,p,C,a))}return c}function hj(e,t,{ignoreArrays:r=!1}={}){switch(t.type){case"SHAPE":{if(t.isArray&&!r)return[];let s=new Map;for(let[a,n]of Object.entries(t.properties))s.set(a,hj(e,n));return s}case"MAP":return t.isArray&&!r?[]:new Map;case"ABSOLUTE_PATH":return t.default===null?null:e.projectCwd===null?Array.isArray(t.default)?t.default.map(s=>Y.normalize(s)):Y.isAbsolute(t.default)?Y.normalize(t.default):t.isNullable?null:void 0:Array.isArray(t.default)?t.default.map(s=>Y.resolve(e.projectCwd,s)):Y.resolve(e.projectCwd,t.default);case"DURATION":return Xk(t.default,t.unit);default:return t.default}}function wT(e,t,r){if(t.type==="SECRET"&&typeof e=="string"&&r.hideSecrets)return Gtt;if(t.type==="ABSOLUTE_PATH"&&typeof e=="string"&&r.getNativePaths)return Ae.fromPortablePath(e);if(t.isArray&&Array.isArray(e)){let s=[];for(let a of e)s.push(wT(a,t,r));return s}if(t.type==="MAP"&&e instanceof Map){if(e.size===0)return;let s=new Map;for(let[a,n]of e.entries()){let c=wT(n,t.valueDefinition,r);typeof c<"u"&&s.set(a,c)}return s}if(t.type==="SHAPE"&&e instanceof Map){if(e.size===0)return;let s=new Map;for(let[a,n]of e.entries()){let c=t.properties[a],f=wT(n,c,r);typeof f<"u"&&s.set(a,f)}return s}return e}function Wtt(){let e={};for(let[t,r]of Object.entries(process.env))t=t.toLowerCase(),t.startsWith(BT)&&(t=(0,_Ae.default)(t.slice(BT.length)),e[t]=r);return e}function uj(){let e=`${BT}rc_filename`;for(let[t,r]of Object.entries(process.env))if(t.toLowerCase()===e&&typeof r=="string")return r;return fj}async function UAe(e){try{return await ae.readFilePromise(e)}catch{return Buffer.of()}}async function Vtt(e,t){return Buffer.compare(...await Promise.all([UAe(e),UAe(t)]))===0}async function Ktt(e,t){let[r,s]=await Promise.all([ae.statPromise(e),ae.statPromise(t)]);return r.dev===s.dev&&r.ino===s.ino}async function ztt({configuration:e,selfPath:t}){let r=e.get("yarnPath");return e.get("ignorePath")||r===null||r===t||await Jtt(r,t)?null:r}var _Ae,Hp,HAe,jAe,GAe,cj,Htt,nv,jtt,jp,BT,fj,Gtt,DI,qAe,Aj,vT,CT,Jtt,Je,iv=Ze(()=>{bt();Sc();_Ae=et(sre()),Hp=et(N0());jt();HAe=et(Xre()),jAe=Ce("module"),GAe=et(M0()),cj=Ce("stream");Lce();fI();P8();x8();k8();Jce();Q8();rm();eue();HQ();Tc();wd();mT();Qc();ET();Lp();$o();Htt=function(){if(!Hp.GITHUB_ACTIONS||!process.env.GITHUB_EVE
Line truncated
|
||||
`);return{stdout:n,stderr:c}}makeResolver(){let t=[];for(let r of this.plugins.values())for(let s of r.resolvers||[])t.push(new s);return new nm([new MQ,new Ii,...t])}makeFetcher(){let t=[];for(let r of this.plugins.values())for(let s of r.fetchers||[])t.push(new s);return new AI([new pI,new hI,...t])}getLinkers(){let t=[];for(let r of this.plugins.values())for(let s of r.linkers||[])t.push(new s);return t}getSupportedArchitectures(){let t=rv(),r=this.get("supportedArchitectures"),s=r.get("os");s!==null&&(s=s.map(c=>c==="current"?t.os:c));let a=r.get("cpu");a!==null&&(a=a.map(c=>c==="current"?t.cpu:c));let n=r.get("libc");return n!==null&&(n=Xl(n,c=>c==="current"?t.libc??Xl.skip:c)),{os:s,cpu:a,libc:n}}isInteractive({interactive:t,stdout:r}){return r.isTTY?t??this.get("preferInteractive"):!1}async getPackageExtensions(){if(this.packageExtensions!==null)return this.packageExtensions;this.packageExtensions=new Map;let t=this.packageExtensions,r=(s,a,{userProvided:n=!1}={})=>{if(!yl(s.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let c=new _t;c.load(a,{yamlCompatibilityMode:!0});let f=bB(t,s.identHash),p=[];f.push([s.range,p]);let h={status:"inactive",userProvided:n,parentDescriptor:s};for(let E of c.dependencies.values())p.push({...h,type:"Dependency",descriptor:E});for(let E of c.peerDependencies.values())p.push({...h,type:"PeerDependency",descriptor:E});for(let[E,C]of c.peerDependenciesMeta)for(let[S,x]of Object.entries(C))p.push({...h,type:"PeerDependencyMeta",selector:E,key:S,value:x})};await this.triggerHook(s=>s.registerPackageExtensions,this,r);for(let[s,a]of this.get("packageExtensions"))r(Bd(s,!0),zk(a),{userProvided:!0});return t}normalizeLocator(t){return yl(t.reference)?Js(t,`${this.get("defaultProtocol")}${t.reference}`):jp.test(t.reference)?Js(t,`${this.get("defaultProtocol")}${t.reference}`):t}normalizeDependency(t){return yl(t.range)?Un(t,`${this.get("defaultProtocol")}${t.range}`):jp.test(t.range)?Un(t,`${this.get("defaultProtocol")}${t.range}`):t}normalizeDependencyMap(t){return new Map([...t].map(([r,s])=>[r,this.normalizeDependency(s)]))}normalizePackage(t,{packageExtensions:r}){let s=FB(t),a=r.get(t.identHash);if(typeof a<"u"){let c=t.version;if(c!==null){for(let[f,p]of a)if(rA(c,f))for(let h of p)switch(h.status==="inactive"&&(h.status="redundant"),h.type){case"Dependency":typeof s.dependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",s.dependencies.set(h.descriptor.identHash,this.normalizeDependency(h.descriptor)));break;case"PeerDependency":typeof s.peerDependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",s.peerDependencies.set(h.descriptor.identHash,h.descriptor));break;case"PeerDependencyMeta":{let E=s.peerDependenciesMeta.get(h.selector);(typeof E>"u"||!Object.hasOwn(E,h.key)||E[h.key]!==h.value)&&(h.status="active",$l(s.peerDependenciesMeta,h.selector,()=>({}))[h.key]=h.value)}break;default:O4(h)}}}let n=c=>c.scope?`${c.scope}__${c.name}`:`${c.name}`;for(let c of s.peerDependenciesMeta.keys()){let f=ka(c);s.peerDependencies.has(f.identHash)||s.peerDependencies.set(f.identHash,Un(f,"*"))}for(let c of s.peerDependencies.values()){if(c.scope==="types")continue;let f=n(c),p=Qa("types",f),h=fn(p);s.peerDependencies.has(p.identHash)||s.peerDependenciesMeta.has(h)||s.dependencies.has(p.identHash)||(s.peerDependencies.set(p.identHash,Un(p,"*")),s.peerDependenciesMeta.set(h,{optional:!0}))}return s.dependencies=new Map(Ks(s.dependencies,([,c])=>gl(c))),s.peerDependencies=new Map(Ks(s.peerDependencies,([,c])=>gl(c))),s}getLimit(t){return $l(this.limits,t,()=>(0,GAe.default)(this.get(t)))}async triggerHook(t,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=t(a);n&&await n(...r)}}async triggerMultipleHooks(t,r){for(let s of r)await this.triggerHook(t,...s)}async reduceHook(t,r,...s){let a=r;for(let n of this.plugins.values()){let c=n.hooks;if(!c)continue;let f=t(c);f&&(a=await f(a,...s))}return a}async firstHook(t,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=t(a);if(!n)continue;let c=await n(...r);if(typeof c<"u")return c}return null}}});var Yr={};Vt(Yr,{EndStrategy:()=>yj,ExecError:()=>ST,PipeError:()=>sv,execvp:()=>aj,pipevp:()=>qu});function am(e){return e!==null&&typeof e.fd=="number"}function dj(){}function gj(){for(let e of lm)e.kill()}async function qu(e,t,{cwd:r,env:s=process.env,strict:a=!1,stdin:n=null,stdout:c,stderr:f,end:p=2}){let h=["pipe","pipe","pipe"];n===null?h[0]="ignore":am(n)&&(h[0]=n),am(c)&&(h[1]=c),am(f)&&(h[2]=f);let E=(0,mj.default)(e,t,{cwd:Ae.fromPortablePath(r),env:{...s,PWD:Ae.fromPortablePath(r)},stdio:h});lm.add(E),lm.size===1&&(process.on("SIGINT",dj),process.on("SIGTERM",gj)),!am(n)&&n!==null&&n.pipe(E.stdin),am(c)||E.stdout.pipe(c,{end:!1}),am(f)||E.stderr.pipe(f,{end:!1});let C=()=>{for(let S of new Set([c,f]))am(S)||S.end()};return new Promise((S,x)=>{E.on("error",I=>{lm.delete(E),lm.size===0&&(process.off("SIGINT",dj),pro
Line truncated
|
||||
This command will run a command using Yarn's portable shell.
|
||||
|
||||
Make sure to escape glob patterns, redirections, and other features that might be expanded by your own shell.
|
||||
|
||||
Note: To escape something from Yarn's shell, you might have to escape it twice, the first time from your own shell.
|
||||
|
||||
Note: Don't use this command in Yarn scripts, as Yarn's shell is automatically used.
|
||||
|
||||
For a list of features, visit: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-shell/README.md.
|
||||
`,examples:[["Run a simple command","$0 echo Hello"],["Run a command with a glob pattern","$0 echo '*.js'"],["Run a command with a redirection","$0 echo Hello World '>' hello.txt"],["Run a command with an escaped glob pattern (The double escape is needed in Unix shells)",`$0 echo '"*.js"'`],["Run a command with a variable (Double quotes are needed in Unix shells, to prevent them from expanding the variable)",'$0 "GREETING=Hello echo $GREETING World"']]}}async execute(){let r=this.args.length>0?`${this.commandName} ${this.args.join(" ")}`:this.commandName;return await xI(r,[],{cwd:Ae.toPortablePath(this.cwd),stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}}});var ec,ape=Ze(()=>{ec=class extends Error{constructor(t){super(t),this.name="ShellError"}}});var TT={};Vt(TT,{fastGlobOptions:()=>upe,isBraceExpansion:()=>Tj,isGlobPattern:()=>nrt,match:()=>irt,micromatchOptions:()=>QT});function nrt(e){if(!kT.default.scan(e,QT).isGlob)return!1;try{kT.default.parse(e,QT)}catch{return!1}return!0}function irt(e,{cwd:t,baseFs:r}){return(0,lpe.default)(e,{...upe,cwd:Ae.fromPortablePath(t),fs:px(cpe.default,new rd(r))})}function Tj(e){return kT.default.scan(e,QT).isBrace}var lpe,cpe,kT,QT,upe,fpe=Ze(()=>{bt();lpe=et(DQ()),cpe=et(Ce("fs")),kT=et(Zo()),QT={strictBrackets:!0},upe={onlyDirectories:!1,onlyFiles:!1}});function Rj(){}function Fj(){for(let e of um)e.kill()}function dpe(e,t,r,s){return a=>{let n=a[0]instanceof sA.Transform?"pipe":a[0],c=a[1]instanceof sA.Transform?"pipe":a[1],f=a[2]instanceof sA.Transform?"pipe":a[2],p=(0,ppe.default)(e,t,{...s,stdio:[n,c,f]});return um.add(p),um.size===1&&(process.on("SIGINT",Rj),process.on("SIGTERM",Fj)),a[0]instanceof sA.Transform&&a[0].pipe(p.stdin),a[1]instanceof sA.Transform&&p.stdout.pipe(a[1],{end:!1}),a[2]instanceof sA.Transform&&p.stderr.pipe(a[2],{end:!1}),{stdin:p.stdin,promise:new Promise(h=>{p.on("error",E=>{switch(um.delete(p),um.size===0&&(process.off("SIGINT",Rj),process.off("SIGTERM",Fj)),E.code){case"ENOENT":a[2].write(`command not found: ${e}
|
||||
`),h(127);break;case"EACCES":a[2].write(`permission denied: ${e}
|
||||
`),h(128);break;default:a[2].write(`uncaught error: ${E.message}
|
||||
`),h(1);break}}),p.on("close",E=>{um.delete(p),um.size===0&&(process.off("SIGINT",Rj),process.off("SIGTERM",Fj)),h(E!==null?E:129)})})}}}function gpe(e){return t=>{let r=t[0]==="pipe"?new sA.PassThrough:t[0];return{stdin:r,promise:Promise.resolve().then(()=>e({stdin:r,stdout:t[1],stderr:t[2]}))}}}function RT(e,t){return Oj.start(e,t)}function Ape(e,t=null){let r=new sA.PassThrough,s=new hpe.StringDecoder,a="";return r.on("data",n=>{let c=s.write(n),f;do if(f=c.indexOf(`
|
||||
`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a="",e(t!==null?`${t} ${p}`:p)}while(f!==-1);a+=c}),r.on("end",()=>{let n=s.end();n!==""&&e(t!==null?`${t} ${n}`:n)}),r}function mpe(e,{prefix:t}){return{stdout:Ape(r=>e.stdout.write(`${r}
|
||||
`),e.stdout.isTTY?t:null),stderr:Ape(r=>e.stderr.write(`${r}
|
||||
`),e.stderr.isTTY?t:null)}}var ppe,sA,hpe,um,Uc,Nj,Oj,Lj=Ze(()=>{ppe=et(RU()),sA=Ce("stream"),hpe=Ce("string_decoder"),um=new Set;Uc=class{constructor(t){this.stream=t}close(){}get(){return this.stream}},Nj=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(t){this.stream=t}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},Oj=class e{constructor(t,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=t,this.implementation=r}static start(t,{stdin:r,stdout:s,stderr:a}){let n=new e(null,t);return n.stdin=r,n.stdout=s,n.stderr=a,n}pipeTo(t,r=1){let s=new e(this,t),a=new Nj;return s.pipe=a,s.stdout=this.stdout,s.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),s}async exec(){let t=["ignore","ignore","ignore"];if(this.pipe)t[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");t[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,t[1]=r.get();let s;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");s=this.stderr,t[2]=s.get();let a=this.implementation(t);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),s.close(),n))}async run(){let t=[];for(let s=this;s;s=s.ancestor)t.push(s.exec());return(await Promise.all(t))[0]}}});var hv={};Vt(hv,{EntryCommand:()=>cv,ShellError:()=>ec,execute:()=>xI,globUtils:()=>TT});function ype(e,t,r){let s=new tc.PassThrough({autoDestroy:!0});switch(e){case 0:(t&1)===1&&r.stdin.pipe(s,{end:!1}),(t&2)===2&&r.stdin instanceof tc.Writable&&s.pipe(r.stdin,{end:!1});break;case 1:(t&1)===1&&r.stdout.pipe(s,{end:!1}),(t&2)===2&&s.pipe(r.stdout,{end:!1});break;case 2:(t&1)===1&&r.stderr.pipe(s,{end:!1}),(t&2)===2&&s.pipe(r.stderr,{end:!1});break;default:throw new ec(`Bad file descriptor: "${e}"`)}return s}function NT(e,t={}){let r={...e,...t};return r.environment={...e.environment,...t.environment},r.variables={...e.variables,...t.variables},r}async function ort(e,t,r){let s=[],a=new tc.PassThrough;return a.on("data",n=>s.push(n)),await OT(e,t,NT(r,{stdout:a})),Buffer.concat(s).toString().replace(/[\r\n]+$/,"")}async function Epe(e,t,r){let s=e.map(async n=>{let c=await fm(n.args,t,r);return{name:n.name,value:c.join(" ")}});return(await Promise.all(s)).reduce((n,c)=>(n[c.name]=c.value,n),{})}function FT(e){return e.match(/[^ \r\n\t]+/g)||[]}async function Spe(e,t,r,s,a=s){switch(e.name){case"$":s(String(process.pid));break;case"#":s(String(t.args.length));break;case"@":if(e.quoted)for(let n of t.args)a(n);else for(let n of t.args){let c=FT(n);for(let f=0;f<c.length-1;++f)a(c[f]);s(c[c.length-1])}break;case"*":{let n=t.args.join(" ");if(e.quoted)s(n);else for(let c of FT(n))a(c)}break;case"PPID":s(String(process.ppid));break;case"RANDOM":s(String(Math.floor(Math.random()*32768)));break;default:{let n=parseInt(e.name,10),c,f=Number.isFinite(n);if(f?n>=0&&n<t.args.length&&(c=t.args[n]):Object.hasOwn(r.variables,e.name)?c=r.variables[e.name]:Object.hasOwn(r.environment,e.name)&&(c=r.environment[e.name]),typeof c<"u"&&e.alternativeValue?c=(await fm(e.alternativeValue,t,r)).join(" "):typeof c>"u"&&(e.defaultValue?c=(await fm(e.defaultValue,t,r)).join(" "):e.alternativeValue&&(c="")),typeof c>"u")throw f?new ec(`Unbound argument #${n}`):new ec(`Unbound variable "${e.name}"`);if(e.quoted)s(c);else{let p=FT(c);for(let E=0;E<p.length-1;++E)a(p[E]);let h=p[p.length-1];typeof h<"u"&&s(h)}}break}}async function fv(e,t,r){if(e.type==="number"){if(Number.isInteger(e.value))return e.value;throw new Error(`Invalid number: "${e.value}", only integers are allowed`)}else if(e.type==="variable"){let s=[];await Spe({...e,quoted:!0},t,r,n=>s.push(n));let a=Number(s.join(" "));return Number.isNaN(a)?fv({type:"variable",name:s.join(" ")},t,r):fv({type:"number",value:a},t,r)}else return art[e.type](await fv(e.left,t,r),await fv(e.right,t,r))}async function fm(e,t,r){let s=new Map,a=[],n=[],c=E=>{n.push(E)},f=()=>{n.length>0&&a.push(n.join("")),n=[]},p=E=>{c(E),f()},h=(E,C,S)=>{let x=JSON.stringify({type:E,fd:C}),I=s.get(x);typeof I>"u"&&s.set(x,I=[]),I.push(S)};for(let E of e){let C=!1;switch(E.type){case"redirection":{let S=await fm(E.args,t,r);for(let x of S)h(E.subtype,E.fd,x)}break;case"argument":for(let S of E.segments)switch(S.type){case"text":c(S.text);break;case"glob":c(S.pattern),C=!0;break;case"shell":{let x=await ort(S.shell,t,r);if(S.quoted)c(x);else{let I=FT(x);for(let R=0;R<I.length-1;++R)p(I[R]);c(I[I.length-1])}}break;case"variable":await Spe(S,t,r,c,p);break;case"arithmetic":c(String(await fv(S.arithmetic,t,r)));break}break}if(f(),C){let S=a.pop();if(typeof S>"u")throw new Error("Assertion failed: Expected a glob pa
Line truncated
|
||||
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${p}, '${c(yE(e))}' has ended
|
||||
`)})),0}return await Cpe(e,t,r)}async function frt(e,t,r,{background:s=!1}={}){let a,n=f=>{a=f,r.variables["?"]=String(f)},c=async f=>{try{return await urt(f.chain,t,r,{background:s&&typeof f.then>"u"})}catch(p){if(!(p instanceof ec))throw p;return r.stderr.write(`${p.message}
|
||||
`),1}};for(n(await c(e));e.then;){if(r.exitCode!==null)return r.exitCode;switch(e.then.type){case"&&":a===0&&n(await c(e.then.line));break;case"||":a!==0&&n(await c(e.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${e.then.type}"`)}e=e.then.line}return a}async function OT(e,t,r){let s=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:c}of e){if(a=await frt(n,t,r,{background:c==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=s,a}function bpe(e){switch(e.type){case"variable":return e.name==="@"||e.name==="#"||e.name==="*"||Number.isFinite(parseInt(e.name,10))||"defaultValue"in e&&!!e.defaultValue&&e.defaultValue.some(t=>pv(t))||"alternativeValue"in e&&!!e.alternativeValue&&e.alternativeValue.some(t=>pv(t));case"arithmetic":return Mj(e.arithmetic);case"shell":return Uj(e.shell);default:return!1}}function pv(e){switch(e.type){case"redirection":return e.args.some(t=>pv(t));case"argument":return e.segments.some(t=>bpe(t));default:throw new Error(`Assertion failed: Unsupported argument type: "${e.type}"`)}}function Mj(e){switch(e.type){case"variable":return bpe(e);case"number":return!1;default:return Mj(e.left)||Mj(e.right)}}function Uj(e){return e.some(({command:t})=>{for(;t;){let r=t.chain;for(;r;){let s;switch(r.type){case"subshell":s=Uj(r.subshell);break;case"command":s=r.envs.some(a=>a.args.some(n=>pv(n)))||r.args.some(a=>pv(a));break}if(s)return!0;if(!r.then)break;r=r.then.chain}if(!t.then)break;t=t.then.line}return!1})}async function xI(e,t=[],{baseFs:r=new Kn,builtins:s={},cwd:a=Ae.toPortablePath(process.cwd()),env:n=process.env,stdin:c=process.stdin,stdout:f=process.stdout,stderr:p=process.stderr,variables:h={},glob:E=TT}={}){let C={};for(let[I,R]of Object.entries(n))typeof R<"u"&&(C[I]=R);let S=new Map(srt);for(let[I,R]of Object.entries(s))S.set(I,R);c===null&&(c=new tc.PassThrough,c.end());let x=gx(e,E);if(!Uj(x)&&x.length>0&&t.length>0){let{command:I}=x[x.length-1];for(;I.then;)I=I.then.line;let R=I.chain;for(;R.then;)R=R.then.chain;R.type==="command"&&(R.args=R.args.concat(t.map(N=>({type:"argument",segments:[{type:"text",text:N}]}))))}return await OT(x,{args:t,baseFs:r,builtins:S,initialStdin:c,initialStdout:f,initialStderr:p,glob:E},{cwd:a,environment:C,exitCode:null,procedures:{},stdin:c,stdout:f,stderr:p,variables:Object.assign({},h,{"?":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var wpe,Bpe,tc,vpe,srt,art,uv=Ze(()=>{bt();Sc();wpe=et(LE()),Bpe=Ce("os"),tc=Ce("stream"),vpe=Ce("timers/promises");ope();ape();fpe();Lj();Lj();srt=new Map([["cd",async([e=(0,Bpe.homedir)(),...t],r,s)=>{let a=Y.resolve(s.cwd,Ae.toPortablePath(e));if(!(await r.baseFs.statPromise(a).catch(c=>{throw c.code==="ENOENT"?new ec(`cd: no such file or directory: ${e}`):c})).isDirectory())throw new ec(`cd: not a directory: ${e}`);return s.cwd=a,0}],["pwd",async(e,t,r)=>(r.stdout.write(`${Ae.fromPortablePath(r.cwd)}
|
||||
`),0)],[":",async(e,t,r)=>0],["true",async(e,t,r)=>0],["false",async(e,t,r)=>1],["exit",async([e,...t],r,s)=>s.exitCode=parseInt(e??s.variables["?"],10)],["echo",async(e,t,r)=>(r.stdout.write(`${e.join(" ")}
|
||||
`),0)],["sleep",async([e],t,r)=>{if(typeof e>"u")throw new ec("sleep: missing operand");let s=Number(e);if(Number.isNaN(s))throw new ec(`sleep: invalid time interval '${e}'`);return await(0,vpe.setTimeout)(1e3*s,0)}],["unset",async(e,t,r)=>{for(let s of e)delete r.environment[s],delete r.variables[s];return 0}],["__ysh_run_procedure",async(e,t,r)=>{let s=r.procedures[e[0]];return await RT(s,{stdin:new Uc(r.stdin),stdout:new Uc(r.stdout),stderr:new Uc(r.stderr)}).run()}],["__ysh_set_redirects",async(e,t,r)=>{let s=r.stdin,a=r.stdout,n=r.stderr,c=[],f=[],p=[],h=0;for(;e[h]!=="--";){let C=e[h++],{type:S,fd:x}=JSON.parse(C),I=K=>{switch(x){case null:case 0:c.push(K);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},R=K=>{switch(x){case null:case 1:f.push(K);break;case 2:p.push(K);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},N=Number(e[h++]),U=h+N;for(let K=h;K<U;++h,++K)switch(S){case"<":I(()=>t.baseFs.createReadStream(Y.resolve(r.cwd,Ae.toPortablePath(e[K]))));break;case"<<<":I(()=>{let $=new tc.PassThrough;return process.nextTick(()=>{$.write(`${e[K]}
|
||||
`),$.end()}),$});break;case"<&":I(()=>ype(Number(e[K]),1,r));break;case">":case">>":{let $=Y.resolve(r.cwd,Ae.toPortablePath(e[K]));R($==="/dev/null"?new tc.Writable({autoDestroy:!0,emitClose:!0,write(ie,fe,le){setImmediate(le)}}):t.baseFs.createWriteStream($,S===">>"?{flags:"a"}:void 0))}break;case">&":R(ype(Number(e[K]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${S}"`)}}if(c.length>0){let C=new tc.PassThrough;s=C;let S=x=>{if(x===c.length)C.end();else{let I=c[x]();I.pipe(C,{end:!1}),I.on("end",()=>{S(x+1)})}};S(0)}if(f.length>0){let C=new tc.PassThrough;a=C;for(let S of f)C.pipe(S)}if(p.length>0){let C=new tc.PassThrough;n=C;for(let S of p)C.pipe(S)}let E=await RT(Av(e.slice(h+1),t,r),{stdin:new Uc(s),stdout:new Uc(a),stderr:new Uc(n)}).run();return await Promise.all(f.map(C=>new Promise((S,x)=>{C.on("error",I=>{x(I)}),C.on("close",()=>{S()}),C.end()}))),await Promise.all(p.map(C=>new Promise((S,x)=>{C.on("error",I=>{x(I)}),C.on("close",()=>{S()}),C.end()}))),E}]]);art={addition:(e,t)=>e+t,subtraction:(e,t)=>e-t,multiplication:(e,t)=>e*t,division:(e,t)=>Math.trunc(e/t)}});var Dpe=G((wUt,LT)=>{function Art(){var e=0,t=1,r=2,s=3,a=4,n=5,c=6,f=7,p=8,h=9,E=10,C=11,S=12,x=13,I=14,R=15,N=16,U=17,K=0,$=1,ie=2,fe=3,le=4;function ge(d,ve){return 55296<=d.charCodeAt(ve)&&d.charCodeAt(ve)<=56319&&56320<=d.charCodeAt(ve+1)&&d.charCodeAt(ve+1)<=57343}function pe(d,ve){ve===void 0&&(ve=0);var Ie=d.charCodeAt(ve);if(55296<=Ie&&Ie<=56319&&ve<d.length-1){var me=Ie,ce=d.charCodeAt(ve+1);return 56320<=ce&&ce<=57343?(me-55296)*1024+(ce-56320)+65536:me}if(56320<=Ie&&Ie<=57343&&ve>=1){var me=d.charCodeAt(ve-1),ce=Ie;return 55296<=me&&me<=56319?(me-55296)*1024+(ce-56320)+65536:ce}return Ie}function De(d,ve,Ie){var me=[d].concat(ve).concat([Ie]),ce=me[me.length-2],X=Ie,be=me.lastIndexOf(I);if(be>1&&me.slice(1,be).every(function(_){return _==s})&&[s,x,U].indexOf(d)==-1)return ie;var ke=me.lastIndexOf(a);if(ke>0&&me.slice(1,ke).every(function(_){return _==a})&&[S,a].indexOf(ce)==-1)return me.filter(function(_){return _==a}).length%2==1?fe:le;if(ce==e&&X==t)return K;if(ce==r||ce==e||ce==t)return X==I&&ve.every(function(_){return _==s})?ie:$;if(X==r||X==e||X==t)return $;if(ce==c&&(X==c||X==f||X==h||X==E))return K;if((ce==h||ce==f)&&(X==f||X==p))return K;if((ce==E||ce==p)&&X==p)return K;if(X==s||X==R)return K;if(X==n)return K;if(ce==S)return K;var it=me.indexOf(s)!=-1?me.lastIndexOf(s)-1:me.length-2;return[x,U].indexOf(me[it])!=-1&&me.slice(it+1,-1).every(function(_){return _==s})&&X==I||ce==R&&[N,U].indexOf(X)!=-1?K:ve.indexOf(a)!=-1?ie:ce==a&&X==a?K:$}this.nextBreak=function(d,ve){if(ve===void 0&&(ve=0),ve<0)return 0;if(ve>=d.length-1)return d.length;for(var Ie=ye(pe(d,ve)),me=[],ce=ve+1;ce<d.length;ce++)if(!ge(d,ce-1)){var X=ye(pe(d,ce));if(De(Ie,me,X))return ce;me.push(X)}return d.length},this.splitGraphemes=function(d){for(var ve=[],Ie=0,me;(me=this.nextBreak(d,Ie))<d.length;)ve.push(d.slice(Ie,me)),Ie=me;return Ie<d.length&&ve.push(d.slice(Ie)),ve},this.iterateGraphemes=function(d){var ve=0,Ie={next:function(){var me,ce;return(ce=this.nextBreak(d,ve))<d.length?(me=d.slice(ve,ce),ve=ce,{value:me,done:!1}):ve<d.length?(me=d.slice(ve),ve=d.length,{value:me,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(Ie[Symbol.iterator]=function(){return Ie}),Ie},this.countGraphemes=function(d){for(var ve=0,Ie=0,me;(me=this.nextBreak(d,Ie))<d.length;)Ie=me,ve++;return Ie<d.length&&ve++,ve};function ye(d){return 1536<=d&&d<=1541||d==1757||d==1807||d==2274||d==3406||d==69821||70082<=d&&d<=70083||d==72250||72326<=d&&d<=72329||d==73030?S:d==13?e:d==10?t:0<=d&&d<=9||11<=d&&d<=12||14<=d&&d<=31||127<=d&&d<=159||d==173||d==1564||d==6158||d==8203||8206<=d&&d<=8207||d==8232||d==8233||8234<=d&&d<=8238||8288<=d&&d<=8292||d==8293||8294<=d&&d<=8303||55296<=d&&d<=57343||d==65279||65520<=d&&d<=65528||65529<=d&&d<=65531||113824<=d&&d<=113827||119155<=d&&d<=119162||d==917504||d==917505||917506<=d&&d<=917535||917632<=d&&d<=917759||918e3<=d&&d<=921599?r:768<=d&&d<=879||1155<=d&&d<=1159||1160<=d&&d<=1161||1425<=d&&d<=1469||d==1471||1473<=d&&d<=1474||1476<=d&&d<=1477||d==1479||1552<=d&&d<=1562||1611<=d&&d<=1631||d==1648||1750<=d&&d<=1756||1759<=d&&d<=1764||1767<=d&&d<=1768||1770<=d&&d<=1773||d==1809||1840<=d&&d<=1866||1958<=d&&d<=1968||2027<=d&&d<=2035||2070<=d&&d<=2073||2075<=d&&d<=2083||2085<=d&&d<=2087||2089<=d&&d<=2093||2137<=d&&d<=2139||2260<=d&&d<=2273||2275<=d&&d<=2306||d==2362||d==2364||2369<=d&&d<=2376||d==2381||2385<=d&&d<=2391||2402<=d&&d<=2403||d==2433||d==2492||d==2494||2497<=d&&d<=2500||d==2509||d==2519||2530<=d&&d<=2531||2561<=d&&d<=2562||d==2620||2625<=d&&d<=2626||2631<=d&&d<=2632||2635<=d&&d<=2637||d==2641||2672<=d&&d<=2673||d==2677||2689<=d&&d<=2690||d==2748||2753<=d&&d<=2757||2759<=d&&d<=2760||d==2765||2786<=d&&d<=2787||2810<=d&&d<=2815||d==2817||d==2876||d==2878||d==2879||2881<=d&&d<=2884||d==2893||d==2902||d==2903||2914<=d&&d<=2915||d==2946||d==3006||d==3008||
Line truncated
|
||||
`,end:e=>`::endgroup::
|
||||
`}:UT.default.TRAVIS?{start:e=>`travis_fold:start:${e}
|
||||
`,end:e=>`travis_fold:end:${e}
|
||||
`}:UT.default.GITLAB?{start:e=>`section_start:${Math.floor(Date.now()/1e3)}:${e.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r\x1B[0K${e}
|
||||
`,end:e=>`section_end:${Math.floor(Date.now()/1e3)}:${e.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,Fpe=Pd!==null,Tpe=new Date,grt=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,mrt=e=>e,_T=mrt({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),yrt=grt&&Object.keys(_T).find(e=>{let t=_T[e];return!(t.date&&(t.date[0]!==Tpe.getDate()||t.date[1]!==Tpe.getMonth()+1))})||"default";Ft=class extends Io{constructor({configuration:r,stdout:s,json:a=!1,forceSectionAlignment:n=!1,includeNames:c=!0,includePrefix:f=!0,includeFooter:p=!0,includeLogs:h=!a,includeInfos:E=h,includeWarnings:C=h}){super();this.uncommitted=new Set;this.warningCount=0;this.errorCount=0;this.timerFooter=[];this.startTime=Date.now();this.indent=0;this.level=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;if(kB(this,{configuration:r}),this.configuration=r,this.forceSectionAlignment=n,this.includeNames=c,this.includePrefix=f,this.includeFooter=p,this.includeInfos=E,this.includeWarnings=C,this.json=a,this.stdout=s,r.get("enableProgressBars")&&!a&&s.isTTY&&s.columns>22){let S=r.get("progressBarStyle")||yrt;if(!Object.hasOwn(_T,S))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=_T[S];let x=Math.min(this.getRecommendedLength(),80);this.progressMaxScaledSize=Math.floor(this.progressStyle.size*x/80)}}static async start(r,s){let a=new this(r),n=process.emitWarning;process.emitWarning=(c,f)=>{if(typeof c!="string"){let h=c;c=h.message,f=f??h.name}let p=typeof f<"u"?`${f}: ${c}`:c;a.reportWarning(0,p)},r.includeVersion&&a.reportInfo(0,Z0(r.configuration,`Yarn ${An}`,2));try{await s(a)}catch(c){a.reportExceptionOnce(c)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}getRecommendedLength(){let s=this.progressStyle!==null?this.stdout.columns-1:super.getRecommendedLength();return Math.max(40,s-12-this.indent*2)}startSectionSync({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}async startSectionPromise({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return await n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}startTimerImpl(r,s,a){return{cb:typeof s=="function"?s:a,reportHeader:()=>{this.level+=1,this.reportInfo(null,`\u250C ${r}`),this.indent+=1,Pd!==null&&!this.json&&this.includeInfos&&this.stdout.write(Pd.start(r))},reportFooter:f=>{if(this.indent-=1,Pd!==null&&!this.json&&this.includeInfos){this.stdout.write(Pd.end(r));for(let p of this.timerFooter)p()}this.configuration.get("enableTimers")&&f>200?this.reportInfo(null,`\u2514 Completed in ${Gt(this.configuration,f,dt.DURATION)}`):this.reportInfo(null,"\u2514 Completed"),this.level-=1},skipIfEmpty:(typeof s=="function"?{}:s).skipIfEmpty}}startTimerSync(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionSync(c,n)}async startTimerPromise(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionPromise(c,n)}reportSeparator(){this.indent===0?this.writeLine(""):this.reportInfo(null,"")}reportInfo(r,s){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"",c=`${this.formatPrefix(n,"blueBright")}${s}`;this.json?this.reportJson({type:"info",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(c)}reportWarning(r,s){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"warning",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,"yellowBright")}${s}`)}reportError(r,s){this.errorCount+=1,this.timerFooter.push(()=>this.reportErrorImpl(r,s)),this.reportErrorImpl(r,s)}reportErrorImpl(r,s){this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"error",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,"redBright")}${s}`,{truncate:!1})}reportFold(r,s){if(!Pd)return;let a=`${Pd.start(r)}${s}${Pd.end(r)}`;this.timerFooter.push(()=>this.stdout.write(a))}reportProgress(r){if(this.progressStyle===null)ret
Line truncated
|
||||
`),this.writeProgress()}writeLines(r,{truncate:s}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:s})}
|
||||
`);this.writeProgress()}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let s of r)s.committed=!0,s.action()}clearProgress({delta:r=0,clear:s=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\x1B[${this.progress.size+r}A`),(r>0||s)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>Qpe&&(this.progressFrame=(this.progressFrame+1)%kpe.length,this.progressTime=r);let s=kpe[this.progressFrame];for(let a of this.progress.values()){let n="";if(typeof a.lastScaledSize<"u"){let h=this.progressStyle.chars[0].repeat(a.lastScaledSize),E=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${h}${E}`}let c=this.formatName(null),f=c?`${c}: `:"",p=a.definition.title?` ${a.definition.title}`:"";this.stdout.write(`${Gt(this.configuration,"\u27A4","blueBright")} ${f}${s}${n}${p}
|
||||
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},Qpe)}refreshProgress({delta:r=0,force:s=!1}={}){let a=!1,n=!1;if(s||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,p=c.lastScaledSize;c.lastScaledSize=f;let h=c.lastTitle;if(c.lastTitle=c.definition.title,f!==p||(n=h!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:s}={}){return this.progressStyle===null&&(s=!1),typeof s>"u"&&(s=this.configuration.get("preferTruncatedLines")),s&&(r=(0,Rpe.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?Npe(r,{configuration:this.configuration,json:this.json}):""}formatPrefix(r,s){return this.includePrefix?`${Gt(this.configuration,"\u27A4",s)} ${r}${this.formatIndent()}`:""}formatNameWithHyperlink(r){return this.includeNames?_j(r,{configuration:this.configuration,json:this.json}):""}formatIndent(){return this.level>0||!this.forceSectionAlignment?"\u2502 ".repeat(this.indent):`${drt} `}}});var wn={};Vt(wn,{PackageManager:()=>Lpe,detectPackageManager:()=>Mpe,executePackageAccessibleBinary:()=>Gpe,executePackageScript:()=>HT,executePackageShellcode:()=>Hj,executeWorkspaceAccessibleBinary:()=>Srt,executeWorkspaceLifecycleScript:()=>Hpe,executeWorkspaceScript:()=>_pe,getPackageAccessibleBinaries:()=>jT,getWorkspaceAccessibleBinaries:()=>jpe,hasPackageScript:()=>wrt,hasWorkspaceScript:()=>jj,isNodeScript:()=>Gj,makeScriptEnv:()=>mv,maybeExecuteWorkspaceLifecycleScript:()=>vrt,prepareExternalProject:()=>Crt});async function xd(e,t,r,s=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${s.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await ae.writeFilePromise(Y.format({dir:e,name:t,ext:".cmd"}),a)}await ae.writeFilePromise(Y.join(e,t),`#!/bin/sh
|
||||
exec "${r}" ${s.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
|
||||
`,{mode:493})}async function Mpe(e){let t=await _t.tryFind(e);if(t?.packageManager){let s=RQ(t.packageManager);if(s?.name){let a=`found ${JSON.stringify({packageManager:t.packageManager})} in manifest`,[n]=s.reference.split(".");switch(s.name){case"yarn":return{packageManagerField:!0,packageManager:Number(n)===1?"Yarn Classic":"Yarn",reason:a};case"npm":return{packageManagerField:!0,packageManager:"npm",reason:a};case"pnpm":return{packageManagerField:!0,packageManager:"pnpm",reason:a}}}}let r;try{r=await ae.readFilePromise(Y.join(e,yr.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:ae.existsSync(Y.join(e,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:ae.existsSync(Y.join(e,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function mv({project:e,locator:t,binFolder:r,ignoreCorepack:s,lifecycleScript:a,baseEnv:n=e?.configuration.env??process.env}){let c={};for(let[E,C]of Object.entries(n))typeof C<"u"&&(c[E.toLowerCase()!=="path"?E:"PATH"]=C);let f=Ae.fromPortablePath(r);c.BERRY_BIN_FOLDER=Ae.fromPortablePath(f);let p=process.env.COREPACK_ROOT&&!s?Ae.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([xd(r,"node",process.execPath),...An!==null?[xd(r,"run",process.execPath,[p,"run"]),xd(r,"yarn",process.execPath,[p]),xd(r,"yarnpkg",process.execPath,[p]),xd(r,"node-gyp",process.execPath,[p,"run","--top-level","node-gyp"])]:[]]),e&&(c.INIT_CWD=Ae.fromPortablePath(e.configuration.startingCwd),c.PROJECT_CWD=Ae.fromPortablePath(e.cwd)),c.PATH=c.PATH?`${f}${Ae.delimiter}${c.PATH}`:`${f}`,c.npm_execpath=`${f}${Ae.sep}yarn`,c.npm_node_execpath=`${f}${Ae.sep}node`,t){if(!e)throw new Error("Assertion failed: Missing project");let E=e.tryWorkspaceByLocator(t),C=E?E.manifest.version??"":e.storedPackages.get(t.locatorHash).version??"";c.npm_package_name=fn(t),c.npm_package_version=C;let S;if(E)S=E.cwd;else{let x=e.storedPackages.get(t.locatorHash);if(!x)throw new Error(`Package for ${Vr(e.configuration,t)} not found in the project`);let I=e.configuration.getLinkers(),R={project:e,report:new Ft({stdout:new kd.PassThrough,configuration:e.configuration})},N=I.find(U=>U.supportsPackage(x,R));if(!N)throw new Error(`The package ${Vr(e.configuration,x)} isn't supported by any of the available linkers`);S=await N.findPackageLocation(x,R)}c.npm_package_json=Ae.fromPortablePath(Y.join(S,yr.manifest))}let h=An!==null?`yarn/${An}`:`yarn/${Tp("@yarnpkg/core").version}-core`;return c.npm_config_user_agent=`${h} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(c.npm_lifecycle_event=a),e&&await e.configuration.triggerHook(E=>E.setupScriptEnvironment,e,c,async(E,C,S)=>await xd(r,E,C,S)),c}async function Crt(e,t,{configuration:r,report:s,workspace:a=null,locator:n=null}){await Irt(async()=>{await ae.mktempPromise(async c=>{let f=Y.join(c,"pack.log"),p=null,{stdout:h,stderr:E}=r.getSubprocessStreams(f,{prefix:Ae.fromPortablePath(e),report:s}),C=n&&ju(n)?aI(n):n,S=C?ml(C):"an external project";h.write(`Packing ${S} from sources
|
||||
`);let x=await Mpe(e),I;x!==null?(h.write(`Using ${x.packageManager} for bootstrap. Reason: ${x.reason}
|
||||
|
||||
`),I=x.packageManager):(h.write(`No package manager configuration detected; defaulting to Yarn
|
||||
|
||||
`),I="Yarn");let R=I==="Yarn"&&!x?.packageManagerField;await ae.mktempPromise(async N=>{let U=await mv({binFolder:N,ignoreCorepack:R,baseEnv:{...process.env,COREPACK_ENABLE_AUTO_PIN:"0"}}),$=new Map([["Yarn Classic",async()=>{let fe=a!==null?["workspace",a]:[],le=Y.join(e,yr.manifest),ge=await ae.readFilePromise(le),pe=await qu(process.execPath,[process.argv[1],"set","version","classic","--only-if-needed","--yarn-path"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(pe.code!==0)return pe.code;await ae.writeFilePromise(le,ge),await ae.appendFilePromise(Y.join(e,".npmignore"),`/.yarn
|
||||
`),h.write(`
|
||||
`),delete U.NODE_ENV;let De=await qu("yarn",["install"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(De.code!==0)return De.code;h.write(`
|
||||
`);let ye=await qu("yarn",[...fe,"pack","--filename",Ae.fromPortablePath(t)],{cwd:e,env:U,stdin:p,stdout:h,stderr:E});return ye.code!==0?ye.code:0}],["Yarn",async()=>{let fe=a!==null?["workspace",a]:[];U.YARN_ENABLE_INLINE_BUILDS="1";let le=Y.join(e,yr.lockfile);await ae.existsPromise(le)||await ae.writeFilePromise(le,"");let ge=await qu("yarn",[...fe,"pack","--install-if-needed","--filename",Ae.fromPortablePath(t)],{cwd:e,env:U,stdin:p,stdout:h,stderr:E});return ge.code!==0?ge.code:0}],["npm",async()=>{if(a!==null){let ve=new kd.PassThrough,Ie=zE(ve);ve.pipe(h,{end:!1});let me=await qu("npm",["--version"],{cwd:e,env:U,stdin:p,stdout:ve,stderr:E,end:0});if(ve.end(),me.code!==0)return h.end(),E.end(),me.code;let ce=(await Ie).toString().trim();if(!rA(ce,">=7.x")){let X=Qa(null,"npm"),be=Un(X,ce),ke=Un(X,">=7.x");throw new Error(`Workspaces aren't supported by ${ai(r,be)}; please upgrade to ${ai(r,ke)} (npm has been detected as the primary package manager for ${Gt(r,e,dt.PATH)})`)}}let fe=a!==null?["--workspace",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let le=await qu("npm",["install","--legacy-peer-deps"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(le.code!==0)return le.code;let ge=new kd.PassThrough,pe=zE(ge);ge.pipe(h);let De=await qu("npm",["pack","--silent",...fe],{cwd:e,env:U,stdin:p,stdout:ge,stderr:E});if(De.code!==0)return De.code;let ye=(await pe).toString().trim().replace(/^.*\n/s,""),d=Y.resolve(e,Ae.toPortablePath(ye));return await ae.renamePromise(d,t),0}]]).get(I);if(typeof $>"u")throw new Error("Assertion failed: Unsupported workflow");let ie=await $();if(!(ie===0||typeof ie>"u"))throw ae.detachTemp(c),new Lt(58,`Packing the package failed (exit code ${ie}, logs can be found here: ${Gt(r,f,dt.PATH)})`)})})})}async function wrt(e,t,{project:r}){let s=r.tryWorkspaceByLocator(e);if(s!==null)return jj(s,t);let a=r.storedPackages.get(e.locatorHash);if(!a)throw new Error(`Package for ${Vr(r.configuration,e)} not found in the project`);return await nA.openPromise(async n=>{let c=r.configuration,f=r.configuration.getLinkers(),p={project:r,report:new Ft({stdout:new kd.PassThrough,configuration:c})},h=f.find(x=>x.supportsPackage(a,p));if(!h)throw new Error(`The package ${Vr(r.configuration,a)} isn't supported by any of the available linkers`);let E=await h.findPackageLocation(a,p),C=new Pn(E,{baseFs:n});return(await _t.find(wt.dot,{baseFs:C})).scripts.has(t)})}async function HT(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ae.mktempPromise(async p=>{let{manifest:h,env:E,cwd:C}=await Upe(e,{project:a,binFolder:p,cwd:s,lifecycleScript:t}),S=h.scripts.get(t);if(typeof S>"u")return 1;let x=async()=>await xI(S,r,{cwd:C,env:E,stdin:n,stdout:c,stderr:f});return await(await a.configuration.reduceHook(R=>R.wrapScriptExecution,x,a,e,t,{script:S,args:r,cwd:C,env:E,stdin:n,stdout:c,stderr:f}))()})}async function Hj(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ae.mktempPromise(async p=>{let{env:h,cwd:E}=await Upe(e,{project:a,binFolder:p,cwd:s});return await xI(t,r,{cwd:E,env:h,stdin:n,stdout:c,stderr:f})})}async function Brt(e,{binFolder:t,cwd:r,lifecycleScript:s}){let a=await mv({project:e.project,locator:e.anchoredLocator,binFolder:t,lifecycleScript:s});return await qj(t,await jpe(e)),typeof r>"u"&&(r=Y.dirname(await ae.realpathPromise(Y.join(e.cwd,"package.json")))),{manifest:e.manifest,binFolder:t,env:a,cwd:r}}async function Upe(e,{project:t,binFolder:r,cwd:s,lifecycleScript:a}){let n=t.tryWorkspaceByLocator(e);if(n!==null)return Brt(n,{binFolder:r,cwd:s,lifecycleScript:a});let c=t.storedPackages.get(e.locatorHash);if(!c)throw new Error(`Package for ${Vr(t.configuration,e)} not found in the project`);return await nA.openPromise(async f=>{let p=t.configuration,h=t.configuration.getLinkers(),E={project:t,report:new Ft({stdout:new kd.PassThrough,configuration:p})},C=h.find(N=>N.supportsPackage(c,E));if(!C)throw new Error(`The package ${Vr(t.configuration,c)} isn't supported by any of the available linkers`);let S=await mv({project:t,locator:e,binFolder:r,lifecycleScript:a});await qj(r,await jT(e,{project:t}));let x=await C.findPackageLocation(c,E),I=new Pn(x,{baseFs:f}),R=await _t.find(wt.dot,{baseFs:I});return typeof s>"u"&&(s=x),{manifest:R,binFolder:r,env:S,cwd:s}})}async function _pe(e,t,r,{cwd:s,stdin:a,stdout:n,stderr:c}){return await HT(e.anchoredLocator,t,r,{cwd:s,project:e.project,stdin:a,stdout:n,stderr:c})}function jj(e,t){return e.manifest.scripts.has(t)}async function Hpe(e,t,{cwd:r,report:s}){let{configuration:a}=e.project,n=null;await ae.mktempPromise(async c=>{let f=Y.join(c,`${t}.log`),p=`# This file contains the result of Yarn calling the "${t}" lifecycle script inside a workspace ("${Ae.fromPortablePath(e.cwd)}")
|
||||
`,{stdout:h,stderr:E}=a.getSubprocessStreams(f,{report:s,prefix:Vr(a,e.anchoredLocator),header:p});s.reportInfo(36,`Calling the "${t}" lifecycle script`);let C=await _pe(e,t,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),C!==0)throw ae.detachTemp(c),new Lt(36,`${vB(t)} script failed (exit code ${Gt(a,C,dt.NUMBER)}, logs can be found here: ${Gt(a,f,dt.PATH)}); run ${Gt(a,`yarn ${t}`,dt.CODE)} to investigate`)})}async function vrt(e,t,r){jj(e,t)&&await Hpe(e,t,r)}function Gj(e){let t=Y.extname(e);if(t.match(/\.[cm]?[jt]sx?$/))return!0;if(t===".exe"||t===".bin")return!1;let r=Buffer.alloc(4),s;try{s=ae.openSync(e,"r")}catch{return!0}try{ae.readSync(s,r,0,r.length,0)}finally{ae.closeSync(s)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function jT(e,{project:t}){let r=t.configuration,s=new Map,a=t.storedPackages.get(e.locatorHash);if(!a)throw new Error(`Package for ${Vr(r,e)} not found in the project`);let n=new kd.Writable,c=r.getLinkers(),f={project:t,report:new Ft({configuration:r,stdout:n})},p=new Set([e.locatorHash]);for(let E of a.dependencies.values()){let C=t.storedResolutions.get(E.descriptorHash);if(!C)throw new Error(`Assertion failed: The resolution (${ai(r,E)}) should have been registered`);p.add(C)}let h=await Promise.all(Array.from(p,async E=>{let C=t.storedPackages.get(E);if(!C)throw new Error(`Assertion failed: The package (${E}) should have been registered`);if(C.bin.size===0)return Xl.skip;let S=c.find(I=>I.supportsPackage(C,f));if(!S)return Xl.skip;let x=null;try{x=await S.findPackageLocation(C,f)}catch(I){if(I.code==="LOCATOR_NOT_INSTALLED")return Xl.skip;throw I}return{dependency:C,packageLocation:x}}));for(let E of h){if(E===Xl.skip)continue;let{dependency:C,packageLocation:S}=E;for(let[x,I]of C.bin){let R=Y.resolve(S,I);s.set(x,[C,Ae.fromPortablePath(R),Gj(R)])}}return s}async function jpe(e){return await jT(e.anchoredLocator,{project:e.project})}async function qj(e,t){await Promise.all(Array.from(t,([r,[,s,a]])=>a?xd(e,r,process.execPath,[s]):xd(e,r,s,[])))}async function Gpe(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await jT(e,{project:a});let E=h.get(t);if(!E)throw new Error(`Binary not found (${t}) for ${Vr(a.configuration,e)}`);return await ae.mktempPromise(async C=>{let[,S]=E,x=await mv({project:a,locator:e,binFolder:C});await qj(x.BERRY_BIN_FOLDER,h);let I=Gj(Ae.toPortablePath(S))?qu(process.execPath,[...p,S,...r],{cwd:s,env:x,stdin:n,stdout:c,stderr:f}):qu(S,r,{cwd:s,env:x,stdin:n,stdout:c,stderr:f}),R;try{R=await I}finally{await ae.removePromise(x.BERRY_BIN_FOLDER)}return R.code})}async function Srt(e,t,r,{cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f}){return await Gpe(e.anchoredLocator,t,r,{project:e.project,cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f})}var Ope,kd,Lpe,Ert,Irt,Yj=Ze(()=>{bt();bt();iA();uv();Zl();Ope=et(M0()),kd=Ce("stream");fI();Nc();gv();dv();IT();Tc();Qc();Lp();$o();Lpe=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(Lpe||{});Ert=2,Irt=(0,Ope.default)(Ert)});function Mnt(e,t,r){let s=t,a=t?t.next:e.head,n=new J6(r,s,a,e);return n.next===void 0&&(e.tail=n),n.prev===void 0&&(e.head=n),e.length++,n}function Unt(e,t){e.tail=new J6(t,e.tail,void 0,e),e.head||(e.head=e.tail),e.length++}function _nt(e,t){e.head=new J6(t,void 0,e.head,e),e.tail||(e.tail=e.head),e.length++}var Ihe,Oa,yR,H6,Che,G6,wm,IR,vhe,hR,Ud,Kpe,She,Cm,Qhe,Uv,Ku,B6,Ohe,Q6,Z6,jhe,X6,Bn,gs,$6,jv,_I,Il,Vhe,_v,eG,El,rG,brt,Drt,qpe,Prt,xrt,krt,qp,Yp,Qd,GT,yv,qT,Ype,YT,Wpe,Yu,QI,zs,Ev,NI,Zs,Na,Xs,Wj,WT,na,es,Vj,Kj,Vpe,Jj,oA,zj,VT,Iv,Am,rc,Cv,Qrt,Trt,Rrt,Frt,whe,Nrt,Ort,Lrt,Dm,Mrt,Hd,zu,wv,Jn,Zj,Jp,Xj,E6,I6,Tv,KT,UI,HI,$j,OI,jd,Ju,Nd,aA,LI,e6,Kp,Bv,t6,nR,pm,iR,Bm,j6,Urt,ER,Bhe,_rt,Hrt,jrt,Grt,qrt,Yrt,Wrt,q6,Hv,Vrt,uA,Krt,Jpe,Jrt,r6,vm,JT,n6,Y6,bhe,zrt,Zrt,Dhe,Xrt,$rt,Phe,ent,tnt,rnt,nnt,int,snt,ont,ant,xhe,khe,lnt,sR,cnt,CR,W6,Sm,unt,hm,i6,fnt,Od,Ant,pnt,hnt,Ld,dnt,gnt,mnt,s6,ynt,dm,dR,Ent,Int,Cnt,wnt,cn,Rhe,wR,Bnt,C6,w6,vnt,_c,gm,Wp,o6,zpe,lA,vv,Td,Zpe,Ci,Vp,Rd,a6,mm,ds,zT,ZT,l6,Xpe,$pe,Sv,c6,XT,TI,Fd,$T,ym,eR,tR,ehe,Snt,bm,Rv,bnt,Fhe,Dnt,Pnt,BR,Nhe,xnt,the,V6,vR,K6,knt,Qnt,rhe,Tnt,Lhe,Rnt,nhe,ihe,she,v6,ohe,bv,oR,S6,aR,b6,D6,P6,x6,Md,gR,k6,u6,cA,Mhe,Fnt,Nnt,Ont,Lnt,J6,ahe,lhe,lR,Dv,Wu,Em,Im,Pv,f6,Vu,A6,cR,che,T6,R6,uR,fR,uhe,p6,AR,Uhe,h6,SR,z6,Hnt,jnt,_he,Hhe,Gnt,qnt,YUt,Ynt,Wnt,Vnt,Knt,Jnt,Ghe,znt,Znt,Xnt,qhe,F6,mR,$nt,Yhe,eit,Whe,Khe,bR,tit,rit,N6,Jhe,nit,iit,d6,fhe,RI,sit,oit,ait,lit,cit,uit,Ahe,O6,phe,L6,Hc,M6,U6,pR,hhe,dhe,Qv,ghe,mhe,g6,_d,$s,rR,yhe,FI,m6,y6,_6,Fv,Nv,Ov,Lv,fit,Mv,Ait,pit,hit,Ehe,tG,xv,zhe,dit,git,WUt,mit,yit,Eit,Iit,Cit,kv,VUt,wit,Zhe=Ze(()=>{Ihe=et(Ce("events"),1),Oa=et(Ce("fs"),1),yR=Ce("node:events"),H6=et(Ce("node:stream"),1),Che=Ce("node:string_decoder"),G6=et(Ce("node:path"),1),wm=et(Ce("node:fs"),1),IR=Ce("path"),vhe=Ce("events"),hR=et(Ce("assert"),1),Ud=Ce("buffer"),Kpe=et(Ce("zlib"),1),
Line truncated
|
||||
`,n=Buffer.byteLength(a),c=Math.floor(Math.log(n)/Math.log(10))+1;return n+c>=Math.pow(10,c)&&(c+=1),c+n+a}static parse(t,r,s=!1){return new The(Ent(Int(t),r),s)}},Ent=(e,t)=>t?Object.assign({},t,e):e,Int=e=>e.replace(/\n$/,"").split(`
|
||||
`).reduce(Cnt,Object.create(null)),Cnt=(e,t)=>{let r=parseInt(t,10);if(r!==Buffer.byteLength(t)+1)return e;t=t.slice((r+" ").length);let s=t.split("="),a=s.shift();if(!a)return e;let n=a.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),c=s.join("=");return e[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(c)*1e3):/^[0-9]+$/.test(c)?+c:c,e},wnt=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,cn=wnt!=="win32"?e=>e:e=>e&&e.replace(/\\/g,"/"),Rhe=class extends Dm{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,r){switch(super({}),this.pause(),this.extended=t,this.globalExtended=r,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=cn(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?cn(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),r&&this.#e(r,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let r=this.remain,s=this.blockRemain;return this.remain=Math.max(0,r-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:r>=t?super.write(e):super.write(e.subarray(0,r))}#e(e,t=!1){e.path&&(e.path=cn(e.path)),e.linkpath&&(e.linkpath=cn(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t))))}},wR=(e,t,r,s={})=>{e.file&&(s.file=e.file),e.cwd&&(s.cwd=e.cwd),s.code=r instanceof Error&&r.code||t,s.tarCode=t,!e.strict&&s.recoverable!==!1?(r instanceof Error&&(s=Object.assign(r,s),r=r.message),e.emit("warn",t,r,s)):r instanceof Error?e.emit("error",Object.assign(r,s)):e.emit("error",Object.assign(new Error(`${t}: ${r}`),s))},Bnt=1024*1024,C6=Buffer.from([31,139]),w6=Buffer.from([40,181,47,253]),vnt=Math.max(C6.length,w6.length),_c=Symbol("state"),gm=Symbol("writeEntry"),Wp=Symbol("readEntry"),o6=Symbol("nextEntry"),zpe=Symbol("processEntry"),lA=Symbol("extendedHeader"),vv=Symbol("globalExtendedHeader"),Td=Symbol("meta"),Zpe=Symbol("emitMeta"),Ci=Symbol("buffer"),Vp=Symbol("queue"),Rd=Symbol("ended"),a6=Symbol("emittedEnd"),mm=Symbol("emit"),ds=Symbol("unzip"),zT=Symbol("consumeChunk"),ZT=Symbol("consumeChunkSub"),l6=Symbol("consumeBody"),Xpe=Symbol("consumeMeta"),$pe=Symbol("consumeHeader"),Sv=Symbol("consuming"),c6=Symbol("bufferConcat"),XT=Symbol("maybeEnd"),TI=Symbol("writing"),Fd=Symbol("aborted"),$T=Symbol("onDone"),ym=Symbol("sawValidEntry"),eR=Symbol("sawNullBlock"),tR=Symbol("sawEOF"),ehe=Symbol("closeStream"),Snt=()=>!0,bm=class extends vhe.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Vp]=[];[Ci];[Wp];[gm];[_c]="begin";[Td]="";[lA];[vv];[Rd]=!1;[ds];[Fd]=!1;[ym];[eR]=!1;[tR]=!1;[TI]=!1;[Sv]=!1;[a6]=!1;constructor(e={}){super(),this.file=e.file||"",this.on($T,()=>{(this[_c]==="begin"||this[ym]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on($T,e.ondone):this.on($T,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Bnt,this.filter=typeof e.filter=="function"?e.filter:Snt;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let r=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:r?!0:void 0,this.on("end",()=>this[ehe]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){wR(this,e,t,r)}[$pe](e,t){this[ym]===void 0&&(this[ym]=!1);let r;try{r=new Sm(e,t,this[lA],this[vv])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(r.nullBlock)this[eR]?(this[tR]=!0,this[_c]==="begin"&&(this[_c]="header"),this[mm]("eof")):(this[eR]=!0,this[mm]("nullBlock"));else if(this[eR]=!1,!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{let s=r.type;if(/^(Symbolic)?Link$/.test(s)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test
Line truncated
|
||||
`}),f},s})});var ts={};Vt(ts,{emitList:()=>xit,emitTree:()=>Ade,treeNodeToJson:()=>fde,treeNodeToTreeify:()=>ude});function ude(e,{configuration:t}){let r={},s=0,a=(n,c)=>{let f=Array.isArray(n)?n.entries():Object.entries(n);for(let[p,h]of f){if(!h)continue;let{label:E,value:C,children:S}=h,x=[];typeof E<"u"&&x.push(Z0(t,E,2)),typeof C<"u"&&x.push(Gt(t,C[0],C[1])),x.length===0&&x.push(Z0(t,`${p}`,2));let I=x.join(": ").trim(),R=`\0${s++}\0`,N=c[`${R}${I}`]={};typeof S<"u"&&a(S,N)}};if(typeof e.children>"u")throw new Error("The root node must only contain children");return a(e.children,r),r}function fde(e){let t=r=>{if(typeof r.children>"u"){if(typeof r.value>"u")throw new Error("Assertion failed: Expected a value to be set if the children are missing");return X0(r.value[0],r.value[1])}let s=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,c]of s)c&&(a[kit(n)]=t(c));return typeof r.value>"u"?a:{value:X0(r.value[0],r.value[1]),children:a}};return t(e)}function xit(e,{configuration:t,stdout:r,json:s}){let a=e.map(n=>({value:n}));Ade({children:a},{configuration:t,stdout:r,json:s})}function Ade(e,{configuration:t,stdout:r,json:s,separators:a=0}){if(s){let c=Array.isArray(e.children)?e.children.values():Object.values(e.children??{});for(let f of c)f&&r.write(`${JSON.stringify(fde(f))}
|
||||
`);return}let n=(0,cde.asTree)(ude(e,{configuration:t}),!1,!1);if(n=n.replace(/\0[0-9]+\0/g,""),a>=1&&(n=n.replace(/^([├└]─)/gm,`\u2502
|
||||
$1`).replace(/^│\n/,"")),a>=2)for(let c=0;c<2;++c)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
|
||||
$2`).replace(/^│\n/,"");if(a>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(n)}function kit(e){return typeof e=="string"?e.replace(/^\0[0-9]+\0/,""):e}var cde,pde=Ze(()=>{cde=et(lde());Tc()});var DR,hde=Ze(()=>{DR=class{constructor(t){this.releaseFunction=t;this.map=new Map}addOrCreate(t,r){let s=this.map.get(t);if(typeof s<"u"){if(s.refCount<=0)throw new Error(`Race condition in RefCountedMap. While adding a new key the refCount is: ${s.refCount} for ${JSON.stringify(t)}`);return s.refCount++,{value:s.value,release:()=>this.release(t)}}else{let a=r();return this.map.set(t,{refCount:1,value:a}),{value:a,release:()=>this.release(t)}}}release(t){let r=this.map.get(t);if(!r)throw new Error(`Unbalanced calls to release. No known instances of: ${JSON.stringify(t)}`);let s=r.refCount;if(s<=0)throw new Error(`Unbalanced calls to release. Too many release vs alloc refcount would become: ${s-1} of ${JSON.stringify(t)}`);s==1?(this.map.delete(t),this.releaseFunction(r.value)):r.refCount--}}});function Yv(e){let t=e.match(Qit);if(!t?.groups)throw new Error("Assertion failed: Expected the checksum to match the requested pattern");let r=t.groups.cacheVersion?parseInt(t.groups.cacheVersion):null;return{cacheKey:t.groups.cacheKey??null,cacheVersion:r,cacheSpec:t.groups.cacheSpec??null,hash:t.groups.hash}}var dde,cG,uG,PR,zr,Qit,fG=Ze(()=>{Ge();bt();bt();iA();dde=Ce("crypto"),cG=et(Ce("fs"));hde();Nc();wd();Qc();$o();uG=ZE(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),PR=ZE(process.env.YARN_CACHE_VERSION_OVERRIDE??10),zr=class e{constructor(t,{configuration:r,immutable:s=r.get("enableImmutableCache"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.refCountedZipFsCache=new DR(t=>{t.discardAndClose()});this.cacheId=`-${(0,dde.randomBytes)(8).toString("hex")}.tmp`;this.configuration=r,this.cwd=t,this.immutable=s,this.check=a;let{cacheSpec:n,cacheKey:c}=e.getCacheKey(r);this.cacheSpec=n,this.cacheKey=c}static async find(t,{immutable:r,check:s}={}){let a=new e(t.get("cacheFolder"),{configuration:t,immutable:r,check:s});return await a.setup(),a}static getCacheKey(t){let r=t.get("compressionLevel"),s=r!=="mixed"?`c${r}`:"";return{cacheKey:[PR,s].join(""),cacheSpec:s}}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let t=`${this.configuration.get("globalFolder")}/cache`;return t!==this.cwd?t:null}getVersionFilename(t){return`${lI(t)}-${this.cacheKey}.zip`}getChecksumFilename(t,r){let a=Yv(r).hash.slice(0,10);return`${lI(t)}-${a}.zip`}isChecksumCompatible(t){if(t===null)return!1;let{cacheVersion:r,cacheSpec:s}=Yv(t);if(r===null||r<uG)return!1;let a=this.configuration.get("cacheMigrationMode");return!(r<PR&&a==="always"||s!==this.cacheSpec&&a!=="required-only")}getLocatorPath(t,r){return this.mirrorCwd===null?Y.resolve(this.cwd,this.getVersionFilename(t)):r===null?Y.resolve(this.cwd,this.getVersionFilename(t)):Y.resolve(this.cwd,this.getChecksumFilename(t,r))}getLocatorMirrorPath(t){let r=this.mirrorCwd;return r!==null?Y.resolve(r,this.getVersionFilename(t)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await ae.existsPromise(this.cwd))throw new Lt(56,"Cache path does not exist.")}else{await ae.mkdirPromise(this.cwd,{recursive:!0});let t=Y.resolve(this.cwd,".gitignore");await ae.changeFilePromise(t,`/.gitignore
|
||||
*.flock
|
||||
*.tmp
|
||||
`)}(this.mirrorCwd||!this.immutable)&&await ae.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(t,r,{onHit:s,onMiss:a,loader:n,...c}){let f=this.getLocatorMirrorPath(t),p=new Kn,h=()=>{let pe=new hs,De=Y.join(wt.root,v8(t));return pe.mkdirSync(De,{recursive:!0}),pe.writeJsonSync(Y.join(De,yr.manifest),{name:fn(t),mocked:!0}),pe},E=async(pe,{isColdHit:De,controlPath:ye=null})=>{if(ye===null&&c.unstablePackages?.has(t.locatorHash))return{isValid:!0,hash:null};let d=r&&!De?Yv(r).cacheKey:this.cacheKey,ve=!c.skipIntegrityCheck||!r?`${d}/${await xQ(pe)}`:r;if(ye!==null){let me=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await xQ(ye)}`:r;if(ve!==me)throw new Lt(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}let Ie=null;switch(r!==null&&ve!==r&&(this.check?Ie="throw":Yv(r).cacheKey!==Yv(ve).cacheKey?Ie="update":Ie=this.configuration.get("checksumBehavior")),Ie){case null:case"update":return{isValid:!0,hash:ve};case"ignore":return{isValid:!0,hash:r};case"reset":return{isValid:!1,hash:r};default:case"throw":throw new Lt(18,"The remote archive doesn't match the expected checksum")}},C=async pe=>{if(!n)throw new Error(`Cache check required but no loader configured for ${Vr(this.configuration,t)}`);let De=await n(),ye=De.getRealPath();De.saveAndClose(),await ae.chmodPromise(ye,420);let d=await E(pe,{controlPath:ye,isColdHit:!1});if(!d.isValid)throw new Error("Assertion failed: Expected a valid checksum");return d.hash},S=async()=>{if(f===null||!await ae.existsPromise(f)){let pe=await n(),De=pe.getRealPath();return pe.saveAndClose(),{source:"loader",path:De}}return{source:"mirror",path:f}},x=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${Vr(this.configuration,t)}`);if(this.immutable)throw new Lt(56,`Cache entry required but missing for ${Vr(this.configuration,t)}`);let{path:pe,source:De}=await S(),{hash:ye}=await E(pe,{isColdHit:!0}),d=this.getLocatorPath(t,ye),ve=[];De!=="mirror"&&f!==null&&ve.push(async()=>{let me=`${f}${this.cacheId}`;await ae.copyFilePromise(pe,me,cG.default.constants.COPYFILE_FICLONE),await ae.chmodPromise(me,420),await ae.renamePromise(me,f)}),(!c.mirrorWriteOnly||f===null)&&ve.push(async()=>{let me=`${d}${this.cacheId}`;await ae.copyFilePromise(pe,me,cG.default.constants.COPYFILE_FICLONE),await ae.chmodPromise(me,420),await ae.renamePromise(me,d)});let Ie=c.mirrorWriteOnly?f??d:d;return await Promise.all(ve.map(me=>me())),[!1,Ie,ye]},I=async()=>{let De=(async()=>{let ye=c.unstablePackages?.has(t.locatorHash),d=ye||!r||this.isChecksumCompatible(r)?this.getLocatorPath(t,r):null,ve=d!==null?this.markedFiles.has(d)||await p.existsPromise(d):!1,Ie=!!c.mockedPackages?.has(t.locatorHash)&&(!this.check||!ve),me=Ie||ve,ce=me?s:a;if(ce&&ce(),me){let X=null,be=d;if(!Ie)if(this.check)X=await C(be);else{let ke=await E(be,{isColdHit:!1});if(ke.isValid)X=ke.hash;else return x()}return[Ie,be,X]}else{if(this.immutable&&ye)throw new Lt(56,`Cache entry required but missing for ${Vr(this.configuration,t)}; consider defining ${ue.pretty(this.configuration,"supportedArchitectures",ue.Type.CODE)} to cache packages for multiple systems`);return x()}})();this.mutexes.set(t.locatorHash,De);try{return await De}finally{this.mutexes.delete(t.locatorHash)}};for(let pe;pe=this.mutexes.get(t.locatorHash);)await pe;let[R,N,U]=await I();R||this.markedFiles.add(N);let K=()=>this.refCountedZipFsCache.addOrCreate(N,()=>R?h():new hs(N,{baseFs:p,readOnly:!0})),$,ie=new AE(()=>M4(()=>($=K(),$.value),pe=>`Failed to open the cache entry for ${Vr(this.configuration,t)}: ${pe}`),Y),fe=new Gf(N,{baseFs:ie,pathUtils:Y}),le=()=>{$?.release()},ge=c.unstablePackages?.has(t.locatorHash)?null:U;return[fe,le,ge]}},Qit=/^(?:(?<cacheKey>(?<cacheVersion>[0-9]+)(?<cacheSpec>.*))\/)?(?<hash>.*)$/});var xR,gde=Ze(()=>{xR=(r=>(r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE",r))(xR||{})});var Tit,jI,AG=Ze(()=>{bt();Sc();Lp();$o();Tit=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(e,t,r,s)=>`${r}#commit=${s}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(e,t,r="",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(e,t,r="",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,e=>`npm:${e}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,e=>`npm:${e}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,e=>`npm:${e}`],[/^https?:\/\/[^/]+\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(e,t)=>FQ({protocol:"npm:",source:null,selector:e,params:{__archiveUrl:t}})],[/^[^/]+\.tgz#[0-9a-f]+$/,e=>`npm:${e}`]],jI=class{constructor(t){this.resolver=t;this.resolutions=null}async setup(t,{report:r}){let s=Y.join(t.cwd,yr.loc
Line truncated
|
||||
`)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}reportFold(r,s){}async finalize(){this.errorCount>0&&(this.stdout.write(`
|
||||
`),this.stdout.write(`${Gt(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
|
||||
`),this.suggestInstall&&this.stdout.write(`${Gt(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
|
||||
`))}formatNameWithHyperlink(r){return _j(r,{configuration:this.configuration,json:!1})}}});var GI,pG=Ze(()=>{$o();GI=class{constructor(t){this.resolver=t}supportsDescriptor(t,r){return!!(r.project.storedResolutions.get(t.descriptorHash)||r.project.originalPackages.has(QQ(t).locatorHash))}supportsLocator(t,r){return!!(r.project.originalPackages.has(t.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(t,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(t,r,s){return t}getResolutionDependencies(t,r){return this.resolver.getResolutionDependencies(t,r)}async getCandidates(t,r,s){let a=s.project.storedResolutions.get(t.descriptorHash);if(a){let c=s.project.originalPackages.get(a);if(c)return[c]}let n=s.project.originalPackages.get(QQ(t).locatorHash);if(n)return[n];throw new Error("Resolution expected from the lockfile data")}async getSatisfying(t,r,s,a){let[n]=await this.getCandidates(t,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(t,r){let s=r.project.originalPackages.get(t.locatorHash);if(!s)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return s}}});function zp(){}function Rit(e,t,r,s,a){for(var n=0,c=t.length,f=0,p=0;n<c;n++){var h=t[n];if(h.removed){if(h.value=e.join(s.slice(p,p+h.count)),p+=h.count,n&&t[n-1].added){var C=t[n-1];t[n-1]=t[n],t[n]=C}}else{if(!h.added&&a){var E=r.slice(f,f+h.count);E=E.map(function(x,I){var R=s[p+I];return R.length>x.length?R:x}),h.value=e.join(E)}else h.value=e.join(r.slice(f,f+h.count));f+=h.count,h.added||(p+=h.count)}}var S=t[c-1];return c>1&&typeof S.value=="string"&&(S.added||S.removed)&&e.equals("",S.value)&&(t[c-2].value+=S.value,t.pop()),t}function Fit(e){return{newPos:e.newPos,components:e.components.slice(0)}}function Nit(e,t){if(typeof e=="function")t.callback=e;else if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function Ide(e,t,r){return r=Nit(r,{ignoreWhitespace:!0}),yG.diff(e,t,r)}function Oit(e,t,r){return EG.diff(e,t,r)}function kR(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kR=function(t){return typeof t}:kR=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kR(e)}function hG(e){return Uit(e)||_it(e)||Hit(e)||jit()}function Uit(e){if(Array.isArray(e))return dG(e)}function _it(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Hit(e,t){if(e){if(typeof e=="string")return dG(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dG(e,t)}}function dG(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function jit(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gG(e,t,r,s,a){t=t||[],r=r||[],s&&(e=s(a,e));var n;for(n=0;n<t.length;n+=1)if(t[n]===e)return r[n];var c;if(Git.call(e)==="[object Array]"){for(t.push(e),c=new Array(e.length),r.push(c),n=0;n<e.length;n+=1)c[n]=gG(e[n],t,r,s,a);return t.pop(),r.pop(),c}if(e&&e.toJSON&&(e=e.toJSON()),kR(e)==="object"&&e!==null){t.push(e),c={},r.push(c);var f=[],p;for(p in e)e.hasOwnProperty(p)&&f.push(p);for(f.sort(),n=0;n<f.length;n+=1)p=f[n],c[p]=gG(e[p],t,r,s,p);t.pop(),r.pop()}else c=e;return c}function Cde(e,t,r,s,a,n,c){c||(c={}),typeof c.context>"u"&&(c.context=4);var f=Oit(r,s,c);if(!f)return;f.push({value:"",lines:[]});function p(U){return U.map(function(K){return" "+K})}for(var h=[],E=0,C=0,S=[],x=1,I=1,R=function(K){var $=f[K],ie=$.lines||$.value.replace(/\n$/,"").split(`
|
||||
`);if($.lines=ie,$.added||$.removed){var fe;if(!E){var le=f[K-1];E=x,C=I,le&&(S=c.context>0?p(le.lines.slice(-c.context)):[],E-=S.length,C-=S.length)}(fe=S).push.apply(fe,hG(ie.map(function(me){return($.added?"+":"-")+me}))),$.added?I+=ie.length:x+=ie.length}else{if(E)if(ie.length<=c.context*2&&K<f.length-2){var ge;(ge=S).push.apply(ge,hG(p(ie)))}else{var pe,De=Math.min(ie.length,c.context);(pe=S).push.apply(pe,hG(p(ie.slice(0,De))));var ye={oldStart:E,oldLines:x-E+De,newStart:C,newLines:I-C+De,lines:S};if(K>=f.length-2&&ie.length<=c.context){var d=/\n$/.test(r),ve=/\n$/.test(s),Ie=ie.length==0&&S.length>ye.oldLines;!d&&Ie&&r.length>0&&S.splice(ye.oldLines,0,"\\ No newline at end of file"),(!d&&!Ie||!ve)&&S.push("\\ No newline at end of file")}h.push(ye),E=0,C=0,S=[]}x+=ie.length,I+=ie.length}},N=0;N<f.length;N++)R(N);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:n,hunks:h}}var s4t,yde,Ede,yG,EG,Lit,Mit,Git,Wv,mG,IG=Ze(()=>{zp.prototype={diff:function(t,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=s.callback;typeof s=="function"&&(a=s,s={}),this.options=s;var n=this;function c(R){return a?(setTimeout(function(){a(void 0,R)},0),!0):R}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var f=r.length,p=t.length,h=1,E=f+p;s.maxEditLength&&(E=Math.min(E,s.maxEditLength));var C=[{newPos:-1,components:[]}],S=this.extractCommon(C[0],r,t,0);if(C[0].newPos+1>=f&&S+1>=p)return c([{value:this.join(r),count:r.length}]);function x(){for(var R=-1*h;R<=h;R+=2){var N=void 0,U=C[R-1],K=C[R+1],$=(K?K.newPos:0)-R;U&&(C[R-1]=void 0);var ie=U&&U.newPos+1<f,fe=K&&0<=$&&$<p;if(!ie&&!fe){C[R]=void 0;continue}if(!ie||fe&&U.newPos<K.newPos?(N=Fit(K),n.pushComponent(N.components,void 0,!0)):(N=U,N.newPos++,n.pushComponent(N.components,!0,void 0)),$=n.extractCommon(N,r,t,R),N.newPos+1>=f&&$+1>=p)return c(Rit(n,N.components,r,t,n.useLongestToken));C[R]=N}h++}if(a)(function R(){setTimeout(function(){if(h>E)return a();x()||R()},0)})();else for(;h<=E;){var I=x();if(I)return I}},pushComponent:function(t,r,s){var a=t[t.length-1];a&&a.added===r&&a.removed===s?t[t.length-1]={count:a.count+1,added:r,removed:s}:t.push({count:1,added:r,removed:s})},extractCommon:function(t,r,s,a){for(var n=r.length,c=s.length,f=t.newPos,p=f-a,h=0;f+1<n&&p+1<c&&this.equals(r[f+1],s[p+1]);)f++,p++,h++;return h&&t.components.push({count:h}),t.newPos=f,p},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],s=0;s<t.length;s++)t[s]&&r.push(t[s]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};s4t=new zp;yde=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Ede=/\S/,yG=new zp;yG.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Ede.test(e)&&!Ede.test(t)};yG.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<t.length-1;r++)!t[r+1]&&t[r+2]&&yde.test(t[r])&&yde.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};EG=new zp;EG.tokenize=function(e){var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var s=0;s<r.length;s++){var a=r[s];s%2&&!this.options.newlineIsToken?t[t.length-1]+=a:(this.options.ignoreWhitespace&&(a=a.trim()),t.push(a))}return t};Lit=new zp;Lit.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};Mit=new zp;Mit.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};Git=Object.prototype.toString,Wv=new zp;Wv.useLongestToken=!0;Wv.tokenize=EG.tokenize;Wv.castInput=function(e){var t=this.options,r=t.undefinedReplacement,s=t.stringifyReplacer,a=s===void 0?function(n,c){return typeof c>"u"?r:c}:s;return typeof e=="string"?e:JSON.stringify(gG(e,null,null,a),a," ")};Wv.equals=function(e,t){return zp.prototype.equals.call(Wv,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};mG=new zp;mG.tokenize=function(e){return e.slice()};mG.join=mG.removeEmpty=function(e){return e}});var QR,wde=Ze(()=>{Nc();QR=class{constructor(t){this.resolver=t}supportsDescriptor(t,r){return this.resolver.supportsDescriptor(t,r)}supportsLocator(t,r){return this.resolver.supportsLocator(t,r)}shouldPersistResolution(t,r){return this.resolver.shouldPersistResolution(t,r)}bindDescriptor(t,r,s){return this.resolver.bindDescriptor(t,r,s)}getResolutionDependencies(t,r){return this.resolver.getResolutionDependencies(t,r)}async getCandidates(t,r,s){throw new Lt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async getSatisfying(t,r,s,a){throw new Lt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async resolve(t,r){throw new Lt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}}});
Line truncated
|
||||
`;await ae.changeFilePromise(r,s,{automaticNewlines:!0}),this.manifest.raw=t}}});function Jit({project:e,allDescriptors:t,allResolutions:r,allPackages:s,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:c=new Map,peerWarnings:f=[],peerRequirementNodes:p=new Map,volatileDescriptors:h=new Set}){let E=new Map,C=[],S=new Map,x=new Map,I=new Map,R=new Map,N=new Map,U=new Map(e.workspaces.map(le=>{let ge=le.anchoredLocator.locatorHash,pe=s.get(ge);if(typeof pe>"u")throw new Error("Assertion failed: The workspace should have an associated package");return[ge,FB(pe)]})),K=()=>{let le=ae.mktempSync(),ge=Y.join(le,"stacktrace.log"),pe=String(C.length+1).length,De=C.map((ye,d)=>`${`${d+1}.`.padStart(pe," ")} ${ml(ye)}
|
||||
`).join("");throw ae.writeFileSync(ge,De),ae.detachTemp(le),new Lt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${Ae.fromPortablePath(ge)}`)},$=le=>{let ge=r.get(le.descriptorHash);if(typeof ge>"u")throw new Error("Assertion failed: The resolution should have been registered");let pe=s.get(ge);if(!pe)throw new Error("Assertion failed: The package could not be found");return pe},ie=(le,ge,pe,{top:De,optional:ye})=>{C.length>1e3&&K(),C.push(ge);let d=fe(le,ge,pe,{top:De,optional:ye});return C.pop(),d},fe=(le,ge,pe,{top:De,optional:ye})=>{if(ye||n.delete(ge.locatorHash),a.has(ge.locatorHash))return;a.add(ge.locatorHash);let d=s.get(ge.locatorHash);if(!d)throw new Error(`Assertion failed: The package (${Vr(e.configuration,ge)}) should have been registered`);let ve=new Set,Ie=new Map,me=[],ce=[],X=[],be=[];for(let ke of Array.from(d.dependencies.values())){if(d.peerDependencies.has(ke.identHash)&&d.locatorHash!==De)continue;if(Fp(ke))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");h.delete(ke.descriptorHash);let it=ye;if(!it){let Te=d.dependenciesMeta.get(fn(ke));if(typeof Te<"u"){let ct=Te.get(null);typeof ct<"u"&&ct.optional&&(it=!0)}}let _=r.get(ke.descriptorHash);if(!_)throw new Error(`Assertion failed: The resolution (${ai(e.configuration,ke)}) should have been registered`);let tt=U.get(_)||s.get(_);if(!tt)throw new Error(`Assertion failed: The package (${_}, resolved from ${ai(e.configuration,ke)}) should have been registered`);if(tt.peerDependencies.size===0){ie(ke,tt,new Map,{top:De,optional:it});continue}let Fe,Qe,Se=new Set,je=new Map;me.push(()=>{Fe=w8(ke,ge.locatorHash),Qe=B8(tt,ge.locatorHash),d.dependencies.set(ke.identHash,Fe),r.set(Fe.descriptorHash,Qe.locatorHash),t.set(Fe.descriptorHash,Fe),s.set(Qe.locatorHash,Qe),Qp(R,Qe.locatorHash).add(Fe.descriptorHash),ve.add(Qe.locatorHash)}),ce.push(()=>{N.set(Qe.locatorHash,je);for(let Te of Qe.peerDependencies.values()){let Me=$l(Ie,Te.identHash,()=>{let P=pe.get(Te.identHash)??null,w=d.dependencies.get(Te.identHash);return!w&&OB(ge,Te)&&(le.identHash===ge.identHash?w=le:(w=Un(ge,le.range),t.set(w.descriptorHash,w),r.set(w.descriptorHash,ge.locatorHash),h.delete(w.descriptorHash),P=null)),w||(w=Un(Te,"missing:")),{subject:ge,ident:Te,provided:w,root:!P,requests:new Map,hash:`p${As(ge.locatorHash,Te.identHash).slice(0,6)}`}}).provided;if(Me.range==="missing:"&&Qe.dependencies.has(Te.identHash)){Qe.peerDependencies.delete(Te.identHash);continue}if(je.set(Te.identHash,{requester:Qe,descriptor:Te,meta:Qe.peerDependenciesMeta.get(fn(Te)),children:new Map}),Qe.dependencies.set(Te.identHash,Me),Fp(Me)){let P=r.get(Me.descriptorHash);Qp(I,P).add(Qe.locatorHash)}S.set(Me.identHash,Me),Me.range==="missing:"&&Se.add(Me.identHash)}Qe.dependencies=new Map(Ks(Qe.dependencies,([Te,ct])=>fn(ct)))}),X.push(()=>{if(!s.has(Qe.locatorHash))return;let Te=E.get(tt.locatorHash);typeof Te=="number"&&Te>=2&&K();let ct=E.get(tt.locatorHash),Me=typeof ct<"u"?ct+1:1;E.set(tt.locatorHash,Me),ie(Fe,Qe,je,{top:De,optional:it}),E.set(tt.locatorHash,Me-1)}),be.push(()=>{let Te=r.get(Fe.descriptorHash);if(typeof Te>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let ct=N.get(Te);if(typeof ct>"u")throw new Error("Assertion failed: Expected the peer requests to be registered");for(let Me of Ie.values()){let P=ct.get(Me.ident.identHash);P&&(Me.requests.set(Fe.descriptorHash,P),p.set(Me.hash,Me),Me.root||pe.get(Me.ident.identHash)?.children.set(Fe.descriptorHash,P))}if(s.has(Qe.locatorHash))for(let Me of Se)Qe.dependencies.delete(Me)})}for(let ke of[...me,...ce])ke();for(let ke of ve){ve.delete(ke);let it=s.get(ke),_=As(aI(it).locatorHash,...Array.from(it.dependencies.values(),Se=>{let je=Se.range!=="missing:"?r.get(Se.descriptorHash):"missing:";if(typeof je>"u")throw new Error(`Assertion failed: Expected the resolution for ${ai(e.configuration,Se)} to have been registered`);return je===De?`${je} (top)`:je})),tt=x.get(_);if(typeof tt>"u"){x.set(_,it);continue}let Fe=Qp(R,tt.locatorHash);for(let Se of R.get(it.locatorHash)??[])r.set(Se,tt.locatorHash),Fe.add(Se);s.delete(it.locatorHash),a.delete(it.locatorHash),ve.delete(it.locatorHash);let Qe=I.get(it.locatorHash);if(Qe!==void 0){let Se=Qp(I,tt.locatorHash);for(let je of Qe)Se.add(je),ve.add(je)}}for(let ke of[...X,...be])ke()};for(let le of e.workspaces){let ge=le.anchoredLocator;h.delete(le.anchoredDescriptor.descriptorHash),ie(le.anchoredDescriptor,ge,new Map,{top:ge.locatorHash,optional:!1})}for(let le of p.values()){if(!le.root)continue;let ge=s.get(le.subject.locatorHash);if(typeof ge>"u")continue;for(let De of le.requests.values()){let ye=`p${As(le.subject.locatorHash,fn(le.ident),De.requester.locatorHash).slice(0,6)}`;c.set(ye,{subject:le.subject.locatorHash,requested:le.ident,rootRequester:De.requester.locatorHash,allRequesters:Array.from(HB(De),d=>d.requester.locatorHash)})}let pe=[...HB(le)];if(le.provided.range
Line truncated
|
||||
|
||||
${[C,S,x].join(`
|
||||
`)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let t=Y.join(this.cwd,yr.lockfile),r=this.configuration.get("defaultLanguageName");if(ae.existsSync(t)){let s=await ae.readFilePromise(t,"utf8");this.lockFileChecksum=Sde(s);let a=us(s);if(a.__metadata){let n=a.__metadata.version,c=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n<FR;for(let f of Object.keys(a)){if(f==="__metadata")continue;let p=a[f];if(typeof p.resolution>"u")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${f})`);let h=Np(p.resolution,!0),E=new _t;E.load(p,{yamlCompatibilityMode:!0});let C=E.version,S=E.languageName||r,x=p.linkType.toUpperCase(),I=p.conditions??null,R=E.dependencies,N=E.peerDependencies,U=E.dependenciesMeta,K=E.peerDependenciesMeta,$=E.bin;if(p.checksum!=null){let fe=typeof c<"u"&&!p.checksum.includes("/")?`${c}/${p.checksum}`:p.checksum;this.storedChecksums.set(h.locatorHash,fe)}let ie={...h,version:C,languageName:S,linkType:x,conditions:I,dependencies:R,peerDependencies:N,dependenciesMeta:U,peerDependenciesMeta:K,bin:$};this.originalPackages.set(ie.locatorHash,ie);for(let fe of f.split(Yit)){let le=Bd(fe);n<=6&&(le=this.configuration.normalizeDependency(le),le=Un(le,le.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,"$1npm%3A"))),this.storedDescriptors.set(le.descriptorHash,le),this.storedResolutions.set(le.descriptorHash,h.locatorHash)}}}else s.includes("yarn lockfile v1")&&(this.lockfileLastVersion=-1)}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let t=new Set,r=(0,RR.default)(4),s=async(a,n)=>{if(t.has(n))return a;t.add(n);let c=new qI(n,{project:this});await r(()=>c.setup());let f=a.then(()=>{this.addWorkspace(c)});return Array.from(c.workspacesCwds).reduce(s,f)};await s(Promise.resolve(),this.cwd)}addWorkspace(t){let r=this.workspacesByIdent.get(t.anchoredLocator.identHash);if(typeof r<"u")throw new Error(`Duplicate workspace name ${$i(this.configuration,t.anchoredLocator)}: ${Ae.fromPortablePath(t.cwd)} conflicts with ${Ae.fromPortablePath(r.cwd)}`);this.workspaces.push(t),this.workspacesByCwd.set(t.cwd,t),this.workspacesByIdent.set(t.anchoredLocator.identHash,t)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(t){Y.isAbsolute(t)||(t=Y.resolve(this.cwd,t)),t=Y.normalize(t).replace(/\/+$/,"");let r=this.workspacesByCwd.get(t);return r||null}getWorkspaceByCwd(t){let r=this.tryWorkspaceByCwd(t);if(!r)throw new Error(`Workspace not found (${t})`);return r}tryWorkspaceByFilePath(t){let r=null;for(let s of this.workspaces)Y.relative(s.cwd,t).startsWith("../")||r&&r.cwd.length>=s.cwd.length||(r=s);return r||null}getWorkspaceByFilePath(t){let r=this.tryWorkspaceByFilePath(t);if(!r)throw new Error(`Workspace not found (${t})`);return r}tryWorkspaceByIdent(t){let r=this.workspacesByIdent.get(t.identHash);return typeof r>"u"?null:r}getWorkspaceByIdent(t){let r=this.tryWorkspaceByIdent(t);if(!r)throw new Error(`Workspace not found (${$i(this.configuration,t)})`);return r}tryWorkspaceByDescriptor(t){if(t.range.startsWith(Ii.protocol)){let s=t.range.slice(Ii.protocol.length);if(s!=="^"&&s!=="~"&&s!=="*"&&!yl(s))return this.tryWorkspaceByCwd(s)}let r=this.tryWorkspaceByIdent(t);return r===null||(Fp(t)&&(t=NB(t)),!r.accepts(t.range))?null:r}getWorkspaceByDescriptor(t){let r=this.tryWorkspaceByDescriptor(t);if(r===null)throw new Error(`Workspace not found (${ai(this.configuration,t)})`);return r}tryWorkspaceByLocator(t){let r=this.tryWorkspaceByIdent(t);return r===null||(ju(t)&&(t=aI(t)),r.anchoredLocator.locatorHash!==t.locatorHash)?null:r}getWorkspaceByLocator(t){let r=this.tryWorkspaceByLocator(t);if(!r)throw new Error(`Workspace not found (${Vr(this.configuration,t)})`);return r}deleteDescriptor(t){this.storedResolutions.delete(t),this.storedDescriptors.delete(t)}deleteLocator(t){this.originalPackages.delete(t),this.storedPackages.delete(t),this.accessibleLocators.delete(t)}forgetResolution(t){if("descriptorHash"in t){let r=this.storedResolutions.get(t.descriptorHash);this.deleteDescriptor(t.descriptorHash);let s=new Set(this.storedResolutions.values());typeof r<"u"&&!s.has(r)&&this.deleteLocator(r)}if("locatorHash"in t){this.deleteLocator(t.locatorHash);for(let[r,s]of this.storedResolutions)s===t.locatorHash&&this.deleteDescriptor(r)}}forgetTransientResolutions(){let t=this.configuration.makeResolver(),r=new Map;for(let[s,a]of this.storedResolutions.entries()){let n=r.get(a);n||r.set(a,n=new Set),n.add(s)}for(let s of this.originalPackages.values()){let a;try{a=t.shouldPersistResolution(s,{project:this,resolver:t})}catch{a=!1}if(!a){this.deleteLocator(s.locatorHash);let n=r.get(s.locatorHash);if(n){r.delete(s.locatorHash);for(let c of n)this.deleteDescriptor(c)}}}}forgetVirtualResolutions(){for(let t of this.storedPackages.values())for(let[r,s]of t.dependencies)Fp(s)&&t.depLine truncated
|
||||
`;switch(tt.type){case 0:Fe+=`# Script name: ${tt.script}
|
||||
`;break;case 1:Fe+=`# Script code: ${tt.script}
|
||||
`;break}let Qe=null;if(!await ae.mktempPromise(async je=>{let Te=Y.join(je,"build.log"),{stdout:ct,stderr:Me}=this.configuration.getSubprocessStreams(Te,{header:Fe,prefix:Vr(this.configuration,X),report:r}),P;try{switch(tt.type){case 0:P=await HT(X,tt.script,[],{cwd:_,project:this,stdin:Qe,stdout:ct,stderr:Me});break;case 1:P=await Hj(X,tt.script,[],{cwd:_,project:this,stdin:Qe,stdout:ct,stderr:Me});break}}catch(y){Me.write(y.stack),P=1}if(ct.end(),Me.end(),P===0)return!0;ae.detachTemp(je);let w=`${Vr(this.configuration,X)} couldn't be built successfully (exit code ${Gt(this.configuration,P,dt.NUMBER)}, logs can be found here: ${Gt(this.configuration,Te,dt.PATH)})`,D=this.optionalBuilds.has(X.locatorHash);return D?r.reportInfo(9,w):r.reportError(9,w),Fpe&&r.reportFold(Ae.fromPortablePath(Te),ae.readFileSync(Te,"utf8")),D}))return!1}return!0});me.push(...it,Promise.allSettled(it).then(_=>{ie.delete(ce),_.every(tt=>tt.status==="fulfilled"&&tt.value===!0)&&ye.set(X.locatorHash,ke)}))}if(await Mu(me),Ie===ie.size){let ce=Array.from(ie).map(X=>{let be=this.storedPackages.get(X);if(!be)throw new Error("Assertion failed: The package should have been registered");return Vr(this.configuration,be)}).join(", ");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${ce})`);break}}this.storedBuildState=ye,this.skippedBuilds=N}async installWithNewReport(t,r){return(await Ft.start({configuration:this.configuration,json:t.json,stdout:t.stdout,forceSectionAlignment:!0,includeLogs:!t.json&&!t.quiet,includeVersion:!0},async a=>{await this.install({...r,report:a})})).exitCode()}async install(t){let r=this.configuration.get("nodeLinker");Je.telemetry?.reportInstall(r);let s=!1;if(await t.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{this.configuration.get("enableOfflineMode")&&t.report.reportWarning(90,"Offline work is enabled; Yarn won't fetch packages from the remote registry if it can avoid it"),await this.configuration.triggerHook(E=>E.validateProject,this,{reportWarning:(E,C)=>{t.report.reportWarning(E,C)},reportError:(E,C)=>{t.report.reportError(E,C),s=!0}})}),s)return;let a=await this.configuration.getPackageExtensions();for(let E of a.values())for(let[,C]of E)for(let S of C)S.status="inactive";let n=Y.join(this.cwd,yr.lockfile),c=null;if(t.immutable)try{c=await ae.readFilePromise(n,"utf8")}catch(E){throw E.code==="ENOENT"?new Lt(28,"The lockfile would have been created by this install, which is explicitly forbidden."):E}await t.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(t)}),await t.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{Zit(this,t.report);for(let[,E]of a)for(let[,C]of E)for(let S of C)if(S.userProvided){let x=Gt(this.configuration,S,dt.PACKAGE_EXTENSION);switch(S.status){case"inactive":t.report.reportWarning(68,`${x}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case"redundant":t.report.reportWarning(69,`${x}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(c!==null){let E=I0(c,this.generateLockfile());if(E!==c){let C=Cde(n,n,c,E,void 0,void 0,{maxEditLength:100});if(C){t.report.reportSeparator();for(let S of C.hunks){t.report.reportInfo(null,`@@ -${S.oldStart},${S.oldLines} +${S.newStart},${S.newLines} @@`);for(let x of S.lines)x.startsWith("+")?t.report.reportError(28,Gt(this.configuration,x,dt.ADDED)):x.startsWith("-")?t.report.reportError(28,Gt(this.configuration,x,dt.REMOVED)):t.report.reportInfo(null,Gt(this.configuration,x,"grey"))}t.report.reportSeparator()}throw new Lt(28,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let E of a.values())for(let[,C]of E)for(let S of C)S.userProvided&&S.status==="active"&&Je.telemetry?.reportPackageExtension(X0(S,dt.PACKAGE_EXTENSION));await t.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(t)});let f=t.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],p=await Promise.all(f.map(async E=>kQ(E,{cwd:this.cwd})));(typeof t.persistProject>"u"||t.persistProject)&&await this.persist(),await t.report.startTimerPromise("Link step",async()=>{if(t.mode==="update-lockfile"){t.report.reportWarning(73,`Skipped due to ${Gt(this.configuration,"mode=update-lockfile",dt.CODE)}`);return}await this.linkEverything(t);let E=await Promise.all(f.map(async C=>kQ(C,{cwd:this.cwd})));for(let C=0;C<f.length;++C)p[C]!==E[C]&&t.report.reportError(64,`The checksum for ${f[C]} has been modified by this install, which is explicitly forbidden.`)}),await this.persistInstallStateFile();let h=!1;await t.report.startTimerPromise("Post-install validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(E=>E.validateProjectAfterInstall,this,{reportWarning:(E,C)=>{t.report.r
Line truncated
|
||||
`,`# Manual changes might be lost - proceed with caution!
|
||||
`].join("")}
|
||||
`+Al(r)}async persistLockfile(){let t=Y.join(this.cwd,yr.lockfile),r="";try{r=await ae.readFilePromise(t,"utf8")}catch{}let s=this.generateLockfile(),a=I0(r,s);a!==r&&(await ae.writeFilePromise(t,a),this.lockFileChecksum=Sde(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let t=[];for(let c of Object.values(BG))t.push(...c);let r=z0(this,t),s=vG.default.serialize(r),a=As(s);if(this.installStateChecksum===a)return;let n=this.configuration.get("installStatePath");await ae.mkdirPromise(Y.dirname(n),{recursive:!0}),await ae.writeFilePromise(n,await Vit(s)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:t=!0,restoreResolutions:r=!0,restoreBuildState:s=!0}={}){let a=this.configuration.get("installStatePath"),n;try{let c=await Kit(await ae.readFilePromise(a));n=vG.default.deserialize(c),this.installStateChecksum=As(c)}catch{r&&await this.applyLightResolution();return}t&&typeof n.linkersCustomData<"u"&&(this.linkersCustomData=n.linkersCustomData),s&&Object.assign(this,z0(n,BG.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,z0(n,BG.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Qi}),await this.persistInstallStateFile()}async persist(){let t=(0,RR.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(r=>t(()=>r.persistManifest()))])}async cacheCleanup({cache:t,report:r}){if(this.configuration.get("enableGlobalCache"))return null;let s=new Set([".gitignore"]);if(!U8(t.cwd,this.cwd)||!await ae.existsPromise(t.cwd))return null;let a=[];for(let c of await ae.readdirPromise(t.cwd)){if(s.has(c))continue;let f=Y.resolve(t.cwd,c);t.markedFiles.has(f)||(t.immutable?r.reportError(56,`${Gt(this.configuration,Y.basename(f),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(ae.lstatPromise(f).then(async p=>(await ae.removePromise(f),p.size))))}if(a.length===0)return null;let n=await Promise.all(a);return{count:a.length,size:n.reduce((c,f)=>c+f,0)}}}});function Xit(e){let s=Math.floor(e.timeNow/864e5),a=e.updateInterval*864e5,n=e.state.lastUpdate??e.timeNow+a+Math.floor(a*e.randomInitialInterval),c=n+a,f=e.state.lastTips??s*864e5,p=f+864e5+8*36e5-e.timeZone,h=c<=e.timeNow,E=p<=e.timeNow,C=null;return(h||E||!e.state.lastUpdate||!e.state.lastTips)&&(C={},C.lastUpdate=h?e.timeNow:n,C.lastTips=f,C.blocks=h?{}:e.state.blocks,C.displayedTips=e.state.displayedTips),{nextState:C,triggerUpdate:h,triggerTips:E,nextTips:E?s*864e5:f}}var YI,Pde=Ze(()=>{bt();dv();wd();mT();Qc();Lp();YI=class{constructor(t,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.nextTips=0;this.displayedTips=[];this.shouldCommitTips=!1;this.configuration=t;let s=this.getRegistryPath();this.isNew=!ae.existsSync(s),this.shouldShowTips=!1,this.sendReport(r),this.startBuffer()}commitTips(){this.shouldShowTips&&(this.shouldCommitTips=!0)}selectTip(t){let r=new Set(this.displayedTips),s=f=>f&&An?rA(An,f):!1,a=t.map((f,p)=>p).filter(f=>t[f]&&s(t[f]?.selector));if(a.length===0)return null;let n=a.filter(f=>!r.has(f));if(n.length===0){let f=Math.floor(a.length*.2);this.displayedTips=f>0?this.displayedTips.slice(-f):[],n=a.filter(p=>!r.has(p))}let c=n[Math.floor(Math.random()*n.length)];return this.displayedTips.push(c),this.commitTips(),t[c]}reportVersion(t){this.reportValue("version",t.replace(/-git\..*/,"-git"))}reportCommandName(t){this.reportValue("commandName",t||"<none>")}reportPluginName(t){this.reportValue("pluginName",t)}reportProject(t){this.reportEnumerator("projectCount",t)}reportInstall(t){this.reportHit("installCount",t)}reportPackageExtension(t){this.reportValue("packageExtension",t)}reportWorkspaceCount(t){this.reportValue("workspaceCount",String(t))}reportDependencyCount(t){this.reportValue("dependencyCount",String(t))}reportValue(t,r){Qp(this.values,t).add(r)}reportEnumerator(t,r){Qp(this.enumerators,t).add(As(r))}reportHit(t,r="*"){let s=L4(this.hits,t),a=$l(s,r,()=>0);s.set(r,a+1)}getRegistryPath(){let t=this.configuration.get("globalFolder");return Y.join(t,"telemetry.json")}sendReport(t){let r=this.getRegistryPath(),s;try{s=ae.readJsonSync(r)}catch{s={}}let{nextState:a,triggerUpdate:n,triggerTips:c,nextTips:f}=Xit({state:s,timeNow:Date.now(),timeZone:new Date().getTimezoneOffset()*60*1e3,randomInitialInterval:Math.random(),updateInterval:this.configuration.get("telemetryInterval")});if(this.nextTips=f,this.displayedTips=s.displayedTips??[],a!==null)try{ae.mkdirSync(Y.dirname(r),{recursive:!0}),ae.writeJsonSync(r,a)}catch{return!1}if(c&&this.configuration.get("enableTips")&&(this.shouldShowTips=!0),n){let p=s.blocks??{};if(Object.keys(p).length===0){let h=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${t}?ddsource=yarn`,E=C=>ij(h,C,{configuration:this.configuration}).catch(()=>{});for(let[C,S]of Object.entries(s.blocks??{})){if(Object.keys(S).length===0)continue;let x=S;x
Line truncated
|
||||
`),h=c.length;for(h>0&&c.includes("unstyle")&&(c=[...new Set(["unstyle",...c])].reverse());h-- >0;)f=r(e.styles[c[h]],f,p);return f},a=(n,c,f)=>{e.styles[n]=t({name:n,codes:c}),(e.keys[f]||(e.keys[f]=[])).push(n),Reflect.defineProperty(e,n,{configurable:!0,enumerable:!0,set(h){e.alias(n,h)},get(){let h=E=>s(E,h.stack);return Reflect.setPrototypeOf(h,e),h.stack=this.stack?this.stack.concat(n):[n],h}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=nst,e.hasColor=e.hasAnsi=n=>(e.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&e.ansiRegex.test(n)),e.alias=(n,c)=>{let f=typeof c=="string"?e[c]:c;if(typeof f!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");f.stack||(Reflect.defineProperty(f,"name",{value:n}),e.styles[n]=f,f.stack=[n]),Reflect.defineProperty(e,n,{configurable:!0,enumerable:!0,set(p){e.alias(n,p)},get(){let p=h=>s(h,p.stack);return Reflect.setPrototypeOf(p,e),p.stack=this.stack?this.stack.concat(f.stack):f.stack,p}})},e.theme=n=>{if(!rst(n))throw new TypeError("Expected theme to be an object");for(let c of Object.keys(n))e.alias(c,n[c]);return e},e.alias("unstyle",n=>typeof n=="string"&&n!==""?(e.ansiRegex.lastIndex=0,n.replace(e.ansiRegex,"")):""),e.alias("noop",n=>n),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=Fde(),e.define=a,e};PG.exports=Nde();PG.exports.create=Nde});var ia=G(hn=>{"use strict";var ist=Object.prototype.toString,jc=Zu(),Ode=!1,xG=[],Lde={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};hn.longest=(e,t)=>e.reduce((r,s)=>Math.max(r,t?s[t].length:s.length),0);hn.hasColor=e=>!!e&&jc.hasColor(e);var LR=hn.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);hn.nativeType=e=>ist.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"");hn.isAsyncFn=e=>hn.nativeType(e)==="asyncfunction";hn.isPrimitive=e=>e!=null&&typeof e!="object"&&typeof e!="function";hn.resolve=(e,t,...r)=>typeof t=="function"?t.call(e,...r):t;hn.scrollDown=(e=[])=>[...e.slice(1),e[0]];hn.scrollUp=(e=[])=>[e.pop(),...e];hn.reorder=(e=[])=>{let t=e.slice();return t.sort((r,s)=>r.index>s.index?1:r.index<s.index?-1:0),t};hn.swap=(e,t,r)=>{let s=e.length,a=r===s?0:r<0?s-1:r,n=e[t];e[t]=e[a],e[a]=n};hn.width=(e,t=80)=>{let r=e&&e.columns?e.columns:t;return e&&typeof e.getWindowSize=="function"&&(r=e.getWindowSize()[0]),process.platform==="win32"?r-1:r};hn.height=(e,t=20)=>{let r=e&&e.rows?e.rows:t;return e&&typeof e.getWindowSize=="function"&&(r=e.getWindowSize()[1]),r};hn.wordWrap=(e,t={})=>{if(!e)return e;typeof t=="number"&&(t={width:t});let{indent:r="",newline:s=`
|
||||
`+r,width:a=80}=t,n=(s+r).match(/[^\S\n]/g)||[];a-=n.length;let c=`.{1,${a}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,f=e.trim(),p=new RegExp(c,"g"),h=f.match(p)||[];return h=h.map(E=>E.replace(/\n$/,"")),t.padEnd&&(h=h.map(E=>E.padEnd(a," "))),t.padStart&&(h=h.map(E=>E.padStart(a," "))),r+h.join(s)};hn.unmute=e=>{let t=e.stack.find(s=>jc.keys.color.includes(s));return t?jc[t]:e.stack.find(s=>s.slice(2)==="bg")?jc[t.slice(2)]:s=>s};hn.pascal=e=>e?e[0].toUpperCase()+e.slice(1):"";hn.inverse=e=>{if(!e||!e.stack)return e;let t=e.stack.find(s=>jc.keys.color.includes(s));if(t){let s=jc["bg"+hn.pascal(t)];return s?s.black:e}let r=e.stack.find(s=>s.slice(0,2)==="bg");return r?jc[r.slice(2).toLowerCase()]||e:jc.none};hn.complement=e=>{if(!e||!e.stack)return e;let t=e.stack.find(s=>jc.keys.color.includes(s)),r=e.stack.find(s=>s.slice(0,2)==="bg");if(t&&!r)return jc[Lde[t]||t];if(r){let s=r.slice(2).toLowerCase(),a=Lde[s];return a&&jc["bg"+hn.pascal(a)]||e}return jc.none};hn.meridiem=e=>{let t=e.getHours(),r=e.getMinutes(),s=t>=12?"pm":"am";t=t%12;let a=t===0?12:t,n=r<10?"0"+r:r;return a+":"+n+" "+s};hn.set=(e={},t="",r)=>t.split(".").reduce((s,a,n,c)=>{let f=c.length-1>n?s[a]||{}:r;return!hn.isObject(f)&&n<c.length-1&&(f={}),s[a]=f},e);hn.get=(e={},t="",r)=>{let s=e[t]==null?t.split(".").reduce((a,n)=>a&&a[n],e):e[t];return s??r};hn.mixin=(e,t)=>{if(!LR(e))return t;if(!LR(t))return e;for(let r of Object.keys(t)){let s=Object.getOwnPropertyDescriptor(t,r);if(s.hasOwnProperty("value"))if(e.hasOwnProperty(r)&&LR(s.value)){let a=Object.getOwnPropertyDescriptor(e,r);LR(a.value)?e[r]=hn.merge({},e[r],t[r]):Reflect.defineProperty(e,r,s)}else Reflect.defineProperty(e,r,s);else Reflect.defineProperty(e,r,s)}return e};hn.merge=(...e)=>{let t={};for(let r of e)hn.mixin(t,r);return t};hn.mixinEmitter=(e,t)=>{let r=t.constructor.prototype;for(let s of Object.keys(r)){let a=r[s];typeof a=="function"?hn.define(e,s,a.bind(t)):hn.define(e,s,a)}};hn.onExit=e=>{let t=(r,s)=>{Ode||(Ode=!0,xG.forEach(a=>a()),r===!0&&process.exit(128+s))};xG.length===0&&(process.once("SIGTERM",t.bind(null,!0,15)),process.once("SIGINT",t.bind(null,!0,2)),process.once("exit",t)),xG.push(e)};hn.define=(e,t,r)=>{Reflect.defineProperty(e,t,{value:r})};hn.defineExport=(e,t,r)=>{let s;Reflect.defineProperty(e,t,{enumerable:!0,configurable:!0,set(a){s=a},get(){return s?s():r()}})}});var Mde=G(JI=>{"use strict";JI.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};JI.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};JI.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};JI.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};JI.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var Hde=G((O3t,_de)=>{"use strict";var Ude=Ce("readline"),sst=Mde(),ost=/^(?:\x1b)([a-zA-Z0-9])$/,ast=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,lst={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function cst(e){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(e)}function ust(e){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(e)}var MR=(e="",t={})=>{let r,s={name:t.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:e,raw:e,...t};if(Buffer.isBuffer(e)?e[0]>127&&e[1]===void 0?(e[0]-=128,e="\x1B"+String(e)):e=String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e=s.sequence||""),s.sequence=s.sequence||e||s.name,e==="\r")s.raw=void 0,s.name="return";else if(e===`
|
||||
`)s.name="enter";else if(e===" ")s.name="tab";else if(e==="\b"||e==="\x7F"||e==="\x1B\x7F"||e==="\x1B\b")s.name="backspace",s.meta=e.charAt(0)==="\x1B";else if(e==="\x1B"||e==="\x1B\x1B")s.name="escape",s.meta=e.length===2;else if(e===" "||e==="\x1B ")s.name="space",s.meta=e.length===2;else if(e<="")s.name=String.fromCharCode(e.charCodeAt(0)+97-1),s.ctrl=!0;else if(e.length===1&&e>="0"&&e<="9")s.name="number";else if(e.length===1&&e>="a"&&e<="z")s.name=e;else if(e.length===1&&e>="A"&&e<="Z")s.name=e.toLowerCase(),s.shift=!0;else if(r=ost.exec(e))s.meta=!0,s.shift=/^[A-Z]$/.test(r[1]);else if(r=ast.exec(e)){let a=[...e];a[0]==="\x1B"&&a[1]==="\x1B"&&(s.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),c=(r[3]||r[5]||1)-1;s.ctrl=!!(c&4),s.meta=!!(c&10),s.shift=!!(c&1),s.code=n,s.name=lst[n],s.shift=cst(n)||s.shift,s.ctrl=ust(n)||s.ctrl}return s};MR.listen=(e={},t)=>{let{stdin:r}=e;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let s=Ude.createInterface({terminal:!0,input:r});Ude.emitKeypressEvents(r,s);let a=(f,p)=>t(f,MR(f,p),s),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",a),s.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener("keypress",a),s.pause(),s.close()}};MR.action=(e,t,r)=>{let s={...sst,...r};return t.ctrl?(t.action=s.ctrl[t.name],t):t.option&&s.option?(t.action=s.option[t.name],t):t.shift?(t.action=s.shift[t.name],t):(t.action=s.keys[t.name],t)};_de.exports=MR});var Gde=G((L3t,jde)=>{"use strict";jde.exports=e=>{e.timers=e.timers||{};let t=e.options.timers;if(t)for(let r of Object.keys(t)){let s=t[r];typeof s=="number"&&(s={interval:s}),fst(e,r,s)}};function fst(e,t,r={}){let s=e.timers[t]={name:t,start:Date.now(),ms:0,tick:0},a=r.interval||120;s.frames=r.frames||[],s.loading=!0;let n=setInterval(()=>{s.ms=Date.now()-s.start,s.tick++,e.render()},a);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),e.once("close",()=>s.stop()),s.stop}});var Yde=G((M3t,qde)=>{"use strict";var{define:Ast,width:pst}=ia(),kG=class{constructor(t){let r=t.options;Ast(this,"_prompt",t),this.type=t.type,this.name=t.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=pst(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=t.symbols,this.styles=t.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let t={...this};return t.status=this.status,t.buffer=Buffer.from(t.buffer),delete t.clone,t}set color(t){this._color=t}get color(){let t=this.prompt.styles;if(this.cancelled)return t.cancelled;if(this.submitted)return t.submitted;let r=this._color||t[this.status];return typeof r=="function"?r:t.pending}set loading(t){this._loading=t}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};qde.exports=kG});var Vde=G((U3t,Wde)=>{"use strict";var QG=ia(),wo=Zu(),TG={default:wo.noop,noop:wo.noop,set inverse(e){this._inverse=e},get inverse(){return this._inverse||QG.inverse(this.primary)},set complement(e){this._complement=e},get complement(){return this._complement||QG.complement(this.primary)},primary:wo.cyan,success:wo.green,danger:wo.magenta,strong:wo.bold,warning:wo.yellow,muted:wo.dim,disabled:wo.gray,dark:wo.dim.gray,underline:wo.underline,set info(e){this._info=e},get info(){return this._info||this.primary},set em(e){this._em=e},get em(){return this._em||this.primary.underline},set heading(e){this._heading=e},get heading(){return this._heading||this.muted.underline},set pending(e){this._pending=e},get pending(){return this._pending||this.primary},set submitted(e){this._submitted=e},get submitted(){return this._submitted||this.success},set cancelled(e){this._cancelled=e},get cancelled(){return this._cancelled||this.danger},set typing(e){this._typing=e},get typing(){return this._typing||this.dim},set placeholder(e){this._placeholder=e},get placeholder(){return this._placeholder||this.primary.dim},set highlight(e){this._highlight=e},get highlight(){return this._highlight||this.inverse}};TG.merge=(e={})=>{e.styles&&typeof e.styles.enabled=="boolean"&&(wo.enabled=e.styles.enabled),e.styles&&typeof e.styles.visible=="boolean"&&(wo.visible=e.styles.visible);let t=QG.merge({},TG,e.styles);delete t.merge;for(let r of Object.keys(wo))t.hasOwnProperty(r)||Reflect.defineProperty(t,r,{get:()=>wo[r]});for(let r of Object.keys(wo.styles))t.hasOwnProperty(r)||Reflect.defineProperty(t,r,{get:()=>wo[r]});return t};Wde.exports=TG});var Jde=G((_3t,Kde)=>{"use strict";var RG=process.platform==="win32",Zp=Zu(),hst=ia(),FG={...Zp.symbols,upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301",
Line truncated
|
||||
`),h=p[0],E=p[p.length-1],S=(s+(r?" "+r:"")).length,x=S<h.length?h.slice(S+1):"";return{header:c,prompt:h,after:x,rest:p.slice(1),last:E}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let t=this.state.error||await this.validate(this.value,this.state);if(t!==!0){let r=`
|
||||
`+this.symbols.pointer+" ";typeof t=="string"?r+=t.trim():r+="Invalid input",this.state.error=`
|
||||
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(t){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(t))}async close(){this.state.closed=!0;try{let t=this.sections(),r=Math.ceil(t.prompt.length/this.width);t.rest&&this.write(xm.cursor.down(t.rest.length)),this.write(`
|
||||
`.repeat(r))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=MG.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:t,options:r,result:s}=this;if(this.format=()=>t.call(this,this.value),this.result=()=>s.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(t,r)=>{if(this.once("submit",t),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(t,r,s){let{options:a,state:n,symbols:c,timers:f}=this,p=f&&f[t];n.timer=p;let h=a[t]||n[t]||c[t],E=r&&r[t]!=null?r[t]:await h;if(E==="")return E;let C=await this.resolve(E,n,r,s);return!C&&r&&r[t]?this.resolve(h,n,r,s):C}async prefix(){let t=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,s=this.state;return s.timer=r,Cl.isObject(t)&&(t=t[s.status]||t.pending),Cl.hasColor(t)?t:(this.styles[s.status]||this.styles.pending)(t)}async message(){let t=await this.element("message");return Cl.hasColor(t)?t:this.styles.strong(t)}async separator(){let t=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,s=this.state;s.timer=r;let a=t[s.status]||t.pending||s.separator,n=await this.resolve(a,s);return Cl.isObject(n)&&(n=n[s.status]||n.pending),Cl.hasColor(n)?n:this.styles.muted(n)}async pointer(t,r){let s=await this.element("pointer",t,r);if(typeof s=="string"&&Cl.hasColor(s))return s;if(s){let a=this.styles,n=this.index===r,c=n?a.primary:h=>h,f=await this.resolve(s[n?"on":"off"]||s,this.state),p=Cl.hasColor(f)?f:c(f);return n?p:" ".repeat(f.length)}}async indicator(t,r){let s=await this.element("indicator",t,r);if(typeof s=="string"&&Cl.hasColor(s))return s;if(s){let a=this.styles,n=t.enabled===!0,c=n?a.success:a.dark,f=s[n?"on":"off"]||s;return Cl.hasColor(f)?f:c(f)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let t=await this.element("hint");return Cl.hasColor(t)?t:this.styles.muted(t)}}error(t){return this.state.submitted?"":t||this.state.error}format(t){return t}result(t){return t}validate(t){return this.options.required===!0?this.isValue(t):!0}isValue(t){return t!=null&&t!==""}resolve(t,...r){return Cl.resolve(this,t,...r)}get base(){return e.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Cl.height(this.stdout,25)}get width(){return this.options.columns||Cl.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(t){this.state.cursor=t}get cursor(){return this.state.cursor}set input(t){this.state.input=t}get input(){return this.state.input}set value(t){this.state.value=t}get value(){let{input:t,value:r}=this.state,s=[r,t].find(this.isValue.bind(this));return this.isValue(s)?s:this.initial}static get prompt(){return t=>new this(t).run()}};function Bst(e){let t=a=>e[a]===void 0||typeof e[a]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let a of Object.keys(e.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=e.options[a];typeof n=="function"&&t(a)?s.includes(a)||(e[a]=n.bind(e)):typeof e[a]!="function"&&(e[a]=n)}}function vst(e){typeof e=="number"&&(e=[e,e,e,e]);let t=[].concat(e||[]),r=a=>a%2===0?`
|
||||
`:" ",s=[];for(let a=0;a<4;a++){let n=r(a);t[a]?s.push(n.repeat(t[a])):s.push("")}return s}ige.exports=UG});var age=G((G3t,oge)=>{"use strict";var Sst=ia(),sge={default(e,t){return t},checkbox(e,t){throw new Error("checkbox role is not implemented yet")},editable(e,t){throw new Error("editable role is not implemented yet")},expandable(e,t){throw new Error("expandable role is not implemented yet")},heading(e,t){return t.disabled="",t.indicator=[t.indicator," "].find(r=>r!=null),t.message=t.message||"",t},input(e,t){throw new Error("input role is not implemented yet")},option(e,t){return sge.default(e,t)},radio(e,t){throw new Error("radio role is not implemented yet")},separator(e,t){return t.disabled="",t.indicator=[t.indicator," "].find(r=>r!=null),t.message=t.message||e.symbols.line.repeat(5),t},spacer(e,t){return t}};oge.exports=(e,t={})=>{let r=Sst.merge({},sge,t.roles);return r[e]||r.default}});var zv=G((q3t,uge)=>{"use strict";var bst=Zu(),Dst=zI(),Pst=age(),UR=ia(),{reorder:_G,scrollUp:xst,scrollDown:kst,isObject:lge,swap:Qst}=UR,HG=class extends Dst{constructor(t){super(t),this.cursorHide(),this.maxSelected=t.maxSelected||1/0,this.multiple=t.multiple||!1,this.initial=t.initial||0,this.delay=t.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:t,initial:r,autofocus:s,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(t)),this.choices.forEach(n=>n.enabled=!1),typeof a!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");lge(r)&&(r=Object.keys(r)),Array.isArray(r)?(s!=null&&(this.index=this.findIndex(s)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(s!=null&&(r=s),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(t,r){this.state.loadingChoices=!0;let s=[],a=0,n=async(c,f)=>{typeof c=="function"&&(c=await c.call(this)),c instanceof Promise&&(c=await c);for(let p=0;p<c.length;p++){let h=c[p]=await this.toChoice(c[p],a++,f);s.push(h),h.choices&&await n(h.choices,h)}return s};return n(t,r).then(c=>(this.state.loadingChoices=!1,c))}async toChoice(t,r,s){if(typeof t=="function"&&(t=await t.call(this,this)),t instanceof Promise&&(t=await t),typeof t=="string"&&(t={name:t}),t.normalized)return t;t.normalized=!0;let a=t.value;if(t=Pst(t.role,this.options)(this,t),typeof t.disabled=="string"&&!t.hint&&(t.hint=t.disabled,t.disabled=!0),t.disabled===!0&&t.hint==null&&(t.hint="(disabled)"),t.index!=null)return t;t.name=t.name||t.key||t.title||t.value||t.message,t.message=t.message||t.name||"",t.value=[t.value,t.name].find(this.isValue.bind(this)),t.input="",t.index=r,t.cursor=0,UR.define(t,"parent",s),t.level=s?s.level+1:1,t.indent==null&&(t.indent=s?s.indent+" ":t.indent||""),t.path=s?s.path+"."+t.name:t.name,t.enabled=!!(this.multiple&&!this.isDisabled(t)&&(t.enabled||this.isSelected(t))),this.isDisabled(t)||(this.longest=Math.max(this.longest,bst.unstyle(t.message).length));let c={...t};return t.reset=(f=c.input,p=c.value)=>{for(let h of Object.keys(c))t[h]=c[h];t.input=f,t.value=p},a==null&&typeof t.initial=="function"&&(t.input=await t.initial.call(this,this.state,t,r)),t}async onChoice(t,r){this.emit("choice",t,r,this),typeof t.onChoice=="function"&&await t.onChoice.call(this,this.state,t,r)}async addChoice(t,r,s){let a=await this.toChoice(t,r,s);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(t,r,s){let a={name:"New choice name?",editable:!0,newChoice:!0,...t},n=await this.addChoice(a,r,s);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(t){return t.indent==null?t.level>1?" ".repeat(t.level-1):"":t.indent}dispatch(t,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(t,r){return typeof r!="boolean"&&(r=t.enabled),r&&!t.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=t.index,t.enabled=r&&!this.isDisabled(t),t)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelected<this.choices.length)return this.alert();let t=this.selectable.every(r=>r.enabled);return this.choices.forEach(r=>r.enabled=!t),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(t=>t.enabled=!t.enabled),this.render())}g(t=this.focused){return this.choices.some(r=>!!r.parent)?(this.toggle(t.parent&&!t.choices?t.parent:t),this.render()):this.a()}toggle(t,r){if(!t.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!="boolean"&&(r=!t.enabled),t.enabled=r,t.choices&&t.
Line truncated
|
||||
`),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,s].filter(Boolean).join(`
|
||||
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(t=>this.styles.primary(t.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:t,size:r}=this.state,s="",a=await this.header(),n=await this.prefix(),c=await this.separator(),f=await this.message();this.options.promptLine!==!1&&(s=[n,f,c,""].join(" "),this.state.prompt=s);let p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();p&&(s+=p),h&&!s.includes(h)&&(s+=" "+h),t&&!p&&!E.trim()&&this.multiple&&this.emptyError!=null&&(s+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,s,E,C].filter(Boolean).join(`
|
||||
`)),this.write(this.margin[2]),this.restore()}};fge.exports=GG});var pge=G((W3t,Age)=>{"use strict";var Rst=Yd(),Fst=(e,t)=>{let r=e.toLowerCase();return s=>{let n=s.toLowerCase().indexOf(r),c=t(s.slice(n,n+r.length));return n>=0?s.slice(0,n)+c+s.slice(n+r.length):s}},qG=class extends Rst{constructor(t){super(t),this.cursorShow()}moveCursor(t){this.state.cursor+=t}dispatch(t){return this.append(t)}space(t){return this.options.multiple?super.space(t):this.append(t)}append(t){let{cursor:r,input:s}=this.state;return this.input=s.slice(0,r)+t+s.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:t,input:r}=this.state;return r?(this.input=r.slice(0,t-1)+r.slice(t),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:t,input:r}=this.state;return r[t]===void 0?this.alert():(this.input=`${r}`.slice(0,t)+`${r}`.slice(t+1),this.complete())}number(t){return this.append(t)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(t=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,t,r);let s=t.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(s))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(t=>this.styles.primary(t.message)).join(", ");if(this.state.submitted){let t=this.value=this.input=this.focused.value;return this.styles.primary(t)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let t=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=Fst(this.input,t),s=this.choices;this.choices=s.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=s}submit(){return this.options.multiple&&(this.value=this.selected.map(t=>t.name)),super.submit()}};Age.exports=qG});var WG=G((V3t,hge)=>{"use strict";var YG=ia();hge.exports=(e,t={})=>{e.cursorHide();let{input:r="",initial:s="",pos:a,showCursor:n=!0,color:c}=t,f=c||e.styles.placeholder,p=YG.inverse(e.styles.primary),h=R=>p(e.styles.black(R)),E=r,C=" ",S=h(C);if(e.blink&&e.blink.off===!0&&(h=R=>R,S=""),n&&a===0&&s===""&&r==="")return h(C);if(n&&a===0&&(r===s||r===""))return h(s[0])+f(s.slice(1));s=YG.isPrimitive(s)?`${s}`:"",r=YG.isPrimitive(r)?`${r}`:"";let x=s&&s.startsWith(r)&&s!==r,I=x?h(s[r.length]):S;if(a!==r.length&&n===!0&&(E=r.slice(0,a)+h(r[a])+r.slice(a+1),I=""),n===!1&&(I=""),x){let R=e.styles.unstyle(E+I);return E+I+f(s.slice(R.length))}return E+I}});var _R=G((K3t,dge)=>{"use strict";var Nst=Zu(),Ost=Yd(),Lst=WG(),VG=class extends Ost{constructor(t){super({...t,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(t){return await super.reset(),t===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(t){return!!t&&this.append(t)}append(t){let r=this.focused;if(!r)return this.alert();let{cursor:s,input:a}=r;return r.value=r.input=a.slice(0,s)+t+a.slice(s),r.cursor++,this.render()}delete(){let t=this.focused;if(!t||t.cursor<=0)return this.alert();let{cursor:r,input:s}=t;return t.value=t.input=s.slice(0,r-1)+s.slice(r),t.cursor--,this.render()}deleteForward(){let t=this.focused;if(!t)return this.alert();let{cursor:r,input:s}=t;if(s[r]===void 0)return this.alert();let a=`${s}`.slice(0,r)+`${s}`.slice(r+1);return t.value=t.input=a,this.render()}right(){let t=this.focused;return t?t.cursor>=t.input.length?this.alert():(t.cursor++,this.render()):this.alert()}left(){let t=this.focused;return t?t.cursor<=0?this.alert():(t.cursor--,this.render()):this.alert()}space(t,r){return this.dispatch(t,r)}number(t,r){return this.dispatch(t,r)}next(){let t=this.focused;if(!t)return this.alert();let{initial:r,input:s}=t;return r&&r.startsWith(s)&&s!==r?(t.value=t.input=r,t.cursor=t.value.length,this.render()):super.next()}prev(){let t=this.focused;return t?t.cursor===0?super.prev():(t.value=t.input="",t.cursor=0,this.render()):this.alert()}separator(){return""}format(t){return this.state.submitted?"":super.format(t)}pointer(){return""}indicator(t){return t.input?"\u29BF":"\u2299"}async choiceSeparator(t,r){let s=await this.resolve(t.separator,this.state,t,r)||":";return s?" "+this.styles.disabled(s):""}async renderChoice(t,r){await this.onChoice(t,r);let{state:s,styles:a}=this,{cursor:n,initial:c="",name:f,hint:p,input:h=""}=t,{muted:E,submitted:C,primary:S,danger:x}=a,I=p,R=this.index===r,N=t.validate||(()=>!0),U=await this.choiceSeparator(t,r),K=t.message;this.align==="right"&&(K=K.padStart(this.longest+1," ")),this.align==="left"&&(K=K.padEnd(this.longest+1," "));let $=this.values[f]=h||c,ie=h?"success":"dark";await N.call(t,$,this.
Line truncated
|
||||
`)),this.restore()}set value(t){super.value=t}get value(){return this.cast(super.value)}};Cge.exports=JG});var Bge=G((X3t,wge)=>{"use strict";var Yst=HR(),zG=class extends Yst{constructor(t){super(t),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};wge.exports=zG});var Sge=G(($3t,vge)=>{"use strict";var Wst=Yd(),Vst=_R(),ZI=Vst.prototype,ZG=class extends Wst{constructor(t){super({...t,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(t,r){let s=this.focused,a=s.parent||{};return!s.editable&&!a.editable&&(t==="a"||t==="i")?super[t]():ZI.dispatch.call(this,t,r)}append(t,r){return ZI.append.call(this,t,r)}delete(t,r){return ZI.delete.call(this,t,r)}space(t){return this.focused.editable?this.append(t):super.space()}number(t){return this.focused.editable?this.append(t):super.number(t)}next(){return this.focused.editable?ZI.next.call(this):super.next()}prev(){return this.focused.editable?ZI.prev.call(this):super.prev()}async indicator(t,r){let s=t.indicator||"",a=t.editable?s:super.indicator(t,r);return await this.resolve(a,this.state,t,r)||""}indent(t){return t.role==="heading"?"":t.editable?" ":" "}async renderChoice(t,r){return t.indent="",t.editable?ZI.renderChoice.call(this,t,r):super.renderChoice(t,r)}error(){return""}footer(){return this.state.error}async validate(){let t=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let s=r.parent?this.value[r.parent.name]:this.value;if(r.editable?s=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(s=r.enabled===!0),t=await r.validate(s,this.state),t!==!0)break}return t!==!0&&(this.state.error=typeof t=="string"?t:"Invalid Input"),t}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(t=>t.newChoice))return this.alert();this.value={};for(let t of this.choices){let r=t.parent?this.value[t.parent.name]:this.value;if(t.role==="heading"){this.value[t.name]={};continue}t.editable?r[t.name]=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(r[t.name]=t.enabled===!0)}return this.base.submit.call(this)}};vge.exports=ZG});var km=G((e8t,bge)=>{"use strict";var Kst=zI(),Jst=WG(),{isPrimitive:zst}=ia(),XG=class extends Kst{constructor(t){super(t),this.initial=zst(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(t,r={}){let s=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!s||s.name!=="return")?this.append(`
|
||||
`,r):super.keypress(t,r)}moveCursor(t){this.cursor+=t}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(t,r){if(!t||r.ctrl||r.code)return this.alert();this.append(t)}append(t){let{cursor:r,input:s}=this.state;this.input=`${s}`.slice(0,r)+t+`${s}`.slice(r),this.moveCursor(String(t).length),this.render()}insert(t){this.append(t)}delete(){let{cursor:t,input:r}=this.state;if(t<=0)return this.alert();this.input=`${r}`.slice(0,t-1)+`${r}`.slice(t),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:t,input:r}=this.state;if(r[t]===void 0)return this.alert();this.input=`${r}`.slice(0,t)+`${r}`.slice(t+1),this.render()}cutForward(){let t=this.cursor;if(this.input.length<=t)return this.alert();this.state.clipboard.push(this.input.slice(t)),this.input=this.input.slice(0,t),this.render()}cutLeft(){let t=this.cursor;if(t===0)return this.alert();let r=this.input.slice(0,t),s=this.input.slice(t),a=r.split(" ");this.state.clipboard.push(a.pop()),this.input=a.join(" "),this.cursor=this.input.length,this.input+=s,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let t=this.initial!=null?String(this.initial):"";if(!t||!t.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(t){return!!t}async format(t=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(t||r):Jst(this,{input:t,initial:r,pos:this.cursor})}async render(){let t=this.state.size,r=await this.prefix(),s=await this.separator(),a=await this.message(),n=[r,a,s].filter(Boolean).join(" ");this.state.prompt=n;let c=await this.header(),f=await this.format(),p=await this.error()||await this.hint(),h=await this.footer();p&&!f.includes(p)&&(f+=" "+p),n+=" "+f,this.clear(t),this.write([c,n,h].filter(Boolean).join(`
|
||||
`)),this.restore()}};bge.exports=XG});var Pge=G((t8t,Dge)=>{"use strict";var Zst=e=>e.filter((t,r)=>e.lastIndexOf(t)===r),jR=e=>Zst(e).filter(Boolean);Dge.exports=(e,t={},r="")=>{let{past:s=[],present:a=""}=t,n,c;switch(e){case"prev":case"undo":return n=s.slice(0,s.length-1),c=s[s.length-1]||"",{past:jR([r,...n]),present:c};case"next":case"redo":return n=s.slice(1),c=s[0]||"",{past:jR([...n,r]),present:c};case"save":return{past:jR([...s,r]),present:""};case"remove":return c=jR(s.filter(f=>f!==r)),a="",c.length&&(a=c.pop()),{past:c,present:a};default:throw new Error(`Invalid action: "${e}"`)}}});var e5=G((r8t,kge)=>{"use strict";var Xst=km(),xge=Pge(),$G=class extends Xst{constructor(t){super(t);let r=this.options.history;if(r&&r.store){let s=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:s},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(t){return this.store?(this.data=xge(t,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=xge("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};kge.exports=$G});var Tge=G((n8t,Qge)=>{"use strict";var $st=km(),t5=class extends $st{format(){return""}};Qge.exports=t5});var Fge=G((i8t,Rge)=>{"use strict";var eot=km(),r5=class extends eot{constructor(t={}){super(t),this.sep=this.options.separator||/, */,this.initial=t.initial||""}split(t=this.value){return t?String(t).split(this.sep):[]}format(){let t=this.state.submitted?this.styles.primary:r=>r;return this.list.map(t).join(", ")}async submit(t){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};Rge.exports=r5});var Oge=G((s8t,Nge)=>{"use strict";var tot=Yd(),n5=class extends tot{constructor(t){super({...t,multiple:!0})}};Nge.exports=n5});var s5=G((o8t,Lge)=>{"use strict";var rot=km(),i5=class extends rot{constructor(t={}){super({style:"number",...t}),this.min=this.isValue(t.min)?this.toNumber(t.min):-1/0,this.max=this.isValue(t.max)?this.toNumber(t.max):1/0,this.delay=t.delay!=null?t.delay:1e3,this.float=t.float!==!1,this.round=t.round===!0||t.float===!1,this.major=t.major||10,this.minor=t.minor||1,this.initial=t.initial!=null?t.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(t){return!/[-+.]/.test(t)||t==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(t)}number(t){return super.append(t)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(t){let r=t||this.minor,s=this.toNumber(this.input);return s>this.max+r?this.alert():(this.input=`${s+r}`,this.render())}down(t){let r=t||this.minor,s=this.toNumber(this.input);return s<this.min-r?this.alert():(this.input=`${s-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(t=this.input){return typeof this.options.format=="function"?this.options.format.call(this,t):this.styles.info(t)}toNumber(t=""){return this.float?+t:Math.round(+t)}isValue(t){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(t)}submit(){let t=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(t||0),super.submit()}};Lge.exports=i5});var Uge=G((a8t,Mge)=>{Mge.exports=s5()});var Hge=G((l8t,_ge)=>{"use strict";var not=km(),o5=class extends not{constructor(t){super(t),this.cursorShow()}format(t=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length)):""}};_ge.exports=o5});var qge=G((c8t,Gge)=>{"use strict";var iot=Zu(),sot=zv(),jge=ia(),a5=class extends sot{constructor(t={}){super(t),this.widths=[].concat(t.messageWidth||50),this.align=[].concat(t.align||"left"),this.linebreak=t.linebreak||!1,this.edgeLength=t.edgeLength||3,this.newline=t.newline||`
|
||||
`;let r=t.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((s,a)=>({name:a+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let t=0;for(let r of this.choices){t=Math.max(t,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let s=0;s<this.scale.length;s++)r.scale.push({index:s})}this.widths[0]=Math.min(this.widths[0],t+3)}async dispatch(t,r){if(this.multiple)return this[r.name]?await this[r.name](t,r):await super.dispatch(t,r);this.alert()}heading(t,r,s){return this.styles.strong(t)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIndex>=this.scale.length-1?this.alert():(t.scaleIndex++,this.render())}left(){let t=this.focused;return t.scaleIndex<=0?this.alert():(t.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(s=>` ${s.name} - ${s.message}`)].map(s=>this.styles.muted(s)).join(`
|
||||
`)}renderScaleHeading(t){let r=this.scale.map(p=>p.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,t));let s=this.scaleLength-r.join("").length,a=Math.round(s/(r.length-1)),c=r.map(p=>this.styles.strong(p)).join(" ".repeat(a)),f=" ".repeat(this.widths[0]);return this.margin[3]+f+this.margin[1]+c}scaleIndicator(t,r,s){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,t,r,s);let a=t.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(t,r){let s=t.scale.map(n=>this.scaleIndicator(t,n,r)),a=this.term==="Hyper"?"":" ";return s.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(t,r){await this.onChoice(t,r);let s=this.index===r,a=await this.pointer(t,r),n=await t.hint;n&&!jge.hasColor(n)&&(n=this.styles.muted(n));let c=I=>this.margin[3]+I.replace(/\s+$/,"").padEnd(this.widths[0]," "),f=this.newline,p=this.indent(t),h=await this.resolve(t.message,this.state,t,r),E=await this.renderScale(t,r),C=this.margin[1]+this.margin[3];this.scaleLength=iot.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-C.length);let x=jge.wordWrap(h,{width:this.widths[0],newline:f}).split(`
|
||||
`).map(I=>c(I)+this.margin[1]);return s&&(E=this.styles.info(E),x=x.map(I=>this.styles.info(I))),x[0]+=E,this.linebreak&&x.push(""),[p+a,x.join(`
|
||||
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let t=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(t),s=await this.renderScaleHeading();return this.margin[0]+[s,...r.map(a=>a.join(" "))].join(`
|
||||
`)}async render(){let{submitted:t,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c="";this.options.promptLine!==!1&&(c=[s,n,a,""].join(" "),this.state.prompt=c);let f=await this.header(),p=await this.format(),h=await this.renderScaleKey(),E=await this.error()||await this.hint(),C=await this.renderChoices(),S=await this.footer(),x=this.emptyError;p&&(c+=p),E&&!c.includes(E)&&(c+=" "+E),t&&!p&&!C.trim()&&this.multiple&&x!=null&&(c+=this.styles.danger(x)),this.clear(r),this.write([f,c,h,C,S].filter(Boolean).join(`
|
||||
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIndex;return this.base.submit.call(this)}};Gge.exports=a5});var Vge=G((u8t,Wge)=>{"use strict";var Yge=Zu(),oot=(e="")=>typeof e=="string"?e.replace(/^['"]|['"]$/g,""):"",c5=class{constructor(t){this.name=t.key,this.field=t.field||{},this.value=oot(t.initial||this.field.initial||""),this.message=t.message||this.name,this.cursor=0,this.input="",this.lines=[]}},aot=async(e={},t={},r=s=>s)=>{let s=new Set,a=e.fields||[],n=e.template,c=[],f=[],p=[],h=1;typeof n=="function"&&(n=await n());let E=-1,C=()=>n[++E],S=()=>n[E+1],x=I=>{I.line=h,c.push(I)};for(x({type:"bos",value:""});E<n.length-1;){let I=C();if(/^[^\S\n ]$/.test(I)){x({type:"text",value:I});continue}if(I===`
|
||||
`){x({type:"newline",value:I}),h++;continue}if(I==="\\"){I+=C(),x({type:"text",value:I});continue}if((I==="$"||I==="#"||I==="{")&&S()==="{"){let N=C();I+=N;let U={type:"template",open:I,inner:"",close:"",value:I},K;for(;K=C();){if(K==="}"){S()==="}"&&(K+=C()),U.value+=K,U.close=K;break}K===":"?(U.initial="",U.key=U.inner):U.initial!==void 0&&(U.initial+=K),U.value+=K,U.inner+=K}U.template=U.open+(U.initial||U.inner)+U.close,U.key=U.key||U.inner,t.hasOwnProperty(U.key)&&(U.initial=t[U.key]),U=r(U),x(U),p.push(U.key),s.add(U.key);let $=f.find(ie=>ie.name===U.key);U.field=a.find(ie=>ie.name===U.key),$||($=new c5(U),f.push($)),$.lines.push(U.line-1);continue}let R=c[c.length-1];R.type==="text"&&R.line===h?R.value+=I:x({type:"text",value:I})}return x({type:"eos",value:""}),{input:n,tabstops:c,unique:s,keys:p,items:f}};Wge.exports=async e=>{let t=e.options,r=new Set(t.required===!0?[]:t.required||[]),s={...t.values,...t.initial},{tabstops:a,items:n,keys:c}=await aot(t,s),f=l5("result",e,t),p=l5("format",e,t),h=l5("validate",e,t,!0),E=e.isValue.bind(e);return async(C={},S=!1)=>{let x=0;C.required=r,C.items=n,C.keys=c,C.output="";let I=async(K,$,ie,fe)=>{let le=await h(K,$,ie,fe);return le===!1?"Invalid field "+ie.name:le};for(let K of a){let $=K.value,ie=K.key;if(K.type!=="template"){$&&(C.output+=$);continue}if(K.type==="template"){let fe=n.find(ye=>ye.name===ie);t.required===!0&&C.required.add(fe.name);let le=[fe.input,C.values[fe.value],fe.value,$].find(E),pe=(fe.field||{}).message||K.inner;if(S){let ye=await I(C.values[ie],C,fe,x);if(ye&&typeof ye=="string"||ye===!1){C.invalid.set(ie,ye);continue}C.invalid.delete(ie);let d=await f(C.values[ie],C,fe,x);C.output+=Yge.unstyle(d);continue}fe.placeholder=!1;let De=$;$=await p($,C,fe,x),le!==$?(C.values[ie]=le,$=e.styles.typing(le),C.missing.delete(pe)):(C.values[ie]=void 0,le=`<${pe}>`,$=e.styles.primary(le),fe.placeholder=!0,C.required.has(ie)&&C.missing.add(pe)),C.missing.has(pe)&&C.validating&&($=e.styles.warning(le)),C.invalid.has(ie)&&C.validating&&($=e.styles.danger(le)),x===C.index&&(De!==$?$=e.styles.underline($):$=e.styles.heading(Yge.unstyle($))),x++}$&&(C.output+=$)}let R=C.output.split(`
|
||||
`).map(K=>" "+K),N=n.length,U=0;for(let K of n)C.invalid.has(K.name)&&K.lines.forEach($=>{R[$][0]===" "&&(R[$]=C.styles.danger(C.symbols.bullet)+R[$].slice(1))}),e.isValue(C.values[K.name])&&U++;return C.completed=(U/N*100).toFixed(0),C.output=R.join(`
|
||||
`),C.output}};function l5(e,t,r,s){return(a,n,c,f)=>typeof c.field[e]=="function"?c.field[e].call(t,a,n,c,f):[s,a].find(p=>t.isValue(p))}});var Jge=G((f8t,Kge)=>{"use strict";var lot=Zu(),cot=Vge(),uot=zI(),u5=class extends uot{constructor(t){super(t),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await cot(this),await super.initialize()}async reset(t){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},t!==!0&&(await this.initialize(),await this.render())}moveCursor(t){let r=this.getItem();this.cursor+=t,r.cursor+=t}dispatch(t,r){if(!r.code&&!r.ctrl&&t!=null&&this.getItem()){this.append(t,r);return}this.alert()}append(t,r){let s=this.getItem(),a=s.input.slice(0,this.cursor),n=s.input.slice(this.cursor);this.input=s.input=`${a}${t}${n}`,this.moveCursor(1),this.render()}delete(){let t=this.getItem();if(this.cursor<=0||!t.input)return this.alert();let r=t.input.slice(this.cursor),s=t.input.slice(0,this.cursor-1);this.input=t.input=`${s}${r}`,this.moveCursor(-1),this.render()}increment(t){return t>=this.state.keys.length-1?0:t+1}decrement(t){return t<=0?this.state.keys.length-1:t-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(t){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:t,keys:r=[],submitted:s,size:a}=this.state,n=[this.options.newline,`
|
||||
`].find(K=>K!=null),c=await this.prefix(),f=await this.separator(),p=await this.message(),h=[c,p,f].filter(Boolean).join(" ");this.state.prompt=h;let E=await this.header(),C=await this.error()||"",S=await this.hint()||"",x=s?"":await this.interpolate(this.state),I=this.state.key=r[t]||"",R=await this.format(I),N=await this.footer();R&&(h+=" "+R),S&&!R&&this.state.completed===0&&(h+=" "+S),this.clear(a);let U=[E,h,x,N,C.trim()];this.write(U.filter(Boolean).join(n)),this.restore()}getItem(t){let{items:r,keys:s,index:a}=this.state,n=r.find(c=>c.name===s[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:t,missing:r,output:s,values:a}=this.state;if(t.size){let f="";for(let[p,h]of t)f+=`Invalid ${p}: ${h}
|
||||
`;return this.state.error=f,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let c=lot.unstyle(s).split(`
|
||||
`).map(f=>f.slice(1)).join(`
|
||||
`);return this.value={values:a,result:c},super.submit()}};Kge.exports=u5});var Zge=G((A8t,zge)=>{"use strict";var fot="(Use <shift>+<up/down> to sort)",Aot=Yd(),f5=class extends Aot{constructor(t){super({...t,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,fot].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(t,r){let s=await super.renderChoice(t,r),a=this.symbols.identicalTo+" ",n=this.index===r&&this.sorting?this.styles.muted(a):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${r+1} - `+s:n+s}get selected(){return this.choices}submit(){return this.value=this.choices.map(t=>t.value),super.submit()}};zge.exports=f5});var $ge=G((p8t,Xge)=>{"use strict";var pot=zv(),A5=class extends pot{constructor(t={}){if(super(t),this.emptyError=t.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(s=>this.styles.muted(s)),this.state.header=r.join(`
|
||||
`)}}async toChoices(...t){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...t);for(let s of r)s.scale=hot(5,this.options),s.scaleIdx=2;return r}dispatch(){this.alert()}space(){let t=this.focused,r=t.scale[t.scaleIdx],s=r.selected;return t.scale.forEach(a=>a.selected=!1),r.selected=!s,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIdx>=t.scale.length-1?this.alert():(t.scaleIdx++,this.render())}left(){let t=this.focused;return t.scaleIdx<=0?this.alert():(t.scaleIdx--,this.render())}indent(){return" "}async renderChoice(t,r){await this.onChoice(t,r);let s=this.index===r,a=this.term==="Hyper",n=a?9:8,c=a?"":" ",f=this.symbols.line.repeat(n),p=" ".repeat(n+(a?0:1)),h=$=>($?this.styles.success("\u25C9"):"\u25EF")+c,E=r+1+".",C=s?this.styles.heading:this.styles.noop,S=await this.resolve(t.message,this.state,t,r),x=this.indent(t),I=x+t.scale.map(($,ie)=>h(ie===t.scaleIdx)).join(f),R=$=>$===t.scaleIdx?C($):$,N=x+t.scale.map(($,ie)=>R(ie)).join(p),U=()=>[E,S].filter(Boolean).join(" "),K=()=>[U(),I,N," "].filter(Boolean).join(`
|
||||
`);return s&&(I=this.styles.cyan(I),N=this.styles.cyan(N)),K()}async renderChoices(){if(this.state.submitted)return"";let t=this.visible.map(async(s,a)=>await this.renderChoice(s,a)),r=await Promise.all(t);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
|
||||
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:t,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=[s,n,a].filter(Boolean).join(" ");this.state.prompt=c;let f=await this.header(),p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();(p||!h)&&(c+=" "+p),h&&!c.includes(h)&&(c+=" "+h),t&&!p&&!E&&this.multiple&&this.type!=="form"&&(c+=this.styles.danger(this.emptyError)),this.clear(r),this.write([c,f,E,C].filter(Boolean).join(`
|
||||
`)),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIdx;return this.base.submit.call(this)}};function hot(e,t={}){if(Array.isArray(t.scale))return t.scale.map(s=>({...s}));let r=[];for(let s=1;s<e+1;s++)r.push({i:s,selected:!1});return r}Xge.exports=A5});var t0e=G((h8t,e0e)=>{e0e.exports=e5()});var n0e=G((d8t,r0e)=>{"use strict";var dot=HR(),p5=class extends dot{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(t="",r){switch(t.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let t=s=>this.styles.primary.underline(s);return[this.value?this.disabled:t(this.disabled),this.value?t(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:t}=this.state,r=await this.header(),s=await this.prefix(),a=await this.separator(),n=await this.message(),c=await this.format(),f=await this.error()||await this.hint(),p=await this.footer(),h=[s,n,a,c].join(" ");this.state.prompt=h,f&&!h.includes(f)&&(h+=" "+f),this.clear(t),this.write([r,h,p].filter(Boolean).join(`
|
||||
`)),this.write(this.margin[2]),this.restore()}};r0e.exports=p5});var s0e=G((g8t,i0e)=>{"use strict";var got=Yd(),h5=class extends got{constructor(t){if(super(t),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(t,r){let s=await super.toChoices(t,r);if(s.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>s.length)throw new Error("Please specify the index of the correct answer from the list of choices");return s}check(t){return t.index===this.options.correctChoice}async result(t){return{selectedAnswer:t,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};i0e.exports=h5});var a0e=G(d5=>{"use strict";var o0e=ia(),Rs=(e,t)=>{o0e.defineExport(d5,e,t),o0e.defineExport(d5,e.toLowerCase(),t)};Rs("AutoComplete",()=>pge());Rs("BasicAuth",()=>Ige());Rs("Confirm",()=>Bge());Rs("Editable",()=>Sge());Rs("Form",()=>_R());Rs("Input",()=>e5());Rs("Invisible",()=>Tge());Rs("List",()=>Fge());Rs("MultiSelect",()=>Oge());Rs("Numeral",()=>Uge());Rs("Password",()=>Hge());Rs("Scale",()=>qge());Rs("Select",()=>Yd());Rs("Snippet",()=>Jge());Rs("Sort",()=>Zge());Rs("Survey",()=>$ge());Rs("Text",()=>t0e());Rs("Toggle",()=>n0e());Rs("Quiz",()=>s0e())});var c0e=G((y8t,l0e)=>{l0e.exports={ArrayPrompt:zv(),AuthPrompt:KG(),BooleanPrompt:HR(),NumberPrompt:s5(),StringPrompt:km()}});var Xv=G((E8t,f0e)=>{"use strict";var u0e=Ce("assert"),m5=Ce("events"),Wd=ia(),$u=class extends m5{constructor(t,r){super(),this.options=Wd.merge({},t),this.answers={...r}}register(t,r){if(Wd.isObject(t)){for(let a of Object.keys(t))this.register(a,t[a]);return this}u0e.equal(typeof r,"function","expected a function");let s=t.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[s]=r:this.prompts[s]=r(this.Prompt,this),this}async prompt(t=[]){for(let r of[].concat(t))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(Wd.merge({},this.options,r))}catch(s){return Promise.reject(s)}return this.answers}async ask(t){typeof t=="function"&&(t=await t.call(this));let r=Wd.merge({},this.options,t),{type:s,name:a}=t,{set:n,get:c}=Wd;if(typeof s=="function"&&(s=await s.call(this,t,this.answers)),!s)return this.answers[a];u0e(this.prompts[s],`Prompt "${s}" is not registered`);let f=new this.prompts[s](r),p=c(this.answers,a);f.state.answers=this.answers,f.enquirer=this,a&&f.on("submit",E=>{this.emit("answer",a,E,f),n(this.answers,a,E)});let h=f.emit.bind(f);return f.emit=(...E)=>(this.emit.call(this,...E),h(...E)),this.emit("prompt",f,this),r.autofill&&p!=null?(f.value=f.input=p,r.autofill==="show"&&await f.submit()):p=f.value=await f.run(),p}use(t){return t.call(this,this),this}set Prompt(t){this._Prompt=t}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(t){this._Prompt=t}static get Prompt(){return this._Prompt||zI()}static get prompts(){return a0e()}static get types(){return c0e()}static get prompt(){let t=(r,...s)=>{let a=new this(...s),n=a.emit.bind(a);return a.emit=(...c)=>(t.emit(...c),n(...c)),a.prompt(r)};return Wd.mixinEmitter(t,new m5),t}};Wd.mixinEmitter($u,new m5);var g5=$u.prompts;for(let e of Object.keys(g5)){let t=e.toLowerCase(),r=s=>new g5[e](s).run();$u.prompt[t]=r,$u[t]=r,$u[e]||Reflect.defineProperty($u,e,{get:()=>g5[e]})}var Zv=e=>{Wd.defineExport($u,e,()=>$u.types[e])};Zv("ArrayPrompt");Zv("AuthPrompt");Zv("BooleanPrompt");Zv("NumberPrompt");Zv("StringPrompt");f0e.exports=$u});var E0e=G((jHt,Sot)=>{Sot.exports={name:"@yarnpkg/cli",version:"4.17.1",license:"BSD-2-Clause",main:"./sources/index.ts",exports:{".":"./sources/index.ts","./polyfills":"./sources/polyfills.ts","./package.json":"./package.json"},dependencies:{"@yarnpkg/core":"workspace:^","@yarnpkg/fslib":"workspace:^","@yarnpkg/libzip":"workspace:^","@yarnpkg/parsers":"workspace:^","@yarnpkg/plugin-catalog":"workspace:^","@yarnpkg/plugin-compat":"workspace:^","@yarnpkg/plugin-constraints":"workspace:^","@yarnpkg/plugin-dlx":"workspace:^","@yarnpkg/plugin-essentials":"workspace:^","@yarnpkg/plugin-exec":"workspace:^","@yarnpkg/plugin-file":"workspace:^","@yarnpkg/plugin-git":"workspace:^","@yarnpkg/plugin-github":"workspace:^","@yarnpkg/plugin-http":"workspace:^","@yarnpkg/plugin-init":"workspace:^","@yarnpkg/plugin-interactive-tools":"workspace:^","@yarnpkg/plugin-jsr":"workspace:^","@yarnpkg/plugin-link":"workspace:^","@yarnpkg/plugin-nm":"workspace:^","@yarnpkg/plugin-npm":"workspace:^","@yarnpkg/plugin-npm-cli":"workspace:^","@yarnpkg/plugin-pack":"workspace:^","@yarnpkg/plugin-patch":"workspace:^","@yarnpkg/plugin-pnp":"workspace:^","@yarnpkg/plugin-pnpm":"workspace:^","@yarnpkg/plugin-stage":"workspace:^","@yarnpkg/plugin-typescript":"workspace:^","@yarnpkg/plugin-version":"workspace:^","@yarnpkg/plugin-workspace-tools":"workspace:^","@yarnpkg/shell":"workspa
Line truncated
|
||||
${K} at ${$}`:`
|
||||
${K}`}).join("");h.push({text:`Conflict detected in constraint targeting ${ue.pretty(e.configuration,x,ue.Type.CODE)}; conflicting values are:${R}`,fixable:!1})}else{let[[R]]=I,N=xa(S,x);if(JSON.stringify(N)===JSON.stringify(R))continue;if(!s){let U=typeof N>"u"?`Missing field ${ue.pretty(e.configuration,x,ue.Type.CODE)}; expected ${ue.pretty(e.configuration,R,ue.Type.INSPECT)}`:typeof R>"u"?`Extraneous field ${ue.pretty(e.configuration,x,ue.Type.CODE)} currently set to ${ue.pretty(e.configuration,N,ue.Type.INSPECT)}`:`Invalid field ${ue.pretty(e.configuration,x,ue.Type.CODE)}; expected ${ue.pretty(e.configuration,R,ue.Type.INSPECT)}, found ${ue.pretty(e.configuration,N,ue.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof R>"u"?hd(S,x):J0(S,x,R),E=!0}E&&a.set(C,S)}h.length>0&&n.set(C,h)}return{changedWorkspaces:a,remainingErrors:n}}function sme(e,{configuration:t}){let r={children:[]};for(let[s,a]of e){let n=[];for(let f of a){let p=f.text.split(/\n/);f.fixable&&(p[0]=`${ue.pretty(t,"\u2699","gray")} ${p[0]}`),n.push({value:ue.tuple(ue.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:ue.tuple(ue.Type.NO_HINT,h)}))})}let c={value:ue.tuple(ue.Type.LOCATOR,s.anchoredLocator),children:qe.sortMap(n,f=>f.value[1])};r.children.push(c)}return r.children=qe.sortMap(r.children,s=>s.value[1]),r}var UC,Iat,Cat,wat,cS=Ze(()=>{Ge();Zl();UC=class{constructor(t){this.indexedFields=t;this.items=[];this.indexes={};this.clear()}clear(){this.items=[];for(let t of this.indexedFields)this.indexes[t]=new Map}insert(t){this.items.push(t);for(let r of this.indexedFields){let s=Object.hasOwn(t,r)?t[r]:void 0;if(typeof s>"u")continue;qe.getArrayWithDefault(this.indexes[r],s).push(t)}return t}find(t){if(typeof t>"u")return this.items;let r=Object.entries(t);if(r.length===0)return this.items;let s=[],a;for(let[c,f]of r){let p=c,h=Object.hasOwn(this.indexes,p)?this.indexes[p]:void 0;if(typeof h>"u"){s.push([p,f]);continue}let E=new Set(h.get(f)??[]);if(E.size===0)return[];if(typeof a>"u")a=E;else for(let C of a)E.has(C)||a.delete(C);if(a.size===0)break}let n=[...a??[]];return s.length>0&&(n=n.filter(c=>{for(let[f,p]of s)if(!(typeof p<"u"?Object.hasOwn(c,f)&&c[f]===p:Object.hasOwn(c,f)===!1))return!1;return!0})),n}},Iat=/^[0-9]+$/,Cat=/^[a-zA-Z0-9_]+$/,wat=new Set(["scripts",..._t.allDependencies])});var ome=G((Sqt,$5)=>{var Sat;(function(e){var t=function(){return{"append/2":[new e.type.Rule(new e.type.Term("append",[new e.type.Var("X"),new e.type.Var("L")]),new e.type.Term("foldl",[new e.type.Term("append",[]),new e.type.Var("X"),new e.type.Term("[]",[]),new e.type.Var("L")]))],"append/3":[new e.type.Rule(new e.type.Term("append",[new e.type.Term("[]",[]),new e.type.Var("X"),new e.type.Var("X")]),null),new e.type.Rule(new e.type.Term("append",[new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("T")]),new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("S")])]),new e.type.Term("append",[new e.type.Var("T"),new e.type.Var("X"),new e.type.Var("S")]))],"member/2":[new e.type.Rule(new e.type.Term("member",[new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("X"),new e.type.Var("_")])]),null),new e.type.Rule(new e.type.Term("member",[new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("_"),new e.type.Var("Xs")])]),new e.type.Term("member",[new e.type.Var("X"),new e.type.Var("Xs")]))],"permutation/2":[new e.type.Rule(new e.type.Term("permutation",[new e.type.Term("[]",[]),new e.type.Term("[]",[])]),null),new e.type.Rule(new e.type.Term("permutation",[new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("T")]),new e.type.Var("S")]),new e.type.Term(",",[new e.type.Term("permutation",[new e.type.Var("T"),new e.type.Var("P")]),new e.type.Term(",",[new e.type.Term("append",[new e.type.Var("X"),new e.type.Var("Y"),new e.type.Var("P")]),new e.type.Term("append",[new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("Y")]),new e.type.Var("S")])])]))],"maplist/2":[new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("_"),new e.type.Term("[]",[])]),null),new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Term(".",[new e.type.Var("X"),new e.type.Var("Xs")])]),new e.type.Term(",",[new e.type.Term("call",[new e.type.Var("P"),new e.type.Var("X")]),new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Var("Xs")])]))],"maplist/3":[new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("_"),new e.type.Term("[]",[]),new e.type.Term("[]",[])]),null),new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Term(".",[new e.type.Var("A"),new e.type.Var("As")]),new e.type.Term(".",[new e.type.Var("B"),new e.type.Var("Bs")])]),new e.type.Term(",",[new e.type.Term("call",[new e.type.Var("P"),new e.type.Var("A"),new e.type.Var("B")]),new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Var("As"),new e.type.Var("Bs")])]))],"maplist/4":[new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("_"),new e.type.Term("[]",[]),new e.type.Ter
Line truncated
|
||||
`+p:"")),c.error.method="_execFileSync",c.error.program=a,c.error.args=n,c.error.extMessage=p,c.error.exitCode=+f),li.unlinkSync(h),li.unlinkSync(E),li.unlinkSync(C),li.unlinkSync(S),c}function xat(e){var t,r={},s,a={env:process.env,encoding:e.encoding};if(Vd||(Rm?process.env.PSModulePath?(Vd="powershell.exe",JR=["-ExecutionPolicy","Bypass","-File",__dirname+"\\read.ps1"]):(Vd="cscript.exe",JR=["//nologo",__dirname+"\\read.cs.js"]):(Vd="/bin/sh",JR=[__dirname+"/read.sh"])),Rm&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),r9.execFileSync){t=fme(e),uS&&uS("execFileSync",t);try{r.input=r9.execFileSync(Vd,t,a)}catch(n){s=n.stderr?(n.stderr+"").trim():"",r.error=new Error(cme+(s?`
|
||||
`+s:"")),r.error.method="execFileSync",r.error.program=Vd,r.error.args=t,r.error.extMessage=s,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=Pat(e,a);return r.error||(r.input=r.input.replace(/^\s*'|'\s*$/g,""),e.display=""),r}function s9(e){var t="",r=e.display,s=!e.display&&e.keyIn&&e.hideEchoBack&&!e.mask;function a(){var n=xat(e);if(n.error)throw n.error;return n.input}return i9&&i9(e),function(){var n,c,f;function p(){return n||(n=process.binding("fs"),c=process.binding("constants")),n}if(typeof $p=="string")if($p=null,Rm){if(f=function(h){var E=h.replace(/^\D+/,"").split("."),C=0;return(E[0]=+E[0])&&(C+=E[0]*1e4),(E[1]=+E[1])&&(C+=E[1]*100),(E[2]=+E[2])&&(C+=E[2]),C}(process.version),!(f>=20302&&f<40204||f>=5e4&&f<50100||f>=50600&&f<60200)&&process.stdin.isTTY)process.stdin.pause(),$p=process.stdin.fd,HC=process.stdin._handle;else try{$p=p().open("CONIN$",c.O_RDWR,parseInt("0666",8)),HC=new ame($p,!0)}catch{}if(process.stdout.isTTY)tf=process.stdout.fd;else{try{tf=li.openSync("\\\\.\\CON","w")}catch{}if(typeof tf!="number")try{tf=p().open("CONOUT$",c.O_RDWR,parseInt("0666",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{$p=li.openSync("/dev/tty","r"),HC=process.stdin._handle}catch{}}else try{$p=li.openSync("/dev/tty","r"),HC=new ame($p,!1)}catch{}if(process.stdout.isTTY)tf=process.stdout.fd;else try{tf=li.openSync("/dev/tty","w")}catch{}}}(),function(){var n,c,f=!e.hideEchoBack&&!e.keyIn,p,h,E,C,S;zR="";function x(I){return I===lme?!0:HC.setRawMode(I)!==0?!1:(lme=I,!0)}if(ume||!HC||typeof tf!="number"&&(e.display||!f)){t=a();return}if(e.display&&(li.writeSync(tf,e.display),e.display=""),!e.displayOnly){if(!x(!f)){t=a();return}for(h=e.keyIn?1:e.bufferSize,p=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(h):new Buffer(h),e.keyIn&&e.limit&&(c=new RegExp("[^"+e.limit+"]","g"+(e.caseSensitive?"":"i")));;){E=0;try{E=li.readSync($p,p,0,h)}catch(I){if(I.code!=="EOF"){x(!1),t+=a();return}}if(E>0?(C=p.toString(e.encoding,0,E),zR+=C):(C=`
|
||||
`,zR+="\0"),C&&typeof(S=(C.match(/^(.*?)[\r\n]/)||[])[1])=="string"&&(C=S,n=!0),C&&(C=C.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")),C&&c&&(C=C.replace(c,"")),C&&(f||(e.hideEchoBack?e.mask&&li.writeSync(tf,new Array(C.length+1).join(e.mask)):li.writeSync(tf,C)),t+=C),!e.keyIn&&n||e.keyIn&&t.length>=h)break}!f&&!s&&li.writeSync(tf,`
|
||||
`),x(!1)}}(),e.print&&!s&&e.print(r+(e.displayOnly?"":(e.hideEchoBack?new Array(t.length+1).join(e.mask):t)+`
|
||||
`),e.encoding),e.displayOnly?"":l9=e.keepWhitespace||e.keyIn?t:t.trim()}function kat(e,t){var r=[];function s(a){a!=null&&(Array.isArray(a)?a.forEach(s):(!t||t(a))&&r.push(a))}return s(e),r}function c9(e){return e.replace(/[\x00-\x7f]/g,function(t){return"\\x"+("00"+t.charCodeAt().toString(16)).substr(-2)})}function eo(){var e=Array.prototype.slice.call(arguments),t,r;return e.length&&typeof e[0]=="boolean"&&(r=e.shift(),r&&(t=Object.keys(n9),e.unshift(n9))),e.reduce(function(s,a){return a==null||(a.hasOwnProperty("noEchoBack")&&!a.hasOwnProperty("hideEchoBack")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty("noTrim")&&!a.hasOwnProperty("keepWhitespace")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(t=Object.keys(a)),t.forEach(function(n){var c;if(a.hasOwnProperty(n))switch(c=a[n],n){case"mask":case"limitMessage":case"defaultInput":case"encoding":c=c!=null?c+"":"",c&&n!=="limitMessage"&&(c=c.replace(/[\r\n]/g,"")),s[n]=c;break;case"bufferSize":!isNaN(c=parseInt(c,10))&&typeof c=="number"&&(s[n]=c);break;case"displayOnly":case"keyIn":case"hideEchoBack":case"caseSensitive":case"keepWhitespace":case"history":case"cd":s[n]=!!c;break;case"limit":case"trueValue":case"falseValue":s[n]=kat(c,function(f){var p=typeof f;return p==="string"||p==="number"||p==="function"||f instanceof RegExp}).map(function(f){return typeof f=="string"?f.replace(/[\r\n]/g,""):f});break;case"print":case"phContent":case"preCheck":s[n]=typeof c=="function"?c:void 0;break;case"prompt":case"display":s[n]=c??"";break}})),s},{})}function o9(e,t,r){return t.some(function(s){var a=typeof s;return a==="string"?r?e===s:e.toLowerCase()===s.toLowerCase():a==="number"?parseFloat(e)===s:a==="function"?s(e):s instanceof RegExp?s.test(e):!1})}function u9(e,t){var r=Kd.normalize(Rm?(process.env.HOMEDRIVE||"")+(process.env.HOMEPATH||""):process.env.HOME||"").replace(/[\/\\]+$/,"");return e=Kd.normalize(e),t?e.replace(/^~(?=\/|\\|$)/,r):e.replace(new RegExp("^"+c9(r)+"(?=\\/|\\\\|$)",Rm?"i":""),"~")}function jC(e,t){var r="(?:\\(([\\s\\S]*?)\\))?(\\w+|.-.)(?:\\(([\\s\\S]*?)\\))?",s=new RegExp("(\\$)?(\\$<"+r+">)","g"),a=new RegExp("(\\$)?(\\$\\{"+r+"\\})","g");function n(c,f,p,h,E,C){var S;return f||typeof(S=t(E))!="string"?p:S?(h||"")+S+(C||""):""}return e.replace(s,n).replace(a,n)}function Ame(e,t,r){var s,a=[],n=-1,c=0,f="",p;function h(E,C){return C.length>3?(E.push(C[0]+"..."+C[C.length-1]),p=!0):C.length&&(E=E.concat(C)),E}return s=e.reduce(function(E,C){return E.concat((C+"").split(""))},[]).reduce(function(E,C){var S,x;return t||(C=C.toLowerCase()),S=/^\d$/.test(C)?1:/^[A-Z]$/.test(C)?2:/^[a-z]$/.test(C)?3:0,r&&S===0?f+=C:(x=C.charCodeAt(0),S&&S===n&&x===c+1?a.push(C):(E=h(E,a),a=[C],n=S),c=x),E},[]),s=h(s,a),f&&(s.push(f),p=!0),{values:s,suppressed:p}}function pme(e,t){return e.join(e.length>2?", ":t?" / ":"/")}function hme(e,t){var r,s,a={},n;if(t.phContent&&(r=t.phContent(e,t)),typeof r!="string")switch(e){case"hideEchoBack":case"mask":case"defaultInput":case"caseSensitive":case"keepWhitespace":case"encoding":case"bufferSize":case"history":case"cd":r=t.hasOwnProperty(e)?typeof t[e]=="boolean"?t[e]?"on":"off":t[e]+"":"";break;case"limit":case"trueValue":case"falseValue":s=t[t.hasOwnProperty(e+"Src")?e+"Src":e],t.keyIn?(a=Ame(s,t.caseSensitive),s=a.values):s=s.filter(function(c){var f=typeof c;return f==="string"||f==="number"}),r=pme(s,a.suppressed);break;case"limitCount":case"limitCountNotZero":r=t[t.hasOwnProperty("limitSrc")?"limitSrc":"limit"].length,r=r||e!=="limitCountNotZero"?r+"":"";break;case"lastInput":r=l9;break;case"cwd":case"CWD":case"cwdHome":r=process.cwd(),e==="CWD"?r=Kd.basename(r):e==="cwdHome"&&(r=u9(r));break;case"date":case"time":case"localeDate":case"localeTime":r=new Date()["to"+e.replace(/^./,function(c){return c.toUpperCase()})+"String"]();break;default:typeof(n=(e.match(/^history_m(\d+)$/)||[])[1])=="string"&&(r=Tm[Tm.length-n]||"")}return r}function dme(e){var t=/^(.)-(.)$/.exec(e),r="",s,a,n,c;if(!t)return null;for(s=t[1].charCodeAt(0),a=t[2].charCodeAt(0),c=s<a?1:-1,n=s;n!==a+c;n+=c)r+=String.fromCharCode(n);return r}function a9(e){var t=new RegExp(/(\s*)(?:("|')(.*?)(?:\2|$)|(\S+))/g),r,s="",a=[],n;for(e=e.trim();r=t.exec(e);)n=r[3]||r[4]||"",r[1]&&(a.push(s),s=""),s+=n;return s&&a.push(s),a}function gme(e,t){return t.trueValue.length&&o9(e,t.trueValue,t.caseSensitive)?!0:t.falseValue.length&&o9(e,t.falseValue,t.caseSensitive)?!1:e}function mme(e){var t,r,s,a,n,c,f;function p(E){return hme(E,e)}function h(E){e.display+=(/[^\r\n]$/.test(e.display)?`
|
||||
`:"")+E}for(e.limitSrc=e.limit,e.displaySrc=e.display,e.limit="",e.display=jC(e.display+"",p);;){if(t=s9(e),r=!1,s="",e.defaultInput&&!t&&(t=e.defaultInput),e.history&&((a=/^\s*\!(?:\!|-1)(:p)?\s*$/.exec(t))?(n=Tm[0]||"",a[1]?r=!0:t=n,h(n+`
|
||||
`),r||(e.displayOnly=!0,s9(e),e.displayOnly=!1)):t&&t!==Tm[Tm.length-1]&&(Tm=[t])),!r&&e.cd&&t)switch(c=a9(t),c[0].toLowerCase()){case"cd":if(c[1])try{process.chdir(u9(c[1],!0))}catch(E){h(E+"")}r=!0;break;case"pwd":h(process.cwd()),r=!0;break}if(!r&&e.preCheck&&(f=e.preCheck(t,e),t=f.res,f.forceNext&&(r=!0)),!r){if(!e.limitSrc.length||o9(t,e.limitSrc,e.caseSensitive))break;e.limitMessage&&(s=jC(e.limitMessage,p))}h((s?s+`
|
||||
`:"")+jC(e.displaySrc+"",p))}return gme(t,e)}en._DBG_set_useExt=function(e){ume=e};en._DBG_set_checkOptions=function(e){i9=e};en._DBG_set_checkMethod=function(e){uS=e};en._DBG_clearHistory=function(){l9="",Tm=[]};en.setDefaultOptions=function(e){return n9=eo(!0,e),eo(!0)};en.question=function(e,t){return mme(eo(eo(!0,t),{display:e}))};en.prompt=function(e){var t=eo(!0,e);return t.display=t.prompt,mme(t)};en.keyIn=function(e,t){var r=eo(eo(!0,t),{display:e,keyIn:!0,keepWhitespace:!0});return r.limitSrc=r.limit.filter(function(s){var a=typeof s;return a==="string"||a==="number"}).map(function(s){return jC(s+"",dme)}),r.limit=c9(r.limitSrc.join("")),["trueValue","falseValue"].forEach(function(s){r[s]=r[s].reduce(function(a,n){var c=typeof n;return c==="string"||c==="number"?a=a.concat((n+"").split("")):a.push(n),a},[])}),r.display=jC(r.display+"",function(s){return hme(s,r)}),gme(s9(r),r)};en.questionEMail=function(e,t){return e==null&&(e="Input e-mail address: "),en.question(e,eo({hideEchoBack:!1,limit:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,limitMessage:"Input valid e-mail address, please.",trueValue:null,falseValue:null},t,{keepWhitespace:!1,cd:!1}))};en.questionNewPassword=function(e,t){var r,s,a,n=eo({hideEchoBack:!0,mask:"*",limitMessage:`It can include: $<charlist>
|
||||
And the length must be: $<length>`,trueValue:null,falseValue:null,caseSensitive:!0},t,{history:!1,cd:!1,phContent:function(x){return x==="charlist"?r.text:x==="length"?s+"..."+a:null}}),c,f,p,h,E,C,S;for(t=t||{},c=jC(t.charlist?t.charlist+"":"$<!-~>",dme),(isNaN(s=parseInt(t.min,10))||typeof s!="number")&&(s=12),(isNaN(a=parseInt(t.max,10))||typeof a!="number")&&(a=24),h=new RegExp("^["+c9(c)+"]{"+s+","+a+"}$"),r=Ame([c],n.caseSensitive,!0),r.text=pme(r.values,r.suppressed),f=t.confirmMessage!=null?t.confirmMessage:"Reinput a same one to confirm it: ",p=t.unmatchMessage!=null?t.unmatchMessage:"It differs from first one. Hit only the Enter key if you want to retry from first one.",e==null&&(e="Input new password: "),E=n.limitMessage;!S;)n.limit=h,n.limitMessage=E,C=en.question(e,n),n.limit=[C,""],n.limitMessage=p,S=en.question(f,n);return C};function yme(e,t,r){var s;function a(n){return s=r(n),!isNaN(s)&&typeof s=="number"}return en.question(e,eo({limitMessage:"Input valid number, please."},t,{limit:a,cd:!1})),s}en.questionInt=function(e,t){return yme(e,t,function(r){return parseInt(r,10)})};en.questionFloat=function(e,t){return yme(e,t,parseFloat)};en.questionPath=function(e,t){var r,s="",a=eo({hideEchoBack:!1,limitMessage:`$<error(
|
||||
)>Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},t,{keepWhitespace:!1,limit:function(n){var c,f,p;n=u9(n,!0),s="";function h(E){E.split(/\/|\\/).reduce(function(C,S){var x=Kd.resolve(C+=S+Kd.sep);if(!li.existsSync(x))li.mkdirSync(x);else if(!li.statSync(x).isDirectory())throw new Error("Non directory already exists: "+x);return C},"")}try{if(c=li.existsSync(n),r=c?li.realpathSync(n):Kd.resolve(n),!t.hasOwnProperty("exists")&&!c||typeof t.exists=="boolean"&&t.exists!==c)return s=(c?"Already exists":"No such file or directory")+": "+r,!1;if(!c&&t.create&&(t.isDirectory?h(r):(h(Kd.dirname(r)),li.closeSync(li.openSync(r,"w"))),r=li.realpathSync(r)),c&&(t.min||t.max||t.isFile||t.isDirectory)){if(f=li.statSync(r),t.isFile&&!f.isFile())return s="Not file: "+r,!1;if(t.isDirectory&&!f.isDirectory())return s="Not directory: "+r,!1;if(t.min&&f.size<+t.min||t.max&&f.size>+t.max)return s="Size "+f.size+" is out of range: "+r,!1}if(typeof t.validate=="function"&&(p=t.validate(r))!==!0)return typeof p=="string"&&(s=p),!1}catch(E){return s=E+"",!1}return!0},phContent:function(n){return n==="error"?s:n!=="min"&&n!=="max"?null:t.hasOwnProperty(n)?t[n]+"":""}});return t=t||{},e==null&&(e='Input path (you can "cd" and "pwd"): '),en.question(e,a),r};function Eme(e,t){var r={},s={};return typeof e=="object"?(Object.keys(e).forEach(function(a){typeof e[a]=="function"&&(s[t.caseSensitive?a:a.toLowerCase()]=e[a])}),r.preCheck=function(a){var n;return r.args=a9(a),n=r.args[0]||"",t.caseSensitive||(n=n.toLowerCase()),r.hRes=n!=="_"&&s.hasOwnProperty(n)?s[n].apply(a,r.args.slice(1)):s.hasOwnProperty("_")?s._.apply(a,r.args):null,{res:a,forceNext:!1}},s.hasOwnProperty("_")||(r.limit=function(){var a=r.args[0]||"";return t.caseSensitive||(a=a.toLowerCase()),s.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=a9(a),r.hRes=typeof e=="function"?e.apply(a,r.args):!0,{res:a,forceNext:!1}},r}en.promptCL=function(e,t){var r=eo({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},t),s=Eme(e,r);return r.limit=s.limit,r.preCheck=s.preCheck,en.prompt(r),s.args};en.promptLoop=function(e,t){for(var r=eo({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},t);!e(en.prompt(r)););};en.promptCLLoop=function(e,t){var r=eo({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},t),s=Eme(e,r);for(r.limit=s.limit,r.preCheck=s.preCheck;en.prompt(r),!s.hRes;);};en.promptSimShell=function(e){return en.prompt(eo({hideEchoBack:!1,history:!0},e,{prompt:function(){return Rm?"$<cwd>>":(process.env.USER||"")+(process.env.HOSTNAME?"@"+process.env.HOSTNAME.replace(/\..*$/,""):"")+":$<cwdHome>$ "}()}))};function Ime(e,t,r){var s;return e==null&&(e="Are you sure? "),(!t||t.guide!==!1)&&(e+="")&&(e=e.replace(/\s*:?\s*$/,"")+" [y/n]: "),s=en.keyIn(e,eo(t,{hideEchoBack:!1,limit:r,trueValue:"y",falseValue:"n",caseSensitive:!1})),typeof s=="boolean"?s:""}en.keyInYN=function(e,t){return Ime(e,t)};en.keyInYNStrict=function(e,t){return Ime(e,t,"yn")};en.keyInPause=function(e,t){e==null&&(e="Continue..."),(!t||t.guide!==!1)&&(e+="")&&(e=e.replace(/\s+$/,"")+" (Hit any key)"),en.keyIn(e,eo({limit:null},t,{hideEchoBack:!0,mask:""}))};en.keyInSelect=function(e,t,r){var s=eo({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(p){return p==="itemsCount"?e.length+"":p==="firstItem"?(e[0]+"").trim():p==="lastItem"?(e[e.length-1]+"").trim():null}}),a="",n={},c=49,f=`
|
||||
`;if(!Array.isArray(e)||!e.length||e.length>35)throw"`items` must be Array (max length: 35).";return e.forEach(function(p,h){var E=String.fromCharCode(c);a+=E,n[E]=h,f+="["+E+"] "+(p+"").trim()+`
|
||||
`,c=c===57?97:c+1}),(!r||r.cancel!==!1)&&(a+="0",n[0]=-1,f+="[0] "+(r&&r.cancel!=null&&typeof r.cancel!="boolean"?(r.cancel+"").trim():"CANCEL")+`
|
||||
`),s.limit=a,f+=`
|
||||
`,t==null&&(t="Choose one from list: "),(t+="")&&((!r||r.guide!==!1)&&(t=t.replace(/\s*:?\s*$/,"")+" [$<limit>]: "),f+=t),n[en.keyIn(f,s).toLowerCase()]};en.getRawInput=function(){return zR};function fS(e,t){var r;return t.length&&(r={},r[e]=t[0]),en.setDefaultOptions(r)[e]}en.setPrint=function(){return fS("print",arguments)};en.setPrompt=function(){return fS("prompt",arguments)};en.setEncoding=function(){return fS("encoding",arguments)};en.setMask=function(){return fS("mask",arguments)};en.setBufferSize=function(){return fS("bufferSize",arguments)}});var f9=G((Dqt,nc)=>{(function(){var e={major:0,minor:2,patch:66,status:"beta"};tau_file_system={files:{},open:function(w,D,y){var F=tau_file_system.files[w];if(!F){if(y==="read")return null;F={path:w,text:"",type:D,get:function(z,Z){return Z===this.text.length||Z>this.text.length?"end_of_file":this.text.substring(Z,Z+z)},put:function(z,Z){return Z==="end_of_file"?(this.text+=z,!0):Z==="past_end_of_file"?null:(this.text=this.text.substring(0,Z)+z+this.text.substring(Z+z.length),!0)},get_byte:function(z){if(z==="end_of_stream")return-1;var Z=Math.floor(z/2);if(this.text.length<=Z)return-1;var ee=n(this.text[Math.floor(z/2)],0);return z%2===0?ee&255:ee/256>>>0},put_byte:function(z,Z){var ee=Z==="end_of_stream"?this.text.length:Math.floor(Z/2);if(this.text.length<ee)return null;var se=this.text.length===ee?-1:n(this.text[Math.floor(Z/2)],0);return Z%2===0?(se=se/256>>>0,se=(se&255)<<8|z&255):(se=se&255,se=(z&255)<<8|se&255),this.text.length===ee?this.text+=c(se):this.text=this.text.substring(0,ee)+c(se)+this.text.substring(ee+1),!0},flush:function(){return!0},close:function(){var z=tau_file_system.files[this.path];return z?!0:null}},tau_file_system.files[w]=F}return y==="write"&&(F.text=""),F}},tau_user_input={buffer:"",get:function(w,D){for(var y;tau_user_input.buffer.length<w;)y=window.prompt(),y&&(tau_user_input.buffer+=y);return y=tau_user_input.buffer.substr(0,w),tau_user_input.buffer=tau_user_input.buffer.substr(w),y}},tau_user_output={put:function(w,D){return console.log(w),!0},flush:function(){return!0}},nodejs_file_system={open:function(w,D,y){var F=Ce("fs"),z=F.openSync(w,y[0]);return y==="read"&&!F.existsSync(w)?null:{get:function(Z,ee){var se=new Buffer(Z);return F.readSync(z,se,0,Z,ee),se.toString()},put:function(Z,ee){var se=Buffer.from(Z);if(ee==="end_of_file")F.writeSync(z,se);else{if(ee==="past_end_of_file")return null;F.writeSync(z,se,0,se.length,ee)}return!0},get_byte:function(Z){return null},put_byte:function(Z,ee){return null},flush:function(){return!0},close:function(){return F.closeSync(z),!0}}}},nodejs_user_input={buffer:"",get:function(w,D){for(var y,F=Cme();nodejs_user_input.buffer.length<w;)nodejs_user_input.buffer+=F.question();return y=nodejs_user_input.buffer.substr(0,w),nodejs_user_input.buffer=nodejs_user_input.buffer.substr(w),y}},nodejs_user_output={put:function(w,D){return process.stdout.write(w),!0},flush:function(){return!0}};var t;Array.prototype.indexOf?t=function(w,D){return w.indexOf(D)}:t=function(w,D){for(var y=w.length,F=0;F<y;F++)if(D===w[F])return F;return-1};var r=function(w,D){if(w.length!==0){for(var y=w[0],F=w.length,z=1;z<F;z++)y=D(y,w[z]);return y}},s;Array.prototype.map?s=function(w,D){return w.map(D)}:s=function(w,D){for(var y=[],F=w.length,z=0;z<F;z++)y.push(D(w[z]));return y};var a;Array.prototype.filter?a=function(w,D){return w.filter(D)}:a=function(w,D){for(var y=[],F=w.length,z=0;z<F;z++)D(w[z])&&y.push(w[z]);return y};var n;String.prototype.codePointAt?n=function(w,D){return w.codePointAt(D)}:n=function(w,D){return w.charCodeAt(D)};var c;String.fromCodePoint?c=function(){return String.fromCodePoint.apply(null,arguments)}:c=function(){return String.fromCharCode.apply(null,arguments)};var f=0,p=1,h=/(\\a)|(\\b)|(\\f)|(\\n)|(\\r)|(\\t)|(\\v)|\\x([0-9a-fA-F]+)\\|\\([0-7]+)\\|(\\\\)|(\\')|('')|(\\")|(\\`)|(\\.)|(.)/g,E={"\\a":7,"\\b":8,"\\f":12,"\\n":10,"\\r":13,"\\t":9,"\\v":11};function C(w){var D=[],y=!1;return w.replace(h,function(F,z,Z,ee,se,xe,Ne,ut,Ct,Yt,ir,Pt,mn,Pr,Cr,Lr,on){switch(!0){case Ct!==void 0:return D.push(parseInt(Ct,16)),"";case Yt!==void 0:return D.push(parseInt(Yt,8)),"";case ir!==void 0:case Pt!==void 0:case mn!==void 0:case Pr!==void 0:case Cr!==void 0:return D.push(n(F.substr(1),0)),"";case on!==void 0:return D.push(n(on,0)),"";case Lr!==void 0:y=!0;default:return D.push(E[F]),""}}),y?null:D}function S(w,D){var y="";if(w.length<2)return w;try{w=w.replace(/\\([0-7]+)\\/g,function(ee,se){return c(parseInt(se,8))}),w=w.replace(/\\x([0-9a-fA-F]+)\\/g,function(ee,se){return c(parseInt(se,16))})}catch{return null}for(var F=0;F<w.length;F++){var z=w.charAt(F),Z=w.charAt(F+1);if(z===D&&Z===D)F++,y+=D;else if(z==="\\")if(["a","b","f","n","r","t","v","'",'"',"\\","a","\b","\f",`
|
||||
`,"\r"," ","\v"].indexOf(Z)!==-1)switch(F+=1,Z){case"a":y+="a";break;case"b":y+="\b";break;case"f":y+="\f";break;case"n":y+=`
|
||||
`;break;case"r":y+="\r";break;case"t":y+=" ";break;case"v":y+="\v";break;case"'":y+="'";break;case'"':y+='"';break;case"\\":y+="\\";break}else return null;else y+=z}return y}function x(w){for(var D="",y=0;y<w.length;y++)switch(w.charAt(y)){case"'":D+="\\'";break;case"\\":D+="\\\\";break;case"\b":D+="\\b";break;case"\f":D+="\\f";break;case`
|
||||
`:D+="\\n";break;case"\r":D+="\\r";break;case" ":D+="\\t";break;case"\v":D+="\\v";break;default:D+=w.charAt(y);break}return D}function I(w){var D=w.substr(2);switch(w.substr(0,2).toLowerCase()){case"0x":return parseInt(D,16);case"0b":return parseInt(D,2);case"0o":return parseInt(D,8);case"0'":return C(D)[0];default:return parseFloat(w)}}var R={whitespace:/^\s*(?:(?:%.*)|(?:\/\*(?:\n|\r|.)*?\*\/)|(?:\s+))\s*/,variable:/^(?:[A-Z_][a-zA-Z0-9_]*)/,atom:/^(\!|,|;|[a-z][0-9a-zA-Z_]*|[#\$\&\*\+\-\.\/\:\<\=\>\?\@\^\~\\]+|'(?:[^']*?(?:\\(?:x?\d+)?\\)*(?:'')*(?:\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\[abfnrtv\\'"`]|\\x?\d+\\|[^\\])|\d+(?:\.\d+(?:[eE][+-]?\d+)?)?)/,string:/^(?:"([^"]|""|\\")*"|`([^`]|``|\\`)*`)/,l_brace:/^(?:\[)/,r_brace:/^(?:\])/,l_bracket:/^(?:\{)/,r_bracket:/^(?:\})/,bar:/^(?:\|)/,l_paren:/^(?:\()/,r_paren:/^(?:\))/};function N(w,D){return w.get_flag("char_conversion").id==="on"?D.replace(/./g,function(y){return w.get_char_conversion(y)}):D}function U(w){this.thread=w,this.text="",this.tokens=[]}U.prototype.set_last_tokens=function(w){return this.tokens=w},U.prototype.new_text=function(w){this.text=w,this.tokens=[]},U.prototype.get_tokens=function(w){var D,y=0,F=0,z=0,Z=[],ee=!1;if(w){var se=this.tokens[w-1];y=se.len,D=N(this.thread,this.text.substr(se.len)),F=se.line,z=se.start}else D=this.text;if(/^\s*$/.test(D))return null;for(;D!=="";){var xe=[],Ne=!1;if(/^\n/.exec(D)!==null){F++,z=0,y++,D=D.replace(/\n/,""),ee=!0;continue}for(var ut in R)if(R.hasOwnProperty(ut)){var Ct=R[ut].exec(D);Ct&&xe.push({value:Ct[0],name:ut,matches:Ct})}if(!xe.length)return this.set_last_tokens([{value:D,matches:[],name:"lexical",line:F,start:z}]);var se=r(xe,function(Pr,Cr){return Pr.value.length>=Cr.value.length?Pr:Cr});switch(se.start=z,se.line=F,D=D.replace(se.value,""),z+=se.value.length,y+=se.value.length,se.name){case"atom":se.raw=se.value,se.value.charAt(0)==="'"&&(se.value=S(se.value.substr(1,se.value.length-2),"'"),se.value===null&&(se.name="lexical",se.value="unknown escape sequence"));break;case"number":se.float=se.value.substring(0,2)!=="0x"&&se.value.match(/[.eE]/)!==null&&se.value!=="0'.",se.value=I(se.value),se.blank=Ne;break;case"string":var Yt=se.value.charAt(0);se.value=S(se.value.substr(1,se.value.length-2),Yt),se.value===null&&(se.name="lexical",se.value="unknown escape sequence");break;case"whitespace":var ir=Z[Z.length-1];ir&&(ir.space=!0),Ne=!0;continue;case"r_bracket":Z.length>0&&Z[Z.length-1].name==="l_bracket"&&(se=Z.pop(),se.name="atom",se.value="{}",se.raw="{}",se.space=!1);break;case"r_brace":Z.length>0&&Z[Z.length-1].name==="l_brace"&&(se=Z.pop(),se.name="atom",se.value="[]",se.raw="[]",se.space=!1);break}se.len=y,Z.push(se),Ne=!1}var Pt=this.set_last_tokens(Z);return Pt.length===0?null:Pt};function K(w,D,y,F,z){if(!D[y])return{type:f,value:P.error.syntax(D[y-1],"expression expected",!0)};var Z;if(F==="0"){var ee=D[y];switch(ee.name){case"number":return{type:p,len:y+1,value:new P.type.Num(ee.value,ee.float)};case"variable":return{type:p,len:y+1,value:new P.type.Var(ee.value)};case"string":var se;switch(w.get_flag("double_quotes").id){case"atom":se=new _(ee.value,[]);break;case"codes":se=new _("[]",[]);for(var xe=ee.value.length-1;xe>=0;xe--)se=new _(".",[new P.type.Num(n(ee.value,xe),!1),se]);break;case"chars":se=new _("[]",[]);for(var xe=ee.value.length-1;xe>=0;xe--)se=new _(".",[new P.type.Term(ee.value.charAt(xe),[]),se]);break}return{type:p,len:y+1,value:se};case"l_paren":var Pt=K(w,D,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:D[Pt.len]&&D[Pt.len].name==="r_paren"?(Pt.len++,Pt):{type:f,derived:!0,value:P.error.syntax(D[Pt.len]?D[Pt.len]:D[Pt.len-1],") or operator expected",!D[Pt.len])};case"l_bracket":var Pt=K(w,D,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:D[Pt.len]&&D[Pt.len].name==="r_bracket"?(Pt.len++,Pt.value=new _("{}",[Pt.value]),Pt):{type:f,derived:!0,value:P.error.syntax(D[Pt.len]?D[Pt.len]:D[Pt.len-1],"} or operator expected",!D[Pt.len])}}var Ne=$(w,D,y,z);return Ne.type===p||Ne.derived||(Ne=ie(w,D,y),Ne.type===p||Ne.derived)?Ne:{type:f,derived:!1,value:P.error.syntax(D[y],"unexpected token")}}var ut=w.__get_max_priority(),Ct=w.__get_next_priority(F),Yt=y;if(D[y].name==="atom"&&D[y+1]&&(D[y].space||D[y+1].name!=="l_paren")){var ee=D[y++],ir=w.__lookup_operator_classes(F,ee.value);if(ir&&ir.indexOf("fy")>-1){var Pt=K(w,D,y,F,z);if(Pt.type!==f)return ee.value==="-"&&!ee.space&&P.type.is_number(Pt.value)?{value:new P.type.Num(-Pt.value.value,Pt.value.is_float),len:Pt.len,type:p}:{value:new P.type.Term(ee.value,[Pt.value]),len:Pt.len,type:p};Z=Pt}else if(ir&&ir.indexOf("fx")>-1){var Pt=K(w,D,y,Ct,z);if(Pt.type!==f)return{value:new P.type.Term(ee.value,[Pt.value]),len:Pt.len,type:p};Z=Pt}}y=Yt;var Pt=K(w,D,y,Ct,z);if(Pt.type===p){y=Pt.len;var ee=D[y];if(D[y]&&(D[y].name==="atom"&&w.__lookup_operator_classes(F,ee.value)||D[y].name==="bar"&&w.__lookup_operator_classes(F,"|"))){var mn=Ct,Pr=F,ir=w.__lookup_operator_classes(F,ee.value);ifLine truncated
|
||||
`;D+=`
|
||||
`;for(key in this.rules)for(y=0;y<this.rules[key].length;y++)D+=this.rules[key][y].toString(w),D+=`
|
||||
`;return D},be.prototype.clone=function(){return new be(this.id)},ke.prototype.clone=function(){return new ke(this.value,this.is_float)},_.prototype.clone=function(){return new _(this.id,s(this.args,function(w){return w.clone()}))},Fe.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},Qe.prototype.clone=function(){var w={};for(var D in this.links)this.links.hasOwnProperty(D)&&(w[D]=this.links[D].clone());return new Qe(w)},Se.prototype.clone=function(){return new Se(this.goal.clone(),this.substitution.clone(),this.parent)},je.prototype.clone=function(){return new je(this.head.clone(),this.body!==null?this.body.clone():null)},be.prototype.equals=function(w){return P.type.is_variable(w)&&this.id===w.id},ke.prototype.equals=function(w){return P.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float},_.prototype.equals=function(w){if(!P.type.is_term(w)||this.indicator!==w.indicator)return!1;for(var D=0;D<this.args.length;D++)if(!this.args[D].equals(w.args[D]))return!1;return!0},Fe.prototype.equals=function(w){return P.type.is_stream(w)&&this.id===w.id},Qe.prototype.equals=function(w){var D;if(!P.type.is_substitution(w))return!1;for(D in this.links)if(this.links.hasOwnProperty(D)&&(!w.links[D]||!this.links[D].equals(w.links[D])))return!1;for(D in w.links)if(w.links.hasOwnProperty(D)&&!this.links[D])return!1;return!0},Se.prototype.equals=function(w){return P.type.is_state(w)&&this.goal.equals(w.goal)&&this.substitution.equals(w.substitution)&&this.parent===w.parent},je.prototype.equals=function(w){return P.type.is_rule(w)&&this.head.equals(w.head)&&(this.body===null&&w.body===null||this.body!==null&&this.body.equals(w.body))},be.prototype.rename=function(w){return w.get_free_variable(this)},ke.prototype.rename=function(w){return this},_.prototype.rename=function(w){return new _(this.id,s(this.args,function(D){return D.rename(w)}))},Fe.prototype.rename=function(w){return this},je.prototype.rename=function(w){return new je(this.head.rename(w),this.body!==null?this.body.rename(w):null)},be.prototype.variables=function(){return[this.id]},ke.prototype.variables=function(){return[]},_.prototype.variables=function(){return[].concat.apply([],s(this.args,function(w){return w.variables()}))},Fe.prototype.variables=function(){return[]},je.prototype.variables=function(){return this.body===null?this.head.variables():this.head.variables().concat(this.body.variables())},be.prototype.apply=function(w){return w.lookup(this.id)?w.lookup(this.id):this},ke.prototype.apply=function(w){return this},_.prototype.apply=function(w){if(this.indicator==="./2"){for(var D=[],y=this;y.indicator==="./2";)D.push(y.args[0].apply(w)),y=y.args[1];for(var F=y.apply(w),z=D.length-1;z>=0;z--)F=new _(".",[D[z],F]);return F}return new _(this.id,s(this.args,function(Z){return Z.apply(w)}),this.ref)},Fe.prototype.apply=function(w){return this},je.prototype.apply=function(w){return new je(this.head.apply(w),this.body!==null?this.body.apply(w):null)},Qe.prototype.apply=function(w){var D,y={};for(D in this.links)this.links.hasOwnProperty(D)&&(y[D]=this.links[D].apply(w));return new Qe(y)},_.prototype.select=function(){for(var w=this;w.indicator===",/2";)w=w.args[0];return w},_.prototype.replace=function(w){return this.indicator===",/2"?this.args[0].indicator===",/2"?new _(",",[this.args[0].replace(w),this.args[1]]):w===null?this.args[1]:new _(",",[w,this.args[1]]):w},_.prototype.search=function(w){if(P.type.is_term(w)&&w.ref!==void 0&&this.ref===w.ref)return!0;for(var D=0;D<this.args.length;D++)if(P.type.is_term(this.args[D])&&this.args[D].search(w))return!0;return!1},Te.prototype.get_current_input=function(){return this.current_input},ct.prototype.get_current_input=function(){return this.session.get_current_input()},Te.prototype.get_current_output=function(){return this.current_output},ct.prototype.get_current_output=function(){return this.session.get_current_output()},Te.prototype.set_current_input=function(w){this.current_input=w},ct.prototype.set_current_input=function(w){return this.session.set_current_input(w)},Te.prototype.set_current_output=function(w){this.current_input=w},ct.prototype.set_current_output=function(w){return this.session.set_current_output(w)},Te.prototype.get_stream_by_alias=function(w){return this.streams[w]},ct.prototype.get_stream_by_alias=function(w){return this.session.get_stream_by_alias(w)},Te.prototype.file_system_open=function(w,D,y){return this.file_system.open(w,D,y)},ct.prototype.file_system_open=function(w,D,y){return this.session.file_system_open(w,D,y)},Te.prototype.get_char_conversion=function(w){return this.__char_conversion[w]||w},ct.prototype.get_char_conversion=function(w){return this.session.get_char_conversion(w)},Te.prototype.parse=function(w){return this.thread.parse(w)},ct.prototype.parse=function(w){var D=new U(this);D.new_text(w);var y=D.get_tokens();if(y===null)return!1;var F=K(this,y,0,this.__get_max_priority(),!1);return F
Line truncated
|
||||
`,[])])])),D.substitution,D)])},"nl/1":function(w,D,y){var F=y.args[0];w.prepend([new Se(D.goal.replace(new _("put_char",[F,new _(`
|
||||
`,[])])),D.substitution,D)])},"get_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new Se(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("get_byte",[new be("S"),F])])),D.substitution,D)])},"get_byte/2":function(w,D,y){var F=y.args[0],z=y.args[1],Z=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(P.type.is_variable(F))w.throw_error(P.error.instantiation(y.indicator));else if(!P.type.is_variable(z)&&!P.type.is_byte(z))w.throw_error(P.error.type("in_byte",char,y.indicator));else if(!P.type.is_stream(F)&&!P.type.is_atom(F))w.throw_error(P.error.domain("stream_or_alias",F,y.indicator));else if(!P.type.is_stream(Z)||Z.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(Z.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(Z.type==="text")w.throw_error(P.error.permission("input","text_stream",F,y.indicator));else if(Z.position==="past_end_of_stream"&&Z.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{var ee;if(Z.position==="end_of_stream")ee="end_of_file",Z.position="past_end_of_stream";else{if(ee=Z.stream.get_byte(Z.position),ee===null){w.throw_error(P.error.representation("byte",y.indicator));return}Z.position++}w.prepend([new Se(D.goal.replace(new _("=",[new ke(ee,!1),z])),D.substitution,D)])}},"peek_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new Se(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("peek_byte",[new be("S"),F])])),D.substitution,D)])},"peek_byte/2":function(w,D,y){var F=y.args[0],z=y.args[1],Z=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(P.type.is_variable(F))w.throw_error(P.error.instantiation(y.indicator));else if(!P.type.is_variable(z)&&!P.type.is_byte(z))w.throw_error(P.error.type("in_byte",char,y.indicator));else if(!P.type.is_stream(F)&&!P.type.is_atom(F))w.throw_error(P.error.domain("stream_or_alias",F,y.indicator));else if(!P.type.is_stream(Z)||Z.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(Z.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(Z.type==="text")w.throw_error(P.error.permission("input","text_stream",F,y.indicator));else if(Z.position==="past_end_of_stream"&&Z.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{var ee;if(Z.position==="end_of_stream")ee="end_of_file",Z.position="past_end_of_stream";else if(ee=Z.stream.get_byte(Z.position),ee===null){w.throw_error(P.error.representation("byte",y.indicator));return}w.prepend([new Se(D.goal.replace(new _("=",[new ke(ee,!1),z])),D.substitution,D)])}},"put_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new Se(D.goal.replace(new _(",",[new _("current_output",[new be("S")]),new _("put_byte",[new be("S"),F])])),D.substitution,D)])},"put_byte/2":function(w,D,y){var F=y.args[0],z=y.args[1],Z=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);P.type.is_variable(F)||P.type.is_variable(z)?w.throw_error(P.error.instantiation(y.indicator)):P.type.is_byte(z)?!P.type.is_variable(F)&&!P.type.is_stream(F)&&!P.type.is_atom(F)?w.throw_error(P.error.domain("stream_or_alias",F,y.indicator)):!P.type.is_stream(Z)||Z.stream===null?w.throw_error(P.error.existence("stream",F,y.indicator)):Z.input?w.throw_error(P.error.permission("output","stream",F,y.indicator)):Z.type==="text"?w.throw_error(P.error.permission("output","text_stream",F,y.indicator)):Z.stream.put_byte(z.value,Z.position)&&(typeof Z.position=="number"&&Z.position++,w.success(D)):w.throw_error(P.error.type("byte",z,y.indicator))},"read/1":function(w,D,y){var F=y.args[0];w.prepend([new Se(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("read_term",[new be("S"),F,new _("[]",[])])])),D.substitution,D)])},"read/2":function(w,D,y){var F=y.args[0],z=y.args[1];w.prepend([new Se(D.goal.replace(new _("read_term",[F,z,new _("[]",[])])),D.substitution,D)])},"read_term/2":function(w,D,y){var F=y.args[0],z=y.args[1];w.prepend([new Se(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("read_term",[new be("S"),F,z])])),D.substitution,D)])},"read_term/3":function(w,D,y){var F=y.args[0],z=y.args[1],Z=y.args[2],ee=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(P.type.is_variable(F)||P.type.is_variable(Z))w.throw_error(P.error.instantiation(y.indicator));else if(!P.type.is_list(Z))w.throw_error(P.error.type("list",Z,y.indicator));else if(!P.type.is_stream(F)&&!P.type.is_atom(F))w.throw_error(P.error.domain("stream_or_alias",F,y.indicator));else if(!P.type.is_stream(ee)||ee.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(ee.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(ee.type==="binary")w.throw_error(P.error.permission("input","binary_stream",F,y.indicator));else if(ee.position==="past_end_of_stream"&&ee.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{for(v
Line truncated
|
||||
`;for(let r of this.project.workspacesByCwd.values()){let s=r.relativeCwd;t+=`workspace(${zd(s)}).
|
||||
`,t+=`workspace_ident(${zd(s)}, ${zd(H.stringifyIdent(r.anchoredLocator))}).
|
||||
`,t+=`workspace_version(${zd(s)}, ${zd(r.manifest.version)}).
|
||||
`;for(let a of Dme)for(let n of r.manifest[a].values())t+=`workspace_has_dependency(${zd(s)}, ${zd(H.stringifyIdent(n))}, ${zd(n.range)}, ${a}).
|
||||
`}return t+=`workspace(_) :- false.
|
||||
`,t+=`workspace_ident(_, _) :- false.
|
||||
`,t+=`workspace_version(_, _) :- false.
|
||||
`,t+=`workspace_has_dependency(_, _, _, _) :- false.
|
||||
`,t}getDeclarations(){let t="";return t+=`gen_enforced_dependency(_, _, _, _) :- false.
|
||||
`,t+=`gen_enforced_field(_, _, _) :- false.
|
||||
`,t}get fullSource(){return`${this.getProjectDatabase()}
|
||||
${this.source}
|
||||
${this.getDeclarations()}`}createSession(){return new p9(this.project,this.fullSource)}async processClassic(){let t=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(t),enforcedFields:await this.genEnforcedFields(t)}}async process(){let{enforcedDependencies:t,enforcedFields:r}=await this.processClassic(),s=new Map;for(let{workspace:a,dependencyIdent:n,dependencyRange:c,dependencyType:f}of t){let p=lS([f,H.stringifyIdent(n)]),h=qe.getMapWithDefault(s,a.cwd);qe.getMapWithDefault(h,p).set(c??void 0,new Set)}for(let{workspace:a,fieldPath:n,fieldValue:c}of r){let f=lS(n),p=qe.getMapWithDefault(s,a.cwd);qe.getMapWithDefault(p,f).set(JSON.parse(c)??void 0,new Set)}return{manifestUpdates:s,reportedErrors:new Map}}async genEnforcedDependencies(t){let r=[];for await(let s of t.makeQuery("workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).")){let a=Y.resolve(this.project.cwd,Fm(s.links.WorkspaceCwd)),n=Fm(s.links.DependencyIdent),c=Fm(s.links.DependencyRange),f=Fm(s.links.DependencyType);if(a===null||n===null)throw new Error("Invalid rule");let p=this.project.getWorkspaceByCwd(a),h=H.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:c,dependencyType:f})}return qe.sortMap(r,[({dependencyRange:s})=>s!==null?"0":"1",({workspace:s})=>H.stringifyIdent(s.anchoredLocator),({dependencyIdent:s})=>H.stringifyIdent(s)])}async genEnforcedFields(t){let r=[];for await(let s of t.makeQuery("workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).")){let a=Y.resolve(this.project.cwd,Fm(s.links.WorkspaceCwd)),n=Fm(s.links.FieldPath),c=Fat(s.links.FieldValue);if(a===null||n===null)throw new Error("Invalid rule");let f=this.project.getWorkspaceByCwd(a);r.push({workspace:f,fieldPath:n,fieldValue:c})}return qe.sortMap(r,[({workspace:s})=>H.stringifyIdent(s.anchoredLocator),({fieldPath:s})=>s])}async*query(t){let r=this.createSession();for await(let s of r.makeQuery(t)){let a={};for(let[n,c]of Object.entries(s.links))n!=="_"&&(a[n]=Fm(c));yield a}}}});var Ume=G(eF=>{"use strict";Object.defineProperty(eF,"__esModule",{value:!0});function PS(e){let t=[...e.caches],r=t.shift();return r===void 0?Mme():{get(s,a,n={miss:()=>Promise.resolve()}){return r.get(s,a,n).catch(()=>PS({caches:t}).get(s,a,n))},set(s,a){return r.set(s,a).catch(()=>PS({caches:t}).set(s,a))},delete(s){return r.delete(s).catch(()=>PS({caches:t}).delete(s))},clear(){return r.clear().catch(()=>PS({caches:t}).clear())}}}function Mme(){return{get(e,t,r={miss:()=>Promise.resolve()}){return t().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}eF.createFallbackableCache=PS;eF.createNullCache=Mme});var Hme=G((uVt,_me)=>{_me.exports=Ume()});var jme=G(P9=>{"use strict";Object.defineProperty(P9,"__esModule",{value:!0});function $at(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);let c=s(),f=a&&a.miss||(()=>Promise.resolve());return c.then(p=>f(p)).then(()=>c)},set(r,s){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(r){return delete t[JSON.stringify(r)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}P9.createInMemoryCache=$at});var qme=G((AVt,Gme)=>{Gme.exports=jme()});var Wme=G(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});function elt(e,t,r){let s={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers(){return e===x9.WithinHeaders?s:{}},queryParameters(){return e===x9.WithinQueryParameters?s:{}}}}function tlt(e){let t=0,r=()=>(t++,new Promise(s=>{setTimeout(()=>{s(e(r))},Math.min(100*t,1e3))}));return e(r)}function Yme(e,t=(r,s)=>Promise.resolve()){return Object.assign(e,{wait(r){return Yme(e.then(s=>Promise.all([t(s,r),s])).then(s=>s[1]))}})}function rlt(e){let t=e.length-1;for(t;t>0;t--){let r=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[r],e[r]=s}return e}function nlt(e,t){return t&&Object.keys(t).forEach(r=>{e[r]=t[r](e)}),e}function ilt(e,...t){let r=0;return e.replace(/%s/g,()=>encodeURIComponent(t[r++]))}var slt="4.22.1",olt=e=>()=>e.transporter.requester.destroy(),x9={WithinQueryParameters:0,WithinHeaders:1};rf.AuthMode=x9;rf.addMethods=nlt;rf.createAuth=elt;rf.createRetryablePromise=tlt;rf.createWaitablePromise=Yme;rf.destroy=olt;rf.encode=ilt;rf.shuffle=rlt;rf.version=slt});var xS=G((hVt,Vme)=>{Vme.exports=Wme()});var Kme=G(k9=>{"use strict";Object.defineProperty(k9,"__esModule",{value:!0});var alt={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};k9.MethodEnum=alt});var kS=G((gVt,Jme)=>{Jme.exports=Kme()});var uye=G(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var Zme=kS();function Q9(e,t){let r=e||{},s=r.data||{};return Object.keys(r).forEach(a=>{["timeout","head
Line truncated
|
||||
`;f!==s&&(s=f,e.write(aIe.default.eraseLines(r)+f),r=f.split(`
|
||||
`).length)};return n.clear=()=>{e.write(aIe.default.eraseLines(r)),s="",r=0},n.done=()=>{s="",r=0,t||(lIe.default.show(),a=!1)},n};jS.default={create:tft}});var fIe=G((i7t,rft)=>{rft.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY_BUILD_BASE",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}}]});var hIe=G(ic=>{"use strict";var pIe=fIe(),pA=process.env;Object.defineProperty(ic,"_vendors",{value:pIe.map(function(e){return e.constant})});ic.name=null;ic.isPR=null;pIe.forEach(function(e){var t=Array.isArray(e.env)?e.env:[e.env],r=t.every(function(s){return AIe(s)});if(ic[e.constant]=r,r)switch(ic.name=e.name,typeof e.pr){case"string":ic.isPR=!!pA[e.pr];break;case"object":"env"in e.pr?ic.isPR=e.pr.env in pA&&pA[e.pr.env]!==e.pr.ne:"any"in e.pr?ic.isPR=e.pr.any.some(function(s){return!!pA[s]}):ic.isPR=AIe(e.pr);break;default:ic.isPR=null}});ic.isCI=!!(pA.CI||pA.CONTINUOUS_INTEGRATION||pA.BUILD_NUMBER||pA.RUN_ID||ic.name);function AIe(e){return typeof e=="string"?!!pA[e]:Object.keys(e).every(function(t){return pA[t]===e[t]})}});var gIe=G((o7t,dIe)=>{"use strict";dIe.exports=hIe().isCI});var yIe=G((a7t,mIe)=>{"use strict";var nft=e=>{let t=new Set;do for(let r of Reflect.ownKeys(e))t.add([e,r]);while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t};mIe.exports=(e,{include:t,exclude:r}={})=>{let s=a=>{let n=c=>typeof c=="string"?a===c:c.test(a);return t?t.some(n):r?!r.some(n):!0};for(let[a,n]of nft(e.constructor.prototype)){if(n==="constructor"||!s(n))continue;let c=Reflect.getOwnPropertyDescriptor(a,n);c&&typeof c.value=="function"&&(e[n]=e[n].bind(e))}return e}});var vIe=G(zn=>{"use strict";var fw,YS,IF,gq;typeof performance=="object"&&typeof performance.now=="function"?(EIe=performance,zn.unstable_now=function(){return EIe.now()}):(uq=Date,IIe=uq.now(),zn.unstable_now=function(){return uq.now()-IIe});var EIe,uq,IIe;typeof window>"u"||typeof MessageChannel!="function"?(uw=null,fq=null,Aq=function(){if(uw!==null)try{var e=zn.unstable_now();uw(!0,e),uw=null}catch(t){throw setTimeout(Aq,0),t}},fw=function(e){uw!==null?setTimeout(fw,0,e):(uw=e,setTimeout(Aq,0))},YS=function(e,t){fq=setTimeout(e,t)},IF=function(){clearTimeout(fq)},zn.unstable_shouldYield=function(){return!1},gq=zn.unstable_forceFrameRate=function(){}):(CIe=window.setTimeout,wIe=window.clearTimeout,typeof console<"u"&&(BIe=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof BIe!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),GS=!1,qS=null,mF=-1,pq=5,hq=0,zn.unstable_shouldYield=function(){return zn.unstable_now()>=hq},gq=function(){},zn.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):pq=0<e?Math
Line truncated
|
||||
`+uu+v}var we=!1;function Ot(v,b){if(!v||we)return"";we=!0;var Q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error()},Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(ht){var j=ht}Reflect.construct(v,[],b)}else{try{b.call()}catch(ht){j=ht}v.call(b.prototype)}else{try{throw Error()}catch(ht){j=ht}v()}}catch(ht){if(ht&&j&&typeof ht.stack=="string"){for(var V=ht.stack.split(`
|
||||
`),ne=j.stack.split(`
|
||||
`),Be=V.length-1,_e=ne.length-1;1<=Be&&0<=_e&&V[Be]!==ne[_e];)_e--;for(;1<=Be&&0<=_e;Be--,_e--)if(V[Be]!==ne[_e]){if(Be!==1||_e!==1)do if(Be--,_e--,0>_e||V[Be]!==ne[_e])return`
|
||||
`+V[Be].replace(" at new "," at ");while(1<=Be&&0<=_e);break}}}finally{we=!1,Error.prepareStackTrace=Q}return(v=v?v.displayName||v.name:"")?cc(v):""}var uc=[],Oi=-1;function fo(v){return{current:v}}function Rt(v){0>Oi||(v.current=uc[Oi],uc[Oi]=null,Oi--)}function Tn(v,b){Oi++,uc[Oi]=v.current,v.current=b}var ha={},Gi=fo(ha),Li=fo(!1),Ya=ha;function yn(v,b){var Q=v.type.contextTypes;if(!Q)return ha;var j=v.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===b)return j.__reactInternalMemoizedMaskedChildContext;var V={},ne;for(ne in Q)V[ne]=b[ne];return j&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=b,v.__reactInternalMemoizedMaskedChildContext=V),V}function Xn(v){return v=v.childContextTypes,v!=null}function fu(){Rt(Li),Rt(Gi)}function Eh(v,b,Q){if(Gi.current!==ha)throw Error(c(168));Tn(Gi,b),Tn(Li,Q)}function Wa(v,b,Q){var j=v.stateNode;if(v=b.childContextTypes,typeof j.getChildContext!="function")return Q;j=j.getChildContext();for(var V in j)if(!(V in v))throw Error(c(108,d(b)||"Unknown",V));return s({},Q,j)}function Va(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||ha,Ya=Gi.current,Tn(Gi,v),Tn(Li,Li.current),!0}function Ka(v,b,Q){var j=v.stateNode;if(!j)throw Error(c(169));Q?(v=Wa(v,b,Ya),j.__reactInternalMemoizedMergedChildContext=v,Rt(Li),Rt(Gi),Tn(Gi,v)):Rt(Li),Tn(Li,Q)}var $e=null,Ja=null,mf=n.unstable_now;mf();var fc=0,Sn=8;function da(v){if(1&v)return Sn=15,1;if(2&v)return Sn=14,2;if(4&v)return Sn=13,4;var b=24&v;return b!==0?(Sn=12,b):v&32?(Sn=11,32):(b=192&v,b!==0?(Sn=10,b):v&256?(Sn=9,256):(b=3584&v,b!==0?(Sn=8,b):v&4096?(Sn=7,4096):(b=4186112&v,b!==0?(Sn=6,b):(b=62914560&v,b!==0?(Sn=5,b):v&67108864?(Sn=4,67108864):v&134217728?(Sn=3,134217728):(b=805306368&v,b!==0?(Sn=2,b):1073741824&v?(Sn=1,1073741824):(Sn=8,v))))))}function _A(v){switch(v){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function HA(v){switch(v){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(c(358,v))}}function ga(v,b){var Q=v.pendingLanes;if(Q===0)return Sn=0;var j=0,V=0,ne=v.expiredLanes,Be=v.suspendedLanes,_e=v.pingedLanes;if(ne!==0)j=ne,V=Sn=15;else if(ne=Q&134217727,ne!==0){var ht=ne&~Be;ht!==0?(j=da(ht),V=Sn):(_e&=ne,_e!==0&&(j=da(_e),V=Sn))}else ne=Q&~Be,ne!==0?(j=da(ne),V=Sn):_e!==0&&(j=da(_e),V=Sn);if(j===0)return 0;if(j=31-ss(j),j=Q&((0>j?0:1<<j)<<1)-1,b!==0&&b!==j&&!(b&Be)){if(da(b),V<=Sn)return b;Sn=V}if(b=v.entangledLanes,b!==0)for(v=v.entanglements,b&=j;0<b;)Q=31-ss(b),V=1<<Q,j|=v[Q],b&=~V;return j}function Ql(v){return v=v.pendingLanes&-1073741825,v!==0?v:v&1073741824?1073741824:0}function Ut(v,b){switch(v){case 15:return 1;case 14:return 2;case 12:return v=Rn(24&~b),v===0?Ut(10,b):v;case 10:return v=Rn(192&~b),v===0?Ut(8,b):v;case 8:return v=Rn(3584&~b),v===0&&(v=Rn(4186112&~b),v===0&&(v=512)),v;case 2:return b=Rn(805306368&~b),b===0&&(b=268435456),b}throw Error(c(358,v))}function Rn(v){return v&-v}function ma(v){for(var b=[],Q=0;31>Q;Q++)b.push(v);return b}function za(v,b,Q){v.pendingLanes|=b;var j=b-1;v.suspendedLanes&=j,v.pingedLanes&=j,v=v.eventTimes,b=31-ss(b),v[b]=Q}var ss=Math.clz32?Math.clz32:pc,Ac=Math.log,Au=Math.LN2;function pc(v){return v===0?32:31-(Ac(v)/Au|0)|0}var Za=n.unstable_runWithPriority,Mi=n.unstable_scheduleCallback,vs=n.unstable_cancelCallback,Tl=n.unstable_shouldYield,yf=n.unstable_requestPaint,hc=n.unstable_now,vi=n.unstable_getCurrentPriorityLevel,Fn=n.unstable_ImmediatePriority,dc=n.unstable_UserBlockingPriority,ze=n.unstable_NormalPriority,at=n.unstable_LowPriority,St=n.unstable_IdlePriority,lr={},te=yf!==void 0?yf:function(){},Ee=null,Oe=null,mt=!1,Et=hc(),Dt=1e4>Et?hc:function(){return hc()-Et};function tr(){switch(vi()){case Fn:return 99;case dc:return 98;case ze:return 97;case at:return 96;case St:return 95;default:throw Error(c(332))}}function pn(v){switch(v){case 99:return Fn;case 98:return dc;case 97:return ze;case 96:return at;case 95:return St;default:throw Error(c(332))}}function ui(v,b){return v=pn(v),Za(v,b)}function qi(v,b,Q){return v=pn(v),Mi(v,b,Q)}function Nn(){if(Oe!==null){var v=Oe;Oe=null,vs(v)}Xa()}function Xa(){if(!mt&&Ee!==null){mt=!0;var v=0;try{var b=Ee;ui(99,function(){for(;v<b.length;v++){var Q=b[v];do Q=Q(!0);while(Q!==null)}}),Ee=null}catch(Q){throw Ee!==null&&(Ee=Ee.slice(v+1)),Mi(Fn,Nn),Q}finally{mt=!1}}}var By=f.ReactCurrentBatchConfig;function z1(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var Qo=typeof Object.is=="function"?Object.is:z1,vy=Object.prototype.hasOwnProperty;function Ih(v,b){if(Qo(v,b))return!0;if(typeof v!="object"||v===null||typeof b!="object"||b===null)return!1;var Q=Object.keys(v),j=Object.keys(b);if(Q.length!==j.length)return!1;for(j=0;j<Q.length;j++)if(!vy.call(b,Q[j])||!Qo(v[Q[j]],b[Q[j]]))return!1;return!0}function Z1(v){switch(v.tag){case 5:return cc(v.type);case 16:return cc("Lazy"
Line truncated
|
||||
Error generating stack: `+ne.message+`
|
||||
`+ne.stack}return{value:v,source:b,stack:V}}function Kg(v,b){try{console.error(b.value)}catch(Q){setTimeout(function(){throw Q})}}var LL=typeof WeakMap=="function"?WeakMap:Map;function r2(v,b,Q){Q=Fl(-1,Q),Q.tag=3,Q.payload={element:null};var j=b.value;return Q.callback=function(){Wy||(Wy=!0,g2=j),Kg(v,b)},Q}function Jg(v,b,Q){Q=Fl(-1,Q),Q.tag=3;var j=v.type.getDerivedStateFromError;if(typeof j=="function"){var V=b.value;Q.payload=function(){return Kg(v,b),j(V)}}var ne=v.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(Q.callback=function(){typeof j!="function"&&(mc===null?mc=new Set([this]):mc.add(this),Kg(v,b));var Be=b.stack;this.componentDidCatch(b.value,{componentStack:Be!==null?Be:""})}),Q}var ML=typeof WeakSet=="function"?WeakSet:Set;function n2(v){var b=v.ref;if(b!==null)if(typeof b=="function")try{b(null)}catch(Q){Tf(v,Q)}else b.current=null}function Ny(v,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&v!==null){var Q=v.memoizedProps,j=v.memoizedState;v=b.stateNode,b=v.getSnapshotBeforeUpdate(b.elementType===b.type?Q:To(b.type,Q),j),v.__reactInternalSnapshotBeforeUpdate=b}return;case 3:F&&b.flags&256&&Ns(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(c(163))}function Rh(v,b){if(b=b.updateQueue,b=b!==null?b.lastEffect:null,b!==null){var Q=b=b.next;do{if((Q.tag&v)===v){var j=Q.destroy;Q.destroy=void 0,j!==void 0&&j()}Q=Q.next}while(Q!==b)}}function gP(v,b,Q){switch(Q.tag){case 0:case 11:case 15:case 22:if(b=Q.updateQueue,b=b!==null?b.lastEffect:null,b!==null){v=b=b.next;do{if((v.tag&3)===3){var j=v.create;v.destroy=j()}v=v.next}while(v!==b)}if(b=Q.updateQueue,b=b!==null?b.lastEffect:null,b!==null){v=b=b.next;do{var V=v;j=V.next,V=V.tag,V&4&&V&1&&(kP(Q,v),KL(Q,v)),v=j}while(v!==b)}return;case 1:v=Q.stateNode,Q.flags&4&&(b===null?v.componentDidMount():(j=Q.elementType===Q.type?b.memoizedProps:To(Q.type,b.memoizedProps),v.componentDidUpdate(j,b.memoizedState,v.__reactInternalSnapshotBeforeUpdate))),b=Q.updateQueue,b!==null&&Dy(Q,b,v);return;case 3:if(b=Q.updateQueue,b!==null){if(v=null,Q.child!==null)switch(Q.child.tag){case 5:v=ke(Q.child.stateNode);break;case 1:v=Q.child.stateNode}Dy(Q,b,v)}return;case 5:v=Q.stateNode,b===null&&Q.flags&4&&ao(v,Q.type,Q.memoizedProps,Q);return;case 6:return;case 4:return;case 12:return;case 13:Z&&Q.memoizedState===null&&(Q=Q.alternate,Q!==null&&(Q=Q.memoizedState,Q!==null&&(Q=Q.dehydrated,Q!==null&&cu(Q))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(c(163))}function mP(v,b){if(F)for(var Q=v;;){if(Q.tag===5){var j=Q.stateNode;b?mh(j):co(Q.stateNode,Q.memoizedProps)}else if(Q.tag===6)j=Q.stateNode,b?yh(j):qn(j,Q.memoizedProps);else if((Q.tag!==23&&Q.tag!==24||Q.memoizedState===null||Q===v)&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===v)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===v)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}}function Oy(v,b){if(Ja&&typeof Ja.onCommitFiberUnmount=="function")try{Ja.onCommitFiberUnmount($e,b)}catch{}switch(b.tag){case 0:case 11:case 14:case 15:case 22:if(v=b.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var Q=v=v.next;do{var j=Q,V=j.destroy;if(j=j.tag,V!==void 0)if(j&4)kP(b,Q);else{j=b;try{V()}catch(ne){Tf(j,ne)}}Q=Q.next}while(Q!==v)}break;case 1:if(n2(b),v=b.stateNode,typeof v.componentWillUnmount=="function")try{v.props=b.memoizedProps,v.state=b.memoizedState,v.componentWillUnmount()}catch(ne){Tf(b,ne)}break;case 5:n2(b);break;case 4:F?CP(v,b):z&&z&&(b=b.stateNode.containerInfo,v=ou(b),NA(b,v))}}function yP(v,b){for(var Q=b;;)if(Oy(v,Q),Q.child===null||F&&Q.tag===4){if(Q===b)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===b)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}else Q.child.return=Q,Q=Q.child}function Ly(v){v.alternate=null,v.child=null,v.dependencies=null,v.firstEffect=null,v.lastEffect=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.return=null,v.updateQueue=null}function EP(v){return v.tag===5||v.tag===3||v.tag===4}function IP(v){if(F){e:{for(var b=v.return;b!==null;){if(EP(b))break e;b=b.return}throw Error(c(160))}var Q=b;switch(b=Q.stateNode,Q.tag){case 5:var j=!1;break;case 3:b=b.containerInfo,j=!0;break;case 4:b=b.containerInfo,j=!0;break;default:throw Error(c(161))}Q.flags&16&&(df(b),Q.flags&=-17);e:t:for(Q=v;;){for(;Q.sibling===null;){if(Q.return===null||EP(Q.return)){Q=null;break e}Q=Q.return}for(Q.sibling.return=Q.return,Q=Q.sibling;Q.tag!==5&&Q.tag!==6&&Q.tag!==18;){if(Q.flags&2||Q.child===null||Q.tag===4)continue t;Q.child.return=Q,Q=Q.child}if(!(Q.flags&2)){Q=Q.stateNode;break e}}j?i2(v,Q,b):s2(v,Q,b)}}function i2(v,b,Q){var j=v.tag,V=j===5||j===6;if(V)v=V?v.stateNode:v.stateNode.instance,b?lo(Q,v,b):Do(Q,v);else if(j!==4&&(v=v.child,v!==null))for(i2(v,b,Q),v=v.sibling;v!==null;)i2(v,b,Q),v=v.sibling}function s2(v,b,Q){var j=v.tag,V=j===5||j===6;if(V)v=V?v.stateNode:v.stateNode.instance,b?ji(Q,v,b):ci(Q,v);els
Line truncated
|
||||
|
||||
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}bs!==5&&(bs=2),ht=Vg(ht,_e),Xt=Be;do{switch(Xt.tag){case 3:ne=ht,Xt.flags|=4096,b&=-b,Xt.lanes|=b;var ri=r2(Xt,ne,b);by(Xt,ri);break e;case 1:ne=ht;var Tr=Xt.type,On=Xt.stateNode;if(!(Xt.flags&64)&&(typeof Tr.getDerivedStateFromError=="function"||On!==null&&typeof On.componentDidCatch=="function"&&(mc===null||!mc.has(On)))){Xt.flags|=4096,b&=-b,Xt.lanes|=b;var jn=Jg(Xt,ne,b);by(Xt,jn);break e}}Xt=Xt.return}while(Xt!==null)}xP(Q)}catch(Zr){b=Zr,Zi===Q&&Q!==null&&(Zi=Q=Q.return);continue}break}while(!0)}function DP(){var v=qy.current;return qy.current=kt,v===null?kt:v}function s0(v,b){var Q=xr;xr|=16;var j=DP();po===v&&Ms===b||Lh(v,b);do try{qL();break}catch(V){bP(v,V)}while(!0);if(Ng(),xr=Q,qy.current=j,Zi!==null)throw Error(c(261));return po=null,Ms=0,bs}function qL(){for(;Zi!==null;)PP(Zi)}function YL(){for(;Zi!==null&&!Tl();)PP(Zi)}function PP(v){var b=RP(v.alternate,v,tp);v.memoizedProps=v.pendingProps,b===null?xP(v):Zi=b,c2.current=null}function xP(v){var b=v;do{var Q=b.alternate;if(v=b.return,b.flags&2048){if(Q=OL(b),Q!==null){Q.flags&=2047,Zi=Q;return}v!==null&&(v.firstEffect=v.lastEffect=null,v.flags|=2048)}else{if(Q=NL(Q,b,tp),Q!==null){Zi=Q;return}if(Q=b,Q.tag!==24&&Q.tag!==23||Q.memoizedState===null||tp&1073741824||!(Q.mode&4)){for(var j=0,V=Q.child;V!==null;)j|=V.lanes|V.childLanes,V=V.sibling;Q.childLanes=j}v!==null&&!(v.flags&2048)&&(v.firstEffect===null&&(v.firstEffect=b.firstEffect),b.lastEffect!==null&&(v.lastEffect!==null&&(v.lastEffect.nextEffect=b.firstEffect),v.lastEffect=b.lastEffect),1<b.flags&&(v.lastEffect!==null?v.lastEffect.nextEffect=b:v.firstEffect=b,v.lastEffect=b))}if(b=b.sibling,b!==null){Zi=b;return}Zi=b=v}while(b!==null);bs===0&&(bs=5)}function rp(v){var b=tr();return ui(99,WL.bind(null,v,b)),null}function WL(v,b){do Bu();while(e0!==null);if(xr&48)throw Error(c(327));var Q=v.finishedWork;if(Q===null)return null;if(v.finishedWork=null,v.finishedLanes=0,Q===v.current)throw Error(c(177));v.callbackNode=null;var j=Q.lanes|Q.childLanes,V=j,ne=v.pendingLanes&~V;v.pendingLanes=V,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=V,v.mutableReadLanes&=V,v.entangledLanes&=V,V=v.entanglements;for(var Be=v.eventTimes,_e=v.expirationTimes;0<ne;){var ht=31-ss(ne),Wt=1<<ht;V[ht]=0,Be[ht]=-1,_e[ht]=-1,ne&=~Wt}if(Cu!==null&&!(j&24)&&Cu.has(v)&&Cu.delete(v),v===po&&(Zi=po=null,Ms=0),1<Q.flags?Q.lastEffect!==null?(Q.lastEffect.nextEffect=Q,j=Q.firstEffect):j=Q:j=Q.firstEffect,j!==null){V=xr,xr|=32,c2.current=null,n0=tt(v.containerInfo),i0=!1,sr=j;do try{VL()}catch(Ye){if(sr===null)throw Error(c(330));Tf(sr,Ye),sr=sr.nextEffect}while(sr!==null);n0=null,sr=j;do try{for(Be=v;sr!==null;){var Sr=sr.flags;if(Sr&16&&F&&df(sr.stateNode),Sr&128){var Mr=sr.alternate;if(Mr!==null){var Xt=Mr.ref;Xt!==null&&(typeof Xt=="function"?Xt(null):Xt.current=null)}}switch(Sr&1038){case 2:IP(sr),sr.flags&=-3;break;case 6:IP(sr),sr.flags&=-3,o2(sr.alternate,sr);break;case 1024:sr.flags&=-1025;break;case 1028:sr.flags&=-1025,o2(sr.alternate,sr);break;case 4:o2(sr.alternate,sr);break;case 8:_e=Be,ne=sr,F?CP(_e,ne):yP(_e,ne);var $n=ne.alternate;Ly(ne),$n!==null&&Ly($n)}sr=sr.nextEffect}}catch(Ye){if(sr===null)throw Error(c(330));Tf(sr,Ye),sr=sr.nextEffect}while(sr!==null);i0&&ut(),Fe(v.containerInfo),v.current=Q,sr=j;do try{for(Sr=v;sr!==null;){var Ei=sr.flags;if(Ei&36&&gP(Sr,sr.alternate,sr),Ei&128){Mr=void 0;var sl=sr.ref;if(sl!==null){var rt=sr.stateNode;switch(sr.tag){case 5:Mr=ke(rt);break;default:Mr=rt}typeof sl=="function"?sl(Mr):sl.current=Mr}}sr=sr.nextEffect}}catch(Ye){if(sr===null)throw Error(c(330));Tf(sr,Ye),sr=sr.nextEffect}while(sr!==null);sr=null,te(),xr=V}else v.current=Q;if(Qf)Qf=!1,e0=v,t0=b;else for(sr=j;sr!==null;)b=sr.nextEffect,sr.nextEffect=null,sr.flags&8&&(Ei=sr,Ei.sibling=null,Ei.stateNode=null),sr=b;if(j=v.pendingLanes,j===0&&(mc=null),j===1?v===E2?r0++:(r0=0,E2=v):r0=0,Q=Q.stateNode,Ja&&typeof Ja.onCommitFiberRoot=="function")try{Ja.onCommitFiberRoot($e,Q,void 0,(Q.current.flags&64)===64)}catch{}if(Ca(v,Dt()),Wy)throw Wy=!1,v=g2,g2=null,v;return xr&8||Nn(),null}function VL(){for(;sr!==null;){var v=sr.alternate;i0||n0===null||(sr.flags&8?be(sr,n0)&&(i0=!0,Ne()):sr.tag===13&&UL(v,sr)&&be(sr,n0)&&(i0=!0,Ne()));var b=sr.flags;b&256&&Ny(v,sr),!(b&512)||Qf||(Qf=!0,qi(97,function(){return Bu(),null})),sr=sr.nextEffect}}function Bu(){if(t0!==90){var v=97<t0?97:t0;return t0=90,ui(v,JL)}return!1}function KL(v,b){m2.push(b,v),Qf||(Qf=!0,qi(97,function(){return Bu(),null}))}function kP(v,b){y2.push(b,v),Qf||(Qf=!0,qi(97,function(){return Bu(),null}))}function JL(){if(e0===null)return!1;var v=e0;if(e0=null,xr&48)throw Error(c(331));var b=xr;xr|=32;var Q=y2;y2=[];for(var j=0;j<Q.length;j+=2){var V=Q[j],ne=Q[j+1],Be=V.destroy;if(V.destroy=void 0,typeof Be=="function")try{Be()}catch(ht){if(ne===null)throw Error(c(330));Tf(ne,ht)}}for(Q=m2,m2=[],j=0;j<Q.length;j+=2){V=Q[j],ne=Q[j+1];try{va
Line truncated
|
||||
`+(j.join(" > ")+`
|
||||
|
||||
No matching component was found for:
|
||||
`)+v.join(" > ")}return null},r.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return ke(v.child.stateNode);default:return v.child.stateNode}},r.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:eM,findFiberByHostInstance:v.findFiberByHostInstance||tM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")v=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!b.isDisabled&&b.supportsFiber)try{$e=b.inject(v),Ja=b}catch{}v=!0}return v},r.observeVisibleRects=function(v,b,Q,j){if(!Yt)throw Error(c(363));v=l2(v,b);var V=on(v,Q,j).disconnect;return{disconnect:function(){V()}}},r.registerMutableSourceForHydration=function(v,b){var Q=b._getVersion;Q=Q(b._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[b,Q]:v.mutableSourceEagerHydrationData.push(b,Q)},r.runWithPriority=function(v,b){var Q=fc;try{return fc=v,b()}finally{fc=Q}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(v,b){var Q=xr;xr&=-2,xr|=8;try{return v(b)}finally{xr=Q,xr===0&&(kf(),Nn())}},r.updateContainer=function(v,b,Q,j){var V=b.current,ne=Lo(),Be=Ds(V);e:if(Q){Q=Q._reactInternals;t:{if(ve(Q)!==Q||Q.tag!==1)throw Error(c(170));var _e=Q;do{switch(_e.tag){case 3:_e=_e.stateNode.context;break t;case 1:if(Xn(_e.type)){_e=_e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}_e=_e.return}while(_e!==null);throw Error(c(171))}if(Q.tag===1){var ht=Q.type;if(Xn(ht)){Q=Wa(Q,ht,_e);break e}}Q=_e}else Q=ha;return b.context===null?b.context=Q:b.pendingContext=Q,b=Fl(ne,Be),b.payload={element:v},j=j===void 0?null:j,j!==null&&(b.callback=j),Nl(V,b),_l(V,Be,ne),Be},r}});var PIe=G((f7t,DIe)=>{"use strict";DIe.exports=bIe()});var kIe=G((A7t,xIe)=>{"use strict";var oft={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2};xIe.exports=oft});var FIe=G((p7t,RIe)=>{"use strict";var aft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},BF=function(){function e(t,r){for(var s=0;s<r.length;s++){var a=r[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,s){return r&&e(t.prototype,r),s&&e(t,s),t}}();function wq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var sf=kIe(),lft=function(){function e(t,r,s,a,n,c){Bq(this,e),this.left=t,this.right=r,this.top=s,this.bottom=a,this.width=n,this.height=c}return BF(e,[{key:"fromJS",value:function(r){r(this.left,this.right,this.top,this.bottom,this.width,this.height)}},{key:"toString",value:function(){return"<Layout#"+this.left+":"+this.right+";"+this.top+":"+this.bottom+";"+this.width+":"+this.height+">"}}]),e}(),QIe=function(){BF(e,null,[{key:"fromJS",value:function(r){var s=r.width,a=r.height;return new e(s,a)}}]);function e(t,r){Bq(this,e),this.width=t,this.height=r}return BF(e,[{key:"fromJS",value:function(r){r(this.width,this.height)}},{key:"toStri
Line truncated
|
||||
`+Module.extraStackTrace()),demangleAll(e)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw"Runtime error: expected the system to be little-endian!";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t();continue}var r=t.func;typeof r=="number"?t.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,t.arg):r(t.arg===void 0?null:t.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}Module.addOnPreRun=addOnPreRun;function addOnInit(e){__ATINIT__.unshift(e)}Module.addOnInit=addOnInit;function addOnPreMain(e){__ATMAIN__.unshift(e)}Module.addOnPreMain=addOnPreMain;function addOnExit(e){__ATEXIT__.unshift(e)}Module.addOnExit=addOnExit;function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(e,t,r){var s=r>0?r:lengthBytesUTF8(e)+1,a=new Array(s),n=stringToUTF8Array(e,a,0,a.length);return t&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(e){for(var t=[],r=0;r<e.length;r++){var s=e[r];s>255&&(s&=255),t.push(String.fromCharCode(s))}return t.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(e,t,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var s,a;r&&(a=t+lengthBytesUTF8(e),s=HEAP8[a]),stringToUTF8(e,t,1/0),r&&(HEAP8[a]=s)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(e,t){HEAP8.set(e,t)}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(e,t,r){for(var s=0;s<e.length;++s)HEAP8[t++>>0]=e.charCodeAt(s);r||(HEAP8[t>>0]=0)}if(Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function e(t,r){var s=t>>>16,a=t&65535,n=r>>>16,c=r&65535;return a*c+(s*c+a*n<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(e){return froundBuffer[0]=e,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e=e>>>0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.cei
Line truncated
|
||||
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r="abort("+e+") at "+stackTrace()+t;throw abortDecorators&&abortDecorators.forEach(function(s){r=s(r,e)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var _m=G((d7t,OIe)=>{"use strict";var cft=FIe(),uft=NIe(),vq=!1,Sq=null;uft({},function(e,t){if(!vq){if(vq=!0,e)throw e;Sq=t}});if(!vq)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");OIe.exports=cft(Sq.bind,Sq.lib)});var Dq=G((g7t,bq)=>{"use strict";var LIe=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);bq.exports=LIe;bq.exports.default=LIe});var UIe=G((m7t,MIe)=>{"use strict";MIe.exports=function(){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
Line truncated
|
||||
`))t=Math.max(t,hft(r));return t};xq.exports=HIe;xq.exports.default=HIe});var jIe=G(JS=>{"use strict";var dft=JS&&JS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(JS,"__esModule",{value:!0});var gft=dft(kq()),Qq={};JS.default=e=>{if(e.length===0)return{width:0,height:0};if(Qq[e])return Qq[e];let t=gft.default(e),r=e.split(`
|
||||
`).length;return Qq[e]={width:t,height:r},{width:t,height:r}}});var GIe=G(zS=>{"use strict";var mft=zS&&zS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zS,"__esModule",{value:!0});var kn=mft(_m()),yft=(e,t)=>{"position"in t&&e.setPositionType(t.position==="absolute"?kn.default.POSITION_TYPE_ABSOLUTE:kn.default.POSITION_TYPE_RELATIVE)},Eft=(e,t)=>{"marginLeft"in t&&e.setMargin(kn.default.EDGE_START,t.marginLeft||0),"marginRight"in t&&e.setMargin(kn.default.EDGE_END,t.marginRight||0),"marginTop"in t&&e.setMargin(kn.default.EDGE_TOP,t.marginTop||0),"marginBottom"in t&&e.setMargin(kn.default.EDGE_BOTTOM,t.marginBottom||0)},Ift=(e,t)=>{"paddingLeft"in t&&e.setPadding(kn.default.EDGE_LEFT,t.paddingLeft||0),"paddingRight"in t&&e.setPadding(kn.default.EDGE_RIGHT,t.paddingRight||0),"paddingTop"in t&&e.setPadding(kn.default.EDGE_TOP,t.paddingTop||0),"paddingBottom"in t&&e.setPadding(kn.default.EDGE_BOTTOM,t.paddingBottom||0)},Cft=(e,t)=>{var r;"flexGrow"in t&&e.setFlexGrow((r=t.flexGrow)!==null&&r!==void 0?r:0),"flexShrink"in t&&e.setFlexShrink(typeof t.flexShrink=="number"?t.flexShrink:1),"flexDirection"in t&&(t.flexDirection==="row"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_ROW),t.flexDirection==="row-reverse"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_ROW_REVERSE),t.flexDirection==="column"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_COLUMN),t.flexDirection==="column-reverse"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&(typeof t.flexBasis=="number"?e.setFlexBasis(t.flexBasis):typeof t.flexBasis=="string"?e.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):e.setFlexBasis(NaN)),"alignItems"in t&&((t.alignItems==="stretch"||!t.alignItems)&&e.setAlignItems(kn.default.ALIGN_STRETCH),t.alignItems==="flex-start"&&e.setAlignItems(kn.default.ALIGN_FLEX_START),t.alignItems==="center"&&e.setAlignItems(kn.default.ALIGN_CENTER),t.alignItems==="flex-end"&&e.setAlignItems(kn.default.ALIGN_FLEX_END)),"alignSelf"in t&&((t.alignSelf==="auto"||!t.alignSelf)&&e.setAlignSelf(kn.default.ALIGN_AUTO),t.alignSelf==="flex-start"&&e.setAlignSelf(kn.default.ALIGN_FLEX_START),t.alignSelf==="center"&&e.setAlignSelf(kn.default.ALIGN_CENTER),t.alignSelf==="flex-end"&&e.setAlignSelf(kn.default.ALIGN_FLEX_END)),"justifyContent"in t&&((t.justifyContent==="flex-start"||!t.justifyContent)&&e.setJustifyContent(kn.default.JUSTIFY_FLEX_START),t.justifyContent==="center"&&e.setJustifyContent(kn.default.JUSTIFY_CENTER),t.justifyContent==="flex-end"&&e.setJustifyContent(kn.default.JUSTIFY_FLEX_END),t.justifyContent==="space-between"&&e.setJustifyContent(kn.default.JUSTIFY_SPACE_BETWEEN),t.justifyContent==="space-around"&&e.setJustifyContent(kn.default.JUSTIFY_SPACE_AROUND))},wft=(e,t)=>{var r,s;"width"in t&&(typeof t.width=="number"?e.setWidth(t.width):typeof t.width=="string"?e.setWidthPercent(Number.parseInt(t.width,10)):e.setWidthAuto()),"height"in t&&(typeof t.height=="number"?e.setHeight(t.height):typeof t.height=="string"?e.setHeightPercent(Number.parseInt(t.height,10)):e.setHeightAuto()),"minWidth"in t&&(typeof t.minWidth=="string"?e.setMinWidthPercent(Number.parseInt(t.minWidth,10)):e.setMinWidth((r=t.minWidth)!==null&&r!==void 0?r:0)),"minHeight"in t&&(typeof t.minHeight=="string"?e.setMinHeightPercent(Number.parseInt(t.minHeight,10)):e.setMinHeight((s=t.minHeight)!==null&&s!==void 0?s:0))},Bft=(e,t)=>{"display"in t&&e.setDisplay(t.display==="flex"?kn.default.DISPLAY_FLEX:kn.default.DISPLAY_NONE)},vft=(e,t)=>{if("borderStyle"in t){let r=typeof t.borderStyle=="string"?1:0;e.setBorder(kn.default.EDGE_TOP,r),e.setBorder(kn.default.EDGE_BOTTOM,r),e.setBorder(kn.default.EDGE_LEFT,r),e.setBorder(kn.default.EDGE_RIGHT,r)}};zS.default=(e,t={})=>{yft(e,t),Eft(e,t),Ift(e,t),Cft(e,t),wft(e,t),Bft(e,t),vft(e,t)}});var WIe=G((w7t,YIe)=>{"use strict";var ZS=KS(),Sft=Ik(),bft=ck(),Rq=new Set(["\x1B","\x9B"]),Dft=39,qIe=e=>`${Rq.values().next().value}[${e}m`,Pft=e=>e.split(" ").map(t=>ZS(t)),Tq=(e,t,r)=>{let s=[...t],a=!1,n=ZS(Sft(e[e.length-1]));for(let[c,f]of s.entries()){let p=ZS(f);if(n+p<=r?e[e.length-1]+=f:(e.push(f),n=0),Rq.has(f))a=!0;else if(a&&f==="m"){a=!1;continue}a||(n+=p,n===r&&c<s.length-1&&(e.push(""),n=0))}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},xft=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(ZS(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},kft=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let s="",a="",n,c=Pft(e),f=[""];for(let[p,h]of e.split(" ").entries()){r.trim!==!1&&(f[f.length-1]=f[f.length-1].trimLeft());let E=ZS(f[f.length-1]);if(p!==0&&(E>=t&&(r.wordWrap===!1||r.trim===!1)&&(f.push(""),E=0),(E>0||r.trim===!1)&&(f[f.length-1]+=" ",E++)),r.hard&&c[p]>t){let C=t-E,S=1+Math.floor((c[p]-C-1)/t);Math.floor((c[p]-1)/t)<S&&f.push(""),Tq(f,h,t);continue}if(E+c[p]>t&&E>0&&c[p]>0){if(r.wordWrap===!1&&E<t){Tq(f,h,t);continue}f.push("")}if(E+c[p]>t&&r.wordWrap===!1){Tq(f,h,t);continue}f[f.
Line truncated
|
||||
`);for(let[p,h]of[...s].entries()){if(a+=h,Rq.has(h)){let C=parseFloat(/\d[^m]*/.exec(s.slice(p,p+4)));n=C===Dft?null:C}let E=bft.codes.get(Number(n));n&&E&&(s[p+1]===`
|
||||
`?a+=qIe(E):h===`
|
||||
`&&(a+=qIe(n)))}return a};YIe.exports=(e,t,r)=>String(e).normalize().replace(/\r\n/g,`
|
||||
`).split(`
|
||||
`).map(s=>kft(s,t,r)).join(`
|
||||
`)});var JIe=G((B7t,KIe)=>{"use strict";var VIe="[\uD800-\uDBFF][\uDC00-\uDFFF]",Qft=e=>e&&e.exact?new RegExp(`^${VIe}$`):new RegExp(VIe,"g");KIe.exports=Qft});var Fq=G((v7t,$Ie)=>{"use strict";var Tft=Dq(),Rft=JIe(),zIe=ck(),XIe=["\x1B","\x9B"],vF=e=>`${XIe[0]}[${e}m`,ZIe=(e,t,r)=>{let s=[];e=[...e];for(let a of e){let n=a;a.match(";")&&(a=a.split(";")[0][0]+"0");let c=zIe.codes.get(parseInt(a,10));if(c){let f=e.indexOf(c.toString());f>=0?e.splice(f,1):s.push(vF(t?c:n))}else if(t){s.push(vF(0));break}else s.push(vF(n))}if(t&&(s=s.filter((a,n)=>s.indexOf(a)===n),r!==void 0)){let a=vF(zIe.codes.get(parseInt(r,10)));s=s.reduce((n,c)=>c===a?[c,...n]:[...n,c],[])}return s.join("")};$Ie.exports=(e,t,r)=>{let s=[...e.normalize()],a=[];r=typeof r=="number"?r:s.length;let n=!1,c,f=0,p="";for(let[h,E]of s.entries()){let C=!1;if(XIe.includes(E)){let S=/\d[^m]*/.exec(e.slice(h,h+18));c=S&&S.length>0?S[0]:void 0,f<r&&(n=!0,c!==void 0&&a.push(c))}else n&&E==="m"&&(n=!1,C=!0);if(!n&&!C&&++f,!Rft({exact:!0}).test(E)&&Tft(E.codePointAt())&&++f,f>t&&f<=r)p+=E;else if(f===t&&!n&&c!==void 0)p=ZIe(a);else if(f>=r){p+=ZIe(a,!0,c);break}}return p}});var tCe=G((S7t,eCe)=>{"use strict";var eg=Fq(),Fft=KS();function SF(e,t,r){if(e.charAt(t)===" ")return t;for(let s=1;s<=3;s++)if(r){if(e.charAt(t+s)===" ")return t+s}else if(e.charAt(t-s)===" ")return t-s;return t}eCe.exports=(e,t,r)=>{r={position:"end",preferTruncationOnSpace:!1,...r};let{position:s,space:a,preferTruncationOnSpace:n}=r,c="\u2026",f=1;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(t===1)return c;let p=Fft(e);if(p<=t)return e;if(s==="start"){if(n){let h=SF(e,p-t+1,!0);return c+eg(e,h,p).trim()}return a===!0&&(c+=" ",f=2),c+eg(e,p-t+f,p)}if(s==="middle"){a===!0&&(c=" "+c+" ",f=3);let h=Math.floor(t/2);if(n){let E=SF(e,h),C=SF(e,p-(t-h)+1,!0);return eg(e,0,E)+c+eg(e,C,p).trim()}return eg(e,0,h)+c+eg(e,p-(t-h)+f,p)}if(s==="end"){if(n){let h=SF(e,t-1);return eg(e,0,h)+c}return a===!0&&(c=" "+c,f=2),eg(e,0,t-f)+c}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${s}`)}});var Oq=G(XS=>{"use strict";var rCe=XS&&XS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(XS,"__esModule",{value:!0});var Nft=rCe(WIe()),Oft=rCe(tCe()),Nq={};XS.default=(e,t,r)=>{let s=e+String(t)+String(r);if(Nq[s])return Nq[s];let a=e;if(r==="wrap"&&(a=Nft.default(e,t,{trim:!1,hard:!0})),r.startsWith("truncate")){let n="end";r==="truncate-middle"&&(n="middle"),r==="truncate-start"&&(n="start"),a=Oft.default(e,t,{position:n})}return Nq[s]=a,a}});var Mq=G(Lq=>{"use strict";Object.defineProperty(Lq,"__esModule",{value:!0});var nCe=e=>{let t="";if(e.childNodes.length>0)for(let r of e.childNodes){let s="";r.nodeName==="#text"?s=r.nodeValue:((r.nodeName==="ink-text"||r.nodeName==="ink-virtual-text")&&(s=nCe(r)),s.length>0&&typeof r.internal_transform=="function"&&(s=r.internal_transform(s))),t+=s}return t};Lq.default=nCe});var Uq=G(Pi=>{"use strict";var $S=Pi&&Pi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.setTextNodeValue=Pi.createTextNode=Pi.setStyle=Pi.setAttribute=Pi.removeChildNode=Pi.insertBeforeNode=Pi.appendChildNode=Pi.createNode=Pi.TEXT_NAME=void 0;var Lft=$S(_m()),iCe=$S(jIe()),Mft=$S(GIe()),Uft=$S(Oq()),_ft=$S(Mq());Pi.TEXT_NAME="#text";Pi.createNode=e=>{var t;let r={nodeName:e,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:e==="ink-virtual-text"?void 0:Lft.default.Node.create()};return e==="ink-text"&&((t=r.yogaNode)===null||t===void 0||t.setMeasureFunc(Hft.bind(null,r))),r};Pi.appendChildNode=(e,t)=>{var r;t.parentNode&&Pi.removeChildNode(t.parentNode,t),t.parentNode=e,e.childNodes.push(t),t.yogaNode&&((r=e.yogaNode)===null||r===void 0||r.insertChild(t.yogaNode,e.yogaNode.getChildCount())),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&bF(e)};Pi.insertBeforeNode=(e,t,r)=>{var s,a;t.parentNode&&Pi.removeChildNode(t.parentNode,t),t.parentNode=e;let n=e.childNodes.indexOf(r);if(n>=0){e.childNodes.splice(n,0,t),t.yogaNode&&((s=e.yogaNode)===null||s===void 0||s.insertChild(t.yogaNode,n));return}e.childNodes.push(t),t.yogaNode&&((a=e.yogaNode)===null||a===void 0||a.insertChild(t.yogaNode,e.yogaNode.getChildCount())),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&bF(e)};Pi.removeChildNode=(e,t)=>{var r,s;t.yogaNode&&((s=(r=t.parentNode)===null||r===void 0?void 0:r.yogaNode)===null||s===void 0||s.removeChild(t.yogaNode)),t.parentNode=null;let a=e.childNodes.indexOf(t);a>=0&&e.childNodes.splice(a,1),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&bF(e)};Pi.setAttribute=(e,t,r)=>{e.attributes[t]=r};Pi.setStyle=(e,t)=>{e.style=t,e.yogaNode&&Mft.default(e.yogaNode,t)};Pi.createTextNode=e=>{let t={nodeName:"#text",nodeValue:e,yogaLine truncated
|
||||
`).repeat(n-2),E=jq.default(f.bottomLeft+f.horizontal.repeat(a-2)+f.bottomRight,c,"foreground");s.write(e,t,p,{transformers:[]}),s.write(e,t+1,h,{transformers:[]}),s.write(e+a-1,t+1,h,{transformers:[]}),s.write(e,t+n-1,E,{transformers:[]})}}});var ICe=G(sb=>{"use strict";var Hm=sb&&sb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sb,"__esModule",{value:!0});var Jft=Hm(_m()),zft=Hm(kq()),Zft=Hm(ACe()),Xft=Hm(Oq()),$ft=Hm(pCe()),eAt=Hm(Mq()),tAt=Hm(yCe()),rAt=(e,t)=>{var r;let s=(r=e.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(s){let a=s.getComputedLeft(),n=s.getComputedTop();t=`
|
||||
`.repeat(n)+Zft.default(t,a)}return t},ECe=(e,t,r)=>{var s;let{offsetX:a=0,offsetY:n=0,transformers:c=[],skipStaticElements:f}=r;if(f&&e.internal_static)return;let{yogaNode:p}=e;if(p){if(p.getDisplay()===Jft.default.DISPLAY_NONE)return;let h=a+p.getComputedLeft(),E=n+p.getComputedTop(),C=c;if(typeof e.internal_transform=="function"&&(C=[e.internal_transform,...c]),e.nodeName==="ink-text"){let S=eAt.default(e);if(S.length>0){let x=zft.default(S),I=$ft.default(p);if(x>I){let R=(s=e.style.textWrap)!==null&&s!==void 0?s:"wrap";S=Xft.default(S,I,R)}S=rAt(e,S),t.write(h,E,S,{transformers:C})}return}if(e.nodeName==="ink-box"&&tAt.default(h,E,e,t),e.nodeName==="ink-root"||e.nodeName==="ink-box")for(let S of e.childNodes)ECe(S,t,{offsetX:h,offsetY:E,transformers:C,skipStaticElements:f})}};sb.default=ECe});var BCe=G(ob=>{"use strict";var wCe=ob&&ob.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ob,"__esModule",{value:!0});var CCe=wCe(Fq()),nAt=wCe(KS()),Gq=class{constructor(t){this.writes=[];let{width:r,height:s}=t;this.width=r,this.height=s}write(t,r,s,a){let{transformers:n}=a;s&&this.writes.push({x:t,y:r,text:s,transformers:n})}get(){let t=[];for(let s=0;s<this.height;s++)t.push(" ".repeat(this.width));for(let s of this.writes){let{x:a,y:n,text:c,transformers:f}=s,p=c.split(`
|
||||
`),h=0;for(let E of p){let C=t[n+h];if(!C)continue;let S=nAt.default(E);for(let x of f)E=x(E);t[n+h]=CCe.default(C,0,a)+E+CCe.default(C,a+S),h++}}return{output:t.map(s=>s.trimRight()).join(`
|
||||
`),height:t.length}}};ob.default=Gq});var bCe=G(ab=>{"use strict";var qq=ab&&ab.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ab,"__esModule",{value:!0});var iAt=qq(_m()),vCe=qq(ICe()),SCe=qq(BCe());ab.default=(e,t)=>{var r;if(e.yogaNode.setWidth(t),e.yogaNode){e.yogaNode.calculateLayout(void 0,void 0,iAt.default.DIRECTION_LTR);let s=new SCe.default({width:e.yogaNode.getComputedWidth(),height:e.yogaNode.getComputedHeight()});vCe.default(e,s,{skipStaticElements:!0});let a;!((r=e.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new SCe.default({width:e.staticNode.yogaNode.getComputedWidth(),height:e.staticNode.yogaNode.getComputedHeight()}),vCe.default(e.staticNode,a,{skipStaticElements:!1}));let{output:n,height:c}=s.get();return{output:n,outputHeight:c,staticOutput:a?`${a.get().output}
|
||||
`:""}}return{output:"",outputHeight:0,staticOutput:""}}});var kCe=G((U7t,xCe)=>{"use strict";var DCe=Ce("stream"),PCe=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],Yq={},sAt=e=>{let t=new DCe.PassThrough,r=new DCe.PassThrough;t.write=a=>e("stdout",a),r.write=a=>e("stderr",a);let s=new console.Console(t,r);for(let a of PCe)Yq[a]=console[a],console[a]=s[a];return()=>{for(let a of PCe)console[a]=Yq[a];Yq={}}};xCe.exports=sAt});var Vq=G(Wq=>{"use strict";Object.defineProperty(Wq,"__esModule",{value:!0});Wq.default=new WeakMap});var Jq=G(Kq=>{"use strict";Object.defineProperty(Kq,"__esModule",{value:!0});var oAt=dn(),QCe=oAt.createContext({exit:()=>{}});QCe.displayName="InternalAppContext";Kq.default=QCe});var Zq=G(zq=>{"use strict";Object.defineProperty(zq,"__esModule",{value:!0});var aAt=dn(),TCe=aAt.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});TCe.displayName="InternalStdinContext";zq.default=TCe});var $q=G(Xq=>{"use strict";Object.defineProperty(Xq,"__esModule",{value:!0});var lAt=dn(),RCe=lAt.createContext({stdout:void 0,write:()=>{}});RCe.displayName="InternalStdoutContext";Xq.default=RCe});var tY=G(eY=>{"use strict";Object.defineProperty(eY,"__esModule",{value:!0});var cAt=dn(),FCe=cAt.createContext({stderr:void 0,write:()=>{}});FCe.displayName="InternalStderrContext";eY.default=FCe});var xF=G(rY=>{"use strict";Object.defineProperty(rY,"__esModule",{value:!0});var uAt=dn(),NCe=uAt.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{},focus:()=>{}});NCe.displayName="InternalFocusContext";rY.default=NCe});var LCe=G((W7t,OCe)=>{"use strict";var fAt=/[|\\{}()[\]^$+*?.-]/g;OCe.exports=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(fAt,"\\$&")}});var HCe=G((V7t,_Ce)=>{"use strict";var AAt=LCe(),pAt=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",UCe=[].concat(Ce("module").builtinModules,"bootstrap_node","node").map(e=>new RegExp(`(?:\\((?:node:)?${e}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${e}(?:\\.js)?:\\d+:\\d+$)`));UCe.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var nY=class e{constructor(t){t={ignoredPackages:[],...t},"internals"in t||(t.internals=e.nodeInternals()),"cwd"in t||(t.cwd=pAt),this._cwd=t.cwd.replace(/\\/g,"/"),this._internals=[].concat(t.internals,hAt(t.ignoredPackages)),this._wrapCallSite=t.wrapCallSite||!1}static nodeInternals(){return[...UCe]}clean(t,r=0){r=" ".repeat(r),Array.isArray(t)||(t=t.split(`
|
||||
`)),!/^\s*at /.test(t[0])&&/^\s*at /.test(t[1])&&(t=t.slice(1));let s=!1,a=null,n=[];return t.forEach(c=>{if(c=c.replace(/\\/g,"/"),this._internals.some(p=>p.test(c)))return;let f=/^\s*at /.test(c);s?c=c.trimEnd().replace(/^(\s+)at /,"$1"):(c=c.trim(),f&&(c=c.slice(3))),c=c.replace(`${this._cwd}/`,""),c&&(f?(a&&(n.push(a),a=null),n.push(c)):(s=!0,a=c))}),n.map(c=>`${r}${c}
|
||||
`).join("")}captureString(t,r=this.captureString){typeof t=="function"&&(r=t,t=1/0);let{stackTraceLimit:s}=Error;t&&(Error.stackTraceLimit=t);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=s,this.clean(n)}capture(t,r=this.capture){typeof t=="function"&&(r=t,t=1/0);let{prepareStackTrace:s,stackTraceLimit:a}=Error;Error.prepareStackTrace=(f,p)=>this._wrapCallSite?p.map(this._wrapCallSite):p,t&&(Error.stackTraceLimit=t);let n={};Error.captureStackTrace(n,r);let{stack:c}=n;return Object.assign(Error,{prepareStackTrace:s,stackTraceLimit:a}),c}at(t=this.at){let[r]=this.capture(1,t);if(!r)return{};let s={line:r.getLineNumber(),column:r.getColumnNumber()};MCe(s,r.getFileName(),this._cwd),r.isConstructor()&&(s.constructor=!0),r.isEval()&&(s.evalOrigin=r.getEvalOrigin()),r.isNative()&&(s.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!=="Object"&&a!=="[object Object]"&&(s.type=a);let n=r.getFunctionName();n&&(s.function=n);let c=r.getMethodName();return c&&n!==c&&(s.method=c),s}parseLine(t){let r=t&&t.match(dAt);if(!r)return null;let s=r[1]==="new",a=r[2],n=r[3],c=r[4],f=Number(r[5]),p=Number(r[6]),h=r[7],E=r[8],C=r[9],S=r[10]==="native",x=r[11]===")",I,R={};if(E&&(R.line=Number(E)),C&&(R.column=Number(C)),x&&h){let N=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===")")N++;else if(h.charAt(U)==="("&&h.charAt(U-1)===" "&&(N--,N===-1&&h.charAt(U-1)===" ")){let K=h.slice(0,U-1);h=h.slice(U+1),a+=` (${K}`;break}}if(a){let N=a.match(gAt);N&&(a=N[1],I=N[2])}return MCe(R,h,this._cwd),s&&(R.constructor=!0),n&&(R.evalOrigin=n,R.evalLine=f,R.evalColumn=p,R.evalFile=c&&c.replace(/\\/g,"/")),S&&(R.native=!0),a&&(R.function=a),I&&a!==I&&(R.method=I),R}};function MCe(e,t,r){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${r}/`)&&(t=t.slice(r.length+1)),e.file=t)}function hAt(e){if(e.length===0)return[];let t=e.map(r=>AAt(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var dAt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),gAt=/^(.*?) \[as (.*?)\]$/;_Ce.exports=nY});var GCe=G((K7t,jCe)=>{"use strict";jCe.exports=(e,t)=>e.replace(/^\t+/gm,r=>" ".repeat(r.length*(t||2)))});var YCe=G((J7t,qCe)=>{"use strict";var mAt=GCe(),yAt=(e,t)=>{let r=[],s=e-t,a=e+t;for(let n=s;n<=a;n++)r.push(n);return r};qCe.exports=(e,t,r)=>{if(typeof e!="string")throw new TypeError("Source code is missing.");if(!t||t<1)throw new TypeError("Line number must start from `1`.");if(e=mAt(e).split(/\r?\n/),!(t>e.length))return r={around:3,...r},yAt(t,r.around).filter(s=>e[s-1]!==void 0).map(s=>({line:s,value:e[s-1]}))}});var kF=G(of=>{"use strict";var EAt=of&&of.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),IAt=of&&of.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),CAt=of&&of.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&EAt(t,e,r);return IAt(t,e),t},wAt=of&&of.__rest||function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(r[s[a]]=e[s[a]]);return r};Object.defineProperty(of,"__esModule",{value:!0});var WCe=CAt(dn()),iY=WCe.forwardRef((e,t)=>{var{children:r}=e,s=wAt(e,["children"]);let a=Object.assign(Object.assign({},s),{marginLeft:s.marginLeft||s.marginX||s.margin||0,marginRight:s.marginRight||s.marginX||s.margin||0,marginTop:s.marginTop||s.marginY||s.margin||0,marginBottom:s.marginBottom||s.marginY||s.margin||0,paddingLeft:s.paddingLeft||s.paddingX||s.padding||0,paddingRight:s.paddingRight||s.paddingX||s.padding||0,paddingTop:s.paddingTop||s.paddingY||s.padding||0,paddingBottom:s.paddingBottom||s.paddingY||s.padding||0});return WCe.default.createElement("ink-box",{ref:t,style:a},r)});iY.displayName="Box";iY.defaultProps={flexDirection:"row",flexGrow:0,flexShrink:1};of.default=iY});var aY=G(lb=>{"use strict";var sY=lb&&lb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lb,"__esModule",{value:!0});var BAt=sY(dn()),Aw=sY(LE()),VCe=sY(Hq()),oY=({color:e,backgroundColor:t,dimColor:r,bold:s,italic:a,underline:n,strikethrough:c,inverse:f,wrap:p,children:h})=>{if(h==null)return null;let E=C=>(r&&(C=Aw.default.dim(C)),e&&(C=VCe.default(C,e,"foreground")),t&&(C=VCe.default(C,t,"background")),s&&(C=Aw.default.bold(C)),a&&(C=Aw.default.italic(C)),n&&(C=Aw.default.underline(C)),c&&(C=Aw.default.strikethrough(C)),f&&(C=Aw.default.inverse(C)),C);return BAt.default.createElement("ink-text",{style:{flexGrow:0,flexSLine truncated
|
||||
`).slice(1):void 0,r=t?zCe.parseLine(t[0]):void 0,s,a=0;if(r?.file&&r?.line&&KCe.existsSync(r.file)){let n=KCe.readFileSync(r.file,"utf8");if(s=DAt.default(n,r.line),s)for(let{line:c}of s)a=Math.max(a,String(c).length)}return Fs.default.createElement(th.default,{flexDirection:"column",padding:1},Fs.default.createElement(th.default,null,Fs.default.createElement(dA.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),Fs.default.createElement(dA.default,null," ",e.message)),r&&Fs.default.createElement(th.default,{marginTop:1},Fs.default.createElement(dA.default,{dimColor:!0},r.file,":",r.line,":",r.column)),r&&s&&Fs.default.createElement(th.default,{marginTop:1,flexDirection:"column"},s.map(({line:n,value:c})=>Fs.default.createElement(th.default,{key:n},Fs.default.createElement(th.default,{width:a+1},Fs.default.createElement(dA.default,{dimColor:n!==r.line,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0},String(n).padStart(a," "),":")),Fs.default.createElement(dA.default,{key:n,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0}," "+c)))),e.stack&&Fs.default.createElement(th.default,{marginTop:1,flexDirection:"column"},e.stack.split(`
|
||||
`).slice(1).map(n=>{let c=zCe.parseLine(n);return c?Fs.default.createElement(th.default,{key:n},Fs.default.createElement(dA.default,{dimColor:!0},"- "),Fs.default.createElement(dA.default,{dimColor:!0,bold:!0},c.function),Fs.default.createElement(dA.default,{dimColor:!0,color:"gray"}," ","(",c.file,":",c.line,":",c.column,")")):Fs.default.createElement(th.default,{key:n},Fs.default.createElement(dA.default,{dimColor:!0},"- "),Fs.default.createElement(dA.default,{dimColor:!0,bold:!0},n))})))};af.default=PAt});var $Ce=G(lf=>{"use strict";var xAt=lf&&lf.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),kAt=lf&&lf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),QAt=lf&&lf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&xAt(t,e,r);return kAt(t,e),t},Gm=lf&&lf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lf,"__esModule",{value:!0});var jm=QAt(dn()),XCe=Gm(cq()),TAt=Gm(Jq()),RAt=Gm(Zq()),FAt=Gm($q()),NAt=Gm(tY()),OAt=Gm(xF()),LAt=Gm(ZCe()),MAt=" ",UAt="\x1B[Z",_At="\x1B",QF=class extends jm.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=t=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
|
||||
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.
|
||||
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),t){this.rawModeEnabledCount===0&&(r.addListener("data",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("data",this.handleInput),r.pause())},this.handleInput=t=>{t===""&&this.props.exitOnCtrlC&&this.handleExit(),t===_At&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(t===MAt&&this.focusNext(),t===UAt&&this.focusPrevious())},this.handleExit=t=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(t)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focus=t=>{this.setState(r=>r.focusables.some(a=>a?.id===t)?{activeFocusId:t}:r)},this.focusNext=()=>{this.setState(t=>{var r;let s=(r=t.focusables[0])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findNextFocusable(t)||s}})},this.focusPrevious=()=>{this.setState(t=>{var r;let s=(r=t.focusables[t.focusables.length-1])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findPreviousFocusable(t)||s}})},this.addFocusable=(t,{autoFocus:r})=>{this.setState(s=>{let a=s.activeFocusId;return!a&&r&&(a=t),{activeFocusId:a,focusables:[...s.focusables,{id:t,isActive:!0}]}})},this.removeFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.filter(s=>s.id!==t)}))},this.activateFocusable=t=>{this.setState(r=>({focusables:r.focusables.map(s=>s.id!==t?s:{id:t,isActive:!0})}))},this.deactivateFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.map(s=>s.id!==t?s:{id:t,isActive:!1})}))},this.findNextFocusable=t=>{var r;let s=t.focusables.findIndex(a=>a.id===t.activeFocusId);for(let a=s+1;a<t.focusables.length;a++)if(!((r=t.focusables[a])===null||r===void 0)&&r.isActive)return t.focusables[a].id},this.findPreviousFocusable=t=>{var r;let s=t.focusables.findIndex(a=>a.id===t.activeFocusId);for(let a=s-1;a>=0;a--)if(!((r=t.focusables[a])===null||r===void 0)&&r.isActive)return t.focusables[a].id}}static getDerivedStateFromError(t){return{error:t}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return jm.default.createElement(TAt.default.Provider,{value:{exit:this.handleExit}},jm.default.createElement(RAt.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},jm.default.createElement(FAt.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},jm.default.createElement(NAt.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},jm.default.createElement(OAt.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?jm.default.createElement(LAt.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){XCe.default.hide(this.props.stdout)}componentWillUnmount(){XCe.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(t){this.handleExit(t)}};lf.default=QF;QF.displayName="InternalApp"});var rwe=G(cf=>{"use strict";var HAt=cf&&cf.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),jAt=cf&&cf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),GAt=cf&&cf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&HAt(t,e,r);return jAt(t,e),t},uf=cf&&cf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cf,"__esModule",{value:!0});var qAt=uf(dn()),ewe=KEe(),YAt=uf(uIe()),WAt=uf(iq()),VAt=uf(gIe()),KAt=uf(yIe()),lY=uf(uCe()),JAt=uf(bCe()),zAt=uf(lq()),ZAt=uf(kCe()),XAt=GAt(Uq()),$At=uf(Vq()),ept=uf($Ce()),pw=process.env.CI==="false"?!1:VAt.default,twe=()=>{},cY=class{constructor(t){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:r,outputHeight:s,staticOutput:a}=JAt.default(this.rootNode,this.options.stdout.columns||80),n=a&&a!==`
|
||||
`;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(pw){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),s>=this.options.stdout.rows){this.options.stdout.write(WAt.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},KAt.default(this),this.options=t,this.rootNode=XAt.createNode("ink-root"),this.rootNode.onRender=t.debug?this.onRender:ewe(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=YAt.default.create(t.stdout),this.throttledLog=t.debug?this.log:ewe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=lY.default.createContainer(this.rootNode,0,!1,null),this.unsubscribeExit=zAt.default(this.unmount,{alwaysLast:!1}),t.patchConsole&&this.patchConsole(),pw||(t.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{t.stdout.off("resize",this.onRender)})}render(t){let r=qAt.default.createElement(ept.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},t);lY.default.updateContainer(r,this.container,null,twe)}writeToStdout(t){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(t+this.fullStaticOutput+this.lastOutput);return}if(pw){this.options.stdout.write(t);return}this.log.clear(),this.options.stdout.write(t),this.log(this.lastOutput)}}writeToStderr(t){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(t),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(pw){this.options.stderr.write(t);return}this.log.clear(),this.options.stderr.write(t),this.log(this.lastOutput)}}unmount(t){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),pw?this.options.stdout.write(this.lastOutput+`
|
||||
`):this.options.debug||this.log.done(),this.isUnmounted=!0,lY.default.updateContainer(null,this.container,null,twe),$At.default.delete(this.options.stdout),t instanceof Error?this.rejectExitPromise(t):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((t,r)=>{this.resolveExitPromise=t,this.rejectExitPromise=r})),this.exitPromise}clear(){!pw&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=ZAt.default((t,r)=>{t==="stdout"&&this.writeToStdout(r),t==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};cf.default=cY});var iwe=G(fb=>{"use strict";var nwe=fb&&fb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fb,"__esModule",{value:!0});var tpt=nwe(rwe()),TF=nwe(Vq()),rpt=Ce("stream"),npt=(e,t)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},ipt(t)),s=spt(r.stdout,()=>new tpt.default(r));return s.render(e),{rerender:s.render,unmount:()=>s.unmount(),waitUntilExit:s.waitUntilExit,cleanup:()=>TF.default.delete(r.stdout),clear:s.clear}};fb.default=npt;var ipt=(e={})=>e instanceof rpt.Stream?{stdout:e,stdin:process.stdin}:e,spt=(e,t)=>{let r;return TF.default.has(e)?r=TF.default.get(e):(r=t(),TF.default.set(e,r)),r}});var owe=G(rh=>{"use strict";var opt=rh&&rh.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),apt=rh&&rh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lpt=rh&&rh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&opt(t,e,r);return apt(t,e),t};Object.defineProperty(rh,"__esModule",{value:!0});var Ab=lpt(dn()),swe=e=>{let{items:t,children:r,style:s}=e,[a,n]=Ab.useState(0),c=Ab.useMemo(()=>t.slice(a),[t,a]);Ab.useLayoutEffect(()=>{n(t.length)},[t.length]);let f=c.map((h,E)=>r(h,a+E)),p=Ab.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},s),[s]);return Ab.default.createElement("ink-box",{internal_static:!0,style:p},f)};swe.displayName="Static";rh.default=swe});var lwe=G(pb=>{"use strict";var cpt=pb&&pb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pb,"__esModule",{value:!0});var upt=cpt(dn()),awe=({children:e,transform:t})=>e==null?null:upt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:t},e);awe.displayName="Transform";pb.default=awe});var uwe=G(hb=>{"use strict";var fpt=hb&&hb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hb,"__esModule",{value:!0});var Apt=fpt(dn()),cwe=({count:e=1})=>Apt.default.createElement("ink-text",null,`
|
||||
`.repeat(e));cwe.displayName="Newline";hb.default=cwe});var pwe=G(db=>{"use strict";var fwe=db&&db.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(db,"__esModule",{value:!0});var ppt=fwe(dn()),hpt=fwe(kF()),Awe=()=>ppt.default.createElement(hpt.default,{flexGrow:1});Awe.displayName="Spacer";db.default=Awe});var RF=G(gb=>{"use strict";var dpt=gb&&gb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gb,"__esModule",{value:!0});var gpt=dn(),mpt=dpt(Zq()),ypt=()=>gpt.useContext(mpt.default);gb.default=ypt});var dwe=G(mb=>{"use strict";var Ept=mb&&mb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mb,"__esModule",{value:!0});var hwe=dn(),Ipt=Ept(RF()),Cpt=(e,t={})=>{let{stdin:r,setRawMode:s,internal_exitOnCtrlC:a}=Ipt.default();hwe.useEffect(()=>{if(t.isActive!==!1)return s(!0),()=>{s(!1)}},[t.isActive,s]),hwe.useEffect(()=>{if(t.isActive===!1)return;let n=c=>{let f=String(c),p={upArrow:f==="\x1B[A",downArrow:f==="\x1B[B",leftArrow:f==="\x1B[D",rightArrow:f==="\x1B[C",pageDown:f==="\x1B[6~",pageUp:f==="\x1B[5~",return:f==="\r",escape:f==="\x1B",ctrl:!1,shift:!1,tab:f===" "||f==="\x1B[Z",backspace:f==="\b",delete:f==="\x7F"||f==="\x1B[3~",meta:!1};f<=""&&!p.return&&(f=String.fromCharCode(f.charCodeAt(0)+97-1),p.ctrl=!0),f.startsWith("\x1B")&&(f=f.slice(1),p.meta=!0);let h=f>="A"&&f<="Z",E=f>="\u0410"&&f<="\u042F";f.length===1&&(h||E)&&(p.shift=!0),p.tab&&f==="[Z"&&(p.shift=!0),(p.tab||p.backspace||p.delete)&&(f=""),(!(f==="c"&&p.ctrl)||!a)&&e(f,p)};return r?.on("data",n),()=>{r?.off("data",n)}},[t.isActive,r,a,e])};mb.default=Cpt});var gwe=G(yb=>{"use strict";var wpt=yb&&yb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yb,"__esModule",{value:!0});var Bpt=dn(),vpt=wpt(Jq()),Spt=()=>Bpt.useContext(vpt.default);yb.default=Spt});var mwe=G(Eb=>{"use strict";var bpt=Eb&&Eb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Eb,"__esModule",{value:!0});var Dpt=dn(),Ppt=bpt($q()),xpt=()=>Dpt.useContext(Ppt.default);Eb.default=xpt});var ywe=G(Ib=>{"use strict";var kpt=Ib&&Ib.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ib,"__esModule",{value:!0});var Qpt=dn(),Tpt=kpt(tY()),Rpt=()=>Qpt.useContext(Tpt.default);Ib.default=Rpt});var Iwe=G(wb=>{"use strict";var Ewe=wb&&wb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wb,"__esModule",{value:!0});var Cb=dn(),Fpt=Ewe(xF()),Npt=Ewe(RF()),Opt=({isActive:e=!0,autoFocus:t=!1,id:r}={})=>{let{isRawModeSupported:s,setRawMode:a}=Npt.default(),{activeId:n,add:c,remove:f,activate:p,deactivate:h,focus:E}=Cb.useContext(Fpt.default),C=Cb.useMemo(()=>r??Math.random().toString().slice(2,7),[r]);return Cb.useEffect(()=>(c(C,{autoFocus:t}),()=>{f(C)}),[C,t]),Cb.useEffect(()=>{e?p(C):h(C)},[e,C]),Cb.useEffect(()=>{if(!(!s||!e))return a(!0),()=>{a(!1)}},[e]),{isFocused:!!C&&n===C,focus:E}};wb.default=Opt});var Cwe=G(Bb=>{"use strict";var Lpt=Bb&&Bb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bb,"__esModule",{value:!0});var Mpt=dn(),Upt=Lpt(xF()),_pt=()=>{let e=Mpt.useContext(Upt.default);return{enableFocus:e.enableFocus,disableFocus:e.disableFocus,focusNext:e.focusNext,focusPrevious:e.focusPrevious,focus:e.focus}};Bb.default=_pt});var wwe=G(uY=>{"use strict";Object.defineProperty(uY,"__esModule",{value:!0});uY.default=e=>{var t,r,s,a;return{width:(r=(t=e.yogaNode)===null||t===void 0?void 0:t.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(s=e.yogaNode)===null||s===void 0?void 0:s.getComputedHeight())!==null&&a!==void 0?a:0}}});var Yc=G(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});var Hpt=iwe();Object.defineProperty(vo,"render",{enumerable:!0,get:function(){return Hpt.default}});var jpt=kF();Object.defineProperty(vo,"Box",{enumerable:!0,get:function(){return jpt.default}});var Gpt=aY();Object.defineProperty(vo,"Text",{enumerable:!0,get:function(){return Gpt.default}});var qpt=owe();Object.defineProperty(vo,"Static",{enumerable:!0,get:function(){return qpt.default}});var Ypt=lwe();Object.defineProperty(vo,"Transform",{enumerable:!0,get:function(){return Ypt.default}});var Wpt=uwe();Object.defineProperty(vo,"Newline",{enumerable:!0,get:function(){return Wpt.default}});var Vpt=pwe();Object.defineProperty(vo,"Spacer",{enumerable:!0,get:function(){return Vpt.default}});var Kpt=dwe();Object.defineProperty(vo,"useInput",{enumerable:!0,get:function(){return Kpt.default}});var Jpt=gwe();Object.defineProperty(vo,"useApp",{enumerable:!0,get:function(){return Jpt.default}});var zpt=RF();Object.defineProperty(vo,"useStdin",{enumerable:!0,get:function(){return zpt.default}});var Zpt=mwe();Object.defineProperty(vo,"useStdout",{enumerable:!0,get:function(){return Zpt.default}});var Xpt=ywe();Object.defineProperty(vo,"useStderr",{enumerable:!0,get:function(){
Line truncated
|
||||
`:"";return c?C+=`@IF EXIST ${c} (\r
|
||||
${c} ${p} ${a} ${E}%*\r
|
||||
) ELSE (\r
|
||||
@SETLOCAL\r
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
|
||||
${f} ${p} ${a} ${E}%*\r
|
||||
)\r
|
||||
`:C+=`@${f} ${p} ${a} ${E}%*\r
|
||||
`,C}function bdt(e,t,r){let s=Vc.relative(Vc.dirname(t),e),a=r.prog&&r.prog.split("\\").join("/"),n;s=s.split("\\").join("/");let c=Vc.isAbsolute(s)?`"${s}"`:`"$basedir/${s}"`,f=r.args||"",p=oW(r.nodePath).posix;a?(n=`"$basedir/${r.prog}"`,s=c):(a=c,f="",s="");let h=r.progArgs?`${r.progArgs.join(" ")} `:"",E=`#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
|
||||
|
||||
case \`uname\` in
|
||||
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
|
||||
esac
|
||||
|
||||
`,C=r.nodePath?`export NODE_PATH="${p}"
|
||||
`:"";return n?E+=`${C}if [ -x ${n} ]; then
|
||||
exec ${n} ${f} ${s} ${h}"$@"
|
||||
else
|
||||
exec ${a} ${f} ${s} ${h}"$@"
|
||||
fi
|
||||
`:E+=`${C}${a} ${f} ${s} ${h}"$@"
|
||||
exit $?
|
||||
`,E}function Ddt(e,t,r){let s=Vc.relative(Vc.dirname(t),e),a=r.prog&&r.prog.split("\\").join("/"),n=a&&`"${a}$exe"`,c;s=s.split("\\").join("/");let f=Vc.isAbsolute(s)?`"${s}"`:`"$basedir/${s}"`,p=r.args||"",h=oW(r.nodePath),E=h.win32,C=h.posix;n?(c=`"$basedir/${r.prog}$exe"`,s=f):(n=f,p="",s="");let S=r.progArgs?`${r.progArgs.join(" ")} `:"",x=`#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
${r.nodePath?`$env_node_path=$env:NODE_PATH
|
||||
$env:NODE_PATH="${E}"
|
||||
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}`;return r.nodePath&&(x+=` else {
|
||||
$env:NODE_PATH="${C}"
|
||||
}`),c?x+=`
|
||||
$ret=0
|
||||
if (Test-Path ${c}) {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & ${c} ${p} ${s} ${S}$args
|
||||
} else {
|
||||
& ${c} ${p} ${s} ${S}$args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & ${n} ${p} ${s} ${S}$args
|
||||
} else {
|
||||
& ${n} ${p} ${s} ${S}$args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
||||
`:""}exit $ret
|
||||
`:x+=`
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & ${n} ${p} ${s} ${S}$args
|
||||
} else {
|
||||
& ${n} ${p} ${s} ${S}$args
|
||||
}
|
||||
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
||||
`:""}exit $LASTEXITCODE
|
||||
`,x}function Pdt(e,t){return t.fs_.chmod(e,493)}function oW(e){if(!e)return{win32:"",posix:""};let t=typeof e=="string"?e.split(Vc.delimiter):Array.from(e),r={};for(let s=0;s<t.length;s++){let a=t[s].split("/").join("\\"),n=N1e()?t[s].split("\\").join("/").replace(/^([^:\\/]*):/,(c,f)=>`/mnt/${f.toLowerCase()}`):t[s];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[s]={win32:a,posix:n}}return r}L1e.exports=sW});var IW=G((Q$t,i2e)=>{i2e.exports=Ce("stream")});var l2e=G((T$t,a2e)=>{"use strict";function s2e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,s)}return r}function fgt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s2e(Object(r),!0).forEach(function(s){Agt(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s2e(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function Agt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pgt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o2e(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function hgt(e,t,r){return t&&o2e(e.prototype,t),r&&o2e(e,r),e}var dgt=Ce("buffer"),sN=dgt.Buffer,ggt=Ce("util"),CW=ggt.inspect,mgt=CW&&CW.custom||"inspect";function ygt(e,t,r){sN.prototype.copy.call(e,t,r)}a2e.exports=function(){function e(){pgt(this,e),this.head=null,this.tail=null,this.length=0}return hgt(e,[{key:"push",value:function(r){var s={data:r,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:"unshift",value:function(r){var s={data:r,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var s=this.head,a=""+s.data;s=s.next;)a+=r+s.data;return a}},{key:"concat",value:function(r){if(this.length===0)return sN.alloc(0);for(var s=sN.allocUnsafe(r>>>0),a=this.head,n=0;a;)ygt(a.data,s,n),n+=a.data.length,a=a.next;return s}},{key:"consume",value:function(r,s){var a;return r<this.head.data.length?(a=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?a=this.shift():a=s?this._getString(r):this._getBuffer(r),a}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var s=this.head,a=1,n=s.data;for(r-=n.length;s=s.next;){var c=s.data,f=r>c.length?c.length:r;if(f===c.length?n+=c:n+=c.slice(0,r),r-=f,r===0){f===c.length?(++a,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=c.slice(f));break}++a}return this.length-=a,n}},{key:"_getBuffer",value:function(r){var s=sN.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(s),r-=a.data.length;a=a.next;){var c=a.data,f=r>c.length?c.length:r;if(c.copy(s,s.length-r,0,f),r-=f,r===0){f===c.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=c.slice(f));break}++n}return this.length-=n,s}},{key:mgt,value:function(r,s){return CW(this,fgt({},s,{depth:0,customInspect:!1}))}}]),e}()});var BW=G((R$t,u2e)=>{"use strict";function Egt(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(wW,this,e)):process.nextTick(wW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(n){!t&&n?r._writableState?r._writableState.errorEmitted?process.nextTick(oN,r):(r._writableState.errorEmitted=!0,process.nextTick(c2e,r,n)):process.nextTick(c2e,r,n):t?(process.nextTick(oN,r),t(n)):process.nextTick(oN,r)}),this)}function c2e(e,t){wW(e,t),oN(e)}function oN(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Igt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function wW(e,t){e.emit("error",t)}function Cgt(e,t){var r=e._readableState,s=e._writableState;r&&
Line truncated
|
||||
`)),e.linkname&&(t+=ZW(" linkpath="+e.linkname+`
|
||||
`));var r=e.pax;if(r)for(var s in r)t+=ZW(" "+s+"="+r[s]+`
|
||||
`);return Buffer.from(t)};Fw.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var s=parseInt(e.slice(0,r).toString(),10);if(!s)return t;var a=e.slice(r+1,s-1).toString(),n=a.indexOf("=");if(n===-1)return t;t[a.slice(0,n)]=a.slice(n+1),e=e.slice(s)}return t};Fw.encode=function(e){var t=pmt(512),r=e.name,s="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var a=r.indexOf("/");if(a===-1)return null;s+=s?"/"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(s)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(dg(e.mode&Emt,6),100),t.write(dg(e.uid,6),108),t.write(dg(e.gid,6),116),t.write(dg(e.size,11),124),t.write(dg(e.mtime.getTime()/1e3|0,11),136),t[156]=uBe+wmt(e.type),e.linkname&&t.write(e.linkname,157),fBe.copy(t,pD),gmt.copy(t,XW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(dg(e.devmajor||0,6),329),t.write(dg(e.devminor||0,6),337),s&&t.write(s,345),t.write(dg(pBe(t),6),148),t)};Fw.decode=function(e,t,r){var s=e[156]===0?0:e[156]-uBe,a=Rw(e,0,100,t),n=gg(e,100,8),c=gg(e,108,8),f=gg(e,116,8),p=gg(e,124,12),h=gg(e,136,12),E=Cmt(s),C=e[157]===0?null:Rw(e,157,100,t),S=Rw(e,265,32),x=Rw(e,297,32),I=gg(e,329,8),R=gg(e,337,8),N=pBe(e);if(N===8*32)return null;if(N!==gg(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(fBe.compare(e,pD,pD+6)===0)e[345]&&(a=Rw(e,345,155,t)+"/"+a);else if(!(mmt.compare(e,pD,pD+6)===0&&ymt.compare(e,XW,XW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return s===0&&a&&a[a.length-1]==="/"&&(s=5),{name:a,mode:n,uid:c,gid:f,size:p,mtime:new Date(1e3*h),type:E,linkname:C,uname:S,gname:x,devmajor:I,devminor:R}}});var IBe=G(($$t,EBe)=>{var dBe=Ce("util"),vmt=cBe(),hD=$W(),gBe=Tw().Writable,mBe=Tw().PassThrough,yBe=function(){},hBe=function(e){return e&=511,e&&512-e},Smt=function(e,t){var r=new CN(e,t);return r.end(),r},bmt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},CN=function(e,t){this._parent=e,this.offset=t,mBe.call(this,{autoDestroy:!1})};dBe.inherits(CN,mBe);CN.prototype.destroy=function(e){this._parent.destroy(e)};var uh=function(e){if(!(this instanceof uh))return new uh(e);gBe.call(this,e),e=e||{},this._offset=0,this._buffer=vmt(),this._missing=0,this._partial=!1,this._onparse=yBe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,s=function(){t._continue()},a=function(S){if(t._locked=!1,S)return t.destroy(S);t._stream||s()},n=function(){t._stream=null;var S=hBe(t._header.size);S?t._parse(S,c):t._parse(512,C),t._locked||s()},c=function(){t._buffer.consume(hBe(t._header.size)),t._parse(512,C),s()},f=function(){var S=t._header.size;t._paxGlobal=hD.decodePax(r.slice(0,S)),r.consume(S),n()},p=function(){var S=t._header.size;t._pax=hD.decodePax(r.slice(0,S)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(S),n()},h=function(){var S=t._header.size;this._gnuLongPath=hD.decodeLongPath(r.slice(0,S),e.filenameEncoding),r.consume(S),n()},E=function(){var S=t._header.size;this._gnuLongLinkPath=hD.decodeLongPath(r.slice(0,S),e.filenameEncoding),r.consume(S),n()},C=function(){var S=t._offset,x;try{x=t._header=hD.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(I){t.emit("error",I)}if(r.consume(512),!x){t._parse(512,C),s();return}if(x.type==="gnu-long-path"){t._parse(x.size,h),s();return}if(x.type==="gnu-long-link-path"){t._parse(x.size,E),s();return}if(x.type==="pax-global-header"){t._parse(x.size,f),s();return}if(x.type==="pax-header"){t._parse(x.size,p),s();return}if(t._gnuLongPath&&(x.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(x.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=x=bmt(x,t._pax),t._pax=null),t._locked=!0,!x.size||x.type==="directory"){t._parse(512,C),t.emit("entry",x,Smt(t,S),a);return}t._stream=new CN(t,S),t.emit("entry",x,t._stream,a),t._parse(x.size,n),s()};this._onheader=C,this._parse(512,C)};dBe.inherits(uh,gBe);uh.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};uh.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};uh.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=yBe,this._overflow?this._write(this._overflow,void 0,e):e()}};uh.prototype._write=function(e,t,r){if(!this._destroyed){var s=this._stream,a=this._buffer,n=this._missing;if(e.length&&(this._partial=!0),e.length<n)return this._missing-=e.length,this._overflow=null,s?s.write(e,r):(a.append(e),
Line truncated
|
||||
Wanted: ${this.expectedSize}
|
||||
Found: ${this.size}`);s.code="EBADSIZE",s.found=this.size,s.expected=this.expectedSize,s.sri=this.sri,this.emit("error",s)}else if(this.sri&&!r){let s=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${t}. (${this.size} bytes)`);s.code="EINTEGRITY",s.found=t,s.expected=this.digests,s.algorithm=this.algorithm,s.sri=this.sri,this.emit("error",s)}else this.#t=this.size,this.emit("size",this.size),this.#e=t,this.emit("integrity",t),r&&(this.#s=r,this.emit("verified",r))}},ph=class{get isHash(){return!0}constructor(t,r){let s=r?.strict;this.source=t.trim(),this.digest="",this.algorithm="",this.options=[];let a=this.source.match(s?iyt:nyt);if(!a||s&&!gV.includes(a[1]))return;this.algorithm=a[1],this.digest=a[2];let n=a[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(t,r){let s=oc(t,r);if(!s)return!1;if(s.isIntegrity){let a=s.pickAlgorithm(r,[this.algorithm]);if(!a)return!1;let n=s[a].find(c=>c.digest===this.digest);return n||!1}return s.digest===this.digest?s:!1}toString(t){return t?.strict&&!(gV.includes(this.algorithm)&&this.digest.match(ryt)&&this.options.every(r=>r.match(syt)))?"":`${this.algorithm}-${this.digest}${wD(this.options)}`}};function jBe(e,t,r,s){let a=e!=="",n=!1,c="",f=s.length-1;for(let h=0;h<f;h++){let E=ph.prototype.toString.call(s[h],r);E&&(n=!0,c+=E,c+=t)}let p=ph.prototype.toString.call(s[f],r);return p&&(n=!0,c+=p),a&&n?e+t+c:e+c}var ny=class{get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(t){let r=t?.sep||" ",s="";if(t?.strict){r=r.replace(/\S+/g," ");for(let a of gV)this[a]&&(s=jBe(s,r,t,this[a]))}else for(let a of Object.keys(this))s=jBe(s,r,t,this[a]);return s}concat(t,r){let s=typeof t=="string"?t:ID(t,r);return oc(`${this.toString(r)} ${s}`,r)}hexDigest(){return oc(this,{single:!0}).hexDigest()}merge(t,r){let s=oc(t,r);for(let a in s)if(this[a]){if(!this[a].find(n=>s[a].find(c=>n.digest===c.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[a]=s[a]}match(t,r){let s=oc(t,r);if(!s)return!1;let a=s.pickAlgorithm(r,Object.keys(this));return!!a&&this[a]&&s[a]&&this[a].find(n=>s[a].find(c=>n.digest===c.digest))||!1}pickAlgorithm(t,r){let s=t?.pickAlgorithm||pyt,a=Object.keys(this).filter(n=>r?.length?r.includes(n):!0);return a.length?a.reduce((n,c)=>s(n,c)||n):null}};BA.exports.parse=oc;function oc(e,t){if(!e)return null;if(typeof e=="string")return dV(e,t);if(e.algorithm&&e.digest){let r=new ny;return r[e.algorithm]=[e],dV(ID(r,t),t)}else return dV(ID(e,t),t)}function dV(e,t){if(t?.single)return new ph(e,t);let r=e.trim().split(/\s+/).reduce((s,a)=>{let n=new ph(a,t);if(n.algorithm&&n.digest){let c=n.algorithm;s[c]||(s[c]=[]),s[c].push(n)}return s},new ny);return r.isEmpty()?null:r}BA.exports.stringify=ID;function ID(e,t){return e.algorithm&&e.digest?ph.prototype.toString.call(e,t):typeof e=="string"?ID(oc(e,t),t):ny.prototype.toString.call(e,t)}BA.exports.fromHex=oyt;function oyt(e,t,r){let s=wD(r?.options);return oc(`${t}-${Buffer.from(e,"hex").toString("base64")}${s}`,r)}BA.exports.fromData=ayt;function ayt(e,t){let r=t?.algorithms||[...yV],s=wD(t?.options);return r.reduce((a,n)=>{let c=CD.createHash(n).update(e).digest("base64"),f=new ph(`${n}-${c}${s}`,t);if(f.algorithm&&f.digest){let p=f.algorithm;a[p]||(a[p]=[]),a[p].push(f)}return a},new ny)}BA.exports.fromStream=lyt;function lyt(e,t){let r=EV(t);return new Promise((s,a)=>{e.pipe(r),e.on("error",a),r.on("error",a);let n;r.on("integrity",c=>{n=c}),r.on("end",()=>s(n)),r.resume()})}BA.exports.checkData=cyt;function cyt(e,t,r){if(t=oc(t,r),!t||!Object.keys(t).length){if(r?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let s=t.pickAlgorithm(r),a=CD.createHash(s).update(e).digest("base64"),n=oc({algorithm:s,digest:a}),c=n.match(t,r);if(r=r||{},c||!r.error)return c;if(typeof r.size=="number"&&e.length!==r.size){let f=new Error(`data size mismatch when checking ${t}.
|
||||
Wanted: ${r.size}
|
||||
Found: ${e.length}`);throw f.code="EBADSIZE",f.found=e.length,f.expected=r.size,f.sri=t,f}else{let f=new Error(`Integrity checksum failed when using ${s}: Wanted ${t}, but got ${n}. (${e.length} bytes)`);throw f.code="EINTEGRITY",f.found=n,f.expected=t,f.algorithm=s,f.sri=t,f}}BA.exports.checkStream=uyt;function uyt(e,t,r){if(r=r||Object.create(null),r.integrity=t,t=oc(t,r),!t||!Object.keys(t).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let s=EV(r);return new Promise((a,n)=>{e.pipe(s),e.on("error",n),s.on("error",n);let c;s.on("verified",f=>{c=f}),s.on("end",()=>a(c)),s.resume()})}BA.exports.integrityStream=EV;function EV(e=Object.create(null)){return new mV(e)}BA.exports.create=fyt;function fyt(e){let t=e?.algorithms||[...yV],r=wD(e?.options),s=t.map(CD.createHash);return{update:function(a,n){return s.forEach(c=>c.update(a,n)),this},digest:function(){return t.reduce((n,c)=>{let f=s.shift().digest("base64"),p=new ph(`${c}-${f}${r}`,e);if(p.algorithm&&p.digest){let h=p.algorithm;n[h]||(n[h]=[]),n[h].push(p)}return n},new ny)}}}var Ayt=CD.getHashes(),GBe=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(e=>Ayt.includes(e));function pyt(e,t){return GBe.indexOf(e.toLowerCase())>=GBe.indexOf(t.toLowerCase())?e:t}});var IV=G(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});yg.Signature=yg.Envelope=void 0;yg.Envelope={fromJSON(e){return{payload:NN(e.payload)?Buffer.from(YBe(e.payload)):Buffer.alloc(0),payloadType:NN(e.payloadType)?globalThis.String(e.payloadType):"",signatures:globalThis.Array.isArray(e?.signatures)?e.signatures.map(t=>yg.Signature.fromJSON(t)):[]}},toJSON(e){let t={};return e.payload.length!==0&&(t.payload=WBe(e.payload)),e.payloadType!==""&&(t.payloadType=e.payloadType),e.signatures?.length&&(t.signatures=e.signatures.map(r=>yg.Signature.toJSON(r))),t}};yg.Signature={fromJSON(e){return{sig:NN(e.sig)?Buffer.from(YBe(e.sig)):Buffer.alloc(0),keyid:NN(e.keyid)?globalThis.String(e.keyid):""}},toJSON(e){let t={};return e.sig.length!==0&&(t.sig=WBe(e.sig)),e.keyid!==""&&(t.keyid=e.keyid),t}};function YBe(e){return Uint8Array.from(globalThis.Buffer.from(e,"base64"))}function WBe(e){return globalThis.Buffer.from(e).toString("base64")}function NN(e){return e!=null}});var KBe=G(ON=>{"use strict";Object.defineProperty(ON,"__esModule",{value:!0});ON.Timestamp=void 0;ON.Timestamp={fromJSON(e){return{seconds:VBe(e.seconds)?globalThis.String(e.seconds):"0",nanos:VBe(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!=="0"&&(t.seconds=e.seconds),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t}};function VBe(e){return e!=null}});var _w=G(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TimeRange=_r.X509CertificateChain=_r.SubjectAlternativeName=_r.X509Certificate=_r.DistinguishedName=_r.ObjectIdentifierValuePair=_r.ObjectIdentifier=_r.PublicKeyIdentifier=_r.PublicKey=_r.RFC3161SignedTimestamp=_r.LogId=_r.MessageSignature=_r.HashOutput=_r.SubjectAlternativeNameType=_r.PublicKeyDetails=_r.HashAlgorithm=void 0;_r.hashAlgorithmFromJSON=zBe;_r.hashAlgorithmToJSON=ZBe;_r.publicKeyDetailsFromJSON=XBe;_r.publicKeyDetailsToJSON=$Be;_r.subjectAlternativeNameTypeFromJSON=eve;_r.subjectAlternativeNameTypeToJSON=tve;var hyt=KBe(),bl;(function(e){e[e.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",e[e.SHA2_256=1]="SHA2_256",e[e.SHA2_384=2]="SHA2_384",e[e.SHA2_512=3]="SHA2_512",e[e.SHA3_256=4]="SHA3_256",e[e.SHA3_384=5]="SHA3_384"})(bl||(_r.HashAlgorithm=bl={}));function zBe(e){switch(e){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return bl.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return bl.SHA2_256;case 2:case"SHA2_384":return bl.SHA2_384;case 3:case"SHA2_512":return bl.SHA2_512;case 4:case"SHA3_256":return bl.SHA3_256;case 5:case"SHA3_384":return bl.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+e+" for enum HashAlgorithm")}}function ZBe(e){switch(e){case bl.HASH_ALGORITHM_UNSPECIFIED:return"HASH_ALGORITHM_UNSPECIFIED";case bl.SHA2_256:return"SHA2_256";case bl.SHA2_384:return"SHA2_384";case bl.SHA2_512:return"SHA2_512";case bl.SHA3_256:return"SHA3_256";case bl.SHA3_384:return"SHA3_384";default:throw new globalThis.Error("Unrecognized enum value "+e+" for enum HashAlgorithm")}}var sn;(function(e){e[e.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]="PUBLIC_KEY_DETAILS_UNSPECIFIED",e[e.PKCS1_RSA_PKCS1V5=1]="PKCS1_RSA_PKCS1V5",e[e.PKCS1_RSA_PSS=2]="PKCS1_RSA_PSS",e[e.PKIX_RSA_PKCS1V5=3]="PKIX_RSA_PKCS1V5",e[e.PKIX_RSA_PSS=4]="PKIX_RSA_PSS",e[e.PKIX_RSA_PKCS1V15_2048_SHA256=9]="PKIX_RSA_PKCS1V15_2048_SHA256",e[e.PKIX_RSA_PKCS1V15_3072_SHA256=10]="PKIX_RSA_PKCS1V15_3072_SHA256",e[e.PKIX_RSA_PKCS1V15_4096_SHA256=11]="PKIX_RSA_PKCS1V15_4096_SHA256",e[e.PKIX_RSA_PSS_2048_SHA256=16]="PKIX_RSA_PSS_2048_SHA256",e[e.PKIX_RSA_PSS_3072_SHA256=17]="PKIX_RSA_PSS_3072_SHA256",e[e.PKIX_RS
Line truncated
|
||||
`).forEach(r=>{r.match(oEt)||r.match(aEt)||(t+=r)}),Buffer.from(t,"base64")}function cEt(e,t="CERTIFICATE"){let s=e.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${t}-----`,...s,`-----END ${t}-----`].join(`
|
||||
`).concat(`
|
||||
`)}});var iO=G(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});Yw.SHA2_HASH_ALGOS=Yw.ECDSA_SIGNATURE_ALGOS=void 0;Yw.ECDSA_SIGNATURE_ALGOS={"1.2.840.10045.4.3.1":"sha224","1.2.840.10045.4.3.2":"sha256","1.2.840.10045.4.3.3":"sha384","1.2.840.10045.4.3.4":"sha512"};Yw.SHA2_HASH_ALGOS={"2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512"}});var UV=G(sO=>{"use strict";Object.defineProperty(sO,"__esModule",{value:!0});sO.RFC3161TimestampVerificationError=void 0;var MV=class extends Error{};sO.RFC3161TimestampVerificationError=MV});var Qve=G(DA=>{"use strict";var uEt=DA&&DA.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,a)}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),fEt=DA&&DA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),AEt=DA&&DA.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&uEt(t,e,r);return fEt(t,e),t};Object.defineProperty(DA,"__esModule",{value:!0});DA.TSTInfo=void 0;var kve=AEt(qw()),pEt=iO(),hEt=UV(),_V=class{constructor(t){this.root=t}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let t=this.messageImprintObj.subs[0].subs[0].toOID();return pEt.SHA2_HASH_ALGOS[t]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(t){let r=kve.digest(this.messageImprintHashAlgorithm,t);if(!kve.bufferEqual(r,this.messageImprintHashedMessage))throw new hEt.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};DA.TSTInfo=_V});var Rve=G(PA=>{"use strict";var dEt=PA&&PA.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,a)}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),gEt=PA&&PA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mEt=PA&&PA.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&dEt(t,e,r);return gEt(t,e),t};Object.defineProperty(PA,"__esModule",{value:!0});PA.RFC3161Timestamp=void 0;var yEt=tO(),HV=mEt(qw()),Tve=iO(),PD=UV(),EEt=Qve(),IEt="1.2.840.113549.1.7.2",CEt="1.2.840.113549.1.9.16.1.4",wEt="1.2.840.113549.1.9.4",jV=class e{constructor(t){this.root=t}static parse(t){let r=yEt.ASN1Obj.parseBuffer(t);return new e(r)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let t=this.signerDigestAlgorithmObj.subs[0].toOID();return Tve.SHA2_HASH_ALGOS[t]}get signatureAlgorithm(){let t=this.signatureAlgorithmObj.subs[0].toOID();return Tve.ECDSA_SIGNATURE_ALGOS[t]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new EEt.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(t,r){if(!this.timeStampTokenObj)throw new PD.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==IEt)throw new PD.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==CEt)throw new PD.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(t),this.verifyMessageDigest(),this.verifySignature(r)}verifyMessageDigest(){let t=HV.digest(this.signerDigestAlgorithm,this.tstInfo.raw),r=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!HV.bufferEqual(t,r))throw new PD.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(t){let r=this.signedAttrsObj.toDER();if(r[0]=49,!HV.verify(r,t,this.signatureValue,this.signatureAlgorithm))throw new PD.RFC3161TimestampVerificationError("signature verification failed")}get pkiStatusInfoObj(){return this.root.subs[0]}get timeStampTokenObj(){return this.root.subs[1]}get contentTypeObj(){return this.timeStampTokenObj.subs[0]}get signedDataObj(){return this.timeStampTokenObj.subs.find(r=>r.tag.isContextSpecific(0)).subs[0]}get encapContentInfoObj(){return this.signedDataObj.subs[2]}get signerInfosObj(){let t=this.signedDataObj;return t.subs[t.subs.length-1]}get sig
Line truncated
|
||||
globstar while`,t,S,r,x,I),this.matchOne(t.slice(S),r.slice(x),s))return this.debug("globstar found match!",S,p,I),!0;if(I==="."||I===".."||!a.dot&&I.charAt(0)==="."){this.debug("dot detected!",t,S,r,x);break}this.debug("globstar swallow a segment, and continue"),S++}return!!(s&&(this.debug(`
|
||||
>>> no match, partial?`,t,S,r,x),S===p))}let R;if(typeof E=="string"?(R=C===E,this.debug("string match",E,C,R)):(R=E.test(C),this.debug("pattern match",E,C,R)),!R)return!1}if(c===p&&f===h)return!0;if(c===p)return s;if(f===h)return c===p-1&&t[c]==="";throw new Error("wtf?")}braceExpand(){return(0,hr.braceExpand)(this.pattern,this.options)}parse(t){(0,OO.assertValidPattern)(t);let r=this.options;if(t==="**")return hr.GLOBSTAR;if(t==="")return"";let s,a=null;(s=t.match(Hwt))?a=r.dot?Gwt:jwt:(s=t.match(Qwt))?a=(r.nocase?r.dot?Nwt:Fwt:r.dot?Rwt:Twt)(s[1]):(s=t.match(qwt))?a=(r.nocase?r.dot?Wwt:Ywt:r.dot?Vwt:Kwt)(s):(s=t.match(Owt))?a=r.dot?Mwt:Lwt:(s=t.match(Uwt))&&(a=_wt);let n=Sbe.AST.fromGlob(t,this.options).toMMPattern();return a&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:a}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,s=r.noglobstar?zwt:r.dot?Zwt:Xwt,a=new Set(r.nocase?["i"]:[]),n=t.map(p=>{let h=p.map(E=>{if(E instanceof RegExp)for(let C of E.flags.split(""))a.add(C);return typeof E=="string"?i1t(E):E===hr.GLOBSTAR?hr.GLOBSTAR:E._src});return h.forEach((E,C)=>{let S=h[C+1],x=h[C-1];E!==hr.GLOBSTAR||x===hr.GLOBSTAR||(x===void 0?S!==void 0&&S!==hr.GLOBSTAR?h[C+1]="(?:\\/|"+s+"\\/)?"+S:h[C]=s:S===void 0?h[C-1]=x+"(?:\\/|"+s+")?":S!==hr.GLOBSTAR&&(h[C-1]=x+"(?:\\/|\\/"+s+"\\/)"+S,h[C+1]=hr.GLOBSTAR))}),h.filter(E=>E!==hr.GLOBSTAR).join("/")}).join("|"),[c,f]=t.length>1?["(?:",")"]:["",""];n="^"+c+n+f+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...a].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let a=this.slashSplit(t);this.debug(this.pattern,"split",a);let n=this.set;this.debug(this.pattern,"set",n);let c=a[a.length-1];if(!c)for(let f=a.length-2;!c&&f>=0;f--)c=a[f];for(let f=0;f<n.length;f++){let p=n[f],h=a;if(s.matchBase&&p.length===1&&(h=[c]),this.matchOne(h,p,r))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return hr.minimatch.defaults(t).Minimatch}};hr.Minimatch=hy;var s1t=H7();Object.defineProperty(hr,"AST",{enumerable:!0,get:function(){return s1t.AST}});var o1t=j7();Object.defineProperty(hr,"escape",{enumerable:!0,get:function(){return o1t.escape}});var a1t=QO();Object.defineProperty(hr,"unescape",{enumerable:!0,get:function(){return a1t.unescape}});hr.minimatch.AST=Sbe.AST;hr.minimatch.Minimatch=hy;hr.minimatch.escape=Pwt.escape;hr.minimatch.unescape=xwt.unescape});var Y7=G(ru=>{"use strict";var kbe=ru&&ru.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ru,"__esModule",{value:!0});ru.SuccinctRoles=ru.DelegatedRole=ru.Role=ru.TOP_LEVEL_ROLE_NAMES=void 0;var Qbe=kbe(Ce("crypto")),l1t=xbe(),LO=kbe(Ce("util")),MO=QA(),dy=hf();ru.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var GD=class e{constructor(t){let{keyIDs:r,threshold:s,unrecognizedFields:a}=t;if(c1t(r))throw new MO.ValueError("duplicate key IDs found");if(s<1)throw new MO.ValueError("threshold must be at least 1");this.keyIDs=r,this.threshold=s,this.unrecognizedFields=a||{}}equals(t){return t instanceof e?this.threshold===t.threshold&&LO.default.isDeepStrictEqual(this.keyIDs,t.keyIDs)&&LO.default.isDeepStrictEqual(this.unrecognizedFields,t.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(t){let{keyids:r,threshold:s,...a}=t;if(!dy.guard.isStringArray(r))throw new TypeError("keyids must be an array");if(typeof s!="number")throw new TypeError("threshold must be a number");return new e({keyIDs:r,threshold:s,unrecognizedFields:a})}};ru.Role=GD;function c1t(e){return new Set(e).size!==e.length}var G7=class e extends GD{constructor(t){super(t);let{name:r,terminating:s,paths:a,pathHashPrefixes:n}=t;if(this.name=r,this.terminating=s,t.paths&&t.pathHashPrefixes)throw new MO.ValueError("paths and pathHashPrefixes are mutually exclusive");this.paths=a,this.pathHashPrefixes=n}equals(t){return t instanceof e?super.equals(t)&&this.name===t.name&&this.terminating===t.terminating&&LO.default.isDeepStrictEqual(this.paths,t.paths)&&LO.default.isDeepStrictEqual(this.pathHashPrefixes,t.pathHashPrefixes):!1}isDelegatedPath(t){if(this.paths)return this.paths.some(r=>f1t(t,r));if(this.pathHashPrefixes){let s=Qbe.default.createHash("sha256").update(t).digest("hex");return this.pathHashPrefixes.some(a=>s.startsWith(a))}return!1}toJSON(){let t={...super.toJSON(),name:this.name,terminating:this.terminating};return this.paths&&(t.paths=this.paths),this.pathHashPrefixes&&(t.path_hash_prefixes=this.pathHashPrefixes),t}static fro
Line truncated
|
||||
`).join(`
|
||||
`+n),e.push(a+"m+"+zO.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=p2t()+t+" "+e[0]}function p2t(){return oo.inspectOpts.hideDate?"":new Date().toISOString()+" "}function h2t(...e){return process.stderr.write(JO.formatWithOptions(oo.inspectOpts,...e)+`
|
||||
`)}function d2t(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function g2t(){return process.env.DEBUG}function m2t(e){e.inspectOpts={};let t=Object.keys(oo.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=oo.inspectOpts[t[r]]}zO.exports=fK()(oo);var{formatters:Wbe}=zO.exports;Wbe.o=function(e){return this.inspectOpts.colors=this.useColors,JO.inspect(e,this.inspectOpts).split(`
|
||||
`).map(t=>t.trim()).join(" ")};Wbe.O=function(e){return this.inspectOpts.colors=this.useColors,JO.inspect(e,this.inspectOpts)}});var pK=G((Irr,AK)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?AK.exports=Ybe():AK.exports=Vbe()});var XO=G(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.DownloadHTTPError=Ji.DownloadLengthMismatchError=Ji.DownloadError=Ji.ExpiredMetadataError=Ji.EqualVersionError=Ji.BadVersionError=Ji.RepositoryError=Ji.PersistError=Ji.RuntimeError=Ji.ValueError=void 0;var hK=class extends Error{};Ji.ValueError=hK;var dK=class extends Error{};Ji.RuntimeError=dK;var gK=class extends Error{};Ji.PersistError=gK;var YD=class extends Error{};Ji.RepositoryError=YD;var ZO=class extends YD{};Ji.BadVersionError=ZO;var mK=class extends ZO{};Ji.EqualVersionError=mK;var yK=class extends YD{};Ji.ExpiredMetadataError=yK;var WD=class extends Error{};Ji.DownloadError=WD;var EK=class extends WD{};Ji.DownloadLengthMismatchError=EK;var IK=class extends WD{constructor(t,r){super(t),this.statusCode=r}};Ji.DownloadHTTPError=IK});var Jbe=G(f1=>{"use strict";var wK=f1&&f1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f1,"__esModule",{value:!0});f1.withTempFile=void 0;var CK=wK(Ce("fs/promises")),y2t=wK(Ce("os")),Kbe=wK(Ce("path")),E2t=async e=>I2t(async t=>e(Kbe.default.join(t,"tempfile")));f1.withTempFile=E2t;var I2t=async e=>{let t=await CK.default.realpath(y2t.default.tmpdir()),r=await CK.default.mkdtemp(t+Kbe.default.sep);try{return await e(r)}finally{await CK.default.rm(r,{force:!0,recursive:!0,maxRetries:3})}}});var vK=G(Qg=>{"use strict";var eL=Qg&&Qg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qg,"__esModule",{value:!0});Qg.DefaultFetcher=Qg.BaseFetcher=void 0;var C2t=eL(pK()),zbe=eL(Ce("fs")),w2t=eL(pO()),B2t=eL(Ce("util")),Zbe=XO(),v2t=Jbe(),S2t=(0,C2t.default)("tuf:fetch"),$O=class{async downloadFile(t,r,s){return(0,v2t.withTempFile)(async a=>{let n=await this.fetch(t),c=0,f=zbe.default.createWriteStream(a);try{for await(let p of n){let h=Buffer.from(p);if(c+=h.length,c>r)throw new Zbe.DownloadLengthMismatchError("Max length reached");await b2t(f,h)}}finally{await B2t.default.promisify(f.close).bind(f)()}return s(a)})}async downloadBytes(t,r){return this.downloadFile(t,r,async s=>{let a=zbe.default.createReadStream(s),n=[];for await(let c of a)n.push(c);return Buffer.concat(n)})}};Qg.BaseFetcher=$O;var BK=class extends $O{constructor(t={}){super(),this.timeout=t.timeout,this.retry=t.retry}async fetch(t){S2t("GET %s",t);let r=await(0,w2t.default)(t,{timeout:this.timeout,retry:this.retry});if(!r.ok||!r?.body)throw new Zbe.DownloadHTTPError("Failed to download",r.status);return r.body}};Qg.DefaultFetcher=BK;var b2t=async(e,t)=>new Promise((r,s)=>{e.write(t,a=>{a&&s(a),r(!0)})})});var Xbe=G(tL=>{"use strict";Object.defineProperty(tL,"__esModule",{value:!0});tL.defaultConfig=void 0;tL.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var $be=G(rL=>{"use strict";Object.defineProperty(rL,"__esModule",{value:!0});rL.TrustedMetadataStore=void 0;var Bs=WO(),Hi=XO(),SK=class{constructor(t){this.trustedSet={},this.referenceTime=new Date,this.loadTrustedRoot(t)}get root(){if(!this.trustedSet.root)throw new ReferenceError("No trusted root metadata");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(t){return this.trustedSet[t]}updateRoot(t){let r=JSON.parse(t.toString("utf8")),s=Bs.Metadata.fromJSON(Bs.MetadataKind.Root,r);if(s.signed.type!=Bs.MetadataKind.Root)throw new Hi.RepositoryError(`Expected 'root', got ${s.signed.type}`);if(this.root.verifyDelegate(Bs.MetadataKind.Root,s),s.signed.version!=this.root.signed.version+1)throw new Hi.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${s.signed.version}`);return s.verifyDelegate(Bs.MetadataKind.Root,s),this.trustedSet.root=s,s}updateTimestamp(t){if(this.snapshot)throw new Hi.RuntimeError("Cannot update timestamp after snapshot");if(this.root.signed.isExpired(this.referenceTime))throw new Hi.ExpiredMetadataError("Final root.json is expired");let r=JSON.parse(t.toString("utf8")),s=Bs.Metadata.fromJSON(Bs.MetadataKind.Timestamp,r);if(s.signed.type!=Bs.MetadataKind.Timestamp)throw new Hi.RepositoryError(`Expected 'timestamp', got ${s.signed.type}`);if(this.root.verifyDelegate(Bs.MetadataKind.Timestamp,s),this.timestamp){if(s.signed.version<this.timestamp.signed.version)throw new Hi.BadVersionError(`New timestamp version ${s.signed.version} is less than current version ${this.timestamp.signed.version}`);if(s.signed.version===this.timestamp.signed.version)throw new Hi.EqualVersionError(`New timestamp version ${s.sLine truncated
|
||||
|
||||
`,FBt=/\u2014 (\S+) (\S+)\n/g;function NBt(e,t){let r=(0,RBt.filterTLogAuthorities)(t,{targetDate:new Date(Number(e.integratedTime)*1e3)}),s=e.inclusionProof,a=VK.fromString(s.checkpoint.envelope),n=KK.fromString(a.note);if(!OBt(a,r))throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!WK.crypto.bufferEqual(n.logHash,s.rootHash))throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}function OBt(e,t){let r=Buffer.from(e.note,"utf-8");return e.signatures.every(s=>{let a=t.find(n=>WK.crypto.bufferEqual(n.logID.subarray(0,4),s.keyHint));return a?WK.crypto.verify(r,a.publicKey,s.signature):!1})}var VK=class e{constructor(t,r){this.note=t,this.signatures=r}static fromString(t){if(!t.includes(YK))throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let r=t.indexOf(YK),s=t.slice(0,r+1),n=t.slice(r+YK.length).matchAll(FBt),c=Array.from(n,f=>{let[,p,h]=f,E=Buffer.from(h,"base64");if(E.length<5)throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:p,keyHint:E.subarray(0,4),signature:E.subarray(4)}});if(c.length===0)throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new e(s,c)}},KK=class e{constructor(t,r,s,a){this.origin=t,this.logSize=r,this.logHash=s,this.rest=a}static fromString(t){let r=t.trimEnd().split(`
|
||||
`);if(r.length<3)throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let s=r[0],a=BigInt(r[1]),n=Buffer.from(r[2],"base64"),c=r.slice(3);return new e(s,a,n,c)}}});var wDe=G($K=>{"use strict";Object.defineProperty($K,"__esModule",{value:!0});$K.verifyMerkleInclusion=UBt;var XK=xl(),zK=bo(),LBt=Buffer.from([0]),MBt=Buffer.from([1]);function UBt(e){let t=e.inclusionProof,r=BigInt(t.logIndex),s=BigInt(t.treeSize);if(r<0n||r>=s)throw new zK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${r}`});let{inner:a,border:n}=_Bt(r,s);if(t.hashes.length!==a+n)throw new zK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let c=t.hashes.slice(0,a),f=t.hashes.slice(a),p=WBt(e.canonicalizedBody),h=jBt(HBt(p,c,r),f);if(!XK.crypto.bufferEqual(h,t.rootHash))throw new zK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}function _Bt(e,t){let r=GBt(e,t),s=qBt(e>>BigInt(r));return{inner:r,border:s}}function HBt(e,t,r){return t.reduce((s,a,n)=>r>>BigInt(n)&BigInt(1)?ZK(a,s):ZK(s,a),e)}function jBt(e,t){return t.reduce((r,s)=>ZK(s,r),e)}function GBt(e,t){return YBt(e^t-BigInt(1))}function qBt(e){return e.toString(2).split("1").length-1}function YBt(e){return e===0n?0:e.toString(2).length}function ZK(e,t){return XK.crypto.digest("sha256",MBt,e,t)}function WBt(e){return XK.crypto.digest("sha256",LBt,e)}});var vDe=G(eJ=>{"use strict";Object.defineProperty(eJ,"__esModule",{value:!0});eJ.verifyTLogSET=JBt;var BDe=xl(),VBt=bo(),KBt=Ey();function JBt(e,t){if(!(0,KBt.filterTLogAuthorities)(t,{logID:e.logId.keyId,targetDate:new Date(Number(e.integratedTime)*1e3)}).some(a=>{let n=zBt(e),c=Buffer.from(BDe.json.canonicalize(n),"utf8"),f=e.inclusionPromise.signedEntryTimestamp;return BDe.crypto.verify(c,a.publicKey,f)}))throw new VBt.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}function zBt(e){let{integratedTime:t,logIndex:r,logId:s,canonicalizedBody:a}=e;return{body:a.toString("base64"),integratedTime:Number(t),logIndex:Number(r),logID:s.keyId.toString("hex")}}});var SDe=G(nJ=>{"use strict";Object.defineProperty(nJ,"__esModule",{value:!0});nJ.verifyRFC3161Timestamp=$Bt;var tJ=xl(),rJ=bo(),ZBt=GK(),XBt=Ey();function $Bt(e,t,r){let s=e.signingTime;if(r=(0,XBt.filterCertAuthorities)(r,{start:s,end:s}),r=tvt(r,{serialNumber:e.signerSerialNumber,issuer:e.signerIssuer}),!r.some(n=>{try{return evt(e,t,n),!0}catch{return!1}}))throw new rJ.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}function evt(e,t,r){let[s,...a]=r.certChain,n=tJ.crypto.createPublicKey(s.publicKey),c=e.signingTime;try{new ZBt.CertificateChainVerifier({untrustedCert:s,trustedCerts:a}).verify()}catch{throw new rJ.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}if(!r.certChain.every(p=>p.validForDate(c)))throw new rJ.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp was signed with an expired certificate"});e.verify(t,n)}function tvt(e,t){return e.filter(r=>r.certChain.length>0&&tJ.crypto.bufferEqual(r.certChain[0].serialNumber,t.serialNumber)&&tJ.crypto.bufferEqual(r.certChain[0].issuer,t.issuer))}});var bDe=G(gL=>{"use strict";Object.defineProperty(gL,"__esModule",{value:!0});gL.verifyTSATimestamp=avt;gL.verifyTLogTimestamp=lvt;var rvt=bo(),nvt=CDe(),ivt=wDe(),svt=vDe(),ovt=SDe();function avt(e,t,r){return(0,ovt.verifyRFC3161Timestamp)(e,t,r),{type:"timestamp-authority",logID:e.signerSerialNumber,timestamp:e.signingTime}}function lvt(e,t){let r=!1;if(cvt(e)&&((0,svt.verifyTLogSET)(e,t),r=!0),uvt(e)&&((0,ivt.verifyMerkleInclusion)(e),(0,nvt.verifyCheckpoint)(e,t),r=!0),!r)throw new rvt.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:e.logId.keyId,timestamp:new Date(Number(e.integratedTime)*1e3)}}function cvt(e){return e.inclusionPromise!==void 0}function uvt(e){return e.inclusionProof!==void 0}});var DDe=G(iJ=>{"use strict";Object.defineProperty(iJ,"__esModule",{value:!0});iJ.verifyDSSETLogBody=fvt;var mL=bo();function fvt(e,t){switch(e.apiVersion){case"0.0.1":return Avt(e,t);default:throw new mL.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${e.apiVersion}`})}}function Avt(e,t){if(e.spec.signatures?.length!==1)throw new mL.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let r=e.spec.signatures[0].signature;if(!t.compareSignature(Buffer.from(r,"base64")))throw new mL.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let s=e.spec.payloadHash?.value||"";if(!t.compareDigest(Buffer.from(s,"hex")))throw new mL.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}});var PDe=G(oJ=>{"use strict";Object.defineProperty(oJ,"__esModule",{value:!0});oJ.verify
Line truncated
|
||||
Try running the command again with the package name prefixed: ${ue.pretty(r,"yarn add",ue.Type.CODE)} ${ue.pretty(r,H.makeDescriptor(H.makeIdent(null,"my-package"),`${ie[0]}...`),ue.Type.DESCRIPTOR)}`);if(!$)throw new ot(`The ${ue.pretty(r,K,ue.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let fe=wot(a,$,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(fe.map(async ge=>{let pe=await tS($,{project:s,workspace:a,cache:n,fixed:c,target:ge,modifier:h,strategies:E,maxResults:C});return{request:$,suggestedDescriptors:pe,target:ge}}))})).then(K=>K.flat()),I=await fA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async K=>{for(let{request:$,suggestedDescriptors:{suggestions:ie,rejections:fe}}of x)if(ie.filter(ge=>ge.descriptor!==null).length===0){let[ge]=fe;if(typeof ge>"u")throw new Error("Assertion failed: Expected an error to have been set");s.configuration.get("enableNetwork")?K.reportError(27,`${H.prettyDescriptor(r,$)} can't be resolved to a satisfying range`):K.reportError(27,`${H.prettyDescriptor(r,$)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),K.reportSeparator(),K.reportExceptionOnce(ge)}});if(I.hasErrors())return I.exitCode();let R=!1,N=[],U=[];for(let{suggestedDescriptors:{suggestions:K},target:$}of x){let ie,fe=K.filter(De=>De.descriptor!==null),le=fe[0].descriptor,ge=fe.every(De=>H.areDescriptorsEqual(De.descriptor,le));fe.length===1||ge?ie=le:(R=!0,{answer:ie}=await(0,m0e.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:K.map(({descriptor:De,name:ye,reason:d})=>De?{name:ye,hint:d,descriptor:De}:{name:ye,hint:d,disabled:!0}),onCancel:()=>process.exit(130),result(De){return this.find(De,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let pe=a.manifest[$].get(ie.identHash);(typeof pe>"u"||pe.descriptorHash!==ie.descriptorHash)&&(a.manifest[$].set(ie.identHash,ie),this.optional&&($==="dependencies"?a.manifest.ensureDependencyMeta({...ie,range:"unknown"}).optional=!0:$==="peerDependencies"&&(a.manifest.ensurePeerDependencyMeta({...ie,range:"unknown"}).optional=!0)),typeof pe>"u"?N.push([a,$,ie,E]):U.push([a,$,pe,ie]))}return await r.triggerMultipleHooks(K=>K.afterWorkspaceDependencyAddition,N),await r.triggerMultipleHooks(K=>K.afterWorkspaceDependencyReplacement,U),R&&this.context.stdout.write(`
|
||||
`),await s.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function wot(e,t,{dev:r,peer:s,preferDev:a,optional:n}){let c=e.manifest.dependencies.has(t.identHash),f=e.manifest.devDependencies.has(t.identHash),p=e.manifest.peerDependencies.has(t.identHash);if((r||s)&&c)throw new ot(`Package "${H.prettyIdent(e.project.configuration,t)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!s&&p)throw new ot(`Package "${H.prettyIdent(e.project.configuration,t)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(n&&f)throw new ot(`Package "${H.prettyIdent(e.project.configuration,t)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(n&&!s&&p)throw new ot(`Package "${H.prettyIdent(e.project.configuration,t)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||a)&&n)throw new ot(`Package "${H.prettyIdent(e.project.configuration,t)}" cannot simultaneously be a dev dependency and an optional dependency`);let h=[];return s&&h.push("peerDependencies"),(r||a)&&h.push("devDependencies"),n&&h.push("dependencies"),h.length>0?h:f?["devDependencies"]:p?["peerDependencies"]:["dependencies"]}Ge();Ge();jt();var eC=class extends ft{constructor(){super(...arguments);this.verbose=he.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=he.String({required:!1})}static{this.paths=[["bin"]]}static{this.usage=st.Usage({description:"get the path to a binary script",details:`
|
||||
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
|
||||
|
||||
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
|
||||
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Tt.find(r,this.context.cwd);if(await s.restoreInstallState(),this.name){let f=(await wn.getPackageAccessibleBinaries(a,{project:s})).get(this.name);if(!f)throw new ot(`Couldn't find a binary named "${this.name}" for package "${H.prettyLocator(r,a)}"`);let[,p]=f;return this.context.stdout.write(`${p}
|
||||
`),0}return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async c=>{let f=await wn.getPackageAccessibleBinaries(a,{project:s}),h=Array.from(f.keys()).reduce((E,C)=>Math.max(E,C.length),0);for(let[E,[C,S]]of f)c.reportJson({name:E,source:H.stringifyIdent(C),path:S});if(this.verbose)for(let[E,[C]]of f)c.reportInfo(null,`${E.padEnd(h," ")} ${H.prettyLocator(r,C)}`);else for(let E of f.keys())c.reportInfo(null,E)})).exitCode()}};Ge();bt();jt();var tC=class extends ft{constructor(){super(...arguments);this.mirror=he.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=he.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}static{this.paths=[["cache","clean"],["cache","clear"]]}static{this.usage=st.Usage({description:"remove the shared cache files",details:`
|
||||
This command will remove all the files from the cache.
|
||||
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);if(!r.get("enableCacheClean"))throw new ot("Cache cleaning is currently disabled. To enable it, set `enableCacheClean: true` in your configuration file. Note: Cache cleaning is typically not required and should be avoided when using Zero-Installs.");let s=await zr.find(r);return(await Ft.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&s.mirrorCwd!==null,c=!this.mirror;n&&(await ae.removePromise(s.mirrorCwd),await r.triggerHook(f=>f.cleanGlobalArtifacts,r)),c&&await ae.removePromise(s.cwd)})).exitCode()}};Ge();jt();Zl();var w5=Ce("util"),rC=class extends ft{constructor(){super(...arguments);this.why=he.Boolean("--why",!1,{description:"Print the explanation for why a setting has its value"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=he.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=he.String()}static{this.paths=[["config","get"]]}static{this.usage=st.Usage({description:"read a configuration settings",details:`
|
||||
This command will print a configuration setting.
|
||||
|
||||
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
|
||||
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=this.name.replace(/[.[].*$/,""),a=this.name.replace(/^[^.[]*/,"");if(typeof r.settings.get(s)>"u")throw new ot(`Couldn't find a configuration settings named "${s}"`);let c=r.getSpecial(s,{hideSecrets:!this.unsafe,getNativePaths:!0}),f=qe.convertMapsToIndexableObjects(c),p=a?xa(f,a):f,h=await Ft.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async E=>{E.reportJson(p)});if(!this.json){if(typeof p=="string")return this.context.stdout.write(`${p}
|
||||
`),h.exitCode();w5.inspect.styles.name="cyan",this.context.stdout.write(`${(0,w5.inspect)(p,{depth:1/0,colors:r.get("enableColors"),compact:!1})}
|
||||
`)}return h.exitCode()}};Ge();jt();Zl();var B5=Ce("util"),nC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=he.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=he.String();this.value=he.String()}static{this.paths=[["config","set"]]}static{this.usage=st.Usage({description:"change a configuration settings",details:`
|
||||
This command will set a configuration setting.
|
||||
|
||||
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
|
||||
|
||||
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
|
||||
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new ot("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new ot(`Couldn't find a configuration settings named "${a}"`);if(a==="enableStrictSettings")throw new ot("This setting only affects the file it's in, and thus cannot be set from the CLI");let f=this.json?JSON.parse(this.value):this.value;await(this.home?I=>Je.updateHomeConfiguration(I):I=>Je.updateConfiguration(s(),I))(I=>{if(n){let R=pd(I);return J0(R,this.name,f),R}else return{...I,[a]:f}});let E=(await Je.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),C=qe.convertMapsToIndexableObjects(E),S=n?xa(C,n):C;return(await Ft.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async I=>{B5.inspect.styles.name="cyan",I.reportInfo(0,`Successfully set ${this.name} to ${(0,B5.inspect)(S,{depth:1/0,colors:r.get("enableColors"),compact:!1})}`)})).exitCode()}};Ge();jt();Zl();var iC=class extends ft{constructor(){super(...arguments);this.home=he.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=he.String()}static{this.paths=[["config","unset"]]}static{this.usage=st.Usage({description:"unset a configuration setting",details:`
|
||||
This command will unset a configuration setting.
|
||||
`,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new ot("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new ot(`Couldn't find a configuration settings named "${a}"`);let f=this.home?h=>Je.updateHomeConfiguration(h):h=>Je.updateConfiguration(s(),h);return(await Ft.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async h=>{let E=!1;await f(C=>{if(!CB(C,this.name))return h.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),E=!0,C;let S=n?pd(C):{...C};return hd(S,this.name),S}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ge();bt();jt();var qR=Ce("util"),sC=class extends ft{constructor(){super(...arguments);this.noDefaults=he.Boolean("--no-defaults",!1,{description:"Omit the default values from the display"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.verbose=he.Boolean("-v,--verbose",{hidden:!0});this.why=he.Boolean("--why",{hidden:!0});this.names=he.Rest()}static{this.paths=[["config"]]}static{this.usage=st.Usage({description:"display the current configuration",details:`
|
||||
This command prints the current active configuration settings.
|
||||
`,examples:[["Print the active configuration settings","$0 config"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins,{strict:!1}),s=await kI({configuration:r,stdout:this.context.stdout,forceError:this.json},[{option:this.verbose,message:"The --verbose option is deprecated, the settings' descriptions are now always displayed"},{option:this.why,message:"The --why option is deprecated, the settings' sources are now always displayed"}]);if(s!==null)return s;let a=this.names.length>0?[...new Set(this.names)].sort():[...r.settings.keys()].sort(),n,c=await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async f=>{if(r.invalid.size>0&&!this.json){for(let[p,h]of r.invalid)f.reportError(34,`Invalid configuration key "${p}" in ${h}`);f.reportSeparator()}if(this.json)for(let p of a){if(this.noDefaults&&!r.sources.has(p))continue;let h=r.settings.get(p);typeof h>"u"&&f.reportError(34,`No configuration key named "${p}"`);let E=r.getSpecial(p,{hideSecrets:!0,getNativePaths:!0}),C=r.sources.get(p)??"<default>",S=C&&C[0]!=="<"?Ae.fromPortablePath(C):C;f.reportJson({key:p,effective:E,source:S,...h})}else{let p={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},h={},E={children:h};for(let C of a){if(this.noDefaults&&!r.sources.has(C))continue;let S=r.settings.get(C),x=r.sources.get(C)??"<default>",I=r.getSpecial(C,{hideSecrets:!0,getNativePaths:!0}),R={Description:{label:"Description",value:ue.tuple(ue.Type.MARKDOWN,{text:S.description,format:this.cli.format(),paragraphs:!1})},Source:{label:"Source",value:ue.tuple(x[0]==="<"?ue.Type.CODE:ue.Type.PATH,x)}};h[C]={value:ue.tuple(ue.Type.CODE,C),children:R};let N=(U,K)=>{for(let[$,ie]of K)if(ie instanceof Map){let fe={};U[$]={children:fe},N(fe,ie)}else U[$]={label:$,value:ue.tuple(ue.Type.NO_HINT,(0,qR.inspect)(ie,p))}};I instanceof Map?N(R,I):R.Value={label:"Value",value:ue.tuple(ue.Type.NO_HINT,(0,qR.inspect)(I,p))}}a.length!==1&&(n=void 0),ts.emitTree(E,{configuration:r,json:this.json,stdout:this.context.stdout,separators:2})}});if(!this.json&&typeof n<"u"){let f=a[0],p=(0,qR.inspect)(r.getSpecial(f,{hideSecrets:!0,getNativePaths:!0}),{colors:r.get("enableColors")});this.context.stdout.write(`
|
||||
`),this.context.stdout.write(`${p}
|
||||
`)}return c.exitCode()}};Ge();jt();Jo();var YR={};Vt(YR,{Strategy:()=>rS,acceptedStrategies:()=>Bot,dedupe:()=>v5});Ge();Ge();var y0e=et(Zo()),rS=(t=>(t.HIGHEST="highest",t))(rS||{}),Bot=new Set(Object.values(rS)),vot={highest:async(e,t,{resolver:r,fetcher:s,resolveOptions:a,fetchOptions:n})=>{let c=new Map;for(let[p,h]of e.storedResolutions){let E=e.storedDescriptors.get(p);if(typeof E>"u")throw new Error(`Assertion failed: The descriptor (${p}) should have been registered`);qe.getSetWithDefault(c,E.identHash).add(h)}let f=new Map(qe.mapAndFilter(e.storedDescriptors.values(),p=>H.isVirtualDescriptor(p)?qe.mapAndFilter.skip:[p.descriptorHash,qe.makeDeferred()]));for(let p of e.storedDescriptors.values()){let h=f.get(p.descriptorHash);if(typeof h>"u")throw new Error(`Assertion failed: The descriptor (${p.descriptorHash}) should have been registered`);let E=e.storedResolutions.get(p.descriptorHash);if(typeof E>"u")throw new Error(`Assertion failed: The resolution (${p.descriptorHash}) should have been registered`);let C=e.originalPackages.get(E);if(typeof C>"u")throw new Error(`Assertion failed: The package (${E}) should have been registered`);Promise.resolve().then(async()=>{let S=r.getResolutionDependencies(p,a),x=Object.fromEntries(await qe.allSettledSafe(Object.entries(S).map(async([$,ie])=>{let fe=f.get(ie.descriptorHash);if(typeof fe>"u")throw new Error(`Assertion failed: The descriptor (${ie.descriptorHash}) should have been registered`);let le=await fe.promise;if(!le)throw new Error("Assertion failed: Expected the dependency to have been through the dedupe process itself");return[$,le.updatedPackage]})));if(t.length&&!y0e.default.isMatch(H.stringifyIdent(p),t)||!r.shouldPersistResolution(C,a))return C;let I=c.get(p.identHash);if(typeof I>"u")throw new Error(`Assertion failed: The resolutions (${p.identHash}) should have been registered`);if(I.size===1)return C;let R=[...I].map($=>{let ie=e.originalPackages.get($);if(typeof ie>"u")throw new Error(`Assertion failed: The package (${$}) should have been registered`);return ie}),N=await r.getSatisfying(p,x,R,a),U=N.locators?.[0];if(typeof U>"u"||!N.sorted)return C;let K=e.originalPackages.get(U.locatorHash);if(typeof K>"u")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return K}).then(async S=>{let x=await e.preparePackage(S,{resolver:r,resolveOptions:a});h.resolve({descriptor:p,currentPackage:C,updatedPackage:S,resolvedPackage:x})}).catch(S=>{h.reject(S)})}return[...f.values()].map(p=>p.promise)}};async function v5(e,{strategy:t,patterns:r,cache:s,report:a}){let{configuration:n}=e,c=new Qi,f=n.makeResolver(),p=n.makeFetcher(),h={cache:s,checksums:e.storedChecksums,fetcher:p,project:e,report:c,cacheOptions:{skipIntegrityCheck:!0}},E={project:e,resolver:f,report:c,fetchOptions:h};return await a.startTimerPromise("Deduplication step",async()=>{let C=vot[t],S=await C(e,r,{resolver:f,resolveOptions:E,fetcher:p,fetchOptions:h}),x=Io.progressViaCounter(S.length);await a.reportProgress(x);let I=0;await Promise.all(S.map(U=>U.then(K=>{if(K===null||K.currentPackage.locatorHash===K.updatedPackage.locatorHash)return;I++;let{descriptor:$,currentPackage:ie,updatedPackage:fe}=K;a.reportInfo(0,`${H.prettyDescriptor(n,$)} can be deduped from ${H.prettyLocator(n,ie)} to ${H.prettyLocator(n,fe)}`),a.reportJson({descriptor:H.stringifyDescriptor($),currentResolution:H.stringifyLocator(ie),updatedResolution:H.stringifyLocator(fe)}),e.storedResolutions.set($.descriptorHash,fe.locatorHash)}).finally(()=>x.tick())));let R;switch(I){case 0:R="No packages";break;case 1:R="One package";break;default:R=`${I} packages`}let N=ue.pretty(n,t,ue.Type.CODE);return a.reportInfo(0,`${R} can be deduped using the ${N} strategy`),I})}var oC=class extends ft{constructor(){super(...arguments);this.strategy=he.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:Qs(rS)});this.check=he.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=he.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=he.Rest()}static{this.paths=[["dedupe"]]}static{this.usage=st.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.\n\n This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):\n\n - `highest`: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never downgraded.
Line truncated
|
||||
`)}};var lC=class extends ft{static{this.paths=[["help"],["--help"],["-h"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ge();bt();jt();var cC=class extends ft{constructor(){super(...arguments);this.leadingArgument=he.String();this.args=he.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!H.tryParseIdent(this.leadingArgument)){let r=Y.resolve(this.context.cwd,Ae.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}};Ge();var uC=class extends ft{static{this.paths=[["-v"],["--version"]]}async execute(){this.context.stdout.write(`${An||"<unknown>"}
|
||||
`)}};Ge();Ge();jt();var fC=class extends ft{constructor(){super(...arguments);this.commandName=he.String();this.args=he.Proxy()}static{this.paths=[["exec"]]}static{this.usage=st.Usage({description:"execute a shell script",details:`
|
||||
This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.
|
||||
|
||||
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
|
||||
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Tt.find(r,this.context.cwd);return await s.restoreInstallState(),await wn.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:s})}};Ge();jt();Jo();var AC=class extends ft{constructor(){super(...arguments);this.hash=he.String({required:!1,validator:ld(Jf(),[Sp(/^p[0-9a-f]{6}$/)])})}static{this.paths=[["explain","peer-requirements"]]}static{this.usage=st.Usage({description:"explain a set of peer requirements",details:`
|
||||
A peer requirement represents all peer requests that a subject must satisfy when providing a requested package to requesters.
|
||||
|
||||
When the hash argument is specified, this command prints a detailed explanation of the peer requirement corresponding to the hash and whether it is satisfied or not.
|
||||
|
||||
When used without arguments, this command lists all peer requirements and the corresponding hash that can be used to get detailed information about a given requirement.
|
||||
|
||||
**Note:** A hash is a seven-letter code consisting of the letter 'p' followed by six characters that can be obtained from peer dependency warnings or from the list of all peer requirements(\`yarn explain peer-requirements\`).
|
||||
`,examples:[["Explain the corresponding peer requirement for a hash","$0 explain peer-requirements p1a4ed"],["List all peer requirements","$0 explain peer-requirements"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);return await s.restoreInstallState({restoreResolutions:!1}),await s.applyLightResolution(),typeof this.hash<"u"?await bot(this.hash,s,{stdout:this.context.stdout}):await Dot(s,{stdout:this.context.stdout})}};async function bot(e,t,r){let s=t.peerRequirementNodes.get(e);if(typeof s>"u")throw new Error(`No peerDependency requirements found for hash: "${e}"`);let a=new Set,n=p=>a.has(p.requester.locatorHash)?{value:ue.tuple(ue.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:ue.tuple(ue.Type.NO_HINT,"...")}]:[]}:(a.add(p.requester.locatorHash),{value:ue.tuple(ue.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[H.stringifyLocator(h.requester),n(h)]))}),c=t.peerWarnings.find(p=>p.hash===e);return(await Ft.start({configuration:t.configuration,stdout:r.stdout,includeFooter:!1,includePrefix:!1},async p=>{let h=ue.mark(t.configuration),E=c?h.Cross:h.Check;if(p.reportInfo(0,`Package ${ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)} is requested to provide ${ue.pretty(t.configuration,s.ident,ue.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)),ts.emitTree({children:Object.fromEntries(Array.from(s.requests.values(),C=>[H.stringifyLocator(C.requester),n(C)]))},{configuration:t.configuration,stdout:r.stdout,json:!1}),p.reportSeparator(),s.provided.range==="missing:"){let C=c?"":" , but all peer requests are optional";p.reportInfo(0,`${E} Package ${ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)} does not provide ${ue.pretty(t.configuration,s.ident,ue.Type.IDENT)}${C}.`)}else{let C=t.storedResolutions.get(s.provided.descriptorHash);if(!C)throw new Error("Assertion failed: Expected the descriptor to be registered");let S=t.storedPackages.get(C);if(!S)throw new Error("Assertion failed: Expected the package to be registered");p.reportInfo(0,`${E} Package ${ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)} provides ${ue.pretty(t.configuration,s.ident,ue.Type.IDENT)} with version ${H.prettyReference(t.configuration,S.version??"0.0.0")}, ${c?"which does not satisfy all requests.":"which satisfies all requests"}`),c?.type===3&&(c.range?p.reportInfo(0,` The combined requested range is ${ue.pretty(t.configuration,c.range,ue.Type.RANGE)}`):p.reportInfo(0," Unfortunately, the requested ranges have no overlap"))}})).exitCode()}async function Dot(e,t){return(await Ft.start({configuration:e.configuration,stdout:t.stdout,includeFooter:!1,includePrefix:!1},async s=>{let a=ue.mark(e.configuration),n=qe.sortMap(e.peerRequirementNodes,[([,c])=>H.stringifyLocator(c.subject),([,c])=>H.stringifyIdent(c.ident)]);for(let[,c]of n.values()){if(!c.root)continue;let f=e.peerWarnings.find(E=>E.hash===c.hash),p=[...H.allPeerRequests(c)],h;if(p.length>2?h=` and ${p.length-1} other dependencies`:p.length===2?h=" and 1 other dependency":h="",c.provided.range!=="missing:"){let E=e.storedResolutions.get(c.provided.descriptorHash);if(!E)throw new Error("Assertion failed: Expected the resolution to have been registered");let C=e.storedPackages.get(E);if(!C)throw new Error("Assertion failed: Expected the provided package to have been registered");let S=`${ue.pretty(e.configuration,c.hash,ue.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${H.prettyLocator(e.configuration,c.subject)} provides ${H.prettyLocator(e.configuration,C)} to ${H.prettyLocator(e.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,S):s.reportInfo(0,S)}else{let E=`${ue.pretty(e.configuration,c.hash,ue.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${H.prettyLocator(e.configuration,c.subject)} doesn't provide ${H.prettyIdent(e.configuration,c.ident)} to ${H.prettyLocator(e.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,E):s.reportInfo(0,E)}}})).exitCode()}Ge();jt();Jo();Ge();Ge();bt();jt();var I0e=et(hi()),pC=class extends ft{constructor(){super(...arguments);this.useYarnPath=he.Boolean("--yarn-path",{description:"Set the yarnPath setting even if the version can be accessed by Corepack"});this.onlyIfNeeded=he.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=he.String()}static{this.paths=[["set","version"]]}static{this.usage=st.Usage({description:"lock the Yarn version used by the project",details:"\n This command will set a specific release of Yarn to be used by Corepack: https://nodejs.org/api/corepack.html.\n\n By default it only will set the `packageManager` field at the root of your project, but if the referenced release cannot be represented this way, if you already have `yarnPath` configured, or if you set th
Line truncated
|
||||
${t}`)})}let f=e.projectCwd??e.startingCwd,p=Y.resolve(f,".yarn/releases"),h=Y.resolve(p,`yarn-${t}.cjs`),E=Y.relative(e.startingCwd,h),C=qe.isTaggedYarnVersion(t),S=e.get("yarnPath"),x=!C,I=x||!!S||!!a;if(a===!1){if(x)throw new Lt(0,"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack");I=!1}else!I&&!process.env.COREPACK_ROOT&&(s.reportWarning(0,`You don't seem to have ${ue.applyHyperlink(e,"Corepack","https://nodejs.org/api/corepack.html")} enabled; we'll have to rely on ${ue.applyHyperlink(e,"yarnPath","https://yarnpkg.com/configuration/yarnrc#yarnPath")} instead`),I=!0);if(I){let $=await c();s.reportInfo(0,`Saving the new release in ${ue.pretty(e,E,"magenta")}`),await ae.removePromise(Y.dirname(h)),await ae.mkdirPromise(Y.dirname(h),{recursive:!0}),await ae.writeFilePromise(h,$,{mode:493}),await Je.updateConfiguration(f,{yarnPath:Y.relative(f,h)})}else await ae.removePromise(Y.dirname(h)),await Je.updateConfiguration(f,{yarnPath:Je.deleteProperty});let R=await _t.tryFind(f)||new _t;R.packageManager=`yarn@${C?t:await nS(e,"stable")}`;let N={};R.exportTo(N);let U=Y.join(f,_t.fileName),K=`${JSON.stringify(N,null,R.indent)}
|
||||
`;return await ae.changeFilePromise(U,K,{automaticNewlines:!0}),{bundleVersion:t}}function C0e(e){return pr[Vx(e)]}var xot=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function kot(e){let r=`https://repo.yarnpkg.com/${qe.isTaggedYarnVersion(An)?An:await nS(e,"canary")}/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx`,s=await nn.get(r,{configuration:e});return new Map(Array.from(s.toString().matchAll(xot),({groups:a})=>{if(!a)throw new Error("Assertion failed: Expected the match to have been successful");let n=C0e(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected "${a.name}" to be named "${n}"`);return[a.code,a.details]}))}var hC=class extends ft{constructor(){super(...arguments);this.code=he.String({required:!1,validator:z2(Jf(),[Sp(/^YN[0-9]{4}$/)])});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["explain"]]}static{this.usage=st.Usage({description:"explain an error code",details:`
|
||||
When the code argument is specified, this command prints its name and its details.
|
||||
|
||||
When used without arguments, this command lists all error codes and their names.
|
||||
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);if(typeof this.code<"u"){let s=C0e(this.code),a=ue.pretty(r,s,ue.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),f=(await kot(r)).get(this.code),p=typeof f<"u"?ue.jsonOrPretty(this.json,r,ue.tuple(ue.Type.MARKDOWN,{text:f,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
|
||||
|
||||
You can help us by editing this page on GitHub \u{1F642}:
|
||||
${ue.jsonOrPretty(this.json,r,ue.tuple(ue.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx"))}
|
||||
`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:s,details:p})}
|
||||
`):this.context.stdout.write(`${n}
|
||||
|
||||
${p}
|
||||
`)}else{let s={children:qe.mapAndFilter(Object.entries(pr),([a,n])=>Number.isNaN(Number(a))?qe.mapAndFilter.skip:{label:zf(Number(a)),value:ue.tuple(ue.Type.CODE,n)})};ts.emitTree(s,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ge();bt();jt();var w0e=et(Zo()),dC=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=he.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=he.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=he.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=he.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=he.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=he.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=he.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=he.Rest()}static{this.paths=[["info"]]}static{this.usage=st.Usage({description:"see information related to packages",details:"\n This command prints various information related to the specified packages, accepting glob patterns.\n\n By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\n\n Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\n\n Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\n ",examples:[["Show information about Lodash","$0 info lodash"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await zr.find(r);if(!a&&!this.all)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let c=new Set(this.extra);this.cache&&c.add("cache"),this.dependents&&c.add("dependents"),this.manifest&&c.add("manifest");let f=(ie,{recursive:fe})=>{let le=ie.anchoredLocator.locatorHash,ge=new Map,pe=[le];for(;pe.length>0;){let De=pe.shift();if(ge.has(De))continue;let ye=s.storedPackages.get(De);if(typeof ye>"u")throw new Error("Assertion failed: Expected the package to be registered");if(ge.set(De,ye),H.isVirtualLocator(ye)&&pe.push(H.devirtualizeLocator(ye).locatorHash),!(!fe&&De!==le))for(let d of ye.dependencies.values()){let ve=s.storedResolutions.get(d.descriptorHash);if(typeof ve>"u")throw new Error("Assertion failed: Expected the resolution to be registered");pe.push(ve)}}return ge.values()},p=({recursive:ie})=>{let fe=new Map;for(let le of s.workspaces)for(let ge of f(le,{recursive:ie}))fe.set(ge.locatorHash,ge);return fe.values()},h=({all:ie,recursive:fe})=>ie&&fe?s.storedPackages.values():ie?p({recursive:fe}):f(a,{recursive:fe}),E=({all:ie,recursive:fe})=>{let le=h({all:ie,recursive:fe}),ge=this.patterns.map(ye=>{let d=H.parseLocator(ye),ve=w0e.default.makeRe(H.stringifyIdent(d)),Ie=H.isVirtualLocator(d),me=Ie?H.devirtualizeLocator(d):d;return ce=>{let X=H.stringifyIdent(ce);if(!ve.test(X))return!1;if(d.reference==="unknown")return!0;let be=H.isVirtualLocator(ce),ke=be?H.devirtualizeLocator(ce):ce;return!(Ie&&be&&d.reference!==ce.reference||me.reference!==ke.reference)}}),pe=qe.sortMap([...le],ye=>H.stringifyLocator(ye));return{selection:pe.filter(ye=>ge.length===0||ge.some(d=>d(ye))),sortedLookup:pe}},{selection:C,sortedLookup:S}=E({all:this.all,recursive:this.recursive});if(C.length===0)throw new ot("No package matched your request");let x=new Map;if(this.dependents)for(let ie of S)for(let fe of ie.dependencies.values()){let le=s.storedResolutions.get(fe.descriptorHash);if(typeof le>"u")throw new Error("Assertion failed: Expected the resolution to be registered");qe.getArrayWithDefault(x,le).push(ie)}let I=new Map;for(let ie of S){if(!H.isVirtualLocator(ie))continue;let fe=H.devirtualizeLocator(ie);qe.getArrayWithDefault(I,fe.locatorHash).push(ie)}let R={},N={children:R},U=r.makeFetcher(),K={project:s,fetcher:U,cache:n,checksums:s.storedChecksum
Line truncated
|
||||
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
|
||||
|
||||
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
|
||||
`,examples:[["Run a Node script","$0 node ./my-script.js"]]})}async execute(){return this.cli.run(["exec","node",...this.args])}};Ge();jt();var EC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","check"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"find all third-party plugins that differ from their own spec",details:`
|
||||
Check only the plugins from https.
|
||||
|
||||
If this command detects any plugin differences in the CI environment, it will throw an error.
|
||||
`,examples:[["find all third-party plugins that differ from their own spec","$0 plugin check"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=await Je.findRcFiles(this.context.cwd);return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{for(let c of s)if(c.data?.plugins)for(let f of c.data.plugins){if(!f.checksum||!f.spec.match(/^https?:/))continue;let p=await nn.get(f.spec,{configuration:r}),h=Mn.makeHash(p);if(f.checksum===h)continue;let E=ue.pretty(r,f.path,ue.Type.PATH),C=ue.pretty(r,f.spec,ue.Type.URL),S=`${E} is different from the file provided by ${C}`;n.reportJson({...f,newChecksum:h}),n.reportError(0,S)}})).exitCode()}};Ge();Ge();bt();jt();var D0e=Ce("os");Ge();bt();jt();var B0e=Ce("os");Ge();Sc();jt();var Not="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Qm(e,t){let r=await nn.get(Not,{configuration:e}),s=us(r.toString());return Object.fromEntries(Object.entries(s).filter(([a,n])=>!t||kr.satisfiesWithPrereleases(t,n.range??"<4.0.0-rc.1")))}var IC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","list"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await Qm(r,An);for(let[c,{experimental:f,...p}]of Object.entries(n)){let h=c;f&&(h+=" [experimental]"),a.reportJson({name:c,experimental:f,...p}),a.reportInfo(null,h)}})).exitCode()}};var Oot=/^[0-9]+$/,Lot=process.platform==="win32";function v0e(e){return Oot.test(e)?`pull/${e}/head`:e}var Mot=({repository:e,branch:t},r)=>[["git","init",Ae.fromPortablePath(r)],["git","remote","add","origin",e],["git","fetch","origin","--depth=1",v0e(t)],["git","reset","--hard","FETCH_HEAD"]],Uot=({branch:e})=>[["git","fetch","origin","--depth=1",v0e(e),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx","-e","packages/yarnpkg-cli/bundles"]],_ot=({plugins:e,noMinify:t},r,s)=>[["yarn","build:cli",...new Array().concat(...e.map(a=>["--plugin",Y.resolve(s,a)])),...t?["--no-minify"]:[],"|"],[Lot?"move":"mv","packages/yarnpkg-cli/bundles/yarn.js",Ae.fromPortablePath(r),"|"]],CC=class extends ft{constructor(){super(...arguments);this.installPath=he.String("--path",{description:"The path where the repository should be cloned to"});this.repository=he.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=he.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=he.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.dryRun=he.Boolean("-n,--dry-run",!1,{description:"If set, the bundle will be built but not added to the project"});this.noMinify=he.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=he.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=he.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}static{this.paths=[["set","version","from","sources"]]}static{this.usage=st.Usage({description:"build Yarn from master",details:`
|
||||
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
|
||||
|
||||
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
|
||||
`,examples:[["Build Yarn from master","$0 set version from sources"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),a=typeof this.installPath<"u"?Y.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):Y.resolve(Ae.toPortablePath((0,B0e.tmpdir)()),"yarnpkg-sources",Mn.makeHash(this.repository).slice(0,6));return(await Ft.start({configuration:r,stdout:this.context.stdout},async c=>{await D5(this,{configuration:r,report:c,target:a}),c.reportSeparator(),c.reportInfo(0,"Building a fresh bundle"),c.reportSeparator();let f=await Yr.execvp("git",["rev-parse","--short","HEAD"],{cwd:a,strict:!0}),p=Y.join(a,`packages/yarnpkg-cli/bundles/yarn-${f.stdout.trim()}.js`);ae.existsSync(p)||(await iS(_ot(this,p,a),{configuration:r,context:this.context,target:a}),c.reportSeparator());let h=await ae.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await S5(r,null,async()=>h,{report:c});this.skipPlugins||await Hot(this,E,{project:s,report:c,target:a})}})).exitCode()}};async function iS(e,{configuration:t,context:r,target:s}){for(let[a,...n]of e){let c=n[n.length-1]==="|";if(c&&n.pop(),c)await Yr.pipevp(a,n,{cwd:s,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${ue.pretty(t,` $ ${[a,...n].join(" ")}`,"grey")}
|
||||
`);try{await Yr.execvp(a,n,{cwd:s,strict:!0})}catch(f){throw r.stdout.write(f.stdout||f.stack),f}}}}async function D5(e,{configuration:t,report:r,target:s}){let a=!1;if(!e.force&&ae.existsSync(Y.join(s,".git"))){r.reportInfo(0,"Fetching the latest commits"),r.reportSeparator();try{await iS(Uot(e),{configuration:t,context:e.context,target:s}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,"Repository update failed; we'll try to regenerate it")}}a||(r.reportInfo(0,"Cloning the remote repository"),r.reportSeparator(),await ae.removePromise(s),await ae.mkdirPromise(s,{recursive:!0}),await iS(Mot(e,s),{configuration:t,context:e.context,target:s}))}async function Hot(e,t,{project:r,report:s,target:a}){let n=await Qm(r.configuration,t),c=new Set(Object.keys(n));for(let f of r.configuration.plugins.keys())c.has(f)&&await P5(f,e,{project:r,report:s,target:a})}Ge();Ge();bt();jt();var S0e=et(hi()),b0e=Ce("vm");var wC=class extends ft{constructor(){super(...arguments);this.name=he.String();this.checksum=he.Boolean("--checksum",!0,{description:"Whether to care if this plugin is modified"})}static{this.paths=[["plugin","import"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
|
||||
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
|
||||
|
||||
Three types of plugin references are accepted:
|
||||
|
||||
- If the plugin is stored within the Yarn repository, it can be referenced by name.
|
||||
- Third-party plugins can be referenced directly through their public urls.
|
||||
- Local plugins can be referenced by their path on the disk.
|
||||
|
||||
If the \`--no-checksum\` option is set, Yarn will no longer care if the plugin is modified.
|
||||
|
||||
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
|
||||
`,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Ft.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await Tt.find(r,this.context.cwd),c,f;if(this.name.match(/^\.{0,2}[\\/]/)||Ae.isAbsolute(this.name)){let p=Y.resolve(this.context.cwd,Ae.toPortablePath(this.name));a.reportInfo(0,`Reading ${ue.pretty(r,p,ue.Type.PATH)}`),c=Y.relative(n.cwd,p),f=await ae.readFilePromise(p)}else{let p;if(this.name.match(/^https?:/)){try{new URL(this.name)}catch{throw new Lt(52,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}c=this.name,p=this.name}else{let h=H.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(h.reference!=="unknown"&&!S0e.default.valid(h.reference))throw new Lt(0,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let E=H.stringifyIdent(h),C=await Qm(r,An);if(!Object.hasOwn(C,E)){let S=`Couldn't find a plugin named ${H.prettyIdent(r,h)} on the remote registry.
|
||||
`;throw r.plugins.has(E)?S+=`A plugin named ${H.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:S+=`Note that only the plugins referenced on our website (${ue.pretty(r,"https://github.com/yarnpkg/berry/blob/master/plugins.yml",ue.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${ue.pretty(r,"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js",ue.Type.URL)}).`,new Lt(51,S)}c=E,p=C[E].url,h.reference!=="unknown"?p=p.replace(/\/master\//,`/${E}/${h.reference}/`):An!==null&&(p=p.replace(/\/master\//,`/@yarnpkg/cli/${An}/`))}a.reportInfo(0,`Downloading ${ue.pretty(r,p,"green")}`),f=await nn.get(p,{configuration:r})}await x5(c,f,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function x5(e,t,{checksum:r=!0,project:s,report:a}){let{configuration:n}=s,c={},f={exports:c};(0,b0e.runInNewContext)(t.toString(),{module:f,exports:c});let h=`.yarn/plugins/${f.exports.name}.cjs`,E=Y.resolve(s.cwd,h);a.reportInfo(0,`Saving the new plugin in ${ue.pretty(n,h,"magenta")}`),await ae.mkdirPromise(Y.dirname(E),{recursive:!0}),await ae.writeFilePromise(E,t);let C={path:h,spec:e};r&&(C.checksum=Mn.makeHash(t)),await Je.addPlugin(s.cwd,[C])}var jot=({pluginName:e,noMinify:t},r)=>[["yarn",`build:${e}`,...t?["--no-minify"]:[],"|"]],BC=class extends ft{constructor(){super(...arguments);this.installPath=he.String("--path",{description:"The path where the repository should be cloned to"});this.repository=he.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=he.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=he.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=he.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=he.String()}static{this.paths=[["plugin","import","from","sources"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
|
||||
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
|
||||
|
||||
The plugins can be referenced by their short name if sourced from the official Yarn repository.
|
||||
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=typeof this.installPath<"u"?Y.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):Y.resolve(Ae.toPortablePath((0,D0e.tmpdir)()),"yarnpkg-sources",Mn.makeHash(this.repository).slice(0,6));return(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:c}=await Tt.find(r,this.context.cwd),f=H.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),p=H.stringifyIdent(f),h=await Qm(r,An);if(!Object.hasOwn(h,p))throw new Lt(51,`Couldn't find a plugin named "${p}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let E=p;await D5(this,{configuration:r,report:n,target:s}),await P5(E,this,{project:c,report:n,target:s})})).exitCode()}};async function P5(e,{context:t,noMinify:r},{project:s,report:a,target:n}){let c=e.replace(/@yarnpkg\//,""),{configuration:f}=s;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${c}`),a.reportSeparator(),await iS(jot({pluginName:c,noMinify:r},n),{configuration:f,context:t,target:n}),a.reportSeparator();let p=Y.resolve(n,`packages/${c}/bundles/${e}.js`),h=await ae.readFilePromise(p);await x5(e,h,{project:s,report:a})}Ge();bt();jt();var vC=class extends ft{constructor(){super(...arguments);this.name=he.String()}static{this.paths=[["plugin","remove"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
|
||||
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
|
||||
|
||||
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
|
||||
`,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);return(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let c=this.name,f=H.parseIdent(c);if(!r.plugins.has(c))throw new ot(`${H.prettyIdent(r,f)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${c}.cjs`,h=Y.resolve(s.cwd,p);ae.existsSync(h)&&(n.reportInfo(0,`Removing ${ue.pretty(r,p,ue.Type.PATH)}...`),await ae.removePromise(h)),n.reportInfo(0,"Updating the configuration..."),await Je.updateConfiguration(s.cwd,{plugins:E=>{if(!Array.isArray(E))return E;let C=E.filter(S=>S.path!==p);return C.length===0?Je.deleteProperty:C.length===E.length?E:C}})})).exitCode()}};Ge();jt();var SC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","runtime"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
|
||||
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
|
||||
`,examples:[["List the currently active plugins","$0 plugin runtime"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let c=this.context.plugins.plugins.has(n),f=n;c&&(f+=" [builtin]"),a.reportJson({name:n,builtin:c}),a.reportInfo(null,`${f}`)}})).exitCode()}};Ge();Ge();jt();var bC=class extends ft{constructor(){super(...arguments);this.idents=he.Rest()}static{this.paths=[["rebuild"]]}static{this.usage=st.Usage({description:"rebuild the project's native packages",details:`
|
||||
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
|
||||
|
||||
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
|
||||
|
||||
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
|
||||
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=new Set;for(let f of this.idents)c.add(H.parseIdent(f).identHash);if(await s.restoreInstallState({restoreResolutions:!1}),await s.resolveEverything({cache:n,report:new Qi}),c.size>0)for(let f of s.storedPackages.values())c.has(f.identHash)&&(s.storedBuildState.delete(f.locatorHash),s.skippedBuilds.delete(f.locatorHash));else s.storedBuildState.clear(),s.skippedBuilds.clear();return await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();jt();var k5=et(Zo());Jo();var DC=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=he.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=he.Rest()}static{this.paths=[["remove"]]}static{this.usage=st.Usage({description:"remove dependencies from the project",details:`
|
||||
This command will remove the packages matching the specified patterns from the current workspace.
|
||||
|
||||
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
|
||||
|
||||
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
|
||||
|
||||
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
|
||||
|
||||
This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
|
||||
`,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.all?s.workspaces:[a],f=["dependencies","devDependencies","peerDependencies"],p=[],h=!1,E=[];for(let I of this.patterns){let R=!1,N=H.parseIdent(I);for(let U of c){let K=[...U.manifest.peerDependenciesMeta.keys()];for(let $ of(0,k5.default)(K,I))U.manifest.peerDependenciesMeta.delete($),h=!0,R=!0;for(let $ of f){let ie=U.manifest.getForScope($),fe=[...ie.values()].map(le=>H.stringifyIdent(le));for(let le of(0,k5.default)(fe,H.stringifyIdent(N))){let{identHash:ge}=H.parseIdent(le),pe=ie.get(ge);if(typeof pe>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");U.manifest[$].delete(ge),E.push([U,$,pe]),h=!0,R=!0}}}R||p.push(I)}let C=p.length>1?"Patterns":"Pattern",S=p.length>1?"don't":"doesn't",x=this.all?"any":"this";if(p.length>0)throw new ot(`${C} ${ue.prettyList(r,p,ue.Type.CODE)} ${S} match any packages referenced by ${x} workspace`);return h?(await r.triggerMultipleHooks(I=>I.afterWorkspaceDependencyRemoval,E),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})):0}};Ge();Ge();jt();var P0e=Ce("util"),PC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["run"]]}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);return(await Ft.start({configuration:r,stdout:this.context.stdout,json:this.json},async c=>{let f=a.manifest.scripts,p=qe.sortMap(f.keys(),C=>C),h={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},E=p.reduce((C,S)=>Math.max(C,S.length),0);for(let[C,S]of f.entries())c.reportInfo(null,`${C.padEnd(E," ")} ${(0,P0e.inspect)(S,h)}`),c.reportJson({name:C,script:S})})).exitCode()}};Ge();Ge();jt();var xC=class extends ft{constructor(){super(...arguments);this.inspect=he.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=he.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=he.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=he.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=he.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=he.Boolean("--silent",{hidden:!0});this.scriptName=he.String();this.args=he.Proxy()}static{this.paths=[["run"]]}static{this.usage=st.Usage({description:"run a script defined in the package.json",details:`
|
||||
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
|
||||
|
||||
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
|
||||
|
||||
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
|
||||
|
||||
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
|
||||
|
||||
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
|
||||
`,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a,locator:n}=await Tt.find(r,this.context.cwd);await s.restoreInstallState();let c=this.topLevel?s.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await wn.hasPackageScript(c,this.scriptName,{project:s}))return await wn.executePackageScript(c,this.scriptName,this.args,{project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let f=await wn.getPackageAccessibleBinaries(c,{project:s});if(f.get(this.scriptName)){let h=[];return this.inspect&&(typeof this.inspect=="string"?h.push(`--inspect=${this.inspect}`):h.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?h.push(`--inspect-brk=${this.inspectBrk}`):h.push("--inspect-brk")),this.require&&h.push(`--require=${this.require}`),await wn.executePackageAccessibleBinary(c,this.scriptName,this.args,{cwd:this.context.cwd,project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:h,packageAccessibleBinaries:f})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(":")){let E=(await Promise.all(s.workspaces.map(async C=>C.manifest.scripts.has(this.scriptName)?C:null))).filter(C=>C!==null);if(E.length===1)return await wn.executeWorkspaceScript(E[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new ot(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${H.prettyLocator(r,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new ot(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${H.prettyLocator(r,n)}).`);{if(this.scriptName==="global")throw new ot("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let h=[this.scriptName].concat(this.args);for(let[E,C]of WI)for(let S of C)if(h.length>=S.length&&JSON.stringify(h.slice(0,S.length))===JSON.stringify(S))throw new ot(`Couldn't find a script named "${this.scriptName}", but a matching command can be found in the ${E} plugin. You can install it with "yarn plugin import ${E}".`);throw new ot(`Couldn't find a script named "${this.scriptName}".`)}}};Ge();Ge();jt();var kC=class extends ft{constructor(){super(...arguments);this.descriptor=he.String();this.resolution=he.String()}static{this.paths=[["set","resolution"]]}static{this.usage=st.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, edit the `resolutions` field in your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 npm:1.5.0"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await zr.find(r);if(await s.restoreInstallState({restoreResolutions:!1}),!a)throw new ar(s.cwd,this.context.cwd);let c=H.parseDescriptor(this.descriptor,!0),f=H.makeDescriptor(c,this.resolution);return s.storedDescriptors.set(c.descriptorHash,c),s.storedDescriptors.set(f.descriptorHash,f),s.resolutionAliases.set(c.descriptorHash,f.descriptorHash),await s.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Ge();bt();jt();var x0e=et(Zo()),QC=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=he.Rest()}static{this.paths=[["unlink"]]}static{this.usage=st.Usage({description:"disconnect the local project from another one",details:`
|
||||
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
|
||||
`,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=s.topLevelWorkspace,f=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:h}of c.manifest.resolutions)h.startsWith("portal:")&&f.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let h=Y.resolve(this.context.cwd,Ae.toPortablePath(p));if(qe.isPathLike(p)){let E=await Je.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:C,workspace:S}=await Tt.find(E,h);if(!S)throw new ar(C.cwd,h);if(this.all){for(let x of C.workspaces)x.manifest.name&&f.add(H.stringifyIdent(x.anchoredLocator));if(f.size===0)throw new ot("No workspace found to be unlinked in the target project")}else{if(!S.manifest.name)throw new ot("The target workspace doesn't have a name and thus cannot be unlinked");f.add(H.stringifyIdent(S.anchoredLocator))}}else{let E=[...c.manifest.resolutions.map(({pattern:C})=>C.descriptor.fullName)];for(let C of(0,x0e.default)(E,p))f.add(C)}}return c.manifest.resolutions=c.manifest.resolutions.filter(({pattern:p})=>!f.has(p.descriptor.fullName)),await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();jt();var k0e=et(Xv()),Q5=et(Zo());Jo();var TC=class extends ft{constructor(){super(...arguments);this.interactive=he.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.fixed=he.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=he.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=he.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=he.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=he.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.noTimeGate=he.Boolean("--no-time-gate",!1,{description:"Disable the minimum release age check for this command"});this.mode=he.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=he.Rest()}static{this.paths=[["up"]]}static{this.usage=st.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously li
Line truncated
|
||||
|
||||
${le}`):N.reportError(27,`${H.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled)
|
||||
|
||||
${le}`)}else ie.length>1&&!f&&N.reportError(27,`${H.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(x.hasErrors())return x.exitCode();let I=!1,R=[];for(let[N,U,,{suggestions:K}]of S){let $,ie=K.filter(pe=>pe.descriptor!==null),fe=ie[0].descriptor,le=ie.every(pe=>H.areDescriptorsEqual(pe.descriptor,fe));ie.length===1||le?$=fe:(I=!0,{answer:$}=await(0,k0e.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${H.prettyWorkspace(r,N)} \u276F ${U}?`,choices:K.map(({descriptor:pe,name:De,reason:ye})=>pe?{name:De,hint:ye,descriptor:pe}:{name:De,hint:ye,disabled:!0}),onCancel:()=>process.exit(130),result(pe){return this.find(pe,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let ge=N.manifest[U].get($.identHash);if(typeof ge>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(ge.descriptorHash!==$.descriptorHash)N.manifest[U].set($.identHash,$),R.push([N,U,ge,$]);else{let pe=r.makeResolver(),De={project:s,resolver:pe},ye=r.normalizeDependency(ge),d=pe.bindDescriptor(ye,N.anchoredLocator,De);s.forgetResolution(d)}}return await r.triggerMultipleHooks(N=>N.afterWorkspaceDependencyReplacement,R),I&&this.context.stdout.write(`
|
||||
`),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}};Ge();Ge();jt();var RC=class extends ft{constructor(){super(...arguments);this.recursive=he.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=he.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=he.String()}static{this.paths=[["why"]]}static{this.usage=st.Usage({description:"display the reason why a package is needed",details:`
|
||||
This command prints the exact reasons why a package appears in the dependency tree. Specify a version or range to determine why the dependency tree contains a specific version of a package. This is particularly useful when trying to find out why your project depends on lower versions.
|
||||
|
||||
If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
|
||||
`,examples:[["Explain why lodash is used in your project","$0 why lodash"],["Explain why version 3.3.1 of lodash is in your project","$0 why lodash@3.3.1"],["Explain why version 3.X of lodash is in your project","$0 why lodash@^3"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=H.parseDescriptor(this.package,!1);if(n.range!=="unknown"&&kr.validRange(n.range)===null)throw new ot(`Expected a valid semver range, got ${n.range}`);let c=this.recursive?qot(s,n,{configuration:r,peers:this.peers}):Got(s,n,{configuration:r,peers:this.peers});ts.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function Got(e,t,{configuration:r,peers:s}){let a=qe.sortMap(e.storedPackages.values(),f=>H.stringifyLocator(f)),n={},c={children:n};for(let f of a){let p={};for(let E of f.dependencies.values()){if(!s&&T5(f,E))continue;let C=e.storedResolutions.get(E.descriptorHash);if(!C)throw new Error("Assertion failed: The resolution should have been registered");let S=e.storedPackages.get(C);if(!S)throw new Error("Assertion failed: The package should have been registered");if(!H.areIdentsEqual(S,t)||!H.isPackageInRange(S,t.range))continue;{let I=H.stringifyLocator(f);n[I]={value:[f,ue.Type.LOCATOR],children:p}}let x=H.stringifyLocator(S);p[x]={value:[{descriptor:E,locator:S},ue.Type.DEPENDENT]}}}return c}function qot(e,t,{configuration:r,peers:s}){let a=qe.sortMap(e.workspaces,S=>H.stringifyLocator(S.anchoredLocator)),n=new Set,c=new Set,f=S=>{if(n.has(S.locatorHash))return c.has(S.locatorHash);if(n.add(S.locatorHash),H.areIdentsEqual(S,t)&&H.isPackageInRange(S,t.range))return c.add(S.locatorHash),!0;let x=!1;for(let I of S.dependencies.values()){if(!s&&T5(S,I))continue;let R=e.storedResolutions.get(I.descriptorHash);if(!R)throw new Error("Assertion failed: The resolution should have been registered");let N=e.storedPackages.get(R);if(!N)throw new Error("Assertion failed: The package should have been registered");f(N)&&(x=!0)}return x&&c.add(S.locatorHash),x};for(let S of a)f(S.anchoredPackage);let p=new Set,h={},E={children:h},C=(S,x,I)=>{if(!c.has(S.locatorHash))return;let R=I!==null?ue.tuple(ue.Type.DEPENDENT,{locator:S,descriptor:I}):ue.tuple(ue.Type.LOCATOR,S),N={},U={value:R,children:N},K=H.stringifyLocator(S);if(x[K]=U,!(I!==null&&e.tryWorkspaceByLocator(S))&&!p.has(S.locatorHash)){p.add(S.locatorHash);for(let $ of S.dependencies.values()){if(!s&&T5(S,$))continue;let ie=e.storedResolutions.get($.descriptorHash);if(!ie)throw new Error("Assertion failed: The resolution should have been registered");let fe=e.storedPackages.get(ie);if(!fe)throw new Error("Assertion failed: The package should have been registered");C(fe,N,$)}}};for(let S of a)C(S.anchoredPackage,h,null);return E}function T5(e,t){return H.isVirtualLocator(e)&&e.peerDependencies.has(t.identHash)}Ge();var j5={};Vt(j5,{GitFetcher:()=>oS,GitResolver:()=>aS,default:()=>fat,gitUtils:()=>Ma});Ge();bt();var Ma={};Vt(Ma,{TreeishProtocols:()=>sS,clone:()=>H5,fetchBase:()=>Z0e,fetchChangedFiles:()=>X0e,fetchChangedWorkspaces:()=>cat,fetchRoot:()=>z0e,isGitUrl:()=>OC,lsRemote:()=>J0e,normalizeLocator:()=>lat,normalizeRepoUrl:()=>FC,resolveUrl:()=>_5,splitRepoUrl:()=>Xp,validateRepoUrl:()=>U5});Ge();bt();jt();Zl();var V0e=et(q0e()),NC=et(Ce("querystring")),L5=et(hi());function O5(e,t,r){let s=e.indexOf(r);return e.lastIndexOf(t,s>-1?s:1/0)}function Y0e(e){try{return new URL(e)}catch{return}}function oat(e){let t=O5(e,"@","#"),r=O5(e,":","#");return r>t&&(e=`${e.slice(0,r)}/${e.slice(r+1)}`),O5(e,":","#")===-1&&e.indexOf("//")===-1&&(e=`ssh://${e}`),e}function W0e(e){return Y0e(e)||Y0e(oat(e))}function FC(e,{git:t=!1}={}){if(e=e.replace(/^git\+https:/,"https:"),e=e.replace(/^(?:github:|https:\/\/github\.com\/|git:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\.git)?(#.*)?$/,"https://github.com/$1/$2.git$3"),e=e.replace(/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,"https://github.com/$1/$2.git#$3"),t){let r=W0e(e);r&&(e=r.href),e=e.replace(/^git\+([^:]+):/,"$1:")}return e}function K0e(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`}}var aat=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],sS=(a=>(a.Commit="commit",a.Head="head",a.Tag="tag",a.Semver="semver",a))(sS||{});function OC(e){return e?aat.some(t=>!!e.match(t)):!1}function Xp(e){e=FC(e);let t=e.indexOf("#");if(t===-1)return{repo:e,treeish:{protoc
Line truncated
|
||||
This command will run a given sub-command on a single workspace.
|
||||
`,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=s.workspaces,c=new Map(n.map(p=>[H.stringifyIdent(p.anchoredLocator),p])),f=c.get(this.workspaceName);if(f===void 0){let p=Array.from(c.keys()).sort();throw new ot(`Workspace '${this.workspaceName}' not found. Did you mean any of the following:
|
||||
- ${p.join(`
|
||||
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:f.cwd})}};var Aat={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:$0e.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:"STRING",values:["^","~",""],default:"^"},preferReuse:{description:"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.",type:"BOOLEAN",default:!1}},commands:[tC,rC,nC,iC,kC,CC,pC,LC,aC,lC,cC,uC,$I,eC,sC,oC,fC,AC,hC,dC,gC,mC,QC,yC,EC,BC,wC,vC,IC,SC,bC,DC,PC,xC,TC,RC,MC]},pat=Aat;var V5={};Vt(V5,{default:()=>mat});Ge();Ge();var q5="catalog:";var Y5=e=>e.startsWith(q5),hat=e=>e.range.slice(q5.length)||null,eme=e=>e===null?"default catalog":`catalog "${e}"`,dat=e=>e.scope?`@${e.scope}/${e.name}`:e.name,W5=(e,t,r,s)=>{let a=hat(t),n;if(a===null)n=e.configuration.get("catalog");else try{let E=e.configuration.get("catalogs");E&&(n=E.get(a))}catch{n=void 0}if(!n||n.size===0)throw new Lt(82,`${H.prettyDescriptor(e.configuration,t)}: ${eme(a)} not found or empty`);let c=dat(t),f=n.get(c);if(!f)throw new Lt(82,`${H.prettyDescriptor(e.configuration,t)}: entry not found in ${eme(a)}`);let p=e.configuration.normalizeDependency(H.makeDescriptor(t,f));return r.supportsDescriptor(p,s)?r.bindDescriptor(p,e.topLevelWorkspace.anchoredLocator,s):p};var gat={configuration:{catalog:{description:"The default catalog of packages",type:"MAP",valueDefinition:{description:"The catalog of packages",type:"STRING"}},catalogs:{description:"Named catalogs of packages",type:"MAP",valueDefinition:{description:"A named catalog",type:"MAP",valueDefinition:{description:"Package version in the catalog",type:"STRING"}}}},hooks:{beforeWorkspacePacking:(e,t)=>{let r=e.project,s=r.configuration.makeResolver(),a={project:r,resolver:s,report:new Qi};for(let n of _t.allDependencies){let c=t[n];if(c)for(let[f,p]of Object.entries(c)){if(typeof p!="string"||!Y5(p))continue;let h=H.parseIdent(f),E=H.makeDescriptor(h,p),C=W5(r,E,s,a),{protocol:S,source:x,params:I,selector:R}=H.parseRange(H.convertToManifestRange(C.range));S===e.project.configuration.get("defaultProtocol")&&(S=null),c[f]=H.makeRange({protocol:S,source:x,params:I,selector:R})}}},reduceDependency:async(e,t,r,s,{resolver:a,resolveOptions:n})=>Y5(e.range)?W5(t,e,a,n):e}},mat=gat;var X5={};Vt(X5,{default:()=>Eat});Ge();var Qt={optional:!0},K5=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{"supports-color":Qt}}],["got@<11",{dependencies:{"@types/responselike":"^1.0.0","@types/keyv":"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{"@types/keyv":"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{"vscode-jsonrpc":"^5.0.1","vscode-languageserver-protocol":"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{"postcss-html":Qt,"postcss-jsx":Qt,"postcss-less":Qt,"postcss-markdown":Qt,"postcss-scss":Qt}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{"tiny-warning":"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:Qt}}],["snowpack@>=3.3.0",{dependencies:{"node-gyp":"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Qt}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Qt,"vue-template-compiler":Qt}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],Line truncated
|
||||
This command will output all matches to the given prolog query.
|
||||
`,examples:[["List all dependencies throughout the workspace","yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(pS(),AS)),s=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.find(s,this.context.cwd),n=await r.find(a),c=this.query;return c.endsWith(".")||(c=`${c}.`),(await Ft.start({configuration:s,json:this.json,stdout:this.context.stdout},async p=>{for await(let h of n.query(c)){let E=Array.from(Object.entries(h)),C=E.length,S=E.reduce((x,[I])=>Math.max(x,I.length),0);for(let x=0;x<C;x++){let[I,R]=E[x];p.reportInfo(null,`${Oat(x,C)}${I.padEnd(S," ")} = ${Nat(R)}`)}p.reportJson(h)}})).exitCode()}};function Nat(e){return typeof e!="string"?`${e}`:e.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?e:`'${e}'`}function Oat(e,t){let r=e===0,s=e===t-1;return r&&s?"":r?"\u250C ":s?"\u2514 ":"\u2502 "}Ge();jt();var YC=class extends ft{constructor(){super(...arguments);this.verbose=he.Boolean("-v,--verbose",!1,{description:"Also print the fact database automatically compiled from the workspace manifests"})}static{this.paths=[["constraints","source"]]}static{this.usage=st.Usage({category:"Constraints-related commands",description:"print the source code for the constraints",details:"\n This command will print the Prolog source code used by the constraints engine. Adding the `-v,--verbose` flag will print the *full* source code, including the fact database automatically compiled from the workspace manifests.\n ",examples:[["Prints the source code","yarn constraints source"],["Print the source code and the fact database","yarn constraints source -v"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(pS(),AS)),s=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.find(s,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ge();Ge();jt();cS();var WC=class extends ft{constructor(){super(...arguments);this.fix=he.Boolean("--fix",!1,{description:"Attempt to automatically fix unambiguous issues, following a multi-pass process"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["constraints"]]}static{this.usage=st.Usage({category:"Constraints-related commands",description:"check that the project constraints are met",details:`
|
||||
This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code.
|
||||
|
||||
If the \`--fix\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution.
|
||||
|
||||
For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints.
|
||||
`,examples:[["Check that all constraints are satisfied","yarn constraints"],["Autofix all unmet constraints","yarn constraints --fix"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);await s.restoreInstallState();let a=await s.loadUserConfig(),n;if(a?.constraints)n=new _C(s);else{let{Constraints:h}=await Promise.resolve().then(()=>(pS(),AS));n=await h.find(s)}let c,f=!1,p=!1;for(let h=this.fix?10:1;h>0;--h){let E=await n.process();if(!E)break;let{changedWorkspaces:C,remainingErrors:S}=VR(s,E,{fix:this.fix}),x=[];for(let[I,R]of C){let N=I.manifest.indent;I.manifest=new _t,I.manifest.indent=N,I.manifest.load(R),x.push(I.persistManifest())}if(await Promise.all(x),!(C.size>0&&h>1)){c=sme(S,{configuration:r}),f=!1,p=!0;for(let[,I]of S)for(let R of I)R.fixable?f=!0:p=!1}}if(c.children.length===0)return 0;if(f){let h=p?`Those errors can all be fixed by running ${ue.pretty(r,"yarn constraints --fix",ue.Type.CODE)}`:`Errors prefixed by '\u2699' can be fixed by running ${ue.pretty(r,"yarn constraints --fix",ue.Type.CODE)}`;await Ft.start({configuration:r,stdout:this.context.stdout,includeNames:!1,includeFooter:!1},async E=>{E.reportInfo(0,h),E.reportSeparator()})}return c.children=qe.sortMap(c.children,h=>h.value[1]),ts.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1}),1}};cS();var Lat={configuration:{enableConstraintsChecks:{description:"If true, constraints will run during installs",type:"BOOLEAN",default:!1},constraintsPath:{description:"The path of the constraints file.",type:"ABSOLUTE_PATH",default:"./constraints.pro"}},commands:[qC,YC,WC],hooks:{async validateProjectAfterInstall(e,{reportError:t}){if(!e.configuration.get("enableConstraintsChecks"))return;let r=await e.loadUserConfig(),s;if(r?.constraints)s=new _C(e);else{let{Constraints:c}=await Promise.resolve().then(()=>(pS(),AS));s=await c.find(e)}let a=await s.process();if(!a)return;let{remainingErrors:n}=VR(e,a);if(n.size!==0)if(e.configuration.isCI)for(let[c,f]of n)for(let p of f)t(84,`${ue.pretty(e.configuration,c.anchoredLocator,ue.Type.IDENT)}: ${p.text}`);else t(84,`Constraint check failed; run ${ue.pretty(e.configuration,"yarn constraints",ue.Type.CODE)} for more details`)}}},Mat=Lat;var g9={};Vt(g9,{CreateCommand:()=>VC,DlxCommand:()=>KC,default:()=>_at});Ge();jt();var VC=class extends ft{constructor(){super(...arguments);this.pkg=he.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=he.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=he.String();this.args=he.Proxy()}static{this.paths=[["create"]]}async execute(){let r=[];this.pkg&&r.push("--package",this.pkg),this.quiet&&r.push("--quiet");let s=this.command.replace(/^(@[^@/]+)(@|$)/,"$1/create$2"),a=H.parseDescriptor(s),n=a.name.match(/^create(-|$)/)?a:a.scope?H.makeIdent(a.scope,`create-${a.name}`):H.makeIdent(null,`create-${a.name}`),c=H.stringifyIdent(n);return a.range!=="unknown"&&(c+=`@${a.range}`),this.cli.run(["dlx",...r,c,...this.args])}};Ge();Ge();bt();jt();var KC=class extends ft{constructor(){super(...arguments);this.packages=he.Array("-p,--package",{description:"The package(s) to install before running the command"});this.quiet=he.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=he.String();this.args=he.Proxy()}static{this.paths=[["dlx"]]}static{this.usage=st.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-vite to scaffold a new Vite project","yarn dlx create-vite"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]})}async execute(){return Je.telemetry=null,await ae.mktempPromise(async r=>{let s=Y.join(r,`dlx-${process.pid}`);await ae.mkdirPromise(s),await ae.writeFilePromise(Y.join(s,"package.json"),`{}
|
||||
`),await ae.writeFilePromise(Y.join(s,"yarn.lock"),"");let a=Y.join(s,".yarnrc.yml"),n=await Je.findProjectCwd(this.context.cwd),f={enableGlobalCache:!(await Je.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),enableTelemetry:!1,logFilters:[{code:zf(68),level:ue.LogLevel.Discard}]},p=n!==null?Y.join(n,".yarnrc.yml"):null;p!==null&&ae.existsSync(p)?(await ae.copyFilePromise(p,a),await Je.updateConfiguration(s,N=>{let U=qe.toMerged(N,f);return Array.isArray(N.plugins)&&(U.plugins=N.plugins.map(K=>{let $=typeof K=="string"?K:K.path,ie=Ae.isAbsolute($)?$:Ae.resolve(Ae.fromPortablePath(n),$);return typeof K=="string"?ie:{path:ie,spec:K.spec}})),U})):await ae.writeJsonPromise(a,f);let h=this.packages??[this.command],E=H.parseDescriptor(this.command).name,C=await this.cli.run(["add","--fixed","--",...h],{cwd:s,quiet:this.quiet});if(C!==0)return C;this.quiet||this.context.stdout.write(`
|
||||
`);let S=await Je.find(s,this.context.plugins),{project:x,workspace:I}=await Tt.find(S,s);if(I===null)throw new ar(x.cwd,s);await x.restoreInstallState();let R=await wn.getWorkspaceAccessibleBinaries(I);return R.has(E)===!1&&R.size===1&&typeof this.packages>"u"&&(E=Array.from(R)[0][0]),await wn.executeWorkspaceAccessibleBinary(I,E,this.args,{packageAccessibleBinaries:R,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var Uat={commands:[VC,KC]},_at=Uat;var E9={};Vt(E9,{ExecFetcher:()=>dS,ExecResolver:()=>gS,default:()=>Gat,execUtils:()=>ZR});Ge();Ge();Ge();bt();var AA="exec:";var ZR={};Vt(ZR,{loadGeneratorFile:()=>hS,makeLocator:()=>y9,makeSpec:()=>Qme,parseSpec:()=>m9});Ge();bt();function m9(e){let{params:t,selector:r}=H.parseRange(e),s=Ae.toPortablePath(r);return{parentLocator:t&&typeof t.locator=="string"?H.parseLocator(t.locator):null,path:s}}function Qme({parentLocator:e,path:t,generatorHash:r,protocol:s}){let a=e!==null?{locator:H.stringifyLocator(e)}:{},n=typeof r<"u"?{hash:r}:{};return H.makeRange({protocol:s,source:t,selector:t,params:{...n,...a}})}function y9(e,{parentLocator:t,path:r,generatorHash:s,protocol:a}){return H.makeLocator(e,Qme({parentLocator:t,path:r,generatorHash:s,protocol:a}))}async function hS(e,t,r){let{parentLocator:s,path:a}=H.parseFileStyleRange(e,{protocol:t}),n=Y.isAbsolute(a)?{packageFs:new Pn(wt.root),prefixPath:wt.dot,localPath:wt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.root,n.localPath)}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=Y.join(c.prefixPath,a);return await f.readFilePromise(p,"utf8")}var dS=class{supports(t,r){return!!t.reference.startsWith(AA)}getLocalPath(t,r){let{parentLocator:s,path:a}=H.parseFileStyleRange(t.reference,{protocol:AA});if(Y.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:Y.resolve(n,a)}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t),loader:()=>this.fetchFromDisk(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:H.getIdentVendorPath(t),localPath:this.getLocalPath(t,r),checksum:c}}async fetchFromDisk(t,r){let s=r.project.getDependencyMeta(t,null);if(!r.project.configuration.get("enableScripts")&&!s.built)throw new Lt(4,`${H.prettyLocator(r.project.configuration,t)} can't be built with the exec: protocol because all scripts have been disabled.`);let a=await hS(t.reference,AA,r);return ae.mktempPromise(async n=>{let c=Y.join(n,"generator.js");return await ae.writeFilePromise(c,a),ae.mktempPromise(async f=>{if(await this.generatePackage(f,t,c,r),!ae.existsSync(Y.join(f,"build")))throw new Error("The script should have generated a build directory");return await ms.makeArchiveFromDirectory(Y.join(f,"build"),{prefixPath:H.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel")})})})}async generatePackage(t,r,s,a){return await ae.mktempPromise(async n=>{let c=await wn.makeScriptEnv({project:a.project,binFolder:n}),f=Y.join(t,"runtime.js");return await ae.mktempPromise(async p=>{let h=Y.join(p,"buildfile.log"),E=Y.join(t,"generator"),C=Y.join(t,"build");await ae.mkdirPromise(E),await ae.mkdirPromise(C);let S={tempDir:Ae.fromPortablePath(E),buildDir:Ae.fromPortablePath(C),locator:H.stringifyLocator(r)};await ae.writeFilePromise(f,`
|
||||
// Expose 'Module' as a global variable
|
||||
Object.defineProperty(global, 'Module', {
|
||||
get: () => require('module'),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
|
||||
// Expose non-hidden built-in modules as global variables
|
||||
for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) {
|
||||
Object.defineProperty(global, name, {
|
||||
get: () => require(name),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
}
|
||||
|
||||
// Expose the 'execEnv' global variable
|
||||
Object.defineProperty(global, 'execEnv', {
|
||||
value: {
|
||||
...${JSON.stringify(S)},
|
||||
},
|
||||
enumerable: true,
|
||||
});
|
||||
`);let x=c.NODE_OPTIONS||"",I=/\s*--require\s+\S*\.pnp\.c?js\s*/g;x=x.replace(I," ").trim(),c.NODE_OPTIONS=x;let{stdout:R,stderr:N}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${H.stringifyLocator(r)})
|
||||
`,prefix:H.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await Yr.pipevp(process.execPath,["--require",Ae.fromPortablePath(f),Ae.fromPortablePath(s),H.stringifyIdent(r)],{cwd:t,env:c,stdin:null,stdout:R,stderr:N});if(U!==0)throw ae.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${ue.pretty(a.project.configuration,h,ue.Type.PATH)})`)})})}};Ge();Ge();Ge();var Hat=2,gS=class{supportsDescriptor(t,r){return!!t.range.startsWith(AA)}supportsLocator(t,r){return!!t.reference.startsWith(AA)}shouldPersistResolution(t,r){return!1}bindDescriptor(t,r,s){if(s.project.tryWorkspaceByLocator(r)===null)throw new Lt(57,`${H.prettyLocator(s.project.configuration,r)} lists ${H.prettyDescriptor(s.project.configuration,t)} as dependency, but only workspaces can depend on exec: packages.`);return H.bindDescriptor(t,{locator:H.stringifyLocator(r)})}getResolutionDependencies(t,r){return{}}async getCandidates(t,r,s){if(!s.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=m9(t.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let c=await hS(H.makeRange({protocol:AA,source:a,selector:a,params:{locator:H.stringifyLocator(n)}}),AA,s.fetchOptions),f=Mn.makeHash(`${Hat}`,c).slice(0,6);return[y9(t,{parentLocator:n,path:a,generatorHash:f,protocol:AA})]}async getSatisfying(t,r,s,a){let[n]=await this.getCandidates(t,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(t,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let s=await r.fetchOptions.fetcher.fetch(t,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...t,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var jat={fetchers:[dS],resolvers:[gS]},Gat=jat;var C9={};Vt(C9,{FileFetcher:()=>IS,FileResolver:()=>CS,TarballFileFetcher:()=>wS,TarballFileResolver:()=>BS,default:()=>Wat,fileUtils:()=>Nm});Ge();bt();var JC=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,mS=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,rs="file:";var Nm={};Vt(Nm,{fetchArchiveFromLocator:()=>ES,makeArchiveFromLocator:()=>XR,makeBufferFromLocator:()=>I9,makeLocator:()=>zC,makeSpec:()=>Tme,parseSpec:()=>yS});Ge();bt();function yS(e){let{params:t,selector:r}=H.parseRange(e),s=Ae.toPortablePath(r);return{parentLocator:t&&typeof t.locator=="string"?H.parseLocator(t.locator):null,path:s}}function Tme({parentLocator:e,path:t,hash:r,protocol:s}){let a=e!==null?{locator:H.stringifyLocator(e)}:{},n=typeof r<"u"?{hash:r}:{};return H.makeRange({protocol:s,source:t,selector:t,params:{...n,...a}})}function zC(e,{parentLocator:t,path:r,hash:s,protocol:a}){return H.makeLocator(e,Tme({parentLocator:t,path:r,hash:s,protocol:a}))}async function ES(e,t){let{parentLocator:r,path:s}=H.parseFileStyleRange(e.reference,{protocol:rs}),a=Y.isAbsolute(s)?{packageFs:new Pn(wt.root),prefixPath:wt.dot,localPath:wt.root}:await t.fetcher.fetch(r,t),n=a.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let c=n.packageFs,f=Y.join(n.prefixPath,s);return await qe.releaseAfterUseAsync(async()=>await c.readFilePromise(f),n.releaseFs)}async function XR(e,{protocol:t,fetchOptions:r,inMemory:s=!1}){let{parentLocator:a,path:n}=H.parseFileStyleRange(e.reference,{protocol:t}),c=Y.isAbsolute(n)?{packageFs:new Pn(wt.root),prefixPath:wt.dot,localPath:wt.root}:await r.fetcher.fetch(a,r),f=c.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.root,c.localPath)}:c;c!==f&&c.releaseFs&&c.releaseFs();let p=f.packageFs,h=Y.join(f.prefixPath,n);return await qe.releaseAfterUseAsync(async()=>await ms.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:H.getIdentVendorPath(e),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:s}),f.releaseFs)}async function I9(e,{protocol:t,fetchOptions:r}){return(await XR(e,{protocol:t,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var IS=class{supports(t,r){return!!t.reference.startsWith(rs)}getLocalPath(t,r){let{parentLocator:s,path:a}=H.parseFileStyleRange(t.reference,{protocol:rs});if(Y.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:Y.resolve(n,a)}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${H.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFro
Line truncated
|
||||
`,{automaticNewlines:!0});let h=[p],E=Y.join(this.context.cwd,"README.md");if(ae.existsSync(E)||(await ae.writeFilePromise(E,`# ${H.stringifyIdent(n.name)}
|
||||
`),h.push(E)),!s||s.cwd===this.context.cwd){let C=Y.join(this.context.cwd,yr.lockfile);ae.existsSync(C)||(await ae.writeFilePromise(C,""),h.push(C));let x=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Whether you use PnP or not, the node_modules folder is often used to store","# build artifacts that should be gitignored","node_modules","","# Swap the comments on the following lines if you wish to use zero-installs","# In that case, don't forget to run `yarn config set enableGlobalCache false`!","# Documentation here: https://yarnpkg.com/features/caching#zero-installs","","#!.yarn/cache",".pnp.*"].map(fe=>`${fe}
|
||||
`).join(""),I=Y.join(this.context.cwd,".gitignore");ae.existsSync(I)||(await ae.writeFilePromise(I,x),h.push(I));let N=["/.yarn/** linguist-vendored","/.yarn/releases/* binary","/.yarn/plugins/**/* binary","/.pnp.* binary linguist-generated"].map(fe=>`${fe}
|
||||
`).join(""),U=Y.join(this.context.cwd,".gitattributes");ae.existsSync(U)||(await ae.writeFilePromise(U,N),h.push(U));let K={"*":{charset:"utf-8",endOfLine:"lf",indentSize:2,indentStyle:"space",insertFinalNewline:!0}};qe.mergeIntoTarget(K,r.get("initEditorConfig"));let $=`root = true
|
||||
`;for(let[fe,le]of Object.entries(K)){$+=`
|
||||
[${fe}]
|
||||
`;for(let[ge,pe]of Object.entries(le)){let De=ge.replace(/[A-Z]/g,ye=>`_${ye.toLowerCase()}`);$+=`${De} = ${pe}
|
||||
`}}let ie=Y.join(this.context.cwd,".editorconfig");ae.existsSync(ie)||(await ae.writeFilePromise(ie,$),h.push(ie)),await this.cli.run(["install"],{quiet:!0}),await this.initialize(),ae.existsSync(Y.join(this.context.cwd,".git"))||(await Yr.execvp("git",["init"],{cwd:this.context.cwd}),await Yr.execvp("git",["add","--",...h],{cwd:this.context.cwd}),await Yr.execvp("git",["commit","--allow-empty","-m","First commit"],{cwd:this.context.cwd}))}}};var ZC=class extends Zd{constructor(){super(...arguments);this.initializer=he.String();this.argv=he.Proxy()}static{this.paths=[["init"]]}async initialize(){this.context.stdout.write(`
|
||||
`),await this.cli.run(["dlx",this.initializer,...this.argv],{quiet:!0})}};var Zat={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:"STRING",default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:"MAP",valueDefinition:{description:"",type:"ANY"}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:"MAP",valueDefinition:{description:"",type:"ANY"}}},commands:[Zd,ZC]},Xat=Zat;var BY={};Vt(BY,{SearchCommand:()=>dw,UpgradeInteractiveCommand:()=>gw,default:()=>lht});Ge();var Lme=et(Ce("os"));function XC({stdout:e}){if(Lme.default.endianness()==="BE")throw new Error("Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures");if(!e.isTTY)throw new Error("Interactive commands can only be used inside a TTY environment")}jt();var Jye=et(q9()),Y9={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},Jct=(0,Jye.default)(Y9.appId,Y9.apiKey).initIndex(Y9.indexName),W9=async(e,t=0)=>await Jct.search(e,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:t,hitsPerPage:10});var Db=["regular","dev","peer"],dw=class extends ft{static{this.paths=[["search"]]}static{this.usage=st.Usage({category:"Interactive commands",description:"open the search interface",details:`
|
||||
This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.
|
||||
`,examples:[["Open the search window","yarn search"]]})}async execute(){XC(this.context);let{Gem:t}=await Promise.resolve().then(()=>(FF(),AY)),{ScrollableItems:r}=await Promise.resolve().then(()=>(MF(),LF)),{useKeypress:s}=await Promise.resolve().then(()=>(hw(),pY)),{useMinistore:a}=await Promise.resolve().then(()=>(yY(),mY)),{renderForm:n}=await Promise.resolve().then(()=>(jF(),HF)),{default:c}=await Promise.resolve().then(()=>et(Fwe())),{Box:f,Text:p}=await Promise.resolve().then(()=>et(Yc())),{default:h,useEffect:E,useState:C}=await Promise.resolve().then(()=>et(dn())),S=await Je.find(this.context.cwd,this.context.plugins),x=()=>h.createElement(f,{flexDirection:"row"},h.createElement(f,{flexDirection:"column",width:48},h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to move between packages.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," to select a package.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," again to change the target."))),h.createElement(f,{flexDirection:"column"},h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to install the selected packages.")),h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),I=()=>h.createElement(h.Fragment,null,h.createElement(f,{width:15},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Owner")),h.createElement(f,{width:11},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Version")),h.createElement(f,{width:10},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Downloads"))),R=()=>h.createElement(f,{width:17},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Target")),N=({hit:pe,active:De})=>{let[ye,d]=a(pe.name,null);s({active:De},(me,ce)=>{if(ce.name!=="space")return;if(!ye){d(Db[0]);return}let X=Db.indexOf(ye)+1;X===Db.length?d(null):d(Db[X])},[ye,d]);let ve=H.parseIdent(pe.name),Ie=H.prettyIdent(S,ve);return h.createElement(f,null,h.createElement(f,{width:45},h.createElement(p,{bold:!0,wrap:"wrap"},Ie)),h.createElement(f,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:"truncate"},pe.owner.name)),h.createElement(f,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:"truncate"},pe.version)),h.createElement(f,{width:16,marginLeft:1},h.createElement(p,null,pe.humanDownloadsLast30Days)))},U=({name:pe,active:De})=>{let[ye]=a(pe,null),d=H.parseIdent(pe);return h.createElement(f,null,h.createElement(f,{width:47},h.createElement(p,{bold:!0}," - ",H.prettyIdent(S,d))),Db.map(ve=>h.createElement(f,{key:ve,width:14,marginLeft:1},h.createElement(p,null," ",h.createElement(t,{active:ye===ve})," ",h.createElement(p,{bold:!0},ve)))))},K=()=>h.createElement(f,{marginTop:1},h.createElement(p,null,"Powered by Algolia.")),ie=await n(({useSubmit:pe})=>{let De=a();pe(De);let ye=Array.from(De.keys()).filter(_=>De.get(_)!==null),[d,ve]=C(""),[Ie,me]=C(0),[ce,X]=C([]),be=_=>{_.match(/\t| /)||ve(_)},ke=async()=>{me(0);let _=await W9(d);_.query===d&&X(_.hits)},it=async()=>{let _=await W9(d,Ie+1);_.query===d&&_.page-1===Ie&&(me(_.page),X([...ce,..._.hits]))};return E(()=>{d?ke():X([])},[d]),h.createElement(f,{flexDirection:"column"},h.createElement(x,null),h.createElement(f,{flexDirection:"row",marginTop:1},h.createElement(p,{bold:!0},"Search: "),h.createElement(f,{width:41},h.createElement(c,{value:d,onChange:be,placeholder:"i.e. babel, webpack, react...",showCursor:!1})),h.createElement(I,null)),ce.length?h.createElement(r,{radius:2,loop:!1,children:ce.map(_=>h.createElement(N,{key:_.name,hit:_,active:!1})),willReachEnd:it}):h.createElement(p,{color:"gray"},"Start typing..."),h.createElement(f,{flexDirection:"row",marginTop:1},h.createElement(f,{width:49},h.createElement(p,{bold:!0},"Selected:")),h.createElement(R,null)),ye.length?ye.map(_=>h.createElement(U,{key:_,name:_,active:!1})):h.createElement(p,{color:"gray"},"No selected packages..."),h.createElement(K,null))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof ie>"u")return 1;let fe=Array.from(ie.keys()).filter(pe=>ie.get(pe)==="regular"),le=Array.from(ie.keys()).filter(pe=>ie.get(pe)==="dev"),ge=Array.from(ie.keys()).filter(pe=>ie.get(pe)==="peer");return fe.length&&await this.cli.run(["add",...fe]),le.length&&await this.cli.run(["add","--dev",...le]),ge&&await this.cli.run(["add","--peer",...ge]),0}};Ge();jt();IG();var Hwe=et(hi());Jo();var _we=/^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/;function jwe(e,t){return e.length>0?[e.slice(0,t)].concat(jwe(e.slice(t),t)):[]}var gw=class extends ft{constructor(){super(...arguments);this.mode=he.String("--mode",{description:"Change what artifacts installs genera
Line truncated
|
||||
${E}, next tree:
|
||||
${Fb(f)}`);let S=Wwe(f);if(S)throw new Error(`${S}, after hoisting finished:
|
||||
${Fb(f)}`)}return n.debugLevel>=2&&console.log(Fb(f)),wht(f)},dht=e=>{let t=e[e.length-1],r=new Map,s=new Set,a=n=>{if(!s.has(n)){s.add(n);for(let c of n.hoistedDependencies.values())r.set(c.name,c);for(let c of n.dependencies.values())n.peerNames.has(c.name)||a(c)}};return a(t),r},ght=e=>{let t=e[e.length-1],r=new Map,s=new Set,a=new Set,n=(c,f)=>{if(s.has(c))return;s.add(c);for(let h of c.hoistedDependencies.values())if(!f.has(h.name)){let E;for(let C of e)E=C.dependencies.get(h.name),E&&r.set(E.name,E)}let p=new Set;for(let h of c.dependencies.values())p.add(h.name);for(let h of c.dependencies.values())c.peerNames.has(h.name)||n(h,p)};return n(t,a),r},qwe=(e,t)=>{if(t.decoupled)return t;let{name:r,references:s,ident:a,locator:n,dependencies:c,originalDependencies:f,hoistedDependencies:p,peerNames:h,reasons:E,isHoistBorder:C,hoistPriority:S,dependencyKind:x,hoistedFrom:I,hoistedTo:R}=t,N={name:r,references:new Set(s),ident:a,locator:n,dependencies:new Map(c),originalDependencies:new Map(f),hoistedDependencies:new Map(p),peerNames:new Set(h),reasons:new Map(E),decoupled:!0,isHoistBorder:C,hoistPriority:S,dependencyKind:x,hoistedFrom:new Map(I),hoistedTo:new Map(R)},U=N.dependencies.get(r);return U&&U.ident==N.ident&&N.dependencies.set(r,N),e.dependencies.set(N.name,N),N},mht=(e,t)=>{let r=new Map([[e.name,[e.ident]]]);for(let a of e.dependencies.values())e.peerNames.has(a.name)||r.set(a.name,[a.ident]);let s=Array.from(t.keys());s.sort((a,n)=>{let c=t.get(a),f=t.get(n);if(f.hoistPriority!==c.hoistPriority)return f.hoistPriority-c.hoistPriority;{let p=c.dependents.size+c.peerDependents.size;return f.dependents.size+f.peerDependents.size-p}});for(let a of s){let n=a.substring(0,a.indexOf("@",1)),c=a.substring(n.length+1);if(!e.peerNames.has(n)){let f=r.get(n);f||(f=[],r.set(n,f)),f.indexOf(c)<0&&f.push(c)}}return r},DY=e=>{let t=new Set,r=(s,a=new Set)=>{if(!a.has(s)){a.add(s);for(let n of s.peerNames)if(!e.peerNames.has(n)){let c=e.dependencies.get(n);c&&!t.has(c)&&r(c,a)}t.add(s)}};for(let s of e.dependencies.values())e.peerNames.has(s.name)||r(s);return t},xY=(e,t,r,s,a,n=new Set)=>{let c=t[t.length-1];if(n.has(c))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(c);let f=Bht(c),p=mht(c,f),h=e==c?new Map:a.fastLookupPossible?dht(t):ght(t),E,C=!1,S=!1,x=new Map(Array.from(p.entries()).map(([R,N])=>[R,N[0]])),I=new Map;do{let R=Iht(e,t,r,h,x,p,s,I,a);R.isGraphChanged&&(S=!0),R.anotherRoundNeeded&&(C=!0),E=!1;for(let[N,U]of p)U.length>1&&!c.dependencies.has(N)&&(x.delete(N),U.shift(),x.set(N,U[0]),E=!0)}while(E);for(let R of c.dependencies.values())if(!c.peerNames.has(R.name)&&!r.has(R.locator)){r.add(R.locator);let N=xY(e,[...t,R],r,I,a);N.isGraphChanged&&(S=!0),N.anotherRoundNeeded&&(C=!0),r.delete(R.locator)}return{anotherRoundNeeded:C,isGraphChanged:S}},yht=e=>{for(let[t,r]of e.dependencies)if(!e.peerNames.has(t)&&r.ident!==e.ident)return!0;return!1},Eht=(e,t,r,s,a,n,c,f,{outputReason:p,fastLookupPossible:h})=>{let E,C=null,S=new Set;p&&(E=`${Array.from(t).map(N=>So(N)).join("\u2192")}`);let x=r[r.length-1],R=!(s.ident===x.ident);if(p&&!R&&(C="- self-reference"),R&&(R=s.dependencyKind!==1,p&&!R&&(C="- workspace")),R&&s.dependencyKind===2&&(R=!yht(s),p&&!R&&(C="- external soft link with unhoisted dependencies")),R&&(R=!e.peerNames.has(s.name),p&&!R&&(C=`- cannot shadow peer: ${So(e.originalDependencies.get(s.name).locator)} at ${E}`)),R){let N=!1,U=a.get(s.name);if(N=!U||U.ident===s.ident,p&&!N&&(C=`- filled by: ${So(U.locator)} at ${E}`),N)for(let K=r.length-1;K>=1;K--){let ie=r[K].dependencies.get(s.name);if(ie&&ie.ident!==s.ident){N=!1;let fe=f.get(x);fe||(fe=new Set,f.set(x,fe)),fe.add(s.name),p&&(C=`- filled by ${So(ie.locator)} at ${r.slice(0,K).map(le=>So(le.locator)).join("\u2192")}`);break}}R=N}if(R&&(R=n.get(s.name)===s.ident,p&&!R&&(C=`- filled by: ${So(c.get(s.name)[0])} at ${E}`)),R){let N=!0,U=new Set(s.peerNames);for(let K=r.length-1;K>=1;K--){let $=r[K];for(let ie of U){if($.peerNames.has(ie)&&$.originalDependencies.has(ie))continue;let fe=$.dependencies.get(ie);fe&&e.dependencies.get(ie)!==fe&&(K===r.length-1?S.add(fe):(S=null,N=!1,p&&(C=`- peer dependency ${So(fe.locator)} from parent ${So($.locator)} was not hoisted to ${E}`))),U.delete(ie)}if(!N)break}R=N}if(R&&!h)for(let N of s.hoistedDependencies.values()){let U=a.get(N.name)||e.dependencies.get(N.name);if(!U||N.ident!==U.ident){R=!1,p&&(C=`- previously hoisted dependency mismatch, needed: ${So(N.locator)}, available: ${So(U?.locator)}`);break}}return S!==null&&S.size>0?{isHoistable:2,dependsOn:S,reason:C}:{isHoistable:R?0:1,reason:C}},YF=e=>`${e.name}@${e.locator}`,Iht=(e,t,r,s,a,n,c,f,p)=>{let h=t[t.length-1],E=new Set,C=!1,S=!1,x=(U,K,$,ie,fe)=>{if(E.has(ie))return;let le=[...K,YF(ie)],ge=[...$,YF(ie)],pe=new Map,De=new Map;for(let me of DY(ie)){let ce=Eht(h,r,[h,...U,ie],me,s,a,n,f,{outputReason:p.debugLevel>=2,fastLookupPossible:p.fastLookupPossible});if(De.set(me,ce),ce.isHoistable===2)for(let X of ce.dependsOn){let be=pe.
Line truncated
|
||||
${Fb(e)}`)}let Ie=DY(ie);for(let me of Ie)if(ye.has(me)){let ce=De.get(me);if((a.get(me.name)===me.ident||!ie.reasons.has(me.name))&&ce.isHoistable!==0&&ie.reasons.set(me.name,ce.reason),!me.isHoistBorder&&ge.indexOf(YF(me))<0){E.add(ie);let be=qwe(ie,me);x([...U,ie],le,ge,be,R),E.delete(ie)}}},I,R=new Set(DY(h)),N=Array.from(t).map(U=>YF(U));do{I=R,R=new Set;for(let U of I){if(U.locator===h.locator||U.isHoistBorder)continue;let K=qwe(h,U);x([],Array.from(r),N,K,R)}}while(R.size>0);return{anotherRoundNeeded:C,isGraphChanged:S}},Wwe=e=>{let t=[],r=new Set,s=new Set,a=(n,c,f)=>{if(r.has(n)||(r.add(n),s.has(n)))return;let p=new Map(c);for(let h of n.dependencies.values())n.peerNames.has(h.name)||p.set(h.name,h);for(let h of n.originalDependencies.values()){let E=p.get(h.name),C=()=>`${Array.from(s).concat([n]).map(S=>So(S.locator)).join("\u2192")}`;if(n.peerNames.has(h.name)){let S=c.get(h.name);(S!==E||!S||S.ident!==h.ident)&&t.push(`${C()} - broken peer promise: expected ${h.ident} but found ${S&&S.ident}`)}else{let S=f.hoistedFrom.get(n.name),x=n.hoistedTo.get(h.name),I=`${S?` hoisted from ${S.join(", ")}`:""}`,R=`${x?` hoisted to ${x}`:""}`,N=`${C()}${I}`;E?E.ident!==h.ident&&t.push(`${N} - broken require promise for ${h.name}${R}: expected ${h.ident}, but found: ${E.ident}`):t.push(`${N} - broken require promise: no required dependency ${h.name}${R} found`)}}s.add(n);for(let h of n.dependencies.values())n.peerNames.has(h.name)||a(h,p,n);s.delete(n)};return a(e,e.dependencies,e),t.join(`
|
||||
`)},Cht=(e,t)=>{let{identName:r,name:s,reference:a,peerNames:n}=e,c={name:s,references:new Set([a]),locator:PY(r,a),ident:Gwe(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},f=new Map([[e,c]]),p=(h,E)=>{let C=f.get(h),S=!!C;if(!C){let{name:x,identName:I,reference:R,peerNames:N,hoistPriority:U,dependencyKind:K}=h,$=t.hoistingLimits.get(E.locator);C={name:x,references:new Set([R]),locator:PY(I,R),ident:Gwe(I,R),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(N),reasons:new Map,decoupled:!0,isHoistBorder:$?$.has(x):!1,hoistPriority:U||0,dependencyKind:K||0,hoistedFrom:new Map,hoistedTo:new Map},f.set(h,C)}if(E.dependencies.set(h.name,C),E.originalDependencies.set(h.name,C),S){let x=new Set,I=R=>{if(!x.has(R)){x.add(R),R.decoupled=!1;for(let N of R.dependencies.values())R.peerNames.has(N.name)||I(N)}};I(C)}else for(let x of h.dependencies)p(x,C)};for(let h of e.dependencies)p(h,c);return c},kY=e=>e.substring(0,e.indexOf("@",1)),wht=e=>{let t={name:e.name,identName:kY(e.locator),references:new Set(e.references),dependencies:new Set},r=new Set([e]),s=(a,n,c)=>{let f=r.has(a),p;if(n===a)p=c;else{let{name:h,references:E,locator:C}=a;p={name:h,identName:kY(C),references:E,dependencies:new Set}}if(c.dependencies.add(p),!f){r.add(a);for(let h of a.dependencies.values())a.peerNames.has(h.name)||s(h,a,p);r.delete(a)}};for(let a of e.dependencies.values())s(a,e,t);return t},Bht=e=>{let t=new Map,r=new Set([e]),s=c=>`${c.name}@${c.ident}`,a=c=>{let f=s(c),p=t.get(f);return p||(p={dependents:new Set,peerDependents:new Set,hoistPriority:0},t.set(f,p)),p},n=(c,f)=>{let p=!!r.has(f);if(a(f).dependents.add(c.ident),!p){r.add(f);for(let E of f.dependencies.values()){let C=a(E);C.hoistPriority=Math.max(C.hoistPriority,E.hoistPriority),f.peerNames.has(E.name)?C.peerDependents.add(f.ident):n(f,E)}}};for(let c of e.dependencies.values())e.peerNames.has(c.name)||n(e,c);return t},So=e=>{if(!e)return"none";let t=e.indexOf("@",1),r=e.substring(0,t);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let s=e.substring(t+1);if(s==="workspace:.")return".";if(s){let a=(s.indexOf("#")>0?s.split("#")[1]:s).replace("npm:","");return s.startsWith("virtual")&&(r=`v:${r}`),a.startsWith("workspace")&&(r=`w:${r}`,a=""),`${r}${a?`@${a}`:""}`}else return`${r}`};var Fb=e=>{let t=0,r=(a,n,c="")=>{if(t>5e4||n.has(a))return"";t++;let f=Array.from(a.dependencies.values()).sort((h,E)=>h.name===E.name?0:h.name>E.name?1:-1),p="";n.add(a);for(let h=0;h<f.length;h++){let E=f[h];if(!a.peerNames.has(E.name)&&E!==a){let C=a.reasons.get(E.name),S=kY(E.locator);p+=`${c}${h<f.length-1?"\u251C\u2500":"\u2514\u2500"}${(n.has(E)?">":"")+(S!==E.name?`a:${E.name}:`:"")+So(E.locator)+(C?` ${C}`:"")}
|
||||
`,p+=r(E,n,`${c}${h<f.length-1?"\u2502 ":" "}`)}}return n.delete(a),p};return r(e,new Set)+(t>5e4?`
|
||||
Tree is too large, part of the tree has been dunped
|
||||
`:"")};var Nb=(s=>(s.WORKSPACES="workspaces",s.DEPENDENCIES="dependencies",s.NONE="none",s))(Nb||{}),Vwe="node_modules",ng="$wsroot$";var Ob=(e,t)=>{let{packageTree:r,hoistingLimits:s,errors:a,preserveSymlinksRequired:n}=Sht(e,t),c=null;if(a.length===0){let f=Ywe(r,{hoistingLimits:s});c=Dht(e,f,t)}return{tree:c,errors:a,preserveSymlinksRequired:n}},gA=e=>`${e.name}@${e.reference}`,TY=e=>{let t=new Map;for(let[r,s]of e.entries())if(!s.dirList){let a=t.get(s.locator);a||(a={target:s.target,linkType:s.linkType,locations:[],aliases:s.aliases},t.set(s.locator,a)),a.locations.push(r)}for(let r of t.values())r.locations=r.locations.sort((s,a)=>{let n=s.split(Y.delimiter).length,c=a.split(Y.delimiter).length;return a===s?0:n!==c?c-n:a>s?1:-1});return t},Kwe=(e,t)=>{let r=H.isVirtualLocator(e)?H.devirtualizeLocator(e):e,s=H.isVirtualLocator(t)?H.devirtualizeLocator(t):t;return H.areLocatorsEqual(r,s)},QY=(e,t,r,s)=>{if(e.linkType!=="SOFT")return!1;let a=Ae.toPortablePath(r.resolveVirtual&&t.reference&&t.reference.startsWith("virtual:")?r.resolveVirtual(e.packageLocation):e.packageLocation);return Y.contains(s,a)===null},vht=e=>{let t=e.getPackageInformation(e.topLevel);if(t===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(e.findPackageLocator(t.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let s=Ae.toPortablePath(t.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},c=e.getDependencyTreeRoots(),f=new Map,p=new Set,h=(S,x)=>{let I=gA(S);if(p.has(I))return;p.add(I);let R=e.getPackageInformation(S);if(R){let N=x?gA(x):"";if(gA(S)!==N&&R.linkType==="SOFT"&&!S.reference.startsWith("link:")&&!QY(R,S,e,s)){let U=Jwe(R,S,e);(!f.get(U)||S.reference.startsWith("workspace:"))&&f.set(U,S)}for(let[U,K]of R.packageDependencies)K!==null&&(R.packagePeers.has(U)||h(e.getLocator(U,K),S))}};for(let S of c)h(S,null);let E=s.split(Y.sep);for(let S of f.values()){let x=e.getPackageInformation(S),R=Ae.toPortablePath(x.packageLocation.slice(0,-1)).split(Y.sep).slice(E.length),N=n;for(let U of R){let K=N.children.get(U);K||(K={children:new Map},N.children.set(U,K)),N=K}N.workspaceLocator=S}let C=(S,x)=>{if(S.workspaceLocator){let I=gA(x),R=a.get(I);R||(R=new Set,a.set(I,R)),R.add(S.workspaceLocator)}for(let I of S.children.values())C(I,S.workspaceLocator||x)};for(let S of n.children.values())C(S,n.workspaceLocator);return a},Sht=(e,t)=>{let r=[],s=!1,a=new Map,n=vht(e),c=e.getPackageInformation(e.topLevel);if(c===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let f=e.findPackageLocator(c.packageLocation);if(f===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let p=Ae.toPortablePath(c.packageLocation.slice(0,-1)),h={name:f.name,identName:f.name,reference:f.reference,peerNames:c.packagePeers,dependencies:new Set,dependencyKind:1},E=new Map,C=(x,I)=>`${gA(I)}:${x}`,S=(x,I,R,N,U,K,$,ie)=>{let fe=C(x,R),le=E.get(fe),ge=!!le;!ge&&R.name===f.name&&R.reference===f.reference&&(le=h,E.set(fe,h));let pe=QY(I,R,e,p);if(!le){let me=0;pe?me=2:I.linkType==="SOFT"&&R.name.endsWith(ng)&&(me=1),le={name:x,identName:R.name,reference:R.reference,dependencies:new Set,peerNames:me===1?new Set:I.packagePeers,dependencyKind:me},E.set(fe,le)}let De;if(pe?De=2:U.linkType==="SOFT"?De=1:De=0,le.hoistPriority=Math.max(le.hoistPriority||0,De),ie&&!pe){let me=gA({name:N.identName,reference:N.reference}),ce=a.get(me)||new Set;a.set(me,ce),ce.add(le.name)}let ye=new Map(I.packageDependencies);if(t.project){let me=t.project.workspacesByCwd.get(Ae.toPortablePath(I.packageLocation.slice(0,-1)));if(me){let ce=new Set([...Array.from(me.manifest.peerDependencies.values(),X=>H.stringifyIdent(X)),...Array.from(me.manifest.peerDependenciesMeta.keys())]);for(let X of ce)ye.has(X)||(ye.set(X,K.get(X)||null),le.peerNames.add(X))}}let d=gA({name:R.name.replace(ng,""),reference:R.reference}),ve=n.get(d);if(ve)for(let me of ve)ye.set(`${me.name}${ng}`,me.reference);(I!==U||I.linkType!=="SOFT"||!pe&&(!t.selfReferencesByCwd||t.selfReferencesByCwd.get($)))&&N.dependencies.add(le);let Ie=R!==f&&I.linkType==="SOFT"&&!R.name.endsWith(ng)&&!pe;if(!ge&&!Ie){let me=new Map;for(let[ce,X]of ye)if(X!==null){let be=e.getLocator(ce,X),ke=e.getLocator(ce.replace(ng,""),X),it=e.getPackageInformation(ke);if(it===null)throw new Error("Assertion failed: Expected the package to have been registered");let _=QY(it,be,e,p);if(t.validateExternalSoftLinks&&t.project&&_){it.packageDependencies.size>0&&(s=!0);for(let[je,Te]of it.packageDependencies)if(Te!==null){let ct=H.parseLocator(Array.isArray(Te)?`${Te[0]}@${Te[1]}`:`${je}@${Te}`);if(gA(ct)!==gA(be)){let Me=ye.get(je);if(Me){let P=H.parseLocator(Array.isArray(Me)?`${Me[0]}@${Me[1]}`:`${je}@${Me}`);Kwe(P,ct)||r.push({messageName:71,text:`Cannot link ${H.prettyIdent(t.project.configuration,H.parseIdent(be.name))} into ${H.prettyLine truncated
|
||||
`;for(let n=0,c=e.length;n<c;++n)a+=s+WF(String(n),e[n],t,s).replace(/^ +/,""),n+1<c&&(a+=","),a+=`
|
||||
`;return a+=r,a+="]",a}function Mht(e,t,r){let s=Object.keys(e),a="";a+="{";for(let n=0,c=s.length,f=0;n<c;++n){let p=s[n],h=e[p];typeof h>"u"||(f!==0&&(a+=", "),a+=JSON.stringify(p),a+=": ",a+=WF(p,h,t,r).replace(/^ +/g,""),f+=1)}return a+="}",a}function Uht(e,t,r){let s=Object.keys(e),a=`${r} `,n="";n+=r,n+=`{
|
||||
`;let c=0;for(let f=0,p=s.length;f<p;++f){let h=s[f],E=e[h];typeof E>"u"||(c!==0&&(n+=",",n+=`
|
||||
`),n+=a,n+=JSON.stringify(h),n+=": ",n+=WF(h,E,t,a).replace(/^ +/g,""),c+=1)}return c!==0&&(n+=`
|
||||
`),n+=r,n+="}",n}function WF(e,t,r,s){let{next:a}=Zwe[r],n=a[e]||a["*"];return Xwe(t,n,s)}function Xwe(e,t,r){let{collapsed:s}=Zwe[t];return Array.isArray(e)?s?Oht(e,t,r):Lht(e,t,r):typeof e=="object"&&e!==null?s?Mht(e,t,r):Uht(e,t,r):JSON.stringify(e)}function $we(e){return Xwe(e,"TOP_LEVEL","")}function Lb(e,t){let r=Array.from(e);Array.isArray(t)||(t=[t]);let s=[];for(let n of t)s.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of s){let p=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function _ht(e){let t=new Map,r=Lb(e.fallbackExclusionList||[],[({name:s,reference:a})=>s,({name:s,reference:a})=>a]);for(let{name:s,reference:a}of r){let n=t.get(s);typeof n>"u"&&t.set(s,n=new Set),n.add(a)}return Array.from(t).map(([s,a])=>[s,Array.from(a)])}function Hht(e){return Lb(e.fallbackPool||[],([t])=>t)}function jht(e){let t=[],r=e.dependencyTreeRoots.find(s=>e.packageRegistry.get(s.name)?.get(s.reference)?.packageLocation==="./");for(let[s,a]of Lb(e.packageRegistry,([n])=>n===null?"0":`1${n}`)){if(s===null)continue;let n=[];t.push([s,n]);for(let[c,{packageLocation:f,packageDependencies:p,packagePeers:h,linkType:E,discardFromLookup:C}]of Lb(a,([S])=>S===null?"0":`1${S}`)){if(c===null)continue;let S=[];s!==null&&c!==null&&!p.has(s)&&S.push([s,c]);for(let[U,K]of p)S.push([U,K]);let x=Lb(S,([U])=>U),I=h&&h.size>0?Array.from(h):void 0,N={packageLocation:f,packageDependencies:x,packagePeers:I,linkType:E,discardFromLookup:C||void 0};n.push([c,N]),r&&s===r.name&&c===r.reference&&t.unshift([null,[[null,N]]])}}return t}function Mb(e){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost."],dependencyTreeRoots:e.dependencyTreeRoots,enableTopLevelFallback:e.enableTopLevelFallback||!1,ignorePatternData:e.ignorePattern||null,pnpZipBackend:e.pnpZipBackend,fallbackExclusionList:_ht(e),fallbackPool:Hht(e),packageRegistryData:jht(e)}}var r1e=et(t1e());function n1e(e,t){return[e?`${e}
|
||||
`:"",`/* eslint-disable */
|
||||
`,`// @ts-nocheck
|
||||
`,`"use strict";
|
||||
`,`
|
||||
`,t,`
|
||||
`,(0,r1e.default)()].join("")}function Ght(e){return JSON.stringify(e,null,2)}function qht(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
|
||||
`)}'`}function Yht(e){return[`const RAW_RUNTIME_STATE =
|
||||
`,`${qht($we(e))};
|
||||
|
||||
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
`,` return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});
|
||||
`,`}
|
||||
`].join("")}function Wht(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
`,` const fs = require('fs');
|
||||
`,` const path = require('path');
|
||||
`,` const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(yr.pnpData)});
|
||||
`,` return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname});
|
||||
`,`}
|
||||
`].join("")}function i1e(e){let t=Mb(e),r=Yht(t);return n1e(e.shebang,r)}function s1e(e){let t=Mb(e),r=Wht(),s=n1e(e.shebang,r);return{dataFile:Ght(t),loaderFile:s}}bt();function LY(e,{basePath:t}){let r=Ae.toPortablePath(t),s=Y.resolve(r),a=e.ignorePatternData!==null?new RegExp(e.ignorePatternData):null,n=new Map,c=new Map(e.packageRegistryData.map(([C,S])=>[C,new Map(S.map(([x,I])=>{if(C===null!=(x===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let R=I.discardFromLookup??!1,N={name:C,reference:x},U=n.get(I.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&R,R||(U.locator=N)):n.set(I.packageLocation,{locator:N,discardFromLookup:R});let K=null;return[x,{packageDependencies:new Map(I.packageDependencies),packagePeers:new Set(I.packagePeers),linkType:I.linkType,discardFromLookup:R,get packageLocation(){return K||(K=Y.join(s,I.packageLocation))}}]}))])),f=new Map(e.fallbackExclusionList.map(([C,S])=>[C,new Set(S)])),p=new Map(e.fallbackPool),h=e.dependencyTreeRoots,E=e.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:h,enableTopLevelFallback:E,fallbackExclusionList:f,pnpZipBackend:e.pnpZipBackend,fallbackPool:p,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:c}}bt();bt();var oh=Ce("module"),Km=Ce("url"),KY=Ce("util");var aa=Ce("url");var c1e=et(Ce("assert"));var MY=Array.isArray,Ub=JSON.stringify,_b=Object.getOwnPropertyNames,Vm=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),UY=(e,t)=>RegExp.prototype.exec.call(e,t),_Y=(e,...t)=>RegExp.prototype[Symbol.replace].apply(e,t),ig=(e,...t)=>String.prototype.endsWith.apply(e,t),HY=(e,...t)=>String.prototype.includes.apply(e,t),jY=(e,...t)=>String.prototype.lastIndexOf.apply(e,t),Hb=(e,...t)=>String.prototype.indexOf.apply(e,t),o1e=(e,...t)=>String.prototype.replace.apply(e,t),sg=(e,...t)=>String.prototype.slice.apply(e,t),mA=(e,...t)=>String.prototype.startsWith.apply(e,t),a1e=Map,l1e=JSON.parse;function jb(e,t,r){return class extends r{constructor(...s){super(t(...s)),this.code=e,this.name=`${r.name} [${e}]`}}}var u1e=jb("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,r)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${r}`,TypeError),GY=jb("ERR_INVALID_MODULE_SPECIFIER",(e,t,r=void 0)=>`Invalid module "${e}" ${t}${r?` imported from ${r}`:""}`,TypeError),f1e=jb("ERR_INVALID_PACKAGE_TARGET",(e,t,r,s=!1,a=void 0)=>{let n=typeof r=="string"&&!s&&r.length&&!mA(r,"./");return t==="."?((0,c1e.default)(s===!1),`Invalid "exports" main target ${Ub(r)} defined in the package config ${e}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${s?"imports":"exports"}" target ${Ub(r)} defined for '${t}' in the package config ${e}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`},Error),Gb=jb("ERR_INVALID_PACKAGE_CONFIG",(e,t,r)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${r?`. ${r}`:""}`,Error),A1e=jb("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,r=void 0)=>t==="."?`No "exports" main defined in ${e}package.json${r?` imported from ${r}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${r?` imported from ${r}`:""}`,Error);var KF=Ce("url");function p1e(e,t){let r=Object.create(null);for(let s=0;s<t.length;s++){let a=t[s];Vm(e,a)&&(r[a]=e[a])}return r}var VF=new a1e;function Vht(e,t,r,s){let a=VF.get(e);if(a!==void 0)return a;let n=s(e);if(n===void 0){let x={pjsonPath:e,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return VF.set(e,x),x}let c;try{c=l1e(n)}catch(x){throw new Gb(e,(r?`"${t}" from `:"")+(0,KF.fileURLToPath)(r||t),x.message)}let{imports:f,main:p,name:h,type:E}=p1e(c,["imports","main","name","type"]),C=Vm(c,"exports")?c.exports:void 0;(typeof f!="object"||f===null)&&(f=void 0),typeof p!="string"&&(p=void 0),typeof h!="string"&&(h=void 0),E!=="module"&&E!=="commonjs"&&(E="none");let S={pjsonPath:e,exists:!0,main:p,name:h,type:E,exports:C,imports:f};return VF.set(e,S),S}function h1e(e,t){let r=new URL("./package.json",e);for(;;){let n=r.pathname;if(ig(n,"node_modules/package.json"))break;let c=Vht((0,KF.fileURLToPath)(r),e,void 0,t);if(c.exists)return c;let f=r;if(r=new URL("../package.json",r),r.pathname===f.pathname)break}let s=(0,KF.fileURLToPath)(r),a={pjsonPath:s,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return VF.set(s,a),a}function Kht(e,t,r){throw new u1e(e,t&&(0,aa.fileURLToPath)(new URL(".",t)),(0,aa.fileURLToPath)(r))}function Jht(e,t,r,s){let a=`request is not a valid subpath for the "${r?"imports":"exports"}" resolution of ${(0,aa.fileURLToPath)(t)}`;throw new GY(e,a,s&&(0,aa.fileURLToPath)(s))}function qb(e,t,r,s,a){throw typeof t=="object"&&t!==null?t=Ub(t,null,""):t=`${t}`,new f1e((0,aa.fileURLToPath)(new URL(".",r)),e,t,s,a&&(0,aa.fileURLToPath)(a))}var d1e=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f
Line truncated
|
||||
`),r;c=e[++n]}else if(c===" "&&!s){a=!0;continue}else if(c==='"'){s=!s;continue}a?(r.push(c),a=!1):r[r.length-1]+=c}return s&&t.push(`invalid value for NODE_OPTIONS (unterminated string)
|
||||
`),r}bt();var[ro,Sl,idt]=process.versions.node.split(".").map(e=>parseInt(e,10)),b1e=ro>19||ro===19&&Sl>=2||ro===18&&Sl>=13,Qzt=ro===20&&Sl<6||ro===19&&Sl>=3,Tzt=ro>19||ro===19&&Sl>=6,Rzt=ro>=21||ro===20&&Sl>=10||ro===18&&Sl>=19,Fzt=ro>=21||ro===20&&Sl>=10||ro===18&&Sl>=20,Nzt=ro>=22,Ozt=ro===26&&Sl<1||ro===25&&Sl>=7||ro===24&&Sl===15||ro===22&&(Sl>22||Sl===22&&idt>=3);function VY(e){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send){let t=e.map(r=>Ae.fromPortablePath(Eo.resolveVirtual(r)));if(b1e)process.send({"watch:require":t});else for(let r of t)process.send({"watch:require":r})}}function JY(e,t){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,s=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,n=/^(\/|\.{1,2}(\/|$))/,c=/\/$/,f=/^\.{0,2}\//,p={name:null,reference:null},h=[],E=new Set;if(e.enableTopLevelFallback===!0&&h.push(p),t.compatibilityMode!==!1)for(let Fe of["react-scripts","gatsby"]){let Qe=e.packageRegistry.get(Fe);if(Qe)for(let Se of Qe.keys()){if(Se===null)throw new Error("Assertion failed: This reference shouldn't be null");h.push({name:Fe,reference:Se})}}let{ignorePattern:C,packageRegistry:S,packageLocatorsByLocations:x}=e;function I(Fe,Qe){return{fn:Fe,args:Qe,error:null,result:null}}function R(Fe){let Qe=process.stderr?.hasColors?.()??process.stdout.isTTY,Se=(ct,Me)=>`\x1B[${ct}m${Me}\x1B[0m`,je=Fe.error;console.error(je?Se("31;1",`\u2716 ${Fe.error?.message.replace(/\n.*/s,"")}`):Se("33;1","\u203C Resolution")),Fe.args.length>0&&console.error();for(let ct of Fe.args)console.error(` ${Se("37;1","In \u2190")} ${(0,KY.inspect)(ct,{colors:Qe,compact:!0})}`);Fe.result&&(console.error(),console.error(` ${Se("37;1","Out \u2192")} ${(0,KY.inspect)(Fe.result,{colors:Qe,compact:!0})}`));let Te=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(Te.length>0){console.error();for(let ct of Te)console.error(` ${Se("38;5;244",ct)}`)}console.error()}function N(Fe,Qe){if(t.allowDebug===!1)return Qe;if(Number.isFinite(s)){if(s>=2)return(...Se)=>{let je=I(Fe,Se);try{return je.result=Qe(...Se)}catch(Te){throw je.error=Te}finally{R(je)}};if(s>=1)return(...Se)=>{try{return Qe(...Se)}catch(je){let Te=I(Fe,Se);throw Te.error=je,R(Te),je}}}return Qe}function U(Fe){let Qe=d(Fe);if(!Qe)throw Es("INTERNAL","Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return Qe}function K(Fe){if(Fe.name===null)return!0;for(let Qe of e.dependencyTreeRoots)if(Qe.name===Fe.name&&Qe.reference===Fe.reference)return!0;return!1}let $=new Set(["node","require",...S1e("--conditions")]);function ie(Fe,Qe=$,Se){let je=me(Y.join(Fe,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(je===null)throw Es("INTERNAL",`The locator that owns the "${Fe}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:Te}=U(je),ct=Y.join(Te,yr.manifest);if(!t.fakeFs.existsSync(ct))return null;let Me=JSON.parse(t.fakeFs.readFileSync(ct,"utf8"));if(Me.exports==null)return null;let P=Y.contains(Te,Fe);if(P===null)throw Es("INTERNAL","unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)");P!=="."&&!f.test(P)&&(P=`./${P}`);try{let w=E1e({packageJSONUrl:(0,Km.pathToFileURL)(Ae.fromPortablePath(ct)),packageSubpath:P,exports:Me.exports,base:Se?(0,Km.pathToFileURL)(Ae.fromPortablePath(Se)):null,conditions:Qe});return Ae.toPortablePath((0,Km.fileURLToPath)(w))}catch(w){throw Es("EXPORTS_RESOLUTION_FAILED",w.message,{unqualifiedPath:ff(Fe),locator:je,pkgJson:Me,subpath:ff(P),conditions:Qe},w.code)}}function fe(Fe,Qe,{extensions:Se}){let je;try{Qe.push(Fe),je=t.fakeFs.statSync(Fe)}catch{}if(je&&!je.isDirectory())return t.fakeFs.realpathSync(Fe);if(je&&je.isDirectory()){let Te;try{Te=JSON.parse(t.fakeFs.readFileSync(Y.join(Fe,yr.manifest),"utf8"))}catch{}let ct;if(Te&&Te.main&&(ct=Y.resolve(Fe,Te.main)),ct&&ct!==Fe){let Me=fe(ct,Qe,{extensions:Se});if(Me!==null)return Me}}for(let Te=0,ct=Se.length;Te<ct;Te++){let Me=`${Fe}${Se[Te]}`;if(Qe.push(Me),t.fakeFs.existsSync(Me))return Me}if(je&&je.isDirectory())for(let Te=0,ct=Se.length;Te<ct;Te++){let Me=Y.format({dir:Fe,name:"index",ext:Se[Te]});if(Qe.push(Me),t.fakeFs.existsSync(Me))return Me}return null}function le(Fe){let Qe=new oh.Module(Fe,null);return Qe.filename=Fe,Qe.paths=oh.Module._nodeModulePaths(Fe),Qe}function ge(Fe,Qe){return Qe.endsWith("/")&&(Qe=Y.join(Qe,"internal.js")),oh.Module._resolveFilename(Ae.fromPortablePath(Fe),le(Ae.fromPortablePath(Qe)),!1,{plugnplay:!1})}function pe(Fe){if(C===null)return!1;let Qe=Y.contains(e.basePath,Fe);return Qe===null?!1:!!C.test(Qe.replace(/\/$/,""))}let De={std:3,resolveVirtual:1,getAllLocators:1},ye=p;function d({name:Fe,reference:Qe}){let Se=S.get(Fe);if(!Se)return null;let je=Se.get(Qe);return je||null}function ve({name:Fe,reference:Qe}){let Se=[];for(let[je,Te]of S)if(je!==null)for(let[ct,Me]of Te)ct===null|Line truncated
|
||||
|
||||
Require request: "${je}"
|
||||
Required by: ${Te}
|
||||
`,{request:je,issuer:Te});return Ae.toPortablePath(P)}let ct,Me=Fe.match(a);if(Me){if(!Qe)throw Es("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:je,issuer:Te});let[,P,w]=Me,D=me(Qe);if(!D){let Ne=ge(Fe,Qe);if(Ne===!1)throw Es("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
|
||||
|
||||
Require path: "${je}"
|
||||
Required by: ${Te}
|
||||
`,{request:je,issuer:Te});return Ae.toPortablePath(Ne)}let F=U(D).packageDependencies.get(P),z=null;if(F==null&&D.name!==null){let Ne=e.fallbackExclusionList.get(D.name);if(!Ne||!Ne.has(D.reference)){for(let Ct=0,Yt=h.length;Ct<Yt;++Ct){let Pt=U(h[Ct]).packageDependencies.get(P);if(Pt!=null){r?z=Pt:F=Pt;break}}if(e.enableTopLevelFallback&&F==null&&z===null){let Ct=e.fallbackPool.get(P);Ct!=null&&(z=Ct)}}}let Z=null;if(F===null)if(K(D))Z=Es("MISSING_PEER_DEPENDENCY",`Your application tried to access ${P} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
|
||||
|
||||
Required package: ${P}${P!==je?` (via "${je}")`:""}
|
||||
Required by: ${Te}
|
||||
`,{request:je,issuer:Te,dependencyName:P});else{let Ne=Ie(P,D);Ne.every(ut=>K(ut))?Z=Es("MISSING_PEER_DEPENDENCY",`${D.name} tried to access ${P} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${P}${P!==je?` (via "${je}")`:""}
|
||||
Required by: ${D.name}@${D.reference} (via ${Te})
|
||||
${Ne.map(ut=>`Ancestor breaking the chain: ${ut.name}@${ut.reference}
|
||||
`).join("")}
|
||||
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P,brokenAncestors:Ne}):Z=Es("MISSING_PEER_DEPENDENCY",`${D.name} tried to access ${P} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${P}${P!==je?` (via "${je}")`:""}
|
||||
Required by: ${D.name}@${D.reference} (via ${Te})
|
||||
|
||||
${Ne.map(ut=>`Ancestor breaking the chain: ${ut.name}@${ut.reference}
|
||||
`).join("")}
|
||||
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P,brokenAncestors:Ne})}else F===void 0&&(!Se&&(0,oh.isBuiltin)(Fe)?K(D)?Z=Es("UNDECLARED_DEPENDENCY",`Your application tried to access ${P}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${P} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${P}${P!==je?` (via "${je}")`:""}
|
||||
Required by: ${Te}
|
||||
`,{request:je,issuer:Te,dependencyName:P}):Z=Es("UNDECLARED_DEPENDENCY",`${D.name} tried to access ${P}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${P} isn't otherwise declared in ${D.name}'s dependencies, this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${P}${P!==je?` (via "${je}")`:""}
|
||||
Required by: ${Te}
|
||||
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P}):K(D)?Z=Es("UNDECLARED_DEPENDENCY",`Your application tried to access ${P}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${P}${P!==je?` (via "${je}")`:""}
|
||||
Required by: ${Te}
|
||||
`,{request:je,issuer:Te,dependencyName:P}):Z=Es("UNDECLARED_DEPENDENCY",`${D.name} tried to access ${P}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${P}${P!==je?` (via "${je}")`:""}
|
||||
Required by: ${D.name}@${D.reference} (via ${Te})
|
||||
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P}));if(F==null){if(z===null||Z===null)throw Z||new Error("Assertion failed: Expected an error to have been set");F=z;let Ne=Z.message.replace(/\n.*/g,"");Z.message=Ne,!E.has(Ne)&&s!==0&&(E.add(Ne),process.emitWarning(Z))}let ee=Array.isArray(F)?{name:F[0],reference:F[1]}:{name:P,reference:F},se=U(ee);if(!se.packageLocation)throw Es("MISSING_DEPENDENCY",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
|
||||
|
||||
Required package: ${ee.name}@${ee.reference}${ee.name!==je?` (via "${je}")`:""}
|
||||
Required by: ${D.name}@${D.reference} (via ${Te})
|
||||
`,{request:je,issuer:Te,dependencyLocator:Object.assign({},ee)});let xe=se.packageLocation;w?ct=Y.join(xe,w):ct=xe}else if(Y.isAbsolute(Fe))ct=Y.normalize(Fe);else{if(!Qe)throw Es("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:je,issuer:Te});let P=Y.resolve(Qe);Qe.match(c)?ct=Y.normalize(Y.join(P,Fe)):ct=Y.normalize(Y.join(Y.dirname(P),Fe))}return Y.normalize(ct)}function be(Fe,Qe,Se=$,je){if(n.test(Fe))return Qe;let Te=ie(Qe,Se,je);return Te?Y.normalize(Te):Qe}function ke(Fe,{extensions:Qe=Object.keys(oh.Module._extensions)}={}){let Se=[],je=fe(Fe,Se,{extensions:Qe});if(je)return VY([je]),Y.normalize(je);{VY(Se);let Te=ff(Fe),ct=me(Fe);if(ct){let{packageLocation:Me}=U(ct),P=!0;try{t.fakeFs.accessSync(Me)}catch(w){if(w?.code==="ENOENT")P=!1;else{let D=(w?.message??w??"empty exception thrown").replace(/^[A-Z]/,y=>y.toLowerCase());throw Es("QUALIFIED_PATH_RESOLUTION_FAILED",`Required package exists but could not be accessed (${D}).
|
||||
|
||||
Missing package: ${ct.name}@${ct.reference}
|
||||
Expected package location: ${ff(Me)}
|
||||
`,{unqualifiedPath:Te,extensions:Qe})}}if(!P){let w=Me.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw Es("QUALIFIED_PATH_RESOLUTION_FAILED",`${w}
|
||||
|
||||
Missing package: ${ct.name}@${ct.reference}
|
||||
Expected package location: ${ff(Me)}
|
||||
`,{unqualifiedPath:Te,extensions:Qe})}}throw Es("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
|
||||
|
||||
Source path: ${Te}
|
||||
${Se.map(Me=>`Not found: ${ff(Me)}
|
||||
`).join("")}`,{unqualifiedPath:Te,extensions:Qe})}}function it(Fe,Qe,Se){if(!Qe)throw new Error("Assertion failed: An issuer is required to resolve private import mappings");let je=I1e({name:Fe,base:(0,Km.pathToFileURL)(Ae.fromPortablePath(Qe)),conditions:Se.conditions??$,readFileSyncFn:ce});if(je instanceof URL)return ke(Ae.toPortablePath((0,Km.fileURLToPath)(je)),{extensions:Se.extensions});if(je.startsWith("#"))throw new Error("Mapping from one private import to another isn't allowed");return _(je,Qe,Se)}function _(Fe,Qe,Se={}){try{if(Fe.startsWith("#"))return it(Fe,Qe,Se);let{considerBuiltins:je,extensions:Te,conditions:ct}=Se,Me=X(Fe,Qe,{considerBuiltins:je});if(Fe==="pnpapi")return Me;if(Me===null)return null;let P=()=>Qe!==null?pe(Qe):!1,w=(!je||!(0,oh.isBuiltin)(Fe))&&!P()?be(Fe,Me,ct,Qe):Me;return ke(w,{extensions:Te})}catch(je){throw Object.hasOwn(je,"pnpCode")&&Object.assign(je.data,{request:ff(Fe),issuer:Qe&&ff(Qe)}),je}}function tt(Fe){let Qe=Y.normalize(Fe),Se=Eo.resolveVirtual(Qe);return Se!==Qe?Se:null}return{VERSIONS:De,topLevel:ye,getLocator:(Fe,Qe)=>Array.isArray(Qe)?{name:Qe[0],reference:Qe[1]}:{name:Fe,reference:Qe},getDependencyTreeRoots:()=>[...e.dependencyTreeRoots],getAllLocators(){let Fe=[];for(let[Qe,Se]of S)for(let je of Se.keys())Qe!==null&&je!==null&&Fe.push({name:Qe,reference:je});return Fe},getPackageInformation:Fe=>{let Qe=d(Fe);if(Qe===null)return null;let Se=Ae.fromPortablePath(Qe.packageLocation);return{...Qe,packageLocation:Se}},findPackageLocator:Fe=>me(Ae.toPortablePath(Fe)),resolveToUnqualified:N("resolveToUnqualified",(Fe,Qe,Se)=>{let je=Qe!==null?Ae.toPortablePath(Qe):null,Te=X(Ae.toPortablePath(Fe),je,Se);return Te===null?null:Ae.fromPortablePath(Te)}),resolveUnqualified:N("resolveUnqualified",(Fe,Qe)=>Ae.fromPortablePath(ke(Ae.toPortablePath(Fe),Qe))),resolveRequest:N("resolveRequest",(Fe,Qe,Se)=>{let je=Qe!==null?Ae.toPortablePath(Qe):null,Te=_(Ae.toPortablePath(Fe),je,Se);return Te===null?null:Ae.fromPortablePath(Te)}),resolveVirtual:N("resolveVirtual",Fe=>{let Qe=tt(Ae.toPortablePath(Fe));return Qe!==null?Ae.fromPortablePath(Qe):null})}}bt();var D1e=(e,t,r)=>{let s=Mb(e),a=LY(s,{basePath:t}),n=Ae.join(t,yr.pnpCjs);return JY(a,{fakeFs:r,pnpapiResolution:n})};var ZY=et(x1e());jt();var yA={};Vt(yA,{checkManifestCompatibility:()=>k1e,extractBuildRequest:()=>JF,getExtractHint:()=>XY,hasBindingGyp:()=>$Y});Ge();bt();function k1e(e){return H.isPackageCompatible(e,Ui.getArchitectureSet())}function JF(e,t,r,{configuration:s}){let a=[];for(let n of["preinstall","install","postinstall"])t.manifest.scripts.has(n)&&a.push({type:0,script:n});return!t.manifest.scripts.has("install")&&t.misc.hasBindingGyp&&a.push({type:1,script:"node-gyp rebuild"}),a.length===0?null:e.linkType!=="HARD"?{skipped:!0,explain:n=>n.reportWarningOnce(6,`${H.prettyLocator(s,e)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`)}:r&&r.built===!1?{skipped:!0,explain:n=>n.reportInfoOnce(5,`${H.prettyLocator(s,e)} lists build scripts, but its build has been explicitly disabled through configuration.`)}:!s.get("enableScripts")&&!r.built?{skipped:!0,explain:n=>n.reportWarningOnce(4,`${H.prettyLocator(s,e)} lists build scripts, but all build scripts have been disabled.`)}:k1e(e)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${H.prettyLocator(s,e)} The ${Ui.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var odt=new Set([".exe",".bin",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function XY(e){return e.packageFs.getExtractHint({relevantExtensions:odt})}function $Y(e){let t=Y.join(e.prefixPath,"binding.gyp");return e.packageFs.existsSync(t)}var Vb={};Vt(Vb,{getUnpluggedPath:()=>Wb});Ge();bt();function Wb(e,{configuration:t}){return Y.resolve(t.get("pnpUnpluggedFolder"),H.slugifyLocator(e))}var adt=new Set([H.makeIdent(null,"open").identHash,H.makeIdent(null,"opn").identHash]),og=class{constructor(){this.mode="strict";this.pnpCache=new Map}getCustomDataKey(){return JSON.stringify({name:"PnpLinker",version:2})}supportsPackage(t,r){return this.isEnabled(r)}async findPackageLocation(t,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let s=ag(r.project).cjs;if(!ae.existsSync(s))throw new ot(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ue.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let a=qe.getFactoryWithDefault(this.pnpCache,s,()=>qe.dynamicRequire(s,{cachingStrategy:qe.CachingStrategy.FsTime})),n={name:H.stringifyIdent(t),reference:t.reference},c=a.getPackageInformation(n);if(!c)throw new ot(`Couldn't find ${H.prettyLocator(r.project.configuration,t)} in the currently installed PnP map - running an install might help`);return Ae.toPortablePath(c.packageLocation)}async findPackageLocator(t,r){if(!this.isEnabled(r))return null;Line truncated
|
||||
`,n+=`# cause your node_modules installation to become invalidated.
|
||||
`,n+=`
|
||||
`,n+=`__metadata:
|
||||
`,n+=` version: ${G1e}
|
||||
`,n+=` nmMode: ${s.value}
|
||||
`;let c=Array.from(t.keys()).sort(),f=H.stringifyLocator(e.topLevelWorkspace.anchoredLocator);for(let E of c){let C=t.get(E);n+=`
|
||||
`,n+=`${JSON.stringify(E)}:
|
||||
`,n+=` locations:
|
||||
`;for(let S of C.locations){let x=Y.contains(e.cwd,S);if(x===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=` - ${JSON.stringify(x)}
|
||||
`}if(C.aliases.length>0){n+=` aliases:
|
||||
`;for(let S of C.aliases)n+=` - ${JSON.stringify(S)}
|
||||
`}if(E===f&&r.size>0){n+=` bin:
|
||||
`;for(let[S,x]of r){let I=Y.contains(e.cwd,S);if(I===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=` ${JSON.stringify(I)}:
|
||||
`;for(let[R,N]of x){let U=Y.relative(Y.join(S,wi),N);n+=` ${JSON.stringify(R)}: ${JSON.stringify(U)}
|
||||
`}}}}let p=e.cwd,h=Y.join(p,wi,uW);try{a&&await ae.removePromise(h),await ae.changeFilePromise(h,n,{automaticNewlines:!0})}finally{Qdt(e)}}async function Fdt(e){let t=e.cwd,r=Y.join(t,wi,uW);try{let s=await ae.statPromise(r);return`${s.mtimeMs}:${s.size}`}catch{return null}}async function q1e(e,{unrollAliases:t=!1}={}){let r=e.cwd,s=Y.join(r,wi,uW),a;try{a=await ae.statPromise(s)}catch{}if(!a)return null;let n=us(await ae.readFilePromise(s,"utf8"));if(n.__metadata.version>G1e)return null;let c=n.__metadata.nmMode||"classic",f=new Map,p=new Map;delete n.__metadata;for(let[h,E]of Object.entries(n)){let C=E.locations.map(x=>Y.join(r,x)),S=E.bin;if(S)for(let[x,I]of Object.entries(S)){let R=Y.join(r,Ae.toPortablePath(x)),N=qe.getMapWithDefault(p,R);for(let[U,K]of Object.entries(I))N.set(U,Ae.toPortablePath([R,wi,K].join(Y.sep)))}if(f.set(h,{target:wt.dot,linkType:"HARD",locations:C,aliases:E.aliases||[]}),t&&E.aliases)for(let x of E.aliases){let{scope:I,name:R}=H.parseLocator(h),N=H.makeLocator(H.makeIdent(I,R),x),U=H.stringifyLocator(N);f.set(U,{target:wt.dot,linkType:"HARD",locations:C,aliases:[]})}}return{locatorMap:f,binSymlinks:p,locationTree:Y1e(f,{skipPrefix:e.cwd}),nmMode:c,mtimeMs:a.mtimeMs}}var ww=async(e,t)=>{if(e.split(Y.sep).indexOf(wi)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${e}`);try{let r;if(!t.innerLoop&&(r=await ae.lstatPromise(e),!r.isDirectory()&&!r.isSymbolicLink()||r.isSymbolicLink()&&!t.isWorkspaceDir)){await ae.unlinkPromise(e);return}let s=await ae.readdirPromise(e,{withFileTypes:!0});for(let n of s){let c=Y.join(e,n.name);n.isDirectory()?(n.name!==wi||t&&t.innerLoop)&&await ww(c,{innerLoop:!0,contentsOnly:!1}):await ae.unlinkPromise(c)}let a=!t.innerLoop&&t.isWorkspaceDir&&r?.isSymbolicLink();!t.contentsOnly&&!a&&await ae.rmdirPromise(e)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},U1e=4,$F=(e,{skipPrefix:t})=>{let r=Y.contains(t,e);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${e} which is outside project root: ${t}`);let s=r.split(Y.sep).filter(p=>p!==""),a=s.indexOf(wi),n=s.slice(0,a).join(Y.sep),c=Y.join(t,n),f=s.slice(a);return{locationRoot:c,segments:f}},Y1e=(e,{skipPrefix:t})=>{let r=new Map;if(e===null)return r;let s=()=>({children:new Map,linkType:"HARD"});for(let[a,n]of e.entries()){if(n.linkType==="SOFT"&&Y.contains(t,n.target)!==null){let f=qe.getFactoryWithDefault(r,n.target,s);f.locator=a,f.linkType=n.linkType}for(let c of n.locations){let{locationRoot:f,segments:p}=$F(c,{skipPrefix:t}),h=qe.getFactoryWithDefault(r,f,s);for(let E=0;E<p.length;++E){let C=p[E];if(C!=="."){let S=qe.getFactoryWithDefault(h.children,C,s);h.children.set(C,S),h=S}E===p.length-1&&(h.locator=a,h.linkType=n.linkType)}}}return r},AW=async(e,t,r)=>{if(process.platform==="win32"&&r==="junctions"){let s;try{s=await ae.lstatPromise(e)}catch{}if(!s||s.isDirectory()){await ae.symlinkPromise(e,t,"junction");return}}await ae.symlinkPromise(Y.relative(Y.dirname(t),e),t)};async function W1e(e,t,r){let s=Y.join(e,`${cW.default.randomBytes(16).toString("hex")}.tmp`);try{await ae.writeFilePromise(s,r);try{await ae.linkPromise(s,t)}catch{}}finally{await ae.unlinkPromise(s)}}async function Ndt({srcPath:e,dstPath:t,entry:r,globalHardlinksStore:s,baseFs:a,nmMode:n}){if(r.kind==="file"){if(n.value==="hardlinks-global"&&s&&r.digest){let f=Y.join(s,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await ae.statPromise(f);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs<r.mtimeMs-kdt))if(await Mn.checksumFile(f,{baseFs:ae,algorithm:"sha1"})!==r.digest){let C=Y.join(s,`${cW.default.randomBytes(16).toString("hex")}.tmp`);await ae.renamePromise(f,C);let S=await a.readFilePromise(e);await ae.writeFilePromise(C,S);try{await ae.linkPromise(C,f),r.mtimeMs=new Date().getTime(),await ae.unlinkPromise(C)}catch{}}else r.mtimeMs||(r.mtimeMs=Math.ceil(h.mtimeMs));await ae.linkPromise(f,t),p=!0}catch{p=!1}if(!p){let h=await a.readFilePromise(e);await W1e(s,f,h),r.mtimeMs=new Date().getTime();try{await ae.linkPromise(f,t)}catch(E){E&&E.code&&E.code=="EXDEV"&&(n.value="hardlinks-local",await a.copyFilePromise(e,t))}}}else await a.copyFilePromise(e,t);let c=r.mode&511;c!==420&&await ae.chmodPromise(t,c)}}var Odt=async(e,t,{baseFs:r,globalHardlinksStore:s,nmMode:a,windowsLinkType:n,packageChecksum:c})=>{await ae.mkdirPromise(e,{recursive:!0});let f=async(E=wt.dot)=>{let C=Y.join(t,E),S=await r.readdirPromise(C,{withFileTypes:!0}),x=new Map;for(let I of S){let R=Y.join(E,I.name),N,U=Y.join(C,I.name);if(I.isFile()){if(N={kind:"file",mode:(await r.lstatPromise(U)).mode},a.value==="hardlinks-global"){let K=await Mn.checksumFile(U,{baseFs:r,algorithm:"sha1"});N.digest=K}}else if(I.isDirectory())N={kind:"directory"};else if(I.isSymbolicLink())N={kind:"symlink",symlinkTo:await r.readlinkPromise(U)};else throw new Error(`Unsupported file type (file: ${U}, mode: 0o${await r.statSync(U).mode.toString(8).padStart(6,"0")})`);if(x.
Line truncated
|
||||
`)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||"";let{otp:s}=await(0,mW.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`
|
||||
`),s}function rN(e){if(e.originalError?.name!=="HTTPError")return!1;try{return(e.originalError?.response.headers["www-authenticate"].split(/,\s*/).map(r=>r.toLowerCase())).includes("otp")}catch{return!1}}function Sw(e){return{"npm-otp":e}}async function cgt(e,{configuration:t,ident:r}){let s=null;if(process.env.GITLAB_CI)s=process.env.NPM_ID_TOKEN||null;else if(process.env.CIRCLECI)s=process.env.NPM_ID_TOKEN||null;else if(process.env.GITHUB_ACTIONS){if(!(process.env.ACTIONS_ID_TOKEN_REQUEST_URL&&process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN))return null;let a=`npm:${new URL(e).host.replace("registry.yarnpkg.com","registry.npmjs.org").replace("yarn.npmjs.org","registry.npmjs.org")}`,n=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);n.searchParams.append("audience",a),s=(await nn.get(n.href,{configuration:t,jsonResponse:!0,headers:{Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).value}if(!s)return null;try{return(await nn.post(`${e}/-/npm/v1/oidc/token/exchange/package${Zb(r)}`,null,{configuration:t,jsonResponse:!0,headers:{Authorization:`Bearer ${s}`}})).token||null}catch{}return null}var $b=class{supports(t,r){if(!t.reference.startsWith(ti))return!1;let{selector:s,params:a}=H.parseRange(t.reference);return!(!r2e.default.valid(s)||a===null||typeof a.__archiveUrl!="string")}getLocalPath(t,r){return null}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${H.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:H.getIdentVendorPath(t),checksum:c}}async fetchFromNetwork(t,r){let{params:s}=H.parseRange(t.reference);if(s===null||typeof s.__archiveUrl!="string")throw new Error("Assertion failed: The archiveUrl querystring parameter should have been available");let a=await Zm(s.__archiveUrl,{customErrorMessage:zm,configuration:r.project.configuration,ident:t});return await ms.convertToZip(a,{configuration:r.project.configuration,prefixPath:H.getIdentVendorPath(t),stripComponents:1})}};Ge();var eD=class{supportsDescriptor(t,r){return!(!t.range.startsWith(ti)||!H.tryParseDescriptor(t.range.slice(ti.length),!0))}supportsLocator(t,r){return!1}shouldPersistResolution(t,r){throw new Error("Unreachable")}bindDescriptor(t,r,s){return t}getResolutionDependencies(t,r){let s=r.project.configuration.normalizeDependency(H.parseDescriptor(t.range.slice(ti.length),!0));return r.resolver.getResolutionDependencies(s,r)}async getCandidates(t,r,s){let a=s.project.configuration.normalizeDependency(H.parseDescriptor(t.range.slice(ti.length),!0));return await s.resolver.getCandidates(a,r,s)}async getSatisfying(t,r,s,a){let n=a.project.configuration.normalizeDependency(H.parseDescriptor(t.range.slice(ti.length),!0));return a.resolver.getSatisfying(n,r,s,a)}resolve(t,r){throw new Error("Unreachable")}};Ge();Ge();var n2e=et(hi());var ah=class e{supports(t,r){if(!t.reference.startsWith(ti))return!1;let s=new URL(t.reference);return!(!n2e.default.valid(s.pathname)||s.searchParams.has("__archiveUrl"))}getLocalPath(t,r){return null}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${H.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:H.getIdentVendorPath(t),checksum:c}}async fetchFromNetwork(t,r){let s;try{s=await Zm(e.getLocatorUrl(t),{customErrorMessage:zm,configuration:r.project.configuration,ident:t})}catch{s=await Zm(e.getLocatorUrl(t).replace(/%2f/g,"/"),{customErrorMessage:zm,configuration:r.project.configuration,ident:t})}return await ms.convertToZip(s,{configuration:r.project.configuration,prefixPath:H.getIdentVendorPath(t),stripComponents:1})}static isConventionalTarballUrl(t,r,{configuration:s}){let a=Bw(t.scope,{configuration:s}),n=e.getLocatorUrl(t);return r=r.replace(/^https?:(\/\/(?:[^/]+\.)?npmjs.org(?:$|\/))/,"https:$1"),a=a.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r=r.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r===a+n||r===a+n.replace(/%2f/g,"/")}static getLocatorUrl(t){let r=kr.clean(t.reference.slice(ti.length));if(r===null)throw new Lt(10,"The npm semver resolver got selected, but the version isn't semver");let s=encodeURIComponent(t.name),a=encodeURIComponent(r);return`${Zb(t)}/-/${s}-${a}.tgz`}};Ge();Ge();Ge();var EW=et(hi());var nN=H.makeIdent(null,"node-gyp"),ugt=/\b(node-gyp|prebuild-install)\b/,tD=class{supportsDescriptor(t,r){return t.range.startsWith(ti)?!!kr.validRange(t.range.slice(ti.length)):!1}supportsLocator(t,r){if(!t.rLine truncated
|
||||
https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html`);r={_type:Wvt,subject:e,predicateType:Kvt,predicate:{buildType:`${Xvt}/${$vt}`,builder:{id:`${vt.CI_PROJECT_URL}/-/runners/${vt.CI_RUNNER_ID}`},invocation:{configSource:{uri:`git+${vt.CI_PROJECT_URL}`,digest:{sha1:vt.CI_COMMIT_SHA},entryPoint:vt.CI_JOB_NAME},parameters:{CI:vt.CI,CI_API_GRAPHQL_URL:vt.CI_API_GRAPHQL_URL,CI_API_V4_URL:vt.CI_API_V4_URL,CI_BUILD_BEFORE_SHA:vt.CI_BUILD_BEFORE_SHA,CI_BUILD_ID:vt.CI_BUILD_ID,CI_BUILD_NAME:vt.CI_BUILD_NAME,CI_BUILD_REF:vt.CI_BUILD_REF,CI_BUILD_REF_NAME:vt.CI_BUILD_REF_NAME,CI_BUILD_REF_SLUG:vt.CI_BUILD_REF_SLUG,CI_BUILD_STAGE:vt.CI_BUILD_STAGE,CI_COMMIT_BEFORE_SHA:vt.CI_COMMIT_BEFORE_SHA,CI_COMMIT_BRANCH:vt.CI_COMMIT_BRANCH,CI_COMMIT_REF_NAME:vt.CI_COMMIT_REF_NAME,CI_COMMIT_REF_PROTECTED:vt.CI_COMMIT_REF_PROTECTED,CI_COMMIT_REF_SLUG:vt.CI_COMMIT_REF_SLUG,CI_COMMIT_SHA:vt.CI_COMMIT_SHA,CI_COMMIT_SHORT_SHA:vt.CI_COMMIT_SHORT_SHA,CI_COMMIT_TIMESTAMP:vt.CI_COMMIT_TIMESTAMP,CI_COMMIT_TITLE:vt.CI_COMMIT_TITLE,CI_CONFIG_PATH:vt.CI_CONFIG_PATH,CI_DEFAULT_BRANCH:vt.CI_DEFAULT_BRANCH,CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:vt.CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX:vt.CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_SERVER:vt.CI_DEPENDENCY_PROXY_SERVER,CI_DEPENDENCY_PROXY_USER:vt.CI_DEPENDENCY_PROXY_USER,CI_JOB_ID:vt.CI_JOB_ID,CI_JOB_NAME:vt.CI_JOB_NAME,CI_JOB_NAME_SLUG:vt.CI_JOB_NAME_SLUG,CI_JOB_STAGE:vt.CI_JOB_STAGE,CI_JOB_STARTED_AT:vt.CI_JOB_STARTED_AT,CI_JOB_URL:vt.CI_JOB_URL,CI_NODE_TOTAL:vt.CI_NODE_TOTAL,CI_PAGES_DOMAIN:vt.CI_PAGES_DOMAIN,CI_PAGES_URL:vt.CI_PAGES_URL,CI_PIPELINE_CREATED_AT:vt.CI_PIPELINE_CREATED_AT,CI_PIPELINE_ID:vt.CI_PIPELINE_ID,CI_PIPELINE_IID:vt.CI_PIPELINE_IID,CI_PIPELINE_SOURCE:vt.CI_PIPELINE_SOURCE,CI_PIPELINE_URL:vt.CI_PIPELINE_URL,CI_PROJECT_CLASSIFICATION_LABEL:vt.CI_PROJECT_CLASSIFICATION_LABEL,CI_PROJECT_DESCRIPTION:vt.CI_PROJECT_DESCRIPTION,CI_PROJECT_ID:vt.CI_PROJECT_ID,CI_PROJECT_NAME:vt.CI_PROJECT_NAME,CI_PROJECT_NAMESPACE:vt.CI_PROJECT_NAMESPACE,CI_PROJECT_NAMESPACE_ID:vt.CI_PROJECT_NAMESPACE_ID,CI_PROJECT_PATH:vt.CI_PROJECT_PATH,CI_PROJECT_PATH_SLUG:vt.CI_PROJECT_PATH_SLUG,CI_PROJECT_REPOSITORY_LANGUAGES:vt.CI_PROJECT_REPOSITORY_LANGUAGES,CI_PROJECT_ROOT_NAMESPACE:vt.CI_PROJECT_ROOT_NAMESPACE,CI_PROJECT_TITLE:vt.CI_PROJECT_TITLE,CI_PROJECT_URL:vt.CI_PROJECT_URL,CI_PROJECT_VISIBILITY:vt.CI_PROJECT_VISIBILITY,CI_REGISTRY:vt.CI_REGISTRY,CI_REGISTRY_IMAGE:vt.CI_REGISTRY_IMAGE,CI_REGISTRY_USER:vt.CI_REGISTRY_USER,CI_RUNNER_DESCRIPTION:vt.CI_RUNNER_DESCRIPTION,CI_RUNNER_ID:vt.CI_RUNNER_ID,CI_RUNNER_TAGS:vt.CI_RUNNER_TAGS,CI_SERVER_HOST:vt.CI_SERVER_HOST,CI_SERVER_NAME:vt.CI_SERVER_NAME,CI_SERVER_PORT:vt.CI_SERVER_PORT,CI_SERVER_PROTOCOL:vt.CI_SERVER_PROTOCOL,CI_SERVER_REVISION:vt.CI_SERVER_REVISION,CI_SERVER_SHELL_SSH_HOST:vt.CI_SERVER_SHELL_SSH_HOST,CI_SERVER_SHELL_SSH_PORT:vt.CI_SERVER_SHELL_SSH_PORT,CI_SERVER_URL:vt.CI_SERVER_URL,CI_SERVER_VERSION:vt.CI_SERVER_VERSION,CI_SERVER_VERSION_MAJOR:vt.CI_SERVER_VERSION_MAJOR,CI_SERVER_VERSION_MINOR:vt.CI_SERVER_VERSION_MINOR,CI_SERVER_VERSION_PATCH:vt.CI_SERVER_VERSION_PATCH,CI_TEMPLATE_REGISTRY_HOST:vt.CI_TEMPLATE_REGISTRY_HOST,GITLAB_CI:vt.GITLAB_CI,GITLAB_FEATURES:vt.GITLAB_FEATURES,GITLAB_USER_ID:vt.GITLAB_USER_ID,GITLAB_USER_LOGIN:vt.GITLAB_USER_LOGIN,RUNNER_GENERATE_ARTIFACTS_METADATA:vt.RUNNER_GENERATE_ARTIFACTS_METADATA},environment:{name:vt.CI_RUNNER_DESCRIPTION,architecture:vt.CI_RUNNER_EXECUTABLE_ARCH,server:vt.CI_SERVER_URL,project:vt.CI_PROJECT_PATH,job:{id:vt.CI_JOB_ID},pipeline:{id:vt.CI_PIPELINE_ID,ref:vt.CI_CONFIG_PATH}}},metadata:{buildInvocationId:`${vt.CI_JOB_URL}`,completeness:{parameters:!0,environment:!0,materials:!1},reproducible:!1},materials:[{uri:`git+${vt.CI_PROJECT_URL}`,digest:{sha1:vt.CI_COMMIT_SHA}}]}}}else throw new Lt(91,"Provenance generation is only supported in GitHub Actions and GitLab CI");return qDe.attest(Buffer.from(JSON.stringify(r)),Yvt,t)};async function eSt(e,t,{access:r,tag:s,registry:a,gitHead:n,provenance:c}){let f=e.manifest.name,p=e.manifest.version,h=H.stringifyIdent(f),E=WDe.default.fromData(t,{algorithms:["sha1","sha512"]}),C=r??VDe(e,f),S=await KDe(e),x=await CA.genPackageManifest(e),I=`${h}-${p}.tgz`,R=new URL(`${Kc(a)}/${h}/-/${I}`),N={[I]:{content_type:"application/octet-stream",data:t.toString("base64"),length:t.length}};if(c){let U={name:`pkg:npm/${h.replace(/^@/,"%40")}@${p}`,digest:{sha512:E.sha512[0].hexDigest()}},K=await YDe([U]),$=JSON.stringify(K);N[`${h}-${p}.sigstore`]={content_type:K.mediaType,data:$,length:$.length}}return{_id:h,_attachments:N,name:h,access:C,"dist-tags":{[s]:p},versions:{[p]:{...x,_id:`${h}@${p}`,name:h,version:p,gitHead:n,dist:{shasum:E.sha1[0].hexDigest(),integrity:E.sha512[0].toString(),tarball:R.toString()}}},readme:S}}async function tSt(e){try{let{stdout:t}=await Yr.execvp("git",["rev-parse","--revs-only","HEAD"],{cwd:e});return t.trim()===""?void 0:t.trim()}catch{return}}fu
Line truncated
|
||||
`;try{a=await ae.readFilePromise(t,"utf8")}catch(n){if(n.code==="ENOENT")return a;throw n}return a}var pJ={npmAlwaysAuth:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"BOOLEAN",default:!1},npmAuthIdent:{description:"Authentication identity for the npm registry (_auth in npm and yarn v1)",type:"SECRET",default:null},npmAuthToken:{description:"Authentication token for the npm registry (_authToken in npm and yarn v1)",type:"SECRET",default:null}},JDe={npmAuditRegistry:{description:"Registry to query for audit reports",type:"STRING",default:null},npmPublishRegistry:{description:"Registry to push packages to",type:"STRING",default:null},npmRegistryServer:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"STRING",default:"https://registry.yarnpkg.com"}},zDe={npmMinimalAgeGate:{description:"Minimum age of a package version according to the publish date on the npm registry to be considered for installation",type:"DURATION",unit:"m",default:"1d"}},rSt={npmPreapprovedPackages:{description:"Array of package descriptors or package name glob patterns to exclude from the minimum release age check",type:"STRING",isArray:!0,default:[]}},nSt={configuration:{...pJ,...JDe,...zDe,...rSt,npmScopes:{description:"Settings per package scope",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{...pJ,...JDe,...zDe}}},npmRegistries:{description:"Settings per registry",type:"MAP",normalizeKeys:Kc,valueDefinition:{description:"",type:"SHAPE",properties:{...pJ}}}},fetchers:[$b,ah],resolvers:[eD,tD,rD]},iSt=nSt;var vJ={};Vt(vJ,{NpmAuditCommand:()=>C1,NpmInfoCommand:()=>w1,NpmLoginCommand:()=>B1,NpmLogoutCommand:()=>S1,NpmPublishCommand:()=>b1,NpmStageApproveCommand:()=>D1,NpmStageListCommand:()=>P1,NpmStageRejectCommand:()=>x1,NpmTagAddCommand:()=>Q1,NpmTagListCommand:()=>k1,NpmTagRemoveCommand:()=>T1,NpmWhoamiCommand:()=>R1,default:()=>mSt,npmAuditTypes:()=>tP,npmAuditUtils:()=>wL});Ge();Ge();jt();var EJ=et(Zo());Jo();var tP={};Vt(tP,{Environment:()=>$D,Severity:()=>eP});var $D=(s=>(s.All="all",s.Production="production",s.Development="development",s))($D||{}),eP=(n=>(n.Info="info",n.Low="low",n.Moderate="moderate",n.High="high",n.Critical="critical",n))(eP||{});var wL={};Vt(wL,{allSeverities:()=>I1,getPackages:()=>yJ,getReportTree:()=>gJ,getSeverityInclusions:()=>dJ,getTopLevelDependencies:()=>mJ});Ge();var ZDe=et(hi());var I1=["info","low","moderate","high","critical"];function dJ(e){if(typeof e>"u")return new Set(I1);let t=I1.indexOf(e),r=I1.slice(t);return new Set(r)}function gJ(e){let t={},r={children:t};for(let[s,a]of qe.sortMap(Object.entries(e),n=>n[0]))for(let n of qe.sortMap(a,c=>`${c.id}`))t[`${s}/${n.id}`]={value:ue.tuple(ue.Type.IDENT,H.parseIdent(s)),children:{ID:typeof n.id<"u"&&{label:"ID",value:ue.tuple(ue.Type.ID,n.id)},Issue:{label:"Issue",value:ue.tuple(ue.Type.NO_HINT,n.title)},URL:typeof n.url<"u"&&{label:"URL",value:ue.tuple(ue.Type.URL,n.url)},Severity:{label:"Severity",value:ue.tuple(ue.Type.NO_HINT,n.severity)},"Vulnerable Versions":{label:"Vulnerable Versions",value:ue.tuple(ue.Type.RANGE,n.vulnerable_versions)},"Tree Versions":{label:"Tree Versions",children:[...n.versions].sort(ZDe.default.compare).map(c=>({value:ue.tuple(ue.Type.REFERENCE,c)}))},Dependents:{label:"Dependents",children:qe.sortMap(n.dependents,c=>H.stringifyLocator(c)).map(c=>({value:ue.tuple(ue.Type.LOCATOR,c)}))}}};return r}function mJ(e,t,{all:r,environment:s}){let a=[],n=r?e.workspaces:[t],c=["all","production"].includes(s),f=["all","development"].includes(s);for(let p of n)for(let h of p.anchoredPackage.dependencies.values())(p.manifest.devDependencies.has(h.identHash)?!f:!c)||a.push({workspace:p,dependency:h});return a}function yJ(e,t,{recursive:r}){let s=new Map,a=new Set,n=[],c=e.configuration.makeResolver(),f={project:e,resolver:c},p=(h,E)=>{let C=e.storedResolutions.get(E.descriptorHash);if(typeof C>"u")throw new Error("Assertion failed: The resolution should have been registered");if(!a.has(C))a.add(C);else return;let S=e.storedPackages.get(C);if(typeof S>"u")throw new Error("Assertion failed: The package should have been registered");let x=H.ensureDevirtualizedDescriptor(E);if(c.supportsDescriptor(x,f)){let R=c.getResolutionDependencies(x,f);if(Object.keys(R).length>0)for(let N of Object.values(R))p(h,N)}if(H.ensureDevirtualizedLocator(S).reference.startsWith("npm:")&&S.version!==null){let R=H.stringifyIdent(S),N=qe.getMapWithDefault(s,R);qe.getArrayWithDefault(N,S.version).push(h)}if(r)for(let R of S.dependencies.values())n.push([S,R])};for(let{workspace:h,dependency:E}of t)n.push([h.anchoredLocator,E]);for(;n.length>0;){let[h,E]=n.shift();p(h,E)}return s}var C1=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Audit dependencies from all workspaces"});this.recursive=he.Boolean("-R,--recursive",!1,{description:"Audit transitive dependencies as well"});this.environment=he.String("
Line truncated
|
||||
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
|
||||
|
||||
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
|
||||
|
||||
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${I1.map(r=>`\`${r}\``).join(", ")}.
|
||||
|
||||
If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
|
||||
|
||||
If certain packages produce false positives for a particular environment, the \`--exclude\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \`npmAuditExcludePackages\` option.
|
||||
|
||||
If particular advisories are needed to be ignored, the \`--ignore\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \`npmAuditIgnoreAdvisories\` option.
|
||||
|
||||
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why package\` to get more information as to who depends on them.
|
||||
`,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=mJ(s,a,{all:this.all,environment:this.environment}),c=yJ(s,n,{recursive:this.recursive}),f=Array.from(new Set([...r.get("npmAuditExcludePackages"),...this.excludes])),p=Object.create(null);for(let[N,U]of c)f.some(K=>EJ.default.isMatch(N,K))||(p[N]=[...U.keys()]);let h=gn.getAuditRegistry({configuration:r}),E,C=await fA.start({configuration:r,stdout:this.context.stdout},async()=>{let N=Qr.post("/-/npm/v1/security/advisories/bulk",p,{authType:Qr.AuthType.BEST_EFFORT,configuration:r,jsonResponse:!0,registry:h}),U=this.noDeprecations?[]:await Promise.all(Array.from(Object.entries(p),async([$,ie])=>{let fe=await Qr.getPackageMetadata(H.parseIdent($),{project:s});return qe.mapAndFilter(ie,le=>{let{deprecated:ge}=fe.versions[le];return ge?[$,le,ge]:qe.mapAndFilter.skip})})),K=await N;for(let[$,ie,fe]of U.flat(1))Object.hasOwn(K,$)&&K[$].some(le=>kr.satisfiesWithPrereleases(ie,le.vulnerable_versions))||(K[$]??=[],K[$].push({id:`${$} (deprecation)`,title:(typeof fe=="string"?fe:"").trim()||"This package has been deprecated.",severity:"moderate",vulnerable_versions:ie}));E=K});if(C.hasErrors())return C.exitCode();let S=dJ(this.severity),x=Array.from(new Set([...r.get("npmAuditIgnoreAdvisories"),...this.ignores])),I=Object.create(null);for(let[N,U]of Object.entries(E)){let K=U.filter($=>!EJ.default.isMatch(`${$.id}`,x)&&S.has($.severity));K.length>0&&(I[N]=K.map($=>{let ie=c.get(N);if(typeof ie>"u")throw new Error("Assertion failed: Expected the registry to only return packages that were requested");let fe=[...ie.keys()].filter(ge=>kr.satisfiesWithPrereleases(ge,$.vulnerable_versions)),le=new Map;for(let ge of fe)for(let pe of ie.get(ge))le.set(pe.locatorHash,pe);return{...$,versions:fe,dependents:[...le.values()]}}))}let R=Object.keys(I).length>0;return R?(ts.emitTree(gJ(I),{configuration:r,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Ft.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async N=>{N.reportInfo(1,"No audit suggestions")}),R?1:0)}};Ge();Ge();bt();jt();var IJ=et(hi()),CJ=Ce("util"),w1=class extends ft{constructor(){super(...arguments);this.fields=he.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=he.Rest()}static{this.paths=[["npm","info"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versi
Line truncated
|
||||
`),this.context.stdout.write(`${(0,CJ.inspect)(p,{depth:1/0,colors:!0,compact:!1})}
|
||||
`);return f.exitCode()}};function wJ(e){if(Array.isArray(e)){let t=[];for(let r of e)r=wJ(r),r&&t.push(r);return t}else if(typeof e=="object"&&e!==null){let t={};for(let r of Object.keys(e)){if(r.startsWith("_"))continue;let s=wJ(e[r]);s&&(t[r]=s)}return t}else return e||null}Ge();Ge();jt();var BJ=et(Xv()),B1=class extends ft{constructor(){super(...arguments);this.scope=he.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=he.Boolean("--publish",!1,{description:"Login to the publish registry"});this.alwaysAuth=he.Boolean("--always-auth",{description:"Set the npmAlwaysAuth configuration"});this.webLogin=he.Boolean("--web-login",{description:"Enable web login"})}static{this.paths=[["npm","login"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=await BL({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Ft.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let c=await cSt({registry:s,configuration:r,report:n,webLogin:this.webLogin,stdin:this.context.stdin,stdout:this.context.stdout});return await fSt(s,c,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,"Successfully logged in")})).exitCode()}};async function BL({scope:e,publish:t,configuration:r,cwd:s}){return e&&t?gn.getScopeRegistry(e,{configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY}):e?gn.getScopeRegistry(e,{configuration:r}):t?gn.getPublishRegistry((await VI(r,s)).manifest,{configuration:r}):gn.getDefaultRegistry({configuration:r})}async function sSt(e,t){let r;try{r=await Qr.post("/-/v1/login",null,{configuration:t,registry:e,authType:Qr.AuthType.NO_AUTH,jsonResponse:!0,headers:{"npm-auth-type":"web"}})}catch{return null}return r}async function oSt(e,t){let r=await nn.request(e,null,{configuration:t,jsonResponse:!0});if(r.statusCode===202){let s=r.headers["retry-after"]??"1";return{type:"waiting",sleep:parseInt(s,10)}}return r.statusCode===200?{type:"success",token:r.body.token}:null}async function aSt({registry:e,configuration:t,report:r}){let s=await sSt(e,t);if(!s)return null;if(Ui.openUrl){r.reportInfo(0,"Starting the web login process..."),r.reportSeparator();let{openNow:a}=await(0,BJ.prompt)({type:"confirm",name:"openNow",message:"Do you want to try to open your browser now?",required:!0,initial:!0,onCancel:()=>process.exit(130)});r.reportSeparator(),(!a||!await Ui.openUrl(s.loginUrl))&&(r.reportWarning(0,"We failed to automatically open the url; you'll have to open it yourself in your browser of choice:"),r.reportWarning(0,ue.pretty(t,s.loginUrl,ue.Type.URL)),r.reportSeparator())}for(;;){let a=await oSt(s.doneUrl,t);if(a===null)return null;if(a.type==="waiting")await new Promise(n=>setTimeout(n,a.sleep*1e3));else return a.token}}var lSt=["https://registry.yarnpkg.com","https://registry.npmjs.org"];async function cSt(e){if(e.webLogin??lSt.includes(e.registry)){let t=await aSt(e);if(t!==null)return t}return await uSt(e)}async function uSt({registry:e,configuration:t,report:r,stdin:s,stdout:a}){let n=await ASt({configuration:t,registry:e,report:r,stdin:s,stdout:a}),c=`/-/user/org.couchdb.user:${encodeURIComponent(n.name)}`,f={_id:`org.couchdb.user:${n.name}`,name:n.name,password:n.password,type:"user",roles:[],date:new Date().toISOString()},p={attemptedAs:n.name,configuration:t,registry:e,jsonResponse:!0,authType:Qr.AuthType.NO_AUTH};try{return(await Qr.put(c,f,p)).token}catch(x){if(!(x.originalError?.name==="HTTPError"&&x.originalError?.response.statusCode===409))throw x}let h={...p,authType:Qr.AuthType.NO_AUTH,headers:{authorization:`Basic ${Buffer.from(`${n.name}:${n.password}`).toString("base64")}`}},E=await Qr.get(c,h);for(let[x,I]of Object.entries(E))(!f[x]||x==="roles")&&(f[x]=I);let C=`${c}/-rev/${f._rev}`;return(await Qr.put(C,f,h)).token}async function fSt(e,t,{alwaysAuth:r,scope:s}){let a=c=>f=>{let p=qe.isIndexableObject(f)?f:{},h=p[c],E=qe.isIndexableObject(h)?h:{};return{...p,[c]:{...E,...r!==void 0?{npLine truncated
|
||||
This command will list all staged package versions awaiting approval on the npm registry.
|
||||
|
||||
If a package name is provided, only staged versions of that package will be listed.
|
||||
`,examples:[["List all staged packages","yarn npm stage list"],["List staged versions of a specific package","yarn npm stage list my-pkg"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=gn.getDefaultRegistry({configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY}),a=await dSt(r,s,this.package??void 0);if(await Ft.start({configuration:r,stdout:this.context.stdout,json:this.json,includeFooter:!1,includePrefix:!1},async c=>{a.length>0?(c.reportInfo(0,`The following packages are awaiting approval. Use ${ue.pretty(r,"yarn npm stage approve <stageId>",ue.Type.CODE)} to approve them.`),c.reportSeparator()):this.package?c.reportInfo(0,`No staged versions found for package ${this.package}`):c.reportInfo(0,"No staged packages found")}),a.length===0)return;let n={children:a.map(c=>{let f=H.parseIdent(c.packageName);return{value:ue.tuple(ue.Type.RESOLUTION,{descriptor:H.makeDescriptor(f,c.tag),locator:H.makeLocator(f,c.version)}),children:{ID:{label:"ID",value:ue.tuple(ue.Type.CODE,c.id)},Staged:{label:"Staged on",value:ue.tuple(ue.Type.NO_HINT,c.createdAt)}}}})};ts.emitTree(n,{configuration:r,json:this.json,stdout:this.context.stdout,separators:1})}};async function dSt(e,t,r){let s=[],a=0,n=100;for(;;){let c={page:String(a),perPage:String(n)};r&&(c.package=r);let f=new URLSearchParams(c).toString(),p=await Qr.get(`/-/stage?${f}`,{configuration:e,registry:t,jsonResponse:!0,authType:Qr.AuthType.ALWAYS_AUTH});if(s.push(...p.items),s.length>=p.total||p.items.length<n)break;a++}return s}Ge();jt();Jo();var x1=class extends ft{constructor(){super(...arguments);this.stageId=he.String({validator:ld(Jf(),[Sp(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)])});this.otp=he.String("--otp",{description:"The OTP token to use with the command"})}static{this.paths=[["npm","stage","reject"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"reject a staged package version",details:"\n This command will reject a staged package version, permanently removing it from the registry staging area. This operation requires 2FA and will prompt for an OTP token if one is not provided via the `--otp` flag.\n ",examples:[["Reject a staged package","yarn npm stage reject 1de6f3db-2ed9-4d72-b3dd-8f0e2b474a2f"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=gn.getDefaultRegistry({configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY});return(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let c=ue.pretty(r,this.stageId,ue.Type.CODE);n.reportInfo(0,`Rejecting staged package ${ue.pretty(r,c,ue.Type.CODE)}...`),n.reportSeparator(),await Qr.del(`/-/stage/${this.stageId}`,{configuration:r,registry:s,otp:this.otp,authType:Qr.AuthType.ALWAYS_AUTH}),n.reportInfo(0,`Staged package ${ue.pretty(r,c,ue.Type.CODE)} has been rejected.`)})).exitCode()}};Ge();jt();var $De=et(hi());Ge();bt();jt();var k1=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=he.String({required:!1})}static{this.paths=[["npm","tag","list"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:`
|
||||
This command will list all tags of a package from the npm registry.
|
||||
|
||||
If the package is not specified, Yarn will default to the current workspace.
|
||||
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n;if(typeof this.package<"u")n=H.parseIdent(this.package);else{if(!a)throw new ar(s.cwd,this.context.cwd);if(!a.manifest.name)throw new ot(`Missing 'name' field in ${Ae.fromPortablePath(Y.join(a.cwd,yr.manifest))}`);n=a.manifest.name}let c=await rP(n,r),p={children:qe.sortMap(Object.entries(c),([h])=>h).map(([h,E])=>({value:ue.tuple(ue.Type.RESOLUTION,{descriptor:H.makeDescriptor(n,h),locator:H.makeLocator(n,E)})}))};return ts.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function rP(e,t){let r=`/-/package${Qr.getIdentUrl(e)}/dist-tags`;return Qr.get(r,{configuration:t,ident:e,jsonResponse:!0,customErrorMessage:Qr.customPackageError})}var Q1=class extends ft{constructor(){super(...arguments);this.package=he.String();this.tag=he.String()}static{this.paths=[["npm","tag","add"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
|
||||
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
|
||||
`,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=H.parseDescriptor(this.package,!0),c=n.range;if(!$De.default.valid(c))throw new ot(`The range ${ue.pretty(r,n.range,ue.Type.RANGE)} must be a valid semver version`);let f=gn.getPublishRegistry(a.manifest,{configuration:r}),p=ue.pretty(r,n,ue.Type.IDENT),h=ue.pretty(r,c,ue.Type.RANGE),E=ue.pretty(r,this.tag,ue.Type.CODE);return(await Ft.start({configuration:r,stdout:this.context.stdout},async S=>{let x=await rP(n,r);Object.hasOwn(x,this.tag)&&x[this.tag]===c&&S.reportWarning(0,`Tag ${E} is already set to version ${h}`);let I=`/-/package${Qr.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Qr.put(I,c,{configuration:r,registry:f,ident:n,jsonRequest:!0,jsonResponse:!0}),S.reportInfo(0,`Tag ${E} added to version ${h} of package ${p}`)})).exitCode()}};Ge();jt();var T1=class extends ft{constructor(){super(...arguments);this.package=he.String();this.tag=he.String()}static{this.paths=[["npm","tag","remove"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
|
||||
This command will remove a tag from a package from the npm registry.
|
||||
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]})}async execute(){if(this.tag==="latest")throw new ot("The 'latest' tag cannot be removed.");let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=H.parseIdent(this.package),c=gn.getPublishRegistry(a.manifest,{configuration:r}),f=ue.pretty(r,this.tag,ue.Type.CODE),p=ue.pretty(r,n,ue.Type.IDENT),h=await rP(n,r);if(!Object.hasOwn(h,this.tag))throw new ot(`${f} is not a tag of package ${p}`);return(await Ft.start({configuration:r,stdout:this.context.stdout},async C=>{let S=`/-/package${Qr.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Qr.del(S,{configuration:r,registry:c,ident:n,jsonResponse:!0}),C.reportInfo(0,`Tag ${f} removed from package ${p}`)})).exitCode()}};Ge();Ge();jt();var R1=class extends ft{constructor(){super(...arguments);this.scope=he.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=he.Boolean("--publish",!1,{description:"Print username for the publish registry"})}static{this.paths=[["npm","whoami"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s;return this.scope&&this.publish?s=gn.getScopeRegistry(this.scope,{configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY}):this.scope?s=gn.getScopeRegistry(this.scope,{configuration:r}):this.publish?s=gn.getPublishRegistry((await VI(r,this.context.cwd)).manifest,{configuration:r}):s=gn.getDefaultRegistry({configuration:r}),(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let c;try{c=await Qr.get("/-/whoami",{configuration:r,registry:s,authType:Qr.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?H.makeIdent(this.scope,""):void 0})}catch(f){if(f.response?.statusCode===401||f.response?.statusCode===403){n.reportError(41,"Authentication failed - your credentials may have expired");return}else throw f}n.reportInfo(0,c.username)})).exitCode()}};var gSt={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmPublishProvenance:{description:"Whether to generate provenance for the published packages",type:"BOOLEAN",default:!1},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[C1,w1,B1,S1,b1,D1,P1,x1,Q1,k1,T1,R1]},mSt=gSt;var QJ={};Vt(QJ,{PatchCommand:()=>U1,PatchCommitCommand:()=>M1,PatchFetcher:()=>aP,PatchResolver:()=>lP,default:()=>OSt,patchUtils:()=>Cy});Ge();Ge();bt();iA();var Cy={};Vt(Cy,{applyPatchFile:()=>SL,diffFolders:()=>xJ,ensureUnpatchedDescriptor:()=>SJ,ensureUnpatchedLocator:()=>DL,extractPackageToDisk:()=>PJ,extractPatchFlags:()=>oPe,isParentRequired:()=>DJ,isPatchDescriptor:()=>bL,isPatchLocator:()=>Fg,loadPatchFiles:()=>oP,makeDescriptor:()=>PL,makeLocator:()=>bJ,makePatchHash:()=>kJ,parseDescriptor:()=>iP,parseLocator:()=>sP,parsePatchFile:()=>nP,unpatchDescriptor:()=>TSt,unpatchLocator:()=>RSt});Ge();bt();Ge();bt();var ySt=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function F1(e){return Y.relative(wt.root,Y.resolve(wt.root,Ae.toPortablePath(e)))}function ESt(e){let t=e.trim().match(ySt);if(!t)throw new Error(`Bad header line: '${e}'`);return{original:{start:Math.max(Number(t[1]),1),length:Number(t[3]||1)},patched:{start:Math.max(Number(t[4]),1),length:Number(t[6]||1)}}}var ISt=420,CSt=493;var ePe=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),wSt=e=>({header:ESt(e),parts:[]}),BSt={"@":"header","-":"deletion","+":"insertion"," ":"context","\\":"pragma",undefined:"context"};function vSt(e){leLine truncated
|
||||
`)+(a.hunk.parts[0].noNewlineAtEndOfFile?"":`
|
||||
`):"";await t.mkdirpPromise(Y.dirname(a.path),{chmod:493,utimes:[pi.SAFE_TIME,pi.SAFE_TIME]}),await t.writeFilePromise(a.path,n,{mode:a.mode}),await t.utimesPromise(a.path,pi.SAFE_TIME,pi.SAFE_TIME)}break;case"patch":await O1(t,a.path,async()=>{await xSt(a,{baseFs:t,dryRun:r})});break;case"mode change":{let c=(await t.statPromise(a.path)).mode;if(tPe(a.newMode)!==tPe(c))continue;await O1(t,a.path,async()=>{await t.chmodPromise(a.path,a.newMode)})}break;default:qe.assertNever(a);break}}function tPe(e){return(e&64)>0}function rPe(e){return e.replace(/\s+$/,"")}function PSt(e,t){return rPe(e)===rPe(t)}async function xSt({hunks:e,path:t},{baseFs:r,dryRun:s=!1}){let a=await r.statSync(t).mode,c=(await r.readFileSync(t,"utf8")).split(/\n/),f=[],p=0,h=0;for(let C of e){let S=Math.max(h,C.header.patched.start+p),x=Math.max(0,S-h),I=Math.max(0,c.length-S-C.header.original.length),R=Math.max(x,I),N=0,U=0,K=null;for(;N<=R;){if(N<=x&&(U=S-N,K=nPe(C,c,U),K!==null)){N=-N;break}if(N<=I&&(U=S+N,K=nPe(C,c,U),K!==null))break;N+=1}if(K===null)throw new N1(e.indexOf(C),C);f.push(K),p+=N,h=U+C.header.original.length}if(s)return;let E=0;for(let C of f)for(let S of C)switch(S.type){case"splice":{let x=S.index+E;c.splice(x,S.numToDelete,...S.linesToInsert),E+=S.linesToInsert.length-S.numToDelete}break;case"pop":c.pop();break;case"push":c.push(S.line);break;default:qe.assertNever(S);break}await r.writeFilePromise(t,c.join(`
|
||||
`),{mode:a})}function nPe(e,t,r){let s=[];for(let a of e.parts)switch(a.type){case"context":case"deletion":{for(let n of a.lines){let c=t[r];if(c==null||!PSt(c,n))return null;r+=1}a.type==="deletion"&&(s.push({type:"splice",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&s.push({type:"push",line:""}))}break;case"insertion":s.push({type:"splice",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&s.push({type:"pop"});break;default:qe.assertNever(a.type);break}return s}var QSt=/^builtin<([^>]+)>$/;function L1(e,t){let{protocol:r,source:s,selector:a,params:n}=H.parseRange(e);if(r!=="patch:")throw new Error("Invalid patch range");if(s===null)throw new Error("Patch locators must explicitly define their source");let c=a?a.split(/&/).map(E=>Ae.toPortablePath(E)):[],f=n&&typeof n.locator=="string"?H.parseLocator(n.locator):null,p=n&&typeof n.version=="string"?n.version:null,h=t(s);return{parentLocator:f,sourceItem:h,patchPaths:c,sourceVersion:p}}function bL(e){return e.range.startsWith("patch:")}function Fg(e){return e.reference.startsWith("patch:")}function iP(e){let{sourceItem:t,...r}=L1(e.range,H.parseDescriptor);return{...r,sourceDescriptor:t}}function sP(e){let{sourceItem:t,...r}=L1(e.reference,H.parseLocator);return{...r,sourceLocator:t}}function TSt(e){let{sourceItem:t}=L1(e.range,H.parseDescriptor);return t}function RSt(e){let{sourceItem:t}=L1(e.reference,H.parseLocator);return t}function SJ(e){if(!bL(e))return e;let{sourceItem:t}=L1(e.range,H.parseDescriptor);return t}function DL(e){if(!Fg(e))return e;let{sourceItem:t}=L1(e.reference,H.parseLocator);return t}function iPe({parentLocator:e,sourceItem:t,patchPaths:r,sourceVersion:s,patchHash:a},n){let c=e!==null?{locator:H.stringifyLocator(e)}:{},f=typeof s<"u"?{version:s}:{},p=typeof a<"u"?{hash:a}:{};return H.makeRange({protocol:"patch:",source:n(t),selector:r.join("&"),params:{...f,...p,...c}})}function PL(e,{parentLocator:t,sourceDescriptor:r,patchPaths:s}){return H.makeDescriptor(e,iPe({parentLocator:t,sourceItem:r,patchPaths:s},H.stringifyDescriptor))}function bJ(e,{parentLocator:t,sourcePackage:r,patchPaths:s,patchHash:a}){return H.makeLocator(e,iPe({parentLocator:t,sourceItem:r,sourceVersion:r.version,patchPaths:s,patchHash:a},H.stringifyLocator))}function sPe({onAbsolute:e,onRelative:t,onProject:r,onBuiltin:s},a){let n=a.lastIndexOf("!");n!==-1&&(a=a.slice(n+1));let c=a.match(QSt);return c!==null?s(c[1]):a.startsWith("~/")?r(a.slice(2)):Y.isAbsolute(a)?e(a):t(a)}function oPe(e){let t=e.lastIndexOf("!");return{optional:(t!==-1?new Set(e.slice(0,t).split(/!/)):new Set).has("optional")}}function DJ(e){return sPe({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},e)}async function oP(e,t,r){let s=e!==null?await r.fetcher.fetch(e,r):null,a=s&&s.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.root,s.localPath)}:s;s&&s!==a&&s.releaseFs&&s.releaseFs();let n=await qe.releaseAfterUseAsync(async()=>await Promise.all(t.map(async c=>{let f=oPe(c),p=await sPe({onAbsolute:async h=>await ae.readFilePromise(h,"utf8"),onRelative:async h=>{if(a===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await a.packageFs.readFilePromise(Y.join(a.prefixPath,h),"utf8")},onProject:async h=>await ae.readFilePromise(Y.join(r.project.cwd,h),"utf8"),onBuiltin:async h=>await r.project.configuration.firstHook(E=>E.getBuiltinPatch,r.project,h)},c);return{...f,source:p}})));for(let c of n)typeof c.source=="string"&&(c.source=c.source.replace(/\r\n?/g,`
|
||||
`));return n}async function PJ(e,{cache:t,project:r}){let s=r.storedPackages.get(e.locatorHash);if(typeof s>"u")throw new Error("Assertion failed: Expected the package to be registered");let a=DL(e),n=r.storedChecksums,c=new Qi,f=await ae.mktempPromise(),p=Y.join(f,"source"),h=Y.join(f,"user"),E=Y.join(f,".yarn-patch.json"),C=r.configuration.makeFetcher(),S=[];try{let x,I;if(e.locatorHash===a.locatorHash){let R=await C.fetch(e,{cache:t,project:r,fetcher:C,checksums:n,report:c});S.push(()=>R.releaseFs?.()),x=R,I=R}else x=await C.fetch(e,{cache:t,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>x.releaseFs?.()),I=await C.fetch(e,{cache:t,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>I.releaseFs?.());await Promise.all([ae.copyPromise(p,x.prefixPath,{baseFs:x.packageFs}),ae.copyPromise(h,I.prefixPath,{baseFs:I.packageFs}),ae.writeJsonPromise(E,{locator:H.stringifyLocator(e),version:s.version})])}finally{for(let x of S)x()}return ae.detachTemp(f),h}async function xJ(e,t){let r=Ae.fromPortablePath(e).replace(/\\/g,"/"),s=Ae.fromPortablePath(t).replace(/\\/g,"/"),{stdout:a,stderr:n}=await Yr.execvp("git",["-c","core.safecrlf=false","-c","core.quotePath=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",r,s],{cwd:Ae.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
|
||||
The following error was reported by 'git':
|
||||
${n}`);let c=r.startsWith("/")?f=>f.slice(1):f=>f;return a.replace(new RegExp(`(a|b)(${qe.escapeRegExp(`/${c(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${qe.escapeRegExp(`/${c(s)}/`)}`,"g"),"$1/").replace(new RegExp(qe.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(qe.escapeRegExp(`${s}/`),"g"),"")}function kJ(e,t){let r=[];for(let{source:s}of e){if(s===null)continue;let a=nP(s);for(let n of a){let{semverExclusivity:c,...f}=n;c!==null&&t!==null&&!kr.satisfiesWithPrereleases(t,c)||r.push(JSON.stringify(f))}}return Mn.makeHash(`${3}`,...r).slice(0,6)}Ge();function aPe(e,{configuration:t,report:r}){for(let s of e.parts)for(let a of s.lines)switch(s.type){case"context":r.reportInfo(null,` ${ue.pretty(t,a,"grey")}`);break;case"deletion":r.reportError(28,`- ${ue.pretty(t,a,ue.Type.REMOVED)}`);break;case"insertion":r.reportError(28,`+ ${ue.pretty(t,a,ue.Type.ADDED)}`);break;default:qe.assertNever(s.type)}}function FSt(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}var aP=class{supports(t,r){return!!Fg(t)}getLocalPath(t,r){return null}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${H.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:H.getIdentVendorPath(t),localPath:this.getLocalPath(t,r),checksum:c}}async patchPackage(t,r){let{parentLocator:s,sourceLocator:a,sourceVersion:n,patchPaths:c}=sP(t),f=await oP(s,c,r),p=await ae.mktempPromise(),h=Y.join(p,"current.zip"),E=await r.fetcher.fetch(a,r),C=H.getIdentVendorPath(t),S=new hs(h,{create:!0,level:r.project.configuration.get("compressionLevel")});await qe.releaseAfterUseAsync(async()=>{await S.copyPromise(C,E.prefixPath,{baseFs:E.packageFs,stableSort:!0})},E.releaseFs),S.saveAndClose();for(let{source:x,optional:I}of f){if(x===null)continue;let R=new hs(h,{level:r.project.configuration.get("compressionLevel")}),N=new Pn(Y.resolve(wt.root,C),{baseFs:R});try{await SL(nP(x),{baseFs:N,version:n})}catch(U){let K=U instanceof N1?U:null;if(!(K!==null||I&&FSt(U)))throw U;let ie=r.project.configuration.get("enableInlineHunks"),fe=K!==null&&!ie&&!I?" (set enableInlineHunks for details)":"",le=`${H.prettyLocator(r.project.configuration,t)}: ${U.message}${fe}`,ge=pe=>{K===null||!ie||aPe(K.hunk,{configuration:r.project.configuration,report:pe})};if(R.discardAndClose(),I){r.report.reportWarningOnce(66,le,{reportExtra:ge});continue}else throw new Lt(66,le,ge)}R.saveAndClose()}return new hs(h,{level:r.project.configuration.get("compressionLevel")})}};Ge();var lP=class{supportsDescriptor(t,r){return!!bL(t)}supportsLocator(t,r){return!!Fg(t)}shouldPersistResolution(t,r){return!1}bindDescriptor(t,r,s){let{patchPaths:a}=iP(t);return a.every(n=>!DJ(n))?t:H.bindDescriptor(t,{locator:H.stringifyLocator(r)})}getResolutionDependencies(t,r){let{sourceDescriptor:s}=iP(t);return{sourceDescriptor:r.project.configuration.normalizeDependency(s)}}async getCandidates(t,r,s){if(!s.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:a,patchPaths:n}=iP(t),c=await oP(a,n,s.fetchOptions),f=r.sourceDescriptor;if(typeof f>"u")throw new Error("Assertion failed: The dependency should have been resolved");let p=kJ(c,f.version);return[bJ(t,{parentLocator:a,sourcePackage:f,patchPaths:n,patchHash:p})]}async getSatisfying(t,r,s,a){let[n]=await this.getCandidates(t,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(t,r){let{sourceLocator:s}=sP(t);return{...await r.resolver.resolve(s,r),...t}}};Ge();bt();jt();var M1=class extends ft{constructor(){super(...arguments);this.save=he.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=he.String()}static{this.paths=[["patch-commit"]]}static{this.usage=st.Usage({description:"generate a patch out of a directory",details:"\n By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of the package. Such file is suitable for consumption with the `patch:` protocol.\n\n With the `-s,--save` option set, the patchfile won't be printed on stdout anymore and will instead be stored within a local file (by default kept within `.yarn/patches`, but configurable via the `patchFolder` setting). A `resolutions` entry will also be added to your top-level manifest, referencing the patched package via the `patch:` protocol.\n\n Note that only folders generated by `yarn patch` are accepted as valid input for `yarn patch-commit`.\n "})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=Y.resoLine truncated
|
||||
${f.map(p=>`
|
||||
- ${H.prettyLocator(r,p)}`).join("")}`);c=f[0]}if(!s.storedPackages.has(c.locatorHash))throw new ot("No package found in the project for the given locator");await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=DL(c),h=await PJ(c,{cache:n,project:s});f.reportJson({locator:H.stringifyLocator(p),path:Ae.fromPortablePath(h)});let E=this.update?" along with its current modifications":"";f.reportInfo(0,`Package ${H.prettyLocator(r,p)} got extracted with success${E}!`),f.reportInfo(0,`You can now edit the following folder: ${ue.pretty(r,Ae.fromPortablePath(h),"magenta")}`),f.reportInfo(0,`Once you are done run ${ue.pretty(r,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${Ae.fromPortablePath(h)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};var NSt={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:"BOOLEAN",default:!1},patchFolder:{description:"Folder where the patch files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/patches"}},commands:[M1,U1],fetchers:[aP],resolvers:[lP]},OSt=NSt;var FJ={};Vt(FJ,{PnpmLinker:()=>uP,default:()=>GSt});Ge();bt();jt();var lPe=".package-map.json",uP=class{getCustomDataKey(){return JSON.stringify({name:"PnpmLinker",version:3})}supportsPackage(t,r){return this.isEnabled(r)}async findPackageLocation(t,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new ot(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ue.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(t.locatorHash);if(typeof n>"u")throw new ot(`Couldn't find ${H.prettyLocator(r.project.configuration,t)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(t,r){if(!this.isEnabled(r))return null;let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new ot(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ue.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=t.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(n){let p=a.locatorByPath.get(n[1]);if(p)return p}let c=t,f=t;do{f=c,c=Y.dirname(f);let p=a.locatorByPath.get(f);if(p)return p}while(c!==f);return null}makeInstaller(t){return new TJ(t)}isEnabled(t){return t.project.configuration.get("nodeLinker")==="pnpm"}},TJ=class{constructor(t){this.opts=t;this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.packageMapNodesByLocator=new Map;this.asyncActions=new qe.AsyncActions(t.project.configuration.get("pnpmInstallConcurrency")),this.indexFolderPromise=sx(ae,{indexPath:Y.join(t.project.configuration.get("globalFolder"),"index")})}attachCustomData(t){}registerPackageMapNode(t,{packageLocation:r}){let s=APe(r);this.packageMapNodesByLocator.has(t)||this.packageMapNodesByLocator.set(t,{packageLocation:s,dependencies:new Map})}registerPackageMapDependency(t,r,s){if(!this.packageMapNodesByLocator.has(s.locatorHash))throw new Error(`Assertion failed: Expected the package to have been registered (${H.stringifyLocator(s)})`);t.dependencies.set(r,s.locatorHash)}async installPackage(t,r,s){switch(t.linkType){case"SOFT":return this.installPackageSoft(t,r,s);case"HARD":return this.installPackageHard(t,r,s)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(t,r,s){let a=Y.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(t)?Y.join(a,yr.nodeModules):null,c={packageLocation:a,dependenciesLocation:n};return this.customData.pathsByLocator.set(t.locatorHash,c),this.registerPackageMapNode(t.locatorHash,c),{packageLocation:a,buildRequest:null}}async installPackageHard(t,r,s){let a=LSt(t,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,H.stringifyLocator(t)),this.customData.pathsByLocator.set(t.locatorHash,a),this.registerPackageMapNode(t.locatorHash,a),s.holdFetchResult(this.asyncActions.set(t.locatorHash,async()=>{await ae.mkdirPromise(n,{recursive:!0}),await ae.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:"HardlinkFromIndex",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let f=H.isVirtualLocator(t)?H.devirtualizeLocator(t):t,p={manifest:await _t.tryFind(r.prefixPath,{baseFs:r.packageFs})??new _t,misc:{hasBindingGyp:yA.hasBindingGyp(r)}},h=this.opts.project.getDependencyMeta(f,t.version),E=yA.extractBuildRequest(t,p,h,{configuration:this.opts.project.configuration});return{packageLocation:n,buildRequest:E}}async attachInternalDependencies(t,r){if(this.opts.project.configuration.get("nodeLinker")!=="pnpm"||!uPe(t,{project:this.opts.project}))return;let s=this.Line truncated
|
||||
|
||||
${YSt}
|
||||
`,"--",...s],{cwd:e,strict:!0})},async makeReset(e,t){let r=t.map(s=>Ae.fromPortablePath(s.path));await Yr.execvp("git",["reset","HEAD","--",...r],{cwd:e,strict:!0})}};var zSt=[dPe],_1=class extends ft{constructor(){super(...arguments);this.commit=he.Boolean("-c,--commit",!1,{description:"Commit the staged files"});this.reset=he.Boolean("-r,--reset",!1,{description:"Remove all files from the staging area"});this.dryRun=he.Boolean("-n,--dry-run",!1,{description:"Print the commit message and the list of modified files without staging / committing"});this.update=he.Boolean("-u,--update",!1,{hidden:!0})}static{this.paths=[["stage"]]}static{this.usage=st.Usage({description:"add all yarn files to your vcs",details:"\n This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\n\n Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\n\n Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\n ",examples:[["Adds all modified project files to the staging area","yarn stage"],["Creates a new commit containing all modified project files","yarn stage --commit"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),{driver:a,root:n}=await ZSt(s.cwd),c=[r.get("cacheFolder"),r.get("globalFolder"),r.get("virtualFolder"),r.get("yarnPath")];await r.triggerHook(C=>C.populateYarnPaths,s,C=>{c.push(C)});let f=new Set;for(let C of c)for(let S of XSt(n,C))f.add(S);let p=new Set([r.get("rcFilename"),yr.lockfile,yr.manifest]),h=await a.filterChanges(n,f,p),E=await a.genCommitMessage(n,h);if(this.dryRun)if(this.commit)this.context.stdout.write(`${E}
|
||||
`);else for(let C of h)this.context.stdout.write(`${Ae.fromPortablePath(C.path)}
|
||||
`);else if(this.reset){let C=await a.filterChanges(n,f,p,{staged:!0});C.length===0?this.context.stdout.write("No staged changes found!"):await a.makeReset(n,C)}else h.length===0?this.context.stdout.write("No changes found!"):this.commit?await a.makeCommit(n,h,E):(await a.makeStage(n,h),this.context.stdout.write(E))}};async function ZSt(e){let t=null,r=null;for(let s of zSt)if((r=await s.findRoot(e))!==null){t=s;break}if(t===null||r===null)throw new ot("No stage driver has been found for your current project");return{driver:t,root:r}}function XSt(e,t){let r=[];if(t===null)return r;for(;;){(t===e||t.startsWith(`${e}/`))&&r.push(t);let s;try{s=ae.statSync(t)}catch{break}if(s.isSymbolicLink())t=Y.resolve(Y.dirname(t),ae.readlinkSync(t));else break}return r}var $St={commands:[_1]},ebt=$St;var jJ={};Vt(jJ,{default:()=>lbt});Ge();Ge();bt();var yPe=et(hi());Ge();var gPe=et(q9()),tbt="e8e1bd300d860104bb8c58453ffa1eb4",rbt="OFCNCOG2CU",mPe=async(e,t)=>{let r=H.stringifyIdent(e),a=nbt(t).initIndex("npm-search");try{return(await a.getObject(r,{attributesToRetrieve:["types"]})).types?.ts==="definitely-typed"}catch{return!1}},nbt=e=>(0,gPe.default)(rbt,tbt,{requester:{async send(r){try{let s=await nn.request(r.url,r.data||null,{configuration:e,headers:r.headers});return{content:s.body,isTimedOut:!1,status:s.statusCode}}catch(s){return{content:s.response.body,isTimedOut:!1,status:s.response.statusCode}}}}});var EPe=e=>e.scope?`${e.scope}__${e.name}`:`${e.name}`,ibt=async(e,t,r,s)=>{if(r.scope==="types")return;let{project:a}=e,{configuration:n}=a;if(!(n.get("tsEnableAutoTypes")??(ae.existsSync(Y.join(e.cwd,"tsconfig.json"))||ae.existsSync(Y.join(a.cwd,"tsconfig.json")))))return;let f=n.makeResolver(),p={project:a,resolver:f,report:new Qi};if(!await mPe(r,n))return;let E=EPe(r),C=H.parseRange(r.range).selector;if(!kr.validRange(C)){let N=n.normalizeDependency(r),U=await f.getCandidates(N,{},p);C=H.parseRange(U[0].reference).selector}let S=yPe.default.coerce(C);if(S===null)return;let x=`${ef.Modifier.CARET}${S.major}`,I=H.makeDescriptor(H.makeIdent("types",E),x),R=qe.mapAndFind(a.workspaces,N=>{let U=N.manifest.dependencies.get(r.identHash)?.descriptorHash,K=N.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&K!==r.descriptorHash)return qe.mapAndFind.skip;let $=[];for(let ie of _t.allDependencies){let fe=N.manifest[ie].get(I.identHash);typeof fe>"u"||$.push([ie,fe])}return $.length===0?qe.mapAndFind.skip:$});if(typeof R<"u")for(let[N,U]of R)e.manifest[N].set(U.identHash,U);else{try{let N=n.normalizeDependency(I);if((await f.getCandidates(N,{},p)).length===0)return}catch{return}e.manifest[ef.Target.DEVELOPMENT].set(I.identHash,I)}},sbt=async(e,t,r)=>{if(r.scope==="types")return;let{project:s}=e,{configuration:a}=s;if(!(a.get("tsEnableAutoTypes")??(ae.existsSync(Y.join(e.cwd,"tsconfig.json"))||ae.existsSync(Y.join(s.cwd,"tsconfig.json")))))return;let c=EPe(r),f=H.makeIdent("types",c);for(let p of _t.allDependencies)typeof e.manifest[p].get(f.identHash)>"u"||e.manifest[p].delete(f.identHash)},obt=(e,t)=>{t.publishConfig&&t.publishConfig.typings&&(t.typings=t.publishConfig.typings),t.publishConfig&&t.publishConfig.types&&(t.types=t.publishConfig.types)},abt={configuration:{tsEnableAutoTypes:{description:"Whether Yarn should auto-install @types/ dependencies on 'yarn add'",type:"BOOLEAN",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:ibt,afterWorkspaceDependencyRemoval:sbt,beforeWorkspacePacking:obt}},lbt=abt;var VJ={};Vt(VJ,{VersionApplyCommand:()=>q1,VersionCheckCommand:()=>Y1,VersionCommand:()=>W1,default:()=>pbt,versionUtils:()=>G1});Ge();Ge();jt();var G1={};Vt(G1,{Decision:()=>H1,applyPrerelease:()=>IPe,applyReleases:()=>WJ,applyStrategy:()=>fP,clearVersionFiles:()=>GJ,getUndecidedDependentWorkspaces:()=>pP,getUndecidedWorkspaces:()=>TL,openVersionFile:()=>j1,requireMoreDecisions:()=>ubt,resolveVersionFiles:()=>AP,suggestStrategy:()=>YJ,updateVersionFiles:()=>qJ,validateReleaseDecision:()=>wy});Ge();bt();Sc();jt();Zl();var RA=et(hi()),cbt=/^(>=|[~^]|)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/,H1=(h=>(h.UNDECIDED="undecided",h.DECLINE="decline",h.MAJOR="major",h.MINOR="minor",h.PATCH="patch",h.PREMAJOR="premajor",h.PREMINOR="preminor",h.PREPATCH="prepatch",h.PRERELEASE="prerelease",h))(H1||{});function wy(e){let t=RA.default.valid(e);return t||qe.validateEnum(x4(H1,"UNDECIDED"),e)}async function AP(e,{prerelease:t=null}={}){let r=new Map,s=e.configuration.get("deferredVersionFolder");if(!ae.existsSync(s))return r;let a=await ae.readdirPromise(s);for(let n of a){if(!n.endsWith(".yml"))continue;let c=Y.join(s,n),f=await ae.readFilePromise(c,"utf8"),p=us(f);for(let[h,E]of Object.entries(p.releases||{})){if(E==="decline")continue;let C=H.parseIdent(h),S=e.tryWorkspaceByIdent(C);if(S===null)throw new Error(`Assertion failed: Expected a release definition fiLine truncated
|
||||
- ${f.map(x=>Ae.fromPortablePath(x)).join(`
|
||||
- `)}`);let p=new Set(qe.mapAndFilter(n,x=>{let I=e.tryWorkspaceByFilePath(x);return I===null?qe.mapAndFilter.skip:I}));if(f.length===0&&p.size===0&&!t)return null;let h=f.length===1?f[0]:Y.join(c,`${Mn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=ae.existsSync(h)?await ae.readFilePromise(h,"utf8"):"{}",C=us(E),S=new Map;for(let x of C.declined||[]){let I=H.parseIdent(x),R=e.getWorkspaceByIdent(I);S.set(R,"decline")}for(let[x,I]of Object.entries(C.releases||{})){let R=H.parseIdent(x),N=e.getWorkspaceByIdent(R);S.set(N,wy(I))}return{project:e,root:s,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:p,releaseRoots:new Set([...p].filter(x=>x.manifest.version!==null)),releases:S,async saveAll(){let x={},I=[],R=[];for(let N of e.workspaces){if(N.manifest.version===null)continue;let U=H.stringifyIdent(N.anchoredLocator),K=S.get(N);K==="decline"?I.push(U):typeof K<"u"?x[U]=wy(K):p.has(N)&&R.push(U)}await ae.mkdirPromise(Y.dirname(h),{recursive:!0}),await ae.changeFilePromise(h,Al(new Al.PreserveOrdering({releases:Object.keys(x).length>0?x:void 0,declined:I.length>0?I:void 0,undecided:R.length>0?R:void 0})))}}}function ubt(e){return TL(e).size>0||pP(e).length>0}function TL(e){let t=new Set;for(let r of e.changedWorkspaces)r.manifest.version!==null&&(e.releases.has(r)||t.add(r));return t}function pP(e,{include:t=new Set}={}){let r=[],s=new Map(qe.mapAndFilter([...e.releases],([n,c])=>c==="decline"?qe.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(qe.mapAndFilter([...e.releases],([n,c])=>c!=="decline"?qe.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of e.project.workspaces)if(!(!t.has(n)&&(a.has(n.anchoredLocator.locatorHash)||s.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let c of _t.hardDependencies)for(let f of n.manifest.getForScope(c).values()){let p=e.project.tryWorkspaceByDescriptor(f);p!==null&&s.has(p.anchoredLocator.locatorHash)&&r.push([n,p])}return r}function YJ(e,t){let r=RA.default.clean(t);for(let s of Object.values(H1))if(s!=="undecided"&&s!=="decline"&&RA.default.inc(e,s)===r)return s;return null}function fP(e,t){if(RA.default.valid(t))return t;if(e===null)throw new ot(`Cannot apply the release strategy "${t}" unless the workspace already has a valid version`);if(!RA.default.valid(e))throw new ot(`Cannot apply the release strategy "${t}" on a non-semver version (${e})`);let r=RA.default.inc(e,t);if(r===null)throw new ot(`Cannot apply the release strategy "${t}" on the specified version (${e})`);return r}function WJ(e,t,{report:r,exact:s}){let a=new Map;for(let n of e.workspaces)for(let c of _t.allDependencies)for(let f of n.manifest[c].values()){let p=e.tryWorkspaceByDescriptor(f);if(p===null||!t.has(p))continue;qe.getArrayWithDefault(a,p).push([n,c,f.identHash])}for(let[n,c]of t){let f=n.manifest.version;n.manifest.version=c,RA.default.prerelease(c)===null?delete n.manifest.raw.stableVersion:n.manifest.raw.stableVersion||(n.manifest.raw.stableVersion=f);let p=n.manifest.name!==null?H.stringifyIdent(n.manifest.name):null;r.reportInfo(0,`${H.prettyLocator(e.configuration,n.anchoredLocator)}: Bumped to ${c}`),r.reportJson({cwd:Ae.fromPortablePath(n.cwd),ident:p,oldVersion:f,newVersion:c});let h=a.get(n);if(!(typeof h>"u"))for(let[E,C,S]of h){let x=E.manifest[C].get(S);if(typeof x>"u")throw new Error("Assertion failed: The dependency should have existed");let I=x.range,R=!1;if(I.startsWith(Ii.protocol)&&(I=I.slice(Ii.protocol.length),R=!0,I===n.relativeCwd))continue;let N=I.match(cbt);if(!N){r.reportWarning(0,`Couldn't auto-upgrade range ${I} (in ${H.prettyLocator(e.configuration,E.anchoredLocator)})`);continue}let U=s?`${c}`:`${N[1]}${c}`;R&&(U=`${Ii.protocol}${U}`);let K=H.makeDescriptor(x,U);E.manifest[C].set(S,K)}}}var fbt=new Map([["%n",{extract:e=>e.length>=1?[e[0],e.slice(1)]:null,generate:(e=0)=>`${e+1}`}]]);function IPe(e,{current:t,prerelease:r}){let s=new RA.default.SemVer(t),a=s.prerelease.slice(),n=[];s.prerelease=[],s.format()!==e&&(a.length=0);let c=!0,f=r.split(/\./g);for(let p of f){let h=fbt.get(p);if(typeof h>"u")n.push(p),a[0]===p?a.shift():c=!1;else{let E=c?h.extract(a):null;E!==null&&typeof E[0]=="number"?(n.push(h.generate(E[0])),a=E[1]):(n.push(h.generate()),c=!1)}}return s.prerelease&&(s.prerelease=[]),`${e}-${n.join(".")}`}var q1=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("--all",!1,{description:"Apply the deferred version changes on all workspaces"});this.dryRun=he.Boolean("--dry-run",!1,{description:"Print the versions without actually generating the package archive"});this.prerelease=he.String("--prerelease",{description:"Add a prerelease identifier to new versions",tolerateBoolean:!0});this.exact=he.Boolean("--exact",!1,{description:"Use the exact version of each package, removes any range. Useful for nightly releases where the range might match another version."});this.recursive=he.Boolean("-R,--recursive",{description:"ReleLine truncated
|
||||
This command will apply the deferred version changes and remove their definitions from the repository.
|
||||
|
||||
Note that if \`--prerelease\` is set, the given prerelease identifier (by default \`rc.%n\`) will be used on all new versions and the version definitions will be kept as-is.
|
||||
|
||||
By default only the current workspace will be bumped, but you can configure this behavior by using one of:
|
||||
|
||||
- \`--recursive\` to also apply the version bump on its dependencies
|
||||
- \`--all\` to apply the version bump on all packages in the repository
|
||||
|
||||
Note that this command will also update the \`workspace:\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.
|
||||
`,examples:[["Apply the version change to the local workspace","yarn version apply"],["Apply the version change to all the workspaces in the local workspace","yarn version apply --all"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=this.prerelease?typeof this.prerelease!="boolean"?this.prerelease:"rc.%n":null,h=await AP(s,{prerelease:p}),E=new Map;if(this.all)E=h;else{let C=this.recursive?a.getRecursiveWorkspaceDependencies():[a];for(let S of C){let x=h.get(S);typeof x<"u"&&E.set(S,x)}}if(E.size===0){let C=h.size>0?" Did you want to add --all?":"";f.reportWarning(0,`The current workspace doesn't seem to require a version bump.${C}`);return}WJ(s,E,{report:f,exact:this.exact}),this.dryRun||(p||(this.all?await GJ(s):await qJ(s,[...E.keys()])),f.reportSeparator())});return this.dryRun||c.hasErrors()?c.exitCode():await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};Ge();bt();jt();var RL=et(hi());var Y1=class extends ft{constructor(){super(...arguments);this.interactive=he.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})}static{this.paths=[["version","check"]]}static{this.usage=st.Usage({category:"Release-related commands",description:"check that all the relevant packages have been bumped",details:"\n **Warning:** This command currently requires Git.\n\n This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\n\n In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\n\n In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\n ",examples:[["Check whether the modified packages need a bump","yarn version check"]]})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){XC(this.context);let{Gem:r}=await Promise.resolve().then(()=>(FF(),AY)),{ScrollableItems:s}=await Promise.resolve().then(()=>(MF(),LF)),{FocusRequest:a}=await Promise.resolve().then(()=>(dY(),bwe)),{useListInput:n}=await Promise.resolve().then(()=>(OF(),Dwe)),{renderForm:c}=await Promise.resolve().then(()=>(jF(),HF)),{Box:f,Text:p}=await Promise.resolve().then(()=>et(Yc())),{default:h,useCallback:E,useState:C}=await Promise.resolve().then(()=>et(dn())),S=await Je.find(this.context.cwd,this.context.plugins),{project:x,workspace:I}=await Tt.find(S,this.context.cwd);if(!I)throw new ar(x.cwd,this.context.cwd);await x.restoreInstallState();let R=await j1(x);if(R===null||R.releaseRoots.size===0)return 0;if(R.root===null)throw new ot("This command can only be run on Git repositories");let N=()=>h.createElement(f,{flexDirection:"row",paddingBottom:1},h.createElement(f,{flexDirection:"column",width:60},h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to select workspaces.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<left>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<right>")," to select release strategies."))),h.createElement(f,{flexDirection:"column"},h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to save.")),h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),U=({workspace:ge,active:pe,decision:De,setDecision:ye})=>{let d=ge.manifest.raw.stableVersion??ge.manifest.version;if(d===null)throw new Error(`Assertion failed: The version should have been set (${H.prettyLocator(S,ge.anchoredLocator)})`);if(RL.default.prerelease(d)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${d})`);let ve=["undecided","decline","patch","minor","major"];n(De,ve,{active:pe,minus:"left",plus:"right",set:ye});let Ie=De==="undecided"?h.createElement(p,{color:"yellow"},d):De==="decline"?h.createElement(p,{color:"green"},d):h.createElement(p,null,h.createElement(p,{color:"magenta"},d)," \u2192 ",h.createElement(p,{color:"green"},RL.default.valid(De)?De:RL.default.inc(d,De)));return h.createElement(f,{flexDirection:"column"},h.createElement(f,null,h.createElement(p,null,H.prettyLocator(S,ge.anchoredLocator)," - ",Ie)),h.createElement(f,null,ve.map(meLine truncated
|
||||
`)},p=()=>{let ye=this.from.map(d=>K1.default.matcher(d));return s.workspaces.filter(d=>{let ve=H.stringifyIdent(d.anchoredLocator),Ie=d.relativeCwd;return ye.some(me=>me(ve)||me(Ie))})},h=[];if(this.since?(f("Option --since is set; selecting the changed workspaces as root for workspace selection"),h=Array.from(await Ma.fetchChangedWorkspaces({ref:this.since,project:s}))):this.from?(f("Option --from is set; selecting the specified workspaces"),h=[...p()]):this.worktree?(f("Option --worktree is set; selecting the current workspace"),h=[a]):this.recursive?(f("Option --recursive is set; selecting the current workspace"),h=[a]):this.all&&(f("Option --all is set; selecting all workspaces"),h=[...s.workspaces]),this.dryRun&&!this.all){for(let ye of h)f(`
|
||||
- ${ye.relativeCwd}
|
||||
${H.prettyLocator(r,ye.anchoredLocator)}`);h.length>0&&f("")}let E;if(this.recursive?this.since?(f("Option --recursive --since is set; recursively selecting all dependent workspaces"),E=new Set(h.map(ye=>[...ye.getRecursiveWorkspaceDependents()]).flat())):(f("Option --recursive is set; recursively selecting all transitive dependencies"),E=new Set(h.map(ye=>[...ye.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(f("Option --worktree is set; recursively selecting all nested workspaces"),E=new Set(h.map(ye=>[...ye.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let ye of E)f(`
|
||||
- ${ye.relativeCwd}
|
||||
${H.prettyLocator(r,ye.anchoredLocator)}`);let C=[],S=!1;if(c?.includes(":")){for(let ye of s.workspaces)if(ye.manifest.scripts.has(c)&&(S=!S,S===!1))break}for(let ye of h){if(c&&!ye.manifest.scripts.has(c)&&!S&&!(await wn.getWorkspaceAccessibleBinaries(ye)).has(c)){f(`Excluding ${ye.relativeCwd} because it doesn't have a "${c}" script`);continue}if(!(c===r.env.npm_lifecycle_event&&ye.cwd===a.cwd)){if(this.include.length>0&&!K1.default.isMatch(H.stringifyIdent(ye.anchoredLocator),this.include)&&!K1.default.isMatch(ye.relativeCwd,this.include)){f(`Excluding ${ye.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&(K1.default.isMatch(H.stringifyIdent(ye.anchoredLocator),this.exclude)||K1.default.isMatch(ye.relativeCwd,this.exclude))){f(`Excluding ${ye.relativeCwd} because it matches the --exclude filter`);continue}if(this.publicOnly&&ye.manifest.private===!0){f(`Excluding ${ye.relativeCwd} because it's a private workspace and --no-private was set`);continue}C.push(ye)}}if(C.sort((ye,d)=>H.stringifyIdent(ye.anchoredLocator).localeCompare(H.stringifyIdent(d.anchoredLocator))),this.dryRun)return 0;let x=this.verbose??(this.context.stdout.isTTY?1/0:0),I=x>0,R=x>1,N=this.parallel?this.jobs==="unlimited"?1/0:Number(this.jobs)||Math.ceil(Ui.availableParallelism()/2):1,U=N===1?!1:this.parallel,K=U?this.interlaced:!0,$=(0,wPe.default)(N),ie=new Map,fe=new Set,le=0,ge=null,pe=!1,De=await Ft.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async ye=>{let d=async(ve,{commandIndex:Ie})=>{if(pe)return-1;!U&&R&&Ie>1&&ye.reportSeparator();let me=hbt(ve,{configuration:r,label:I,commandIndex:Ie}),[ce,X]=CPe(ye,{prefix:me,interlaced:K}),[be,ke]=CPe(ye,{prefix:me,interlaced:K});try{R&&ye.reportInfo(null,`${me?`${me} `:""}Process started`);let it=Date.now(),_=await this.cli.run([this.commandName,...this.args],{cwd:ve.cwd,stdout:ce,stderr:be})||0;ce.end(),be.end(),await X,await ke;let tt=Date.now();if(R){let Fe=r.get("enableTimers")?`, completed in ${ue.pretty(r,tt-it,ue.Type.DURATION)}`:"";ye.reportInfo(null,`${me?`${me} `:""}Process exited (exit code ${_})${Fe}`)}return _===130&&(pe=!0,ge=_),_}catch(it){throw ce.end(),be.end(),await X,await ke,it}};for(let ve of C)ie.set(ve.anchoredLocator.locatorHash,ve);for(;ie.size>0&&!ye.hasErrors();){let ve=[];for(let[X,be]of ie){if(fe.has(be.anchoredDescriptor.descriptorHash))continue;let ke=!0;if(this.topological||this.topologicalDev){let it=this.topologicalDev?new Map([...be.manifest.dependencies,...be.manifest.devDependencies]):be.manifest.dependencies;for(let _ of it.values()){let tt=s.tryWorkspaceByDescriptor(_);if(ke=tt===null||!ie.has(tt.anchoredLocator.locatorHash),!ke)break}}if(ke&&(fe.add(be.anchoredDescriptor.descriptorHash),ve.push($(async()=>{let it=await d(be,{commandIndex:++le});return ie.delete(X),fe.delete(be.anchoredDescriptor.descriptorHash),{workspace:be,exitCode:it}})),!U))break}if(ve.length===0){let X=Array.from(ie.values()).map(be=>H.prettyLocator(r,be.anchoredLocator)).join(", ");ye.reportError(3,`Dependency cycle detected (${X})`);return}let Ie=await Promise.all(ve);Ie.forEach(({workspace:X,exitCode:be})=>{be!==0&&ye.reportError(0,`The command failed in workspace ${H.prettyLocator(r,X.anchoredLocator)} with exit code ${be}`)});let ce=Ie.map(X=>X.exitCode).find(X=>X!==0);(this.topological||this.topologicalDev)&&typeof ce<"u"&&ye.reportError(0,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return ge!==null?ge:De.exitCode()}};function CPe(e,{prefix:t,interlaced:r}){let s=e.createStreamReporter(t),a=new qe.DefaultStream;a.pipe(s,{end:!1}),a.on("finish",()=>{s.end()});let n=new Promise(f=>{s.on("finish",()=>{f(a.active)})});if(r)return[a,n];let c=new qe.BufferStream;return c.pipe(a,{end:!1}),c.on("finish",()=>{a.end()}),[c,n]}function hbt(e,{configuration:t,commandIndex:r,label:s}){if(!s)return null;let n=`[${H.stringifyIdent(e.anchoredLocator)}]:`,c=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],f=c[r%c.length];return ue.pretty(t,n,f)}var dbt={commands:[V1,J1]},gbt=dbt;var KI=()=>({modules:new Map([["@yarnpkg/cli",Kv],["@yarnpkg/core",Vv],["@yarnpkg/fslib",M2],["@yarnpkg/libzip",lv],["@yarnpkg/parsers",W2],["@yarnpkg/shell",hv],["clipanion",nB],["semver",mbt],["typanion",qs],["@yarnpkg/plugin-essentials",G5],["@yarnpkg/plugin-catalog",V5],["@yarnpkg/plugin-compat",X5],["@yarnpkg/plugin-constraints",d9],["@yarnpkg/plugin-dlx",g9],["@yarnpkg/plugin-exec",E9],["@yarnpkg/plugin-file",C9],["@yarnpkg/plugin-git",j5],["@yarnpkg/plugin-github",v9],["@yarnpkg/plugin-http",S9],["@yarnpkg/plugin-init",b9],["@yarnpkg/plugin-interactive-tools",BY],["@yarnpkg/plugin-jsr",SY],["@yarnpkg/plugin-link",bY],["@yarnpkg/plugin-nm",dW],["@yarnpkg/plugin-npm",hJ],["@yarnpkg/plugin-npm-cli",vJ],["@yarnpkg/plugin-pack",aV],["@yarnpkg/plugin-patch",QJ],["@yarnpkg/plugin-pnp",rW],["@yarnpkg/plugin-pnpm",FJ],["@yarnpkg/plugin-stage",HJ],["@yarnpkg/plugin-tLine truncated
|
||||
Please report this issue at https://github.com/yarnpkg/berry/issues.`)}process.once("beforeExit",n);try{process.exitCode=42,process.exitCode=await wbt(a,e,{selfPath:r,pluginConfiguration:s})}catch(c){ba.defaultContext.stdout.write(a.error(c)),process.exitCode=1}finally{process.off("beforeExit",n),await ae.rmtempPromise()}}OR(process.argv.slice(2),{cwd:Y.cwd(),selfPath:Ae.toPortablePath(Ae.resolve(process.argv[1])),pluginConfiguration:KI()});})();
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2015, Rebecca Turner
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
@license
|
||||
Copyright Node.js contributors. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
@license
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
@license
|
||||
Copyright Joyent, Inc. and other Node contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/*! Bundled license information:
|
||||
|
||||
is-number/index.js:
|
||||
(*!
|
||||
* is-number <https://github.com/jonschlinkert/is-number>
|
||||
*
|
||||
* Copyright (c) 2014-present, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
|
||||
to-regex-range/index.js:
|
||||
(*!
|
||||
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
||||
*
|
||||
* Copyright (c) 2015-present, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
|
||||
fill-range/index.js:
|
||||
(*!
|
||||
* fill-range <https://github.com/jonschlinkert/fill-range>
|
||||
*
|
||||
* Copyright (c) 2014-present, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*)
|
||||
|
||||
is-extglob/index.js:
|
||||
(*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*)
|
||||
|
||||
is-glob/index.js:
|
||||
(*!
|
||||
* is-glob <https://github.com/jonschlinkert/is-glob>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
|
||||
queue-microtask/index.js:
|
||||
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||
|
||||
run-parallel/index.js:
|
||||
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||
|
||||
git-url-parse/lib/index.js:
|
||||
(*!
|
||||
* buildToken
|
||||
* Builds OAuth token prefix (helper function)
|
||||
*
|
||||
* @name buildToken
|
||||
* @function
|
||||
* @param {GitUrl} obj The parsed Git url object.
|
||||
* @return {String} token prefix
|
||||
*)
|
||||
|
||||
object-assign/index.js:
|
||||
(*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*)
|
||||
|
||||
react/cjs/react.production.min.js:
|
||||
(** @license React v17.0.2
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
scheduler/cjs/scheduler.production.min.js:
|
||||
(** @license React v0.20.2
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
react-reconciler/cjs/react-reconciler.production.min.js:
|
||||
(** @license React v0.26.2
|
||||
* react-reconciler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
is-windows/index.js:
|
||||
(*!
|
||||
* is-windows <https://github.com/jonschlinkert/is-windows>
|
||||
*
|
||||
* Copyright © 2015-2018, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
*/
|
||||
Vendored
-925
@@ -1,925 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable */
|
||||
//prettier-ignore
|
||||
(()=>{var t_e=Object.create;var vR=Object.defineProperty;var r_e=Object.getOwnPropertyDescriptor;var n_e=Object.getOwnPropertyNames;var i_e=Object.getPrototypeOf,s_e=Object.prototype.hasOwnProperty;var ve=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Et=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Vt=(t,e)=>{for(var r in e)vR(t,r,{get:e[r],enumerable:!0})},o_e=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of n_e(e))!s_e.call(t,a)&&a!==r&&vR(t,a,{get:()=>e[a],enumerable:!(o=r_e(e,a))||o.enumerable});return t};var Ze=(t,e,r)=>(r=t!=null?t_e(i_e(t)):{},o_e(e||!t||!t.__esModule?vR(r,"default",{value:t,enumerable:!0}):r,t));var Bi={};Vt(Bi,{SAFE_TIME:()=>D7,S_IFDIR:()=>iD,S_IFLNK:()=>sD,S_IFMT:()=>Uu,S_IFREG:()=>Dw});var Uu,iD,Dw,sD,D7,P7=Et(()=>{Uu=61440,iD=16384,Dw=32768,sD=40960,D7=456789e3});var nr={};Vt(nr,{EBADF:()=>Io,EBUSY:()=>a_e,EEXIST:()=>p_e,EINVAL:()=>c_e,EISDIR:()=>f_e,ENOENT:()=>u_e,ENOSYS:()=>l_e,ENOTDIR:()=>A_e,ENOTEMPTY:()=>g_e,EOPNOTSUPP:()=>d_e,EROFS:()=>h_e,ERR_DIR_CLOSED:()=>DR});function Tl(t,e){return Object.assign(new Error(`${t}: ${e}`),{code:t})}function a_e(t){return Tl("EBUSY",t)}function l_e(t,e){return Tl("ENOSYS",`${t}, ${e}`)}function c_e(t){return Tl("EINVAL",`invalid argument, ${t}`)}function Io(t){return Tl("EBADF",`bad file descriptor, ${t}`)}function u_e(t){return Tl("ENOENT",`no such file or directory, ${t}`)}function A_e(t){return Tl("ENOTDIR",`not a directory, ${t}`)}function f_e(t){return Tl("EISDIR",`illegal operation on a directory, ${t}`)}function p_e(t){return Tl("EEXIST",`file already exists, ${t}`)}function h_e(t){return Tl("EROFS",`read-only filesystem, ${t}`)}function g_e(t){return Tl("ENOTEMPTY",`directory not empty, ${t}`)}function d_e(t){return Tl("EOPNOTSUPP",`operation not supported, ${t}`)}function DR(){return Tl("ERR_DIR_CLOSED","Directory handle was closed")}var oD=Et(()=>{});var wa={};Vt(wa,{BigIntStatsEntry:()=>qd,DEFAULT_MODE:()=>bR,DirEntry:()=>PR,StatEntry:()=>Hd,areStatsEqual:()=>xR,clearStats:()=>aD,convertToBigIntStats:()=>y_e,makeDefaultStats:()=>S7,makeEmptyStats:()=>m_e});function S7(){return new Hd}function m_e(){return aD(S7())}function aD(t){for(let e in t)if(Object.hasOwn(t,e)){let r=t[e];typeof r=="number"?t[e]=0:typeof r=="bigint"?t[e]=BigInt(0):SR.types.isDate(r)&&(t[e]=new Date(0))}return t}function y_e(t){let e=new qd;for(let r in t)if(Object.hasOwn(t,r)){let o=t[r];typeof o=="number"?e[r]=BigInt(o):SR.types.isDate(o)&&(e[r]=new Date(o))}return e.atimeNs=e.atimeMs*BigInt(1e6),e.mtimeNs=e.mtimeMs*BigInt(1e6),e.ctimeNs=e.ctimeMs*BigInt(1e6),e.birthtimeNs=e.birthtimeMs*BigInt(1e6),e}function xR(t,e){if(t.atimeMs!==e.atimeMs||t.birthtimeMs!==e.birthtimeMs||t.blksize!==e.blksize||t.blocks!==e.blocks||t.ctimeMs!==e.ctimeMs||t.dev!==e.dev||t.gid!==e.gid||t.ino!==e.ino||t.isBlockDevice()!==e.isBlockDevice()||t.isCharacterDevice()!==e.isCharacterDevice()||t.isDirectory()!==e.isDirectory()||t.isFIFO()!==e.isFIFO()||t.isFile()!==e.isFile()||t.isSocket()!==e.isSocket()||t.isSymbolicLink()!==e.isSymbolicLink()||t.mode!==e.mode||t.mtimeMs!==e.mtimeMs||t.nlink!==e.nlink||t.rdev!==e.rdev||t.size!==e.size||t.uid!==e.uid)return!1;let r=t,o=e;return!(r.atimeNs!==o.atimeNs||r.mtimeNs!==o.mtimeNs||r.ctimeNs!==o.ctimeNs||r.birthtimeNs!==o.birthtimeNs)}var SR,bR,PR,Hd,qd,kR=Et(()=>{SR=Ze(ve("util")),bR=33188,PR=class{constructor(){this.name="";this.path="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},Hd=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=bR;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},qd=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(bR);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){reLine truncated
|
||||
`).length,o=e.length-r;return r>o?`\r
|
||||
`:`
|
||||
`}function L0(t,e){return e.replace(/\r?\n/g,Q_e(t))}var L7,M7,hf,_u,M0=Et(()=>{L7=ve("crypto"),M7=ve("os");RR();Ia();hf=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:r=!1}={}){let o=[e];for(;o.length>0;){let a=o.shift();if((await this.lstatPromise(a)).isDirectory()){let u=await this.readdirPromise(a);if(r)for(let A of u.sort())o.push(this.pathUtils.join(a,A));else throw new Error("Not supported")}else yield a}}async checksumFilePromise(e,{algorithm:r="sha512"}={}){let o=await this.openPromise(e,"r");try{let n=Buffer.allocUnsafeSlow(65536),u=(0,L7.createHash)(r),A=0;for(;(A=await this.readPromise(o,n,0,65536))!==0;)u.update(A===65536?n:n.slice(0,A));return u.digest("hex")}finally{await this.closePromise(o)}}async removePromise(e,{recursive:r=!0,maxRetries:o=5}={}){let a;try{a=await this.lstatPromise(e)}catch(n){if(n.code==="ENOENT")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(e);await Promise.all(n.map(u=>this.removePromise(this.pathUtils.resolve(e,u))))}for(let n=0;n<=o;n++)try{await this.rmdirPromise(e);break}catch(u){if(u.code!=="EBUSY"&&u.code!=="ENOTEMPTY")throw u;n<o&&await new Promise(A=>setTimeout(A,n*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:r=!0}={}){let o;try{o=this.lstatSync(e)}catch(a){if(a.code==="ENOENT")return;throw a}if(o.isDirectory()){if(r)for(let a of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,a));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:r,utimes:o}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let u=2;u<=a.length;++u){let A=a.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(A)){try{await this.mkdirPromise(A)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=A,r!=null&&await this.chmodPromise(A,r),o!=null)await this.utimesPromise(A,o[0],o[1]);else{let p=await this.statPromise(this.pathUtils.dirname(A));await this.utimesPromise(A,p.atime,p.mtime)}}}return n}mkdirpSync(e,{chmod:r,utimes:o}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let u=2;u<=a.length;++u){let A=a.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(A)){try{this.mkdirSync(A)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=A,r!=null&&this.chmodSync(A,r),o!=null)this.utimesSync(A,o[0],o[1]);else{let p=this.statSync(this.pathUtils.dirname(A));this.utimesSync(A,p.atime,p.mtime)}}}return n}async copyPromise(e,r,{baseFs:o=this,overwrite:a=!0,stableSort:n=!1,stableTime:u=!1,linkStrategy:A=null}={}){return await k7(this,e,o,r,{overwrite:a,stableSort:n,stableTime:u,linkStrategy:A})}copySync(e,r,{baseFs:o=this,overwrite:a=!0}={}){let n=o.lstatSync(r),u=this.existsSync(e);if(n.isDirectory()){this.mkdirpSync(e);let p=o.readdirSync(r);for(let h of p)this.copySync(this.pathUtils.join(e,h),o.pathUtils.join(r,h),{baseFs:o,overwrite:a})}else if(n.isFile()){if(!u||a){u&&this.removeSync(e);let p=o.readFileSync(r);this.writeFileSync(e,p)}}else if(n.isSymbolicLink()){if(!u||a){u&&this.removeSync(e);let p=o.readlinkSync(r);this.symlinkSync(lD(this.pathUtils,p),e)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,"0")})`);let A=n.mode&511;this.chmodSync(e,A)}async changeFilePromise(e,r,o={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(e,r,o):this.changeFileTextPromise(e,r,o)}async changeFileBufferPromise(e,r,{mode:o}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(e)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(e,r,{mode:o})}async changeFileTextPromise(e,r,{automaticNewlines:o,mode:a}={}){let n="";try{n=await this.readFilePromise(e,"utf8")}catch{}let u=o?L0(n,r):r;n!==u&&await this.writeFilePromise(e,u,{mode:a})}changeFileSync(e,r,o={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(e,r,o):this.changeFileTextSync(e,r,o)}changeFileBufferSync(e,r,{mode:o}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(e)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(e,r,{mode:o})}changeFileTextSync(e,r,{automaticNewlines:o=!1,mode:a}={}){let n="";try{n=this.readFileSync(e,"utf8")}catch{}let u=o?L0(n,r):r;n!==u&&this.writeFileSync(e,u,{mode:a})}async movePromise(e,r){try{await this.renamePromise(e,r)}catch(o){if(o.code==="EXDEV")await this.copyPromise(r,e),await this.removePromise(e);else throw o}}moveSync(e,r){try{this.renameSync(e,r)}catch(o){if(o.code==="EXDEV")this.copySync(r,e),this.removeSync(e);else throw o}}async lockPromise(e,r){let o=`${e}.flock`,a=1e3/60,n=Date.now(),u=null,A=async()=>{let p;try{[p]=await this.readJsonPromise(o)}catch{return Date.now()-n<500}try{return process.kill(p,0),!0}catch{return!1}};for(;u===null;)try{u=await this.openPromise(o,"wx")}catch(p){if(p.code==="EEXIST"){if(!await A())try{await this.unlinkPromise(o);continue}catch{}if(Date.now()-n<60*1e3)await new Promise(h=>setTimeout(h,a));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${o})`)}else throw
Line truncated
|
||||
`)}writeJsonSync(e,r,{compact:o=!1}={}){let a=o?0:2;return this.writeFileSync(e,`${JSON.stringify(r,null,a)}
|
||||
`)}async preserveTimePromise(e,r){let o=await this.lstatPromise(e),a=await r();typeof a<"u"&&(e=a),await this.lutimesPromise(e,o.atime,o.mtime)}async preserveTimeSync(e,r){let o=this.lstatSync(e),a=r();typeof a<"u"&&(e=a),this.lutimesSync(e,o.atime,o.mtime)}},_u=class extends hf{constructor(){super(K)}}});var bs,gf=Et(()=>{M0();bs=class extends hf{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,o){return this.baseFs.openPromise(this.mapToBase(e),r,o)}openSync(e,r,o){return this.baseFs.openSync(this.mapToBase(e),r,o)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,o,a,n){return await this.baseFs.readPromise(e,r,o,a,n)}readSync(e,r,o,a,n){return this.baseFs.readSync(e,r,o,a,n)}async writePromise(e,r,o,a,n){return typeof r=="string"?await this.baseFs.writePromise(e,r,o):await this.baseFs.writePromise(e,r,o,a,n)}writeSync(e,r,o,a,n){return typeof r=="string"?this.baseFs.writeSync(e,r,o):this.baseFs.writeSync(e,r,o,a,n)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async fchmodPromise(e,r){return this.baseFs.fchmodPromise(e,r)}fchmodSync(e,r){return this.baseFs.fchmodSync(e,r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async fchownPromise(e,r,o){return this.baseFs.fchownPromise(e,r,o)}fchownSync(e,r,o){return this.baseFs.fchownSync(e,r,o)}async chownPromise(e,r,o){return this.baseFs.chownPromise(this.mapToBase(e),r,o)}chownSync(e,r,o){return this.baseFs.chownSync(this.mapToBase(e),r,o)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,o=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),o)}copyFileSync(e,r,o=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),o)}async appendFilePromise(e,r,o){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,o)}appendFileSync(e,r,o){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,o)}async writeFilePromise(e,r,o){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,o)}writeFileSync(e,r,o){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,o)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,o){return this.baseFs.utimesPromise(this.mapToBase(e),r,o)}utimesSync(e,r,o){return this.baseFs.utimesSync(this.mapToBase(e),r,o)}async lutimesPromise(e,r,o){return this.baseFs.lutimesPromise(this.mapToBase(e),r,o)}lutimesSync(e,r,o){return this.baseFs.lutimesSync(this.mapToBase(e),r,o)}async mkdirPromise(e,r){return this.baseFs.mkdirPromise(this.mapToBase(e),r)}mkdirSync(e,r){return this.baseFs.mkdirSync(this.mapToBase(e),r)}async rmdirPromise(e,r){return this.baseFs.rmdirPromise(this.mapToBase(e),r)}rmdirSync(e,r){return this.baseFs.rmdirSync(this.mapToBase(e),r)}async rmPromise(e,r){return this.baseFs.rmPromise(this.mapToBase(e),r)}rmSync(e,r){return this.baseFs.rmSync(this.mapToBase(e),r)}async linkPromise(e,r){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(r))}linkSync(e,r){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(r))}async symlinkPromise(e,r,o){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),a,o);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),u=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkP
Line truncated
|
||||
`,Vn=Br(`\\
|
||||
`,!1),Mn=function(){return""},Ti="\\",On=Br("\\",!1),_i=/^[\\$"`]/,ir=Is(["\\","$",'"',"`"],!1,!1),Me=function(N){return N},ii="\\a",Ha=Br("\\a",!1),hr=function(){return"a"},Ac="\\b",fu=Br("\\b",!1),fc=function(){return"\b"},El=/^[Ee]/,vA=Is(["E","e"],!1,!1),pu=function(){return"\x1B"},Ie="\\f",Tt=Br("\\f",!1),pc=function(){return"\f"},Hi="\\n",hu=Br("\\n",!1),Yt=function(){return`
|
||||
`},Cl="\\r",DA=Br("\\r",!1),ap=function(){return"\r"},hc="\\t",PA=Br("\\t",!1),Qn=function(){return" "},hi="\\v",gc=Br("\\v",!1),SA=function(){return"\v"},aa=/^[\\'"?]/,Ni=Is(["\\","'",'"',"?"],!1,!1),_o=function(N){return String.fromCharCode(parseInt(N,16))},Xe="\\x",lo=Br("\\x",!1),dc="\\u",gu=Br("\\u",!1),qi="\\U",du=Br("\\U",!1),bA=function(N){return String.fromCodePoint(parseInt(N,16))},qa=/^[0-7]/,mc=Is([["0","7"]],!1,!1),ds=/^[0-9a-fA-f]/,Ht=Is([["0","9"],["a","f"],["A","f"]],!1,!1),Fn=o0(),Ei="{}",la=Br("{}",!1),co=function(){return"{}"},Hs="-",ca=Br("-",!1),ua="+",Ho=Br("+",!1),Ci=".",ms=Br(".",!1),ys=function(N,V,re){return{type:"number",value:(N==="-"?-1:1)*parseFloat(V.join("")+"."+re.join(""))}},Es=function(N,V){return{type:"number",value:(N==="-"?-1:1)*parseInt(V.join(""))}},qs=function(N){return{type:"variable",...N}},Un=function(N){return{type:"variable",name:N}},Pn=function(N){return N},Cs="*",We=Br("*",!1),tt="/",Bt=Br("/",!1),or=function(N,V,re){return{type:V==="*"?"multiplication":"division",right:re}},ee=function(N,V){return V.reduce((re,he)=>({left:re,...he}),N)},ye=function(N,V,re){return{type:V==="+"?"addition":"subtraction",right:re}},Le="$((",ft=Br("$((",!1),pt="))",Nt=Br("))",!1),rr=function(N){return N},$r="$(",ji=Br("$(",!1),rs=function(N){return N},Si="${",qo=Br("${",!1),xA=":-",kA=Br(":-",!1),lp=function(N,V){return{name:N,defaultValue:V}},e0=":-}",mu=Br(":-}",!1),t0=function(N){return{name:N,defaultValue:[]}},yu=":+",uo=Br(":+",!1),QA=function(N,V){return{name:N,alternativeValue:V}},yc=":+}",Aa=Br(":+}",!1),r0=function(N){return{name:N,alternativeValue:[]}},Ec=function(N){return{name:N}},hd="$",n0=Br("$",!1),$n=function(N){return e.isGlobPattern(N)},cp=function(N){return N},i0=/^[a-zA-Z0-9_]/,FA=Is([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),js=function(){return s0()},Eu=/^[$@*?#a-zA-Z0-9_\-]/,ja=Is(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),Gi=/^[()}<>$|&; \t"']/,fa=Is(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),Cu=/^[<>&; \t"']/,ws=Is(["<",">","&",";"," "," ",'"',"'"],!1,!1),Cc=/^[ \t]/,wc=Is([" "," "],!1,!1),Y=0,Dt=0,wl=[{line:1,column:1}],bi=0,Ic=[],ct=0,wu;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function s0(){return t.substring(Dt,Y)}function tw(){return Bc(Dt,Y)}function RA(N,V){throw V=V!==void 0?V:Bc(Dt,Y),c0([l0(N)],t.substring(Dt,Y),V)}function up(N,V){throw V=V!==void 0?V:Bc(Dt,Y),gd(N,V)}function Br(N,V){return{type:"literal",text:N,ignoreCase:V}}function Is(N,V,re){return{type:"class",parts:N,inverted:V,ignoreCase:re}}function o0(){return{type:"any"}}function a0(){return{type:"end"}}function l0(N){return{type:"other",description:N}}function Ap(N){var V=wl[N],re;if(V)return V;for(re=N-1;!wl[re];)re--;for(V=wl[re],V={line:V.line,column:V.column};re<N;)t.charCodeAt(re)===10?(V.line++,V.column=1):V.column++,re++;return wl[N]=V,V}function Bc(N,V){var re=Ap(N),he=Ap(V);return{start:{offset:N,line:re.line,column:re.column},end:{offset:V,line:he.line,column:he.column}}}function Ct(N){Y<bi||(Y>bi&&(bi=Y,Ic=[]),Ic.push(N))}function gd(N,V){return new _0(N,null,null,V)}function c0(N,V,re){return new _0(_0.buildMessage(N,V),N,V,re)}function u0(){var N,V,re;for(N=Y,V=[],re=Qt();re!==r;)V.push(re),re=Qt();return V!==r?(re=Iu(),re===r&&(re=null),re!==r?(Dt=N,V=n(re),N=V):(Y=N,N=r)):(Y=N,N=r),N}function Iu(){var N,V,re,he,ze;if(N=Y,V=Bu(),V!==r){for(re=[],he=Qt();he!==r;)re.push(he),he=Qt();re!==r?(he=A0(),he!==r?(ze=dd(),ze===r&&(ze=null),ze!==r?(Dt=N,V=u(V,he,ze),N=V):(Y=N,N=r)):(Y=N,N=r)):(Y=N,N=r)}else Y=N,N=r;if(N===r)if(N=Y,V=Bu(),V!==r){for(re=[],he=Qt();he!==r;)re.push(he),he=Qt();re!==r?(he=A0(),he===r&&(he=null),he!==r?(Dt=N,V=A(V,he),N=V):(Y=N,N=r)):(Y=N,N=r)}else Y=N,N=r;return N}function dd(){var N,V,re,he,ze;for(N=Y,V=[],re=Qt();re!==r;)V.push(re),re=Qt();if(V!==r)if(re=Iu(),re!==r){for(he=[],ze=Qt();ze!==r;)he.push(ze),ze=Qt();he!==r?(Dt=N,V=p(re),N=V):(Y=N,N=r)}else Y=N,N=r;else Y=N,N=r;return N}function A0(){var N;return t.charCodeAt(Y)===59?(N=h,Y++):(N=r,ct===0&&Ct(E)),N===r&&(t.charCodeAt(Y)===38?(N=I,Y++):(N=r,ct===0&&Ct(v))),N}function Bu(){var N,V,re;return N=Y,V=pa(),V!==r?(re=rw(),re===r&&(re=null),re!==r?(Dt=N,V=x(V,re),N=V):(Y=N,N=r)):(Y=N,N=r),N}function rw(){var N,V,re,he,ze,mt,fr;for(N=Y,V=[],re=Qt();re!==r;)V.push(re),re=Qt();if(V!==r)if(re=md(),re!==r){for(he=[],ze=Qt();ze!==r;)he.push(ze),ze=Qt();if(he!==r)if(ze=Bu(),ze!==r){for(mt=[],fr=Qt();fr!==r;)mt.push(fr),fr=Qt();mt!==r?(Dt=N,V=C(re,ze),N=V):(Y=N,N=r)}else Y=N,N=r;else Y=N,N=r}else Y=N,N=r;else Y=N,N=r;return N}function md(){var N;return t.substr(Y,2)===R?(N=R,Y+=2):(N=r,ct===0&&Ct(L)),N===r&&(t.substr(Y,2)===U?(N=U,Y+=2):(N=r,ct===0&&Ct(z))),N}function pa(){var N,V,re;return N=Y,V=f0(),V!==r?(re=vc(),re===r&&(re=null),re!==r?(Dt=N,V=te(V,re),N=V):(Y=N,N=r)):(Y=N,N=r),N}function vc(){var N,V,re,he,ze,mt,fr;for(N=Y,V=[],re=Qt();re!==r;)V.push(re),re=Qt();if(V!==r)Line truncated
|
||||
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),u8e=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(eW,([t,e])=>[t,`"$'${e}'"`])]),tW=t=>eW.get(t)??`\\x${t.charCodeAt(0).toString(16).padStart(2,"0")}`,A8e=t=>u8e.get(t)??`"$'${tW(t)}'"`});var iW=_((_bt,nW)=>{"use strict";function f8e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function q0(t,e,r,o){this.message=t,this.expected=e,this.found=r,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,q0)}f8e(q0,Error);q0.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",I;for(I=0;I<h.parts.length;I++)E+=h.parts[I]instanceof Array?n(h.parts[I][0])+"-"+n(h.parts[I][1]):n(h.parts[I]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function o(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+o(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+o(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+o(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+o(E)})}function u(h){return r[h.type](h)}function A(h){var E=new Array(h.length),I,v;for(I=0;I<h.length;I++)E[I]=u(h[I]);if(E.sort(),E.length>0){for(I=1,v=1;I<E.length;I++)E[I-1]!==E[I]&&(E[v]=E[I],v++);E.length=v}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+A(t)+" but "+p(e)+" found."};function p8e(t,e){e=e!==void 0?e:{};var r={},o={resolution:Fe},a=Fe,n="/",u=we("/",!1),A=function(Ue,b){return{from:Ue,descriptor:b}},p=function(Ue){return{descriptor:Ue}},h="@",E=we("@",!1),I=function(Ue,b){return{fullName:Ue,description:b}},v=function(Ue){return{fullName:Ue}},x=function(){return Be()},C=/^[^\/@]/,R=Ae(["/","@"],!0,!1),L=/^[^\/]/,U=Ae(["/"],!0,!1),z=0,te=0,ae=[{line:1,column:1}],le=0,ce=[],Ce=0,de;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function Be(){return t.substring(te,z)}function Ee(){return ht(te,z)}function g(Ue,b){throw b=b!==void 0?b:ht(te,z),Te([xe(Ue)],t.substring(te,z),b)}function me(Ue,b){throw b=b!==void 0?b:ht(te,z),rt(Ue,b)}function we(Ue,b){return{type:"literal",text:Ue,ignoreCase:b}}function Ae(Ue,b,w){return{type:"class",parts:Ue,inverted:b,ignoreCase:w}}function ne(){return{type:"any"}}function Z(){return{type:"end"}}function xe(Ue){return{type:"other",description:Ue}}function Ne(Ue){var b=ae[Ue],w;if(b)return b;for(w=Ue-1;!ae[w];)w--;for(b=ae[w],b={line:b.line,column:b.column};w<Ue;)t.charCodeAt(w)===10?(b.line++,b.column=1):b.column++,w++;return ae[Ue]=b,b}function ht(Ue,b){var w=Ne(Ue),S=Ne(b);return{start:{offset:Ue,line:w.line,column:w.column},end:{offset:b,line:S.line,column:S.column}}}function H(Ue){z<le||(z>le&&(le=z,ce=[]),ce.push(Ue))}function rt(Ue,b){return new q0(Ue,null,null,b)}function Te(Ue,b,w){return new q0(q0.buildMessage(Ue,b),Ue,b,w)}function Fe(){var Ue,b,w,S;return Ue=z,b=ke(),b!==r?(t.charCodeAt(z)===47?(w=n,z++):(w=r,Ce===0&&H(u)),w!==r?(S=ke(),S!==r?(te=Ue,b=A(b,S),Ue=b):(z=Ue,Ue=r)):(z=Ue,Ue=r)):(z=Ue,Ue=r),Ue===r&&(Ue=z,b=ke(),b!==r&&(te=Ue,b=p(b)),Ue=b),Ue}function ke(){var Ue,b,w,S;return Ue=z,b=Ye(),b!==r?(t.charCodeAt(z)===64?(w=h,z++):(w=r,Ce===0&&H(E)),w!==r?(S=et(),S!==r?(te=Ue,b=I(b,S),Ue=b):(z=Ue,Ue=r)):(z=Ue,Ue=r)):(z=Ue,Ue=r),Ue===r&&(Ue=z,b=Ye(),b!==r&&(te=Ue,b=v(b)),Ue=b),Ue}function Ye(){var Ue,b,w,S,y;return Ue=z,t.charCodeAt(z)===64?(b=h,z++):(b=r,Ce===0&&H(E)),b!==r?(w=Se(),w!==r?(t.charCodeAt(z)===47?(S=n,z++):(S=r,Ce===0&&H(u)),S!==r?(y=Se(),y!==r?(te=Ue,b=x(),Ue=b):(z=Ue,Ue=r)):(z=Ue,Ue=r)):(z=Ue,Ue=r)):(z=Ue,Ue=r),Ue===r&&(Ue=z,b=Se(),b!==r&&(te=Ue,b=x()),Ue=b),Ue}function Se(){var Ue,b,w;if(Ue=z,b=[],C.test(t.charAt(z))?(w=t.charAt(z),z++):(w=r,Ce===0&&H(R)),w!==r)for(;w!==r;)b.push(w),C.test(t.charAt(z))?(w=t.charAt(z),z++):(w=r,Ce===0&&H(R));else b=r;return b!==r&&(te=Ue,b=x()),Ue=b,Ue}function et(){var Ue,b,w;if(Ue=z,b=[],L.test(t.charAt(z))?(w=t.charAt(z),z++):(w=r,Ce===0&&H(U)),w!==r)for(;w!==r;)b.push(w),L.test(t.charAt(z))?(w=t.charAt(z),z++):(w=r,Ce===0&&H(U));else b=r;return b!==r&&(te=Ue,b=x()),Ue=b,Ue}if(de=a(),de!==r&&z===t.length)return de;throw de!==r&&z<t.length&&H(Z()),Te(ce,le<t.length?t.charAt(le):null,le<t.length?ht(le,le+1):ht(le,le))}nW.exports={SyntaxError:q0,parse:p8e}});function BD(t){let e=t.match(/^\*{1,2}\/(.*Line truncated
|
||||
\x85\u2028\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){o=" ... ",a+=5;break}for(n="",u=this.position;u<this.buffer.length&&`\0\r
|
||||
\x85\u2028\u2029`.indexOf(this.buffer.charAt(u))===-1;)if(u+=1,u-this.position>r/2-1){n=" ... ",u-=5;break}return A=this.buffer.slice(a,u),cW.repeat(" ",e)+o+A+n+`
|
||||
`+cW.repeat(" ",e+this.position-a+o.length)+"^"};$R.prototype.toString=function(e){var r,o="";return this.name&&(o+='in "'+this.name+'" '),o+="at line "+(this.line+1)+", column "+(this.column+1),e||(r=this.getSnippet(),r&&(o+=`:
|
||||
`+r)),o};uW.exports=$R});var ls=_((Ybt,pW)=>{"use strict";var fW=Xd(),E8e=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],C8e=["scalar","sequence","mapping"];function w8e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(o){e[String(o)]=r})}),e}function I8e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(E8e.indexOf(r)===-1)throw new fW('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=w8e(e.styleAliases||null),C8e.indexOf(this.kind)===-1)throw new fW('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}pW.exports=I8e});var Y0=_((Wbt,gW)=>{"use strict";var hW=G0(),DD=Xd(),B8e=ls();function eT(t,e,r){var o=[];return t.include.forEach(function(a){r=eT(a,e,r)}),t[e].forEach(function(a){r.forEach(function(n,u){n.tag===a.tag&&n.kind===a.kind&&o.push(u)}),r.push(a)}),r.filter(function(a,n){return o.indexOf(n)===-1})}function v8e(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function o(a){t[a.kind][a.tag]=t.fallback[a.tag]=a}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(o);return t}function Zd(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new DD("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=eT(this,"implicit",[]),this.compiledExplicit=eT(this,"explicit",[]),this.compiledTypeMap=v8e(this.compiledImplicit,this.compiledExplicit)}Zd.DEFAULT=null;Zd.create=function(){var e,r;switch(arguments.length){case 1:e=Zd.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new DD("Wrong number of arguments for Schema.create function")}if(e=hW.toArray(e),r=hW.toArray(r),!e.every(function(o){return o instanceof Zd}))throw new DD("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(o){return o instanceof B8e}))throw new DD("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Zd({include:e,explicit:r})};gW.exports=Zd});var mW=_((Kbt,dW)=>{"use strict";var D8e=ls();dW.exports=new D8e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var EW=_((Vbt,yW)=>{"use strict";var P8e=ls();yW.exports=new P8e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var wW=_((zbt,CW)=>{"use strict";var S8e=ls();CW.exports=new S8e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var PD=_((Jbt,IW)=>{"use strict";var b8e=Y0();IW.exports=new b8e({explicit:[mW(),EW(),wW()]})});var vW=_((Xbt,BW)=>{"use strict";var x8e=ls();function k8e(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Q8e(){return null}function F8e(t){return t===null}BW.exports=new x8e("tag:yaml.org,2002:null",{kind:"scalar",resolve:k8e,construct:Q8e,predicate:F8e,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var PW=_((Zbt,DW)=>{"use strict";var R8e=ls();function T8e(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function N8e(t){return t==="true"||t==="True"||t==="TRUE"}function L8e(t){return Object.prototype.toString.call(t)==="[object Boolean]"}DW.exports=new R8e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:T8e,construct:N8e,predicate:L8e,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var bW=_(($bt,SW)=>{"use strict";var M8e=G0(),O8e=ls();function U8e(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function _8e(t){return 48<=t&&t<=55}function H8e(t){return 48<=t&&t<=57}function q8e(t){if(t===null)return!1;var e=t.length,r=0,o=!1,a;if(!e)return!1;if(a=t[r],(a==="-"||a==="+")&&(a=t[++r]),a==="0"){if(r+1===e)return!0;if(a=t[++r],a==="b"){for(r++;r<e;r++)if(a=t[r],a!=="_"){if(a!=="0"&&a!=="1")return!1;o=!0}return o&&a!=="_"}if(a==="x"){for(r++;r<e;r++)if(a=t[r],a!=="_"){if(!U8e(t.charCodeAt(r)))return!1;o=!0}return o&&a!=="_"}for(;r<e;r++)if(a=t[r],a!=="_"){if(!_8e(t.charCodeAt(r)))return!1;o=!0}return o&&a!=="_"}if(a==="_")return!1;for(;r<e;r++)if(a=t[r],a!=="_"){if(a===":")break;if(!H8e(t.charCodeAt(r)))return!1;o=!0}return!o||a==="_"?!1:a!==":"?!0:/^(:[0-5]?[0-9])+$/.test(t.slice(r))
Line truncated
|
||||
\r`;function aHe(t){if(t===null)return!1;var e,r,o=0,a=t.length,n=nT;for(r=0;r<a;r++)if(e=n.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;o+=6}return o%8===0}function lHe(t){var e,r,o=t.replace(/[\r\n=]/g,""),a=o.length,n=nT,u=0,A=[];for(e=0;e<a;e++)e%4===0&&e&&(A.push(u>>16&255),A.push(u>>8&255),A.push(u&255)),u=u<<6|n.indexOf(o.charAt(e));return r=a%4*6,r===0?(A.push(u>>16&255),A.push(u>>8&255),A.push(u&255)):r===18?(A.push(u>>10&255),A.push(u>>2&255)):r===12&&A.push(u>>4&255),W0?W0.from?W0.from(A):new W0(A):A}function cHe(t){var e="",r=0,o,a,n=t.length,u=nT;for(o=0;o<n;o++)o%3===0&&o&&(e+=u[r>>18&63],e+=u[r>>12&63],e+=u[r>>6&63],e+=u[r&63]),r=(r<<8)+t[o];return a=n%3,a===0?(e+=u[r>>18&63],e+=u[r>>12&63],e+=u[r>>6&63],e+=u[r&63]):a===2?(e+=u[r>>10&63],e+=u[r>>4&63],e+=u[r<<2&63],e+=u[64]):a===1&&(e+=u[r>>2&63],e+=u[r<<4&63],e+=u[64],e+=u[64]),e}function uHe(t){return W0&&W0.isBuffer(t)}HW.exports=new oHe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:aHe,construct:lHe,predicate:uHe,represent:cHe})});var GW=_((axt,jW)=>{"use strict";var AHe=ls(),fHe=Object.prototype.hasOwnProperty,pHe=Object.prototype.toString;function hHe(t){if(t===null)return!0;var e=[],r,o,a,n,u,A=t;for(r=0,o=A.length;r<o;r+=1){if(a=A[r],u=!1,pHe.call(a)!=="[object Object]")return!1;for(n in a)if(fHe.call(a,n))if(!u)u=!0;else return!1;if(!u)return!1;if(e.indexOf(n)===-1)e.push(n);else return!1}return!0}function gHe(t){return t!==null?t:[]}jW.exports=new AHe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:hHe,construct:gHe})});var WW=_((lxt,YW)=>{"use strict";var dHe=ls(),mHe=Object.prototype.toString;function yHe(t){if(t===null)return!0;var e,r,o,a,n,u=t;for(n=new Array(u.length),e=0,r=u.length;e<r;e+=1){if(o=u[e],mHe.call(o)!=="[object Object]"||(a=Object.keys(o),a.length!==1))return!1;n[e]=[a[0],o[a[0]]]}return!0}function EHe(t){if(t===null)return[];var e,r,o,a,n,u=t;for(n=new Array(u.length),e=0,r=u.length;e<r;e+=1)o=u[e],a=Object.keys(o),n[e]=[a[0],o[a[0]]];return n}YW.exports=new dHe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yHe,construct:EHe})});var VW=_((cxt,KW)=>{"use strict";var CHe=ls(),wHe=Object.prototype.hasOwnProperty;function IHe(t){if(t===null)return!0;var e,r=t;for(e in r)if(wHe.call(r,e)&&r[e]!==null)return!1;return!0}function BHe(t){return t!==null?t:{}}KW.exports=new CHe("tag:yaml.org,2002:set",{kind:"mapping",resolve:IHe,construct:BHe})});var $d=_((uxt,zW)=>{"use strict";var vHe=Y0();zW.exports=new vHe({include:[rT()],implicit:[MW(),UW()],explicit:[qW(),GW(),WW(),VW()]})});var XW=_((Axt,JW)=>{"use strict";var DHe=ls();function PHe(){return!0}function SHe(){}function bHe(){return""}function xHe(t){return typeof t>"u"}JW.exports=new DHe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:PHe,construct:SHe,predicate:xHe,represent:bHe})});var $W=_((fxt,ZW)=>{"use strict";var kHe=ls();function QHe(t){if(t===null||t.length===0)return!1;var e=t,r=/\/([gim]*)$/.exec(t),o="";return!(e[0]==="/"&&(r&&(o=r[1]),o.length>3||e[e.length-o.length-1]!=="/"))}function FHe(t){var e=t,r=/\/([gim]*)$/.exec(t),o="";return e[0]==="/"&&(r&&(o=r[1]),e=e.slice(1,e.length-o.length-1)),new RegExp(e,o)}function RHe(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function THe(t){return Object.prototype.toString.call(t)==="[object RegExp]"}ZW.exports=new kHe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:QHe,construct:FHe,predicate:THe,represent:RHe})});var rK=_((pxt,tK)=>{"use strict";var SD;try{eK=ve,SD=eK("esprima")}catch{typeof window<"u"&&(SD=window.esprima)}var eK,NHe=ls();function LHe(t){if(t===null)return!1;try{var e="("+t+")",r=SD.parse(e,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function MHe(t){var e="("+t+")",r=SD.parse(e,{range:!0}),o=[],a;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(n){o.push(n.name)}),a=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement"?new Function(o,e.slice(a[0]+1,a[1]-1)):new Function(o,"return "+e.slice(a[0],a[1]))}function OHe(t){return t.toString()}function UHe(t){return Object.prototype.toString.call(t)==="[object Function]"}tK.exports=new NHe("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:LHe,construct:MHe,predicate:UHe,represent:OHe})});var Rw=_((gxt,iK)=>{"use strict";var nK=Y0();iK.exports=nK.DEFAULT=new nK({include:[$d()],explicit:[XW(),$W(),rK()]})});var BK=_((dxt,Tw)=>{"use strict";var mf=G0(),AK=Xd(),_He=AW(),fK=$d(),HHe=Rw(),qp=Object.prototype.hasOwnProperty,bD=1,pK=2,hK=3,xD=4,iT=1,qHe=2,sK=3,jHe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uD
Line truncated
|
||||
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function zHe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var mK=new Array(256),yK=new Array(256);for(K0=0;K0<256;K0++)mK[K0]=aK(K0)?1:0,yK[K0]=aK(K0);var K0;function JHe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||HHe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function EK(t,e){return new AK(e,new _He(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function Sr(t,e){throw EK(t,e)}function kD(t,e){t.onWarning&&t.onWarning.call(null,EK(t,e))}var lK={YAML:function(e,r,o){var a,n,u;e.version!==null&&Sr(e,"duplication of %YAML directive"),o.length!==1&&Sr(e,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),a===null&&Sr(e,"ill-formed argument of the YAML directive"),n=parseInt(a[1],10),u=parseInt(a[2],10),n!==1&&Sr(e,"unacceptable YAML version of the document"),e.version=o[0],e.checkLineBreaks=u<2,u!==1&&u!==2&&kD(e,"unsupported YAML version of the document")},TAG:function(e,r,o){var a,n;o.length!==2&&Sr(e,"TAG directive accepts exactly two arguments"),a=o[0],n=o[1],gK.test(a)||Sr(e,"ill-formed tag handle (first argument) of the TAG directive"),qp.call(e.tagMap,a)&&Sr(e,'there is a previously declared suffix for "'+a+'" tag handle'),dK.test(n)||Sr(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[a]=n}};function Hp(t,e,r,o){var a,n,u,A;if(e<r){if(A=t.input.slice(e,r),o)for(a=0,n=A.length;a<n;a+=1)u=A.charCodeAt(a),u===9||32<=u&&u<=1114111||Sr(t,"expected valid JSON character");else jHe.test(A)&&Sr(t,"the stream contains non-printable characters");t.result+=A}}function cK(t,e,r,o){var a,n,u,A;for(mf.isObject(r)||Sr(t,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(r),u=0,A=a.length;u<A;u+=1)n=a[u],qp.call(e,n)||(e[n]=r[n],o[n]=!0)}function tm(t,e,r,o,a,n,u,A){var p,h;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),p=0,h=a.length;p<h;p+=1)Array.isArray(a[p])&&Sr(t,"nested arrays are not supported inside keys"),typeof a=="object"&&oK(a[p])==="[object Object]"&&(a[p]="[object Object]");if(typeof a=="object"&&oK(a)==="[object Object]"&&(a="[object Object]"),a=String(a),e===null&&(e={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(n))for(p=0,h=n.length;p<h;p+=1)cK(t,e,n[p],r);else cK(t,e,n,r);else!t.json&&!qp.call(r,a)&&qp.call(e,a)&&(t.line=u||t.line,t.position=A||t.position,Sr(t,"duplicated mapping key")),e[a]=n,delete r[a];return e}function sT(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Sr(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function Wi(t,e,r){for(var o=0,a=t.input.charCodeAt(t.position);a!==0;){for(;V0(a);)a=t.input.charCodeAt(++t.position);if(e&&a===35)do a=t.input.charCodeAt(++t.position);while(a!==10&&a!==13&&a!==0);if(ju(a))for(sT(t),a=t.input.charCodeAt(t.position),o++,t.lineIndent=0;a===32;)t.lineIndent++,a=t.input.charCodeAt(++t.position);else break}return r!==-1&&o!==0&&t.lineIndent<r&&kD(t,"deficient indentation"),o}function QD(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||va(r)))}function oT(t,e){e===1?t.result+=" ":e>1&&(t.result+=mf.repeat(`
|
||||
`,e-1))}function XHe(t,e,r){var o,a,n,u,A,p,h,E,I=t.kind,v=t.result,x;if(x=t.input.charCodeAt(t.position),va(x)||em(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(a=t.input.charCodeAt(t.position+1),va(a)||r&&em(a)))return!1;for(t.kind="scalar",t.result="",n=u=t.position,A=!1;x!==0;){if(x===58){if(a=t.input.charCodeAt(t.position+1),va(a)||r&&em(a))break}else if(x===35){if(o=t.input.charCodeAt(t.position-1),va(o))break}else{if(t.position===t.lineStart&&QD(t)||r&&em(x))break;if(ju(x))if(p=t.line,h=t.lineStart,E=t.lineIndent,Wi(t,!1,-1),t.lineIndent>=e){A=!0,x=t.input.charCodeAt(t.position);continue}else{t.position=u,t.line=p,t.lineStart=h,t.lineIndent=E;break}}A&&(Hp(t,n,u,!1),oT(t,t.line-p),n=u=t.position,A=!1),V0(x)||(u=t.position+1),x=t.input.charCodeAt(++t.position)}return Hp(t,n,u,!1),t.result?!0:(t.kind=I,t.result=v,!1)}function ZHe(t,e){var r,o,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,o=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Hp(t,o,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)o=t.position,t.position++,a=t.position;else return!0;else ju(r)?(Hp(t,o,a,!0),oT(t,Wi(t,!1,e)),o=a=t.position):t.position===t.lineStart&&QD(t)?Sr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,a=t.position);Sr(t,"unexpected end of the stream within a single quoted scalar")}function $He(t,e){var r,o,a,n,u,A;if(A=t.input.charCodeAt(t.position),A!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=o=t.position;(A=t.input.charCodeAt(t.position))!==0;){if(A===34)return Hp(t,r,t.position,!0),t.position++,!0;if(A===92){if(Hp(t,r,t.position,!0),A=t.input.charCodeAt(++t.position),ju(A))Wi(t,!1,e);else if(A<256&&mK[A])t.result+=yK[A],t.position++;else if((u=KHe(A))>0){for(a=u,n=0;a>0;a--)A=t.input.charCodeAt(++t.position),(u=WHe(A))>=0?n=(n<<4)+u:Sr(t,"expected hexadecimal character");t.result+=zHe(n),t.position++}else Sr(t,"unknown escape sequence");r=o=t.position}else ju(A)?(Hp(t,r,o,!0),oT(t,Wi(t,!1,e)),r=o=t.position):t.position===t.lineStart&&QD(t)?Sr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,o=t.position)}Sr(t,"unexpected end of the stream within a double quoted scalar")}function e6e(t,e){var r=!0,o,a=t.tag,n,u=t.anchor,A,p,h,E,I,v={},x,C,R,L;if(L=t.input.charCodeAt(t.position),L===91)p=93,I=!1,n=[];else if(L===123)p=125,I=!0,n={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),L=t.input.charCodeAt(++t.position);L!==0;){if(Wi(t,!0,e),L=t.input.charCodeAt(t.position),L===p)return t.position++,t.tag=a,t.anchor=u,t.kind=I?"mapping":"sequence",t.result=n,!0;r||Sr(t,"missed comma between flow collection entries"),C=x=R=null,h=E=!1,L===63&&(A=t.input.charCodeAt(t.position+1),va(A)&&(h=E=!0,t.position++,Wi(t,!0,e))),o=t.line,rm(t,e,bD,!1,!0),C=t.tag,x=t.result,Wi(t,!0,e),L=t.input.charCodeAt(t.position),(E||t.line===o)&&L===58&&(h=!0,L=t.input.charCodeAt(++t.position),Wi(t,!0,e),rm(t,e,bD,!1,!0),R=t.result),I?tm(t,n,v,C,x,R):h?n.push(tm(t,null,v,C,x,R)):n.push(x),Wi(t,!0,e),L=t.input.charCodeAt(t.position),L===44?(r=!0,L=t.input.charCodeAt(++t.position)):r=!1}Sr(t,"unexpected end of the stream within a flow collection")}function t6e(t,e){var r,o,a=iT,n=!1,u=!1,A=e,p=0,h=!1,E,I;if(I=t.input.charCodeAt(t.position),I===124)o=!1;else if(I===62)o=!0;else return!1;for(t.kind="scalar",t.result="";I!==0;)if(I=t.input.charCodeAt(++t.position),I===43||I===45)iT===a?a=I===43?sK:qHe:Sr(t,"repeat of a chomping mode identifier");else if((E=VHe(I))>=0)E===0?Sr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?Sr(t,"repeat of an indentation width identifier"):(A=e+E-1,u=!0);else break;if(V0(I)){do I=t.input.charCodeAt(++t.position);while(V0(I));if(I===35)do I=t.input.charCodeAt(++t.position);while(!ju(I)&&I!==0)}for(;I!==0;){for(sT(t),t.lineIndent=0,I=t.input.charCodeAt(t.position);(!u||t.lineIndent<A)&&I===32;)t.lineIndent++,I=t.input.charCodeAt(++t.position);if(!u&&t.lineIndent>A&&(A=t.lineIndent),ju(I)){p++;continue}if(t.lineIndent<A){a===sK?t.result+=mf.repeat(`
|
||||
`,n?1+p:p):a===iT&&n&&(t.result+=`
|
||||
`);break}for(o?V0(I)?(h=!0,t.result+=mf.repeat(`
|
||||
`,n?1+p:p)):h?(h=!1,t.result+=mf.repeat(`
|
||||
`,p+1)):p===0?n&&(t.result+=" "):t.result+=mf.repeat(`
|
||||
`,p):t.result+=mf.repeat(`
|
||||
`,n?1+p:p),n=!0,u=!0,p=0,r=t.position;!ju(I)&&I!==0;)I=t.input.charCodeAt(++t.position);Hp(t,r,t.position,!1)}return!0}function uK(t,e){var r,o=t.tag,a=t.anchor,n=[],u,A=!1,p;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),p=t.input.charCodeAt(t.position);p!==0&&!(p!==45||(u=t.input.charCodeAt(t.position+1),!va(u)));){if(A=!0,t.position++,Wi(t,!0,-1)&&t.lineIndent<=e){n.push(null),p=t.input.charCodeAt(t.position);continue}if(r=t.line,rm(t,e,hK,!1,!0),n.push(t.result),Wi(t,!0,-1),p=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&p!==0)Sr(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return A?(t.tag=o,t.anchor=a,t.kind="sequence",t.result=n,!0):!1}function r6e(t,e,r){var o,a,n,u,A=t.tag,p=t.anchor,h={},E={},I=null,v=null,x=null,C=!1,R=!1,L;for(t.anchor!==null&&(t.anchorMap[t.anchor]=h),L=t.input.charCodeAt(t.position);L!==0;){if(o=t.input.charCodeAt(t.position+1),n=t.line,u=t.position,(L===63||L===58)&&va(o))L===63?(C&&(tm(t,h,E,I,v,null),I=v=x=null),R=!0,C=!0,a=!0):C?(C=!1,a=!0):Sr(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,L=o;else if(rm(t,r,pK,!1,!0))if(t.line===n){for(L=t.input.charCodeAt(t.position);V0(L);)L=t.input.charCodeAt(++t.position);if(L===58)L=t.input.charCodeAt(++t.position),va(L)||Sr(t,"a whitespace character is expected after the key-value separator within a block mapping"),C&&(tm(t,h,E,I,v,null),I=v=x=null),R=!0,C=!1,a=!1,I=t.tag,v=t.result;else if(R)Sr(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=A,t.anchor=p,!0}else if(R)Sr(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=A,t.anchor=p,!0;else break;if((t.line===n||t.lineIndent>e)&&(rm(t,e,xD,!0,a)&&(C?v=t.result:x=t.result),C||(tm(t,h,E,I,v,x,n,u),I=v=x=null),Wi(t,!0,-1),L=t.input.charCodeAt(t.position)),t.lineIndent>e&&L!==0)Sr(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return C&&tm(t,h,E,I,v,null),R&&(t.tag=A,t.anchor=p,t.kind="mapping",t.result=h),R}function n6e(t){var e,r=!1,o=!1,a,n,u;if(u=t.input.charCodeAt(t.position),u!==33)return!1;if(t.tag!==null&&Sr(t,"duplication of a tag property"),u=t.input.charCodeAt(++t.position),u===60?(r=!0,u=t.input.charCodeAt(++t.position)):u===33?(o=!0,a="!!",u=t.input.charCodeAt(++t.position)):a="!",e=t.position,r){do u=t.input.charCodeAt(++t.position);while(u!==0&&u!==62);t.position<t.length?(n=t.input.slice(e,t.position),u=t.input.charCodeAt(++t.position)):Sr(t,"unexpected end of the stream within a verbatim tag")}else{for(;u!==0&&!va(u);)u===33&&(o?Sr(t,"tag suffix cannot contain exclamation marks"):(a=t.input.slice(e-1,t.position+1),gK.test(a)||Sr(t,"named tag handle cannot contain such characters"),o=!0,e=t.position+1)),u=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),YHe.test(n)&&Sr(t,"tag suffix cannot contain flow indicator characters")}return n&&!dK.test(n)&&Sr(t,"tag name cannot contain such characters: "+n),r?t.tag=n:qp.call(t.tagMap,a)?t.tag=t.tagMap[a]+n:a==="!"?t.tag="!"+n:a==="!!"?t.tag="tag:yaml.org,2002:"+n:Sr(t,'undeclared tag handle "'+a+'"'),!0}function i6e(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&Sr(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!va(r)&&!em(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Sr(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function s6e(t){var e,r,o;if(o=t.input.charCodeAt(t.position),o!==42)return!1;for(o=t.input.charCodeAt(++t.position),e=t.position;o!==0&&!va(o)&&!em(o);)o=t.input.charCodeAt(++t.position);return t.position===e&&Sr(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),qp.call(t.anchorMap,r)||Sr(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],Wi(t,!0,-1),!0}function rm(t,e,r,o,a){var n,u,A,p=1,h=!1,E=!1,I,v,x,C,R;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,n=u=A=xD===r||hK===r,o&&Wi(t,!0,-1)&&(h=!0,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)),p===1)for(;n6e(t)||i6e(t);)Wi(t,!0,-1)?(h=!0,A=n,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)):A=!1;if(A&&(A=h||a),(p===1||xD===r)&&(bD===r||pK===r?C=e:C=e+1,R=t.position-t.lineStart,p===1?A&&(uK(t,R)||r6e(t,R,C))||e6e(t,C)?E=!0:(u&&t6e(t,C)||ZHe(t,C)||$He(t,C)?E=!0:s6e(t)?(E=!0,(t.tag!==null||t.anchor!==null)&&Sr(t,"alias node should not have any properties")):XHe(t,C,bD===r)&&(E=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):p===0&&(E=A&&uK(t,R))),t.tag!==null&&t.tag!=="!")if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&Sr(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),I=0,v=t.implicitTypes.length;I<v;I+=1)if(x=t.implicitTypes[I],x.resolve(t.result)){t.result=x.construct(t.result),t.tag=x.tag
Line truncated
|
||||
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new JHe(t,e),o=t.indexOf("\0");for(o!==-1&&(r.position=o,Sr(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)o6e(r);return r.documents}function wK(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var o=CK(t,r);if(typeof e!="function")return o;for(var a=0,n=o.length;a<n;a+=1)e(o[a])}function IK(t,e){var r=CK(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new AK("expected a single document in the stream, but found more")}}function a6e(t,e,r){return typeof e=="object"&&e!==null&&typeof r>"u"&&(r=e,e=null),wK(t,e,mf.extend({schema:fK},r))}function l6e(t,e){return IK(t,mf.extend({schema:fK},e))}Tw.exports.loadAll=wK;Tw.exports.load=IK;Tw.exports.safeLoadAll=a6e;Tw.exports.safeLoad=l6e});var WK=_((mxt,uT)=>{"use strict";var Lw=G0(),Mw=Xd(),c6e=Rw(),u6e=$d(),QK=Object.prototype.toString,FK=Object.prototype.hasOwnProperty,A6e=9,Nw=10,f6e=13,p6e=32,h6e=33,g6e=34,RK=35,d6e=37,m6e=38,y6e=39,E6e=42,TK=44,C6e=45,NK=58,w6e=61,I6e=62,B6e=63,v6e=64,LK=91,MK=93,D6e=96,OK=123,P6e=124,UK=125,vo={};vo[0]="\\0";vo[7]="\\a";vo[8]="\\b";vo[9]="\\t";vo[10]="\\n";vo[11]="\\v";vo[12]="\\f";vo[13]="\\r";vo[27]="\\e";vo[34]='\\"';vo[92]="\\\\";vo[133]="\\N";vo[160]="\\_";vo[8232]="\\L";vo[8233]="\\P";var S6e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function b6e(t,e){var r,o,a,n,u,A,p;if(e===null)return{};for(r={},o=Object.keys(e),a=0,n=o.length;a<n;a+=1)u=o[a],A=String(e[u]),u.slice(0,2)==="!!"&&(u="tag:yaml.org,2002:"+u.slice(2)),p=t.compiledTypeMap.fallback[u],p&&FK.call(p.styleAliases,A)&&(A=p.styleAliases[A]),r[u]=A;return r}function vK(t){var e,r,o;if(e=t.toString(16).toUpperCase(),t<=255)r="x",o=2;else if(t<=65535)r="u",o=4;else if(t<=4294967295)r="U",o=8;else throw new Mw("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Lw.repeat("0",o-e.length)+e}function x6e(t){this.schema=t.schema||c6e,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Lw.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=b6e(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function DK(t,e){for(var r=Lw.repeat(" ",e),o=0,a=-1,n="",u,A=t.length;o<A;)a=t.indexOf(`
|
||||
`,o),a===-1?(u=t.slice(o),o=A):(u=t.slice(o,a+1),o=a+1),u.length&&u!==`
|
||||
`&&(n+=r),n+=u;return n}function aT(t,e){return`
|
||||
`+Lw.repeat(" ",t.indent*e)}function k6e(t,e){var r,o,a;for(r=0,o=t.implicitTypes.length;r<o;r+=1)if(a=t.implicitTypes[r],a.resolve(e))return!0;return!1}function cT(t){return t===p6e||t===A6e}function nm(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function Q6e(t){return nm(t)&&!cT(t)&&t!==65279&&t!==f6e&&t!==Nw}function PK(t,e){return nm(t)&&t!==65279&&t!==TK&&t!==LK&&t!==MK&&t!==OK&&t!==UK&&t!==NK&&(t!==RK||e&&Q6e(e))}function F6e(t){return nm(t)&&t!==65279&&!cT(t)&&t!==C6e&&t!==B6e&&t!==NK&&t!==TK&&t!==LK&&t!==MK&&t!==OK&&t!==UK&&t!==RK&&t!==m6e&&t!==E6e&&t!==h6e&&t!==P6e&&t!==w6e&&t!==I6e&&t!==y6e&&t!==g6e&&t!==d6e&&t!==v6e&&t!==D6e}function _K(t){var e=/^\n* /;return e.test(t)}var HK=1,qK=2,jK=3,GK=4,FD=5;function R6e(t,e,r,o,a){var n,u,A,p=!1,h=!1,E=o!==-1,I=-1,v=F6e(t.charCodeAt(0))&&!cT(t.charCodeAt(t.length-1));if(e)for(n=0;n<t.length;n++){if(u=t.charCodeAt(n),!nm(u))return FD;A=n>0?t.charCodeAt(n-1):null,v=v&&PK(u,A)}else{for(n=0;n<t.length;n++){if(u=t.charCodeAt(n),u===Nw)p=!0,E&&(h=h||n-I-1>o&&t[I+1]!==" ",I=n);else if(!nm(u))return FD;A=n>0?t.charCodeAt(n-1):null,v=v&&PK(u,A)}h=h||E&&n-I-1>o&&t[I+1]!==" "}return!p&&!h?v&&!a(t)?HK:qK:r>9&&_K(t)?FD:h?GK:jK}function T6e(t,e,r,o){t.dump=function(){if(e.length===0)return"''";if(!t.noCompatMode&&S6e.indexOf(e)!==-1)return"'"+e+"'";var a=t.indent*Math.max(1,r),n=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),u=o||t.flowLevel>-1&&r>=t.flowLevel;function A(p){return k6e(t,p)}switch(R6e(e,u,t.indent,n,A)){case HK:return e;case qK:return"'"+e.replace(/'/g,"''")+"'";case jK:return"|"+SK(e,t.indent)+bK(DK(e,a));case GK:return">"+SK(e,t.indent)+bK(DK(N6e(e,n),a));case FD:return'"'+L6e(e,n)+'"';default:throw new Mw("impossible error: invalid scalar style")}}()}function SK(t,e){var r=_K(t)?String(e):"",o=t[t.length-1]===`
|
||||
`,a=o&&(t[t.length-2]===`
|
||||
`||t===`
|
||||
`),n=a?"+":o?"":"-";return r+n+`
|
||||
`}function bK(t){return t[t.length-1]===`
|
||||
`?t.slice(0,-1):t}function N6e(t,e){for(var r=/(\n+)([^\n]*)/g,o=function(){var h=t.indexOf(`
|
||||
`);return h=h!==-1?h:t.length,r.lastIndex=h,xK(t.slice(0,h),e)}(),a=t[0]===`
|
||||
`||t[0]===" ",n,u;u=r.exec(t);){var A=u[1],p=u[2];n=p[0]===" ",o+=A+(!a&&!n&&p!==""?`
|
||||
`:"")+xK(p,e),a=n}return o}function xK(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,o,a=0,n,u=0,A=0,p="";o=r.exec(t);)A=o.index,A-a>e&&(n=u>a?u:A,p+=`
|
||||
`+t.slice(a,n),a=n+1),u=A;return p+=`
|
||||
`,t.length-a>e&&u>a?p+=t.slice(a,u)+`
|
||||
`+t.slice(u+1):p+=t.slice(a),p.slice(1)}function L6e(t){for(var e="",r,o,a,n=0;n<t.length;n++){if(r=t.charCodeAt(n),r>=55296&&r<=56319&&(o=t.charCodeAt(n+1),o>=56320&&o<=57343)){e+=vK((r-55296)*1024+o-56320+65536),n++;continue}a=vo[r],e+=!a&&nm(r)?t[n]:a||vK(r)}return e}function M6e(t,e,r){var o="",a=t.tag,n,u;for(n=0,u=r.length;n<u;n+=1)z0(t,e,r[n],!1,!1)&&(n!==0&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=a,t.dump="["+o+"]"}function O6e(t,e,r,o){var a="",n=t.tag,u,A;for(u=0,A=r.length;u<A;u+=1)z0(t,e+1,r[u],!0,!0)&&((!o||u!==0)&&(a+=aT(t,e)),t.dump&&Nw===t.dump.charCodeAt(0)?a+="-":a+="- ",a+=t.dump);t.tag=n,t.dump=a||"[]"}function U6e(t,e,r){var o="",a=t.tag,n=Object.keys(r),u,A,p,h,E;for(u=0,A=n.length;u<A;u+=1)E="",u!==0&&(E+=", "),t.condenseFlow&&(E+='"'),p=n[u],h=r[p],z0(t,e,p,!1,!1)&&(t.dump.length>1024&&(E+="? "),E+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),z0(t,e,h,!1,!1)&&(E+=t.dump,o+=E));t.tag=a,t.dump="{"+o+"}"}function _6e(t,e,r,o){var a="",n=t.tag,u=Object.keys(r),A,p,h,E,I,v;if(t.sortKeys===!0)u.sort();else if(typeof t.sortKeys=="function")u.sort(t.sortKeys);else if(t.sortKeys)throw new Mw("sortKeys must be a boolean or a function");for(A=0,p=u.length;A<p;A+=1)v="",(!o||A!==0)&&(v+=aT(t,e)),h=u[A],E=r[h],z0(t,e+1,h,!0,!0,!0)&&(I=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,I&&(t.dump&&Nw===t.dump.charCodeAt(0)?v+="?":v+="? "),v+=t.dump,I&&(v+=aT(t,e)),z0(t,e+1,E,!0,I)&&(t.dump&&Nw===t.dump.charCodeAt(0)?v+=":":v+=": ",v+=t.dump,a+=v));t.tag=n,t.dump=a||"{}"}function kK(t,e,r){var o,a,n,u,A,p;for(a=r?t.explicitTypes:t.implicitTypes,n=0,u=a.length;n<u;n+=1)if(A=a[n],(A.instanceOf||A.predicate)&&(!A.instanceOf||typeof e=="object"&&e instanceof A.instanceOf)&&(!A.predicate||A.predicate(e))){if(t.tag=r?A.tag:"?",A.represent){if(p=t.styleMap[A.tag]||A.defaultStyle,QK.call(A.represent)==="[object Function]")o=A.represent(e,p);else if(FK.call(A.represent,p))o=A.represent[p](e,p);else throw new Mw("!<"+A.tag+'> tag resolver accepts not "'+p+'" style');t.dump=o}return!0}return!1}function z0(t,e,r,o,a,n){t.tag=null,t.dump=r,kK(t,r,!1)||kK(t,r,!0);var u=QK.call(t.dump);o&&(o=t.flowLevel<0||t.flowLevel>e);var A=u==="[object Object]"||u==="[object Array]",p,h;if(A&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(a=!1),h&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(A&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),u==="[object Object]")o&&Object.keys(t.dump).length!==0?(_6e(t,e,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(U6e(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(u==="[object Array]"){var E=t.noArrayIndent&&e>0?e-1:e;o&&t.dump.length!==0?(O6e(t,E,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(M6e(t,E,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump))}else if(u==="[object String]")t.tag!=="?"&&T6e(t,t.dump,e,n);else{if(t.skipInvalid)return!1;throw new Mw("unacceptable kind of an object to dump "+u)}t.tag!==null&&t.tag!=="?"&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function H6e(t,e){var r=[],o=[],a,n;for(lT(t,r,o),a=0,n=o.length;a<n;a+=1)e.duplicates.push(r[o[a]]);e.usedDuplicates=new Array(n)}function lT(t,e,r){var o,a,n;if(t!==null&&typeof t=="object")if(a=e.indexOf(t),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(e.push(t),Array.isArray(t))for(a=0,n=t.length;a<n;a+=1)lT(t[a],e,r);else for(o=Object.keys(t),a=0,n=o.length;a<n;a+=1)lT(t[o[a]],e,r)}function YK(t,e){e=e||{};var r=new x6e(e);return r.noRefs||H6e(t,r),z0(r,0,t,!0,!0)?r.dump+`
|
||||
`:""}function q6e(t,e){return YK(t,Lw.extend({schema:u6e},e))}uT.exports.dump=YK;uT.exports.safeDump=q6e});var VK=_((yxt,xi)=>{"use strict";var RD=BK(),KK=WK();function TD(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}xi.exports.Type=ls();xi.exports.Schema=Y0();xi.exports.FAILSAFE_SCHEMA=PD();xi.exports.JSON_SCHEMA=tT();xi.exports.CORE_SCHEMA=rT();xi.exports.DEFAULT_SAFE_SCHEMA=$d();xi.exports.DEFAULT_FULL_SCHEMA=Rw();xi.exports.load=RD.load;xi.exports.loadAll=RD.loadAll;xi.exports.safeLoad=RD.safeLoad;xi.exports.safeLoadAll=RD.safeLoadAll;xi.exports.dump=KK.dump;xi.exports.safeDump=KK.safeDump;xi.exports.YAMLException=Xd();xi.exports.MINIMAL_SCHEMA=PD();xi.exports.SAFE_SCHEMA=$d();xi.exports.DEFAULT_SCHEMA=Rw();xi.exports.scan=TD("scan");xi.exports.parse=TD("parse");xi.exports.compose=TD("compose");xi.exports.addConstructor=TD("addConstructor")});var JK=_((Ext,zK)=>{"use strict";var j6e=VK();zK.exports=j6e});var ZK=_((Cxt,XK)=>{"use strict";function G6e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function J0(t,e,r,o){this.message=t,this.expected=e,this.found=r,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,J0)}G6e(J0,Error);J0.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",I;for(I=0;I<h.parts.length;I++)E+=h.parts[I]instanceof Array?n(h.parts[I][0])+"-"+n(h.parts[I][1]):n(h.parts[I]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function o(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+o(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+o(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+o(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+o(E)})}function u(h){return r[h.type](h)}function A(h){var E=new Array(h.length),I,v;for(I=0;I<h.length;I++)E[I]=u(h[I]);if(E.sort(),E.length>0){for(I=1,v=1;I<E.length;I++)E[I-1]!==E[I]&&(E[v]=E[I],v++);E.length=v}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+A(t)+" but "+p(e)+" found."};function Y6e(t,e){e=e!==void 0?e:{};var r={},o={Start:gu},a=gu,n=function(ee){return[].concat(...ee)},u="-",A=Qn("-",!1),p=function(ee){return ee},h=function(ee){return Object.assign({},...ee)},E="#",I=Qn("#",!1),v=gc(),x=function(){return{}},C=":",R=Qn(":",!1),L=function(ee,ye){return{[ee]:ye}},U=",",z=Qn(",",!1),te=function(ee,ye){return ye},ae=function(ee,ye,Le){return Object.assign({},...[ee].concat(ye).map(ft=>({[ft]:Le})))},le=function(ee){return ee},ce=function(ee){return ee},Ce=aa("correct indentation"),de=" ",Be=Qn(" ",!1),Ee=function(ee){return ee.length===or*Bt},g=function(ee){return ee.length===(or+1)*Bt},me=function(){return or++,!0},we=function(){return or--,!0},Ae=function(){return DA()},ne=aa("pseudostring"),Z=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,xe=hi(["\r",`
|
||||
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Ne=/^[^\r\n\t ,\][{}:#"']/,ht=hi(["\r",`
|
||||
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),H=function(){return DA().replace(/^ *| *$/g,"")},rt="--",Te=Qn("--",!1),Fe=/^[a-zA-Z\/0-9]/,ke=hi([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Ye=/^[^\r\n\t :,]/,Se=hi(["\r",`
|
||||
`," "," ",":",","],!0,!1),et="null",Ue=Qn("null",!1),b=function(){return null},w="true",S=Qn("true",!1),y=function(){return!0},F="false",J=Qn("false",!1),X=function(){return!1},$=aa("string"),ie='"',be=Qn('"',!1),Re=function(){return""},at=function(ee){return ee},dt=function(ee){return ee.join("")},jt=/^[^"\\\0-\x1F\x7F]/,tr=hi(['"',"\\",["\0",""],"\x7F"],!0,!1),St='\\"',ln=Qn('\\"',!1),kr=function(){return'"'},mr="\\\\",br=Qn("\\\\",!1),Kr=function(){return"\\"},Kn="\\/",Ms=Qn("\\/",!1),Ri=function(){return"/"},gs="\\b",io=Qn("\\b",!1),Pi=function(){return"\b"},Os="\\f",so=Qn("\\f",!1),uc=function(){return"\f"},Au="\\n",sp=Qn("\\n",!1),op=function(){return`
|
||||
`},Us="\\r",Dn=Qn("\\r",!1),oo=function(){return"\r"},_s="\\t",ml=Qn("\\t",!1),yl=function(){return" "},ao="\\u",Vn=Qn("\\u",!1),Mn=function(ee,ye,Le,ft){return String.fromCharCode(parseInt(`0x${ee}${ye}${Le}${ft}`))},Ti=/^[0-9a-fA-F]/,On=hi([["0","9"],["a","f"],["A","F"]],!1,!1),_i=aa("blank space"),ir=/^[ \t]/,Me=hi([" "," "],!1,!1),ii=aa("white space"),Ha=/^[ \t\n\r]/,hr=hi([" "," ",`
|
||||
`,"\r"],!1,!1),Ac=`\r
|
||||
`,fu=Qn(`\r
|
||||
`,!1),fc=`
|
||||
`,El=Qn(`
|
||||
`,!1),vA="\r",pu=Qn("\r",!1),Ie=0,Tt=0,pc=[{line:1,column:1}],Hi=0,hu=[],Yt=0,Cl;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function DA(){return t.substring(Tt,Ie)}function ap(){return _o(Tt,Ie)}function hc(ee,ye){throw ye=ye!==void 0?ye:_o(Tt,Ie),dc([aa(ee)],t.substring(Tt,Ie),ye)}function PA(ee,ye){throw ye=ye!==void 0?ye:_o(Tt,Ie),lo(ee,ye)}function Qn(ee,ye){return{type:"literal",text:ee,ignoreCase:ye}}function hi(ee,ye,Le){return{type:"class",parts:ee,inverted:ye,ignoreCase:Le}}function gc(){return{type:"any"}}function SA(){return{type:"end"}}function aa(ee){return{type:"other",description:ee}}function Ni(ee){var ye=pc[ee],Le;if(ye)return ye;for(Le=ee-1;!pc[Le];)Le--;for(ye=pc[Le],ye={line:ye.line,column:ye.column};Le<ee;)t.charCodeAt(Le)===10?(ye.line++,ye.column=1):ye.column++,Le++;return pc[ee]=ye,ye}function _o(ee,ye){var Le=Ni(ee),ft=Ni(ye);return{start:{offset:ee,line:Le.line,column:Le.column},end:{offset:ye,line:ft.line,column:ft.column}}}function Xe(ee){Ie<Hi||(Ie>Hi&&(Hi=Ie,hu=[]),hu.push(ee))}function lo(ee,ye){return new J0(ee,null,null,ye)}function dc(ee,ye,Le){return new J0(J0.buildMessage(ee,ye),ee,ye,Le)}function gu(){var ee;return ee=bA(),ee}function qi(){var ee,ye,Le;for(ee=Ie,ye=[],Le=du();Le!==r;)ye.push(Le),Le=du();return ye!==r&&(Tt=ee,ye=n(ye)),ee=ye,ee}function du(){var ee,ye,Le,ft,pt;return ee=Ie,ye=ds(),ye!==r?(t.charCodeAt(Ie)===45?(Le=u,Ie++):(Le=r,Yt===0&&Xe(A)),Le!==r?(ft=Pn(),ft!==r?(pt=mc(),pt!==r?(Tt=ee,ye=p(pt),ee=ye):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r),ee}function bA(){var ee,ye,Le;for(ee=Ie,ye=[],Le=qa();Le!==r;)ye.push(Le),Le=qa();return ye!==r&&(Tt=ee,ye=h(ye)),ee=ye,ee}function qa(){var ee,ye,Le,ft,pt,Nt,rr,$r,ji;if(ee=Ie,ye=Pn(),ye===r&&(ye=null),ye!==r){if(Le=Ie,t.charCodeAt(Ie)===35?(ft=E,Ie++):(ft=r,Yt===0&&Xe(I)),ft!==r){if(pt=[],Nt=Ie,rr=Ie,Yt++,$r=tt(),Yt--,$r===r?rr=void 0:(Ie=rr,rr=r),rr!==r?(t.length>Ie?($r=t.charAt(Ie),Ie++):($r=r,Yt===0&&Xe(v)),$r!==r?(rr=[rr,$r],Nt=rr):(Ie=Nt,Nt=r)):(Ie=Nt,Nt=r),Nt!==r)for(;Nt!==r;)pt.push(Nt),Nt=Ie,rr=Ie,Yt++,$r=tt(),Yt--,$r===r?rr=void 0:(Ie=rr,rr=r),rr!==r?(t.length>Ie?($r=t.charAt(Ie),Ie++):($r=r,Yt===0&&Xe(v)),$r!==r?(rr=[rr,$r],Nt=rr):(Ie=Nt,Nt=r)):(Ie=Nt,Nt=r);else pt=r;pt!==r?(ft=[ft,pt],Le=ft):(Ie=Le,Le=r)}else Ie=Le,Le=r;if(Le===r&&(Le=null),Le!==r){if(ft=[],pt=We(),pt!==r)for(;pt!==r;)ft.push(pt),pt=We();else ft=r;ft!==r?(Tt=ee,ye=x(),ee=ye):(Ie=ee,ee=r)}else Ie=ee,ee=r}else Ie=ee,ee=r;if(ee===r&&(ee=Ie,ye=ds(),ye!==r?(Le=la(),Le!==r?(ft=Pn(),ft===r&&(ft=null),ft!==r?(t.charCodeAt(Ie)===58?(pt=C,Ie++):(pt=r,Yt===0&&Xe(R)),pt!==r?(Nt=Pn(),Nt===r&&(Nt=null),Nt!==r?(rr=mc(),rr!==r?(Tt=ee,ye=L(Le,rr),ee=ye):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r),ee===r&&(ee=Ie,ye=ds(),ye!==r?(Le=co(),Le!==r?(ft=Pn(),ft===r&&(ft=null),ft!==r?(t.charCodeAt(Ie)===58?(pt=C,Ie++):(pt=r,Yt===0&&Xe(R)),pt!==r?(Nt=Pn(),Nt===r&&(Nt=null),Nt!==r?(rr=mc(),rr!==r?(Tt=ee,ye=L(Le,rr),ee=ye):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r),ee===r))){if(ee=Ie,ye=ds(),ye!==r)if(Le=co(),Le!==r)if(ft=Pn(),ft!==r)if(pt=ca(),pt!==r){if(Nt=[],rr=We(),rr!==r)for(;rr!==r;)Nt.push(rr),rr=We();else Nt=r;Nt!==r?(Tt=ee,ye=L(Le,pt),ee=ye):(Ie=ee,ee=r)}else Ie=ee,ee=r;else Ie=ee,ee=r;else Ie=ee,ee=r;else Ie=ee,ee=r;if(ee===r)if(ee=Ie,ye=ds(),ye!==r)if(Le=co(),Le!==r){if(ft=[],pt=Ie,Nt=Pn(),Nt===r&&(Nt=null),Nt!==r?(t.charCodeAt(Ie)===44?(rr=U,Ie++):(rr=r,Yt===0&&Xe(z)),rr!==r?($r=Pn(),$r===r&&($r=null),$r!==r?(ji=co(),ji!==r?(Tt=pt,Nt=te(Le,ji),pt=Nt):(Ie=pt,pt=r)):(Ie=pt,pt=r)):(Ie=pt,pt=r)):(Ie=pt,pt=r),pt!==r)for(;pt!==r;)ft.push(pt),pt=Ie,Nt=Pn(),Nt===r&&(Nt=null),Nt!==r?(t.charCodeAt(Ie)===44?(rr=U,Ie++):(rr=r,Yt===0&&Xe(z)),rr!==r?($r=Pn(),$r===r&&($r=null),$r!==r?(ji=co(),ji!==r?(Tt=pt,Nt=te(Le,ji),pt=Nt):(Ie=pt,pt=r)):(Ie=pt,pt=r)):(Ie=pt,pt=r)):(Ie=pt,pt=r);else ft=r;ft!==r?(pt=Pn(),pt===r&&(pt=null),pt!==r?(t.charCodeAt(Ie)===58?(Nt=C,Ie++):(Nt=r,Yt===0&&Xe(R)),Nt!==r?(rr=Pn(),rr===r&&(rr=null),rr!==r?($r=mc(),$r!==r?(Tt=ee,ye=ae(Le,ft,$r),ee=ye):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)}else Ie=ee,ee=r;else Ie=ee,ee=r}return ee}function mc(){var ee,ye,Le,ft,pt,Nt,rr;if(ee=Ie,ye=Ie,Yt++,Le=Ie,ft=tt(),ft!==r?(pt=Ht(),pt!==r?(t.charCodeAt(Ie)===45?(Nt=u,Ie++):(Nt=r,Yt===0&&Xe(A)),Nt!==r?(rr=Pn(),rr!==r?(ft=[ft,pt,Nt,rr],Le=ft):(Ie=Le,Le=r)):(Ie=Le,Le=r)):(Ie=Le,Le=r)):(Ie=Le,Le=r),Yt--,Le!==r?(Ie=ye,ye=void 0):ye=r,ye!==r?(Le=We(),Le!==r?(ft=Fn(),ft!==r?(pt=qi(),pt!==r?(Nt=Ei(),Nt!==r?(Tt=ee,ye=le(pt),ee=ye):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r),ee===r&&(ee=Ie,ye=tt(),ye!==r?(Le=Fn(),Le!==r?(ft=bA(),ft!==r?(pt=Ei(),pt!==r?(Tt=ee,ye=le(ft),ee=ye):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r)):(Ie=ee,ee=r),ee===r))if(ee=Ie,ye=Hs(),ye!==r){if(Le=[],ft=We(),ft!==r)for(;ft!==r;)Le.push(ft),ft=We();else Le=r;Le!==r?(Tt=ee,yeLine truncated
|
||||
`;if(typeof t=="number"||typeof t=="boolean")return`${t.toString()}
|
||||
`;if(typeof t=="string")return`${eV(t)}
|
||||
`;if(Array.isArray(t)){if(t.length===0)return`[]
|
||||
`;let o=" ".repeat(e);return`
|
||||
${t.map(n=>`${o}- ${AT(n,e+1,!1)}`).join("")}`}if(typeof t=="object"&&t){let[o,a]=t instanceof ND?[t.data,!1]:[t,!0],n=" ".repeat(e),u=Object.keys(o);a&&u.sort((p,h)=>{let E=$K.indexOf(p),I=$K.indexOf(h);return E===-1&&I===-1?p<h?-1:p>h?1:0:E!==-1&&I===-1?-1:E===-1&&I!==-1?1:E-I});let A=u.filter(p=>!rV(o[p])).map((p,h)=>{let E=o[p],I=eV(p),v=AT(E,e+1,!0),x=h>0||r?n:"",C=I.length>1024?`? ${I}
|
||||
${x}:`:`${I}:`,R=v.startsWith(`
|
||||
`)?v:` ${v}`;return`${x}${C}${R}`}).join(e===0?`
|
||||
`:"")||`
|
||||
`;return r?`
|
||||
${A}`:`${A}`}throw new Error(`Unsupported value type (${t})`)}function Da(t){try{let e=AT(t,0,!1);return e!==`
|
||||
`?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}function K6e(t){return t.endsWith(`
|
||||
`)||(t+=`
|
||||
`),(0,tV.parse)(t)}function z6e(t){if(V6e.test(t))return K6e(t);let e=(0,LD.safeLoad)(t,{schema:LD.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function Ki(t){return z6e(t)}var LD,tV,W6e,$K,ND,V6e,nV=Et(()=>{LD=Ze(JK()),tV=Ze(ZK()),W6e=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,$K=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],ND=class{constructor(e){this.data=e}};Da.PreserveOrdering=ND;V6e=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i});var Ow={};Vt(Ow,{parseResolution:()=>BD,parseShell:()=>CD,parseSyml:()=>Ki,stringifyArgument:()=>XR,stringifyArgumentSegment:()=>ZR,stringifyArithmeticExpression:()=>ID,stringifyCommand:()=>JR,stringifyCommandChain:()=>Jd,stringifyCommandChainThen:()=>zR,stringifyCommandLine:()=>wD,stringifyCommandLineThen:()=>VR,stringifyEnvSegment:()=>ED,stringifyRedirectArgument:()=>Qw,stringifyResolution:()=>vD,stringifyShell:()=>zd,stringifyShellLine:()=>zd,stringifySyml:()=>Da,stringifyValueArgument:()=>H0});var Nl=Et(()=>{rW();oW();nV()});var sV=_((Dxt,fT)=>{"use strict";var J6e=t=>{let e=!1,r=!1,o=!1;for(let a=0;a<t.length;a++){let n=t[a];e&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(t=t.slice(0,a)+"-"+t.slice(a),e=!1,o=r,r=!0,a++):r&&o&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(t=t.slice(0,a-1)+"-"+t.slice(a-1),o=r,r=!1,e=!0):(e=n.toLowerCase()===n&&n.toUpperCase()!==n,o=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return t},iV=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let r=a=>e.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(t)?t=t.map(a=>a.trim()).filter(a=>a.length).join("-"):t=t.trim(),t.length===0?"":t.length===1?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=J6e(t)),t=t.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\d+(\w|$)/g,a=>a.toUpperCase()),r(t))};fT.exports=iV;fT.exports.default=iV});var oV=_((Pxt,X6e)=>{X6e.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE
Line truncated
|
||||
|
||||
${this.candidates.map(({usage:a})=>`$ ${a}`).join(`
|
||||
`)}`}else if(this.candidates.length===1){let[{usage:o}]=this.candidates;this.message=`Command not found; did you mean:
|
||||
|
||||
$ ${o}
|
||||
${dT(e)}`}else this.message=`Command not found; did you mean one of:
|
||||
|
||||
${this.candidates.map(({usage:o},a)=>`${`${a}.`.padStart(4)} ${o}`).join(`
|
||||
`)}
|
||||
|
||||
${dT(e)}`}},UD=class extends Error{constructor(e,r){super(),this.input=e,this.usages=r,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
|
||||
|
||||
${this.usages.map((o,a)=>`${`${a}.`.padStart(4)} ${o}`).join(`
|
||||
`)}
|
||||
|
||||
${dT(e)}`}},dT=t=>`While running ${t.filter(e=>e!==Hn.EndOfInput&&e!==Hn.EndOfPartialInput).map(e=>{let r=JSON.stringify(e);return e.match(/\s/)||e.length===0||r!==`"${e}"`?r:e}).join(" ")}`});function Z6e(t){let e=t.split(`
|
||||
`),r=e.filter(a=>a.match(/\S/)),o=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return e.map(a=>a.slice(o).trimRight()).join(`
|
||||
`)}function Do(t,{format:e,paragraphs:r}){return t=t.replace(/\r\n?/g,`
|
||||
`),t=Z6e(t),t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
|
||||
|
||||
`),t=t.replace(/\n(\n)?\n*/g,(o,a)=>a||" "),r&&(t=t.split(/\n/).map(o=>{let a=o.match(/^\s*[*-][\t ]+(.*)/);if(!a)return o.match(/(.{1,80})(?: |$)/g).join(`
|
||||
`);let n=o.length-o.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,"g")).map((u,A)=>" ".repeat(n)+(A===0?"- ":" ")+u).join(`
|
||||
`)}).join(`
|
||||
|
||||
`)),t=t.replace(/(`+)((?:.|[\n])*?)\1/g,(o,a,n)=>e.code(a+n+a)),t=t.replace(/(\*\*)((?:.|[\n])*?)\1/g,(o,a,n)=>e.bold(a+n+a)),t?`${t}
|
||||
`:""}var mT,uV,AV,yT=Et(()=>{mT=Array(80).fill("\u2501");for(let t=0;t<=24;++t)mT[mT.length-t]=`\x1B[38;5;${232+t}m\u2501`;uV={header:t=>`\x1B[1m\u2501\u2501\u2501 ${t}${t.length<75?` ${mT.slice(t.length+5).join("")}`:":"}\x1B[0m`,bold:t=>`\x1B[1m${t}\x1B[22m`,error:t=>`\x1B[31m\x1B[1m${t}\x1B[22m\x1B[39m`,code:t=>`\x1B[36m${t}\x1B[39m`},AV={header:t=>t,bold:t=>t,error:t=>t,code:t=>t}});function Ko(t){return{...t,[Uw]:!0}}function Gu(t,e){return typeof t>"u"?[t,e]:typeof t=="object"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function HD(t,{mergeName:e=!1}={}){let r=t.match(/^([^:]+): (.*)$/m);if(!r)return"validation failed";let[,o,a]=r;return e&&(a=a[0].toLowerCase()+a.slice(1)),a=o!=="."||!e?`${o.replace(/^\.(\[|$)/,"$1")}: ${a}`:`: ${a}`,a}function _w(t,e){return e.length===1?new st(`${t}${HD(e[0],{mergeName:!0})}`):new st(`${t}:
|
||||
${e.map(r=>`
|
||||
- ${HD(r)}`).join("")}`)}function $0(t,e,r){if(typeof r>"u")return e;let o=[],a=[],n=A=>{let p=e;return e=A,n.bind(null,p)};if(!r(e,{errors:o,coercions:a,coercion:n}))throw _w(`Invalid value for ${t}`,o);for(let[,A]of a)A();return e}var Uw,yf=Et(()=>{_D();Uw=Symbol("clipanion/isOption")});var Vo={};Vt(Vo,{KeyRelationship:()=>Yu,TypeAssertionError:()=>Gp,applyCascade:()=>jw,as:()=>mqe,assert:()=>hqe,assertWithErrors:()=>gqe,cascade:()=>YD,fn:()=>yqe,hasAtLeastOneKey:()=>DT,hasExactLength:()=>dV,hasForbiddenKeys:()=>Mqe,hasKeyRelationship:()=>Yw,hasMaxLength:()=>Cqe,hasMinLength:()=>Eqe,hasMutuallyExclusiveKeys:()=>Oqe,hasRequiredKeys:()=>Lqe,hasUniqueItems:()=>wqe,isArray:()=>qD,isAtLeast:()=>BT,isAtMost:()=>vqe,isBase64:()=>Fqe,isBoolean:()=>oqe,isDate:()=>lqe,isDict:()=>Aqe,isEnum:()=>Js,isHexColor:()=>Qqe,isISO8601:()=>kqe,isInExclusiveRange:()=>Pqe,isInInclusiveRange:()=>Dqe,isInstanceOf:()=>pqe,isInteger:()=>vT,isJSON:()=>Rqe,isLiteral:()=>pV,isLowerCase:()=>Sqe,isMap:()=>uqe,isNegative:()=>Iqe,isNullable:()=>Nqe,isNumber:()=>wT,isObject:()=>hV,isOneOf:()=>IT,isOptional:()=>Tqe,isPartial:()=>fqe,isPayload:()=>aqe,isPositive:()=>Bqe,isRecord:()=>GD,isSet:()=>cqe,isString:()=>om,isTuple:()=>jD,isUUID4:()=>xqe,isUnknown:()=>CT,isUpperCase:()=>bqe,makeTrait:()=>gV,makeValidator:()=>Hr,matchesRegExp:()=>qw,softAssert:()=>dqe});function qn(t){return t===null?"null":t===void 0?"undefined":t===""?"an empty string":typeof t=="symbol"?`<${t.toString()}>`:Array.isArray(t)?"an array":JSON.stringify(t)}function sm(t,e){if(t.length===0)return"nothing";if(t.length===1)return qn(t[0]);let r=t.slice(0,-1),o=t[t.length-1],a=t.length>2?`, ${e} `:` ${e} `;return`${r.map(n=>qn(n)).join(", ")}${a}${qn(o)}`}function jp(t,e){var r,o,a;return typeof e=="number"?`${(r=t?.p)!==null&&r!==void 0?r:"."}[${e}]`:$6e.test(e)?`${(o=t?.p)!==null&&o!==void 0?o:""}.${e}`:`${(a=t?.p)!==null&&a!==void 0?a:"."}[${JSON.stringify(e)}]`}function ET(t,e,r){return t===1?e:r}function pr({errors:t,p:e}={},r){return t?.push(`${e??"."}: ${r}`),!1}function iqe(t,e){return r=>{t[e]=r}}function Wu(t,e){return r=>{let o=t[e];return t[e]=r,Wu(t,e).bind(null,o)}}function Hw(t,e,r){let o=()=>(t(r()),a),a=()=>(t(e),o);return o}function CT(){return Hr({test:(t,e)=>!0})}function pV(t){return Hr({test:(e,r)=>e!==t?pr(r,`Expected ${qn(t)} (got ${qn(e)})`):!0})}function om(){return Hr({test:(t,e)=>typeof t!="string"?pr(e,`Expected a string (got ${qn(t)})`):!0})}function Js(t){let e=Array.isArray(t)?t:Object.values(t),r=e.every(a=>typeof a=="string"||typeof a=="number"),o=new Set(e);return o.size===1?pV([...o][0]):Hr({test:(a,n)=>o.has(a)?!0:r?pr(n,`Expected one of ${sm(e,"or")} (got ${qn(a)})`):pr(n,`Expected a valid enumeration value (got ${qn(a)})`)})}function oqe(){return Hr({test:(t,e)=>{var r;if(typeof t!="boolean"){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return pr(e,"Unbound coercion result");let o=sqe.get(t);if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return pr(e,`Expected a boolean (got ${qn(t)})`)}return!0}})}function wT(){return Hr({test:(t,e)=>{var r;if(typeof t!="number"){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return pr(e,"Unbound coercion result");let o;if(typeof t=="string"){let a;try{a=JSON.parse(t)}catch{}if(typeof a=="number")if(JSON.stringify(a)===t)o=a;else return pr(e,`Received a number that can't be safely represented by the runtime (${t})`)}if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return pr(e,`Expected a number (got ${qn(t)})`)}return!0}})}function aqe(t){return Hr({test:(e,r)=>{var o;if(typeof r?.coercions>"u")return pr(r,"The isPayload predicate can only be used with coercion enabled");if(typeof r.coercion>"u")return pr(r,"Unbound coercion result");if(typeof e!="string")return pr(r,`Expected a string (got ${qn(e)})`);let a;try{a=JSON.parse(e)}catch{return pr(r,`Expected a JSON string (got ${qn(e)})`)}let n={value:a};return t(a,Object.assign(Object.assign({},r),{coercion:Wu(n,"value")}))?(r.coercions.push([(o=r.p)!==null&&o!==void 0?o:".",r.coercion.bind(null,n.value)]),!0):!1}})}function lqe(){return Hr({test:(t,e)=>{var r;if(!(t instanceof Date)){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return pr(e,"Unbound coercion result");let o;if(typeof t=="string"&&fV.test(t))o=new Date(t);else{let a;if(typeof t=="string"){let n;try{n=JSON.parse(t)}catch{}typeof n=="number"&&(a=n)}else typeof t=="number"&&(a=t);if(typeof a<"u")if(Number.isSafeInteger(a)||!Number.isSafeInteger(a*1e3))o=new Date(a*1e3);else return pr(e,`Received a timestamp that can't be safely represented by the runtime (${t})`)}if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return pr(e,`Expected a date (got ${qn(t)})`)}return!0}})}function qD(t,{delimiter:e}={}){return Hr({test:(r,o)=>{var a;let n=r;if(typeof r=="string"&&typeof e<"u"&&typeof o?.coercions<"u"){if(typeoLine truncated
|
||||
`;for(let o of e)r+=`
|
||||
- ${o}`}super(r)}};Gw={missing:(t,e)=>t.has(e),undefined:(t,e,r)=>t.has(e)&&typeof r[e]<"u",nil:(t,e,r)=>t.has(e)&&r[e]!=null,falsy:(t,e,r)=>t.has(e)&&!!r[e]};(function(t){t.Forbids="Forbids",t.Requires="Requires"})(Yu||(Yu={}));Uqe={[Yu.Forbids]:{expect:!1,message:"forbids using"},[Yu.Requires]:{expect:!0,message:"requires using"}}});var it,Yp=Et(()=>{yf();it=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:a,isUnknown:n,applyCascade:u}=await Promise.resolve().then(()=>(el(),Vo)),A=u(a(n()),r),p=[],h=[];if(!A(this,{errors:p,coercions:h}))throw _w("Invalid option schema",p);for(let[,I]of h)I()}else if(r!=null)throw new Error("Invalid command schema");let o=await this.execute();return typeof o<"u"?o:0}};it.isOption=Uw;it.Default=[]});function Pa(t){gT&&console.log(t)}function yV(){let t={nodes:[]};for(let e=0;e<un.CustomNode;++e)t.nodes.push(tl());return t}function _qe(t){let e=yV(),r=[],o=e.nodes.length;for(let a of t){r.push(o);for(let n=0;n<a.nodes.length;++n)CV(n)||e.nodes.push(Vqe(a.nodes[n],o));o+=a.nodes.length-un.CustomNode+1}for(let a of r)am(e,un.InitialNode,a);return e}function Oc(t,e){return t.nodes.push(e),t.nodes.length-1}function Hqe(t){let e=new Set,r=o=>{if(e.has(o))return;e.add(o);let a=t.nodes[o];for(let u of Object.values(a.statics))for(let{to:A}of u)r(A);for(let[,{to:u}]of a.dynamics)r(u);for(let{to:u}of a.shortcuts)r(u);let n=new Set(a.shortcuts.map(({to:u})=>u));for(;a.shortcuts.length>0;){let{to:u}=a.shortcuts.shift(),A=t.nodes[u];for(let[p,h]of Object.entries(A.statics)){let E=Object.prototype.hasOwnProperty.call(a.statics,p)?a.statics[p]:a.statics[p]=[];for(let I of h)E.some(({to:v})=>I.to===v)||E.push(I)}for(let[p,h]of A.dynamics)a.dynamics.some(([E,{to:I}])=>p===E&&h.to===I)||a.dynamics.push([p,h]);for(let p of A.shortcuts)n.has(p.to)||(a.shortcuts.push(p),n.add(p.to))}};r(un.InitialNode)}function qqe(t,{prefix:e=""}={}){if(gT){Pa(`${e}Nodes are:`);for(let r=0;r<t.nodes.length;++r)Pa(`${e} ${r}: ${JSON.stringify(t.nodes[r])}`)}}function jqe(t,e,r=!1){Pa(`Running a vm on ${JSON.stringify(e)}`);let o=[{node:un.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,partial:!1,tokens:[]}}];qqe(t,{prefix:" "});let a=[Hn.StartOfInput,...e];for(let n=0;n<a.length;++n){let u=a[n],A=u===Hn.EndOfInput||u===Hn.EndOfPartialInput,p=n-1;Pa(` Processing ${JSON.stringify(u)}`);let h=[];for(let{node:E,state:I}of o){Pa(` Current node is ${E}`);let v=t.nodes[E];if(E===un.ErrorNode){h.push({node:E,state:I});continue}console.assert(v.shortcuts.length===0,"Shortcuts should have been eliminated by now");let x=Object.prototype.hasOwnProperty.call(v.statics,u);if(!r||n<a.length-1||x)if(x){let C=v.statics[u];for(let{to:R,reducer:L}of C)h.push({node:R,state:typeof L<"u"?WD(ST,L,I,u,p):I}),Pa(` Static transition to ${R} found`)}else Pa(" No static transition found");else{let C=!1;for(let R of Object.keys(v.statics))if(R.startsWith(u)){if(u===R)for(let{to:L,reducer:U}of v.statics[R])h.push({node:L,state:typeof U<"u"?WD(ST,U,I,u,p):I}),Pa(` Static transition to ${L} found`);else for(let{to:L}of v.statics[R])h.push({node:L,state:{...I,remainder:R.slice(u.length)}}),Pa(` Static transition to ${L} found (partial match)`);C=!0}C||Pa(" No partial static transition found")}if(!A)for(let[C,{to:R,reducer:L}]of v.dynamics)WD(zqe,C,I,u,p)&&(h.push({node:R,state:typeof L<"u"?WD(ST,L,I,u,p):I}),Pa(` Dynamic transition to ${R} found (via ${C})`))}if(h.length===0&&A&&e.length===1)return[{node:un.InitialNode,state:mV}];if(h.length===0)throw new im(e,o.filter(({node:E})=>E!==un.ErrorNode).map(({state:E})=>({usage:E.candidateUsage,reason:null})));if(h.every(({node:E})=>E===un.ErrorNode))throw new im(e,h.map(({state:E})=>({usage:E.candidateUsage,reason:E.errorMessage})));o=Yqe(h)}if(o.length>0){Pa(" Results:");for(let n of o)Pa(` - ${n.node} -> ${JSON.stringify(n.state)}`)}else Pa(" No results");return o}function Gqe(t,e,{endToken:r=Hn.EndOfInput}={}){let o=jqe(t,[...e,r]);return Wqe(e,o.map(({state:a})=>a))}function Yqe(t){let e=0;for(let{state:r}of t)r.path.length>e&&(e=r.path.length);return t.filter(({state:r})=>r.path.length===e)}function Wqe(t,e){let r=e.filter(v=>v.selectedIndex!==null),o=r.filter(v=>!v.partial);if(o.length>0&&(r=o),r.length===0)throw new Error;let a=r.filter(v=>v.selectedIndex===Z0||v.requiredOptions.every(x=>x.some(C=>v.options.find(R=>R.name===C))));if(a.length===0)throw new im(t,r.map(v=>({usage:v.candidateUsage,reason:null})));let n=0;for(let v of a)v.path.length>n&&(n=v.path.length);let u=a.filter(v=>v.path.length===n),A=v=>v.positionals.filter(({extra:x})=>!x).length+v.options.length,p=u.map(v=>({state:v,positionalCount:A(v)})),h=0;for(let{positionalCount:v}of p)v>h&&(h=v);let E=p.filter(({positionalCount:v})=>v===h).map(({state:v})=>
Line truncated
|
||||
`),this.context.stdout.write(`
|
||||
`);let r=0;for(let o of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[o].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`
|
||||
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
|
||||
`)}}}});async function bV(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}=kV(t);return Jo.from(r,e).runExit(o,a)}async function xV(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}=kV(t);return Jo.from(r,e).run(o,a)}function kV(t){let e,r,o,a;switch(typeof process<"u"&&typeof process.argv<"u"&&(o=process.argv.slice(2)),t.length){case 1:r=t[0];break;case 2:t[0]&&t[0].prototype instanceof it||Array.isArray(t[0])?(r=t[0],Array.isArray(t[1])?o=t[1]:a=t[1]):(e=t[0],r=t[1]);break;case 3:Array.isArray(t[2])?(e=t[0],r=t[1],o=t[2]):t[0]&&t[0].prototype instanceof it||Array.isArray(t[0])?(r=t[0],o=t[1],a=t[2]):(e=t[0],r=t[1],a=t[2]);break;default:e=t[0],r=t[1],o=t[2],a=t[3];break}if(typeof o>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}}function SV(t){return t()}var PV,Jo,QV=Et(()=>{OD();VD();yT();vV();Yp();DV();PV=Symbol("clipanion/errorCommand");Jo=class t{constructor({binaryLabel:e,binaryName:r="...",binaryVersion:o,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new KD({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=o,this.enableCapture=a,this.enableColors=n}static from(e,r={}){let o=new t(r),a=Array.isArray(e)?e:[e];for(let n of a)o.register(n);return o}register(e){var r;let o=new Map,a=new e;for(let p in a){let h=a[p];typeof h=="object"&&h!==null&&h[it.isOption]&&o.set(p,h)}let n=this.builder.command(),u=n.cliIndex,A=(r=e.paths)!==null&&r!==void 0?r:a.paths;if(typeof A<"u")for(let p of A)n.addPath(p);this.registrations.set(e,{specs:o,builder:n,index:u});for(let[p,{definition:h}]of o.entries())h(n,p);n.setContext({commandClass:e})}process(e,r){let{input:o,context:a,partial:n}=typeof e=="object"&&Array.isArray(e)?{input:e,context:r}:e,{contexts:u,process:A}=this.builder.compile(),p=A(o,{partial:n}),h={...t.defaultContext,...a};switch(p.selectedIndex){case Z0:{let E=JD.from(p,u);return E.context=h,E.tokens=p.tokens,E}default:{let{commandClass:E}=u[p.selectedIndex],I=this.registrations.get(E);if(typeof I>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let v=new E;v.context=h,v.tokens=p.tokens,v.path=p.path;try{for(let[x,{transformer:C}]of I.specs.entries())v[x]=C(I.builder,x,p,h);return v}catch(x){throw x[PV]=v,x}}break}}async run(e,r){var o,a;let n,u={...t.defaultContext,...r},A=(o=this.enableColors)!==null&&o!==void 0?o:u.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e,u)}catch(E){return u.stdout.write(this.error(E,{colored:A})),1}if(n.help)return u.stdout.write(this.usage(n,{colored:A,detailed:!0})),0;n.context=u,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:E=>this.definition(E),error:(E,I)=>this.error(E,I),format:E=>this.format(E),process:(E,I)=>this.process(E,{...u,...I}),run:(E,I)=>this.run(E,{...u,...I}),usage:(E,I)=>this.usage(E,I)};let p=this.enableCapture&&(a=BV(u))!==null&&a!==void 0?a:SV,h;try{h=await p(()=>n.validateAndExecute().catch(E=>n.catch(E).then(()=>0)))}catch(E){return u.stdout.write(this.error(E,{colored:A,command:n})),1}return h}async runExit(e,r){process.exitCode=await this.run(e,r)}definition(e,{colored:r=!1}={}){if(!e.usage)return null;let{usage:o}=this.getUsageByRegistration(e,{detailed:!1}),{usage:a,options:n}=this.getUsageByRegistration(e,{detailed:!0,inlineOptions:!1}),u=typeof e.usage.category<"u"?Do(e.usage.category,{format:this.format(r),paragraphs:!1}):void 0,A=typeof e.usage.description<"u"?Do(e.usage.description,{format:this.format(r),paragraphs:!1}):void 0,p=typeof e.usage.details<"u"?Do(e.usage.details,{format:this.format(r),paragraphs:!0}):void 0,h=typeof e.usage.examples<"u"?e.usage.examples.map(([E,I])=>[Do(E,{format:this.format(r),paragraphs:!1}),I.replace(/\$0/g,this.binaryName)]):void 0;return{path:o,usage:a,category:u,description:A,details:p,examples:h,options:n}}definitions({colored:e=!1}={}){let r=[];for(let o of this.registrations.keys()){let a=this.definition(o,{colored:e});a&&r.push(a)}return r}usage(e=null,{colored:r,detailed:o=!1,prefix:a="$ "}={}){var n;if(e===null){for(let p of this.registrations.keys()){let h=p.paths,E=typeof p.usage<"u";if(!h||h.length===0||h.length===1&&h[0].length===0||((n=h?.some(x=>x.length===0))!==null&&n!==void 0?n:!1))if(e){e=null;break}else e=p;else if(E){e=null;continue}}e&&(o=!0)}let u=e!==null&&e instanceof it?e.constructor:e,A="";if(u)if(o){let{description:p="",details:h="",examples:E=[]}=u.usage||{};p!==""&&(A+=Do(p,{format:this.format(r),paragraphs:!1}).replace(/^./,x=>x.toUpperCase()),A+=`
|
||||
`),(h!==""||E.length>0)&&(A+=`${this.format(r).header("Usage")}
|
||||
`,A+=`
|
||||
`);let{usage:I,options:v}=this.getUsageByRegistration(u,{inlineOptions:!1});if(A+=`${this.format(r).bold(a)}${I}
|
||||
`,v.length>0){A+=`
|
||||
`,A+=`${this.format(r).header("Options")}
|
||||
`;let x=v.reduce((C,R)=>Math.max(C,R.definition.length),0);A+=`
|
||||
`;for(let{definition:C,description:R}of v)A+=` ${this.format(r).bold(C.padEnd(x))} ${Do(R,{format:this.format(r),paragraphs:!1})}`}if(h!==""&&(A+=`
|
||||
`,A+=`${this.format(r).header("Details")}
|
||||
`,A+=`
|
||||
`,A+=Do(h,{format:this.format(r),paragraphs:!0})),E.length>0){A+=`
|
||||
`,A+=`${this.format(r).header("Examples")}
|
||||
`;for(let[x,C]of E)A+=`
|
||||
`,A+=Do(x,{format:this.format(r),paragraphs:!1}),A+=`${C.replace(/^/m,` ${this.format(r).bold(a)}`).replace(/\$0/g,this.binaryName)}
|
||||
`}}else{let{usage:p}=this.getUsageByRegistration(u);A+=`${this.format(r).bold(a)}${p}
|
||||
`}else{let p=new Map;for(let[v,{index:x}]of this.registrations.entries()){if(typeof v.usage>"u")continue;let C=typeof v.usage.category<"u"?Do(v.usage.category,{format:this.format(r),paragraphs:!1}):null,R=p.get(C);typeof R>"u"&&p.set(C,R=[]);let{usage:L}=this.getUsageByIndex(x);R.push({commandClass:v,usage:L})}let h=Array.from(p.keys()).sort((v,x)=>v===null?-1:x===null?1:v.localeCompare(x,"en",{usage:"sort",caseFirst:"upper"})),E=typeof this.binaryLabel<"u",I=typeof this.binaryVersion<"u";E||I?(E&&I?A+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
|
||||
|
||||
`:E?A+=`${this.format(r).header(`${this.binaryLabel}`)}
|
||||
`:A+=`${this.format(r).header(`${this.binaryVersion}`)}
|
||||
`,A+=` ${this.format(r).bold(a)}${this.binaryName} <command>
|
||||
`):A+=`${this.format(r).bold(a)}${this.binaryName} <command>
|
||||
`;for(let v of h){let x=p.get(v).slice().sort((R,L)=>R.usage.localeCompare(L.usage,"en",{usage:"sort",caseFirst:"upper"})),C=v!==null?v.trim():"General commands";A+=`
|
||||
`,A+=`${this.format(r).header(`${C}`)}
|
||||
`;for(let{commandClass:R,usage:L}of x){let U=R.usage.description||"undocumented";A+=`
|
||||
`,A+=` ${this.format(r).bold(L)}
|
||||
`,A+=` ${Do(U,{format:this.format(r),paragraphs:!1})}`}}A+=`
|
||||
`,A+=Do("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(r),paragraphs:!0})}return A}error(e,r){var o,{colored:a,command:n=(o=e[PV])!==null&&o!==void 0?o:null}=r===void 0?{}:r;(!e||typeof e!="object"||!("stack"in e))&&(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let u="",A=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");A==="Error"&&(A="Internal Error"),u+=`${this.format(a).error(A)}: ${e.message}
|
||||
`;let p=e.clipanion;return typeof p<"u"?p.type==="usage"&&(u+=`
|
||||
`,u+=this.usage(n)):e.stack&&(u+=`${e.stack.replace(/^.*\n/,"")}
|
||||
`),u}format(e){var r;return((r=e??this.enableColors)!==null&&r!==void 0?r:t.defaultContext.colorDepth>1)?uV:AV}getUsageByRegistration(e,r){let o=this.registrations.get(e);if(typeof o>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(o.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}};Jo.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:IV()}});var Ww,FV=Et(()=>{Yp();Ww=class extends it{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
|
||||
`)}};Ww.paths=[["--clipanion=definitions"]]});var Kw,RV=Et(()=>{Yp();Kw=class extends it{async execute(){this.context.stdout.write(this.cli.usage())}};Kw.paths=[["-h"],["--help"]]});function XD(t={}){return Ko({definition(e,r){var o;e.addProxy({name:(o=t.name)!==null&&o!==void 0?o:r,required:t.required})},transformer(e,r,o){return o.positionals.map(({value:a})=>a)}})}var xT=Et(()=>{yf()});var Vw,TV=Et(()=>{Yp();xT();Vw=class extends it{constructor(){super(...arguments),this.args=XD()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}
|
||||
`)}};Vw.paths=[["--clipanion=tokens"]]});var zw,NV=Et(()=>{Yp();zw=class extends it{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:"<unknown>"}
|
||||
`)}};zw.paths=[["-v"],["--version"]]});var kT={};Vt(kT,{DefinitionsCommand:()=>Ww,HelpCommand:()=>Kw,TokensCommand:()=>Vw,VersionCommand:()=>zw});var LV=Et(()=>{FV();RV();TV();NV()});function MV(t,e,r){let[o,a]=Gu(e,r??{}),{arity:n=1}=a,u=t.split(","),A=new Set(u);return Ko({definition(p){p.addOption({names:u,arity:n,hidden:a?.hidden,description:a?.description,required:a.required})},transformer(p,h,E){let I,v=typeof o<"u"?[...o]:void 0;for(let{name:x,value:C}of E.options)A.has(x)&&(I=x,v=v??[],v.push(C));return typeof v<"u"?$0(I??h,v,a.validator):v}})}var OV=Et(()=>{yf()});function UV(t,e,r){let[o,a]=Gu(e,r??{}),n=t.split(","),u=new Set(n);return Ko({definition(A){A.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(A,p,h){let E=o;for(let{name:I,value:v}of h.options)u.has(I)&&(E=v);return E}})}var _V=Et(()=>{yf()});function HV(t,e,r){let[o,a]=Gu(e,r??{}),n=t.split(","),u=new Set(n);return Ko({definition(A){A.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(A,p,h){let E=o;for(let{name:I,value:v}of h.options)u.has(I)&&(E??(E=0),v?E+=1:E=0);return E}})}var qV=Et(()=>{yf()});function jV(t={}){return Ko({definition(e,r){var o;e.addRest({name:(o=t.name)!==null&&o!==void 0?o:r,required:t.required})},transformer(e,r,o){let a=u=>{let A=o.positionals[u];return A.extra===rl||A.extra===!1&&u<e.arity.leading.length},n=0;for(;n<o.positionals.length&&a(n);)n+=1;return o.positionals.splice(0,n).map(({value:u})=>u)}})}var GV=Et(()=>{VD();yf()});function Jqe(t,e,r){let[o,a]=Gu(e,r??{}),{arity:n=1}=a,u=t.split(","),A=new Set(u);return Ko({definition(p){p.addOption({names:u,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(p,h,E,I){let v,x=o;typeof a.env<"u"&&I.env[a.env]&&(v=a.env,x=I.env[a.env]);for(let{name:C,value:R}of E.options)A.has(C)&&(v=C,x=R);return typeof x=="string"?$0(v??h,x,a.validator):x}})}function Xqe(t={}){let{required:e=!0}=t;return Ko({definition(r,o){var a;r.addPositional({name:(a=t.name)!==null&&a!==void 0?a:o,required:t.required})},transformer(r,o,a){var n;for(let u=0;u<a.positionals.length;++u){if(a.positionals[u].extra===rl||e&&a.positionals[u].extra===!0||!e&&a.positionals[u].extra===!1)continue;let[A]=a.positionals.splice(u,1);return $0((n=t.name)!==null&&n!==void 0?n:o,A.value,t.validator)}}})}function YV(t,...e){return typeof t=="string"?Jqe(t,...e):Xqe(t)}var WV=Et(()=>{VD();yf()});var ge={};Vt(ge,{Array:()=>MV,Boolean:()=>UV,Counter:()=>HV,Proxy:()=>XD,Rest:()=>jV,String:()=>YV,applyValidator:()=>$0,cleanValidationError:()=>HD,formatError:()=>_w,isOptionSymbol:()=>Uw,makeCommandOption:()=>Ko,rerouteArguments:()=>Gu});var KV=Et(()=>{yf();xT();OV();_V();qV();GV();WV()});var Jw={};Vt(Jw,{Builtins:()=>kT,Cli:()=>Jo,Command:()=>it,Option:()=>ge,UsageError:()=>st,formatMarkdownish:()=>Do,run:()=>xV,runExit:()=>bV});var qt=Et(()=>{_D();yT();Yp();QV();LV();KV()});var VV=_((Rkt,Zqe)=>{Zqe.exports={name:"dotenv",version:"16.3.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var ZV=_((Tkt,Ef)=>{var zV=ve("fs"),FT=ve("path"),$qe=ve("os"),eje=ve("crypto"),tje=VV(),RT=tje.version,rje=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function nje(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
||||
`);let o;for(;(o=rje.exec(r))!=null;){let a=o[1],n=o[2]||"";n=n.trim();let u=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),u==='"'&&(n=n.replace(/\\n/g,`
|
||||
`),n=n.replace(/\\r/g,"\r")),e[a]=n}return e}function ije(t){let e=XV(t),r=ks.configDotenv({path:e});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);let o=JV(t).split(","),a=o.length,n;for(let u=0;u<a;u++)try{let A=o[u].trim(),p=aje(r,A);n=ks.decrypt(p.ciphertext,p.key);break}catch(A){if(u+1>=a)throw A}return ks.parse(n)}function sje(t){console.log(`[dotenv@${RT}][INFO] ${t}`)}function oje(t){console.log(`[dotenv@${RT}][WARN] ${t}`)}function QT(t){console.log(`[dotenv@${RT}][DEBUG] ${t}`)}function JV(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function aje(t,e){let r;try{r=new URL(e)}catch(A){throw A.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):A}let o=r.password;if(!o)throw new Error("INVALID_DOTENV_KEY: Missing key part");let a=r.searchParams.get("environment");if(!a)throw new Error("INVALID_DOTENV_KEY: Missing environment part");let n=`DOTENV_VAULT_${a.toUpperCase()}`,u=t.parsed[n];if(!u)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:u,key:o}}function XV(t){let e=FT.resolve(process.cwd(),".env");return t&&t.path&&t.path.length>0&&(e=t.path),e.endsWith(".vault")?e:`${e}.vault`}function lje(t){return t[0]==="~"?FT.join($qe.homedir(),t.slice(1)):t}function cje(t){sje("Loading env from encrypted .env.vault");let e=ks._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),ks.populate(r,e,t),{parsed:e}}function uje(t){let e=FT.resolve(process.cwd(),".env"),r="utf8",o=!!(t&&t.debug);t&&(t.path!=null&&(e=lje(t.path)),t.encoding!=null&&(r=t.encoding));try{let a=ks.parse(zV.readFileSync(e,{encoding:r})),n=process.env;return t&&t.processEnv!=null&&(n=t.processEnv),ks.populate(n,a,t),{parsed:a}}catch(a){return o&&QT(`Failed to load ${e} ${a.message}`),{error:a}}}function Aje(t){let e=XV(t);return JV(t).length===0?ks.configDotenv(t):zV.existsSync(e)?ks._configVault(t):(oje(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),ks.configDotenv(t))}function fje(t,e){let r=Buffer.from(e.slice(-64),"hex"),o=Buffer.from(t,"base64"),a=o.slice(0,12),n=o.slice(-16);o=o.slice(12,-16);try{let u=eje.createDecipheriv("aes-256-gcm",r,a);return u.setAuthTag(n),`${u.update(o)}${u.final()}`}catch(u){let A=u instanceof RangeError,p=u.message==="Invalid key length",h=u.message==="Unsupported state or unable to authenticate data";if(A||p){let E="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(E)}else if(h){let E="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(E)}else throw console.error("Error: ",u.code),console.error("Error: ",u.message),u}}function pje(t,e,r={}){let o=!!(r&&r.debug),a=!!(r&&r.override);if(typeof e!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(a===!0&&(t[n]=e[n]),o&&QT(a===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var ks={configDotenv:uje,_configVault:cje,_parseVault:ije,config:Aje,decrypt:fje,parse:nje,populate:pje};Ef.exports.configDotenv=ks.configDotenv;Ef.exports._configVault=ks._configVault;Ef.exports._parseVault=ks._parseVault;Ef.exports.config=ks.config;Ef.exports.decrypt=ks.decrypt;Ef.exports.parse=ks.parse;Ef.exports.populate=ks.populate;Ef.exports=ks});var ez=_((Nkt,$V)=>{"use strict";$V.exports=(t,...e)=>new Promise(r=>{r(t(...e))})});var eg=_((Lkt,TT)=>{"use strict";var hje=ez(),tz=t=>{if(t<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=[],r=0,o=()=>{r--,e.length>0&&e.shift()()},a=(A,p,...h)=>{r++;let E=hje(A,...h);p(E),E.then(o,o)},n=(A,p,...h)=>{r<t?a(A,p,...h):e.push(a.bind(null,A,p,...h))},u=(A,...p)=>new Promise(h=>n(A,h,...p));return Object.defineProperties(u,{activeCount:{get:()=>r},pendingCount:{get:()=>e.length}}),u};TT.exports=tz;TT.exports.default=tz});function Ku(t){return`YN${t.toString(10).padStart(4,"0")}`}function ZD(t){let e=Number(t.slice(2));if(typeof wr[e]>"u")throw new Error(`Unknown message name: "${t}"`);return e}var wr,$D=Et(()=>{wr=(Me=>(Me[Me.UNNAMED=0]="UNNAMED",Me[Me.EXCEPTION=1]="EXCEPTION",Me[Me.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",Me[Me.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",Me[Me.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",Me[Me.BUILD_DISABLED=5]="BUILD_DISABLED",Me[Me.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",Me[Me.MUST_BUILD=7]="MUST_BUILD",Me[Me.MUST_REBUILD=8]="MUST_REBUILD",Me[Me.BUILD_FAILED=9]="BUILD_FAILED",Me[Me.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",Me[Me.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",Me[Me.LINKER_NOT_FOUND=12]="LINKER_NOT_FOUND",Me[Me.FETC
Line truncated
|
||||
`,"\r","(",")","!","|","&","^"],!0,!1),ce=function($){return e.queryPattern.test($)},Ce=function($){return e.checkFn($)},de=Se("whitespace"),Be=/^[ \t\n\r]/,Ee=Fe([" "," ",`
|
||||
`,"\r"],!1,!1),g=0,me=0,we=[{line:1,column:1}],Ae=0,ne=[],Z=0,xe;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function Ne(){return t.substring(me,g)}function ht(){return Ue(me,g)}function H($,ie){throw ie=ie!==void 0?ie:Ue(me,g),S([Se($)],t.substring(me,g),ie)}function rt($,ie){throw ie=ie!==void 0?ie:Ue(me,g),w($,ie)}function Te($,ie){return{type:"literal",text:$,ignoreCase:ie}}function Fe($,ie,be){return{type:"class",parts:$,inverted:ie,ignoreCase:be}}function ke(){return{type:"any"}}function Ye(){return{type:"end"}}function Se($){return{type:"other",description:$}}function et($){var ie=we[$],be;if(ie)return ie;for(be=$-1;!we[be];)be--;for(ie=we[be],ie={line:ie.line,column:ie.column};be<$;)t.charCodeAt(be)===10?(ie.line++,ie.column=1):ie.column++,be++;return we[$]=ie,ie}function Ue($,ie){var be=et($),Re=et(ie);return{start:{offset:$,line:be.line,column:be.column},end:{offset:ie,line:Re.line,column:Re.column}}}function b($){g<Ae||(g>Ae&&(Ae=g,ne=[]),ne.push($))}function w($,ie){return new sg($,null,null,ie)}function S($,ie,be){return new sg(sg.buildMessage($,ie),$,ie,be)}function y(){var $,ie,be,Re,at,dt,jt,tr;if($=g,ie=F(),ie!==r){for(be=[],Re=g,at=X(),at!==r?(t.charCodeAt(g)===124?(dt=n,g++):(dt=r,Z===0&&b(u)),dt===r&&(t.charCodeAt(g)===38?(dt=A,g++):(dt=r,Z===0&&b(p)),dt===r&&(t.charCodeAt(g)===94?(dt=h,g++):(dt=r,Z===0&&b(E)))),dt!==r?(jt=X(),jt!==r?(tr=F(),tr!==r?(at=[at,dt,jt,tr],Re=at):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r);Re!==r;)be.push(Re),Re=g,at=X(),at!==r?(t.charCodeAt(g)===124?(dt=n,g++):(dt=r,Z===0&&b(u)),dt===r&&(t.charCodeAt(g)===38?(dt=A,g++):(dt=r,Z===0&&b(p)),dt===r&&(t.charCodeAt(g)===94?(dt=h,g++):(dt=r,Z===0&&b(E)))),dt!==r?(jt=X(),jt!==r?(tr=F(),tr!==r?(at=[at,dt,jt,tr],Re=at):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r);be!==r?(me=$,ie=I(ie,be),$=ie):(g=$,$=r)}else g=$,$=r;return $}function F(){var $,ie,be,Re,at,dt;return $=g,t.charCodeAt(g)===33?(ie=v,g++):(ie=r,Z===0&&b(x)),ie!==r?(be=F(),be!==r?(me=$,ie=C(be),$=ie):(g=$,$=r)):(g=$,$=r),$===r&&($=g,t.charCodeAt(g)===40?(ie=R,g++):(ie=r,Z===0&&b(L)),ie!==r?(be=X(),be!==r?(Re=y(),Re!==r?(at=X(),at!==r?(t.charCodeAt(g)===41?(dt=U,g++):(dt=r,Z===0&&b(z)),dt!==r?(me=$,ie=te(Re),$=ie):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r),$===r&&($=J())),$}function J(){var $,ie,be,Re,at;if($=g,ie=X(),ie!==r){if(be=g,Re=[],ae.test(t.charAt(g))?(at=t.charAt(g),g++):(at=r,Z===0&&b(le)),at!==r)for(;at!==r;)Re.push(at),ae.test(t.charAt(g))?(at=t.charAt(g),g++):(at=r,Z===0&&b(le));else Re=r;Re!==r?be=t.substring(be,g):be=Re,be!==r?(me=g,Re=ce(be),Re?Re=void 0:Re=r,Re!==r?(me=$,ie=Ce(be),$=ie):(g=$,$=r)):(g=$,$=r)}else g=$,$=r;return $}function X(){var $,ie;for(Z++,$=[],Be.test(t.charAt(g))?(ie=t.charAt(g),g++):(ie=r,Z===0&&b(Ee));ie!==r;)$.push(ie),Be.test(t.charAt(g))?(ie=t.charAt(g),g++):(ie=r,Z===0&&b(Ee));return Z--,$===r&&(ie=r,Z===0&&b(de)),$}if(xe=a(),xe!==r&&g===t.length)return xe;throw xe!==r&&g<t.length&&b(Ye()),S(ne,Ae<t.length?t.charAt(Ae):null,Ae<t.length?Ue(Ae,Ae+1):Ue(Ae,Ae))}ZJ.exports={SyntaxError:sg,parse:p9e}});var eX=_(fP=>{var{parse:h9e}=$J();fP.makeParser=(t=/[a-z]+/)=>(e,r)=>h9e(e,{queryPattern:t,checkFn:r});fP.parse=fP.makeParser()});var rX=_((FQt,tX)=>{"use strict";tX.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[Line truncated
|
||||
`:`
|
||||
`)+r,a=o+1,o=t.indexOf(`
|
||||
`,a)}while(o!==-1);return n+=t.substr(a),n};yX.exports={stringReplaceAll:S9e,stringEncaseCRLFWithFirstIndex:b9e}});var vX=_((_Qt,BX)=>{"use strict";var x9e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,CX=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,k9e=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Q9e=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,F9e=new Map([["n",`
|
||||
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function IX(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):F9e.get(t)||t}function R9e(t,e){let r=[],o=e.trim().split(/\s*,\s*/g),a;for(let n of o){let u=Number(n);if(!Number.isNaN(u))r.push(u);else if(a=n.match(k9e))r.push(a[2].replace(Q9e,(A,p,h)=>p?IX(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function T9e(t){CX.lastIndex=0;let e=[],r;for(;(r=CX.exec(t))!==null;){let o=r[1];if(r[2]){let a=R9e(o,r[2]);e.push([o].concat(a))}else e.push([o])}return e}function wX(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let o=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in o))throw new Error(`Unknown Chalk style: ${a}`);o=n.length>0?o[a](...n):o[a]}return o}BX.exports=(t,e)=>{let r=[],o=[],a=[];if(e.replace(x9e,(n,u,A,p,h,E)=>{if(u)a.push(IX(u));else if(p){let I=a.join("");a=[],o.push(r.length===0?I:wX(t,r)(I)),r.push({inverse:A,styles:T9e(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");o.push(wX(t,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),o.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return o.join("")}});var pN=_((HQt,bX)=>{"use strict";var lI=aI(),{stdout:cN,stderr:uN}=aN(),{stringReplaceAll:N9e,stringEncaseCRLFWithFirstIndex:L9e}=EX(),DX=["ansi","ansi","ansi256","ansi16m"],gm=Object.create(null),M9e=(t,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let r=cN?cN.level:0;t.level=e.level===void 0?r:e.level},AN=class{constructor(e){return PX(e)}},PX=t=>{let e={};return M9e(e,t),e.template=(...r)=>_9e(e.template,...r),Object.setPrototypeOf(e,gP.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=AN,e.template};function gP(t){return PX(t)}for(let[t,e]of Object.entries(lI))gm[t]={get(){let r=dP(this,fN(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};gm.visible={get(){let t=dP(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var SX=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of SX)gm[t]={get(){let{level:e}=this;return function(...r){let o=fN(lI.color[DX[e]][t](...r),lI.color.close,this._styler);return dP(this,o,this._isEmpty)}}};for(let t of SX){let e="bg"+t[0].toUpperCase()+t.slice(1);gm[e]={get(){let{level:r}=this;return function(...o){let a=fN(lI.bgColor[DX[r]][t](...o),lI.bgColor.close,this._styler);return dP(this,a,this._isEmpty)}}}}var O9e=Object.defineProperties(()=>{},{...gm,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),fN=(t,e,r)=>{let o,a;return r===void 0?(o=t,a=e):(o=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:a,parent:r}},dP=(t,e,r)=>{let o=(...a)=>U9e(o,a.length===1?""+a[0]:a.join(" "));return o.__proto__=O9e,o._generator=t,o._styler=e,o._isEmpty=r,o},U9e=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:o,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=N9e(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
|
||||
`);return n!==-1&&(e=L9e(e,a,o,n)),o+e+a},lN,_9e=(t,...e)=>{let[r]=e;if(!Array.isArray(r))return e.join(" ");let o=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(o[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return lN===void 0&&(lN=vX()),lN(t,a.join(""))};Object.defineProperties(gP.prototype,gm);var cI=gP();cI.supportsColor=cN;cI.stderr=gP({level:uN?uN.level:0});cI.stderr.supportsColor=uN;cI.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};bX.exports=cI});var mP=_(Ul=>{"use strict";Ul.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Ul.find=(t,e)=>t.nodes.find(r=>r.type===e);Ul.exceedsLimit=(t,e,r=1,o)=>o===!1||!Ul.isInteger(t)||!Ul.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=o;Ul.escapeNode=(t,e=0,r)=>{let o=t.nodes[e];o&&(r&&o.type===r||o.type==="open"||o.type==="close")&&o.escaped!==!0&&(o.value="\\"+o.value,o.escaped=!0)};Ul.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);Ul.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Ul.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Ul.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);Ul.flatten=(...t)=>{let e=[],r=o=>{for(let a=0;a<o.length;a++){let n=o[a];Array.isArray(n)?r(n,e):n!==void 0&&e.push(n)}return e};return r(t),e}});var yP=_((jQt,kX)=>{"use strict";var xX=mP();kX.exports=(t,e={})=>{let r=(o,a={})=>{let n=e.escapeInvalid&&xX.isInvalidBrace(a),u=o.invalid===!0&&e.escapeInvalid===!0,A="";if(o.value)return(n||u)&&xX.isOpenOrClose(o)?"\\"+o.value:o.value;if(o.value)return o.value;if(o.nodes)for(let p of o.nodes)A+=r(p);return A};return r(t)}});var FX=_((GQt,QX)=>{"use strict";QX.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var HX=_((YQt,_X)=>{"use strict";var RX=FX(),og=(t,e,r)=>{if(RX(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(RX(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let o={relaxZeros:!0,...r};typeof o.strictZeros=="boolean"&&(o.relaxZeros=o.strictZeros===!1);let a=String(o.relaxZeros),n=String(o.shorthand),u=String(o.capture),A=String(o.wrap),p=t+":"+e+"="+a+n+u+A;if(og.cache.hasOwnProperty(p))return og.cache[p].result;let h=Math.min(t,e),E=Math.max(t,e);if(Math.abs(h-E)===1){let R=t+"|"+e;return o.capture?`(${R})`:o.wrap===!1?R:`(?:${R})`}let I=UX(t)||UX(e),v={min:t,max:e,a:h,b:E},x=[],C=[];if(I&&(v.isPadded=I,v.maxLen=String(v.max).length),h<0){let R=E<0?Math.abs(E):1;C=TX(R,Math.abs(h),v,o),h=v.a=0}return E>=0&&(x=TX(h,E,v,o)),v.negatives=C,v.positives=x,v.result=H9e(C,x,o),o.capture===!0?v.result=`(${v.result})`:o.wrap!==!1&&x.length+C.length>1&&(v.result=`(?:${v.result})`),og.cache[p]=v,v.result};function H9e(t,e,r){let o=hN(t,e,"-",!1,r)||[],a=hN(e,t,"",!1,r)||[],n=hN(t,e,"-?",!0,r)||[];return o.concat(n).concat(a).join("|")}function q9e(t,e){let r=1,o=1,a=LX(t,r),n=new Set([e]);for(;t<=a&&a<=e;)n.add(a),r+=1,a=LX(t,r);for(a=MX(e+1,o)-1;t<a&&a<=e;)n.add(a),o+=1,a=MX(e+1,o)-1;return n=[...n],n.sort(Y9e),n}function j9e(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let o=G9e(t,e),a=o.length,n="",u=0;for(let A=0;A<a;A++){let[p,h]=o[A];p===h?n+=p:p!=="0"||h!=="9"?n+=W9e(p,h,r):u++}return u&&(n+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[u],digits:a}}function TX(t,e,r,o){let a=q9e(t,e),n=[],u=t,A;for(let p=0;p<a.length;p++){let h=a[p],E=j9e(String(u),String(h),o),I="";if(!r.isPadded&&A&&A.pattern===E.pattern){A.count.length>1&&A.count.pop(),A.count.push(E.count[0]),A.string=A.pattern+OX(A.count),u=h+1;continue}r.isPadded&&(I=K9e(h,r,o)),E.string=I+E.pattern+OX(E.count),n.push(E),u=h+1,A=E}return n}function hN(t,e,r,o,a){let n=[];for(let u of t){let{string:A}=u;!o&&!NX(e,"string",A)&&n.push(r+A),o&&NX(e,"string",A)&&n.push(r+A)}return n}function G9e(t,e){let r=[];for(let o=0;o<t.length;o++)r.push([t[o],e[o]]);return r}function Y9e(t,e){return t>e?1:e>t?-1:0}function NX(t,e,r){return t.some(o=>o[e]===r)}function LX(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function MX(t,e){return t-t%Math.pow(10,e)}function OX(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function W9e(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function UX(t){return/^-?(0+)\d/.test(t)}function K9e(t,e,r){if(!e.isPadded)return t;let o=Math.abs(e.maxLen-String(t).length),a=r.relaxZeros!==!1;switch(o){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:return a?`0{0,${o}}`:`0{${o}}`}}og.cache={};og.clearCache=()=>og.cache={};_X.exports=og});var mN=_((WQt,zX)=>{"use strict";var V9e=ve("util"),GX=HX(),qX=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),z9e=t
Line truncated
|
||||
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var lZ=_((JQt,aZ)=>{"use strict";var o7e=yP(),{MAX_LENGTH:iZ,CHAR_BACKSLASH:yN,CHAR_BACKTICK:a7e,CHAR_COMMA:l7e,CHAR_DOT:c7e,CHAR_LEFT_PARENTHESES:u7e,CHAR_RIGHT_PARENTHESES:A7e,CHAR_LEFT_CURLY_BRACE:f7e,CHAR_RIGHT_CURLY_BRACE:p7e,CHAR_LEFT_SQUARE_BRACKET:sZ,CHAR_RIGHT_SQUARE_BRACKET:oZ,CHAR_DOUBLE_QUOTE:h7e,CHAR_SINGLE_QUOTE:g7e,CHAR_NO_BREAK_SPACE:d7e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:m7e}=nZ(),y7e=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},o=typeof r.maxLength=="number"?Math.min(iZ,r.maxLength):iZ;if(t.length>o)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${o})`);let a={type:"root",input:t,nodes:[]},n=[a],u=a,A=a,p=0,h=t.length,E=0,I=0,v,x={},C=()=>t[E++],R=L=>{if(L.type==="text"&&A.type==="dot"&&(A.type="text"),A&&A.type==="text"&&L.type==="text"){A.value+=L.value;return}return u.nodes.push(L),L.parent=u,L.prev=A,A=L,L};for(R({type:"bos"});E<h;)if(u=n[n.length-1],v=C(),!(v===m7e||v===d7e)){if(v===yN){R({type:"text",value:(e.keepEscaping?v:"")+C()});continue}if(v===oZ){R({type:"text",value:"\\"+v});continue}if(v===sZ){p++;let L=!0,U;for(;E<h&&(U=C());){if(v+=U,U===sZ){p++;continue}if(U===yN){v+=C();continue}if(U===oZ&&(p--,p===0))break}R({type:"text",value:v});continue}if(v===u7e){u=R({type:"paren",nodes:[]}),n.push(u),R({type:"text",value:v});continue}if(v===A7e){if(u.type!=="paren"){R({type:"text",value:v});continue}u=n.pop(),R({type:"text",value:v}),u=n[n.length-1];continue}if(v===h7e||v===g7e||v===a7e){let L=v,U;for(e.keepQuotes!==!0&&(v="");E<h&&(U=C());){if(U===yN){v+=U+C();continue}if(U===L){e.keepQuotes===!0&&(v+=U);break}v+=U}R({type:"text",value:v});continue}if(v===f7e){I++;let U={type:"brace",open:!0,close:!1,dollar:A.value&&A.value.slice(-1)==="$"||u.dollar===!0,depth:I,commas:0,ranges:0,nodes:[]};u=R(U),n.push(u),R({type:"open",value:v});continue}if(v===p7e){if(u.type!=="brace"){R({type:"text",value:v});continue}let L="close";u=n.pop(),u.close=!0,R({type:L,value:v}),I--,u=n[n.length-1];continue}if(v===l7e&&I>0){if(u.ranges>0){u.ranges=0;let L=u.nodes.shift();u.nodes=[L,{type:"text",value:o7e(u)}]}R({type:"comma",value:v}),u.commas++;continue}if(v===c7e&&I>0&&u.commas===0){let L=u.nodes;if(I===0||L.length===0){R({type:"text",value:v});continue}if(A.type==="dot"){if(u.range=[],A.value+=v,A.type="range",u.nodes.length!==3&&u.nodes.length!==5){u.invalid=!0,u.ranges=0,A.type="text";continue}u.ranges++,u.args=[];continue}if(A.type==="range"){L.pop();let U=L[L.length-1];U.value+=A.value+v,A=U,u.ranges--;continue}R({type:"dot",value:v});continue}R({type:"text",value:v})}do if(u=n.pop(),u.type!=="root"){u.nodes.forEach(z=>{z.nodes||(z.type==="open"&&(z.isOpen=!0),z.type==="close"&&(z.isClose=!0),z.nodes||(z.type="text"),z.invalid=!0)});let L=n[n.length-1],U=L.nodes.indexOf(u);L.nodes.splice(U,1,...u.nodes)}while(n.length>0);return R({type:"eos"}),a};aZ.exports=y7e});var AZ=_((XQt,uZ)=>{"use strict";var cZ=yP(),E7e=ZX(),C7e=tZ(),w7e=lZ(),nl=(t,e={})=>{let r=[];if(Array.isArray(t))for(let o of t){let a=nl.create(o,e);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(nl.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};nl.parse=(t,e={})=>w7e(t,e);nl.stringify=(t,e={})=>cZ(typeof t=="string"?nl.parse(t,e):t,e);nl.compile=(t,e={})=>(typeof t=="string"&&(t=nl.parse(t,e)),E7e(t,e));nl.expand=(t,e={})=>{typeof t=="string"&&(t=nl.parse(t,e));let r=C7e(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};nl.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?nl.compile(t,e):nl.expand(t,e);uZ.exports=nl});var AI=_((ZQt,dZ)=>{"use strict";var I7e=ve("path"),Vu="\\\\/",fZ=`[^${Vu}]`,Bf="\\.",B7e="\\+",v7e="\\?",CP="\\/",D7e="(?=.)",pZ="[^/]",EN=`(?:${CP}|$)`,hZ=`(?:^|${CP})`,CN=`${Bf}{1,2}${EN}`,P7e=`(?!${Bf})`,S7e=`(?!${hZ}${CN})`,b7e=`(?!${Bf}{0,1}${EN})`,x7e=`(?!${CN})`,k7e=`[^.${CP}]`,Q7e=`${pZ}*?`,gZ={DOT_LITERAL:Bf,PLUS_LITERAL:B7e,QMARK_LITERAL:v7e,SLASH_LITERAL:CP,ONE_CHAR:D7e,QMARK:pZ,END_ANCHOR:EN,DOTS_SLASH:CN,NO_DOT:P7e,NO_DOTS:S7e,NO_DOT_SLASH:b7e,NO_DOTS_SLASH:x7e,QMARK_NO_DOT:k7e,STAR:Q7e,START_ANCHOR:hZ},F7e={...gZ,SLASH_LITERAL:`[${Vu}]`,QMARK:fZ,STAR:`${fZ}*?`,DOTS_SLASH:`${Bf}{1,2}(?:[${Vu}]|$)`,NO_DOT:`(?!${Bf})`,NO_DOTS:`(?!(?:^|[${Vu}])${Bf}{1,2}(?:[${Vu}]|$))`,NO_DOT_SLASH:`(?!${Bf}{0,1}(?:[${Vu}]|$))`,NO_DOTS_SLASH:`(?!${Bf}{1,2}(?:[${Vu}]|$))`,QMARK_NO_DOT:`[^.${Vu}]`,START_ANCHOR:`(?:^|[${Vu}])`,END_ANCHOR:`(?:[${Vu}]|$)`},R7e={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",spacLine truncated
|
||||
`),A!==-1){let p=a+u.substring(0,A);u=u.substring(A+1),a="",e!==null?this.reportInfo(null,`${e} ${p}`):this.reportInfo(null,p)}while(A!==-1);a+=u}),r.on("end",()=>{let n=o.end();n!==""&&(e!==null?this.reportInfo(null,`${e} ${n}`):this.reportInfo(null,n))}),r}}});var Wm,tO=Et(()=>{Wl();bo();Wm=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let o=this.fetchers.find(a=>a.supports(e,r));return o||null}getFetcher(e,r){let o=this.fetchers.find(a=>a.supports(e,r));if(!o)throw new Jt(11,`${qr(r.project.configuration,e)} isn't supported by any available fetcher`);return o}}});var yg,rO=Et(()=>{bo();yg=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,o){return this.getResolverByDescriptor(e,o).bindDescriptor(e,r,o)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,o){return await this.getResolverByDescriptor(e,o).getCandidates(e,r,o)}async getSatisfying(e,r,o,a){return this.getResolverByDescriptor(e,a).getSatisfying(e,r,o,a)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let o=this.resolvers.find(a=>a.supportsDescriptor(e,r));return o||null}getResolverByDescriptor(e,r){let o=this.resolvers.find(a=>a.supportsDescriptor(e,r));if(!o)throw new Error(`${jn(r.project.configuration,e)} isn't supported by any available resolver`);return o}tryResolverByLocator(e,r){let o=this.resolvers.find(a=>a.supportsLocator(e,r));return o||null}getResolverByLocator(e,r){let o=this.resolvers.find(a=>a.supportsLocator(e,r));if(!o)throw new Error(`${qr(r.project.configuration,e)} isn't supported by any available resolver`);return o}}});var Km,nO=Et(()=>{Pt();bo();Km=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,r){let o=e.reference.indexOf("#");if(o===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(o+1),n=Rs(e,a);return r.fetcher.getLocalPath(n,r)}async fetch(e,r){let o=e.reference.indexOf("#");if(o===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(o+1),n=Rs(e,a),u=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(e,u,r)}getLocatorFilename(e){return Hm(e)}async ensureVirtualLink(e,r,o){let a=r.packageFs.getRealPath(),n=o.project.configuration.get("virtualFolder"),u=this.getLocatorFilename(e),A=zs.makeVirtualPath(n,u,a),p=new Hu(A,{baseFs:r.packageFs,pathUtils:K});return{...r,packageFs:p}}}});var kS,Ose=Et(()=>{kS=class t{static{this.protocol="virtual:"}static isVirtualDescriptor(e){return!!e.range.startsWith(t.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(t.protocol)}supportsDescriptor(e,r){return t.isVirtualDescriptor(e)}supportsLocator(e,r){return t.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(e,r){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(e,r,o){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(e,r,o,a){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(e,r){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}}});var Vm,iO=Et(()=>{Pt();mg();Vm=class{supports(e){return!!e.reference.startsWith(ei.protocol)}getLocalPath(e,r){return this.getWorkspace(e,r).cwd}async fetch(e,r){let o=this.getWorkspace(e,r).cwd;return{packageFs:new gn(o),prefixPath:It.dot,localPath:o}}getWorkspace(e,r){return r.project.getWorkspaceByCwd(e.reference.slice(ei.protocol.length))}}});function KI(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Use(t){return typeof t>"u"?3:KI(t)?0:Array.isArray(t)?1:2}function aO(t,e){return Object.hasOwn(t,e)}function brt(t){return KI(t)&&aO(t,"onConflict")&&typeof t.onConflict=="string"}function xrt(t){if(typeof t>"u")return{onConflict:"default",value:t};if(!brt(t))return{onConflict:"default",value:t};if(aO(t,"value"))return t;let{onConflict:e,...r}=t;return{onConflict:e,value:r}}function _se(t,e){let r=KI(t)&&aO(t,e)?t[e]:void 0;return xrt(r)}function zm(t,e){return[t,e,Hse]}function lO(t){return Array.isArray(t)?t[2]===Hse:!1}function sO(t,e){if(KI(t)){let r={};for(let o of Object.keys(t))r[o]=sO(t[o],e);return zm(e,r)}return Array.isArray(t)?zm(e,t.map(r=>sO(r,e))):zm(e,t)}function oO(t,e,r,o,a){let n,u=[],A=a,p=0;for(let E=a-Line truncated
|
||||
`,I.message,I.stack);var v=new Error("tunneling socket could not be established, cause="+I.message);v.code="ECONNRESET",e.request.emit("error",v),o.removeSocket(a)}};xf.prototype.removeSocket=function(e){var r=this.sockets.indexOf(e);if(r!==-1){this.sockets.splice(r,1);var o=this.requests.shift();o&&this.createSocket(o,function(a){o.request.onSocket(a)})}};function Yse(t,e){var r=this;xf.prototype.createSocket.call(r,t,function(o){var a=t.request.getHeader("host"),n=hO({},r.options,{socket:o,servername:a?a.replace(/:.*$/,""):t.host}),u=Qrt.connect(0,n);r.sockets[r.sockets.indexOf(o)]=u,e(u)})}function Wse(t,e,r){return typeof t=="string"?{host:t,port:e,localAddress:r}:t}function hO(t){for(var e=1,r=arguments.length;e<r;++e){var o=arguments[e];if(typeof o=="object")for(var a=Object.keys(o),n=0,u=a.length;n<u;++n){var A=a[n];o[A]!==void 0&&(t[A]=o[A])}}return t}var ih;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?ih=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:ih=function(){};Xm.debug=ih});var zse=_((pLt,Vse)=>{Vse.exports=Kse()});var Qf=_((kf,NS)=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var Jse=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Ort(t){return Jse.includes(t)}var Urt=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...Jse];function _rt(t){return Urt.includes(t)}var Hrt=["null","undefined","string","number","bigint","boolean","symbol"];function qrt(t){return Hrt.includes(t)}function Zm(t){return e=>typeof e===t}var{toString:Xse}=Object.prototype,zI=t=>{let e=Xse.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&Pe.domElement(t))return"HTMLElement";if(_rt(e))return e},Xn=t=>e=>zI(e)===t;function Pe(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(Pe.observable(t))return"Observable";if(Pe.array(t))return"Array";if(Pe.buffer(t))return"Buffer";let e=zI(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}Pe.undefined=Zm("undefined");Pe.string=Zm("string");var jrt=Zm("number");Pe.number=t=>jrt(t)&&!Pe.nan(t);Pe.bigint=Zm("bigint");Pe.function_=Zm("function");Pe.null_=t=>t===null;Pe.class_=t=>Pe.function_(t)&&t.toString().startsWith("class ");Pe.boolean=t=>t===!0||t===!1;Pe.symbol=Zm("symbol");Pe.numericString=t=>Pe.string(t)&&!Pe.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));Pe.array=(t,e)=>Array.isArray(t)?Pe.function_(e)?t.every(e):!0:!1;Pe.buffer=t=>{var e,r,o,a;return(a=(o=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||o===void 0?void 0:o.call(r,t))!==null&&a!==void 0?a:!1};Pe.blob=t=>Xn("Blob")(t);Pe.nullOrUndefined=t=>Pe.null_(t)||Pe.undefined(t);Pe.object=t=>!Pe.null_(t)&&(typeof t=="object"||Pe.function_(t));Pe.iterable=t=>{var e;return Pe.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};Pe.asyncIterable=t=>{var e;return Pe.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};Pe.generator=t=>{var e,r;return Pe.iterable(t)&&Pe.function_((e=t)===null||e===void 0?void 0:e.next)&&Pe.function_((r=t)===null||r===void 0?void 0:r.throw)};Pe.asyncGenerator=t=>Pe.asyncIterable(t)&&Pe.function_(t.next)&&Pe.function_(t.throw);Pe.nativePromise=t=>Xn("Promise")(t);var Grt=t=>{var e,r;return Pe.function_((e=t)===null||e===void 0?void 0:e.then)&&Pe.function_((r=t)===null||r===void 0?void 0:r.catch)};Pe.promise=t=>Pe.nativePromise(t)||Grt(t);Pe.generatorFunction=Xn("GeneratorFunction");Pe.asyncGeneratorFunction=t=>zI(t)==="AsyncGeneratorFunction";Pe.asyncFunction=t=>zI(t)==="AsyncFunction";Pe.boundFunction=t=>Pe.function_(t)&&!t.hasOwnProperty("prototype");Pe.regExp=Xn("RegExp");Pe.date=Xn("Date");Pe.error=Xn("Error");Pe.map=t=>Xn("Map")(t);Pe.set=t=>Xn("Set")(t);Pe.weakMap=t=>Xn("WeakMap")(t);Pe.weakSet=t=>Xn("WeakSet")(t);Pe.int8Array=Xn("Int8Array");Pe.uint8Array=Xn("Uint8Array");Pe.uint8ClampedArray=Xn("Uint8ClampedArray");Pe.int16Array=Xn("Int16Array");Pe.uint16Array=Xn("Uint16Array");Pe.int32Array=Xn("Int32Array");Pe.uint32Array=Xn("Uint32Array");Pe.float32Array=Xn("Float32Array");Pe.float64Array=Xn("Float64Array");Pe.bigInt64Array=Xn("BigInt64Array");Pe.bigUint64Array=Xn("BigUint64Array");Pe.arrayBuffer=Xn("ArrayBuffer");Pe.sharedArrayBuffer=Xn("SharedArrayBuffer");P
Line truncated
|
||||
Please report this to https://github.com/szmarczak/http2-wrapper/`);C(R)}return}o[0].resolve(x);return}}if(u in this.queue){if(A in this.queue[u]){this.queue[u][A].listeners.push(...o),this._tryToCreateNewSession(u,A);return}}else this.queue[u]={};let p=()=>{u in this.queue&&this.queue[u][A]===h&&(delete this.queue[u][A],Object.keys(this.queue[u]).length===0&&delete this.queue[u])},h=()=>{let E=`${A}:${u}`,I=!1;try{let v=$nt.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});v[ra]=0,v[ty]=!1;let x=()=>v[ra]<v.remoteSettings.maxConcurrentStreams,C=!0;v.socket.once("session",L=>{this.tlsSessionCache.set(E,L)}),v.once("error",L=>{for(let{reject:U}of o)U(L);this.tlsSessionCache.delete(E)}),v.setTimeout(this.timeout,()=>{v.destroy()}),v.once("close",()=>{if(I){C&&this._freeSessionsCount--,this._sessionsCount--;let L=this.sessions[u];L.splice(L.indexOf(v),1),L.length===0&&delete this.sessions[u]}else{let L=new Error("Session closed without receiving a SETTINGS frame");L.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:U}of o)U(L);p()}this._tryToCreateNewSession(u,A)});let R=()=>{if(!(!(u in this.queue)||!x())){for(let L of v[Kl])if(L in this.queue[u]){let{listeners:U}=this.queue[u][L];for(;U.length!==0&&x();)U.shift().resolve(v);let z=this.queue[u];if(z[L].listeners.length===0&&(delete z[L],Object.keys(z).length===0)){delete this.queue[u];break}if(!x())break}}};v.on("origin",()=>{v[Kl]=v.originSet,x()&&(R(),UO(this.sessions[u],v))}),v.once("remoteSettings",()=>{if(v.ref(),v.unref(),this._sessionsCount++,h.destroyed){let L=new Error("Agent has been destroyed");for(let U of o)U.reject(L);v.destroy();return}v[Kl]=v.originSet;{let L=this.sessions;if(u in L){let U=L[u];U.splice(rit(U,v,nit),0,v)}else L[u]=[v]}this._freeSessionsCount+=1,I=!0,this.emit("session",v),R(),p(),v[ra]===0&&this._freeSessionsCount>this.maxFreeSessions&&v.close(),o.length!==0&&(this.getSession(A,r,o),o.length=0),v.on("remoteSettings",()=>{R(),UO(this.sessions[u],v)})}),v[Voe]=v.request,v.request=(L,U)=>{if(v[ty])throw new Error("The session is gracefully closing. No new streams are allowed.");let z=v[Voe](L,U);return v.ref(),++v[ra],v[ra]===v.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,z.once("close",()=>{if(C=x(),--v[ra],!v.destroyed&&!v.closed&&(iit(this.sessions[u],v),x()&&!v.closed)){C||(this._freeSessionsCount++,C=!0);let te=v[ra]===0;te&&v.unref(),te&&(this._freeSessionsCount>this.maxFreeSessions||v[ty])?v.close():(UO(this.sessions[u],v),R())}}),z}}catch(v){for(let x of o)x.reject(v);p()}};h.listeners=o,h.completed=!1,h.destroyed=!1,this.queue[u][A]=h,this._tryToCreateNewSession(u,A)})}request(e,r,o,a){return new Promise((n,u)=>{this.getSession(e,r,[{reject:u,resolve:A=>{try{n(A.request(o,a))}catch(p){u(p)}}}])})}createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let o=e.port||443,a=e.hostname||e.host;return typeof r.servername>"u"&&(r.servername=a),Znt.connect(o,a,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[ra]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let o of r)o.destroy(e);for(let r of Object.values(this.queue))for(let o of Object.values(r))o.destroyed=!0;this.queue={}}get freeSessions(){return zoe({agent:this,isFree:!0})}get busySessions(){return zoe({agent:this,isFree:!1})}};Cg.kCurrentStreamsCount=ra;Cg.kGracefullyClosing=ty;Xoe.exports={Agent:Cg,globalAgent:new Cg}});var qO=_((ULt,Zoe)=>{"use strict";var{Readable:sit}=ve("stream"),HO=class extends sit{constructor(e,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};Zoe.exports=HO});var jO=_((_Lt,$oe)=>{"use strict";$oe.exports=t=>{let e={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return typeof t.port=="string"&&t.port.length!==0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}});var tae=_((HLt,eae)=>{"use strict";eae.exports=(t,e,r)=>{for(let o of r)t.on(o,(...a)=>e.emit(o,...a))}});var nae=_((qLt,rae)=>{"use strict";rae.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var sae=_((GLt,iae)=>{"use strict";var ry=(t,e,r)=>{iae.exports[e]=class extends t{constructor(...a){super(typeof r=="string"?r:
Line truncated
|
||||
`).reverse(),A=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
|
||||
`).reverse();for(;A.length!==0&&A[0]===u[0];)u.shift();this.stack=`${this.stack.slice(0,n)}${u.reverse().join(`
|
||||
`)}${A.reverse().join(`
|
||||
`)}`}}};Bn.RequestError=Ji;var ZS=class extends Ji{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError"}};Bn.MaxRedirectsError=ZS;var $S=class extends Ji{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError"}};Bn.HTTPError=$S;var eb=class extends Ji{constructor(e,r){super(e.message,e,r),this.name="CacheError"}};Bn.CacheError=eb;var tb=class extends Ji{constructor(e,r){super(e.message,e,r),this.name="UploadError"}};Bn.UploadError=tb;var rb=class extends Ji{constructor(e,r,o){super(e.message,e,o),this.name="TimeoutError",this.event=e.event,this.timings=r}};Bn.TimeoutError=rb;var n1=class extends Ji{constructor(e,r){super(e.message,e,r),this.name="ReadError"}};Bn.ReadError=n1;var nb=class extends Ji{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};Bn.UnsupportedProtocolError=nb;var fst=["socket","connect","continue","information","upgrade","timeout"],ib=class extends Hae.Duplex{constructor(e,r={},o){super({autoDestroy:!1,highWaterMark:0}),this[iy]=0,this[oy]=0,this.requestInitialized=!1,this[zS]=new Set,this.redirects=[],this[ay]=!1,this[JS]=!1,this[r1]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on("pipe",h=>{h.prependListener("data",a),h.on("data",n),h.prependListener("end",a),h.on("end",n)}),this.on("unpipe",h=>{h.off("data",a),h.off("data",n),h.off("end",a),h.off("end",n)}),this.on("pipe",h=>{h instanceof p4.IncomingMessage&&(this.options.headers={...h.headers,...this.options.headers})});let{json:u,body:A,form:p}=r;if((u||A||p)&&this._lockWrite(),Bn.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,o)}catch(h){ot.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(h);return}(async()=>{var h;try{this.options.body instanceof Yit.ReadStream&&await cst(this.options.body);let{url:E}=this.options;if(!E)throw new TypeError("Missing `url` property");if(this.requestUrl=E.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(h=this[$s])===null||h===void 0||h.destroy();return}for(let I of this[r1])I();this[r1].length=0,this.requestInitialized=!0}catch(E){if(E instanceof Ji){this._beforeError(E);return}this.destroyed||this.destroy(E)}})()}static normalizeArguments(e,r,o){var a,n,u,A,p;let h=r;if(ot.default.object(e)&&!ot.default.urlInstance(e))r={...o,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...o,...r},e!==void 0&&(r.url=e),ot.default.urlInstance(r.url)&&(r.url=new sh.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),ot.assert.any([ot.default.string,ot.default.undefined],r.method),ot.assert.any([ot.default.object,ot.default.undefined],r.headers),ot.assert.any([ot.default.string,ot.default.urlInstance,ot.default.undefined],r.prefixUrl),ot.assert.any([ot.default.object,ot.default.undefined],r.cookieJar),ot.assert.any([ot.default.object,ot.default.string,ot.default.undefined],r.searchParams),ot.assert.any([ot.default.object,ot.default.string,ot.default.undefined],r.cache),ot.assert.any([ot.default.object,ot.default.number,ot.default.undefined],r.timeout),ot.assert.any([ot.default.object,ot.default.undefined],r.context),ot.assert.any([ot.default.object,ot.default.undefined],r.hooks),ot.assert.any([ot.default.boolean,ot.default.undefined],r.decompress),ot.assert.any([ot.default.boolean,ot.default.undefined],r.ignoreInvalidCookies),ot.assert.any([ot.default.boolean,ot.default.undefined],r.followRedirect),ot.assert.any([ot.default.number,ot.default.undefined],r.maxRedirects),ot.assert.any([ot.default.boolean,ot.default.undefined],r.throwHttpErrors),ot.assert.any([ot.default.boolean,ot.default.undefined],r.http2),ot.assert.any([ot.default.boolean,ot.default.undefined],r.allowGetBody),ot.assert.any([ot.default.string,ot.default.undefined],r.localAddress),ot.assert.any([Kae.isDnsLookupIpVersion,ot.default.undefined],r.dnsLookupIpVersion),ot.assert.any([ot.default.object,ot.default.undefined],r.https),ot.assert.any([ot.default.boolean,ot.default.undefined],r.rejectUnauthorized),r.https&&(ot.assert.any([ot.default.boolean,ot.default.undefined],r.https.rejectUnauthorized),ot.assert.any([ot.default.function_,ot.default.undefined],r.https.checkServerIdentity),ot.assert.any([ot.default.string,ot.default.object,ot.default.array,ot.default.undefined],r.https.certificateAuthority),ot.assert.any([ot.default.string,ot.default.object,ot.default.array,ot.default.undefined],r.https.key),ot.assert.any([ot.default.string,ot.default.object,ot.default.array,ot.default.undefined],r.https.certificate),ot.assert.any([ot.default.string,ot.default.undefined],r.https.passphrase),ot.assert.any([ot.default.string,ot.default.buffer,ot.default.array,ot.default.undefined],r.httpLine truncated
|
||||
`)[3];return Xst(e)}function Q4(){return typeof fb.default.availableParallelism<"u"?fb.default.availableParallelism():Math.max(1,fb.default.cpus().length)}var fb,Gst,Ple,Yst,Wst,Sle,ble,zst,Jst,pb=Et(()=>{Pt();fb=Ze(ve("os"));hb();ql();Gst=Number(process.versions.node.split(".")[0]),Ple=new Map([["darwin","open"],["linux","xdg-open"],["win32","explorer.exe"]]).get(process.platform),Yst=typeof Ple<"u"?async t=>{try{return await F4(Ple,[t],{cwd:K.cwd()}),!0}catch{return!1}}:void 0,Wst="/usr/bin/ldd";zst=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jst=/\((\S*)(?::(\d+))(?::(\d+))\)/});function M4(t,e,r,o,a){let n=VI(r);if(o.isArray||o.type==="ANY"&&Array.isArray(n))return Array.isArray(n)?n.map((u,A)=>R4(t,`${e}[${A}]`,u,o,a)):String(n).split(/,/).map(u=>R4(t,e,u,o,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings "${e}" cannot be an array`);return R4(t,e,r,o,a)}function R4(t,e,r,o,a){let n=VI(r);switch(o.type){case"ANY":return QS(n);case"SHAPE":return rot(t,e,r,o,a);case"MAP":return not(t,e,r,o,a)}if(n===null&&!o.isNullable&&o.default!==null)throw new Error(`Non-nullable configuration settings "${e}" cannot be set to null`);if(o.values?.includes(n))return n;let A=(()=>{if(o.type==="BOOLEAN"&&typeof n!="string")return QI(n);if(typeof n!="string")throw new Error(`Expected configuration setting "${e}" to be a string, got ${typeof n}`);let p=YP(n,{env:t.env});switch(o.type){case"ABSOLUTE_PATH":{let h=a,E=cO(r);return E&&E[0]!=="<"&&(h=K.dirname(E)),K.resolve(h,ue.toPortablePath(p))}case"LOCATOR_LOOSE":return Sf(p,!1);case"NUMBER":return parseInt(p);case"LOCATOR":return Sf(p);case"BOOLEAN":return QI(p);default:return p}})();if(o.values&&!o.values.includes(A))throw new Error(`Invalid value, expected one of ${o.values.join(", ")}`);return A}function rot(t,e,r,o,a){let n=VI(r);if(typeof n!="object"||Array.isArray(n))throw new st(`Object configuration settings "${e}" must be an object`);let u=O4(t,o,{ignoreArrays:!0});if(n===null)return u;for(let[A,p]of Object.entries(n)){let h=`${e}.${A}`;if(!o.properties[A])throw new st(`Unrecognized configuration settings found: ${e}.${A} - run "yarn config -v" to see the list of settings supported in Yarn`);u.set(A,M4(t,h,p,o.properties[A],a))}return u}function not(t,e,r,o,a){let n=VI(r),u=new Map;if(typeof n!="object"||Array.isArray(n))throw new st(`Map configuration settings "${e}" must be an object`);if(n===null)return u;for(let[A,p]of Object.entries(n)){let h=o.normalizeKeys?o.normalizeKeys(A):A,E=`${e}['${h}']`,I=o.valueDefinition;u.set(h,M4(t,E,p,I,a))}return u}function O4(t,e,{ignoreArrays:r=!1}={}){switch(e.type){case"SHAPE":{if(e.isArray&&!r)return[];let o=new Map;for(let[a,n]of Object.entries(e.properties))o.set(a,O4(t,n));return o}case"MAP":return e.isArray&&!r?[]:new Map;case"ABSOLUTE_PATH":return e.default===null?null:t.projectCwd===null?Array.isArray(e.default)?e.default.map(o=>K.normalize(o)):K.isAbsolute(e.default)?K.normalize(e.default):e.isNullable?null:void 0:Array.isArray(e.default)?e.default.map(o=>K.resolve(t.projectCwd,o)):K.resolve(t.projectCwd,e.default);default:return e.default}}function db(t,e,r){if(e.type==="SECRET"&&typeof t=="string"&&r.hideSecrets)return tot;if(e.type==="ABSOLUTE_PATH"&&typeof t=="string"&&r.getNativePaths)return ue.fromPortablePath(t);if(e.isArray&&Array.isArray(t)){let o=[];for(let a of t)o.push(db(a,e,r));return o}if(e.type==="MAP"&&t instanceof Map){if(t.size===0)return;let o=new Map;for(let[a,n]of t.entries()){let u=db(n,e.valueDefinition,r);typeof u<"u"&&o.set(a,u)}return o}if(e.type==="SHAPE"&&t instanceof Map){if(t.size===0)return;let o=new Map;for(let[a,n]of t.entries()){let u=e.properties[a],A=db(n,u,r);typeof A<"u"&&o.set(a,A)}return o}return t}function iot(){let t={};for(let[e,r]of Object.entries(process.env))e=e.toLowerCase(),e.startsWith(mb)&&(e=(0,kle.default)(e.slice(mb.length)),t[e]=r);return t}function N4(){let t=`${mb}rc_filename`;for(let[e,r]of Object.entries(process.env))if(e.toLowerCase()===t&&typeof r=="string")return r;return L4}async function xle(t){try{return await oe.readFilePromise(t)}catch{return Buffer.of()}}async function sot(t,e){return Buffer.compare(...await Promise.all([xle(t),xle(e)]))===0}async function oot(t,e){let[r,o]=await Promise.all([oe.statPromise(t),oe.statPromise(e)]);return r.dev===o.dev&&r.ino===o.ino}async function lot({configuration:t,selfPath:e}){let r=t.get("yarnPath");return t.get("ignorePath")||r===null||r===e||await aot(r,e)?null:r}var kle,Rf,Qle,Fle,Rle,T4,$st,l1,eot,ly,mb,L4,tot,c1,Tle,yb,gb,aot,Ke,u1=Et(()=>{Pt();Nl();kle=Ze(sV()),Rf=Ze(X0());qt();Qle=Ze(ZV()),Fle=ve("module"),Rle=Ze(eg()),T4=ve("stream");use();Gm();tO();rO();nO();Ose();iO();mg();jse();TS();jl();th();Ab();ql();pb();bf();bo();$st=function(){if(!Rf.GITHUB_ACTIONS||!process.env.GITHUB_EVENT_PATH)return!1;let t=ue.toPortablePath(process.env.GITHUB_EVENT_PATH),e;try{e=oe.readJsonSync(t)}catch{ret
Line truncated
|
||||
`);return{stdout:n,stderr:u}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let o of r.resolvers||[])e.push(new o);return new yg([new kS,new ei,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let o of r.fetchers||[])e.push(new o);return new Wm([new Km,new Vm,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let o of r.linkers||[])e.push(new o);return e}getSupportedArchitectures(){let e=a1(),r=this.get("supportedArchitectures"),o=r.get("os");o!==null&&(o=o.map(u=>u==="current"?e.os:u));let a=r.get("cpu");a!==null&&(a=a.map(u=>u==="current"?e.cpu:u));let n=r.get("libc");return n!==null&&(n=ol(n,u=>u==="current"?e.libc??ol.skip:u)),{os:o,cpu:a,libc:n}}isInteractive({interactive:e,stdout:r}){return r.isTTY?e??this.get("preferInteractive"):!1}async getPackageExtensions(){if(this.packageExtensions!==null)return this.packageExtensions;this.packageExtensions=new Map;let e=this.packageExtensions,r=(o,a,{userProvided:n=!1}={})=>{if(!Qa(o.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let u=new Ut;u.load(a,{yamlCompatibilityMode:!0});let A=xI(e,o.identHash),p=[];A.push([o.range,p]);let h={status:"inactive",userProvided:n,parentDescriptor:o};for(let E of u.dependencies.values())p.push({...h,type:"Dependency",descriptor:E});for(let E of u.peerDependencies.values())p.push({...h,type:"PeerDependency",descriptor:E});for(let[E,I]of u.peerDependenciesMeta)for(let[v,x]of Object.entries(I))p.push({...h,type:"PeerDependencyMeta",selector:E,key:v,value:x})};await this.triggerHook(o=>o.registerPackageExtensions,this,r);for(let[o,a]of this.get("packageExtensions"))r(rh(o,!0),GP(a),{userProvided:!0});return e}normalizeLocator(e){return Qa(e.reference)?Rs(e,`${this.get("defaultProtocol")}${e.reference}`):ly.test(e.reference)?Rs(e,`${this.get("defaultProtocol")}${e.reference}`):e}normalizeDependency(e){return Qa(e.range)?In(e,`${this.get("defaultProtocol")}${e.range}`):ly.test(e.range)?In(e,`${this.get("defaultProtocol")}${e.range}`):e}normalizeDependencyMap(e){return new Map([...e].map(([r,o])=>[r,this.normalizeDependency(o)]))}normalizePackage(e,{packageExtensions:r}){let o=OI(e),a=r.get(e.identHash);if(typeof a<"u"){let u=e.version;if(u!==null){for(let[A,p]of a)if(tA(u,A))for(let h of p)switch(h.status==="inactive"&&(h.status="redundant"),h.type){case"Dependency":typeof o.dependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",o.dependencies.set(h.descriptor.identHash,this.normalizeDependency(h.descriptor)));break;case"PeerDependency":typeof o.peerDependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",o.peerDependencies.set(h.descriptor.identHash,h.descriptor));break;case"PeerDependencyMeta":{let E=o.peerDependenciesMeta.get(h.selector);(typeof E>"u"||!Object.hasOwn(E,h.key)||E[h.key]!==h.value)&&(h.status="active",al(o.peerDependenciesMeta,h.selector,()=>({}))[h.key]=h.value)}break;default:cL(h)}}}let n=u=>u.scope?`${u.scope}__${u.name}`:`${u.name}`;for(let u of o.peerDependenciesMeta.keys()){let A=ea(u);o.peerDependencies.has(A.identHash)||o.peerDependencies.set(A.identHash,In(A,"*"))}for(let u of o.peerDependencies.values()){if(u.scope==="types")continue;let A=n(u),p=eA("types",A),h=rn(p);o.peerDependencies.has(p.identHash)||o.peerDependenciesMeta.has(h)||(o.peerDependencies.set(p.identHash,In(p,"*")),o.peerDependenciesMeta.set(h,{optional:!0}))}return o.dependencies=new Map(Fs(o.dependencies,([,u])=>xa(u))),o.peerDependencies=new Map(Fs(o.peerDependencies,([,u])=>xa(u))),o}getLimit(e){return al(this.limits,e,()=>(0,Rle.default)(this.get(e)))}async triggerHook(e,...r){for(let o of this.plugins.values()){let a=o.hooks;if(!a)continue;let n=e(a);n&&await n(...r)}}async triggerMultipleHooks(e,r){for(let o of r)await this.triggerHook(e,...o)}async reduceHook(e,r,...o){let a=r;for(let n of this.plugins.values()){let u=n.hooks;if(!u)continue;let A=e(u);A&&(a=await A(a,...o))}return a}async firstHook(e,...r){for(let o of this.plugins.values()){let a=o.hooks;if(!a)continue;let n=e(a);if(!n)continue;let u=await n(...r);if(typeof u<"u")return u}return null}}});var Ur={};Vt(Ur,{EndStrategy:()=>q4,ExecError:()=>Eb,PipeError:()=>A1,execvp:()=>F4,pipevp:()=>Wc});function Ig(t){return t!==null&&typeof t.fd=="number"}function U4(){}function _4(){for(let t of Bg)t.kill()}async function Wc(t,e,{cwd:r,env:o=process.env,strict:a=!1,stdin:n=null,stdout:u,stderr:A,end:p=2}){let h=["pipe","pipe","pipe"];n===null?h[0]="ignore":Ig(n)&&(h[0]=n),Ig(u)&&(h[1]=u),Ig(A)&&(h[2]=A);let E=(0,H4.default)(t,e,{cwd:ue.fromPortablePath(r),env:{...o,PWD:ue.fromPortablePath(r)},stdio:h});Bg.add(E),Bg.size===1&&(process.on("SIGINT",U4),process.on("SIGTERM",_4)),!Ig(n)&&n!==null&&n.pipe(E.stdin),Ig(u)||E.stdout.pipe(u,{end:!1}),Ig(A)||E.stderr.pipe(A,{end:!1});let I=()=>{for(let v of new Set([u,A]))Ig(v)||v.end()};return new Promise((v,x)=>{E.on("error",C=>{Bg.delete(E),Bg.size===0&&(process.off("SIGINT",U4),process.off("SIGTERM",_4)),(p===2||p
Line truncated
|
||||
This command will run a command using Yarn's portable shell.
|
||||
|
||||
Make sure to escape glob patterns, redirections, and other features that might be expanded by your own shell.
|
||||
|
||||
Note: To escape something from Yarn's shell, you might have to escape it twice, the first time from your own shell.
|
||||
|
||||
Note: Don't use this command in Yarn scripts, as Yarn's shell is automatically used.
|
||||
|
||||
For a list of features, visit: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-shell/README.md.
|
||||
`,examples:[["Run a simple command","$0 echo Hello"],["Run a command with a glob pattern","$0 echo '*.js'"],["Run a command with a redirection","$0 echo Hello World '>' hello.txt"],["Run a command with an escaped glob pattern (The double escape is needed in Unix shells)",`$0 echo '"*.js"'`],["Run a command with a variable (Double quotes are needed in Unix shells, to prevent them from expanding the variable)",'$0 "GREETING=Hello echo $GREETING World"']]}}async execute(){let r=this.args.length>0?`${this.commandName} ${this.args.join(" ")}`:this.commandName;return await cy(r,[],{cwd:ue.toPortablePath(this.cwd),stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}}});var ll,Jle=Et(()=>{ll=class extends Error{constructor(e){super(e),this.name="ShellError"}}});var Db={};Vt(Db,{fastGlobOptions:()=>$le,isBraceExpansion:()=>Z4,isGlobPattern:()=>got,match:()=>dot,micromatchOptions:()=>vb});function got(t){if(!Bb.default.scan(t,vb).isGlob)return!1;try{Bb.default.parse(t,vb)}catch{return!1}return!0}function dot(t,{cwd:e,baseFs:r}){return(0,Xle.default)(t,{...$le,cwd:ue.fromPortablePath(e),fs:mD(Zle.default,new Up(r))})}function Z4(t){return Bb.default.scan(t,vb).isBrace}var Xle,Zle,Bb,vb,$le,ece=Et(()=>{Pt();Xle=Ze(ES()),Zle=Ze(ve("fs")),Bb=Ze($o()),vb={strictBrackets:!0},$le={onlyDirectories:!1,onlyFiles:!1}});function $4(){}function eU(){for(let t of vg)t.kill()}function ice(t,e,r,o){return a=>{let n=a[0]instanceof iA.Transform?"pipe":a[0],u=a[1]instanceof iA.Transform?"pipe":a[1],A=a[2]instanceof iA.Transform?"pipe":a[2],p=(0,rce.default)(t,e,{...o,stdio:[n,u,A]});return vg.add(p),vg.size===1&&(process.on("SIGINT",$4),process.on("SIGTERM",eU)),a[0]instanceof iA.Transform&&a[0].pipe(p.stdin),a[1]instanceof iA.Transform&&p.stdout.pipe(a[1],{end:!1}),a[2]instanceof iA.Transform&&p.stderr.pipe(a[2],{end:!1}),{stdin:p.stdin,promise:new Promise(h=>{p.on("error",E=>{switch(vg.delete(p),vg.size===0&&(process.off("SIGINT",$4),process.off("SIGTERM",eU)),E.code){case"ENOENT":a[2].write(`command not found: ${t}
|
||||
`),h(127);break;case"EACCES":a[2].write(`permission denied: ${t}
|
||||
`),h(128);break;default:a[2].write(`uncaught error: ${E.message}
|
||||
`),h(1);break}}),p.on("close",E=>{vg.delete(p),vg.size===0&&(process.off("SIGINT",$4),process.off("SIGTERM",eU)),h(E!==null?E:129)})})}}}function sce(t){return e=>{let r=e[0]==="pipe"?new iA.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}function Pb(t,e){return rU.start(t,e)}function tce(t,e=null){let r=new iA.PassThrough,o=new nce.StringDecoder,a="";return r.on("data",n=>{let u=o.write(n),A;do if(A=u.indexOf(`
|
||||
`),A!==-1){let p=a+u.substring(0,A);u=u.substring(A+1),a="",t(e!==null?`${e} ${p}`:p)}while(A!==-1);a+=u}),r.on("end",()=>{let n=o.end();n!==""&&t(e!==null?`${e} ${n}`:n)}),r}function oce(t,{prefix:e}){return{stdout:tce(r=>t.stdout.write(`${r}
|
||||
`),t.stdout.isTTY?e:null),stderr:tce(r=>t.stderr.write(`${r}
|
||||
`),t.stderr.isTTY?e:null)}}var rce,iA,nce,vg,Jl,tU,rU,nU=Et(()=>{rce=Ze(KR()),iA=ve("stream"),nce=ve("string_decoder"),vg=new Set;Jl=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},tU=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},rU=class t{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:o,stderr:a}){let n=new t(null,e);return n.stdin=r,n.stdout=o,n.stderr=a,n}pipeTo(e,r=1){let o=new t(this,e),a=new tU;return o.pipe=a,o.stdout=this.stdout,o.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),o}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,e[1]=r.get();let o;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");o=this.stderr,e[2]=o.get();let a=this.implementation(e);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),o.close(),n))}async run(){let e=[];for(let o=this;o;o=o.ancestor)e.push(o.exec());return(await Promise.all(e))[0]}}});var E1={};Vt(E1,{EntryCommand:()=>h1,ShellError:()=>ll,execute:()=>cy,globUtils:()=>Db});function ace(t,e,r){let o=new cl.PassThrough({autoDestroy:!0});switch(t){case 0:(e&1)===1&&r.stdin.pipe(o,{end:!1}),(e&2)===2&&r.stdin instanceof cl.Writable&&o.pipe(r.stdin,{end:!1});break;case 1:(e&1)===1&&r.stdout.pipe(o,{end:!1}),(e&2)===2&&o.pipe(r.stdout,{end:!1});break;case 2:(e&1)===1&&r.stderr.pipe(o,{end:!1}),(e&2)===2&&o.pipe(r.stderr,{end:!1});break;default:throw new ll(`Bad file descriptor: "${t}"`)}return o}function bb(t,e={}){let r={...t,...e};return r.environment={...t.environment,...e.environment},r.variables={...t.variables,...e.variables},r}async function yot(t,e,r){let o=[],a=new cl.PassThrough;return a.on("data",n=>o.push(n)),await xb(t,e,bb(r,{stdout:a})),Buffer.concat(o).toString().replace(/[\r\n]+$/,"")}async function lce(t,e,r){let o=t.map(async n=>{let u=await Dg(n.args,e,r);return{name:n.name,value:u.join(" ")}});return(await Promise.all(o)).reduce((n,u)=>(n[u.name]=u.value,n),{})}function Sb(t){return t.match(/[^ \r\n\t]+/g)||[]}async function hce(t,e,r,o,a=o){switch(t.name){case"$":o(String(process.pid));break;case"#":o(String(e.args.length));break;case"@":if(t.quoted)for(let n of e.args)a(n);else for(let n of e.args){let u=Sb(n);for(let A=0;A<u.length-1;++A)a(u[A]);o(u[u.length-1])}break;case"*":{let n=e.args.join(" ");if(t.quoted)o(n);else for(let u of Sb(n))a(u)}break;case"PPID":o(String(process.ppid));break;case"RANDOM":o(String(Math.floor(Math.random()*32768)));break;default:{let n=parseInt(t.name,10),u,A=Number.isFinite(n);if(A?n>=0&&n<e.args.length&&(u=e.args[n]):Object.hasOwn(r.variables,t.name)?u=r.variables[t.name]:Object.hasOwn(r.environment,t.name)&&(u=r.environment[t.name]),typeof u<"u"&&t.alternativeValue?u=(await Dg(t.alternativeValue,e,r)).join(" "):typeof u>"u"&&(t.defaultValue?u=(await Dg(t.defaultValue,e,r)).join(" "):t.alternativeValue&&(u="")),typeof u>"u")throw A?new ll(`Unbound argument #${n}`):new ll(`Unbound variable "${t.name}"`);if(t.quoted)o(u);else{let p=Sb(u);for(let E=0;E<p.length-1;++E)a(p[E]);let h=p[p.length-1];typeof h<"u"&&o(h)}}break}}async function d1(t,e,r){if(t.type==="number"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: "${t.value}", only integers are allowed`)}else if(t.type==="variable"){let o=[];await hce({...t,quoted:!0},e,r,n=>o.push(n));let a=Number(o.join(" "));return Number.isNaN(a)?d1({type:"variable",name:o.join(" ")},e,r):d1({type:"number",value:a},e,r)}else return Eot[t.type](await d1(t.left,e,r),await d1(t.right,e,r))}async function Dg(t,e,r){let o=new Map,a=[],n=[],u=E=>{n.push(E)},A=()=>{n.length>0&&a.push(n.join("")),n=[]},p=E=>{u(E),A()},h=(E,I,v)=>{let x=JSON.stringify({type:E,fd:I}),C=o.get(x);typeof C>"u"&&o.set(x,C=[]),C.push(v)};for(let E of t){let I=!1;switch(E.type){case"redirection":{let v=await Dg(E.args,e,r);for(let x of v)h(E.subtype,E.fd,x)}break;case"argument":for(let v of E.segments)switch(v.type){case"text":u(v.text);break;case"glob":u(v.pattern),I=!0;break;case"shell":{let x=await yot(v.shell,e,r);if(v.quoted)u(x);else{let C=Sb(x);for(let R=0;R<C.length-1;++R)p(C[R]);u(C[C.length-1])}}break;case"variable":await hce(v,e,r,u,p);break;case"arithmetic":u(String(await d1(v.arithmetic,e,r)));break}break}if(A(),I){let v=a.pop();if(typeof v>"u")throw new Error("Assertion failed: Expected a glob pa
Line truncated
|
||||
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${p}, '${u(Jd(t))}' has ended
|
||||
`)})),0}return await uce(t,e,r)}async function Bot(t,e,r,{background:o=!1}={}){let a,n=A=>{a=A,r.variables["?"]=String(A)},u=async A=>{try{return await Iot(A.chain,e,r,{background:o&&typeof A.then>"u"})}catch(p){if(!(p instanceof ll))throw p;return r.stderr.write(`${p.message}
|
||||
`),1}};for(n(await u(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case"&&":a===0&&n(await u(t.then.line));break;case"||":a!==0&&n(await u(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${t.then.type}"`)}t=t.then.line}return a}async function xb(t,e,r){let o=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:u}of t){if(a=await Bot(n,e,r,{background:u==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=o,a}function gce(t){switch(t.type){case"variable":return t.name==="@"||t.name==="#"||t.name==="*"||Number.isFinite(parseInt(t.name,10))||"defaultValue"in t&&!!t.defaultValue&&t.defaultValue.some(e=>y1(e))||"alternativeValue"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>y1(e));case"arithmetic":return iU(t.arithmetic);case"shell":return sU(t.shell);default:return!1}}function y1(t){switch(t.type){case"redirection":return t.args.some(e=>y1(e));case"argument":return t.segments.some(e=>gce(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${t.type}"`)}}function iU(t){switch(t.type){case"variable":return gce(t);case"number":return!1;default:return iU(t.left)||iU(t.right)}}function sU(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let o;switch(r.type){case"subshell":o=sU(r.subshell);break;case"command":o=r.envs.some(a=>a.args.some(n=>y1(n)))||r.args.some(a=>y1(a));break}if(o)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function cy(t,e=[],{baseFs:r=new Tn,builtins:o={},cwd:a=ue.toPortablePath(process.cwd()),env:n=process.env,stdin:u=process.stdin,stdout:A=process.stdout,stderr:p=process.stderr,variables:h={},glob:E=Db}={}){let I={};for(let[C,R]of Object.entries(n))typeof R<"u"&&(I[C]=R);let v=new Map(mot);for(let[C,R]of Object.entries(o))v.set(C,R);u===null&&(u=new cl.PassThrough,u.end());let x=CD(t,E);if(!sU(x)&&x.length>0&&e.length>0){let{command:C}=x[x.length-1];for(;C.then;)C=C.then.line;let R=C.chain;for(;R.then;)R=R.then.chain;R.type==="command"&&(R.args=R.args.concat(e.map(L=>({type:"argument",segments:[{type:"text",text:L}]}))))}return await xb(x,{args:e,baseFs:r,builtins:v,initialStdin:u,initialStdout:A,initialStderr:p,glob:E},{cwd:a,environment:I,exitCode:null,procedures:{},stdin:u,stdout:A,stderr:p,variables:Object.assign({},h,{"?":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var Ace,fce,cl,pce,mot,Eot,g1=Et(()=>{Pt();Nl();Ace=Ze(pN()),fce=ve("os"),cl=ve("stream"),pce=ve("timers/promises");zle();Jle();ece();nU();nU();mot=new Map([["cd",async([t=(0,fce.homedir)(),...e],r,o)=>{let a=K.resolve(o.cwd,ue.toPortablePath(t));if(!(await r.baseFs.statPromise(a).catch(u=>{throw u.code==="ENOENT"?new ll(`cd: no such file or directory: ${t}`):u})).isDirectory())throw new ll(`cd: not a directory: ${t}`);return o.cwd=a,0}],["pwd",async(t,e,r)=>(r.stdout.write(`${ue.fromPortablePath(r.cwd)}
|
||||
`),0)],[":",async(t,e,r)=>0],["true",async(t,e,r)=>0],["false",async(t,e,r)=>1],["exit",async([t,...e],r,o)=>o.exitCode=parseInt(t??o.variables["?"],10)],["echo",async(t,e,r)=>(r.stdout.write(`${t.join(" ")}
|
||||
`),0)],["sleep",async([t],e,r)=>{if(typeof t>"u")throw new ll("sleep: missing operand");let o=Number(t);if(Number.isNaN(o))throw new ll(`sleep: invalid time interval '${t}'`);return await(0,pce.setTimeout)(1e3*o,0)}],["__ysh_run_procedure",async(t,e,r)=>{let o=r.procedures[t[0]];return await Pb(o,{stdin:new Jl(r.stdin),stdout:new Jl(r.stdout),stderr:new Jl(r.stderr)}).run()}],["__ysh_set_redirects",async(t,e,r)=>{let o=r.stdin,a=r.stdout,n=r.stderr,u=[],A=[],p=[],h=0;for(;t[h]!=="--";){let I=t[h++],{type:v,fd:x}=JSON.parse(I),C=z=>{switch(x){case null:case 0:u.push(z);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},R=z=>{switch(x){case null:case 1:A.push(z);break;case 2:p.push(z);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},L=Number(t[h++]),U=h+L;for(let z=h;z<U;++h,++z)switch(v){case"<":C(()=>e.baseFs.createReadStream(K.resolve(r.cwd,ue.toPortablePath(t[z]))));break;case"<<<":C(()=>{let te=new cl.PassThrough;return process.nextTick(()=>{te.write(`${t[z]}
|
||||
`),te.end()}),te});break;case"<&":C(()=>ace(Number(t[z]),1,r));break;case">":case">>":{let te=K.resolve(r.cwd,ue.toPortablePath(t[z]));R(te==="/dev/null"?new cl.Writable({autoDestroy:!0,emitClose:!0,write(ae,le,ce){setImmediate(ce)}}):e.baseFs.createWriteStream(te,v===">>"?{flags:"a"}:void 0))}break;case">&":R(ace(Number(t[z]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${v}"`)}}if(u.length>0){let I=new cl.PassThrough;o=I;let v=x=>{if(x===u.length)I.end();else{let C=u[x]();C.pipe(I,{end:!1}),C.on("end",()=>{v(x+1)})}};v(0)}if(A.length>0){let I=new cl.PassThrough;a=I;for(let v of A)I.pipe(v)}if(p.length>0){let I=new cl.PassThrough;n=I;for(let v of p)I.pipe(v)}let E=await Pb(m1(t.slice(h+1),e,r),{stdin:new Jl(o),stdout:new Jl(a),stderr:new Jl(n)}).run();return await Promise.all(A.map(I=>new Promise((v,x)=>{I.on("error",C=>{x(C)}),I.on("close",()=>{v()}),I.end()}))),await Promise.all(p.map(I=>new Promise((v,x)=>{I.on("error",C=>{x(C)}),I.on("close",()=>{v()}),I.end()}))),E}]]);Eot={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)}});var kb=_((l4t,dce)=>{function vot(t,e){for(var r=-1,o=t==null?0:t.length,a=Array(o);++r<o;)a[r]=e(t[r],r,t);return a}dce.exports=vot});var Ice=_((c4t,wce)=>{var mce=lg(),Dot=kb(),Pot=Hl(),Sot=Ym(),bot=1/0,yce=mce?mce.prototype:void 0,Ece=yce?yce.toString:void 0;function Cce(t){if(typeof t=="string")return t;if(Pot(t))return Dot(t,Cce)+"";if(Sot(t))return Ece?Ece.call(t):"";var e=t+"";return e=="0"&&1/t==-bot?"-0":e}wce.exports=Cce});var C1=_((u4t,Bce)=>{var xot=Ice();function kot(t){return t==null?"":xot(t)}Bce.exports=kot});var oU=_((A4t,vce)=>{function Qot(t,e,r){var o=-1,a=t.length;e<0&&(e=-e>a?0:a+e),r=r>a?a:r,r<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var n=Array(a);++o<a;)n[o]=t[o+e];return n}vce.exports=Qot});var Pce=_((f4t,Dce)=>{var Fot=oU();function Rot(t,e,r){var o=t.length;return r=r===void 0?o:r,!e&&r>=o?t:Fot(t,e,r)}Dce.exports=Rot});var aU=_((p4t,Sce)=>{var Tot="\\ud800-\\udfff",Not="\\u0300-\\u036f",Lot="\\ufe20-\\ufe2f",Mot="\\u20d0-\\u20ff",Oot=Not+Lot+Mot,Uot="\\ufe0e\\ufe0f",_ot="\\u200d",Hot=RegExp("["+_ot+Tot+Oot+Uot+"]");function qot(t){return Hot.test(t)}Sce.exports=qot});var xce=_((h4t,bce)=>{function jot(t){return t.split("")}bce.exports=jot});var Mce=_((g4t,Lce)=>{var kce="\\ud800-\\udfff",Got="\\u0300-\\u036f",Yot="\\ufe20-\\ufe2f",Wot="\\u20d0-\\u20ff",Kot=Got+Yot+Wot,Vot="\\ufe0e\\ufe0f",zot="["+kce+"]",lU="["+Kot+"]",cU="\\ud83c[\\udffb-\\udfff]",Jot="(?:"+lU+"|"+cU+")",Qce="[^"+kce+"]",Fce="(?:\\ud83c[\\udde6-\\uddff]){2}",Rce="[\\ud800-\\udbff][\\udc00-\\udfff]",Xot="\\u200d",Tce=Jot+"?",Nce="["+Vot+"]?",Zot="(?:"+Xot+"(?:"+[Qce,Fce,Rce].join("|")+")"+Nce+Tce+")*",$ot=Nce+Tce+Zot,eat="(?:"+[Qce+lU+"?",lU,Fce,Rce,zot].join("|")+")",tat=RegExp(cU+"(?="+cU+")|"+eat+$ot,"g");function rat(t){return t.match(tat)||[]}Lce.exports=rat});var Uce=_((d4t,Oce)=>{var nat=xce(),iat=aU(),sat=Mce();function oat(t){return iat(t)?sat(t):nat(t)}Oce.exports=oat});var Hce=_((m4t,_ce)=>{var aat=Pce(),lat=aU(),cat=Uce(),uat=C1();function Aat(t){return function(e){e=uat(e);var r=lat(e)?cat(e):void 0,o=r?r[0]:e.charAt(0),a=r?aat(r,1).join(""):e.slice(1);return o[t]()+a}}_ce.exports=Aat});var jce=_((y4t,qce)=>{var fat=Hce(),pat=fat("toUpperCase");qce.exports=pat});var uU=_((E4t,Gce)=>{var hat=C1(),gat=jce();function dat(t){return gat(hat(t).toLowerCase())}Gce.exports=dat});var Yce=_((C4t,Qb)=>{function mat(){var t=0,e=1,r=2,o=3,a=4,n=5,u=6,A=7,p=8,h=9,E=10,I=11,v=12,x=13,C=14,R=15,L=16,U=17,z=0,te=1,ae=2,le=3,ce=4;function Ce(g,me){return 55296<=g.charCodeAt(me)&&g.charCodeAt(me)<=56319&&56320<=g.charCodeAt(me+1)&&g.charCodeAt(me+1)<=57343}function de(g,me){me===void 0&&(me=0);var we=g.charCodeAt(me);if(55296<=we&&we<=56319&&me<g.length-1){var Ae=we,ne=g.charCodeAt(me+1);return 56320<=ne&&ne<=57343?(Ae-55296)*1024+(ne-56320)+65536:Ae}if(56320<=we&&we<=57343&&me>=1){var Ae=g.charCodeAt(me-1),ne=we;return 55296<=Ae&&Ae<=56319?(Ae-55296)*1024+(ne-56320)+65536:ne}return we}function Be(g,me,we){var Ae=[g].concat(me).concat([we]),ne=Ae[Ae.length-2],Z=we,xe=Ae.lastIndexOf(C);if(xe>1&&Ae.slice(1,xe).every(function(H){return H==o})&&[o,x,U].indexOf(g)==-1)return ae;var Ne=Ae.lastIndexOf(a);if(Ne>0&&Ae.slice(1,Ne).every(function(H){return H==a})&&[v,a].indexOf(ne)==-1)return Ae.filter(function(H){return H==a}).length%2==1?le:ce;if(ne==t&&Z==e)return z;if(ne==r||ne==t||ne==e)return Z==C&&me.every(function(H){return H==o})?ae:te;if(Z==r||Z==t||Z==e)return te;if(ne==u&&(Z==u||Z==A||Z==h||Z==E))return z;if((ne==h||ne==A)&&(Z==A||Z==p))return z;if((ne==E||ne==p)&&Z==p)return z;if(Z==o||Z==R)return z;if(Z==n)return z;if(ne==v)return z;var ht=Ae.indexOf(o)!=-1?Ae.lastIndexOf(o)-1:Ae.length-2;return[x,U].indexOf(Ae[ht])!=-1&&Ae.slice(ht+1,-1).every(function(H){return H==o})&&Z==C||ne==R&&[L,U].indexOf(Z)!=-1?z:me.indexOf(a)!=-1?ae:ne==a&&Z==a?z:te}this.nextBreak=function(g,me){if(me===void 0&&(me=0),me<0
Line truncated
|
||||
`,end:t=>`::endgroup::
|
||||
`}:Rb.default.TRAVIS?{start:t=>`travis_fold:start:${t}
|
||||
`,end:t=>`travis_fold:end:${t}
|
||||
`}:Rb.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r\x1B[0K${t}
|
||||
`,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,Zce=ch!==null,Jce=new Date,wat=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,Iat=t=>t,Tb=Iat({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),Bat=wat&&Object.keys(Tb).find(t=>{let e=Tb[t];return!(e.date&&(e.date[0]!==Jce.getDate()||e.date[1]!==Jce.getMonth()+1))})||"default";Rt=class extends Zs{constructor({configuration:r,stdout:o,json:a=!1,forceSectionAlignment:n=!1,includeNames:u=!0,includePrefix:A=!0,includeFooter:p=!0,includeLogs:h=!a,includeInfos:E=h,includeWarnings:I=h}){super();this.uncommitted=new Set;this.warningCount=0;this.errorCount=0;this.timerFooter=[];this.startTime=Date.now();this.indent=0;this.level=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;if(TI(this,{configuration:r}),this.configuration=r,this.forceSectionAlignment=n,this.includeNames=u,this.includePrefix=A,this.includeFooter=p,this.includeInfos=E,this.includeWarnings=I,this.json=a,this.stdout=o,r.get("enableProgressBars")&&!a&&o.isTTY&&o.columns>22){let v=r.get("progressBarStyle")||Bat;if(!Object.hasOwn(Tb,v))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=Tb[v];let x=Math.min(this.getRecommendedLength(),80);this.progressMaxScaledSize=Math.floor(this.progressStyle.size*x/80)}}static async start(r,o){let a=new this(r),n=process.emitWarning;process.emitWarning=(u,A)=>{if(typeof u!="string"){let h=u;u=h.message,A=A??h.name}let p=typeof A<"u"?`${A}: ${u}`:u;a.reportWarning(0,p)},r.includeVersion&&a.reportInfo(0,fg(r.configuration,`Yarn ${nn}`,2));try{await o(a)}catch(u){a.reportExceptionOnce(u)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}getRecommendedLength(){let o=this.progressStyle!==null?this.stdout.columns-1:super.getRecommendedLength();return Math.max(40,o-12-this.indent*2)}startSectionSync({reportHeader:r,reportFooter:o,skipIfEmpty:a},n){let u={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(u):(u.action(),u.committed=!0);let A=Date.now();try{return n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(u),u.committed&&o?.(p-A)}}async startSectionPromise({reportHeader:r,reportFooter:o,skipIfEmpty:a},n){let u={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(u):(u.action(),u.committed=!0);let A=Date.now();try{return await n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(u),u.committed&&o?.(p-A)}}startTimerImpl(r,o,a){return{cb:typeof o=="function"?o:a,reportHeader:()=>{this.level+=1,this.reportInfo(null,`\u250C ${r}`),this.indent+=1,ch!==null&&!this.json&&this.includeInfos&&this.stdout.write(ch.start(r))},reportFooter:A=>{if(this.indent-=1,ch!==null&&!this.json&&this.includeInfos){this.stdout.write(ch.end(r));for(let p of this.timerFooter)p()}this.configuration.get("enableTimers")&&A>200?this.reportInfo(null,`\u2514 Completed in ${Ot(this.configuration,A,yt.DURATION)}`):this.reportInfo(null,"\u2514 Completed"),this.level-=1},skipIfEmpty:(typeof o=="function"?{}:o).skipIfEmpty}}startTimerSync(r,o,a){let{cb:n,...u}=this.startTimerImpl(r,o,a);return this.startSectionSync(u,n)}async startTimerPromise(r,o,a){let{cb:n,...u}=this.startTimerImpl(r,o,a);return this.startSectionPromise(u,n)}reportSeparator(){this.indent===0?this.writeLine(""):this.reportInfo(null,"")}reportInfo(r,o){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"",u=`${this.formatPrefix(n,"blueBright")}${o}`;this.json?this.reportJson({type:"info",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:o}):this.writeLine(u)}reportWarning(r,o){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"warning",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:o}):this.writeLine(`${this.formatPrefix(n,"yellowBright")}${o}`)}reportError(r,o){this.errorCount+=1,this.timerFooter.push(()=>this.reportErrorImpl(r,o)),this.reportErrorImpl(r,o)}reportErrorImpl(r,o){this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"error",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:o}):this.writeLine(`${this.formatPrefix(n,"redBright")}${o}`,{truncate:!1})}reportFold(r,o){if(!ch)return;let a=`${ch.start(r)}${o}${ch.end(r)}`;this.timerFooter.push(()=>this.stdout.write(a))}reportProgress(r){if(this.progressStyle===null)ret
Line truncated
|
||||
`),this.writeProgress()}writeLines(r,{truncate:o}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:o})}
|
||||
`);this.writeProgress()}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let o of r)o.committed=!0,o.action()}clearProgress({delta:r=0,clear:o=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\x1B[${this.progress.size+r}A`),(r>0||o)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>zce&&(this.progressFrame=(this.progressFrame+1)%Vce.length,this.progressTime=r);let o=Vce[this.progressFrame];for(let a of this.progress.values()){let n="";if(typeof a.lastScaledSize<"u"){let h=this.progressStyle.chars[0].repeat(a.lastScaledSize),E=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${h}${E}`}let u=this.formatName(null),A=u?`${u}: `:"",p=a.definition.title?` ${a.definition.title}`:"";this.stdout.write(`${Ot(this.configuration,"\u27A4","blueBright")} ${A}${o}${n}${p}
|
||||
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},zce)}refreshProgress({delta:r=0,force:o=!1}={}){let a=!1,n=!1;if(o||this.progress.size===0)a=!0;else for(let u of this.progress.values()){let A=typeof u.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*u.definition.progress):void 0,p=u.lastScaledSize;u.lastScaledSize=A;let h=u.lastTitle;if(u.lastTitle=u.definition.title,A!==p||(n=h!==u.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:o}={}){return this.progressStyle===null&&(o=!1),typeof o>"u"&&(o=this.configuration.get("preferTruncatedLines")),o&&(r=(0,Xce.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?$ce(r,{configuration:this.configuration,json:this.json}):""}formatPrefix(r,o){return this.includePrefix?`${Ot(this.configuration,"\u27A4",o)} ${r}${this.formatIndent()}`:""}formatNameWithHyperlink(r){return this.includeNames?AU(r,{configuration:this.configuration,json:this.json}):""}formatIndent(){return this.level>0||!this.forceSectionAlignment?"\u2502 ".repeat(this.indent):`${Cat} `}}});var An={};Vt(An,{PackageManager:()=>rue,detectPackageManager:()=>nue,executePackageAccessibleBinary:()=>lue,executePackageScript:()=>Nb,executePackageShellcode:()=>fU,executeWorkspaceAccessibleBinary:()=>kat,executeWorkspaceLifecycleScript:()=>oue,executeWorkspaceScript:()=>sue,getPackageAccessibleBinaries:()=>Lb,getWorkspaceAccessibleBinaries:()=>aue,hasPackageScript:()=>Sat,hasWorkspaceScript:()=>pU,isNodeScript:()=>hU,makeScriptEnv:()=>B1,maybeExecuteWorkspaceLifecycleScript:()=>xat,prepareExternalProject:()=>Pat});async function uh(t,e,r,o=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${o.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await oe.writeFilePromise(K.format({dir:t,name:e,ext:".cmd"}),a)}await oe.writeFilePromise(K.join(t,e),`#!/bin/sh
|
||||
exec "${r}" ${o.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
|
||||
`,{mode:493})}async function nue(t){let e=await Ut.tryFind(t);if(e?.packageManager){let o=DS(e.packageManager);if(o?.name){let a=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[n]=o.reference.split(".");switch(o.name){case"yarn":return{packageManagerField:!0,packageManager:Number(n)===1?"Yarn Classic":"Yarn",reason:a};case"npm":return{packageManagerField:!0,packageManager:"npm",reason:a};case"pnpm":return{packageManagerField:!0,packageManager:"pnpm",reason:a}}}}let r;try{r=await oe.readFilePromise(K.join(t,dr.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:oe.existsSync(K.join(t,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:oe.existsSync(K.join(t,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function B1({project:t,locator:e,binFolder:r,ignoreCorepack:o,lifecycleScript:a,baseEnv:n=t?.configuration.env??process.env}){let u={};for(let[E,I]of Object.entries(n))typeof I<"u"&&(u[E.toLowerCase()!=="path"?E:"PATH"]=I);let A=ue.fromPortablePath(r);u.BERRY_BIN_FOLDER=ue.fromPortablePath(A);let p=process.env.COREPACK_ROOT&&!o?ue.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([uh(r,"node",process.execPath),...nn!==null?[uh(r,"run",process.execPath,[p,"run"]),uh(r,"yarn",process.execPath,[p]),uh(r,"yarnpkg",process.execPath,[p]),uh(r,"node-gyp",process.execPath,[p,"run","--top-level","node-gyp"])]:[]]),t&&(u.INIT_CWD=ue.fromPortablePath(t.configuration.startingCwd),u.PROJECT_CWD=ue.fromPortablePath(t.cwd)),u.PATH=u.PATH?`${A}${ue.delimiter}${u.PATH}`:`${A}`,u.npm_execpath=`${A}${ue.sep}yarn`,u.npm_node_execpath=`${A}${ue.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let E=t.tryWorkspaceByLocator(e),I=E?E.manifest.version??"":t.storedPackages.get(e.locatorHash).version??"";u.npm_package_name=rn(e),u.npm_package_version=I;let v;if(E)v=E.cwd;else{let x=t.storedPackages.get(e.locatorHash);if(!x)throw new Error(`Package for ${qr(t.configuration,e)} not found in the project`);let C=t.configuration.getLinkers(),R={project:t,report:new Rt({stdout:new Ah.PassThrough,configuration:t.configuration})},L=C.find(U=>U.supportsPackage(x,R));if(!L)throw new Error(`The package ${qr(t.configuration,x)} isn't supported by any of the available linkers`);v=await L.findPackageLocation(x,R)}u.npm_package_json=ue.fromPortablePath(K.join(v,dr.manifest))}let h=nn!==null?`yarn/${nn}`:`yarn/${vf("@yarnpkg/core").version}-core`;return u.npm_config_user_agent=`${h} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(u.npm_lifecycle_event=a),t&&await t.configuration.triggerHook(E=>E.setupScriptEnvironment,t,u,async(E,I,v)=>await uh(r,E,I,v)),u}async function Pat(t,e,{configuration:r,report:o,workspace:a=null,locator:n=null}){await Dat(async()=>{await oe.mktempPromise(async u=>{let A=K.join(u,"pack.log"),p=null,{stdout:h,stderr:E}=r.getSubprocessStreams(A,{prefix:ue.fromPortablePath(t),report:o}),I=n&&Gc(n)?_I(n):n,v=I?ka(I):"an external project";h.write(`Packing ${v} from sources
|
||||
`);let x=await nue(t),C;x!==null?(h.write(`Using ${x.packageManager} for bootstrap. Reason: ${x.reason}
|
||||
|
||||
`),C=x.packageManager):(h.write(`No package manager configuration detected; defaulting to Yarn
|
||||
|
||||
`),C="Yarn");let R=C==="Yarn"&&!x?.packageManagerField;await oe.mktempPromise(async L=>{let U=await B1({binFolder:L,ignoreCorepack:R}),te=new Map([["Yarn Classic",async()=>{let le=a!==null?["workspace",a]:[],ce=K.join(t,dr.manifest),Ce=await oe.readFilePromise(ce),de=await Wc(process.execPath,[process.argv[1],"set","version","classic","--only-if-needed","--yarn-path"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(de.code!==0)return de.code;await oe.writeFilePromise(ce,Ce),await oe.appendFilePromise(K.join(t,".npmignore"),`/.yarn
|
||||
`),h.write(`
|
||||
`),delete U.NODE_ENV;let Be=await Wc("yarn",["install"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(Be.code!==0)return Be.code;h.write(`
|
||||
`);let Ee=await Wc("yarn",[...le,"pack","--filename",ue.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return Ee.code!==0?Ee.code:0}],["Yarn",async()=>{let le=a!==null?["workspace",a]:[];U.YARN_ENABLE_INLINE_BUILDS="1";let ce=K.join(t,dr.lockfile);await oe.existsPromise(ce)||await oe.writeFilePromise(ce,"");let Ce=await Wc("yarn",[...le,"pack","--install-if-needed","--filename",ue.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return Ce.code!==0?Ce.code:0}],["npm",async()=>{if(a!==null){let me=new Ah.PassThrough,we=km(me);me.pipe(h,{end:!1});let Ae=await Wc("npm",["--version"],{cwd:t,env:U,stdin:p,stdout:me,stderr:E,end:0});if(me.end(),Ae.code!==0)return h.end(),E.end(),Ae.code;let ne=(await we).toString().trim();if(!tA(ne,">=7.x")){let Z=eA(null,"npm"),xe=In(Z,ne),Ne=In(Z,">=7.x");throw new Error(`Workspaces aren't supported by ${jn(r,xe)}; please upgrade to ${jn(r,Ne)} (npm has been detected as the primary package manager for ${Ot(r,t,yt.PATH)})`)}}let le=a!==null?["--workspace",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let ce=await Wc("npm",["install","--legacy-peer-deps"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(ce.code!==0)return ce.code;let Ce=new Ah.PassThrough,de=km(Ce);Ce.pipe(h);let Be=await Wc("npm",["pack","--silent",...le],{cwd:t,env:U,stdin:p,stdout:Ce,stderr:E});if(Be.code!==0)return Be.code;let Ee=(await de).toString().trim().replace(/^.*\n/s,""),g=K.resolve(t,ue.toPortablePath(Ee));return await oe.renamePromise(g,e),0}]]).get(C);if(typeof te>"u")throw new Error("Assertion failed: Unsupported workflow");let ae=await te();if(!(ae===0||typeof ae>"u"))throw oe.detachTemp(u),new Jt(58,`Packing the package failed (exit code ${ae}, logs can be found here: ${Ot(r,A,yt.PATH)})`)})})})}async function Sat(t,e,{project:r}){let o=r.tryWorkspaceByLocator(t);if(o!==null)return pU(o,e);let a=r.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${qr(r.configuration,t)} not found in the project`);return await rA.openPromise(async n=>{let u=r.configuration,A=r.configuration.getLinkers(),p={project:r,report:new Rt({stdout:new Ah.PassThrough,configuration:u})},h=A.find(x=>x.supportsPackage(a,p));if(!h)throw new Error(`The package ${qr(r.configuration,a)} isn't supported by any of the available linkers`);let E=await h.findPackageLocation(a,p),I=new gn(E,{baseFs:n});return(await Ut.find(It.dot,{baseFs:I})).scripts.has(e)})}async function Nb(t,e,r,{cwd:o,project:a,stdin:n,stdout:u,stderr:A}){return await oe.mktempPromise(async p=>{let{manifest:h,env:E,cwd:I}=await iue(t,{project:a,binFolder:p,cwd:o,lifecycleScript:e}),v=h.scripts.get(e);if(typeof v>"u")return 1;let x=async()=>await cy(v,r,{cwd:I,env:E,stdin:n,stdout:u,stderr:A});return await(await a.configuration.reduceHook(R=>R.wrapScriptExecution,x,a,t,e,{script:v,args:r,cwd:I,env:E,stdin:n,stdout:u,stderr:A}))()})}async function fU(t,e,r,{cwd:o,project:a,stdin:n,stdout:u,stderr:A}){return await oe.mktempPromise(async p=>{let{env:h,cwd:E}=await iue(t,{project:a,binFolder:p,cwd:o});return await cy(e,r,{cwd:E,env:h,stdin:n,stdout:u,stderr:A})})}async function bat(t,{binFolder:e,cwd:r,lifecycleScript:o}){let a=await B1({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:o});return await gU(e,await aue(t)),typeof r>"u"&&(r=K.dirname(await oe.realpathPromise(K.join(t.cwd,"package.json")))),{manifest:t.manifest,binFolder:e,env:a,cwd:r}}async function iue(t,{project:e,binFolder:r,cwd:o,lifecycleScript:a}){let n=e.tryWorkspaceByLocator(t);if(n!==null)return bat(n,{binFolder:r,cwd:o,lifecycleScript:a});let u=e.storedPackages.get(t.locatorHash);if(!u)throw new Error(`Package for ${qr(e.configuration,t)} not found in the project`);return await rA.openPromise(async A=>{let p=e.configuration,h=e.configuration.getLinkers(),E={project:e,report:new Rt({stdout:new Ah.PassThrough,configuration:p})},I=h.find(L=>L.supportsPackage(u,E));if(!I)throw new Error(`The package ${qr(e.configuration,u)} isn't supported by any of the available linkers`);let v=await B1({project:e,locator:t,binFolder:r,lifecycleScript:a});await gU(r,await Lb(t,{project:e}));let x=await I.findPackageLocation(u,E),C=new gn(x,{baseFs:A}),R=await Ut.find(It.dot,{baseFs:C});return typeof o>"u"&&(o=x),{manifest:R,binFolder:r,env:v,cwd:o}})}async function sue(t,e,r,{cwd:o,stdin:a,stdout:n,stderr:u}){return await Nb(t.anchoredLocator,e,r,{cwd:o,project:t.project,stdin:a,stdout:n,stderr:u})}function pU(t,e){return t.manifest.scripts.has(e)}async function oue(t,e,{cwd:r,report:o}){let{configuration:a}=t.project,n=null;await oe.mktempPromise(async u=>{let A=K.join(u,`${e}.log`),p=`# This file contains the result of Yarn calling the "${e}" lifecycle script inside a workspace ("${ue.fromPortablePath(t.cwd)}")
|
||||
`,{stdout:h,stderr:E}=a.getSubprocessStreams(A,{report:o,prefix:qr(a,t.anchoredLocator),header:p});o.reportInfo(36,`Calling the "${e}" lifecycle script`);let I=await sue(t,e,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),I!==0)throw oe.detachTemp(u),new Jt(36,`${(0,eue.default)(e)} script failed (exit code ${Ot(a,I,yt.NUMBER)}, logs can be found here: ${Ot(a,A,yt.PATH)}); run ${Ot(a,`yarn ${e}`,yt.CODE)} to investigate`)})}async function xat(t,e,r){pU(t,e)&&await oue(t,e,r)}function hU(t){let e=K.extname(t);if(e.match(/\.[cm]?[jt]sx?$/))return!0;if(e===".exe"||e===".bin")return!1;let r=Buffer.alloc(4),o;try{o=oe.openSync(t,"r")}catch{return!0}try{oe.readSync(o,r,0,r.length,0)}finally{oe.closeSync(o)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function Lb(t,{project:e}){let r=e.configuration,o=new Map,a=e.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${qr(r,t)} not found in the project`);let n=new Ah.Writable,u=r.getLinkers(),A={project:e,report:new Rt({configuration:r,stdout:n})},p=new Set([t.locatorHash]);for(let E of a.dependencies.values()){let I=e.storedResolutions.get(E.descriptorHash);if(!I)throw new Error(`Assertion failed: The resolution (${jn(r,E)}) should have been registered`);p.add(I)}let h=await Promise.all(Array.from(p,async E=>{let I=e.storedPackages.get(E);if(!I)throw new Error(`Assertion failed: The package (${E}) should have been registered`);if(I.bin.size===0)return ol.skip;let v=u.find(C=>C.supportsPackage(I,A));if(!v)return ol.skip;let x=null;try{x=await v.findPackageLocation(I,A)}catch(C){if(C.code==="LOCATOR_NOT_INSTALLED")return ol.skip;throw C}return{dependency:I,packageLocation:x}}));for(let E of h){if(E===ol.skip)continue;let{dependency:I,packageLocation:v}=E;for(let[x,C]of I.bin){let R=K.resolve(v,C);o.set(x,[I,ue.fromPortablePath(R),hU(R)])}}return o}async function aue(t){return await Lb(t.anchoredLocator,{project:t.project})}async function gU(t,e){await Promise.all(Array.from(e,([r,[,o,a]])=>a?uh(t,r,process.execPath,[o]):uh(t,r,o,[])))}async function lue(t,e,r,{cwd:o,project:a,stdin:n,stdout:u,stderr:A,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await Lb(t,{project:a});let E=h.get(e);if(!E)throw new Error(`Binary not found (${e}) for ${qr(a.configuration,t)}`);return await oe.mktempPromise(async I=>{let[,v]=E,x=await B1({project:a,locator:t,binFolder:I});await gU(x.BERRY_BIN_FOLDER,h);let C=hU(ue.toPortablePath(v))?Wc(process.execPath,[...p,v,...r],{cwd:o,env:x,stdin:n,stdout:u,stderr:A}):Wc(v,r,{cwd:o,env:x,stdin:n,stdout:u,stderr:A}),R;try{R=await C}finally{await oe.removePromise(x.BERRY_BIN_FOLDER)}return R.code})}async function kat(t,e,r,{cwd:o,stdin:a,stdout:n,stderr:u,packageAccessibleBinaries:A}){return await lue(t.anchoredLocator,e,r,{project:t.project,cwd:o,stdin:a,stdout:n,stderr:u,packageAccessibleBinaries:A})}var eue,tue,Ah,rue,vat,Dat,dU=Et(()=>{Pt();Pt();nA();g1();eue=Ze(uU()),tue=Ze(eg()),Ah=ve("stream");Gm();Wl();I1();w1();hb();jl();ql();bf();bo();rue=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(rue||{});vat=2,Dat=(0,tue.default)(vat)});var Ay=_((q4t,uue)=>{"use strict";var cue=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);uue.exports=t=>t?Object.keys(t).map(e=>[cue.has(e)?cue.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var py=_((j4t,Eue)=>{"use strict";var Aue=typeof process=="object"&&process?process:{stdout:null,stderr:null},Qat=ve("events"),fue=ve("stream"),pue=ve("string_decoder").StringDecoder,Nf=Symbol("EOF"),Lf=Symbol("maybeEmitEnd"),fh=Symbol("emittedEnd"),Mb=Symbol("emittingEnd"),v1=Symbol("emittedError"),Ob=Symbol("closed"),hue=Symbol("read"),Ub=Symbol("flush"),gue=Symbol("flushChunk"),Fa=Symbol("encoding"),Mf=Symbol("decoder"),_b=Symbol("flowing"),D1=Symbol("paused"),fy=Symbol("resume"),Ts=Symbol("bufferLength"),mU=Symbol("bufferPush"),yU=Symbol("bufferShift"),Fo=Symbol("objectMode"),Ro=Symbol("destroyed"),EU=Symbol("emitData"),due=Symbol("emitEnd"),CU=Symbol("emitEnd2"),Of=Symbol("async"),P1=t=>Promise.resolve().then(t),mue=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Fat=mue&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Rat=mue&&Symbol.iterator||Symbol("iterator not implemented"),Tat=t=>t==="end"||t==="finish"||t==="prefinish",Nat=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,Lat=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Hb=class{constructor(e,r,o){this.src=e,this.dest=r,this.opts=o,this.ondrain=()=>e[fy](),r.on("drain",this.ondrain)}unpipe(){this.dest.remove
Line truncated
|
||||
`,a=Buffer.byteLength(o),n=Math.floor(Math.log(a)/Math.log(10))+1;return a+n>=Math.pow(10,n)&&(n+=1),n+a+o}};b1.parse=(t,e,r)=>new b1(slt(olt(t),e),r);var slt=(t,e)=>e?Object.keys(t).reduce((r,o)=>(r[o]=t[o],r),e):t,olt=t=>t.replace(/\n$/,"").split(`
|
||||
`).reduce(alt,Object.create(null)),alt=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+" ").length);let o=e.split("="),a=o.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!a)return t;let n=o.join("=");return t[a]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(a)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,t};Rue.exports=b1});var Ey=_((tUt,Tue)=>{Tue.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)==="/";)r=e,e--;return r===-1?t:t.slice(0,r)}});var Vb=_((rUt,Nue)=>{"use strict";Nue.exports=t=>class extends t{warn(e,r,o={}){this.file&&(o.file=this.file),this.cwd&&(o.cwd=this.cwd),o.code=r instanceof Error&&r.code||e,o.tarCode=e,!this.strict&&o.recoverable!==!1?(r instanceof Error&&(o=Object.assign(r,o),r=r.message),this.emit("warn",o.tarCode,r,o)):r instanceof Error?this.emit("error",Object.assign(r,o)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),o))}}});var KU=_((iUt,Lue)=>{"use strict";var zb=["|","<",">","?",":"],WU=zb.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),llt=new Map(zb.map((t,e)=>[t,WU[e]])),clt=new Map(WU.map((t,e)=>[t,zb[e]]));Lue.exports={encode:t=>zb.reduce((e,r)=>e.split(r).join(llt.get(r)),t),decode:t=>WU.reduce((e,r)=>e.split(r).join(clt.get(r)),t)}});var VU=_((sUt,Oue)=>{var{isAbsolute:ult,parse:Mue}=ve("path").win32;Oue.exports=t=>{let e="",r=Mue(t);for(;ult(t)||r.root;){let o=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":r.root;t=t.substr(o.length),e+=o,r=Mue(t)}return[e,t]}});var _ue=_((oUt,Uue)=>{"use strict";Uue.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var i3=_((cUt,eAe)=>{"use strict";var Kue=py(),Vue=Kb(),zue=yy(),oA=ve("fs"),Hue=ve("path"),sA=dy(),Alt=Ey(),Jue=(t,e)=>e?(t=sA(t).replace(/^\.(\/|$)/,""),Alt(e)+"/"+t):sA(t),flt=16*1024*1024,que=Symbol("process"),jue=Symbol("file"),Gue=Symbol("directory"),JU=Symbol("symlink"),Yue=Symbol("hardlink"),x1=Symbol("header"),Jb=Symbol("read"),XU=Symbol("lstat"),Xb=Symbol("onlstat"),ZU=Symbol("onread"),$U=Symbol("onreadlink"),e3=Symbol("openfile"),t3=Symbol("onopenfile"),dh=Symbol("close"),Zb=Symbol("mode"),r3=Symbol("awaitDrain"),zU=Symbol("ondrain"),aA=Symbol("prefix"),Wue=Symbol("hadError"),Xue=Vb(),plt=KU(),Zue=VU(),$ue=_ue(),$b=Xue(class extends Kue{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=sA(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||flt,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=sA(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?sA(r.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let o=!1;if(!this.preservePaths){let[a,n]=Zue(this.path);a&&(this.path=n,o=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=plt.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=sA(r.absolute||Hue.resolve(this.cwd,e)),this.path===""&&(this.path="./"),o&&this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:this,path:o+this.path}),this.statCache.has(this.absolute)?this[Xb](this.statCache.get(this.absolute)):this[XU]()}emit(e,...r){return e==="error"&&(this[Wue]=!0),super.emit(e,...r)}[XU](){oA.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Xb](r)})}[Xb](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=glt(e),this.emit("stat",e),this[que]()}[que](){switch(this.type){case"File":return this[jue]();case"Directory":return this[Gue]();case"SymbolicLink":return this[JU]();default:return this.end()}}[Zb](e){return $ue(e,this.type==="Directory",this.portable)}[aA](e){return Jue(e,this.prefix)}[x1](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new zue({path:this[aA](this.path),linkpath:this.type==="Link"?this[aA](this.linkpath):this.linkpath,mode:this[Zb](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Vue({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[aA](this.path),linkpath:this.type==="Link"?this[aA](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.
Line truncated
|
||||
`}),A},o})});var fs={};Vt(fs,{emitList:()=>aut,emitTree:()=>lpe,treeNodeToJson:()=>ape,treeNodeToTreeify:()=>ope});function ope(t,{configuration:e}){let r={},o=0,a=(n,u)=>{let A=Array.isArray(n)?n.entries():Object.entries(n);for(let[p,h]of A){if(!h)continue;let{label:E,value:I,children:v}=h,x=[];typeof E<"u"&&x.push(fg(e,E,2)),typeof I<"u"&&x.push(Ot(e,I[0],I[1])),x.length===0&&x.push(fg(e,`${p}`,2));let C=x.join(": ").trim(),R=`\0${o++}\0`,L=u[`${R}${C}`]={};typeof v<"u"&&a(v,L)}};if(typeof t.children>"u")throw new Error("The root node must only contain children");return a(t.children,r),r}function ape(t){let e=r=>{if(typeof r.children>"u"){if(typeof r.value>"u")throw new Error("Assertion failed: Expected a value to be set if the children are missing");return pg(r.value[0],r.value[1])}let o=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,u]of o)u&&(a[lut(n)]=e(u));return typeof r.value>"u"?a:{value:pg(r.value[0],r.value[1]),children:a}};return e(t)}function aut(t,{configuration:e,stdout:r,json:o}){let a=t.map(n=>({value:n}));lpe({children:a},{configuration:e,stdout:r,json:o})}function lpe(t,{configuration:e,stdout:r,json:o,separators:a=0}){if(o){let u=Array.isArray(t.children)?t.children.values():Object.values(t.children??{});for(let A of u)A&&r.write(`${JSON.stringify(ape(A))}
|
||||
`);return}let n=(0,spe.asTree)(ope(t,{configuration:e}),!1,!1);if(n=n.replace(/\0[0-9]+\0/g,""),a>=1&&(n=n.replace(/^([├└]─)/gm,`\u2502
|
||||
$1`).replace(/^│\n/,"")),a>=2)for(let u=0;u<2;++u)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
|
||||
$2`).replace(/^│\n/,"");if(a>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(n)}function lut(t){return typeof t=="string"?t.replace(/^\0[0-9]+\0/,""):t}var spe,cpe=Et(()=>{spe=Ze(ipe());jl()});function j1(t){let e=t.match(cut);if(!e?.groups)throw new Error("Assertion failed: Expected the checksum to match the requested pattern");let r=e.groups.cacheVersion?parseInt(e.groups.cacheVersion):null;return{cacheKey:e.groups.cacheKey??null,cacheVersion:r,cacheSpec:e.groups.cacheSpec??null,hash:e.groups.hash}}var upe,t_,r_,Lx,Gr,cut,n_=Et(()=>{Ge();Pt();Pt();nA();upe=ve("crypto"),t_=Ze(ve("fs"));Wl();th();ql();bo();r_=Qm(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),Lx=Qm(process.env.YARN_CACHE_VERSION_OVERRIDE??10),Gr=class t{constructor(e,{configuration:r,immutable:o=r.get("enableImmutableCache"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,upe.randomBytes)(8).toString("hex")}.tmp`;this.configuration=r,this.cwd=e,this.immutable=o,this.check=a;let{cacheSpec:n,cacheKey:u}=t.getCacheKey(r);this.cacheSpec=n,this.cacheKey=u}static async find(e,{immutable:r,check:o}={}){let a=new t(e.get("cacheFolder"),{configuration:e,immutable:r,check:o});return await a.setup(),a}static getCacheKey(e){let r=e.get("compressionLevel"),o=r!=="mixed"?`c${r}`:"";return{cacheKey:[Lx,o].join(""),cacheSpec:o}}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let e=`${this.configuration.get("globalFolder")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${Hm(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let a=j1(r).hash.slice(0,10);return`${Hm(e)}-${a}.zip`}isChecksumCompatible(e){if(e===null)return!1;let{cacheVersion:r,cacheSpec:o}=j1(e);if(r===null||r<r_)return!1;let a=this.configuration.get("cacheMigrationMode");return!(r<Lx&&a==="always"||o!==this.cacheSpec&&a!=="required-only")}getLocatorPath(e,r){return this.mirrorCwd===null?K.resolve(this.cwd,this.getVersionFilename(e)):r===null?K.resolve(this.cwd,this.getVersionFilename(e)):K.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?K.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await oe.existsPromise(this.cwd))throw new Jt(56,"Cache path does not exist.")}else{await oe.mkdirPromise(this.cwd,{recursive:!0});let e=K.resolve(this.cwd,".gitignore");await oe.changeFilePromise(e,`/.gitignore
|
||||
*.flock
|
||||
*.tmp
|
||||
`)}(this.mirrorCwd||!this.immutable)&&await oe.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,{onHit:o,onMiss:a,loader:n,...u}){let A=this.getLocatorMirrorPath(e),p=new Tn,h=()=>{let de=new Zi,Be=K.join(It.root,zM(e));return de.mkdirSync(Be,{recursive:!0}),de.writeJsonSync(K.join(Be,dr.manifest),{name:rn(e),mocked:!0}),de},E=async(de,{isColdHit:Be,controlPath:Ee=null})=>{if(Ee===null&&u.unstablePackages?.has(e.locatorHash))return{isValid:!0,hash:null};let g=r&&!Be?j1(r).cacheKey:this.cacheKey,me=!u.skipIntegrityCheck||!r?`${g}/${await wS(de)}`:r;if(Ee!==null){let Ae=!u.skipIntegrityCheck||!r?`${this.cacheKey}/${await wS(Ee)}`:r;if(me!==Ae)throw new Jt(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}let we=null;switch(r!==null&&me!==r&&(this.check?we="throw":j1(r).cacheKey!==j1(me).cacheKey?we="update":we=this.configuration.get("checksumBehavior")),we){case null:case"update":return{isValid:!0,hash:me};case"ignore":return{isValid:!0,hash:r};case"reset":return{isValid:!1,hash:r};default:case"throw":throw new Jt(18,"The remote archive doesn't match the expected checksum")}},I=async de=>{if(!n)throw new Error(`Cache check required but no loader configured for ${qr(this.configuration,e)}`);let Be=await n(),Ee=Be.getRealPath();Be.saveAndClose(),await oe.chmodPromise(Ee,420);let g=await E(de,{controlPath:Ee,isColdHit:!1});if(!g.isValid)throw new Error("Assertion failed: Expected a valid checksum");return g.hash},v=async()=>{if(A===null||!await oe.existsPromise(A)){let de=await n(),Be=de.getRealPath();return de.saveAndClose(),{source:"loader",path:Be}}return{source:"mirror",path:A}},x=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${qr(this.configuration,e)}`);if(this.immutable)throw new Jt(56,`Cache entry required but missing for ${qr(this.configuration,e)}`);let{path:de,source:Be}=await v(),{hash:Ee}=await E(de,{isColdHit:!0}),g=this.getLocatorPath(e,Ee),me=[];Be!=="mirror"&&A!==null&&me.push(async()=>{let Ae=`${A}${this.cacheId}`;await oe.copyFilePromise(de,Ae,t_.default.constants.COPYFILE_FICLONE),await oe.chmodPromise(Ae,420),await oe.renamePromise(Ae,A)}),(!u.mirrorWriteOnly||A===null)&&me.push(async()=>{let Ae=`${g}${this.cacheId}`;await oe.copyFilePromise(de,Ae,t_.default.constants.COPYFILE_FICLONE),await oe.chmodPromise(Ae,420),await oe.renamePromise(Ae,g)});let we=u.mirrorWriteOnly?A??g:g;return await Promise.all(me.map(Ae=>Ae())),[!1,we,Ee]},C=async()=>{let Be=(async()=>{let Ee=u.unstablePackages?.has(e.locatorHash),g=Ee||!r||this.isChecksumCompatible(r)?this.getLocatorPath(e,r):null,me=g!==null?this.markedFiles.has(g)||await p.existsPromise(g):!1,we=!!u.mockedPackages?.has(e.locatorHash)&&(!this.check||!me),Ae=we||me,ne=Ae?o:a;if(ne&&ne(),Ae){let Z=null,xe=g;if(!we)if(this.check)Z=await I(xe);else{let Ne=await E(xe,{isColdHit:!1});if(Ne.isValid)Z=Ne.hash;else return x()}return[we,xe,Z]}else{if(this.immutable&&Ee)throw new Jt(56,`Cache entry required but missing for ${qr(this.configuration,e)}; consider defining ${pe.pretty(this.configuration,"supportedArchitectures",pe.Type.CODE)} to cache packages for multiple systems`);return x()}})();this.mutexes.set(e.locatorHash,Be);try{return await Be}finally{this.mutexes.delete(e.locatorHash)}};for(let de;de=this.mutexes.get(e.locatorHash);)await de;let[R,L,U]=await C();R||this.markedFiles.add(L);let z,te=R?()=>h():()=>new Zi(L,{baseFs:p,readOnly:!0}),ae=new Gd(()=>uL(()=>z=te(),de=>`Failed to open the cache entry for ${qr(this.configuration,e)}: ${de}`),K),le=new Hu(L,{baseFs:ae,pathUtils:K}),ce=()=>{z?.discardAndClose()},Ce=u.unstablePackages?.has(e.locatorHash)?null:U;return[le,ce,Ce]}},cut=/^(?:(?<cacheKey>(?<cacheVersion>[0-9]+)(?<cacheSpec>.*))\/)?(?<hash>.*)$/});var Mx,Ape=Et(()=>{Mx=(r=>(r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE",r))(Mx||{})});var uut,Ty,i_=Et(()=>{Pt();Nl();bf();bo();uut=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(t,e,r,o)=>`${r}#commit=${o}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(t,e,r="",o,a)=>`https://${r}github.com/${o}.git#commit=${a}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(t,e,r="",o,a)=>`https://${r}github.com/${o}.git#commit=${a}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,t=>`npm:${t}`],[/^https?:\/\/[^/]+\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(t,e)=>PS({protocol:"npm:",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],Ty=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:r}){let o=K.join(e.cwd,dr.lockfile);if(!oe.existsSync(o))return;let a=
Line truncated
|
||||
`)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}reportFold(r,o){}async finalize(){this.errorCount>0&&(this.stdout.write(`
|
||||
`),this.stdout.write(`${Ot(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
|
||||
`),this.suggestInstall&&this.stdout.write(`${Ot(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
|
||||
`))}formatNameWithHyperlink(r){return AU(r,{configuration:this.configuration,json:!1})}}});var Ny,s_=Et(()=>{bo();Ny=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(BS(e).locatorHash))}supportsLocator(e,r){return!!(r.project.originalPackages.has(e.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(e,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,o){let a=o.project.storedResolutions.get(e.descriptorHash);if(a){let u=o.project.originalPackages.get(a);if(u)return[u]}let n=o.project.originalPackages.get(BS(e).locatorHash);if(n)return[n];throw new Error("Resolution expected from the lockfile data")}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let o=r.project.originalPackages.get(e.locatorHash);if(!o)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return o}}});function Gf(){}function Aut(t,e,r,o,a){for(var n=0,u=e.length,A=0,p=0;n<u;n++){var h=e[n];if(h.removed){if(h.value=t.join(o.slice(p,p+h.count)),p+=h.count,n&&e[n-1].added){var I=e[n-1];e[n-1]=e[n],e[n]=I}}else{if(!h.added&&a){var E=r.slice(A,A+h.count);E=E.map(function(x,C){var R=o[p+C];return R.length>x.length?R:x}),h.value=t.join(E)}else h.value=t.join(r.slice(A,A+h.count));A+=h.count,h.added||(p+=h.count)}}var v=e[u-1];return u>1&&typeof v.value=="string"&&(v.added||v.removed)&&t.equals("",v.value)&&(e[u-2].value+=v.value,e.pop()),e}function fut(t){return{newPos:t.newPos,components:t.components.slice(0)}}function put(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function gpe(t,e,r){return r=put(r,{ignoreWhitespace:!0}),u_.diff(t,e,r)}function hut(t,e,r){return A_.diff(t,e,r)}function Ox(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ox=function(e){return typeof e}:Ox=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ox(t)}function o_(t){return mut(t)||yut(t)||Eut(t)||Cut()}function mut(t){if(Array.isArray(t))return a_(t)}function yut(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Eut(t,e){if(t){if(typeof t=="string")return a_(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a_(t,e)}}function a_(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function Cut(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l_(t,e,r,o,a){e=e||[],r=r||[],o&&(t=o(a,t));var n;for(n=0;n<e.length;n+=1)if(e[n]===t)return r[n];var u;if(wut.call(t)==="[object Array]"){for(e.push(t),u=new Array(t.length),r.push(u),n=0;n<t.length;n+=1)u[n]=l_(t[n],e,r,o,a);return e.pop(),r.pop(),u}if(t&&t.toJSON&&(t=t.toJSON()),Ox(t)==="object"&&t!==null){e.push(t),u={},r.push(u);var A=[],p;for(p in t)t.hasOwnProperty(p)&&A.push(p);for(A.sort(),n=0;n<A.length;n+=1)p=A[n],u[p]=l_(t[p],e,r,o,p);e.pop(),r.pop()}else u=t;return u}function dpe(t,e,r,o,a,n,u){u||(u={}),typeof u.context>"u"&&(u.context=4);var A=hut(r,o,u);if(!A)return;A.push({value:"",lines:[]});function p(U){return U.map(function(z){return" "+z})}for(var h=[],E=0,I=0,v=[],x=1,C=1,R=function(z){var te=A[z],ae=te.lines||te.value.replace(/\n$/,"").split(`
|
||||
`);if(te.lines=ae,te.added||te.removed){var le;if(!E){var ce=A[z-1];E=x,I=C,ce&&(v=u.context>0?p(ce.lines.slice(-u.context)):[],E-=v.length,I-=v.length)}(le=v).push.apply(le,o_(ae.map(function(Ae){return(te.added?"+":"-")+Ae}))),te.added?C+=ae.length:x+=ae.length}else{if(E)if(ae.length<=u.context*2&&z<A.length-2){var Ce;(Ce=v).push.apply(Ce,o_(p(ae)))}else{var de,Be=Math.min(ae.length,u.context);(de=v).push.apply(de,o_(p(ae.slice(0,Be))));var Ee={oldStart:E,oldLines:x-E+Be,newStart:I,newLines:C-I+Be,lines:v};if(z>=A.length-2&&ae.length<=u.context){var g=/\n$/.test(r),me=/\n$/.test(o),we=ae.length==0&&v.length>Ee.oldLines;!g&&we&&r.length>0&&v.splice(Ee.oldLines,0,"\\ No newline at end of file"),(!g&&!we||!me)&&v.push("\\ No newline at end of file")}h.push(Ee),E=0,I=0,v=[]}x+=ae.length,C+=ae.length}},L=0;L<A.length;L++)R(L);return{oldFileName:t,newFileName:e,oldHeader:a,newHeader:n,hunks:h}}var c3t,ppe,hpe,u_,A_,gut,dut,wut,G1,c_,f_=Et(()=>{Gf.prototype={diff:function(e,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.callback;typeof o=="function"&&(a=o,o={}),this.options=o;var n=this;function u(R){return a?(setTimeout(function(){a(void 0,R)},0),!0):R}e=this.castInput(e),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var A=r.length,p=e.length,h=1,E=A+p;o.maxEditLength&&(E=Math.min(E,o.maxEditLength));var I=[{newPos:-1,components:[]}],v=this.extractCommon(I[0],r,e,0);if(I[0].newPos+1>=A&&v+1>=p)return u([{value:this.join(r),count:r.length}]);function x(){for(var R=-1*h;R<=h;R+=2){var L=void 0,U=I[R-1],z=I[R+1],te=(z?z.newPos:0)-R;U&&(I[R-1]=void 0);var ae=U&&U.newPos+1<A,le=z&&0<=te&&te<p;if(!ae&&!le){I[R]=void 0;continue}if(!ae||le&&U.newPos<z.newPos?(L=fut(z),n.pushComponent(L.components,void 0,!0)):(L=U,L.newPos++,n.pushComponent(L.components,!0,void 0)),te=n.extractCommon(L,r,e,R),L.newPos+1>=A&&te+1>=p)return u(Aut(n,L.components,r,e,n.useLongestToken));I[R]=L}h++}if(a)(function R(){setTimeout(function(){if(h>E)return a();x()||R()},0)})();else for(;h<=E;){var C=x();if(C)return C}},pushComponent:function(e,r,o){var a=e[e.length-1];a&&a.added===r&&a.removed===o?e[e.length-1]={count:a.count+1,added:r,removed:o}:e.push({count:1,added:r,removed:o})},extractCommon:function(e,r,o,a){for(var n=r.length,u=o.length,A=e.newPos,p=A-a,h=0;A+1<n&&p+1<u&&this.equals(r[A+1],o[p+1]);)A++,p++,h++;return h&&e.components.push({count:h}),e.newPos=A,p},equals:function(e,r){return this.options.comparator?this.options.comparator(e,r):e===r||this.options.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],o=0;o<e.length;o++)e[o]&&r.push(e[o]);return r},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};c3t=new Gf;ppe=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,hpe=/\S/,u_=new Gf;u_.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!hpe.test(t)&&!hpe.test(e)};u_.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<e.length-1;r++)!e[r+1]&&e[r+2]&&ppe.test(e[r])&&ppe.test(e[r+2])&&(e[r]+=e[r+2],e.splice(r+1,2),r--);return e};A_=new Gf;A_.tokenize=function(t){var e=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var o=0;o<r.length;o++){var a=r[o];o%2&&!this.options.newlineIsToken?e[e.length-1]+=a:(this.options.ignoreWhitespace&&(a=a.trim()),e.push(a))}return e};gut=new Gf;gut.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};dut=new Gf;dut.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};wut=Object.prototype.toString,G1=new Gf;G1.useLongestToken=!0;G1.tokenize=A_.tokenize;G1.castInput=function(t){var e=this.options,r=e.undefinedReplacement,o=e.stringifyReplacer,a=o===void 0?function(n,u){return typeof u>"u"?r:u}:o;return typeof t=="string"?t:JSON.stringify(l_(t,null,null,a),a," ")};G1.equals=function(t,e){return Gf.prototype.equals.call(G1,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};c_=new Gf;c_.tokenize=function(t){return t.slice()};c_.join=c_.removeEmpty=function(t){return t}});var ype=_((A3t,mpe)=>{var Iut=Hl(),But=Ym(),vut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dut=/^\w*$/;function Put(t,e){if(Iut(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||But(t)?!0:Dut.test(t)||!vut.test(t)||e!=null&&t in Object(e)}mpe.exports=Put});var wpe=_((f3t,Cpe)=>{var Epe=PP(),Sut="Expected a function";function p_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Sut);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],n=r.cache;if(n.has(a))return n.get(a);var u=t.apply(this,o);return r.cache=n.set(a,u)||n,u};return r.cache=new(p_.Cache||Epe),r}p_.Cache=Epe;Cpe.exports=p_});var Bpe=_((p3t,Ipe)=>{var but=wpe(),xut=500;function kut(t){var e=but(t,function(o){return r.size===xut&&r.clear(),o}),r=e.cache;return e}Ipe.exports=kut});var h_=_((h3t,vpe)=>{
Line truncated
|
||||
`;await oe.changeFilePromise(r,o,{automaticNewlines:!0}),this.manifest.raw=e}}});function TAt({project:t,allDescriptors:e,allResolutions:r,allPackages:o,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:u=new Map,peerWarnings:A=[],peerRequirementNodes:p=new Map,volatileDescriptors:h=new Set}){let E=new Map,I=[],v=new Map,x=new Map,C=new Map,R=new Map,L=new Map(t.workspaces.map(le=>{let ce=le.anchoredLocator.locatorHash,Ce=o.get(ce);if(typeof Ce>"u")throw new Error("Assertion failed: The workspace should have an associated package");return[ce,OI(Ce)]})),U=()=>{let le=oe.mktempSync(),ce=K.join(le,"stacktrace.log"),Ce=String(I.length+1).length,de=I.map((Be,Ee)=>`${`${Ee+1}.`.padStart(Ce," ")} ${ka(Be)}
|
||||
`).join("");throw oe.writeFileSync(ce,de),oe.detachTemp(le),new Jt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${ue.fromPortablePath(ce)}`)},z=le=>{let ce=r.get(le.descriptorHash);if(typeof ce>"u")throw new Error("Assertion failed: The resolution should have been registered");let Ce=o.get(ce);if(!Ce)throw new Error("Assertion failed: The package could not be found");return Ce},te=(le,ce,Ce,{top:de,optional:Be})=>{I.length>1e3&&U(),I.push(ce);let Ee=ae(le,ce,Ce,{top:de,optional:Be});return I.pop(),Ee},ae=(le,ce,Ce,{top:de,optional:Be})=>{if(Be||n.delete(ce.locatorHash),a.has(ce.locatorHash))return;a.add(ce.locatorHash);let Ee=o.get(ce.locatorHash);if(!Ee)throw new Error(`Assertion failed: The package (${qr(t.configuration,ce)}) should have been registered`);let g=[],me=new Map,we=[],Ae=[],ne=[],Z=[];for(let Ne of Array.from(Ee.dependencies.values())){if(Ee.peerDependencies.has(Ne.identHash)&&Ee.locatorHash!==de)continue;if(Pf(Ne))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");h.delete(Ne.descriptorHash);let ht=Be;if(!ht){let Se=Ee.dependenciesMeta.get(rn(Ne));if(typeof Se<"u"){let et=Se.get(null);typeof et<"u"&&et.optional&&(ht=!0)}}let H=r.get(Ne.descriptorHash);if(!H)throw new Error(`Assertion failed: The resolution (${jn(t.configuration,Ne)}) should have been registered`);let rt=L.get(H)||o.get(H);if(!rt)throw new Error(`Assertion failed: The package (${H}, resolved from ${jn(t.configuration,Ne)}) should have been registered`);if(rt.peerDependencies.size===0){te(Ne,rt,new Map,{top:de,optional:ht});continue}let Te,Fe,ke=new Set,Ye=new Map;we.push(()=>{Te=KM(Ne,ce.locatorHash),Fe=VM(rt,ce.locatorHash),Ee.dependencies.delete(Ne.identHash),Ee.dependencies.set(Te.identHash,Te),r.set(Te.descriptorHash,Fe.locatorHash),e.set(Te.descriptorHash,Te),o.set(Fe.locatorHash,Fe),g.push([rt,Te,Fe])}),Ae.push(()=>{R.set(Fe.locatorHash,Ye);for(let Se of Fe.peerDependencies.values()){let Ue=al(me,Se.identHash,()=>{let b=Ce.get(Se.identHash)??null,w=Ee.dependencies.get(Se.identHash);return!w&&HI(ce,Se)&&(le.identHash===ce.identHash?w=le:(w=In(ce,le.range),e.set(w.descriptorHash,w),r.set(w.descriptorHash,ce.locatorHash),h.delete(w.descriptorHash),b=null)),w||(w=In(Se,"missing:")),{subject:ce,ident:Se,provided:w,root:!b,requests:new Map,hash:`p${zi(ce.locatorHash,Se.identHash).slice(0,5)}`}}).provided;if(Ue.range==="missing:"&&Fe.dependencies.has(Se.identHash)){Fe.peerDependencies.delete(Se.identHash);continue}Ye.set(Se.identHash,{requester:Fe,descriptor:Se,meta:Fe.peerDependenciesMeta.get(rn(Se)),children:new Map}),Fe.dependencies.set(Se.identHash,Ue),Pf(Ue)&&bm(C,Ue.descriptorHash).add(Fe.locatorHash),v.set(Ue.identHash,Ue),Ue.range==="missing:"&&ke.add(Ue.identHash)}Fe.dependencies=new Map(Fs(Fe.dependencies,([Se,et])=>rn(et)))}),ne.push(()=>{if(!o.has(Fe.locatorHash))return;let Se=E.get(rt.locatorHash);typeof Se=="number"&&Se>=2&&U();let et=E.get(rt.locatorHash),Ue=typeof et<"u"?et+1:1;E.set(rt.locatorHash,Ue),te(Te,Fe,Ye,{top:de,optional:ht}),E.set(rt.locatorHash,Ue-1)}),Z.push(()=>{let Se=Ee.dependencies.get(Ne.identHash);if(typeof Se>"u")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let et=r.get(Se.descriptorHash);if(typeof et>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let Ue=R.get(et);if(typeof Ue>"u")throw new Error("Assertion failed: Expected the peer requests to be registered");for(let b of me.values()){let w=Ue.get(b.ident.identHash);w&&(b.requests.set(Se.descriptorHash,w),p.set(b.hash,b),b.root||Ce.get(b.ident.identHash)?.children.set(Se.descriptorHash,w))}if(o.has(Fe.locatorHash))for(let b of ke)Fe.dependencies.delete(b)})}for(let Ne of[...we,...Ae])Ne();let xe;do{xe=!0;for(let[Ne,ht,H]of g){let rt=kI(x,Ne.locatorHash),Te=zi(...[...H.dependencies.values()].map(Se=>{let et=Se.range!=="missing:"?r.get(Se.descriptorHash):"missing:";if(typeof et>"u")throw new Error(`Assertion failed: Expected the resolution for ${jn(t.configuration,Se)} to have been registered`);return et===de?`${et} (top)`:et}),ht.identHash),Fe=rt.get(Te);if(typeof Fe>"u"){rt.set(Te,ht);continue}if(Fe===ht)continue;o.delete(H.locatorHash),e.delete(ht.descriptorHash),r.delete(ht.descriptorHash),a.delete(H.locatorHash);let ke=C.get(ht.descriptorHash)||[],Ye=[Ee.locatorHash,...ke];C.delete(ht.descriptorHash);for(let Se of Ye){let et=o.get(Se);typeof et>"u"||(et.dependencies.get(ht.identHash).descriptorHash!==Fe.descriptorHash&&(xe=!1),et.dependencies.set(ht.identHash,Fe))}for(let Se of me.values())Se.provided.descriptorHash===ht.descriptorHash&&(Se.provided=Fe)}}while(!xe);for(let Ne of[...ne,...Z])Ne()};for(let le of t.workspaces){let ce=le.anchoredLocator;h.delete(le.anchoredDescriptor.descriptorHash),te(le.anchoredDescriptor,ce,new Map,{top:ce.locatorHash,optional:!1})}for(let le of p.values()){if(!le.root)continue;let ce=o.get(le.subject.locatorHash);if(typeof ce>"u")co
Line truncated
|
||||
|
||||
${[I,v,x].join(`
|
||||
`)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=K.join(this.cwd,dr.lockfile),r=this.configuration.get("defaultLanguageName");if(oe.existsSync(e)){let o=await oe.readFilePromise(e,"utf8");this.lockFileChecksum=$pe(o);let a=Ki(o);if(a.__metadata){let n=a.__metadata.version,u=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n<Gx;for(let A of Object.keys(a)){if(A==="__metadata")continue;let p=a[A];if(typeof p.resolution>"u")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${A})`);let h=Sf(p.resolution,!0),E=new Ut;E.load(p,{yamlCompatibilityMode:!0});let I=E.version,v=E.languageName||r,x=p.linkType.toUpperCase(),C=p.conditions??null,R=E.dependencies,L=E.peerDependencies,U=E.dependenciesMeta,z=E.peerDependenciesMeta,te=E.bin;if(p.checksum!=null){let le=typeof u<"u"&&!p.checksum.includes("/")?`${u}/${p.checksum}`:p.checksum;this.storedChecksums.set(h.locatorHash,le)}let ae={...h,version:I,languageName:v,linkType:x,conditions:C,dependencies:R,peerDependencies:L,dependenciesMeta:U,peerDependenciesMeta:z,bin:te};this.originalPackages.set(ae.locatorHash,ae);for(let le of A.split(kAt)){let ce=rh(le);n<=6&&(ce=this.configuration.normalizeDependency(ce),ce=In(ce,ce.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,"$1npm%3A"))),this.storedDescriptors.set(ce.descriptorHash,ce),this.storedResolutions.set(ce.descriptorHash,h.locatorHash)}}}else o.includes("yarn lockfile v1")&&(this.lockfileLastVersion=-1)}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=new Set,r=(0,jx.default)(4),o=async(a,n)=>{if(e.has(n))return a;e.add(n);let u=new My(n,{project:this});await r(()=>u.setup());let A=a.then(()=>{this.addWorkspace(u)});return Array.from(u.workspacesCwds).reduce(o,A)};await o(Promise.resolve(),this.cwd)}addWorkspace(e){let r=this.workspacesByIdent.get(e.anchoredLocator.identHash);if(typeof r<"u")throw new Error(`Duplicate workspace name ${Oi(this.configuration,e.anchoredLocator)}: ${ue.fromPortablePath(e.cwd)} conflicts with ${ue.fromPortablePath(r.cwd)}`);this.workspaces.push(e),this.workspacesByCwd.set(e.cwd,e),this.workspacesByIdent.set(e.anchoredLocator.identHash,e)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){K.isAbsolute(e)||(e=K.resolve(this.cwd,e)),e=K.normalize(e).replace(/\/+$/,"");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let o of this.workspaces)K.relative(o.cwd,e).startsWith("../")||r&&r.cwd.length>=o.cwd.length||(r=o);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r>"u"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${Oi(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){if(e.range.startsWith(ei.protocol)){let o=e.range.slice(ei.protocol.length);if(o!=="^"&&o!=="~"&&o!=="*"&&!Qa(o))return this.tryWorkspaceByCwd(o)}let r=this.tryWorkspaceByIdent(e);return r===null||(Pf(e)&&(e=UI(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${jn(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(Gc(e)&&(e=_I(e)),r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${qr(this.configuration,e)})`);return r}deleteDescriptor(e){this.storedResolutions.delete(e),this.storedDescriptors.delete(e)}deleteLocator(e){this.originalPackages.delete(e),this.storedPackages.delete(e),this.accessibleLocators.delete(e)}forgetResolution(e){if("descriptorHash"in e){let r=this.storedResolutions.get(e.descriptorHash);this.deleteDescriptor(e.descriptorHash);let o=new Set(this.storedResolutions.values());typeof r<"u"&&!o.has(r)&&this.deleteLocator(r)}if("locatorHash"in e){this.deleteLocator(e.locatorHash);for(let[r,o]of this.storedResolutions)o===e.locatorHash&&this.deleteDescriptor(r)}}forgetTransientResolutions(){let e=this.configuration.makeResolver(),r=new Map;for(let[o,a]of this.storedResolutions.entries()){let n=r.get(a);n||r.set(a,n=new Set),n.add(o)}for(let o of this.originalPackages.values()){let a;try{a=e.shouldPersistResolution(o,{project:this,resolver:e})}catch{a=!1}if(!a){this.deleteLocator(o.locatorHash);let n=r.get(o.locatorHash);if(n){r.delete(o.locatorHash);for(let u of n)this.deleteDescriptor(u)}}}}forgetVirtualResolutions(){for(let e of this.storedPackages.values())for(let[r,o]of e.dependencies)Pf(o)&&e.dLine truncated
|
||||
`;switch(rt.type){case 0:Te+=`# Script name: ${rt.script}
|
||||
`;break;case 1:Te+=`# Script code: ${rt.script}
|
||||
`;break}let Fe=null;if(!await oe.mktempPromise(async Ye=>{let Se=K.join(Ye,"build.log"),{stdout:et,stderr:Ue}=this.configuration.getSubprocessStreams(Se,{header:Te,prefix:qr(this.configuration,Z),report:r}),b;try{switch(rt.type){case 0:b=await Nb(Z,rt.script,[],{cwd:H,project:this,stdin:Fe,stdout:et,stderr:Ue});break;case 1:b=await fU(Z,rt.script,[],{cwd:H,project:this,stdin:Fe,stdout:et,stderr:Ue});break}}catch(y){Ue.write(y.stack),b=1}if(et.end(),Ue.end(),b===0)return!0;oe.detachTemp(Ye);let w=`${qr(this.configuration,Z)} couldn't be built successfully (exit code ${Ot(this.configuration,b,yt.NUMBER)}, logs can be found here: ${Ot(this.configuration,Se,yt.PATH)})`,S=this.optionalBuilds.has(Z.locatorHash);return S?r.reportInfo(9,w):r.reportError(9,w),Zce&&r.reportFold(ue.fromPortablePath(Se),oe.readFileSync(Se,"utf8")),S}))return!1}return!0});Ae.push(...ht,Promise.allSettled(ht).then(H=>{ae.delete(ne),H.every(rt=>rt.status==="fulfilled"&&rt.value===!0)&&Ee.set(Z.locatorHash,Ne)}))}if(await _c(Ae),we===ae.size){let ne=Array.from(ae).map(Z=>{let xe=this.storedPackages.get(Z);if(!xe)throw new Error("Assertion failed: The package should have been registered");return qr(this.configuration,xe)}).join(", ");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${ne})`);break}}this.storedBuildState=Ee,this.skippedBuilds=L}async installWithNewReport(e,r){return(await Rt.start({configuration:this.configuration,json:e.json,stdout:e.stdout,forceSectionAlignment:!0,includeLogs:!e.json&&!e.quiet,includeVersion:!0},async a=>{await this.install({...r,report:a})})).exitCode()}async install(e){let r=this.configuration.get("nodeLinker");Ke.telemetry?.reportInstall(r);let o=!1;if(await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{this.configuration.get("enableOfflineMode")&&e.report.reportWarning(90,"Offline work is enabled; Yarn won't fetch packages from the remote registry if it can avoid it"),await this.configuration.triggerHook(E=>E.validateProject,this,{reportWarning:(E,I)=>{e.report.reportWarning(E,I)},reportError:(E,I)=>{e.report.reportError(E,I),o=!0}})}),o)return;let a=await this.configuration.getPackageExtensions();for(let E of a.values())for(let[,I]of E)for(let v of I)v.status="inactive";let n=K.join(this.cwd,dr.lockfile),u=null;if(e.immutable)try{u=await oe.readFilePromise(n,"utf8")}catch(E){throw E.code==="ENOENT"?new Jt(28,"The lockfile would have been created by this install, which is explicitly forbidden."):E}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{LAt(this,e.report);for(let[,E]of a)for(let[,I]of E)for(let v of I)if(v.userProvided){let x=Ot(this.configuration,v,yt.PACKAGE_EXTENSION);switch(v.status){case"inactive":e.report.reportWarning(68,`${x}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case"redundant":e.report.reportWarning(69,`${x}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(u!==null){let E=L0(u,this.generateLockfile());if(E!==u){let I=dpe(n,n,u,E,void 0,void 0,{maxEditLength:100});if(I){e.report.reportSeparator();for(let v of I.hunks){e.report.reportInfo(null,`@@ -${v.oldStart},${v.oldLines} +${v.newStart},${v.newLines} @@`);for(let x of v.lines)x.startsWith("+")?e.report.reportError(28,Ot(this.configuration,x,yt.ADDED)):x.startsWith("-")?e.report.reportError(28,Ot(this.configuration,x,yt.REMOVED)):e.report.reportInfo(null,Ot(this.configuration,x,"grey"))}e.report.reportSeparator()}throw new Jt(28,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let E of a.values())for(let[,I]of E)for(let v of I)v.userProvided&&v.status==="active"&&Ke.telemetry?.reportPackageExtension(pg(v,yt.PACKAGE_EXTENSION));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e)});let A=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],p=await Promise.all(A.map(async E=>IS(E,{cwd:this.cwd})));(typeof e.persistProject>"u"||e.persistProject)&&await this.persist(),await e.report.startTimerPromise("Link step",async()=>{if(e.mode==="update-lockfile"){e.report.reportWarning(73,`Skipped due to ${Ot(this.configuration,"mode=update-lockfile",yt.CODE)}`);return}await this.linkEverything(e);let E=await Promise.all(A.map(async I=>IS(I,{cwd:this.cwd})));for(let I=0;I<A.length;++I)p[I]!==E[I]&&e.report.reportError(64,`The checksum for ${A[I]} has been modified by this install, which is explicitly forbidden.`)}),await this.persistInstallStateFile();let h=!1;await e.report.startTimerPromise("Post-install validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(E=>E.validateProjectAfterInstall,this,{reportWarning:(E,I)=>{e.report.r
Line truncated
|
||||
`,`# Manual changes might be lost - proceed with caution!
|
||||
`].join("")}
|
||||
`+Da(r)}async persistLockfile(){let e=K.join(this.cwd,dr.lockfile),r="";try{r=await oe.readFilePromise(e,"utf8")}catch{}let o=this.generateLockfile(),a=L0(r,o);a!==r&&(await oe.writeFilePromise(e,a),this.lockFileChecksum=$pe(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let u of Object.values(w_))e.push(...u);let r=(0,qx.default)(this,e),o=I_.default.serialize(r),a=zi(o);if(this.installStateChecksum===a)return;let n=this.configuration.get("installStatePath");await oe.mkdirPromise(K.dirname(n),{recursive:!0}),await oe.writeFilePromise(n,await FAt(o)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:o=!0}={}){let a=this.configuration.get("installStatePath"),n;try{let u=await RAt(await oe.readFilePromise(a));n=I_.default.deserialize(u),this.installStateChecksum=zi(u)}catch{r&&await this.applyLightResolution();return}e&&typeof n.linkersCustomData<"u"&&(this.linkersCustomData=n.linkersCustomData),o&&Object.assign(this,(0,qx.default)(n,w_.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,(0,qx.default)(n,w_.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new ki}),await this.persistInstallStateFile()}async persist(){let e=(0,jx.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(r=>e(()=>r.persistManifest()))])}async cacheCleanup({cache:e,report:r}){if(this.configuration.get("enableGlobalCache"))return null;let o=new Set([".gitignore"]);if(!fO(e.cwd,this.cwd)||!await oe.existsPromise(e.cwd))return null;let a=[];for(let u of await oe.readdirPromise(e.cwd)){if(o.has(u))continue;let A=K.resolve(e.cwd,u);e.markedFiles.has(A)||(e.immutable?r.reportError(56,`${Ot(this.configuration,K.basename(A),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(oe.lstatPromise(A).then(async p=>(await oe.removePromise(A),p.size))))}if(a.length===0)return null;let n=await Promise.all(a);return{count:a.length,size:n.reduce((u,A)=>u+A,0)}}}});function MAt(t){let o=Math.floor(t.timeNow/864e5),a=t.updateInterval*864e5,n=t.state.lastUpdate??t.timeNow+a+Math.floor(a*t.randomInitialInterval),u=n+a,A=t.state.lastTips??o*864e5,p=A+864e5+8*36e5-t.timeZone,h=u<=t.timeNow,E=p<=t.timeNow,I=null;return(h||E||!t.state.lastUpdate||!t.state.lastTips)&&(I={},I.lastUpdate=h?t.timeNow:n,I.lastTips=A,I.blocks=h?{}:t.state.blocks,I.displayedTips=t.state.displayedTips),{nextState:I,triggerUpdate:h,triggerTips:E,nextTips:E?o*864e5:A}}var Oy,rhe=Et(()=>{Pt();w1();th();Ab();ql();bf();Oy=class{constructor(e,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.nextTips=0;this.displayedTips=[];this.shouldCommitTips=!1;this.configuration=e;let o=this.getRegistryPath();this.isNew=!oe.existsSync(o),this.shouldShowTips=!1,this.sendReport(r),this.startBuffer()}commitTips(){this.shouldShowTips&&(this.shouldCommitTips=!0)}selectTip(e){let r=new Set(this.displayedTips),o=A=>A&&nn?tA(nn,A):!1,a=e.map((A,p)=>p).filter(A=>e[A]&&o(e[A]?.selector));if(a.length===0)return null;let n=a.filter(A=>!r.has(A));if(n.length===0){let A=Math.floor(a.length*.2);this.displayedTips=A>0?this.displayedTips.slice(-A):[],n=a.filter(p=>!r.has(p))}let u=n[Math.floor(Math.random()*n.length)];return this.displayedTips.push(u),this.commitTips(),e[u]}reportVersion(e){this.reportValue("version",e.replace(/-git\..*/,"-git"))}reportCommandName(e){this.reportValue("commandName",e||"<none>")}reportPluginName(e){this.reportValue("pluginName",e)}reportProject(e){this.reportEnumerator("projectCount",e)}reportInstall(e){this.reportHit("installCount",e)}reportPackageExtension(e){this.reportValue("packageExtension",e)}reportWorkspaceCount(e){this.reportValue("workspaceCount",String(e))}reportDependencyCount(e){this.reportValue("dependencyCount",String(e))}reportValue(e,r){bm(this.values,e).add(r)}reportEnumerator(e,r){bm(this.enumerators,e).add(zi(r))}reportHit(e,r="*"){let o=kI(this.hits,e),a=al(o,r,()=>0);o.set(r,a+1)}getRegistryPath(){let e=this.configuration.get("globalFolder");return K.join(e,"telemetry.json")}sendReport(e){let r=this.getRegistryPath(),o;try{o=oe.readJsonSync(r)}catch{o={}}let{nextState:a,triggerUpdate:n,triggerTips:u,nextTips:A}=MAt({state:o,timeNow:Date.now(),timeZone:new Date().getTimezoneOffset()*60*1e3,randomInitialInterval:Math.random(),updateInterval:this.configuration.get("telemetryInterval")});if(this.nextTips=A,this.displayedTips=o.displayedTips??[],a!==null)try{oe.mkdirSync(K.dirname(r),{recursive:!0}),oe.writeJsonSync(r,a)}catch{return!1}if(u&&this.configuration.get("enableTips")&&(this.shouldShowTips=!0),n){let p=o.blocks??{};if(Object.keys(p).length===0){let h=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${e}?ddsource=yarn`,E=I=>x4(h,I,{configuration:this.configuration}).catch(()=>{});for(let[I,v]of Object.entries(o.blocks??{})){if(Object.k
Line truncated
|
||||
`),h=u.length;for(h>0&&u.includes("unstyle")&&(u=[...new Set(["unstyle",...u])].reverse());h-- >0;)A=r(t.styles[u[h]],A,p);return A},a=(n,u,A)=>{t.styles[n]=e({name:n,codes:u}),(t.keys[A]||(t.keys[A]=[])).push(n),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(h){t.alias(n,h)},get(){let h=E=>o(E,h.stack);return Reflect.setPrototypeOf(h,t),h.stack=this.stack?this.stack.concat(n):[n],h}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=qAt,t.hasColor=t.hasAnsi=n=>(t.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&t.ansiRegex.test(n)),t.alias=(n,u)=>{let A=typeof u=="string"?t[u]:u;if(typeof A!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");A.stack||(Reflect.defineProperty(A,"name",{value:n}),t.styles[n]=A,A.stack=[n]),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(p){t.alias(n,p)},get(){let p=h=>o(h,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(A.stack):A.stack,p}})},t.theme=n=>{if(!HAt(n))throw new TypeError("Expected theme to be an object");for(let u of Object.keys(n))t.alias(u,n[u]);return t},t.alias("unstyle",n=>typeof n=="string"&&n!==""?(t.ansiRegex.lastIndex=0,n.replace(t.ansiRegex,"")):""),t.alias("noop",n=>n),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=lhe(),t.define=a,t};P_.exports=che();P_.exports.create=che});var No=_(on=>{"use strict";var jAt=Object.prototype.toString,rc=zc(),uhe=!1,S_=[],Ahe={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};on.longest=(t,e)=>t.reduce((r,o)=>Math.max(r,e?o[e].length:o.length),0);on.hasColor=t=>!!t&&rc.hasColor(t);var Kx=on.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);on.nativeType=t=>jAt.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");on.isAsyncFn=t=>on.nativeType(t)==="asyncfunction";on.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";on.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;on.scrollDown=(t=[])=>[...t.slice(1),t[0]];on.scrollUp=(t=[])=>[t.pop(),...t];on.reorder=(t=[])=>{let e=t.slice();return e.sort((r,o)=>r.index>o.index?1:r.index<o.index?-1:0),e};on.swap=(t,e,r)=>{let o=t.length,a=r===o?0:r<0?o-1:r,n=t[e];t[e]=t[a],t[a]=n};on.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};on.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};on.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:o=`
|
||||
`+r,width:a=80}=e,n=(o+r).match(/[^\S\n]/g)||[];a-=n.length;let u=`.{1,${a}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,A=t.trim(),p=new RegExp(u,"g"),h=A.match(p)||[];return h=h.map(E=>E.replace(/\n$/,"")),e.padEnd&&(h=h.map(E=>E.padEnd(a," "))),e.padStart&&(h=h.map(E=>E.padStart(a," "))),r+h.join(o)};on.unmute=t=>{let e=t.stack.find(o=>rc.keys.color.includes(o));return e?rc[e]:t.stack.find(o=>o.slice(2)==="bg")?rc[e.slice(2)]:o=>o};on.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";on.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(o=>rc.keys.color.includes(o));if(e){let o=rc["bg"+on.pascal(e)];return o?o.black:t}let r=t.stack.find(o=>o.slice(0,2)==="bg");return r?rc[r.slice(2).toLowerCase()]||t:rc.none};on.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(o=>rc.keys.color.includes(o)),r=t.stack.find(o=>o.slice(0,2)==="bg");if(e&&!r)return rc[Ahe[e]||e];if(r){let o=r.slice(2).toLowerCase(),a=Ahe[o];return a&&rc["bg"+on.pascal(a)]||t}return rc.none};on.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),o=e>=12?"pm":"am";e=e%12;let a=e===0?12:e,n=r<10?"0"+r:r;return a+":"+n+" "+o};on.set=(t={},e="",r)=>e.split(".").reduce((o,a,n,u)=>{let A=u.length-1>n?o[a]||{}:r;return!on.isObject(A)&&n<u.length-1&&(A={}),o[a]=A},t);on.get=(t={},e="",r)=>{let o=t[e]==null?e.split(".").reduce((a,n)=>a&&a[n],t):t[e];return o??r};on.mixin=(t,e)=>{if(!Kx(t))return e;if(!Kx(e))return t;for(let r of Object.keys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(o.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&Kx(o.value)){let a=Object.getOwnPropertyDescriptor(t,r);Kx(a.value)?t[r]=on.merge({},t[r],e[r]):Reflect.defineProperty(t,r,o)}else Reflect.defineProperty(t,r,o);else Reflect.defineProperty(t,r,o)}return t};on.merge=(...t)=>{let e={};for(let r of t)on.mixin(e,r);return e};on.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let o of Object.keys(r)){let a=r[o];typeof a=="function"?on.define(t,o,a.bind(e)):on.define(t,o,a)}};on.onExit=t=>{let e=(r,o)=>{uhe||(uhe=!0,S_.forEach(a=>a()),r===!0&&process.exit(128+o))};S_.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),S_.push(t)};on.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};on.defineExport=(t,e,r)=>{let o;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(a){o=a},get(){return o?o():r()}})}});var fhe=_(qy=>{"use strict";qy.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};qy.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};qy.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};qy.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};qy.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var ghe=_((n8t,hhe)=>{"use strict";var phe=ve("readline"),GAt=fhe(),YAt=/^(?:\x1b)([a-zA-Z0-9])$/,WAt=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,KAt={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function VAt(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}function zAt(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}var Vx=(t="",e={})=>{let r,o={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&t[1]===void 0?(t[0]-=128,t="\x1B"+String(t)):t=String(t):t!==void 0&&typeof t!="string"?t=String(t):t||(t=o.sequence||""),o.sequence=o.sequence||t||o.name,t==="\r")o.raw=void 0,o.name="return";else if(t===`
|
||||
`)o.name="enter";else if(t===" ")o.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x1B\x7F"||t==="\x1B\b")o.name="backspace",o.meta=t.charAt(0)==="\x1B";else if(t==="\x1B"||t==="\x1B\x1B")o.name="escape",o.meta=t.length===2;else if(t===" "||t==="\x1B ")o.name="space",o.meta=t.length===2;else if(t<="")o.name=String.fromCharCode(t.charCodeAt(0)+97-1),o.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")o.name="number";else if(t.length===1&&t>="a"&&t<="z")o.name=t;else if(t.length===1&&t>="A"&&t<="Z")o.name=t.toLowerCase(),o.shift=!0;else if(r=YAt.exec(t))o.meta=!0,o.shift=/^[A-Z]$/.test(r[1]);else if(r=WAt.exec(t)){let a=[...t];a[0]==="\x1B"&&a[1]==="\x1B"&&(o.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),u=(r[3]||r[5]||1)-1;o.ctrl=!!(u&4),o.meta=!!(u&10),o.shift=!!(u&1),o.code=n,o.name=KAt[n],o.shift=VAt(n)||o.shift,o.ctrl=zAt(n)||o.ctrl}return o};Vx.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let o=phe.createInterface({terminal:!0,input:r});phe.emitKeypressEvents(r,o);let a=(A,p)=>e(A,Vx(A,p),o),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",a),o.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener("keypress",a),o.pause(),o.close()}};Vx.action=(t,e,r)=>{let o={...GAt,...r};return e.ctrl?(e.action=o.ctrl[e.name],e):e.option&&o.option?(e.action=o.option[e.name],e):e.shift?(e.action=o.shift[e.name],e):(e.action=o.keys[e.name],e)};hhe.exports=Vx});var mhe=_((i8t,dhe)=>{"use strict";dhe.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(e)for(let r of Object.keys(e)){let o=e[r];typeof o=="number"&&(o={interval:o}),JAt(t,r,o)}};function JAt(t,e,r={}){let o=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},a=r.interval||120;o.frames=r.frames||[],o.loading=!0;let n=setInterval(()=>{o.ms=Date.now()-o.start,o.tick++,t.render()},a);return o.stop=()=>{o.loading=!1,clearInterval(n)},Reflect.defineProperty(o,"interval",{value:n}),t.once("close",()=>o.stop()),o.stop}});var Ehe=_((s8t,yhe)=>{"use strict";var{define:XAt,width:ZAt}=No(),b_=class{constructor(e){let r=e.options;XAt(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=ZAt(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r=="function"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};yhe.exports=b_});var whe=_((o8t,Che)=>{"use strict";var x_=No(),eo=zc(),k_={default:eo.noop,noop:eo.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||x_.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||x_.complement(this.primary)},primary:eo.cyan,success:eo.green,danger:eo.magenta,strong:eo.bold,warning:eo.yellow,muted:eo.dim,disabled:eo.gray,dark:eo.dim.gray,underline:eo.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse}};k_.merge=(t={})=>{t.styles&&typeof t.styles.enabled=="boolean"&&(eo.enabled=t.styles.enabled),t.styles&&typeof t.styles.visible=="boolean"&&(eo.visible=t.styles.visible);let e=x_.merge({},k_,t.styles);delete e.merge;for(let r of Object.keys(eo))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>eo[r]});for(let r of Object.keys(eo.styles))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>eo[r]});return e};Che.exports=k_});var Bhe=_((a8t,Ihe)=>{"use strict";var Q_=process.platform==="win32",Yf=zc(),$At=No(),F_={...Yf.symbols,upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301",
Line truncated
|
||||
`),h=p[0],E=p[p.length-1],v=(o+(r?" "+r:"")).length,x=v<h.length?h.slice(v+1):"";return{header:u,prompt:h,after:x,rest:p.slice(1),last:E}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`
|
||||
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
|
||||
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Ug.cursor.down(e.rest.length)),this.write(`
|
||||
`.repeat(r))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=L_.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:o}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>o.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,o){let{options:a,state:n,symbols:u,timers:A}=this,p=A&&A[e];n.timer=p;let h=a[e]||n[e]||u[e],E=r&&r[e]!=null?r[e]:await h;if(E==="")return E;let I=await this.resolve(E,n,r,o);return!I&&r&&r[e]?this.resolve(h,n,r,o):I}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,o=this.state;return o.timer=r,Na.isObject(e)&&(e=e[o.status]||e.pending),Na.hasColor(e)?e:(this.styles[o.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Na.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,o=this.state;o.timer=r;let a=e[o.status]||e.pending||o.separator,n=await this.resolve(a,o);return Na.isObject(n)&&(n=n[o.status]||n.pending),Na.hasColor(n)?n:this.styles.muted(n)}async pointer(e,r){let o=await this.element("pointer",e,r);if(typeof o=="string"&&Na.hasColor(o))return o;if(o){let a=this.styles,n=this.index===r,u=n?a.primary:h=>h,A=await this.resolve(o[n?"on":"off"]||o,this.state),p=Na.hasColor(A)?A:u(A);return n?p:" ".repeat(A.length)}}async indicator(e,r){let o=await this.element("indicator",e,r);if(typeof o=="string"&&Na.hasColor(o))return o;if(o){let a=this.styles,n=e.enabled===!0,u=n?a.success:a.dark,A=o[n?"on":"off"]||o;return Na.hasColor(A)?A:u(A)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return Na.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...r){return Na.resolve(this,e,...r)}get base(){return t.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Na.height(this.stdout,25)}get width(){return this.options.columns||Na.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,o=[r,e].find(this.isValue.bind(this));return this.isValue(o)?o:this.initial}static get prompt(){return e=>new this(e).run()}};function lft(t){let e=a=>t[a]===void 0||typeof t[a]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],o=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let a of Object.keys(t.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=t.options[a];typeof n=="function"&&e(a)?o.includes(a)||(t[a]=n.bind(t)):typeof t[a]!="function"&&(t[a]=n)}}function cft(t){typeof t=="number"&&(t=[t,t,t,t]);let e=[].concat(t||[]),r=a=>a%2===0?`
|
||||
`:" ",o=[];for(let a=0;a<4;a++){let n=r(a);e[a]?o.push(n.repeat(e[a])):o.push("")}return o}Fhe.exports=M_});var Nhe=_((u8t,The)=>{"use strict";var uft=No(),Rhe={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return Rhe.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};The.exports=(t,e={})=>{let r=uft.merge({},Rhe,e.roles);return r[t]||r.default}});var V1=_((A8t,Ohe)=>{"use strict";var Aft=zc(),fft=jy(),pft=Nhe(),zx=No(),{reorder:O_,scrollUp:hft,scrollDown:gft,isObject:Lhe,swap:dft}=zx,U_=class extends fft{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:o,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof a!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");Lhe(r)&&(r=Object.keys(r)),Array.isArray(r)?(o!=null&&(this.index=this.findIndex(o)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(o!=null&&(r=o),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let o=[],a=0,n=async(u,A)=>{typeof u=="function"&&(u=await u.call(this)),u instanceof Promise&&(u=await u);for(let p=0;p<u.length;p++){let h=u[p]=await this.toChoice(u[p],a++,A);o.push(h),h.choices&&await n(h.choices,h)}return o};return n(e,r).then(u=>(this.state.loadingChoices=!1,u))}async toChoice(e,r,o){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let a=e.value;if(e=pft(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=r,e.cursor=0,zx.define(e,"parent",o),e.level=o?o.level+1:1,e.indent==null&&(e.indent=o?o.indent+" ":e.indent||""),e.path=o?o.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,Aft.unstyle(e.message).length));let u={...e};return e.reset=(A=u.input,p=u.value)=>{for(let h of Object.keys(u))e[h]=u[h];e.input=A,e.value=p},a==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,o){let a=await this.toChoice(e,r,o);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(e,r,o){let a={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(a,r,o);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(e,r){return typeof r!="boolean"&&(r=e.enabled),r&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=r&&!this.isDisabled(e),e)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelected<this.choices.length)return this.alert();let e=this.selectable.every(r=>r.enabled);return this.choices.forEach(r=>r.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(e=this.focused){return this.choices.some(r=>!!r.parent)?(this.toggle(e.parent&&!e.choices?e.parent:e),this.render()):this.a()}toggle(e,r){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!="boolean"&&(r=!e.enabled),e.enabled=r,e.choices&&e.
Line truncated
|
||||
`),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,o].filter(Boolean).join(`
|
||||
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,o="",a=await this.header(),n=await this.prefix(),u=await this.separator(),A=await this.message();this.options.promptLine!==!1&&(o=[n,A,u,""].join(" "),this.state.prompt=o);let p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),I=await this.footer();p&&(o+=p),h&&!o.includes(h)&&(o+=" "+h),e&&!p&&!E.trim()&&this.multiple&&this.emptyError!=null&&(o+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,o,E,I].filter(Boolean).join(`
|
||||
`)),this.write(this.margin[2]),this.restore()}};Uhe.exports=H_});var Hhe=_((p8t,_he)=>{"use strict";var yft=Ph(),Eft=(t,e)=>{let r=t.toLowerCase();return o=>{let n=o.toLowerCase().indexOf(r),u=e(o.slice(n,n+r.length));return n>=0?o.slice(0,n)+u+o.slice(n+r.length):o}},q_=class extends yft{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:o}=this.state;return this.input=o.slice(0,r)+e+o.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let o=e.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(o))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=Eft(this.input,e),o=this.choices;this.choices=o.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=o}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};_he.exports=q_});var G_=_((h8t,qhe)=>{"use strict";var j_=No();qhe.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:o="",pos:a,showCursor:n=!0,color:u}=e,A=u||t.styles.placeholder,p=j_.inverse(t.styles.primary),h=R=>p(t.styles.black(R)),E=r,I=" ",v=h(I);if(t.blink&&t.blink.off===!0&&(h=R=>R,v=""),n&&a===0&&o===""&&r==="")return h(I);if(n&&a===0&&(r===o||r===""))return h(o[0])+A(o.slice(1));o=j_.isPrimitive(o)?`${o}`:"",r=j_.isPrimitive(r)?`${r}`:"";let x=o&&o.startsWith(r)&&o!==r,C=x?h(o[r.length]):v;if(a!==r.length&&n===!0&&(E=r.slice(0,a)+h(r[a])+r.slice(a+1),C=""),n===!1&&(C=""),x){let R=t.styles.unstyle(E+C);return E+C+A(o.slice(R.length))}return E+C}});var Jx=_((g8t,jhe)=>{"use strict";var Cft=zc(),wft=Ph(),Ift=G_(),Y_=class extends wft{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:o,input:a}=r;return r.value=r.input=a.slice(0,o)+e+a.slice(o),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:o}=e;return e.value=e.input=o.slice(0,r-1)+o.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:o}=e;if(o[r]===void 0)return this.alert();let a=`${o}`.slice(0,r)+`${o}`.slice(r+1);return e.value=e.input=a,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:o}=e;return r&&r.startsWith(o)&&o!==r?(e.value=e.input=r,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input="",e.cursor=0,this.render()):this.alert()}separator(){return""}format(e){return this.state.submitted?"":super.format(e)}pointer(){return""}indicator(e){return e.input?"\u29BF":"\u2299"}async choiceSeparator(e,r){let o=await this.resolve(e.separator,this.state,e,r)||":";return o?" "+this.styles.disabled(o):""}async renderChoice(e,r){await this.onChoice(e,r);let{state:o,styles:a}=this,{cursor:n,initial:u="",name:A,hint:p,input:h=""}=e,{muted:E,submitted:I,primary:v,danger:x}=a,C=p,R=this.index===r,L=e.validate||(()=>!0),U=await this.choiceSeparator(e,r),z=e.message;this.align==="right"&&(z=z.padStart(this.longest+1," ")),this.align==="left"&&(z=z.padEnd(this.longest+1," "));let te=this.values[A]=h||u,ae=h?"success":"dark";await L.call(e,te,thi
Line truncated
|
||||
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};zhe.exports=K_});var Xhe=_((E8t,Jhe)=>{"use strict";var kft=Xx(),V_=class extends kft{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};Jhe.exports=V_});var $he=_((C8t,Zhe)=>{"use strict";var Qft=Ph(),Fft=Jx(),Gy=Fft.prototype,z_=class extends Qft{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let o=this.focused,a=o.parent||{};return!o.editable&&!a.editable&&(e==="a"||e==="i")?super[e]():Gy.dispatch.call(this,e,r)}append(e,r){return Gy.append.call(this,e,r)}delete(e,r){return Gy.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?Gy.next.call(this):super.next()}prev(){return this.focused.editable?Gy.prev.call(this):super.prev()}async indicator(e,r){let o=e.indicator||"",a=e.editable?o:super.indicator(e,r);return await this.resolve(a,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?Gy.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let o=r.parent?this.value[r.parent.name]:this.value;if(r.editable?o=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(o=r.enabled===!0),e=await r.validate(o,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};Zhe.exports=z_});var _g=_((w8t,e0e)=>{"use strict";var Rft=jy(),Tft=G_(),{isPrimitive:Nft}=No(),J_=class extends Rft{constructor(e){super(e),this.initial=Nft(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let o=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!o||o.name!=="return")?this.append(`
|
||||
`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:o}=this.state;this.input=`${o}`.slice(0,r)+e+`${o}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),o=this.input.slice(e),a=r.split(" ");this.state.clipboard.push(a.pop()),this.input=a.join(" "),this.cursor=this.input.length,this.input+=o,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):Tft(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),o=await this.separator(),a=await this.message(),n=[r,a,o].filter(Boolean).join(" ");this.state.prompt=n;let u=await this.header(),A=await this.format(),p=await this.error()||await this.hint(),h=await this.footer();p&&!A.includes(p)&&(A+=" "+p),n+=" "+A,this.clear(e),this.write([u,n,h].filter(Boolean).join(`
|
||||
`)),this.restore()}};e0e.exports=J_});var r0e=_((I8t,t0e)=>{"use strict";var Lft=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),Zx=t=>Lft(t).filter(Boolean);t0e.exports=(t,e={},r="")=>{let{past:o=[],present:a=""}=e,n,u;switch(t){case"prev":case"undo":return n=o.slice(0,o.length-1),u=o[o.length-1]||"",{past:Zx([r,...n]),present:u};case"next":case"redo":return n=o.slice(1),u=o[0]||"",{past:Zx([...n,r]),present:u};case"save":return{past:Zx([...o,r]),present:""};case"remove":return u=Zx(o.filter(A=>A!==r)),a="",u.length&&(a=u.pop()),{past:u,present:a};default:throw new Error(`Invalid action: "${t}"`)}}});var Z_=_((B8t,i0e)=>{"use strict";var Mft=_g(),n0e=r0e(),X_=class extends Mft{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let o=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:o},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=n0e(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=n0e("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};i0e.exports=X_});var o0e=_((v8t,s0e)=>{"use strict";var Oft=_g(),$_=class extends Oft{format(){return""}};s0e.exports=$_});var l0e=_((D8t,a0e)=>{"use strict";var Uft=_g(),e8=class extends Uft{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};a0e.exports=e8});var u0e=_((P8t,c0e)=>{"use strict";var _ft=Ph(),t8=class extends _ft{constructor(e){super({...e,multiple:!0})}};c0e.exports=t8});var n8=_((S8t,A0e)=>{"use strict";var Hft=_g(),r8=class extends Hft{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,o=this.toNumber(this.input);return o>this.max+r?this.alert():(this.input=`${o+r}`,this.render())}down(e){let r=e||this.minor,o=this.toNumber(this.input);return o<this.min-r?this.alert():(this.input=`${o-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};A0e.exports=r8});var p0e=_((b8t,f0e)=>{f0e.exports=n8()});var g0e=_((x8t,h0e)=>{"use strict";var qft=_g(),i8=class extends qft{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};h0e.exports=i8});var y0e=_((k8t,m0e)=>{"use strict";var jft=zc(),Gft=V1(),d0e=No(),s8=class extends Gft{constructor(e={}){super(e),this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||"left"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||`
|
||||
`;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((o,a)=>({name:a+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let o=0;o<this.scale.length;o++)r.scale.push({index:o})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,o){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(o=>` ${o.name} - ${o.message}`)].map(o=>this.styles.muted(o)).join(`
|
||||
`)}renderScaleHeading(e){let r=this.scale.map(p=>p.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let o=this.scaleLength-r.join("").length,a=Math.round(o/(r.length-1)),u=r.map(p=>this.styles.strong(p)).join(" ".repeat(a)),A=" ".repeat(this.widths[0]);return this.margin[3]+A+this.margin[1]+u}scaleIndicator(e,r,o){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,o);let a=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let o=e.scale.map(n=>this.scaleIndicator(e,n,r)),a=this.term==="Hyper"?"":" ";return o.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let o=this.index===r,a=await this.pointer(e,r),n=await e.hint;n&&!d0e.hasColor(n)&&(n=this.styles.muted(n));let u=C=>this.margin[3]+C.replace(/\s+$/,"").padEnd(this.widths[0]," "),A=this.newline,p=this.indent(e),h=await this.resolve(e.message,this.state,e,r),E=await this.renderScale(e,r),I=this.margin[1]+this.margin[3];this.scaleLength=jft.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-I.length);let x=d0e.wordWrap(h,{width:this.widths[0],newline:A}).split(`
|
||||
`).map(C=>u(C)+this.margin[1]);return o&&(E=this.styles.info(E),x=x.map(C=>this.styles.info(C))),x[0]+=E,this.linebreak&&x.push(""),[p+a,x.join(`
|
||||
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(e),o=await this.renderScaleHeading();return this.margin[0]+[o,...r.map(a=>a.join(" "))].join(`
|
||||
`)}async render(){let{submitted:e,size:r}=this.state,o=await this.prefix(),a=await this.separator(),n=await this.message(),u="";this.options.promptLine!==!1&&(u=[o,n,a,""].join(" "),this.state.prompt=u);let A=await this.header(),p=await this.format(),h=await this.renderScaleKey(),E=await this.error()||await this.hint(),I=await this.renderChoices(),v=await this.footer(),x=this.emptyError;p&&(u+=p),E&&!u.includes(E)&&(u+=" "+E),e&&!p&&!I.trim()&&this.multiple&&x!=null&&(u+=this.styles.danger(x)),this.clear(r),this.write([A,u,h,I,v].filter(Boolean).join(`
|
||||
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};m0e.exports=s8});var w0e=_((Q8t,C0e)=>{"use strict";var E0e=zc(),Yft=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",a8=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=Yft(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},Wft=async(t={},e={},r=o=>o)=>{let o=new Set,a=t.fields||[],n=t.template,u=[],A=[],p=[],h=1;typeof n=="function"&&(n=await n());let E=-1,I=()=>n[++E],v=()=>n[E+1],x=C=>{C.line=h,u.push(C)};for(x({type:"bos",value:""});E<n.length-1;){let C=I();if(/^[^\S\n ]$/.test(C)){x({type:"text",value:C});continue}if(C===`
|
||||
`){x({type:"newline",value:C}),h++;continue}if(C==="\\"){C+=I(),x({type:"text",value:C});continue}if((C==="$"||C==="#"||C==="{")&&v()==="{"){let L=I();C+=L;let U={type:"template",open:C,inner:"",close:"",value:C},z;for(;z=I();){if(z==="}"){v()==="}"&&(z+=I()),U.value+=z,U.close=z;break}z===":"?(U.initial="",U.key=U.inner):U.initial!==void 0&&(U.initial+=z),U.value+=z,U.inner+=z}U.template=U.open+(U.initial||U.inner)+U.close,U.key=U.key||U.inner,e.hasOwnProperty(U.key)&&(U.initial=e[U.key]),U=r(U),x(U),p.push(U.key),o.add(U.key);let te=A.find(ae=>ae.name===U.key);U.field=a.find(ae=>ae.name===U.key),te||(te=new a8(U),A.push(te)),te.lines.push(U.line-1);continue}let R=u[u.length-1];R.type==="text"&&R.line===h?R.value+=C:x({type:"text",value:C})}return x({type:"eos",value:""}),{input:n,tabstops:u,unique:o,keys:p,items:A}};C0e.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),o={...e.values,...e.initial},{tabstops:a,items:n,keys:u}=await Wft(e,o),A=o8("result",t,e),p=o8("format",t,e),h=o8("validate",t,e,!0),E=t.isValue.bind(t);return async(I={},v=!1)=>{let x=0;I.required=r,I.items=n,I.keys=u,I.output="";let C=async(z,te,ae,le)=>{let ce=await h(z,te,ae,le);return ce===!1?"Invalid field "+ae.name:ce};for(let z of a){let te=z.value,ae=z.key;if(z.type!=="template"){te&&(I.output+=te);continue}if(z.type==="template"){let le=n.find(Ee=>Ee.name===ae);e.required===!0&&I.required.add(le.name);let ce=[le.input,I.values[le.value],le.value,te].find(E),de=(le.field||{}).message||z.inner;if(v){let Ee=await C(I.values[ae],I,le,x);if(Ee&&typeof Ee=="string"||Ee===!1){I.invalid.set(ae,Ee);continue}I.invalid.delete(ae);let g=await A(I.values[ae],I,le,x);I.output+=E0e.unstyle(g);continue}le.placeholder=!1;let Be=te;te=await p(te,I,le,x),ce!==te?(I.values[ae]=ce,te=t.styles.typing(ce),I.missing.delete(de)):(I.values[ae]=void 0,ce=`<${de}>`,te=t.styles.primary(ce),le.placeholder=!0,I.required.has(ae)&&I.missing.add(de)),I.missing.has(de)&&I.validating&&(te=t.styles.warning(ce)),I.invalid.has(ae)&&I.validating&&(te=t.styles.danger(ce)),x===I.index&&(Be!==te?te=t.styles.underline(te):te=t.styles.heading(E0e.unstyle(te))),x++}te&&(I.output+=te)}let R=I.output.split(`
|
||||
`).map(z=>" "+z),L=n.length,U=0;for(let z of n)I.invalid.has(z.name)&&z.lines.forEach(te=>{R[te][0]===" "&&(R[te]=I.styles.danger(I.symbols.bullet)+R[te].slice(1))}),t.isValue(I.values[z.name])&&U++;return I.completed=(U/L*100).toFixed(0),I.output=R.join(`
|
||||
`),I.output}};function o8(t,e,r,o){return(a,n,u,A)=>typeof u.field[t]=="function"?u.field[t].call(e,a,n,u,A):[o,a].find(p=>e.isValue(p))}});var B0e=_((F8t,I0e)=>{"use strict";var Kft=zc(),Vft=w0e(),zft=jy(),l8=class extends zft{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Vft(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let o=this.getItem(),a=o.input.slice(0,this.cursor),n=o.input.slice(this.cursor);this.input=o.input=`${a}${e}${n}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),o=e.input.slice(0,this.cursor-1);this.input=e.input=`${o}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:o,size:a}=this.state,n=[this.options.newline,`
|
||||
`].find(z=>z!=null),u=await this.prefix(),A=await this.separator(),p=await this.message(),h=[u,p,A].filter(Boolean).join(" ");this.state.prompt=h;let E=await this.header(),I=await this.error()||"",v=await this.hint()||"",x=o?"":await this.interpolate(this.state),C=this.state.key=r[e]||"",R=await this.format(C),L=await this.footer();R&&(h+=" "+R),v&&!R&&this.state.completed===0&&(h+=" "+v),this.clear(a);let U=[E,h,x,L,I.trim()];this.write(U.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:r,keys:o,index:a}=this.state,n=r.find(u=>u.name===o[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:o,values:a}=this.state;if(e.size){let A="";for(let[p,h]of e)A+=`Invalid ${p}: ${h}
|
||||
`;return this.state.error=A,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let u=Kft.unstyle(o).split(`
|
||||
`).map(A=>A.slice(1)).join(`
|
||||
`);return this.value={values:a,result:u},super.submit()}};I0e.exports=l8});var D0e=_((R8t,v0e)=>{"use strict";var Jft="(Use <shift>+<up/down> to sort)",Xft=Ph(),c8=class extends Xft{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,Jft].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let o=await super.renderChoice(e,r),a=this.symbols.identicalTo+" ",n=this.index===r&&this.sorting?this.styles.muted(a):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${r+1} - `+o:n+o}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};v0e.exports=c8});var S0e=_((T8t,P0e)=>{"use strict";var Zft=V1(),u8=class extends Zft{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(o=>this.styles.muted(o)),this.state.header=r.join(`
|
||||
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let o of r)o.scale=$ft(5,this.options),o.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],o=r.selected;return e.scale.forEach(a=>a.selected=!1),r.selected=!o,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,r){await this.onChoice(e,r);let o=this.index===r,a=this.term==="Hyper",n=a?9:8,u=a?"":" ",A=this.symbols.line.repeat(n),p=" ".repeat(n+(a?0:1)),h=te=>(te?this.styles.success("\u25C9"):"\u25EF")+u,E=r+1+".",I=o?this.styles.heading:this.styles.noop,v=await this.resolve(e.message,this.state,e,r),x=this.indent(e),C=x+e.scale.map((te,ae)=>h(ae===e.scaleIdx)).join(A),R=te=>te===e.scaleIdx?I(te):te,L=x+e.scale.map((te,ae)=>R(ae)).join(p),U=()=>[E,v].filter(Boolean).join(" "),z=()=>[U(),C,L," "].filter(Boolean).join(`
|
||||
`);return o&&(C=this.styles.cyan(C),L=this.styles.cyan(L)),z()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(o,a)=>await this.renderChoice(o,a)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
|
||||
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=this.state,o=await this.prefix(),a=await this.separator(),n=await this.message(),u=[o,n,a].filter(Boolean).join(" ");this.state.prompt=u;let A=await this.header(),p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),I=await this.footer();(p||!h)&&(u+=" "+p),h&&!u.includes(h)&&(u+=" "+h),e&&!p&&!E&&this.multiple&&this.type!=="form"&&(u+=this.styles.danger(this.emptyError)),this.clear(r),this.write([u,A,E,I].filter(Boolean).join(`
|
||||
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function $ft(t,e={}){if(Array.isArray(e.scale))return e.scale.map(o=>({...o}));let r=[];for(let o=1;o<t+1;o++)r.push({i:o,selected:!1});return r}P0e.exports=u8});var x0e=_((N8t,b0e)=>{b0e.exports=Z_()});var Q0e=_((L8t,k0e)=>{"use strict";var ept=Xx(),A8=class extends ept{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",r){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=o=>this.styles.primary.underline(o);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,r=await this.header(),o=await this.prefix(),a=await this.separator(),n=await this.message(),u=await this.format(),A=await this.error()||await this.hint(),p=await this.footer(),h=[o,n,a,u].join(" ");this.state.prompt=h,A&&!h.includes(A)&&(h+=" "+A),this.clear(e),this.write([r,h,p].filter(Boolean).join(`
|
||||
`)),this.write(this.margin[2]),this.restore()}};k0e.exports=A8});var R0e=_((M8t,F0e)=>{"use strict";var tpt=Ph(),f8=class extends tpt{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,r){let o=await super.toChoices(e,r);if(o.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>o.length)throw new Error("Please specify the index of the correct answer from the list of choices");return o}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};F0e.exports=f8});var N0e=_(p8=>{"use strict";var T0e=No(),ps=(t,e)=>{T0e.defineExport(p8,t,e),T0e.defineExport(p8,t.toLowerCase(),e)};ps("AutoComplete",()=>Hhe());ps("BasicAuth",()=>Vhe());ps("Confirm",()=>Xhe());ps("Editable",()=>$he());ps("Form",()=>Jx());ps("Input",()=>Z_());ps("Invisible",()=>o0e());ps("List",()=>l0e());ps("MultiSelect",()=>u0e());ps("Numeral",()=>p0e());ps("Password",()=>g0e());ps("Scale",()=>y0e());ps("Select",()=>Ph());ps("Snippet",()=>B0e());ps("Sort",()=>D0e());ps("Survey",()=>S0e());ps("Text",()=>x0e());ps("Toggle",()=>Q0e());ps("Quiz",()=>R0e())});var M0e=_((U8t,L0e)=>{L0e.exports={ArrayPrompt:V1(),AuthPrompt:W_(),BooleanPrompt:Xx(),NumberPrompt:n8(),StringPrompt:_g()}});var J1=_((_8t,U0e)=>{"use strict";var O0e=ve("assert"),g8=ve("events"),Sh=No(),Xc=class extends g8{constructor(e,r){super(),this.options=Sh.merge({},e),this.answers={...r}}register(e,r){if(Sh.isObject(e)){for(let a of Object.keys(e))this.register(a,e[a]);return this}O0e.equal(typeof r,"function","expected a function");let o=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[o]=r:this.prompts[o]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(Sh.merge({},this.options,r))}catch(o){return Promise.reject(o)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=Sh.merge({},this.options,e),{type:o,name:a}=e,{set:n,get:u}=Sh;if(typeof o=="function"&&(o=await o.call(this,e,this.answers)),!o)return this.answers[a];O0e(this.prompts[o],`Prompt "${o}" is not registered`);let A=new this.prompts[o](r),p=u(this.answers,a);A.state.answers=this.answers,A.enquirer=this,a&&A.on("submit",E=>{this.emit("answer",a,E,A),n(this.answers,a,E)});let h=A.emit.bind(A);return A.emit=(...E)=>(this.emit.call(this,...E),h(...E)),this.emit("prompt",A,this),r.autofill&&p!=null?(A.value=A.input=p,r.autofill==="show"&&await A.submit()):p=A.value=await A.run(),p}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||jy()}static get prompts(){return N0e()}static get types(){return M0e()}static get prompt(){let e=(r,...o)=>{let a=new this(...o),n=a.emit.bind(a);return a.emit=(...u)=>(e.emit(...u),n(...u)),a.prompt(r)};return Sh.mixinEmitter(e,new g8),e}};Sh.mixinEmitter(Xc,new g8);var h8=Xc.prompts;for(let t of Object.keys(h8)){let e=t.toLowerCase(),r=o=>new h8[t](o).run();Xc.prompt[e]=r,Xc[e]=r,Xc[t]||Reflect.defineProperty(Xc,t,{get:()=>h8[t]})}var z1=t=>{Sh.defineExport(Xc,t,()=>Xc.types[t])};z1("ArrayPrompt");z1("AuthPrompt");z1("BooleanPrompt");z1("NumberPrompt");z1("StringPrompt");U0e.exports=Xc});var e2=_((IHt,W0e)=>{var apt=Ux();function lpt(t,e,r){var o=t==null?void 0:apt(t,e);return o===void 0?r:o}W0e.exports=lpt});var z0e=_((bHt,V0e)=>{function cpt(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}V0e.exports=cpt});var X0e=_((xHt,J0e)=>{var upt=Ag(),Apt=LP();function fpt(t,e){return t&&upt(e,Apt(e),t)}J0e.exports=fpt});var $0e=_((kHt,Z0e)=>{var ppt=Ag(),hpt=Sm();function gpt(t,e){return t&&ppt(e,hpt(e),t)}Z0e.exports=gpt});var tge=_((QHt,ege)=>{var dpt=Ag(),mpt=kP();function ypt(t,e){return dpt(t,mpt(t),e)}ege.exports=ypt});var w8=_((FHt,rge)=>{var Ept=xP(),Cpt=HP(),wpt=kP(),Ipt=MN(),Bpt=Object.getOwnPropertySymbols,vpt=Bpt?function(t){for(var e=[];t;)Ept(e,wpt(t)),t=Cpt(t);return e}:Ipt;rge.exports=vpt});var ige=_((RHt,nge)=>{var Dpt=Ag(),Ppt=w8();function Spt(t,e){return Dpt(t,Ppt(t),e)}nge.exports=Spt});var I8=_((THt,sge)=>{var bpt=LN(),xpt=w8(),kpt=Sm();function Qpt(t){return bpt(t,kpt,xpt)}sge.exports=Qpt});var age=_((NHt,oge)=>{var Fpt=Object.prototype,Rpt=Fpt.hasOwnProperty;function Tpt(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Rpt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}oge.exports=Tpt});var cge=_((LHt,lge)=>{var Npt=UP();function Lpt(t,e){var r=e?Npt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}lge.exports=Lpt});var Age=_((MHt,uge)=
Line truncated
|
||||
${z} at ${te}`:`
|
||||
${z}`}).join("");h.push({text:`Conflict detected in constraint targeting ${pe.pretty(t.configuration,x,pe.Type.CODE)}; conflicting values are:${R}`,fixable:!1})}else{let[[R]]=C,L=(0,qde.default)(v,x);if(JSON.stringify(L)===JSON.stringify(R))continue;if(!o){let U=typeof L>"u"?`Missing field ${pe.pretty(t.configuration,x,pe.Type.CODE)}; expected ${pe.pretty(t.configuration,R,pe.Type.INSPECT)}`:typeof R>"u"?`Extraneous field ${pe.pretty(t.configuration,x,pe.Type.CODE)} currently set to ${pe.pretty(t.configuration,L,pe.Type.INSPECT)}`:`Invalid field ${pe.pretty(t.configuration,x,pe.Type.CODE)}; expected ${pe.pretty(t.configuration,R,pe.Type.INSPECT)}, found ${pe.pretty(t.configuration,L,pe.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof R>"u"?(0,Yde.default)(v,x):(0,jde.default)(v,x,R),E=!0}E&&a.set(I,v)}h.length>0&&n.set(I,h)}return{changedWorkspaces:a,remainingErrors:n}}function Wde(t,{configuration:e}){let r={children:[]};for(let[o,a]of t){let n=[];for(let A of a){let p=A.text.split(/\n/);A.fixable&&(p[0]=`${pe.pretty(e,"\u2699","gray")} ${p[0]}`),n.push({value:pe.tuple(pe.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:pe.tuple(pe.Type.NO_HINT,h)}))})}let u={value:pe.tuple(pe.Type.LOCATOR,o.anchoredLocator),children:He.sortMap(n,A=>A.value[1])};r.children.push(u)}return r.children=He.sortMap(r.children,o=>o.value[1]),r}var qde,jde,Gde,Yde,QE,jgt,Ggt,Ygt,l2=Et(()=>{Ge();qde=Ze(e2()),jde=Ze(D8()),Gde=Ze(Hde()),Yde=Ze(b8()),QE=class{constructor(e){this.indexedFields=e;this.items=[];this.indexes={};this.clear()}clear(){this.items=[];for(let e of this.indexedFields)this.indexes[e]=new Map}insert(e){this.items.push(e);for(let r of this.indexedFields){let o=Object.hasOwn(e,r)?e[r]:void 0;if(typeof o>"u")continue;He.getArrayWithDefault(this.indexes[r],o).push(e)}return e}find(e){if(typeof e>"u")return this.items;let r=Object.entries(e);if(r.length===0)return this.items;let o=[],a;for(let[u,A]of r){let p=u,h=Object.hasOwn(this.indexes,p)?this.indexes[p]:void 0;if(typeof h>"u"){o.push([p,A]);continue}let E=new Set(h.get(A)??[]);if(E.size===0)return[];if(typeof a>"u")a=E;else for(let I of a)E.has(I)||a.delete(I);if(a.size===0)break}let n=[...a??[]];return o.length>0&&(n=n.filter(u=>{for(let[A,p]of o)if(!(typeof p<"u"?Object.hasOwn(u,A)&&u[A]===p:Object.hasOwn(u,A)===!1))return!1;return!0})),n}},jgt=/^[0-9]+$/,Ggt=/^[a-zA-Z0-9_]+$/,Ygt=new Set(["scripts",...Ut.allDependencies])});var Kde=_((s7t,$8)=>{var Vgt;(function(t){var e=function(){return{"append/2":[new t.type.Rule(new t.type.Term("append",[new t.type.Var("X"),new t.type.Var("L")]),new t.type.Term("foldl",[new t.type.Term("append",[]),new t.type.Var("X"),new t.type.Term("[]",[]),new t.type.Var("L")]))],"append/3":[new t.type.Rule(new t.type.Term("append",[new t.type.Term("[]",[]),new t.type.Var("X"),new t.type.Var("X")]),null),new t.type.Rule(new t.type.Term("append",[new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("S")])]),new t.type.Term("append",[new t.type.Var("T"),new t.type.Var("X"),new t.type.Var("S")]))],"member/2":[new t.type.Rule(new t.type.Term("member",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("_")])]),null),new t.type.Rule(new t.type.Term("member",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("_"),new t.type.Var("Xs")])]),new t.type.Term("member",[new t.type.Var("X"),new t.type.Var("Xs")]))],"permutation/2":[new t.type.Rule(new t.type.Term("permutation",[new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("permutation",[new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("permutation",[new t.type.Var("T"),new t.type.Var("P")]),new t.type.Term(",",[new t.type.Term("append",[new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("P")]),new t.type.Term("append",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("Y")]),new t.type.Var("S")])])]))],"maplist/2":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("X")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("Xs")])]))],"maplist/3":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("A"),new t.type.Var("As")]),new t.type.Term(".",[new t.type.Var("B"),new t.type.Var("Bs")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("A"),new t.type.Var("B")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("As"),new t.type.Var("Bs")])]))],"maplist/4":
Line truncated
|
||||
`+p:"")),u.error.method="_execFileSync",u.error.program=a,u.error.args=n,u.error.extMessage=p,u.error.exitCode=+A),Yn.unlinkSync(h),Yn.unlinkSync(E),Yn.unlinkSync(I),Yn.unlinkSync(v),u}function Zgt(t){var e,r={},o,a={env:process.env,encoding:t.encoding};if(xh||(jg?process.env.PSModulePath?(xh="powershell.exe",ok=["-ExecutionPolicy","Bypass","-File",__dirname+"\\read.ps1"]):(xh="cscript.exe",ok=["//nologo",__dirname+"\\read.cs.js"]):(xh="/bin/sh",ok=[__dirname+"/read.sh"])),jg&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),rH.execFileSync){e=Zde(t),c2&&c2("execFileSync",e);try{r.input=rH.execFileSync(xh,e,a)}catch(n){o=n.stderr?(n.stderr+"").trim():"",r.error=new Error(Jde+(o?`
|
||||
`+o:"")),r.error.method="execFileSync",r.error.program=xh,r.error.args=e,r.error.extMessage=o,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=Xgt(t,a);return r.error||(r.input=r.input.replace(/^\s*'|'\s*$/g,""),t.display=""),r}function sH(t){var e="",r=t.display,o=!t.display&&t.keyIn&&t.hideEchoBack&&!t.mask;function a(){var n=Zgt(t);if(n.error)throw n.error;return n.input}return iH&&iH(t),function(){var n,u,A;function p(){return n||(n=process.binding("fs"),u=process.binding("constants")),n}if(typeof Wf=="string")if(Wf=null,jg){if(A=function(h){var E=h.replace(/^\D+/,"").split("."),I=0;return(E[0]=+E[0])&&(I+=E[0]*1e4),(E[1]=+E[1])&&(I+=E[1]*100),(E[2]=+E[2])&&(I+=E[2]),I}(process.version),!(A>=20302&&A<40204||A>=5e4&&A<50100||A>=50600&&A<60200)&&process.stdin.isTTY)process.stdin.pause(),Wf=process.stdin.fd,RE=process.stdin._handle;else try{Wf=p().open("CONIN$",u.O_RDWR,parseInt("0666",8)),RE=new Vde(Wf,!0)}catch{}if(process.stdout.isTTY)$c=process.stdout.fd;else{try{$c=Yn.openSync("\\\\.\\CON","w")}catch{}if(typeof $c!="number")try{$c=p().open("CONOUT$",u.O_RDWR,parseInt("0666",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{Wf=Yn.openSync("/dev/tty","r"),RE=process.stdin._handle}catch{}}else try{Wf=Yn.openSync("/dev/tty","r"),RE=new Vde(Wf,!1)}catch{}if(process.stdout.isTTY)$c=process.stdout.fd;else try{$c=Yn.openSync("/dev/tty","w")}catch{}}}(),function(){var n,u,A=!t.hideEchoBack&&!t.keyIn,p,h,E,I,v;ak="";function x(C){return C===zde?!0:RE.setRawMode(C)!==0?!1:(zde=C,!0)}if(Xde||!RE||typeof $c!="number"&&(t.display||!A)){e=a();return}if(t.display&&(Yn.writeSync($c,t.display),t.display=""),!t.displayOnly){if(!x(!A)){e=a();return}for(h=t.keyIn?1:t.bufferSize,p=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(h):new Buffer(h),t.keyIn&&t.limit&&(u=new RegExp("[^"+t.limit+"]","g"+(t.caseSensitive?"":"i")));;){E=0;try{E=Yn.readSync(Wf,p,0,h)}catch(C){if(C.code!=="EOF"){x(!1),e+=a();return}}if(E>0?(I=p.toString(t.encoding,0,E),ak+=I):(I=`
|
||||
`,ak+="\0"),I&&typeof(v=(I.match(/^(.*?)[\r\n]/)||[])[1])=="string"&&(I=v,n=!0),I&&(I=I.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")),I&&u&&(I=I.replace(u,"")),I&&(A||(t.hideEchoBack?t.mask&&Yn.writeSync($c,new Array(I.length+1).join(t.mask)):Yn.writeSync($c,I)),e+=I),!t.keyIn&&n||t.keyIn&&e.length>=h)break}!A&&!o&&Yn.writeSync($c,`
|
||||
`),x(!1)}}(),t.print&&!o&&t.print(r+(t.displayOnly?"":(t.hideEchoBack?new Array(e.length+1).join(t.mask):e)+`
|
||||
`),t.encoding),t.displayOnly?"":lH=t.keepWhitespace||t.keyIn?e:e.trim()}function $gt(t,e){var r=[];function o(a){a!=null&&(Array.isArray(a)?a.forEach(o):(!e||e(a))&&r.push(a))}return o(t),r}function cH(t){return t.replace(/[\x00-\x7f]/g,function(e){return"\\x"+("00"+e.charCodeAt().toString(16)).substr(-2)})}function Ns(){var t=Array.prototype.slice.call(arguments),e,r;return t.length&&typeof t[0]=="boolean"&&(r=t.shift(),r&&(e=Object.keys(nH),t.unshift(nH))),t.reduce(function(o,a){return a==null||(a.hasOwnProperty("noEchoBack")&&!a.hasOwnProperty("hideEchoBack")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty("noTrim")&&!a.hasOwnProperty("keepWhitespace")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(e=Object.keys(a)),e.forEach(function(n){var u;if(a.hasOwnProperty(n))switch(u=a[n],n){case"mask":case"limitMessage":case"defaultInput":case"encoding":u=u!=null?u+"":"",u&&n!=="limitMessage"&&(u=u.replace(/[\r\n]/g,"")),o[n]=u;break;case"bufferSize":!isNaN(u=parseInt(u,10))&&typeof u=="number"&&(o[n]=u);break;case"displayOnly":case"keyIn":case"hideEchoBack":case"caseSensitive":case"keepWhitespace":case"history":case"cd":o[n]=!!u;break;case"limit":case"trueValue":case"falseValue":o[n]=$gt(u,function(A){var p=typeof A;return p==="string"||p==="number"||p==="function"||A instanceof RegExp}).map(function(A){return typeof A=="string"?A.replace(/[\r\n]/g,""):A});break;case"print":case"phContent":case"preCheck":o[n]=typeof u=="function"?u:void 0;break;case"prompt":case"display":o[n]=u??"";break}})),o},{})}function oH(t,e,r){return e.some(function(o){var a=typeof o;return a==="string"?r?t===o:t.toLowerCase()===o.toLowerCase():a==="number"?parseFloat(t)===o:a==="function"?o(t):o instanceof RegExp?o.test(t):!1})}function uH(t,e){var r=kh.normalize(jg?(process.env.HOMEDRIVE||"")+(process.env.HOMEPATH||""):process.env.HOME||"").replace(/[\/\\]+$/,"");return t=kh.normalize(t),e?t.replace(/^~(?=\/|\\|$)/,r):t.replace(new RegExp("^"+cH(r)+"(?=\\/|\\\\|$)",jg?"i":""),"~")}function TE(t,e){var r="(?:\\(([\\s\\S]*?)\\))?(\\w+|.-.)(?:\\(([\\s\\S]*?)\\))?",o=new RegExp("(\\$)?(\\$<"+r+">)","g"),a=new RegExp("(\\$)?(\\$\\{"+r+"\\})","g");function n(u,A,p,h,E,I){var v;return A||typeof(v=e(E))!="string"?p:v?(h||"")+v+(I||""):""}return t.replace(o,n).replace(a,n)}function $de(t,e,r){var o,a=[],n=-1,u=0,A="",p;function h(E,I){return I.length>3?(E.push(I[0]+"..."+I[I.length-1]),p=!0):I.length&&(E=E.concat(I)),E}return o=t.reduce(function(E,I){return E.concat((I+"").split(""))},[]).reduce(function(E,I){var v,x;return e||(I=I.toLowerCase()),v=/^\d$/.test(I)?1:/^[A-Z]$/.test(I)?2:/^[a-z]$/.test(I)?3:0,r&&v===0?A+=I:(x=I.charCodeAt(0),v&&v===n&&x===u+1?a.push(I):(E=h(E,a),a=[I],n=v),u=x),E},[]),o=h(o,a),A&&(o.push(A),p=!0),{values:o,suppressed:p}}function eme(t,e){return t.join(t.length>2?", ":e?" / ":"/")}function tme(t,e){var r,o,a={},n;if(e.phContent&&(r=e.phContent(t,e)),typeof r!="string")switch(t){case"hideEchoBack":case"mask":case"defaultInput":case"caseSensitive":case"keepWhitespace":case"encoding":case"bufferSize":case"history":case"cd":r=e.hasOwnProperty(t)?typeof e[t]=="boolean"?e[t]?"on":"off":e[t]+"":"";break;case"limit":case"trueValue":case"falseValue":o=e[e.hasOwnProperty(t+"Src")?t+"Src":t],e.keyIn?(a=$de(o,e.caseSensitive),o=a.values):o=o.filter(function(u){var A=typeof u;return A==="string"||A==="number"}),r=eme(o,a.suppressed);break;case"limitCount":case"limitCountNotZero":r=e[e.hasOwnProperty("limitSrc")?"limitSrc":"limit"].length,r=r||t!=="limitCountNotZero"?r+"":"";break;case"lastInput":r=lH;break;case"cwd":case"CWD":case"cwdHome":r=process.cwd(),t==="CWD"?r=kh.basename(r):t==="cwdHome"&&(r=uH(r));break;case"date":case"time":case"localeDate":case"localeTime":r=new Date()["to"+t.replace(/^./,function(u){return u.toUpperCase()})+"String"]();break;default:typeof(n=(t.match(/^history_m(\d+)$/)||[])[1])=="string"&&(r=qg[qg.length-n]||"")}return r}function rme(t){var e=/^(.)-(.)$/.exec(t),r="",o,a,n,u;if(!e)return null;for(o=e[1].charCodeAt(0),a=e[2].charCodeAt(0),u=o<a?1:-1,n=o;n!==a+u;n+=u)r+=String.fromCharCode(n);return r}function aH(t){var e=new RegExp(/(\s*)(?:("|')(.*?)(?:\2|$)|(\S+))/g),r,o="",a=[],n;for(t=t.trim();r=e.exec(t);)n=r[3]||r[4]||"",r[1]&&(a.push(o),o=""),o+=n;return o&&a.push(o),a}function nme(t,e){return e.trueValue.length&&oH(t,e.trueValue,e.caseSensitive)?!0:e.falseValue.length&&oH(t,e.falseValue,e.caseSensitive)?!1:t}function ime(t){var e,r,o,a,n,u,A;function p(E){return tme(E,t)}function h(E){t.display+=(/[^\r\n]$/.test(t.display)?`
|
||||
`:"")+E}for(t.limitSrc=t.limit,t.displaySrc=t.display,t.limit="",t.display=TE(t.display+"",p);;){if(e=sH(t),r=!1,o="",t.defaultInput&&!e&&(e=t.defaultInput),t.history&&((a=/^\s*\!(?:\!|-1)(:p)?\s*$/.exec(e))?(n=qg[0]||"",a[1]?r=!0:e=n,h(n+`
|
||||
`),r||(t.displayOnly=!0,sH(t),t.displayOnly=!1)):e&&e!==qg[qg.length-1]&&(qg=[e])),!r&&t.cd&&e)switch(u=aH(e),u[0].toLowerCase()){case"cd":if(u[1])try{process.chdir(uH(u[1],!0))}catch(E){h(E+"")}r=!0;break;case"pwd":h(process.cwd()),r=!0;break}if(!r&&t.preCheck&&(A=t.preCheck(e,t),e=A.res,A.forceNext&&(r=!0)),!r){if(!t.limitSrc.length||oH(e,t.limitSrc,t.caseSensitive))break;t.limitMessage&&(o=TE(t.limitMessage,p))}h((o?o+`
|
||||
`:"")+TE(t.displaySrc+"",p))}return nme(e,t)}Wr._DBG_set_useExt=function(t){Xde=t};Wr._DBG_set_checkOptions=function(t){iH=t};Wr._DBG_set_checkMethod=function(t){c2=t};Wr._DBG_clearHistory=function(){lH="",qg=[]};Wr.setDefaultOptions=function(t){return nH=Ns(!0,t),Ns(!0)};Wr.question=function(t,e){return ime(Ns(Ns(!0,e),{display:t}))};Wr.prompt=function(t){var e=Ns(!0,t);return e.display=e.prompt,ime(e)};Wr.keyIn=function(t,e){var r=Ns(Ns(!0,e),{display:t,keyIn:!0,keepWhitespace:!0});return r.limitSrc=r.limit.filter(function(o){var a=typeof o;return a==="string"||a==="number"}).map(function(o){return TE(o+"",rme)}),r.limit=cH(r.limitSrc.join("")),["trueValue","falseValue"].forEach(function(o){r[o]=r[o].reduce(function(a,n){var u=typeof n;return u==="string"||u==="number"?a=a.concat((n+"").split("")):a.push(n),a},[])}),r.display=TE(r.display+"",function(o){return tme(o,r)}),nme(sH(r),r)};Wr.questionEMail=function(t,e){return t==null&&(t="Input e-mail address: "),Wr.question(t,Ns({hideEchoBack:!1,limit:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,limitMessage:"Input valid e-mail address, please.",trueValue:null,falseValue:null},e,{keepWhitespace:!1,cd:!1}))};Wr.questionNewPassword=function(t,e){var r,o,a,n=Ns({hideEchoBack:!0,mask:"*",limitMessage:`It can include: $<charlist>
|
||||
And the length must be: $<length>`,trueValue:null,falseValue:null,caseSensitive:!0},e,{history:!1,cd:!1,phContent:function(x){return x==="charlist"?r.text:x==="length"?o+"..."+a:null}}),u,A,p,h,E,I,v;for(e=e||{},u=TE(e.charlist?e.charlist+"":"$<!-~>",rme),(isNaN(o=parseInt(e.min,10))||typeof o!="number")&&(o=12),(isNaN(a=parseInt(e.max,10))||typeof a!="number")&&(a=24),h=new RegExp("^["+cH(u)+"]{"+o+","+a+"}$"),r=$de([u],n.caseSensitive,!0),r.text=eme(r.values,r.suppressed),A=e.confirmMessage!=null?e.confirmMessage:"Reinput a same one to confirm it: ",p=e.unmatchMessage!=null?e.unmatchMessage:"It differs from first one. Hit only the Enter key if you want to retry from first one.",t==null&&(t="Input new password: "),E=n.limitMessage;!v;)n.limit=h,n.limitMessage=E,I=Wr.question(t,n),n.limit=[I,""],n.limitMessage=p,v=Wr.question(A,n);return I};function sme(t,e,r){var o;function a(n){return o=r(n),!isNaN(o)&&typeof o=="number"}return Wr.question(t,Ns({limitMessage:"Input valid number, please."},e,{limit:a,cd:!1})),o}Wr.questionInt=function(t,e){return sme(t,e,function(r){return parseInt(r,10)})};Wr.questionFloat=function(t,e){return sme(t,e,parseFloat)};Wr.questionPath=function(t,e){var r,o="",a=Ns({hideEchoBack:!1,limitMessage:`$<error(
|
||||
)>Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},e,{keepWhitespace:!1,limit:function(n){var u,A,p;n=uH(n,!0),o="";function h(E){E.split(/\/|\\/).reduce(function(I,v){var x=kh.resolve(I+=v+kh.sep);if(!Yn.existsSync(x))Yn.mkdirSync(x);else if(!Yn.statSync(x).isDirectory())throw new Error("Non directory already exists: "+x);return I},"")}try{if(u=Yn.existsSync(n),r=u?Yn.realpathSync(n):kh.resolve(n),!e.hasOwnProperty("exists")&&!u||typeof e.exists=="boolean"&&e.exists!==u)return o=(u?"Already exists":"No such file or directory")+": "+r,!1;if(!u&&e.create&&(e.isDirectory?h(r):(h(kh.dirname(r)),Yn.closeSync(Yn.openSync(r,"w"))),r=Yn.realpathSync(r)),u&&(e.min||e.max||e.isFile||e.isDirectory)){if(A=Yn.statSync(r),e.isFile&&!A.isFile())return o="Not file: "+r,!1;if(e.isDirectory&&!A.isDirectory())return o="Not directory: "+r,!1;if(e.min&&A.size<+e.min||e.max&&A.size>+e.max)return o="Size "+A.size+" is out of range: "+r,!1}if(typeof e.validate=="function"&&(p=e.validate(r))!==!0)return typeof p=="string"&&(o=p),!1}catch(E){return o=E+"",!1}return!0},phContent:function(n){return n==="error"?o:n!=="min"&&n!=="max"?null:e.hasOwnProperty(n)?e[n]+"":""}});return e=e||{},t==null&&(t='Input path (you can "cd" and "pwd"): '),Wr.question(t,a),r};function ome(t,e){var r={},o={};return typeof t=="object"?(Object.keys(t).forEach(function(a){typeof t[a]=="function"&&(o[e.caseSensitive?a:a.toLowerCase()]=t[a])}),r.preCheck=function(a){var n;return r.args=aH(a),n=r.args[0]||"",e.caseSensitive||(n=n.toLowerCase()),r.hRes=n!=="_"&&o.hasOwnProperty(n)?o[n].apply(a,r.args.slice(1)):o.hasOwnProperty("_")?o._.apply(a,r.args):null,{res:a,forceNext:!1}},o.hasOwnProperty("_")||(r.limit=function(){var a=r.args[0]||"";return e.caseSensitive||(a=a.toLowerCase()),o.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=aH(a),r.hRes=typeof t=="function"?t.apply(a,r.args):!0,{res:a,forceNext:!1}},r}Wr.promptCL=function(t,e){var r=Ns({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),o=ome(t,r);return r.limit=o.limit,r.preCheck=o.preCheck,Wr.prompt(r),o.args};Wr.promptLoop=function(t,e){for(var r=Ns({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},e);!t(Wr.prompt(r)););};Wr.promptCLLoop=function(t,e){var r=Ns({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),o=ome(t,r);for(r.limit=o.limit,r.preCheck=o.preCheck;Wr.prompt(r),!o.hRes;);};Wr.promptSimShell=function(t){return Wr.prompt(Ns({hideEchoBack:!1,history:!0},t,{prompt:function(){return jg?"$<cwd>>":(process.env.USER||"")+(process.env.HOSTNAME?"@"+process.env.HOSTNAME.replace(/\..*$/,""):"")+":$<cwdHome>$ "}()}))};function ame(t,e,r){var o;return t==null&&(t="Are you sure? "),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s*:?\s*$/,"")+" [y/n]: "),o=Wr.keyIn(t,Ns(e,{hideEchoBack:!1,limit:r,trueValue:"y",falseValue:"n",caseSensitive:!1})),typeof o=="boolean"?o:""}Wr.keyInYN=function(t,e){return ame(t,e)};Wr.keyInYNStrict=function(t,e){return ame(t,e,"yn")};Wr.keyInPause=function(t,e){t==null&&(t="Continue..."),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s+$/,"")+" (Hit any key)"),Wr.keyIn(t,Ns({limit:null},e,{hideEchoBack:!0,mask:""}))};Wr.keyInSelect=function(t,e,r){var o=Ns({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(p){return p==="itemsCount"?t.length+"":p==="firstItem"?(t[0]+"").trim():p==="lastItem"?(t[t.length-1]+"").trim():null}}),a="",n={},u=49,A=`
|
||||
`;if(!Array.isArray(t)||!t.length||t.length>35)throw"`items` must be Array (max length: 35).";return t.forEach(function(p,h){var E=String.fromCharCode(u);a+=E,n[E]=h,A+="["+E+"] "+(p+"").trim()+`
|
||||
`,u=u===57?97:u+1}),(!r||r.cancel!==!1)&&(a+="0",n[0]=-1,A+="[0] "+(r&&r.cancel!=null&&typeof r.cancel!="boolean"?(r.cancel+"").trim():"CANCEL")+`
|
||||
`),o.limit=a,A+=`
|
||||
`,e==null&&(e="Choose one from list: "),(e+="")&&((!r||r.guide!==!1)&&(e=e.replace(/\s*:?\s*$/,"")+" [$<limit>]: "),A+=e),n[Wr.keyIn(A,o).toLowerCase()]};Wr.getRawInput=function(){return ak};function u2(t,e){var r;return e.length&&(r={},r[t]=e[0]),Wr.setDefaultOptions(r)[t]}Wr.setPrint=function(){return u2("print",arguments)};Wr.setPrompt=function(){return u2("prompt",arguments)};Wr.setEncoding=function(){return u2("encoding",arguments)};Wr.setMask=function(){return u2("mask",arguments)};Wr.setBufferSize=function(){return u2("bufferSize",arguments)}});var AH=_((a7t,gl)=>{(function(){var t={major:0,minor:2,patch:66,status:"beta"};tau_file_system={files:{},open:function(w,S,y){var F=tau_file_system.files[w];if(!F){if(y==="read")return null;F={path:w,text:"",type:S,get:function(J,X){return X===this.text.length||X>this.text.length?"end_of_file":this.text.substring(X,X+J)},put:function(J,X){return X==="end_of_file"?(this.text+=J,!0):X==="past_end_of_file"?null:(this.text=this.text.substring(0,X)+J+this.text.substring(X+J.length),!0)},get_byte:function(J){if(J==="end_of_stream")return-1;var X=Math.floor(J/2);if(this.text.length<=X)return-1;var $=n(this.text[Math.floor(J/2)],0);return J%2===0?$&255:$/256>>>0},put_byte:function(J,X){var $=X==="end_of_stream"?this.text.length:Math.floor(X/2);if(this.text.length<$)return null;var ie=this.text.length===$?-1:n(this.text[Math.floor(X/2)],0);return X%2===0?(ie=ie/256>>>0,ie=(ie&255)<<8|J&255):(ie=ie&255,ie=(J&255)<<8|ie&255),this.text.length===$?this.text+=u(ie):this.text=this.text.substring(0,$)+u(ie)+this.text.substring($+1),!0},flush:function(){return!0},close:function(){var J=tau_file_system.files[this.path];return J?!0:null}},tau_file_system.files[w]=F}return y==="write"&&(F.text=""),F}},tau_user_input={buffer:"",get:function(w,S){for(var y;tau_user_input.buffer.length<w;)y=window.prompt(),y&&(tau_user_input.buffer+=y);return y=tau_user_input.buffer.substr(0,w),tau_user_input.buffer=tau_user_input.buffer.substr(w),y}},tau_user_output={put:function(w,S){return console.log(w),!0},flush:function(){return!0}},nodejs_file_system={open:function(w,S,y){var F=ve("fs"),J=F.openSync(w,y[0]);return y==="read"&&!F.existsSync(w)?null:{get:function(X,$){var ie=new Buffer(X);return F.readSync(J,ie,0,X,$),ie.toString()},put:function(X,$){var ie=Buffer.from(X);if($==="end_of_file")F.writeSync(J,ie);else{if($==="past_end_of_file")return null;F.writeSync(J,ie,0,ie.length,$)}return!0},get_byte:function(X){return null},put_byte:function(X,$){return null},flush:function(){return!0},close:function(){return F.closeSync(J),!0}}}},nodejs_user_input={buffer:"",get:function(w,S){for(var y,F=lme();nodejs_user_input.buffer.length<w;)nodejs_user_input.buffer+=F.question();return y=nodejs_user_input.buffer.substr(0,w),nodejs_user_input.buffer=nodejs_user_input.buffer.substr(w),y}},nodejs_user_output={put:function(w,S){return process.stdout.write(w),!0},flush:function(){return!0}};var e;Array.prototype.indexOf?e=function(w,S){return w.indexOf(S)}:e=function(w,S){for(var y=w.length,F=0;F<y;F++)if(S===w[F])return F;return-1};var r=function(w,S){if(w.length!==0){for(var y=w[0],F=w.length,J=1;J<F;J++)y=S(y,w[J]);return y}},o;Array.prototype.map?o=function(w,S){return w.map(S)}:o=function(w,S){for(var y=[],F=w.length,J=0;J<F;J++)y.push(S(w[J]));return y};var a;Array.prototype.filter?a=function(w,S){return w.filter(S)}:a=function(w,S){for(var y=[],F=w.length,J=0;J<F;J++)S(w[J])&&y.push(w[J]);return y};var n;String.prototype.codePointAt?n=function(w,S){return w.codePointAt(S)}:n=function(w,S){return w.charCodeAt(S)};var u;String.fromCodePoint?u=function(){return String.fromCodePoint.apply(null,arguments)}:u=function(){return String.fromCharCode.apply(null,arguments)};var A=0,p=1,h=/(\\a)|(\\b)|(\\f)|(\\n)|(\\r)|(\\t)|(\\v)|\\x([0-9a-fA-F]+)\\|\\([0-7]+)\\|(\\\\)|(\\')|('')|(\\")|(\\`)|(\\.)|(.)/g,E={"\\a":7,"\\b":8,"\\f":12,"\\n":10,"\\r":13,"\\t":9,"\\v":11};function I(w){var S=[],y=!1;return w.replace(h,function(F,J,X,$,ie,be,Re,at,dt,jt,tr,St,ln,kr,mr,br,Kr){switch(!0){case dt!==void 0:return S.push(parseInt(dt,16)),"";case jt!==void 0:return S.push(parseInt(jt,8)),"";case tr!==void 0:case St!==void 0:case ln!==void 0:case kr!==void 0:case mr!==void 0:return S.push(n(F.substr(1),0)),"";case Kr!==void 0:return S.push(n(Kr,0)),"";case br!==void 0:y=!0;default:return S.push(E[F]),""}}),y?null:S}function v(w,S){var y="";if(w.length<2)return w;try{w=w.replace(/\\([0-7]+)\\/g,function($,ie){return u(parseInt(ie,8))}),w=w.replace(/\\x([0-9a-fA-F]+)\\/g,function($,ie){return u(parseInt(ie,16))})}catch{return null}for(var F=0;F<w.length;F++){var J=w.charAt(F),X=w.charAt(F+1);if(J===S&&X===S)F++,y+=S;else if(J==="\\")if(["a","b","f","n","r","t","v","'",'"',"\\","a","\b","\f",`
|
||||
`,"\r"," ","\v"].indexOf(X)!==-1)switch(F+=1,X){case"a":y+="a";break;case"b":y+="\b";break;case"f":y+="\f";break;case"n":y+=`
|
||||
`;break;case"r":y+="\r";break;case"t":y+=" ";break;case"v":y+="\v";break;case"'":y+="'";break;case'"':y+='"';break;case"\\":y+="\\";break}else return null;else y+=J}return y}function x(w){for(var S="",y=0;y<w.length;y++)switch(w.charAt(y)){case"'":S+="\\'";break;case"\\":S+="\\\\";break;case"\b":S+="\\b";break;case"\f":S+="\\f";break;case`
|
||||
`:S+="\\n";break;case"\r":S+="\\r";break;case" ":S+="\\t";break;case"\v":S+="\\v";break;default:S+=w.charAt(y);break}return S}function C(w){var S=w.substr(2);switch(w.substr(0,2).toLowerCase()){case"0x":return parseInt(S,16);case"0b":return parseInt(S,2);case"0o":return parseInt(S,8);case"0'":return I(S)[0];default:return parseFloat(w)}}var R={whitespace:/^\s*(?:(?:%.*)|(?:\/\*(?:\n|\r|.)*?\*\/)|(?:\s+))\s*/,variable:/^(?:[A-Z_][a-zA-Z0-9_]*)/,atom:/^(\!|,|;|[a-z][0-9a-zA-Z_]*|[#\$\&\*\+\-\.\/\:\<\=\>\?\@\^\~\\]+|'(?:[^']*?(?:\\(?:x?\d+)?\\)*(?:'')*(?:\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\[abfnrtv\\'"`]|\\x?\d+\\|[^\\])|\d+(?:\.\d+(?:[eE][+-]?\d+)?)?)/,string:/^(?:"([^"]|""|\\")*"|`([^`]|``|\\`)*`)/,l_brace:/^(?:\[)/,r_brace:/^(?:\])/,l_bracket:/^(?:\{)/,r_bracket:/^(?:\})/,bar:/^(?:\|)/,l_paren:/^(?:\()/,r_paren:/^(?:\))/};function L(w,S){return w.get_flag("char_conversion").id==="on"?S.replace(/./g,function(y){return w.get_char_conversion(y)}):S}function U(w){this.thread=w,this.text="",this.tokens=[]}U.prototype.set_last_tokens=function(w){return this.tokens=w},U.prototype.new_text=function(w){this.text=w,this.tokens=[]},U.prototype.get_tokens=function(w){var S,y=0,F=0,J=0,X=[],$=!1;if(w){var ie=this.tokens[w-1];y=ie.len,S=L(this.thread,this.text.substr(ie.len)),F=ie.line,J=ie.start}else S=this.text;if(/^\s*$/.test(S))return null;for(;S!=="";){var be=[],Re=!1;if(/^\n/.exec(S)!==null){F++,J=0,y++,S=S.replace(/\n/,""),$=!0;continue}for(var at in R)if(R.hasOwnProperty(at)){var dt=R[at].exec(S);dt&&be.push({value:dt[0],name:at,matches:dt})}if(!be.length)return this.set_last_tokens([{value:S,matches:[],name:"lexical",line:F,start:J}]);var ie=r(be,function(kr,mr){return kr.value.length>=mr.value.length?kr:mr});switch(ie.start=J,ie.line=F,S=S.replace(ie.value,""),J+=ie.value.length,y+=ie.value.length,ie.name){case"atom":ie.raw=ie.value,ie.value.charAt(0)==="'"&&(ie.value=v(ie.value.substr(1,ie.value.length-2),"'"),ie.value===null&&(ie.name="lexical",ie.value="unknown escape sequence"));break;case"number":ie.float=ie.value.substring(0,2)!=="0x"&&ie.value.match(/[.eE]/)!==null&&ie.value!=="0'.",ie.value=C(ie.value),ie.blank=Re;break;case"string":var jt=ie.value.charAt(0);ie.value=v(ie.value.substr(1,ie.value.length-2),jt),ie.value===null&&(ie.name="lexical",ie.value="unknown escape sequence");break;case"whitespace":var tr=X[X.length-1];tr&&(tr.space=!0),Re=!0;continue;case"r_bracket":X.length>0&&X[X.length-1].name==="l_bracket"&&(ie=X.pop(),ie.name="atom",ie.value="{}",ie.raw="{}",ie.space=!1);break;case"r_brace":X.length>0&&X[X.length-1].name==="l_brace"&&(ie=X.pop(),ie.name="atom",ie.value="[]",ie.raw="[]",ie.space=!1);break}ie.len=y,X.push(ie),Re=!1}var St=this.set_last_tokens(X);return St.length===0?null:St};function z(w,S,y,F,J){if(!S[y])return{type:A,value:b.error.syntax(S[y-1],"expression expected",!0)};var X;if(F==="0"){var $=S[y];switch($.name){case"number":return{type:p,len:y+1,value:new b.type.Num($.value,$.float)};case"variable":return{type:p,len:y+1,value:new b.type.Var($.value)};case"string":var ie;switch(w.get_flag("double_quotes").id){case"atom":ie=new H($.value,[]);break;case"codes":ie=new H("[]",[]);for(var be=$.value.length-1;be>=0;be--)ie=new H(".",[new b.type.Num(n($.value,be),!1),ie]);break;case"chars":ie=new H("[]",[]);for(var be=$.value.length-1;be>=0;be--)ie=new H(".",[new b.type.Term($.value.charAt(be),[]),ie]);break}return{type:p,len:y+1,value:ie};case"l_paren":var St=z(w,S,y+1,w.__get_max_priority(),!0);return St.type!==p?St:S[St.len]&&S[St.len].name==="r_paren"?(St.len++,St):{type:A,derived:!0,value:b.error.syntax(S[St.len]?S[St.len]:S[St.len-1],") or operator expected",!S[St.len])};case"l_bracket":var St=z(w,S,y+1,w.__get_max_priority(),!0);return St.type!==p?St:S[St.len]&&S[St.len].name==="r_bracket"?(St.len++,St.value=new H("{}",[St.value]),St):{type:A,derived:!0,value:b.error.syntax(S[St.len]?S[St.len]:S[St.len-1],"} or operator expected",!S[St.len])}}var Re=te(w,S,y,J);return Re.type===p||Re.derived||(Re=ae(w,S,y),Re.type===p||Re.derived)?Re:{type:A,derived:!1,value:b.error.syntax(S[y],"unexpected token")}}var at=w.__get_max_priority(),dt=w.__get_next_priority(F),jt=y;if(S[y].name==="atom"&&S[y+1]&&(S[y].space||S[y+1].name!=="l_paren")){var $=S[y++],tr=w.__lookup_operator_classes(F,$.value);if(tr&&tr.indexOf("fy")>-1){var St=z(w,S,y,F,J);if(St.type!==A)return $.value==="-"&&!$.space&&b.type.is_number(St.value)?{value:new b.type.Num(-St.value.value,St.value.is_float),len:St.len,type:p}:{value:new b.type.Term($.value,[St.value]),len:St.len,type:p};X=St}else if(tr&&tr.indexOf("fx")>-1){var St=z(w,S,y,dt,J);if(St.type!==A)return{value:new b.type.Term($.value,[St.value]),len:St.len,type:p};X=St}}y=jt;var St=z(w,S,y,dt,J);if(St.type===p){y=St.len;var $=S[y];if(S[y]&&(S[y].name==="atom"&&w.__lookup_operator_classes(F,$.value)||S[y].name==="bar"&&w.__lookup_operator_classes(F,"|"))){var ln=dt,kr=F,tr=w.__lookup_operator_classes(F,$.value);if(tr.indexOf("xf")>-1Line truncated
|
||||
`;S+=`
|
||||
`;for(key in this.rules)for(y=0;y<this.rules[key].length;y++)S+=this.rules[key][y].toString(w),S+=`
|
||||
`;return S},xe.prototype.clone=function(){return new xe(this.id)},Ne.prototype.clone=function(){return new Ne(this.value,this.is_float)},H.prototype.clone=function(){return new H(this.id,o(this.args,function(w){return w.clone()}))},Te.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},Fe.prototype.clone=function(){var w={};for(var S in this.links)this.links.hasOwnProperty(S)&&(w[S]=this.links[S].clone());return new Fe(w)},ke.prototype.clone=function(){return new ke(this.goal.clone(),this.substitution.clone(),this.parent)},Ye.prototype.clone=function(){return new Ye(this.head.clone(),this.body!==null?this.body.clone():null)},xe.prototype.equals=function(w){return b.type.is_variable(w)&&this.id===w.id},Ne.prototype.equals=function(w){return b.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float},H.prototype.equals=function(w){if(!b.type.is_term(w)||this.indicator!==w.indicator)return!1;for(var S=0;S<this.args.length;S++)if(!this.args[S].equals(w.args[S]))return!1;return!0},Te.prototype.equals=function(w){return b.type.is_stream(w)&&this.id===w.id},Fe.prototype.equals=function(w){var S;if(!b.type.is_substitution(w))return!1;for(S in this.links)if(this.links.hasOwnProperty(S)&&(!w.links[S]||!this.links[S].equals(w.links[S])))return!1;for(S in w.links)if(w.links.hasOwnProperty(S)&&!this.links[S])return!1;return!0},ke.prototype.equals=function(w){return b.type.is_state(w)&&this.goal.equals(w.goal)&&this.substitution.equals(w.substitution)&&this.parent===w.parent},Ye.prototype.equals=function(w){return b.type.is_rule(w)&&this.head.equals(w.head)&&(this.body===null&&w.body===null||this.body!==null&&this.body.equals(w.body))},xe.prototype.rename=function(w){return w.get_free_variable(this)},Ne.prototype.rename=function(w){return this},H.prototype.rename=function(w){return new H(this.id,o(this.args,function(S){return S.rename(w)}))},Te.prototype.rename=function(w){return this},Ye.prototype.rename=function(w){return new Ye(this.head.rename(w),this.body!==null?this.body.rename(w):null)},xe.prototype.variables=function(){return[this.id]},Ne.prototype.variables=function(){return[]},H.prototype.variables=function(){return[].concat.apply([],o(this.args,function(w){return w.variables()}))},Te.prototype.variables=function(){return[]},Ye.prototype.variables=function(){return this.body===null?this.head.variables():this.head.variables().concat(this.body.variables())},xe.prototype.apply=function(w){return w.lookup(this.id)?w.lookup(this.id):this},Ne.prototype.apply=function(w){return this},H.prototype.apply=function(w){if(this.indicator==="./2"){for(var S=[],y=this;y.indicator==="./2";)S.push(y.args[0].apply(w)),y=y.args[1];for(var F=y.apply(w),J=S.length-1;J>=0;J--)F=new H(".",[S[J],F]);return F}return new H(this.id,o(this.args,function(X){return X.apply(w)}),this.ref)},Te.prototype.apply=function(w){return this},Ye.prototype.apply=function(w){return new Ye(this.head.apply(w),this.body!==null?this.body.apply(w):null)},Fe.prototype.apply=function(w){var S,y={};for(S in this.links)this.links.hasOwnProperty(S)&&(y[S]=this.links[S].apply(w));return new Fe(y)},H.prototype.select=function(){for(var w=this;w.indicator===",/2";)w=w.args[0];return w},H.prototype.replace=function(w){return this.indicator===",/2"?this.args[0].indicator===",/2"?new H(",",[this.args[0].replace(w),this.args[1]]):w===null?this.args[1]:new H(",",[w,this.args[1]]):w},H.prototype.search=function(w){if(b.type.is_term(w)&&w.ref!==void 0&&this.ref===w.ref)return!0;for(var S=0;S<this.args.length;S++)if(b.type.is_term(this.args[S])&&this.args[S].search(w))return!0;return!1},Se.prototype.get_current_input=function(){return this.current_input},et.prototype.get_current_input=function(){return this.session.get_current_input()},Se.prototype.get_current_output=function(){return this.current_output},et.prototype.get_current_output=function(){return this.session.get_current_output()},Se.prototype.set_current_input=function(w){this.current_input=w},et.prototype.set_current_input=function(w){return this.session.set_current_input(w)},Se.prototype.set_current_output=function(w){this.current_input=w},et.prototype.set_current_output=function(w){return this.session.set_current_output(w)},Se.prototype.get_stream_by_alias=function(w){return this.streams[w]},et.prototype.get_stream_by_alias=function(w){return this.session.get_stream_by_alias(w)},Se.prototype.file_system_open=function(w,S,y){return this.file_system.open(w,S,y)},et.prototype.file_system_open=function(w,S,y){return this.session.file_system_open(w,S,y)},Se.prototype.get_char_conversion=function(w){return this.__char_conversion[w]||w},et.prototype.get_char_conversion=function(w){return this.session.get_char_conversion(w)},Se.prototype.parse=function(w){return this.thread.parse(w)},et.prototype.parse=function(w){var S=new U(this);S.new_text(w);var y=S.get_tokens();if(y===null)return!1;var F=z(this,y,0,this.__get_max_priority(),!1);return F
Line truncated
|
||||
`,[])])])),S.substitution,S)])},"nl/1":function(w,S,y){var F=y.args[0];w.prepend([new ke(S.goal.replace(new H("put_char",[F,new H(`
|
||||
`,[])])),S.substitution,S)])},"get_byte/1":function(w,S,y){var F=y.args[0];w.prepend([new ke(S.goal.replace(new H(",",[new H("current_input",[new xe("S")]),new H("get_byte",[new xe("S"),F])])),S.substitution,S)])},"get_byte/2":function(w,S,y){var F=y.args[0],J=y.args[1],X=b.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(b.type.is_variable(F))w.throw_error(b.error.instantiation(y.indicator));else if(!b.type.is_variable(J)&&!b.type.is_byte(J))w.throw_error(b.error.type("in_byte",char,y.indicator));else if(!b.type.is_stream(F)&&!b.type.is_atom(F))w.throw_error(b.error.domain("stream_or_alias",F,y.indicator));else if(!b.type.is_stream(X)||X.stream===null)w.throw_error(b.error.existence("stream",F,y.indicator));else if(X.output)w.throw_error(b.error.permission("input","stream",F,y.indicator));else if(X.type==="text")w.throw_error(b.error.permission("input","text_stream",F,y.indicator));else if(X.position==="past_end_of_stream"&&X.eof_action==="error")w.throw_error(b.error.permission("input","past_end_of_stream",F,y.indicator));else{var $;if(X.position==="end_of_stream")$="end_of_file",X.position="past_end_of_stream";else{if($=X.stream.get_byte(X.position),$===null){w.throw_error(b.error.representation("byte",y.indicator));return}X.position++}w.prepend([new ke(S.goal.replace(new H("=",[new Ne($,!1),J])),S.substitution,S)])}},"peek_byte/1":function(w,S,y){var F=y.args[0];w.prepend([new ke(S.goal.replace(new H(",",[new H("current_input",[new xe("S")]),new H("peek_byte",[new xe("S"),F])])),S.substitution,S)])},"peek_byte/2":function(w,S,y){var F=y.args[0],J=y.args[1],X=b.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(b.type.is_variable(F))w.throw_error(b.error.instantiation(y.indicator));else if(!b.type.is_variable(J)&&!b.type.is_byte(J))w.throw_error(b.error.type("in_byte",char,y.indicator));else if(!b.type.is_stream(F)&&!b.type.is_atom(F))w.throw_error(b.error.domain("stream_or_alias",F,y.indicator));else if(!b.type.is_stream(X)||X.stream===null)w.throw_error(b.error.existence("stream",F,y.indicator));else if(X.output)w.throw_error(b.error.permission("input","stream",F,y.indicator));else if(X.type==="text")w.throw_error(b.error.permission("input","text_stream",F,y.indicator));else if(X.position==="past_end_of_stream"&&X.eof_action==="error")w.throw_error(b.error.permission("input","past_end_of_stream",F,y.indicator));else{var $;if(X.position==="end_of_stream")$="end_of_file",X.position="past_end_of_stream";else if($=X.stream.get_byte(X.position),$===null){w.throw_error(b.error.representation("byte",y.indicator));return}w.prepend([new ke(S.goal.replace(new H("=",[new Ne($,!1),J])),S.substitution,S)])}},"put_byte/1":function(w,S,y){var F=y.args[0];w.prepend([new ke(S.goal.replace(new H(",",[new H("current_output",[new xe("S")]),new H("put_byte",[new xe("S"),F])])),S.substitution,S)])},"put_byte/2":function(w,S,y){var F=y.args[0],J=y.args[1],X=b.type.is_stream(F)?F:w.get_stream_by_alias(F.id);b.type.is_variable(F)||b.type.is_variable(J)?w.throw_error(b.error.instantiation(y.indicator)):b.type.is_byte(J)?!b.type.is_variable(F)&&!b.type.is_stream(F)&&!b.type.is_atom(F)?w.throw_error(b.error.domain("stream_or_alias",F,y.indicator)):!b.type.is_stream(X)||X.stream===null?w.throw_error(b.error.existence("stream",F,y.indicator)):X.input?w.throw_error(b.error.permission("output","stream",F,y.indicator)):X.type==="text"?w.throw_error(b.error.permission("output","text_stream",F,y.indicator)):X.stream.put_byte(J.value,X.position)&&(typeof X.position=="number"&&X.position++,w.success(S)):w.throw_error(b.error.type("byte",J,y.indicator))},"read/1":function(w,S,y){var F=y.args[0];w.prepend([new ke(S.goal.replace(new H(",",[new H("current_input",[new xe("S")]),new H("read_term",[new xe("S"),F,new H("[]",[])])])),S.substitution,S)])},"read/2":function(w,S,y){var F=y.args[0],J=y.args[1];w.prepend([new ke(S.goal.replace(new H("read_term",[F,J,new H("[]",[])])),S.substitution,S)])},"read_term/2":function(w,S,y){var F=y.args[0],J=y.args[1];w.prepend([new ke(S.goal.replace(new H(",",[new H("current_input",[new xe("S")]),new H("read_term",[new xe("S"),F,J])])),S.substitution,S)])},"read_term/3":function(w,S,y){var F=y.args[0],J=y.args[1],X=y.args[2],$=b.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(b.type.is_variable(F)||b.type.is_variable(X))w.throw_error(b.error.instantiation(y.indicator));else if(!b.type.is_list(X))w.throw_error(b.error.type("list",X,y.indicator));else if(!b.type.is_stream(F)&&!b.type.is_atom(F))w.throw_error(b.error.domain("stream_or_alias",F,y.indicator));else if(!b.type.is_stream($)||$.stream===null)w.throw_error(b.error.existence("stream",F,y.indicator));else if($.output)w.throw_error(b.error.permission("input","stream",F,y.indicator));else if($.type==="binary")w.throw_error(b.error.permission("input","binary_stream",F,y.indicator));else if($.position==="past_end_of_stream"&&$.eof_action==="error")w.throw_error(b.error.permission("input","past_end_of_stream",F,y.indicator));else{for(var ie={},be=X,Re;
Line truncated
|
||||
`;for(let r of this.project.workspacesByCwd.values()){let o=r.relativeCwd;e+=`workspace(${Fh(o)}).
|
||||
`,e+=`workspace_ident(${Fh(o)}, ${Fh(G.stringifyIdent(r.anchoredLocator))}).
|
||||
`,e+=`workspace_version(${Fh(o)}, ${Fh(r.manifest.version)}).
|
||||
`;for(let a of hme)for(let n of r.manifest[a].values())e+=`workspace_has_dependency(${Fh(o)}, ${Fh(G.stringifyIdent(n))}, ${Fh(n.range)}, ${a}).
|
||||
`}return e+=`workspace(_) :- false.
|
||||
`,e+=`workspace_ident(_, _) :- false.
|
||||
`,e+=`workspace_version(_, _) :- false.
|
||||
`,e+=`workspace_has_dependency(_, _, _, _) :- false.
|
||||
`,e}getDeclarations(){let e="";return e+=`gen_enforced_dependency(_, _, _, _) :- false.
|
||||
`,e+=`gen_enforced_field(_, _, _) :- false.
|
||||
`,e}get fullSource(){return`${this.getProjectDatabase()}
|
||||
${this.source}
|
||||
${this.getDeclarations()}`}createSession(){return new hH(this.project,this.fullSource)}async processClassic(){let e=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(e),enforcedFields:await this.genEnforcedFields(e)}}async process(){let{enforcedDependencies:e,enforcedFields:r}=await this.processClassic(),o=new Map;for(let{workspace:a,dependencyIdent:n,dependencyRange:u,dependencyType:A}of e){let p=a2([A,G.stringifyIdent(n)]),h=He.getMapWithDefault(o,a.cwd);He.getMapWithDefault(h,p).set(u??void 0,new Set)}for(let{workspace:a,fieldPath:n,fieldValue:u}of r){let A=a2(n),p=He.getMapWithDefault(o,a.cwd);He.getMapWithDefault(p,A).set(JSON.parse(u)??void 0,new Set)}return{manifestUpdates:o,reportedErrors:new Map}}async genEnforcedDependencies(e){let r=[];for await(let o of e.makeQuery("workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).")){let a=K.resolve(this.project.cwd,Gg(o.links.WorkspaceCwd)),n=Gg(o.links.DependencyIdent),u=Gg(o.links.DependencyRange),A=Gg(o.links.DependencyType);if(a===null||n===null)throw new Error("Invalid rule");let p=this.project.getWorkspaceByCwd(a),h=G.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:u,dependencyType:A})}return He.sortMap(r,[({dependencyRange:o})=>o!==null?"0":"1",({workspace:o})=>G.stringifyIdent(o.anchoredLocator),({dependencyIdent:o})=>G.stringifyIdent(o)])}async genEnforcedFields(e){let r=[];for await(let o of e.makeQuery("workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).")){let a=K.resolve(this.project.cwd,Gg(o.links.WorkspaceCwd)),n=Gg(o.links.FieldPath),u=ndt(o.links.FieldValue);if(a===null||n===null)throw new Error("Invalid rule");let A=this.project.getWorkspaceByCwd(a);r.push({workspace:A,fieldPath:n,fieldValue:u})}return He.sortMap(r,[({workspace:o})=>G.stringifyIdent(o.anchoredLocator),({fieldPath:o})=>o])}async*query(e){let r=this.createSession();for await(let o of r.makeQuery(e)){let a={};for(let[n,u]of Object.entries(o.links))n!=="_"&&(a[n]=Gg(u));yield a}}}});var Pme=_(Ak=>{"use strict";Object.defineProperty(Ak,"__esModule",{value:!0});function S2(t){let e=[...t.caches],r=e.shift();return r===void 0?Dme():{get(o,a,n={miss:()=>Promise.resolve()}){return r.get(o,a,n).catch(()=>S2({caches:e}).get(o,a,n))},set(o,a){return r.set(o,a).catch(()=>S2({caches:e}).set(o,a))},delete(o){return r.delete(o).catch(()=>S2({caches:e}).delete(o))},clear(){return r.clear().catch(()=>S2({caches:e}).clear())}}}function Dme(){return{get(t,e,r={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}Ak.createFallbackableCache=S2;Ak.createNullCache=Dme});var bme=_((MWt,Sme)=>{Sme.exports=Pme()});var xme=_(xH=>{"use strict";Object.defineProperty(xH,"__esModule",{value:!0});function Idt(t={serializable:!0}){let e={};return{get(r,o,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in e)return Promise.resolve(t.serializable?JSON.parse(e[n]):e[n]);let u=o(),A=a&&a.miss||(()=>Promise.resolve());return u.then(p=>A(p)).then(()=>u)},set(r,o){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(o):o,Promise.resolve(o)},delete(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}xH.createInMemoryCache=Idt});var Qme=_((UWt,kme)=>{kme.exports=xme()});var Rme=_(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});function Bdt(t,e,r){let o={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers(){return t===kH.WithinHeaders?o:{}},queryParameters(){return t===kH.WithinQueryParameters?o:{}}}}function vdt(t){let e=0,r=()=>(e++,new Promise(o=>{setTimeout(()=>{o(t(r))},Math.min(100*e,1e3))}));return t(r)}function Fme(t,e=(r,o)=>Promise.resolve()){return Object.assign(t,{wait(r){return Fme(t.then(o=>Promise.all([e(o,r),o])).then(o=>o[1]))}})}function Ddt(t){let e=t.length-1;for(e;e>0;e--){let r=Math.floor(Math.random()*(e+1)),o=t[e];t[e]=t[r],t[r]=o}return t}function Pdt(t,e){return e&&Object.keys(e).forEach(r=>{t[r]=e[r](t)}),t}function Sdt(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}var bdt="4.22.1",xdt=t=>()=>t.transporter.requester.destroy(),kH={WithinQueryParameters:0,WithinHeaders:1};eu.AuthMode=kH;eu.addMethods=Pdt;eu.createAuth=Bdt;eu.createRetryablePromise=vdt;eu.createWaitablePromise=Fme;eu.destroy=xdt;eu.encode=Sdt;eu.shuffle=Ddt;eu.version=bdt});var b2=_((HWt,Tme)=>{Tme.exports=Rme()});var Nme=_(QH=>{"use strict";Object.defineProperty(QH,"__esModule",{value:!0});var kdt={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};QH.MethodEnum=kdt});var x2=_((jWt,Lme)=>{Lme.exports=Nme()});var Xme=_(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var Ome=x2();function FH(t,e){let r=t||{},o=r.data||{};return Object.keys(r).forEach(a=>{["timeout","head
Line truncated
|
||||
`;A!==o&&(o=A,t.write(uEe.default.eraseLines(r)+A),r=A.split(`
|
||||
`).length)};return n.clear=()=>{t.write(uEe.default.eraseLines(r)),o="",r=0},n.done=()=>{o="",r=0,e||(AEe.default.show(),a=!1)},n};_2.default={create:qyt}});var hEe=_((dKt,jyt)=>{jyt.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY_BUILD_BASE",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}}]});var mEe=_(dl=>{"use strict";var dEe=hEe(),pA=process.env;Object.defineProperty(dl,"_vendors",{value:dEe.map(function(t){return t.constant})});dl.name=null;dl.isPR=null;dEe.forEach(function(t){var e=Array.isArray(t.env)?t.env:[t.env],r=e.every(function(o){return gEe(o)});if(dl[t.constant]=r,r)switch(dl.name=t.name,typeof t.pr){case"string":dl.isPR=!!pA[t.pr];break;case"object":"env"in t.pr?dl.isPR=t.pr.env in pA&&pA[t.pr.env]!==t.pr.ne:"any"in t.pr?dl.isPR=t.pr.any.some(function(o){return!!pA[o]}):dl.isPR=gEe(t.pr);break;default:dl.isPR=null}});dl.isCI=!!(pA.CI||pA.CONTINUOUS_INTEGRATION||pA.BUILD_NUMBER||pA.RUN_ID||dl.name);function gEe(t){return typeof t=="string"?!!pA[t]:Object.keys(t).every(function(e){return pA[e]===t[e]})}});var EEe=_((yKt,yEe)=>{"use strict";yEe.exports=mEe().isCI});var wEe=_((EKt,CEe)=>{"use strict";var Gyt=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};CEe.exports=(t,{include:e,exclude:r}={})=>{let o=a=>{let n=u=>typeof u=="string"?a===u:u.test(a);return e?e.some(n):r?!r.some(n):!0};for(let[a,n]of Gyt(t.constructor.prototype)){if(n==="constructor"||!o(n))continue;let u=Reflect.getOwnPropertyDescriptor(a,n);u&&typeof u.value=="function"&&(t[n]=t[n].bind(t))}return t}});var bEe=_(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});var rC,j2,kk,Qk,m6;typeof window>"u"||typeof MessageChannel!="function"?(tC=null,A6=null,f6=function(){if(tC!==null)try{var t=kn.unstable_now();tC(!0,t),tC=null}catch(e){throw setTimeout(f6,0),e}},IEe=Date.now(),kn.unstable_now=function(){return Date.now()-IEe},rC=function(t){tC!==null?setTimeout(rC,0,t):(tC=t,setTimeout(f6,0))},j2=function(t,e){A6=setTimeout(t,e)},kk=function(){clearTimeout(A6)},Qk=function(){return!1},m6=kn.unstable_forceFrameRate=function(){}):(Pk=window.performance,p6=window.Date,BEe=window.setTimeout,vEe=window.clearTimeout,typeof console<"u"&&(DEe=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),typeof DEe!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),typeof Pk=="object"&&typeof Pk.now=="function"?kn.unstable_now=function(){return Pk.now()}:(PEe=p6.now(),kn.unstable_now=function(){return p6.now()-PEe}),H2=!1,q2=null,Sk=-1,h6=5,g6=0,Qk=function(){return kn.unstable_now()>=g6},m6=function(){},kn.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps
Line truncated
|
||||
in `+(q||"Unknown")+fe}D+=T,P=P.return}while(P);return D}var yl=[],ao=-1;function Vn(P){0>ao||(P.current=yl[ao],yl[ao]=null,ao--)}function Mn(P,D){ao++,yl[ao]=P.current,P.current=D}var Ti={},On={current:Ti},_i={current:!1},ir=Ti;function Me(P,D){var T=P.type.contextTypes;if(!T)return Ti;var q=P.stateNode;if(q&&q.__reactInternalMemoizedUnmaskedChildContext===D)return q.__reactInternalMemoizedMaskedChildContext;var W={},fe;for(fe in T)W[fe]=D[fe];return q&&(P=P.stateNode,P.__reactInternalMemoizedUnmaskedChildContext=D,P.__reactInternalMemoizedMaskedChildContext=W),W}function ii(P){return P=P.childContextTypes,P!=null}function Ha(P){Vn(_i,P),Vn(On,P)}function hr(P){Vn(_i,P),Vn(On,P)}function Ac(P,D,T){if(On.current!==Ti)throw Error(n(168));Mn(On,D,P),Mn(_i,T,P)}function fu(P,D,T){var q=P.stateNode;if(P=D.childContextTypes,typeof q.getChildContext!="function")return T;q=q.getChildContext();for(var W in q)if(!(W in P))throw Error(n(108,de(D)||"Unknown",W));return r({},T,{},q)}function fc(P){var D=P.stateNode;return D=D&&D.__reactInternalMemoizedMergedChildContext||Ti,ir=On.current,Mn(On,D,P),Mn(_i,_i.current,P),!0}function El(P,D,T){var q=P.stateNode;if(!q)throw Error(n(169));T?(D=fu(P,D,ir),q.__reactInternalMemoizedMergedChildContext=D,Vn(_i,P),Vn(On,P),Mn(On,D,P)):Vn(_i,P),Mn(_i,T,P)}var vA=a.unstable_runWithPriority,pu=a.unstable_scheduleCallback,Ie=a.unstable_cancelCallback,Tt=a.unstable_shouldYield,pc=a.unstable_requestPaint,Hi=a.unstable_now,hu=a.unstable_getCurrentPriorityLevel,Yt=a.unstable_ImmediatePriority,Cl=a.unstable_UserBlockingPriority,DA=a.unstable_NormalPriority,ap=a.unstable_LowPriority,hc=a.unstable_IdlePriority,PA={},Qn=pc!==void 0?pc:function(){},hi=null,gc=null,SA=!1,aa=Hi(),Ni=1e4>aa?Hi:function(){return Hi()-aa};function _o(){switch(hu()){case Yt:return 99;case Cl:return 98;case DA:return 97;case ap:return 96;case hc:return 95;default:throw Error(n(332))}}function Xe(P){switch(P){case 99:return Yt;case 98:return Cl;case 97:return DA;case 96:return ap;case 95:return hc;default:throw Error(n(332))}}function lo(P,D){return P=Xe(P),vA(P,D)}function dc(P,D,T){return P=Xe(P),pu(P,D,T)}function gu(P){return hi===null?(hi=[P],gc=pu(Yt,du)):hi.push(P),PA}function qi(){if(gc!==null){var P=gc;gc=null,Ie(P)}du()}function du(){if(!SA&&hi!==null){SA=!0;var P=0;try{var D=hi;lo(99,function(){for(;P<D.length;P++){var T=D[P];do T=T(!0);while(T!==null)}}),hi=null}catch(T){throw hi!==null&&(hi=hi.slice(P+1)),pu(Yt,qi),T}finally{SA=!1}}}var bA=3;function qa(P,D,T){return T/=10,1073741821-(((1073741821-P+D/10)/T|0)+1)*T}function mc(P,D){return P===D&&(P!==0||1/P===1/D)||P!==P&&D!==D}var ds=typeof Object.is=="function"?Object.is:mc,Ht=Object.prototype.hasOwnProperty;function Fn(P,D){if(ds(P,D))return!0;if(typeof P!="object"||P===null||typeof D!="object"||D===null)return!1;var T=Object.keys(P),q=Object.keys(D);if(T.length!==q.length)return!1;for(q=0;q<T.length;q++)if(!Ht.call(D,T[q])||!ds(P[T[q]],D[T[q]]))return!1;return!0}function Ei(P,D){if(P&&P.defaultProps){D=r({},D),P=P.defaultProps;for(var T in P)D[T]===void 0&&(D[T]=P[T])}return D}var la={current:null},co=null,Hs=null,ca=null;function ua(){ca=Hs=co=null}function Ho(P,D){var T=P.type._context;b?(Mn(la,T._currentValue,P),T._currentValue=D):(Mn(la,T._currentValue2,P),T._currentValue2=D)}function Ci(P){var D=la.current;Vn(la,P),P=P.type._context,b?P._currentValue=D:P._currentValue2=D}function ms(P,D){for(;P!==null;){var T=P.alternate;if(P.childExpirationTime<D)P.childExpirationTime=D,T!==null&&T.childExpirationTime<D&&(T.childExpirationTime=D);else if(T!==null&&T.childExpirationTime<D)T.childExpirationTime=D;else break;P=P.return}}function ys(P,D){co=P,ca=Hs=null,P=P.dependencies,P!==null&&P.firstContext!==null&&(P.expirationTime>=D&&(jo=!0),P.firstContext=null)}function Es(P,D){if(ca!==P&&D!==!1&&D!==0)if((typeof D!="number"||D===1073741823)&&(ca=P,D=1073741823),D={context:P,observedBits:D,next:null},Hs===null){if(co===null)throw Error(n(308));Hs=D,co.dependencies={expirationTime:0,firstContext:D,responders:null}}else Hs=Hs.next=D;return b?P._currentValue:P._currentValue2}var qs=!1;function Un(P){return{baseState:P,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Pn(P){return{baseState:P.baseState,firstUpdate:P.firstUpdate,lastUpdate:P.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Cs(P,D){return{expirationTime:P,suspenseConfig:D,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function We(P,D){P.lastUpdate===null?P.firstUpdate=P.lastUpdate=D:(P.lastUpdate.next=D,P.lastUpdate=D)}function tt(P,D){var T=P.alternate;if(T===null){var q=P.updateQueue,W=null;q===null&&(q=P.updateQueue=Un(P.memoizedState))}else q=P.updateQueue,W=T.updateQueue,q===null?W===null?(q=P.updateQueue=Un(P.memoizedState),W=T.updateQueue=Un(T.memoiz
Line truncated
|
||||
|
||||
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`+ml(W))}Yi!==Sc&&(Yi=Ii),fe=g0(fe,W),wt=q;do{switch(wt.tag){case 3:De=fe,wt.effectTag|=4096,wt.expirationTime=D;var Ve=Sv(wt,De,D);Bt(wt,Ve);break e;case 1:De=fe;var At=wt.type,Wt=wt.stateNode;if(!(wt.effectTag&64)&&(typeof At.getDerivedStateFromError=="function"||Wt!==null&&typeof Wt.componentDidCatch=="function"&&(Su===null||!Su.has(Wt)))){wt.effectTag|=4096,wt.expirationTime=D;var vr=bv(wt,De,D);Bt(wt,vr);break e}}wt=wt.return}while(wt!==null)}Mr=Rv(Mr)}catch(Sn){D=Sn;continue}break}while(!0)}function jA(){var P=mp.current;return mp.current=Bu,P===null?Bu:P}function uw(P,D){P<Ka&&2<P&&(Ka=P),D!==null&&P<MA&&2<P&&(MA=P,vd=D)}function bd(P){P>yp&&(yp=P)}function tF(){for(;Mr!==null;)Mr=Fv(Mr)}function rF(){for(;Mr!==null&&!Tt();)Mr=Fv(Mr)}function Fv(P){var D=Nv(P.alternate,P,ss);return P.memoizedProps=P.pendingProps,D===null&&(D=Rv(P)),sw.current=null,D}function Rv(P){Mr=P;do{var D=Mr.alternate;if(P=Mr.return,Mr.effectTag&2048){if(D=nw(Mr,ss),D!==null)return D.effectTag&=2047,D;P!==null&&(P.firstEffect=P.lastEffect=null,P.effectTag|=2048)}else{e:{var T=D;D=Mr;var q=ss,W=D.pendingProps;switch(D.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:ii(D.type)&&Ha(D);break;case 3:Ec(D),hr(D),W=D.stateNode,W.pendingContext&&(W.context=W.pendingContext,W.pendingContext=null),(T===null||T.child===null)&&Ga(D)&&ga(D),Bl(D);break;case 5:n0(D);var fe=Aa(yc.current);if(q=D.type,T!==null&&D.stateNode!=null)ns(T,D,q,W,fe),T.ref!==D.ref&&(D.effectTag|=128);else if(W){if(T=Aa(uo.current),Ga(D)){if(W=D,!y)throw Error(n(175));T=sp(W.stateNode,W.type,W.memoizedProps,fe,T,W),W.updateQueue=T,T=T!==null,T&&ga(D)}else{var De=ht(q,W,fe,T,D);Dc(De,D,!1,!1),D.stateNode=De,rt(De,q,W,fe,T)&&ga(D)}D.ref!==null&&(D.effectTag|=128)}else if(D.stateNode===null)throw Error(n(166));break;case 6:if(T&&D.stateNode!=null)Yr(T,D,T.memoizedProps,W);else{if(typeof W!="string"&&D.stateNode===null)throw Error(n(166));if(T=Aa(yc.current),fe=Aa(uo.current),Ga(D)){if(T=D,!y)throw Error(n(176));(T=op(T.stateNode,T.memoizedProps,T))&&ga(D)}else D.stateNode=Ye(W,T,fe,D)}break;case 11:break;case 13:if(Vn($n,D),W=D.memoizedState,D.effectTag&64){D.expirationTime=q;break e}W=W!==null,fe=!1,T===null?D.memoizedProps.fallback!==void 0&&Ga(D):(q=T.memoizedState,fe=q!==null,W||q===null||(q=T.child.sibling,q!==null&&(De=D.firstEffect,De!==null?(D.firstEffect=q,q.nextEffect=De):(D.firstEffect=D.lastEffect=q,q.nextEffect=null),q.effectTag=8))),W&&!fe&&D.mode&2&&(T===null&&D.memoizedProps.unstable_avoidThisFallback!==!0||$n.current&1?Yi===Du&&(Yi=da):((Yi===Du||Yi===da)&&(Yi=vl),yp!==0&&gi!==null&&(WA(gi,ss),Mv(gi,yp)))),S&&W&&(D.effectTag|=4),w&&(W||fe)&&(D.effectTag|=4);break;case 7:break;case 8:break;case 12:break;case 4:Ec(D),Bl(D);break;case 10:Ci(D);break;case 9:break;case 14:break;case 17:ii(D.type)&&Ha(D);break;case 19:if(Vn($n,D),W=D.memoizedState,W===null)break;if(fe=(D.effectTag&64)!==0,De=W.rendering,De===null){if(fe)Pc(W,!1);else if(Yi!==Du||T!==null&&T.effectTag&64)for(T=D.child;T!==null;){if(De=cp(T),De!==null){for(D.effectTag|=64,Pc(W,!1),T=De.updateQueue,T!==null&&(D.updateQueue=T,D.effectTag|=4),W.lastEffect===null&&(D.firstEffect=null),D.lastEffect=W.lastEffect,T=q,W=D.child;W!==null;)fe=W,q=T,fe.effectTag&=2,fe.nextEffect=null,fe.firstEffect=null,fe.lastEffect=null,De=fe.alternate,De===null?(fe.childExpirationTime=0,fe.expirationTime=q,fe.child=null,fe.memoizedProps=null,fe.memoizedState=null,fe.updateQueue=null,fe.dependencies=null):(fe.childExpirationTime=De.childExpirationTime,fe.expirationTime=De.expirationTime,fe.child=De.child,fe.memoizedProps=De.memoizedProps,fe.memoizedState=De.memoizedState,fe.updateQueue=De.updateQueue,q=De.dependencies,fe.dependencies=q===null?null:{expirationTime:q.expirationTime,firstContext:q.firstContext,responders:q.responders}),W=W.sibling;Mn($n,$n.current&1|2,D),D=D.child;break e}T=T.sibling}}else{if(!fe)if(T=cp(De),T!==null){if(D.effectTag|=64,fe=!0,T=T.updateQueue,T!==null&&(D.updateQueue=T,D.effectTag|=4),Pc(W,!0),W.tail===null&&W.tailMode==="hidden"&&!De.alternate){D=D.lastEffect=W.lastEffect,D!==null&&(D.nextEffect=null);break}}else Ni()>W.tailExpiration&&1<q&&(D.effectTag|=64,fe=!0,Pc(W,!1),D.expirationTime=D.childExpirationTime=q-1);W.isBackwards?(De.sibling=D.child,D.child=De):(T=W.last,T!==null?T.sibling=De:D.child=De,W.last=De)}if(W.tail!==null){W.tailExpiration===0&&(W.tailExpiration=Ni()+500),T=W.tail,W.rendering=T,W.tail=T.sibling,W.lastEffect=D.lastEffect,T.sibling=null,W=$n.current,W=fe?W&1|2:W&1,Mn($n,W,D),D=T;break e}break;case 20:break;case 21:break;default:throw Error(n(156,D.tag))}D=null}if(T=Mr,ss===1||T.childExpirationTime!==1){for(W=0,fe=T.child;fe!==null;)q=fe.expirationTime,De=fe.childExpirationTime,q>W&&(W=q),De>W&&(W=De),fe=fe.sibling;T.childExpirationTime=W}if(D!==null)return D;P!==null&&!(P.effectTag&2048)&&(P.firstEffect===null&&(P.firstEffect=Mr.firstEffect)
Line truncated
|
||||
`+Module.extraStackTrace()),demangleAll(t)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw"Runtime error: expected the system to be little-endian!";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(t){for(;t.length>0;){var e=t.shift();if(typeof e=="function"){e();continue}var r=e.func;typeof r=="number"?e.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(e.arg===void 0?null:e.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(t){__ATPRERUN__.unshift(t)}Module.addOnPreRun=addOnPreRun;function addOnInit(t){__ATINIT__.unshift(t)}Module.addOnInit=addOnInit;function addOnPreMain(t){__ATMAIN__.unshift(t)}Module.addOnPreMain=addOnPreMain;function addOnExit(t){__ATEXIT__.unshift(t)}Module.addOnExit=addOnExit;function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(t,e,r){var o=r>0?r:lengthBytesUTF8(t)+1,a=new Array(o),n=stringToUTF8Array(t,a,0,a.length);return e&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(t){for(var e=[],r=0;r<t.length;r++){var o=t[r];o>255&&(o&=255),e.push(String.fromCharCode(o))}return e.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(t,e,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var o,a;r&&(a=e+lengthBytesUTF8(t),o=HEAP8[a]),stringToUTF8(t,e,1/0),r&&(HEAP8[a]=o)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(t,e){HEAP8.set(t,e)}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(t,e,r){for(var o=0;o<t.length;++o)HEAP8[e++>>0]=t.charCodeAt(o);r||(HEAP8[e>>0]=0)}if(Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function t(e,r){var o=e>>>16,a=e&65535,n=r>>>16,u=r&65535;return a*u+(o*u+a*n<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(t){return froundBuffer[0]=t,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(t){t=t>>>0;for(var e=0;e<32;e++)if(t&1<<31-e)return e;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.cei
Line truncated
|
||||
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r="abort("+t+") at "+stackTrace()+e;throw abortDecorators&&abortDecorators.forEach(function(o){r=o(r,t)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var Jg=_((SKt,_Ee)=>{"use strict";var Jyt=OEe(),Xyt=UEe(),v6=!1,D6=null;Xyt({},function(t,e){if(!v6){if(v6=!0,t)throw t;D6=e}});if(!v6)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");_Ee.exports=Jyt(D6.bind,D6.lib)});var S6=_((bKt,P6)=>{"use strict";var HEe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);P6.exports=HEe;P6.exports.default=HEe});var jEe=_((xKt,qEe)=>{"use strict";qEe.exports=function(){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
Line truncated
|
||||
`))e=Math.max(e,tEt(r));return e};x6.exports=YEe;x6.exports.default=YEe});var WEe=_(W2=>{"use strict";var rEt=W2&&W2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W2,"__esModule",{value:!0});var nEt=rEt(k6()),Q6={};W2.default=t=>{if(t.length===0)return{width:0,height:0};if(Q6[t])return Q6[t];let e=nEt.default(t),r=t.split(`
|
||||
`).length;return Q6[t]={width:e,height:r},{width:e,height:r}}});var KEe=_(K2=>{"use strict";var iEt=K2&&K2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K2,"__esModule",{value:!0});var dn=iEt(Jg()),sEt=(t,e)=>{"position"in e&&t.setPositionType(e.position==="absolute"?dn.default.POSITION_TYPE_ABSOLUTE:dn.default.POSITION_TYPE_RELATIVE)},oEt=(t,e)=>{"marginLeft"in e&&t.setMargin(dn.default.EDGE_START,e.marginLeft||0),"marginRight"in e&&t.setMargin(dn.default.EDGE_END,e.marginRight||0),"marginTop"in e&&t.setMargin(dn.default.EDGE_TOP,e.marginTop||0),"marginBottom"in e&&t.setMargin(dn.default.EDGE_BOTTOM,e.marginBottom||0)},aEt=(t,e)=>{"paddingLeft"in e&&t.setPadding(dn.default.EDGE_LEFT,e.paddingLeft||0),"paddingRight"in e&&t.setPadding(dn.default.EDGE_RIGHT,e.paddingRight||0),"paddingTop"in e&&t.setPadding(dn.default.EDGE_TOP,e.paddingTop||0),"paddingBottom"in e&&t.setPadding(dn.default.EDGE_BOTTOM,e.paddingBottom||0)},lEt=(t,e)=>{var r;"flexGrow"in e&&t.setFlexGrow((r=e.flexGrow)!==null&&r!==void 0?r:0),"flexShrink"in e&&t.setFlexShrink(typeof e.flexShrink=="number"?e.flexShrink:1),"flexDirection"in e&&(e.flexDirection==="row"&&t.setFlexDirection(dn.default.FLEX_DIRECTION_ROW),e.flexDirection==="row-reverse"&&t.setFlexDirection(dn.default.FLEX_DIRECTION_ROW_REVERSE),e.flexDirection==="column"&&t.setFlexDirection(dn.default.FLEX_DIRECTION_COLUMN),e.flexDirection==="column-reverse"&&t.setFlexDirection(dn.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in e&&(typeof e.flexBasis=="number"?t.setFlexBasis(e.flexBasis):typeof e.flexBasis=="string"?t.setFlexBasisPercent(Number.parseInt(e.flexBasis,10)):t.setFlexBasis(NaN)),"alignItems"in e&&((e.alignItems==="stretch"||!e.alignItems)&&t.setAlignItems(dn.default.ALIGN_STRETCH),e.alignItems==="flex-start"&&t.setAlignItems(dn.default.ALIGN_FLEX_START),e.alignItems==="center"&&t.setAlignItems(dn.default.ALIGN_CENTER),e.alignItems==="flex-end"&&t.setAlignItems(dn.default.ALIGN_FLEX_END)),"alignSelf"in e&&((e.alignSelf==="auto"||!e.alignSelf)&&t.setAlignSelf(dn.default.ALIGN_AUTO),e.alignSelf==="flex-start"&&t.setAlignSelf(dn.default.ALIGN_FLEX_START),e.alignSelf==="center"&&t.setAlignSelf(dn.default.ALIGN_CENTER),e.alignSelf==="flex-end"&&t.setAlignSelf(dn.default.ALIGN_FLEX_END)),"justifyContent"in e&&((e.justifyContent==="flex-start"||!e.justifyContent)&&t.setJustifyContent(dn.default.JUSTIFY_FLEX_START),e.justifyContent==="center"&&t.setJustifyContent(dn.default.JUSTIFY_CENTER),e.justifyContent==="flex-end"&&t.setJustifyContent(dn.default.JUSTIFY_FLEX_END),e.justifyContent==="space-between"&&t.setJustifyContent(dn.default.JUSTIFY_SPACE_BETWEEN),e.justifyContent==="space-around"&&t.setJustifyContent(dn.default.JUSTIFY_SPACE_AROUND))},cEt=(t,e)=>{var r,o;"width"in e&&(typeof e.width=="number"?t.setWidth(e.width):typeof e.width=="string"?t.setWidthPercent(Number.parseInt(e.width,10)):t.setWidthAuto()),"height"in e&&(typeof e.height=="number"?t.setHeight(e.height):typeof e.height=="string"?t.setHeightPercent(Number.parseInt(e.height,10)):t.setHeightAuto()),"minWidth"in e&&(typeof e.minWidth=="string"?t.setMinWidthPercent(Number.parseInt(e.minWidth,10)):t.setMinWidth((r=e.minWidth)!==null&&r!==void 0?r:0)),"minHeight"in e&&(typeof e.minHeight=="string"?t.setMinHeightPercent(Number.parseInt(e.minHeight,10)):t.setMinHeight((o=e.minHeight)!==null&&o!==void 0?o:0))},uEt=(t,e)=>{"display"in e&&t.setDisplay(e.display==="flex"?dn.default.DISPLAY_FLEX:dn.default.DISPLAY_NONE)},AEt=(t,e)=>{if("borderStyle"in e){let r=typeof e.borderStyle=="string"?1:0;t.setBorder(dn.default.EDGE_TOP,r),t.setBorder(dn.default.EDGE_BOTTOM,r),t.setBorder(dn.default.EDGE_LEFT,r),t.setBorder(dn.default.EDGE_RIGHT,r)}};K2.default=(t,e={})=>{sEt(t,e),oEt(t,e),aEt(t,e),lEt(t,e),cEt(t,e),uEt(t,e),AEt(t,e)}});var JEe=_((TKt,zEe)=>{"use strict";var V2=Lk(),fEt=BP(),pEt=aI(),R6=new Set(["\x1B","\x9B"]),hEt=39,VEe=t=>`${R6.values().next().value}[${t}m`,gEt=t=>t.split(" ").map(e=>V2(e)),F6=(t,e,r)=>{let o=[...e],a=!1,n=V2(fEt(t[t.length-1]));for(let[u,A]of o.entries()){let p=V2(A);if(n+p<=r?t[t.length-1]+=A:(t.push(A),n=0),R6.has(A))a=!0;else if(a&&A==="m"){a=!1;continue}a||(n+=p,n===r&&u<o.length-1&&(t.push(""),n=0))}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},dEt=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(V2(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},mEt=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let o="",a="",n,u=gEt(t),A=[""];for(let[p,h]of t.split(" ").entries()){r.trim!==!1&&(A[A.length-1]=A[A.length-1].trimLeft());let E=V2(A[A.length-1]);if(p!==0&&(E>=e&&(r.wordWrap===!1||r.trim===!1)&&(A.push(""),E=0),(E>0||r.trim===!1)&&(A[A.length-1]+=" ",E++)),r.hard&&u[p]>e){let I=e-E,v=1+Math.floor((u[p]-I-1)/e);Math.floor((u[p]-1)/e)<v&&A.push(""),F6(A,h,e);continue}if(E+u[p]>e&&E>0&&u[p]>0){if(r.wordWrap===!1&&E<e){F6(A,h,e);continue}A.push("")}if(E+u[p]>e&&r.wordWrap===!1){F6(A,h,e);continue}A[A.
Line truncated
|
||||
`);for(let[p,h]of[...o].entries()){if(a+=h,R6.has(h)){let I=parseFloat(/\d[^m]*/.exec(o.slice(p,p+4)));n=I===hEt?null:I}let E=pEt.codes.get(Number(n));n&&E&&(o[p+1]===`
|
||||
`?a+=VEe(E):h===`
|
||||
`&&(a+=VEe(n)))}return a};zEe.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
|
||||
`).split(`
|
||||
`).map(o=>mEt(o,e,r)).join(`
|
||||
`)});var $Ee=_((NKt,ZEe)=>{"use strict";var XEe="[\uD800-\uDBFF][\uDC00-\uDFFF]",yEt=t=>t&&t.exact?new RegExp(`^${XEe}$`):new RegExp(XEe,"g");ZEe.exports=yEt});var T6=_((LKt,nCe)=>{"use strict";var EEt=S6(),CEt=$Ee(),eCe=aI(),rCe=["\x1B","\x9B"],Mk=t=>`${rCe[0]}[${t}m`,tCe=(t,e,r)=>{let o=[];t=[...t];for(let a of t){let n=a;a.match(";")&&(a=a.split(";")[0][0]+"0");let u=eCe.codes.get(parseInt(a,10));if(u){let A=t.indexOf(u.toString());A>=0?t.splice(A,1):o.push(Mk(e?u:n))}else if(e){o.push(Mk(0));break}else o.push(Mk(n))}if(e&&(o=o.filter((a,n)=>o.indexOf(a)===n),r!==void 0)){let a=Mk(eCe.codes.get(parseInt(r,10)));o=o.reduce((n,u)=>u===a?[u,...n]:[...n,u],[])}return o.join("")};nCe.exports=(t,e,r)=>{let o=[...t.normalize()],a=[];r=typeof r=="number"?r:o.length;let n=!1,u,A=0,p="";for(let[h,E]of o.entries()){let I=!1;if(rCe.includes(E)){let v=/\d[^m]*/.exec(t.slice(h,h+18));u=v&&v.length>0?v[0]:void 0,A<r&&(n=!0,u!==void 0&&a.push(u))}else n&&E==="m"&&(n=!1,I=!0);if(!n&&!I&&++A,!CEt({exact:!0}).test(E)&&EEt(E.codePointAt())&&++A,A>e&&A<=r)p+=E;else if(A===e&&!n&&u!==void 0)p=tCe(a);else if(A>=r){p+=tCe(a,!0,u);break}}return p}});var sCe=_((MKt,iCe)=>{"use strict";var Nh=T6(),wEt=Lk();function Ok(t,e,r){if(t.charAt(e)===" ")return e;for(let o=1;o<=3;o++)if(r){if(t.charAt(e+o)===" ")return e+o}else if(t.charAt(e-o)===" ")return e-o;return e}iCe.exports=(t,e,r)=>{r={position:"end",preferTruncationOnSpace:!1,...r};let{position:o,space:a,preferTruncationOnSpace:n}=r,u="\u2026",A=1;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof e!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof e}`);if(e<1)return"";if(e===1)return u;let p=wEt(t);if(p<=e)return t;if(o==="start"){if(n){let h=Ok(t,p-e+1,!0);return u+Nh(t,h,p).trim()}return a===!0&&(u+=" ",A=2),u+Nh(t,p-e+A,p)}if(o==="middle"){a===!0&&(u=" "+u+" ",A=3);let h=Math.floor(e/2);if(n){let E=Ok(t,h),I=Ok(t,p-(e-h)+1,!0);return Nh(t,0,E)+u+Nh(t,I,p).trim()}return Nh(t,0,h)+u+Nh(t,p-(e-h)+A,p)}if(o==="end"){if(n){let h=Ok(t,e-1);return Nh(t,0,h)+u}return a===!0&&(u=" "+u,A=2),Nh(t,0,e-A)+u}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${o}`)}});var L6=_(z2=>{"use strict";var oCe=z2&&z2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z2,"__esModule",{value:!0});var IEt=oCe(JEe()),BEt=oCe(sCe()),N6={};z2.default=(t,e,r)=>{let o=t+String(e)+String(r);if(N6[o])return N6[o];let a=t;if(r==="wrap"&&(a=IEt.default(t,e,{trim:!1,hard:!0})),r.startsWith("truncate")){let n="end";r==="truncate-middle"&&(n="middle"),r==="truncate-start"&&(n="start"),a=BEt.default(t,e,{position:n})}return N6[o]=a,a}});var O6=_(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});var aCe=t=>{let e="";if(t.childNodes.length>0)for(let r of t.childNodes){let o="";r.nodeName==="#text"?o=r.nodeValue:((r.nodeName==="ink-text"||r.nodeName==="ink-virtual-text")&&(o=aCe(r)),o.length>0&&typeof r.internal_transform=="function"&&(o=r.internal_transform(o))),e+=o}return e};M6.default=aCe});var U6=_(pi=>{"use strict";var J2=pi&&pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});pi.setTextNodeValue=pi.createTextNode=pi.setStyle=pi.setAttribute=pi.removeChildNode=pi.insertBeforeNode=pi.appendChildNode=pi.createNode=pi.TEXT_NAME=void 0;var vEt=J2(Jg()),lCe=J2(WEe()),DEt=J2(KEe()),PEt=J2(L6()),SEt=J2(O6());pi.TEXT_NAME="#text";pi.createNode=t=>{var e;let r={nodeName:t,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:t==="ink-virtual-text"?void 0:vEt.default.Node.create()};return t==="ink-text"&&((e=r.yogaNode)===null||e===void 0||e.setMeasureFunc(bEt.bind(null,r))),r};pi.appendChildNode=(t,e)=>{var r;e.parentNode&&pi.removeChildNode(e.parentNode,e),e.parentNode=t,t.childNodes.push(e),e.yogaNode&&((r=t.yogaNode)===null||r===void 0||r.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&Uk(t)};pi.insertBeforeNode=(t,e,r)=>{var o,a;e.parentNode&&pi.removeChildNode(e.parentNode,e),e.parentNode=t;let n=t.childNodes.indexOf(r);if(n>=0){t.childNodes.splice(n,0,e),e.yogaNode&&((o=t.yogaNode)===null||o===void 0||o.insertChild(e.yogaNode,n));return}t.childNodes.push(e),e.yogaNode&&((a=t.yogaNode)===null||a===void 0||a.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&Uk(t)};pi.removeChildNode=(t,e)=>{var r,o;e.yogaNode&&((o=(r=e.parentNode)===null||r===void 0?void 0:r.yogaNode)===null||o===void 0||o.removeChild(e.yogaNode)),e.parentNode=null;let a=t.childNodes.indexOf(e);a>=0&&t.childNodes.splice(a,1),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&Uk(t)};pi.setAttribute=(t,e,r)=>{t.attributes[e]=r};pi.setStyle=(t,e)=>{t.style=e,t.yogaNode&&DEt.default(t.yogaNode,e)};pi.createTextNode=t=>{let e={nodeName:"#text",nodeValue:t,yogaLine truncated
|
||||
`:`
|
||||
`)+r,a=o+1,o=t.indexOf(`
|
||||
`,a)}while(o!==-1);return n+=t.substr(a),n};wCe.exports={stringReplaceAll:FEt,stringEncaseCRLFWithFirstIndex:REt}});var SCe=_((KKt,PCe)=>{"use strict";var TEt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,BCe=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,NEt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,LEt=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,MEt=new Map([["n",`
|
||||
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function DCe(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):MEt.get(t)||t}function OEt(t,e){let r=[],o=e.trim().split(/\s*,\s*/g),a;for(let n of o){let u=Number(n);if(!Number.isNaN(u))r.push(u);else if(a=n.match(NEt))r.push(a[2].replace(LEt,(A,p,h)=>p?DCe(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function UEt(t){BCe.lastIndex=0;let e=[],r;for(;(r=BCe.exec(t))!==null;){let o=r[1];if(r[2]){let a=OEt(o,r[2]);e.push([o].concat(a))}else e.push([o])}return e}function vCe(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let o=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in o))throw new Error(`Unknown Chalk style: ${a}`);o=n.length>0?o[a](...n):o[a]}return o}PCe.exports=(t,e)=>{let r=[],o=[],a=[];if(e.replace(TEt,(n,u,A,p,h,E)=>{if(u)a.push(DCe(u));else if(p){let I=a.join("");a=[],o.push(r.length===0?I:vCe(t,r)(I)),r.push({inverse:A,styles:UEt(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");o.push(vCe(t,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),o.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return o.join("")}});var Yk=_((VKt,RCe)=>{"use strict";var $2=aI(),{stdout:q6,stderr:j6}=aN(),{stringReplaceAll:_Et,stringEncaseCRLFWithFirstIndex:HEt}=ICe(),{isArray:Hk}=Array,xCe=["ansi","ansi","ansi256","ansi16m"],nC=Object.create(null),qEt=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=q6?q6.level:0;t.level=e.level===void 0?r:e.level},G6=class{constructor(e){return kCe(e)}},kCe=t=>{let e={};return qEt(e,t),e.template=(...r)=>FCe(e.template,...r),Object.setPrototypeOf(e,qk.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=G6,e.template};function qk(t){return kCe(t)}for(let[t,e]of Object.entries($2))nC[t]={get(){let r=jk(this,Y6(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};nC.visible={get(){let t=jk(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var QCe=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of QCe)nC[t]={get(){let{level:e}=this;return function(...r){let o=Y6($2.color[xCe[e]][t](...r),$2.color.close,this._styler);return jk(this,o,this._isEmpty)}}};for(let t of QCe){let e="bg"+t[0].toUpperCase()+t.slice(1);nC[e]={get(){let{level:r}=this;return function(...o){let a=Y6($2.bgColor[xCe[r]][t](...o),$2.bgColor.close,this._styler);return jk(this,a,this._isEmpty)}}}}var jEt=Object.defineProperties(()=>{},{...nC,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),Y6=(t,e,r)=>{let o,a;return r===void 0?(o=t,a=e):(o=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:a,parent:r}},jk=(t,e,r)=>{let o=(...a)=>Hk(a[0])&&Hk(a[0].raw)?bCe(o,FCe(o,...a)):bCe(o,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(o,jEt),o._generator=t,o._styler=e,o._isEmpty=r,o},bCe=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:o,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=_Et(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
|
||||
`);return n!==-1&&(e=HEt(e,a,o,n)),o+e+a},H6,FCe=(t,...e)=>{let[r]=e;if(!Hk(r)||!Hk(r.raw))return e.join(" ");let o=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(o[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return H6===void 0&&(H6=SCe()),H6(t,a.join(""))};Object.defineProperties(qk.prototype,nC);var Gk=qk();Gk.supportsColor=q6;Gk.stderr=qk({level:j6?j6.level:0});Gk.stderr.supportsColor=j6;RCe.exports=Gk});var W6=_(tB=>{"use strict";var GEt=tB&&tB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tB,"__esModule",{value:!0});var eB=GEt(Yk()),YEt=/^(rgb|hsl|hsv|hwb)\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,WEt=/^(ansi|ansi256)\(\s?(\d+)\s?\)$/,Wk=(t,e)=>e==="foreground"?t:"bg"+t[0].toUpperCase()+t.slice(1);tB.default=(t,e,r)=>{if(!e)return t;if(e in eB.default){let a=Wk(e,r);return eB.default[a](t)}if(e.startsWith("#")){let a=Wk("hex",r);return eB.default[a](e)(t)}if(e.startsWith("ansi")){let a=WEt.exec(e);if(!a)return t;let n=Wk(a[1],r),u=Number(a[2]);return eB.default[n](u)(t)}if(e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("hsv")||e.startsWith("hwb")){let a=YEt.exec(e);if(!a)return t;let n=Wk(a[1],r),u=Number(a[2]),A=Number(a[3]),p=Number(a[4]);return eB.default[n](u,A,p)(t)}return t}});var NCe=_(rB=>{"use strict";var TCe=rB&&rB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rB,"__esModule",{value:!0});var KEt=TCe(CCe()),K6=TCe(W6());rB.default=(t,e,r,o)=>{if(typeof r.style.borderStyle=="string"){let a=r.yogaNode.getComputedWidth(),n=r.yogaNode.getComputedHeight(),u=r.style.borderColor,A=KEt.default[r.style.borderStyle],p=K6.default(A.topLeft+A.horizontal.repeat(a-2)+A.topRight,u,"foreground"),h=(K6.default(A.vertical,u,"foreground")+`
|
||||
`).repeat(n-2),E=K6.default(A.bottomLeft+A.horizontal.repeat(a-2)+A.bottomRight,u,"foreground");o.write(t,e,p,{transformers:[]}),o.write(t,e+1,h,{transformers:[]}),o.write(t+a-1,e+1,h,{transformers:[]}),o.write(t,e+n-1,E,{transformers:[]})}}});var MCe=_(nB=>{"use strict";var Xg=nB&&nB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nB,"__esModule",{value:!0});var VEt=Xg(Jg()),zEt=Xg(k6()),JEt=Xg(dCe()),XEt=Xg(L6()),ZEt=Xg(mCe()),$Et=Xg(O6()),eCt=Xg(NCe()),tCt=(t,e)=>{var r;let o=(r=t.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(o){let a=o.getComputedLeft(),n=o.getComputedTop();e=`
|
||||
`.repeat(n)+JEt.default(e,a)}return e},LCe=(t,e,r)=>{var o;let{offsetX:a=0,offsetY:n=0,transformers:u=[],skipStaticElements:A}=r;if(A&&t.internal_static)return;let{yogaNode:p}=t;if(p){if(p.getDisplay()===VEt.default.DISPLAY_NONE)return;let h=a+p.getComputedLeft(),E=n+p.getComputedTop(),I=u;if(typeof t.internal_transform=="function"&&(I=[t.internal_transform,...u]),t.nodeName==="ink-text"){let v=$Et.default(t);if(v.length>0){let x=zEt.default(v),C=ZEt.default(p);if(x>C){let R=(o=t.style.textWrap)!==null&&o!==void 0?o:"wrap";v=XEt.default(v,C,R)}v=tCt(t,v),e.write(h,E,v,{transformers:I})}return}if(t.nodeName==="ink-box"&&eCt.default(h,E,t,e),t.nodeName==="ink-root"||t.nodeName==="ink-box")for(let v of t.childNodes)LCe(v,e,{offsetX:h,offsetY:E,transformers:I,skipStaticElements:A})}};nB.default=LCe});var UCe=_((ZKt,OCe)=>{"use strict";OCe.exports=t=>{t=Object.assign({onlyFirst:!1},t);let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t.onlyFirst?void 0:"g")}});var HCe=_(($Kt,V6)=>{"use strict";var rCt=UCe(),_Ce=t=>typeof t=="string"?t.replace(rCt(),""):t;V6.exports=_Ce;V6.exports.default=_Ce});var GCe=_((eVt,jCe)=>{"use strict";var qCe="[\uD800-\uDBFF][\uDC00-\uDFFF]";jCe.exports=t=>t&&t.exact?new RegExp(`^${qCe}$`):new RegExp(qCe,"g")});var WCe=_((tVt,z6)=>{"use strict";var nCt=HCe(),iCt=GCe(),YCe=t=>nCt(t).replace(iCt()," ").length;z6.exports=YCe;z6.exports.default=YCe});var zCe=_(iB=>{"use strict";var VCe=iB&&iB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iB,"__esModule",{value:!0});var KCe=VCe(T6()),sCt=VCe(WCe()),J6=class{constructor(e){this.writes=[];let{width:r,height:o}=e;this.width=r,this.height=o}write(e,r,o,a){let{transformers:n}=a;o&&this.writes.push({x:e,y:r,text:o,transformers:n})}get(){let e=[];for(let o=0;o<this.height;o++)e.push(" ".repeat(this.width));for(let o of this.writes){let{x:a,y:n,text:u,transformers:A}=o,p=u.split(`
|
||||
`),h=0;for(let E of p){let I=e[n+h];if(!I)continue;let v=sCt.default(E);for(let x of A)E=x(E);e[n+h]=KCe.default(I,0,a)+E+KCe.default(I,a+v),h++}}return{output:e.map(o=>o.trimRight()).join(`
|
||||
`),height:e.length}}};iB.default=J6});var ZCe=_(sB=>{"use strict";var X6=sB&&sB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sB,"__esModule",{value:!0});var oCt=X6(Jg()),JCe=X6(MCe()),XCe=X6(zCe());sB.default=(t,e)=>{var r;if(t.yogaNode.setWidth(e),t.yogaNode){t.yogaNode.calculateLayout(void 0,void 0,oCt.default.DIRECTION_LTR);let o=new XCe.default({width:t.yogaNode.getComputedWidth(),height:t.yogaNode.getComputedHeight()});JCe.default(t,o,{skipStaticElements:!0});let a;!((r=t.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new XCe.default({width:t.staticNode.yogaNode.getComputedWidth(),height:t.staticNode.yogaNode.getComputedHeight()}),JCe.default(t.staticNode,a,{skipStaticElements:!1}));let{output:n,height:u}=o.get();return{output:n,outputHeight:u,staticOutput:a?`${a.get().output}
|
||||
`:""}}return{output:"",outputHeight:0,staticOutput:""}}});var rwe=_((iVt,twe)=>{"use strict";var $Ce=ve("stream"),ewe=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],Z6={},aCt=t=>{let e=new $Ce.PassThrough,r=new $Ce.PassThrough;e.write=a=>t("stdout",a),r.write=a=>t("stderr",a);let o=new console.Console(e,r);for(let a of ewe)Z6[a]=console[a],console[a]=o[a];return()=>{for(let a of ewe)console[a]=Z6[a];Z6={}}};twe.exports=aCt});var eq=_($6=>{"use strict";Object.defineProperty($6,"__esModule",{value:!0});$6.default=new WeakMap});var rq=_(tq=>{"use strict";Object.defineProperty(tq,"__esModule",{value:!0});var lCt=an(),nwe=lCt.createContext({exit:()=>{}});nwe.displayName="InternalAppContext";tq.default=nwe});var iq=_(nq=>{"use strict";Object.defineProperty(nq,"__esModule",{value:!0});var cCt=an(),iwe=cCt.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});iwe.displayName="InternalStdinContext";nq.default=iwe});var oq=_(sq=>{"use strict";Object.defineProperty(sq,"__esModule",{value:!0});var uCt=an(),swe=uCt.createContext({stdout:void 0,write:()=>{}});swe.displayName="InternalStdoutContext";sq.default=swe});var lq=_(aq=>{"use strict";Object.defineProperty(aq,"__esModule",{value:!0});var ACt=an(),owe=ACt.createContext({stderr:void 0,write:()=>{}});owe.displayName="InternalStderrContext";aq.default=owe});var Kk=_(cq=>{"use strict";Object.defineProperty(cq,"__esModule",{value:!0});var fCt=an(),awe=fCt.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{}});awe.displayName="InternalFocusContext";cq.default=awe});var cwe=_((AVt,lwe)=>{"use strict";var pCt=/[|\\{}()[\]^$+*?.-]/g;lwe.exports=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(pCt,"\\$&")}});var pwe=_((fVt,fwe)=>{"use strict";var hCt=cwe(),gCt=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",Awe=[].concat(ve("module").builtinModules,"bootstrap_node","node").map(t=>new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`));Awe.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var uq=class t{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=t.nodeInternals()),"cwd"in e||(e.cwd=gCt),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,dCt(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...Awe]}clean(e,r=0){r=" ".repeat(r),Array.isArray(e)||(e=e.split(`
|
||||
`)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let o=!1,a=null,n=[];return e.forEach(u=>{if(u=u.replace(/\\/g,"/"),this._internals.some(p=>p.test(u)))return;let A=/^\s*at /.test(u);o?u=u.trimEnd().replace(/^(\s+)at /,"$1"):(u=u.trim(),A&&(u=u.slice(3))),u=u.replace(`${this._cwd}/`,""),u&&(A?(a&&(n.push(a),a=null),n.push(u)):(o=!0,a=u))}),n.map(u=>`${r}${u}
|
||||
`).join("")}captureString(e,r=this.captureString){typeof e=="function"&&(r=e,e=1/0);let{stackTraceLimit:o}=Error;e&&(Error.stackTraceLimit=e);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=o,this.clean(n)}capture(e,r=this.capture){typeof e=="function"&&(r=e,e=1/0);let{prepareStackTrace:o,stackTraceLimit:a}=Error;Error.prepareStackTrace=(A,p)=>this._wrapCallSite?p.map(this._wrapCallSite):p,e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,r);let{stack:u}=n;return Object.assign(Error,{prepareStackTrace:o,stackTraceLimit:a}),u}at(e=this.at){let[r]=this.capture(1,e);if(!r)return{};let o={line:r.getLineNumber(),column:r.getColumnNumber()};uwe(o,r.getFileName(),this._cwd),r.isConstructor()&&(o.constructor=!0),r.isEval()&&(o.evalOrigin=r.getEvalOrigin()),r.isNative()&&(o.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!=="Object"&&a!=="[object Object]"&&(o.type=a);let n=r.getFunctionName();n&&(o.function=n);let u=r.getMethodName();return u&&n!==u&&(o.method=u),o}parseLine(e){let r=e&&e.match(mCt);if(!r)return null;let o=r[1]==="new",a=r[2],n=r[3],u=r[4],A=Number(r[5]),p=Number(r[6]),h=r[7],E=r[8],I=r[9],v=r[10]==="native",x=r[11]===")",C,R={};if(E&&(R.line=Number(E)),I&&(R.column=Number(I)),x&&h){let L=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===")")L++;else if(h.charAt(U)==="("&&h.charAt(U-1)===" "&&(L--,L===-1&&h.charAt(U-1)===" ")){let z=h.slice(0,U-1);h=h.slice(U+1),a+=` (${z}`;break}}if(a){let L=a.match(yCt);L&&(a=L[1],C=L[2])}return uwe(R,h,this._cwd),o&&(R.constructor=!0),n&&(R.evalOrigin=n,R.evalLine=A,R.evalColumn=p,R.evalFile=u&&u.replace(/\\/g,"/")),v&&(R.native=!0),a&&(R.function=a),C&&a!==C&&(R.method=C),R}};function uwe(t,e,r){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${r}/`)&&(e=e.slice(r.length+1)),t.file=e)}function dCt(t){if(t.length===0)return[];let e=t.map(r=>hCt(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var mCt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),yCt=/^(.*?) \[as (.*?)\]$/;fwe.exports=uq});var gwe=_((pVt,hwe)=>{"use strict";hwe.exports=(t,e)=>t.replace(/^\t+/gm,r=>" ".repeat(r.length*(e||2)))});var mwe=_((hVt,dwe)=>{"use strict";var ECt=gwe(),CCt=(t,e)=>{let r=[],o=t-e,a=t+e;for(let n=o;n<=a;n++)r.push(n);return r};dwe.exports=(t,e,r)=>{if(typeof t!="string")throw new TypeError("Source code is missing.");if(!e||e<1)throw new TypeError("Line number must start from `1`.");if(t=ECt(t).split(/\r?\n/),!(e>t.length))return r={around:3,...r},CCt(e,r.around).filter(o=>t[o-1]!==void 0).map(o=>({line:o,value:t[o-1]}))}});var Vk=_(iu=>{"use strict";var wCt=iu&&iu.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),ICt=iu&&iu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BCt=iu&&iu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&wCt(e,t,r);return ICt(e,t),e},vCt=iu&&iu.__rest||function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(r[o[a]]=t[o[a]]);return r};Object.defineProperty(iu,"__esModule",{value:!0});var ywe=BCt(an()),Aq=ywe.forwardRef((t,e)=>{var{children:r}=t,o=vCt(t,["children"]);let a=Object.assign(Object.assign({},o),{marginLeft:o.marginLeft||o.marginX||o.margin||0,marginRight:o.marginRight||o.marginX||o.margin||0,marginTop:o.marginTop||o.marginY||o.margin||0,marginBottom:o.marginBottom||o.marginY||o.margin||0,paddingLeft:o.paddingLeft||o.paddingX||o.padding||0,paddingRight:o.paddingRight||o.paddingX||o.padding||0,paddingTop:o.paddingTop||o.paddingY||o.padding||0,paddingBottom:o.paddingBottom||o.paddingY||o.padding||0});return ywe.default.createElement("ink-box",{ref:e,style:a},r)});Aq.displayName="Box";Aq.defaultProps={flexDirection:"row",flexGrow:0,flexShrink:1};iu.default=Aq});var hq=_(oB=>{"use strict";var fq=oB&&oB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oB,"__esModule",{value:!0});var DCt=fq(an()),iC=fq(Yk()),Ewe=fq(W6()),pq=({color:t,backgroundColor:e,dimColor:r,bold:o,italic:a,underline:n,strikethrough:u,inverse:A,wrap:p,children:h})=>{if(h==null)return null;let E=I=>(r&&(I=iC.default.dim(I)),t&&(I=Ewe.default(I,t,"foreground")),e&&(I=Ewe.default(I,e,"background")),o&&(I=iC.default.bold(I)),a&&(I=iC.default.italic(I)),n&&(I=iC.default.underline(I)),u&&(I=iC.default.strikethrough(I)),A&&(I=iC.default.inverse(I)),I);return DCt.default.createElement("ink-text",{style:{flexGrow:0,flexSLine truncated
|
||||
`).slice(1):void 0,r=e?Iwe.parseLine(e[0]):void 0,o,a=0;if(r?.file&&r?.line&&Cwe.existsSync(r.file)){let n=Cwe.readFileSync(r.file,"utf8");if(o=xCt.default(n,r.line),o)for(let{line:u}of o)a=Math.max(a,String(u).length)}return hs.default.createElement(Vf.default,{flexDirection:"column",padding:1},hs.default.createElement(Vf.default,null,hs.default.createElement(hA.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),hs.default.createElement(hA.default,null," ",t.message)),r&&hs.default.createElement(Vf.default,{marginTop:1},hs.default.createElement(hA.default,{dimColor:!0},r.file,":",r.line,":",r.column)),r&&o&&hs.default.createElement(Vf.default,{marginTop:1,flexDirection:"column"},o.map(({line:n,value:u})=>hs.default.createElement(Vf.default,{key:n},hs.default.createElement(Vf.default,{width:a+1},hs.default.createElement(hA.default,{dimColor:n!==r.line,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0},String(n).padStart(a," "),":")),hs.default.createElement(hA.default,{key:n,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0}," "+u)))),t.stack&&hs.default.createElement(Vf.default,{marginTop:1,flexDirection:"column"},t.stack.split(`
|
||||
`).slice(1).map(n=>{let u=Iwe.parseLine(n);return u?hs.default.createElement(Vf.default,{key:n},hs.default.createElement(hA.default,{dimColor:!0},"- "),hs.default.createElement(hA.default,{dimColor:!0,bold:!0},u.function),hs.default.createElement(hA.default,{dimColor:!0,color:"gray"}," ","(",u.file,":",u.line,":",u.column,")")):hs.default.createElement(Vf.default,{key:n},hs.default.createElement(hA.default,{dimColor:!0},"- "),hs.default.createElement(hA.default,{dimColor:!0,bold:!0},n))})))};su.default=kCt});var Dwe=_(ou=>{"use strict";var QCt=ou&&ou.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),FCt=ou&&ou.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),RCt=ou&&ou.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&QCt(e,t,r);return FCt(e,t),e},$g=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var Zg=RCt(an()),vwe=$g(u6()),TCt=$g(rq()),NCt=$g(iq()),LCt=$g(oq()),MCt=$g(lq()),OCt=$g(Kk()),UCt=$g(Bwe()),_Ct=" ",HCt="\x1B[Z",qCt="\x1B",zk=class extends Zg.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
|
||||
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.
|
||||
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),e){this.rawModeEnabledCount===0&&(r.addListener("data",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("data",this.handleInput),r.pause())},this.handleInput=e=>{e===""&&this.props.exitOnCtrlC&&this.handleExit(),e===qCt&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===_Ct&&this.focusNext(),e===HCt&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focusNext=()=>{this.setState(e=>{let r=e.focusables[0].id;return{activeFocusId:this.findNextFocusable(e)||r}})},this.focusPrevious=()=>{this.setState(e=>{let r=e.focusables[e.focusables.length-1].id;return{activeFocusId:this.findPreviousFocusable(e)||r}})},this.addFocusable=(e,{autoFocus:r})=>{this.setState(o=>{let a=o.activeFocusId;return!a&&r&&(a=e),{activeFocusId:a,focusables:[...o.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.filter(o=>o.id!==e)}))},this.activateFocusable=e=>{this.setState(r=>({focusables:r.focusables.map(o=>o.id!==e?o:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.map(o=>o.id!==e?o:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{let r=e.focusables.findIndex(o=>o.id===e.activeFocusId);for(let o=r+1;o<e.focusables.length;o++)if(e.focusables[o].isActive)return e.focusables[o].id},this.findPreviousFocusable=e=>{let r=e.focusables.findIndex(o=>o.id===e.activeFocusId);for(let o=r-1;o>=0;o--)if(e.focusables[o].isActive)return e.focusables[o].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return Zg.default.createElement(TCt.default.Provider,{value:{exit:this.handleExit}},Zg.default.createElement(NCt.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},Zg.default.createElement(LCt.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},Zg.default.createElement(MCt.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},Zg.default.createElement(OCt.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious}},this.state.error?Zg.default.createElement(UCt.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){vwe.default.hide(this.props.stdout)}componentWillUnmount(){vwe.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}};ou.default=zk;zk.displayName="InternalApp"});var bwe=_(au=>{"use strict";var jCt=au&&au.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),GCt=au&&au.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),YCt=au&&au.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&jCt(e,t,r);return GCt(e,t),e},lu=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var WCt=lu(an()),Pwe=eO(),KCt=lu(pEe()),VCt=lu(s6()),zCt=lu(EEe()),JCt=lu(wEe()),gq=lu(hCe()),XCt=lu(ZCe()),ZCt=lu(c6()),$Ct=lu(rwe()),ewt=YCt(U6()),twt=lu(eq()),rwt=lu(Dwe()),sC=process.env.CI==="false"?!1:zCt.default,Swe=()=>{},dq=class{constructor(e){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:r,outputHeight:o,staticOutput:a}=XCt.default(this.rootNode,this.options.stdout.columns||80),n=a&&a!==`
|
||||
`;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(sC){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),o>=this.options.stdout.rows){this.options.stdout.write(VCt.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},JCt.default(this),this.options=e,this.rootNode=ewt.createNode("ink-root"),this.rootNode.onRender=e.debug?this.onRender:Pwe(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=KCt.default.create(e.stdout),this.throttledLog=e.debug?this.log:Pwe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=gq.default.createContainer(this.rootNode,!1,!1),this.unsubscribeExit=ZCt.default(this.unmount,{alwaysLast:!1}),e.patchConsole&&this.patchConsole(),sC||(e.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{e.stdout.off("resize",this.onRender)})}render(e){let r=WCt.default.createElement(rwt.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);gq.default.updateContainer(r,this.container,null,Swe)}writeToStdout(e){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput);return}if(sC){this.options.stdout.write(e);return}this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)}}writeToStderr(e){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(e),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(sC){this.options.stderr.write(e);return}this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)}}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),sC?this.options.stdout.write(this.lastOutput+`
|
||||
`):this.options.debug||this.log.done(),this.isUnmounted=!0,gq.default.updateContainer(null,this.container,null,Swe),twt.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,r)=>{this.resolveExitPromise=e,this.rejectExitPromise=r})),this.exitPromise}clear(){!sC&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=$Ct.default((e,r)=>{e==="stdout"&&this.writeToStdout(r),e==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};au.default=dq});var kwe=_(lB=>{"use strict";var xwe=lB&&lB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lB,"__esModule",{value:!0});var nwt=xwe(bwe()),Jk=xwe(eq()),iwt=ve("stream"),swt=(t,e)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},owt(e)),o=awt(r.stdout,()=>new nwt.default(r));return o.render(t),{rerender:o.render,unmount:()=>o.unmount(),waitUntilExit:o.waitUntilExit,cleanup:()=>Jk.default.delete(r.stdout),clear:o.clear}};lB.default=swt;var owt=(t={})=>t instanceof iwt.Stream?{stdout:t,stdin:process.stdin}:t,awt=(t,e)=>{let r;return Jk.default.has(t)?r=Jk.default.get(t):(r=e(),Jk.default.set(t,r)),r}});var Fwe=_(zf=>{"use strict";var lwt=zf&&zf.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),cwt=zf&&zf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uwt=zf&&zf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&lwt(e,t,r);return cwt(e,t),e};Object.defineProperty(zf,"__esModule",{value:!0});var cB=uwt(an()),Qwe=t=>{let{items:e,children:r,style:o}=t,[a,n]=cB.useState(0),u=cB.useMemo(()=>e.slice(a),[e,a]);cB.useLayoutEffect(()=>{n(e.length)},[e.length]);let A=u.map((h,E)=>r(h,a+E)),p=cB.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},o),[o]);return cB.default.createElement("ink-box",{internal_static:!0,style:p},A)};Qwe.displayName="Static";zf.default=Qwe});var Twe=_(uB=>{"use strict";var Awt=uB&&uB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uB,"__esModule",{value:!0});var fwt=Awt(an()),Rwe=({children:t,transform:e})=>t==null?null:fwt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:e},t);Rwe.displayName="Transform";uB.default=Rwe});var Lwe=_(AB=>{"use strict";var pwt=AB&&AB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(AB,"__esModule",{value:!0});var hwt=pwt(an()),Nwe=({count:t=1})=>hwt.default.createElement("ink-text",null,`
|
||||
`.repeat(t));Nwe.displayName="Newline";AB.default=Nwe});var Uwe=_(fB=>{"use strict";var Mwe=fB&&fB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fB,"__esModule",{value:!0});var gwt=Mwe(an()),dwt=Mwe(Vk()),Owe=()=>gwt.default.createElement(dwt.default,{flexGrow:1});Owe.displayName="Spacer";fB.default=Owe});var Xk=_(pB=>{"use strict";var mwt=pB&&pB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pB,"__esModule",{value:!0});var ywt=an(),Ewt=mwt(iq()),Cwt=()=>ywt.useContext(Ewt.default);pB.default=Cwt});var Hwe=_(hB=>{"use strict";var wwt=hB&&hB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hB,"__esModule",{value:!0});var _we=an(),Iwt=wwt(Xk()),Bwt=(t,e={})=>{let{stdin:r,setRawMode:o,internal_exitOnCtrlC:a}=Iwt.default();_we.useEffect(()=>{if(e.isActive!==!1)return o(!0),()=>{o(!1)}},[e.isActive,o]),_we.useEffect(()=>{if(e.isActive===!1)return;let n=u=>{let A=String(u),p={upArrow:A==="\x1B[A",downArrow:A==="\x1B[B",leftArrow:A==="\x1B[D",rightArrow:A==="\x1B[C",pageDown:A==="\x1B[6~",pageUp:A==="\x1B[5~",return:A==="\r",escape:A==="\x1B",ctrl:!1,shift:!1,tab:A===" "||A==="\x1B[Z",backspace:A==="\b",delete:A==="\x7F"||A==="\x1B[3~",meta:!1};A<=""&&!p.return&&(A=String.fromCharCode(A.charCodeAt(0)+97-1),p.ctrl=!0),A.startsWith("\x1B")&&(A=A.slice(1),p.meta=!0);let h=A>="A"&&A<="Z",E=A>="\u0410"&&A<="\u042F";A.length===1&&(h||E)&&(p.shift=!0),p.tab&&A==="[Z"&&(p.shift=!0),(p.tab||p.backspace||p.delete)&&(A=""),(!(A==="c"&&p.ctrl)||!a)&&t(A,p)};return r?.on("data",n),()=>{r?.off("data",n)}},[e.isActive,r,a,t])};hB.default=Bwt});var qwe=_(gB=>{"use strict";var vwt=gB&&gB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gB,"__esModule",{value:!0});var Dwt=an(),Pwt=vwt(rq()),Swt=()=>Dwt.useContext(Pwt.default);gB.default=Swt});var jwe=_(dB=>{"use strict";var bwt=dB&&dB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dB,"__esModule",{value:!0});var xwt=an(),kwt=bwt(oq()),Qwt=()=>xwt.useContext(kwt.default);dB.default=Qwt});var Gwe=_(mB=>{"use strict";var Fwt=mB&&mB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mB,"__esModule",{value:!0});var Rwt=an(),Twt=Fwt(lq()),Nwt=()=>Rwt.useContext(Twt.default);mB.default=Nwt});var Wwe=_(EB=>{"use strict";var Ywe=EB&&EB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(EB,"__esModule",{value:!0});var yB=an(),Lwt=Ywe(Kk()),Mwt=Ywe(Xk()),Owt=({isActive:t=!0,autoFocus:e=!1}={})=>{let{isRawModeSupported:r,setRawMode:o}=Mwt.default(),{activeId:a,add:n,remove:u,activate:A,deactivate:p}=yB.useContext(Lwt.default),h=yB.useMemo(()=>Math.random().toString().slice(2,7),[]);return yB.useEffect(()=>(n(h,{autoFocus:e}),()=>{u(h)}),[h,e]),yB.useEffect(()=>{t?A(h):p(h)},[t,h]),yB.useEffect(()=>{if(!(!r||!t))return o(!0),()=>{o(!1)}},[t]),{isFocused:!!h&&a===h}};EB.default=Owt});var Kwe=_(CB=>{"use strict";var Uwt=CB&&CB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(CB,"__esModule",{value:!0});var _wt=an(),Hwt=Uwt(Kk()),qwt=()=>{let t=_wt.useContext(Hwt.default);return{enableFocus:t.enableFocus,disableFocus:t.disableFocus,focusNext:t.focusNext,focusPrevious:t.focusPrevious}};CB.default=qwt});var Vwe=_(mq=>{"use strict";Object.defineProperty(mq,"__esModule",{value:!0});mq.default=t=>{var e,r,o,a;return{width:(r=(e=t.yogaNode)===null||e===void 0?void 0:e.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(o=t.yogaNode)===null||o===void 0?void 0:o.getComputedHeight())!==null&&a!==void 0?a:0}}});var ic=_(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});var jwt=kwe();Object.defineProperty(ro,"render",{enumerable:!0,get:function(){return jwt.default}});var Gwt=Vk();Object.defineProperty(ro,"Box",{enumerable:!0,get:function(){return Gwt.default}});var Ywt=hq();Object.defineProperty(ro,"Text",{enumerable:!0,get:function(){return Ywt.default}});var Wwt=Fwe();Object.defineProperty(ro,"Static",{enumerable:!0,get:function(){return Wwt.default}});var Kwt=Twe();Object.defineProperty(ro,"Transform",{enumerable:!0,get:function(){return Kwt.default}});var Vwt=Lwe();Object.defineProperty(ro,"Newline",{enumerable:!0,get:function(){return Vwt.default}});var zwt=Uwe();Object.defineProperty(ro,"Spacer",{enumerable:!0,get:function(){return zwt.default}});var Jwt=Hwe();Object.defineProperty(ro,"useInput",{enumerable:!0,get:function(){return Jwt.default}});var Xwt=qwe();Object.defineProperty(ro,"useApp",{enumerable:!0,get:function(){return Xwt.default}});var Zwt=Xk();Object.defineProperty(ro,"useStdin",{enumerable:!0,get:function(){return Zwt.default}});var $wt=jwe();Object.defineProperty(ro,"useStdout",{enumerable:!0,get:function(){return $wt.default}});var eIt=Gwe();Object.defineProperty(ro,"useStderr",{enumerable:!0,get:function(){return eIt.default}});var tIt=Wwe();Obj
Line truncated
|
||||
`:"";return u?I+=`@IF EXIST ${u} (\r
|
||||
${u} ${p} ${a} ${E}%*\r
|
||||
) ELSE (\r
|
||||
@SETLOCAL\r
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
|
||||
${A} ${p} ${a} ${E}%*\r
|
||||
)\r
|
||||
`:I+=`@${A} ${p} ${a} ${E}%*\r
|
||||
`,I}function h1t(t,e,r){let o=oc.relative(oc.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n;o=o.split("\\").join("/");let u=oc.isAbsolute(o)?`"${o}"`:`"$basedir/${o}"`,A=r.args||"",p=oj(r.nodePath).posix;a?(n=`"$basedir/${r.prog}"`,o=u):(a=u,A="",o="");let h=r.progArgs?`${r.progArgs.join(" ")} `:"",E=`#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
|
||||
|
||||
case \`uname\` in
|
||||
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
|
||||
esac
|
||||
|
||||
`,I=r.nodePath?`export NODE_PATH="${p}"
|
||||
`:"";return n?E+=`${I}if [ -x ${n} ]; then
|
||||
exec ${n} ${A} ${o} ${h}"$@"
|
||||
else
|
||||
exec ${a} ${A} ${o} ${h}"$@"
|
||||
fi
|
||||
`:E+=`${I}${a} ${A} ${o} ${h}"$@"
|
||||
exit $?
|
||||
`,E}function g1t(t,e,r){let o=oc.relative(oc.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n=a&&`"${a}$exe"`,u;o=o.split("\\").join("/");let A=oc.isAbsolute(o)?`"${o}"`:`"$basedir/${o}"`,p=r.args||"",h=oj(r.nodePath),E=h.win32,I=h.posix;n?(u=`"$basedir/${r.prog}$exe"`,o=A):(n=A,p="",o="");let v=r.progArgs?`${r.progArgs.join(" ")} `:"",x=`#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
${r.nodePath?`$env_node_path=$env:NODE_PATH
|
||||
$env:NODE_PATH="${E}"
|
||||
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}`;return r.nodePath&&(x+=` else {
|
||||
$env:NODE_PATH="${I}"
|
||||
}`),u?x+=`
|
||||
$ret=0
|
||||
if (Test-Path ${u}) {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & ${u} ${p} ${o} ${v}$args
|
||||
} else {
|
||||
& ${u} ${p} ${o} ${v}$args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & ${n} ${p} ${o} ${v}$args
|
||||
} else {
|
||||
& ${n} ${p} ${o} ${v}$args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
||||
`:""}exit $ret
|
||||
`:x+=`
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & ${n} ${p} ${o} ${v}$args
|
||||
} else {
|
||||
& ${n} ${p} ${o} ${v}$args
|
||||
}
|
||||
${r.nodePath?`$env:NODE_PATH=$env_node_path
|
||||
`:""}exit $LASTEXITCODE
|
||||
`,x}function d1t(t,e){return e.fs_.chmod(t,493)}function oj(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(oc.delimiter):Array.from(t),r={};for(let o=0;o<e.length;o++){let a=e[o].split("/").join("\\"),n=l1e()?e[o].split("\\").join("/").replace(/^([^:\\/]*):/,(u,A)=>`/mnt/${A.toLowerCase()}`):e[o];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[o]={win32:a,posix:n}}return r}u1e.exports=sj});var Cj=_((I$t,Q1e)=>{Q1e.exports=ve("stream")});var N1e=_((B$t,T1e)=>{"use strict";function F1e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,o)}return r}function j1t(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?F1e(Object(r),!0).forEach(function(o){G1t(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F1e(Object(r)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}function G1t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y1t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R1e(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function W1t(t,e,r){return e&&R1e(t.prototype,e),r&&R1e(t,r),t}var K1t=ve("buffer"),yQ=K1t.Buffer,V1t=ve("util"),wj=V1t.inspect,z1t=wj&&wj.custom||"inspect";function J1t(t,e,r){yQ.prototype.copy.call(t,e,r)}T1e.exports=function(){function t(){Y1t(this,t),this.head=null,this.tail=null,this.length=0}return W1t(t,[{key:"push",value:function(r){var o={data:r,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length}},{key:"unshift",value:function(r){var o={data:r,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var o=this.head,a=""+o.data;o=o.next;)a+=r+o.data;return a}},{key:"concat",value:function(r){if(this.length===0)return yQ.alloc(0);for(var o=yQ.allocUnsafe(r>>>0),a=this.head,n=0;a;)J1t(a.data,o,n),n+=a.data.length,a=a.next;return o}},{key:"consume",value:function(r,o){var a;return r<this.head.data.length?(a=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?a=this.shift():a=o?this._getString(r):this._getBuffer(r),a}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var o=this.head,a=1,n=o.data;for(r-=n.length;o=o.next;){var u=o.data,A=r>u.length?u.length:r;if(A===u.length?n+=u:n+=u.slice(0,r),r-=A,r===0){A===u.length?(++a,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=u.slice(A));break}++a}return this.length-=a,n}},{key:"_getBuffer",value:function(r){var o=yQ.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(o),r-=a.data.length;a=a.next;){var u=a.data,A=r>u.length?u.length:r;if(u.copy(o,o.length-r,0,A),r-=A,r===0){A===u.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=u.slice(A));break}++n}return this.length-=n,o}},{key:z1t,value:function(r,o){return wj(this,j1t({},o,{depth:0,customInspect:!1}))}}]),t}()});var Bj=_((v$t,M1e)=>{"use strict";function X1t(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ij,this,t)):process.nextTick(Ij,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(n){!e&&n?r._writableState?r._writableState.errorEmitted?process.nextTick(EQ,r):(r._writableState.errorEmitted=!0,process.nextTick(L1e,r,n)):process.nextTick(L1e,r,n):e?(process.nextTick(EQ,r),e(n)):process.nextTick(EQ,r)}),this)}function L1e(t,e){Ij(t,e),EQ(t)}function EQ(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Z1t(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ij(t,e){t.emit("error",e)}function $1t(t,e){var r=t._readableState,o=t._writableState;r&&
Line truncated
|
||||
`)),t.linkname&&(e+=Xj(" linkpath="+t.linkname+`
|
||||
`));var r=t.pax;if(r)for(var o in r)e+=Xj(" "+o+"="+r[o]+`
|
||||
`);return Buffer.from(e)};IC.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var o=parseInt(t.slice(0,r).toString(),10);if(!o)return e;var a=t.slice(r+1,o-1).toString(),n=a.indexOf("=");if(n===-1)return e;e[a.slice(0,n)]=a.slice(n+1),t=t.slice(o)}return e};IC.encode=function(t){var e=YBt(512),r=t.name,o="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var a=r.indexOf("/");if(a===-1)return null;o+=o?"/"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(o)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(Jh(t.mode&XBt,6),100),e.write(Jh(t.uid,6),108),e.write(Jh(t.gid,6),116),e.write(Jh(t.size,11),124),e.write(Jh(t.mtime.getTime()/1e3|0,11),136),e[156]=M2e+evt(t.type),t.linkname&&e.write(t.linkname,157),O2e.copy(e,lv),VBt.copy(e,Zj),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(Jh(t.devmajor||0,6),329),e.write(Jh(t.devminor||0,6),337),o&&e.write(o,345),e.write(Jh(_2e(e),6),148),e)};IC.decode=function(t,e,r){var o=t[156]===0?0:t[156]-M2e,a=wC(t,0,100,e),n=Xh(t,100,8),u=Xh(t,108,8),A=Xh(t,116,8),p=Xh(t,124,12),h=Xh(t,136,12),E=$Bt(o),I=t[157]===0?null:wC(t,157,100,e),v=wC(t,265,32),x=wC(t,297,32),C=Xh(t,329,8),R=Xh(t,337,8),L=_2e(t);if(L===8*32)return null;if(L!==Xh(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(O2e.compare(t,lv,lv+6)===0)t[345]&&(a=wC(t,345,155,e)+"/"+a);else if(!(zBt.compare(t,lv,lv+6)===0&&JBt.compare(t,Zj,Zj+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return o===0&&a&&a[a.length-1]==="/"&&(o=5),{name:a,mode:n,uid:u,gid:A,size:p,mtime:new Date(1e3*h),type:E,linkname:I,uname:v,gname:x,devmajor:C,devminor:R}}});var K2e=_((G$t,W2e)=>{var q2e=ve("util"),rvt=L2e(),cv=$j(),j2e=CC().Writable,G2e=CC().PassThrough,Y2e=function(){},H2e=function(t){return t&=511,t&&512-t},nvt=function(t,e){var r=new TQ(t,e);return r.end(),r},ivt=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},TQ=function(t,e){this._parent=t,this.offset=e,G2e.call(this,{autoDestroy:!1})};q2e.inherits(TQ,G2e);TQ.prototype.destroy=function(t){this._parent.destroy(t)};var ip=function(t){if(!(this instanceof ip))return new ip(t);j2e.call(this,t),t=t||{},this._offset=0,this._buffer=rvt(),this._missing=0,this._partial=!1,this._onparse=Y2e,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,o=function(){e._continue()},a=function(v){if(e._locked=!1,v)return e.destroy(v);e._stream||o()},n=function(){e._stream=null;var v=H2e(e._header.size);v?e._parse(v,u):e._parse(512,I),e._locked||o()},u=function(){e._buffer.consume(H2e(e._header.size)),e._parse(512,I),o()},A=function(){var v=e._header.size;e._paxGlobal=cv.decodePax(r.slice(0,v)),r.consume(v),n()},p=function(){var v=e._header.size;e._pax=cv.decodePax(r.slice(0,v)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(v),n()},h=function(){var v=e._header.size;this._gnuLongPath=cv.decodeLongPath(r.slice(0,v),t.filenameEncoding),r.consume(v),n()},E=function(){var v=e._header.size;this._gnuLongLinkPath=cv.decodeLongPath(r.slice(0,v),t.filenameEncoding),r.consume(v),n()},I=function(){var v=e._offset,x;try{x=e._header=cv.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(C){e.emit("error",C)}if(r.consume(512),!x){e._parse(512,I),o();return}if(x.type==="gnu-long-path"){e._parse(x.size,h),o();return}if(x.type==="gnu-long-link-path"){e._parse(x.size,E),o();return}if(x.type==="pax-global-header"){e._parse(x.size,A),o();return}if(x.type==="pax-header"){e._parse(x.size,p),o();return}if(e._gnuLongPath&&(x.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(x.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=x=ivt(x,e._pax),e._pax=null),e._locked=!0,!x.size||x.type==="directory"){e._parse(512,I),e.emit("entry",x,nvt(e,v),a);return}e._stream=new TQ(e,v),e.emit("entry",x,e._stream,a),e._parse(x.size,n),o()};this._onheader=I,this._parse(512,I)};q2e.inherits(ip,j2e);ip.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit("error",t),this.emit("close"),this._stream&&this._stream.emit("close"))};ip.prototype._parse=function(t,e){this._destroyed||(this._offset+=t,this._missing=t,e===this._onheader&&(this._partial=!1),this._onparse=e)};ip.prototype._continue=function(){if(!this._destroyed){var t=this._cb;this._cb=Y2e,this._overflow?this._write(this._overflow,void 0,t):t()}};ip.prototype._write=function(t,e,r){if(!this._destroyed){var o=this._stream,a=this._buffer,n=this._missing;if(t.length&&(this._partial=!0),t.length<n)return this._missing-=t.length,this._overflow=null,o?o.write(t,r):(a.append(t),
Line truncated
|
||||
Wanted: ${r.size}
|
||||
Found: ${t.length}`);throw A.code="EBADSIZE",A.found=t.length,A.expected=r.size,A.sri=e,A}else{let A=new Error(`Integrity checksum failed when using ${o}: Wanted ${e}, but got ${n}. (${t.length} bytes)`);throw A.code="EINTEGRITY",A.found=n,A.expected=e,A.algorithm=o,A.sri=e,A}}IA.exports.checkStream=Nvt;function Nvt(t,e,r){r=oa(r);let o=r.Promise||Promise,a=u5(r.concat({integrity:e}));return new o((n,u)=>{t.pipe(a),t.on("error",u),a.on("error",u);let A;a.on("verified",p=>{A=p}),a.on("end",()=>n(A)),a.on("data",()=>{})})}IA.exports.integrityStream=u5;function u5(t){t=oa(t);let e=t.integrity&&wA(t.integrity,t),r=e&&Object.keys(e).length,o=r&&e.pickAlgorithm(t),a=r&&e[o],n=Array.from(new Set(t.algorithms.concat(o?[o]:[]))),u=n.map(pv.createHash),A=0,p=new Pvt({transform(h,E,I){A+=h.length,u.forEach(v=>v.update(h,E)),I(null,h,E)}}).on("end",()=>{let h=t.options&&t.options.length?`?${t.options.join("?")}`:"",E=wA(u.map((v,x)=>`${n[x]}-${v.digest("base64")}${h}`).join(" "),t),I=r&&E.match(e,t);if(typeof t.size=="number"&&A!==t.size){let v=new Error(`stream size mismatch when checking ${e}.
|
||||
Wanted: ${t.size}
|
||||
Found: ${A}`);v.code="EBADSIZE",v.found=A,v.expected=t.size,v.sri=e,p.emit("error",v)}else if(t.integrity&&!I){let v=new Error(`${e} integrity checksum failed when using ${o}: wanted ${a} but got ${E}. (${A} bytes)`);v.code="EINTEGRITY",v.found=E,v.expected=a,v.algorithm=o,v.sri=e,p.emit("error",v)}else p.emit("size",A),p.emit("integrity",E),I&&p.emit("verified",I)});return p}IA.exports.create=Lvt;function Lvt(t){t=oa(t);let e=t.algorithms,r=t.options.length?`?${t.options.join("?")}`:"",o=e.map(pv.createHash);return{update:function(a,n){return o.forEach(u=>u.update(a,n)),this},digest:function(a){return e.reduce((u,A)=>{let p=o.shift().digest("base64"),h=new Zh(`${A}-${p}${r}`,t);if(h.algorithm&&h.digest){let E=h.algorithm;u[E]||(u[E]=[]),u[E].push(h)}return u},new fd)}}}var Mvt=new Set(pv.getHashes()),gBe=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(t=>Mvt.has(t));function Ovt(t,e){return gBe.indexOf(t.toLowerCase())>=gBe.indexOf(e.toLowerCase())?t:e}});var YBe=_((dir,GBe)=>{var ODt=$N();function UDt(t){return ODt(t)?void 0:t}GBe.exports=UDt});var KBe=_((mir,WBe)=>{var _Dt=kb(),HDt=B8(),qDt=S8(),jDt=Mg(),GDt=Ag(),YDt=YBe(),WDt=m_(),KDt=I8(),VDt=1,zDt=2,JDt=4,XDt=WDt(function(t,e){var r={};if(t==null)return r;var o=!1;e=_Dt(e,function(n){return n=jDt(n,t),o||(o=n.length>1),n}),GDt(t,KDt(t),r),o&&(r=HDt(r,VDt|zDt|JDt,YDt));for(var a=e.length;a--;)qDt(r,e[a]);return r});WBe.exports=XDt});Pt();Ge();Pt();var ZBe=ve("child_process"),$Be=Ze(X0());qt();var Uy=new Map([]);var W1={};Vt(W1,{BaseCommand:()=>ut,WorkspaceRequiredError:()=>sr,getCli:()=>ihe,getDynamicLibs:()=>nhe,getPluginConfiguration:()=>Hy,openWorkspace:()=>_y,pluginCommands:()=>Uy,runExit:()=>Wx});qt();var ut=class extends it{constructor(){super(...arguments);this.cwd=ge.String("--cwd",{hidden:!0})}validateAndExecute(){if(typeof this.cwd<"u")throw new st("The --cwd option is ambiguous when used anywhere else than the very first parameter provided in the command line, before even the command path");return super.validateAndExecute()}};Ge();Pt();qt();var sr=class extends st{constructor(e,r){let o=K.relative(e,r),a=K.join(e,Ut.fileName);super(`This command can only be run from within a workspace of your project (${o} isn't a workspace of ${a}).`)}};Ge();Pt();nA();Nl();g1();qt();var OAt=Ze(Jn());el();var nhe=()=>new Map([["@yarnpkg/cli",W1],["@yarnpkg/core",Y1],["@yarnpkg/fslib",kw],["@yarnpkg/libzip",p1],["@yarnpkg/parsers",Ow],["@yarnpkg/shell",E1],["clipanion",Jw],["semver",OAt],["typanion",Vo]]);Ge();async function _y(t,e){let{project:r,workspace:o}=await kt.find(t,e);if(!o)throw new sr(r.cwd,e);return o}Ge();Pt();nA();Nl();g1();qt();var oPt=Ze(Jn());el();var K8={};Vt(K8,{AddCommand:()=>Yy,BinCommand:()=>Wy,CacheCleanCommand:()=>Ky,ClipanionCommand:()=>$y,ConfigCommand:()=>Xy,ConfigGetCommand:()=>Vy,ConfigSetCommand:()=>zy,ConfigUnsetCommand:()=>Jy,DedupeCommand:()=>Zy,EntryCommand:()=>tE,ExecCommand:()=>nE,ExplainCommand:()=>oE,ExplainPeerRequirementsCommand:()=>iE,HelpCommand:()=>eE,InfoCommand:()=>aE,LinkCommand:()=>cE,NodeCommand:()=>uE,PluginCheckCommand:()=>AE,PluginImportCommand:()=>hE,PluginImportSourcesCommand:()=>gE,PluginListCommand:()=>fE,PluginRemoveCommand:()=>dE,PluginRuntimeCommand:()=>mE,RebuildCommand:()=>yE,RemoveCommand:()=>EE,RunCommand:()=>wE,RunIndexCommand:()=>CE,SetResolutionCommand:()=>IE,SetVersionCommand:()=>sE,SetVersionSourcesCommand:()=>pE,UnlinkCommand:()=>BE,UpCommand:()=>vE,VersionCommand:()=>rE,WhyCommand:()=>DE,WorkspaceCommand:()=>kE,WorkspacesListCommand:()=>xE,YarnCommand:()=>lE,dedupeUtils:()=>rk,default:()=>Fgt,suggestUtils:()=>Zc});var Nde=Ze(X0());Ge();Ge();Ge();qt();var Y0e=Ze(J1());el();var Zc={};Vt(Zc,{Modifier:()=>m8,Strategy:()=>$x,Target:()=>X1,WorkspaceModifier:()=>_0e,applyModifier:()=>ipt,extractDescriptorFromPath:()=>y8,extractRangeModifier:()=>H0e,fetchDescriptorFrom:()=>E8,findProjectDescriptors:()=>G0e,getModifier:()=>Z1,getSuggestedDescriptors:()=>$1,makeWorkspaceDescriptor:()=>j0e,toWorkspaceModifier:()=>q0e});Ge();Ge();Pt();var d8=Ze(Jn()),rpt="workspace:",X1=(o=>(o.REGULAR="dependencies",o.DEVELOPMENT="devDependencies",o.PEER="peerDependencies",o))(X1||{}),m8=(o=>(o.CARET="^",o.TILDE="~",o.EXACT="",o))(m8||{}),_0e=(o=>(o.CARET="^",o.TILDE="~",o.EXACT="*",o))(_0e||{}),$x=(n=>(n.KEEP="keep",n.REUSE="reuse",n.PROJECT="project",n.LATEST="latest",n.CACHE="cache",n))($x||{});function Z1(t,e){return t.exact?"":t.caret?"^":t.tilde?"~":e.configuration.get("defaultSemverRangePrefix")}var npt=/^([\^~]?)[0-9]+(?:\.[0-9]+){0,2}(?:-\S+)?$/;function H0e(t,{project:e}){let r=t.match(npt);return r?r[1]:e.configuration.get("defaultSemverRangePrefix")}function ipt(t,e){let{protocol:r,source:o,params:a,selector:n}=G.parseRange(t.range);return d8.default.valid(n)&&(n=`${e}${t.range}`),G.makeDescriptor(t,G.makeRange({protocol:r,source:o,params:a,selector:n}))}function q0e(t){switch(t){case"^":return"^";case"~":retur
Line truncated
|
||||
Try running the command again with the package name prefixed: ${pe.pretty(r,"yarn add",pe.Type.CODE)} ${pe.pretty(r,G.makeDescriptor(G.makeIdent(null,"my-package"),`${te[0]}...`),pe.Type.DESCRIPTOR)}`);if(!z)throw new st(`The ${pe.pretty(r,U,pe.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let ae=opt(a,z,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(ae.map(async ce=>{let Ce=await $1(z,{project:o,workspace:a,cache:n,fixed:u,target:ce,modifier:h,strategies:E,maxResults:I});return{request:z,suggestedDescriptors:Ce,target:ce}}))})).then(U=>U.flat()),x=await AA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async U=>{for(let{request:z,suggestedDescriptors:{suggestions:te,rejections:ae}}of v)if(te.filter(ce=>ce.descriptor!==null).length===0){let[ce]=ae;if(typeof ce>"u")throw new Error("Assertion failed: Expected an error to have been set");o.configuration.get("enableNetwork")?U.reportError(27,`${G.prettyDescriptor(r,z)} can't be resolved to a satisfying range`):U.reportError(27,`${G.prettyDescriptor(r,z)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),U.reportSeparator(),U.reportExceptionOnce(ce)}});if(x.hasErrors())return x.exitCode();let C=!1,R=[],L=[];for(let{suggestedDescriptors:{suggestions:U},target:z}of v){let te,ae=U.filter(de=>de.descriptor!==null),le=ae[0].descriptor,ce=ae.every(de=>G.areDescriptorsEqual(de.descriptor,le));ae.length===1||ce?te=le:(C=!0,{answer:te}=await(0,Y0e.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:U.map(({descriptor:de,name:Be,reason:Ee})=>de?{name:Be,hint:Ee,descriptor:de}:{name:Be,hint:Ee,disabled:!0}),onCancel:()=>process.exit(130),result(de){return this.find(de,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let Ce=a.manifest[z].get(te.identHash);(typeof Ce>"u"||Ce.descriptorHash!==te.descriptorHash)&&(a.manifest[z].set(te.identHash,te),this.optional&&(z==="dependencies"?a.manifest.ensureDependencyMeta({...te,range:"unknown"}).optional=!0:z==="peerDependencies"&&(a.manifest.ensurePeerDependencyMeta({...te,range:"unknown"}).optional=!0)),typeof Ce>"u"?R.push([a,z,te,E]):L.push([a,z,Ce,te]))}return await r.triggerMultipleHooks(U=>U.afterWorkspaceDependencyAddition,R),await r.triggerMultipleHooks(U=>U.afterWorkspaceDependencyReplacement,L),C&&this.context.stdout.write(`
|
||||
`),await o.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function opt(t,e,{dev:r,peer:o,preferDev:a,optional:n}){let u=t.manifest.dependencies.has(e.identHash),A=t.manifest.devDependencies.has(e.identHash),p=t.manifest.peerDependencies.has(e.identHash);if((r||o)&&u)throw new st(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!o&&p)throw new st(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(n&&A)throw new st(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(n&&!o&&p)throw new st(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||a)&&n)throw new st(`Package "${G.prettyIdent(t.project.configuration,e)}" cannot simultaneously be a dev dependency and an optional dependency`);let h=[];return o&&h.push("peerDependencies"),(r||a)&&h.push("devDependencies"),n&&h.push("dependencies"),h.length>0?h:A?["devDependencies"]:p?["peerDependencies"]:["dependencies"]}Ge();Ge();qt();var Wy=class extends ut{constructor(){super(...arguments);this.verbose=ge.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=ge.String({required:!1})}static{this.paths=[["bin"]]}static{this.usage=it.Usage({description:"get the path to a binary script",details:`
|
||||
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
|
||||
|
||||
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
|
||||
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,locator:a}=await kt.find(r,this.context.cwd);if(await o.restoreInstallState(),this.name){let A=(await An.getPackageAccessibleBinaries(a,{project:o})).get(this.name);if(!A)throw new st(`Couldn't find a binary named "${this.name}" for package "${G.prettyLocator(r,a)}"`);let[,p]=A;return this.context.stdout.write(`${p}
|
||||
`),0}return(await Rt.start({configuration:r,json:this.json,stdout:this.context.stdout},async u=>{let A=await An.getPackageAccessibleBinaries(a,{project:o}),h=Array.from(A.keys()).reduce((E,I)=>Math.max(E,I.length),0);for(let[E,[I,v]]of A)u.reportJson({name:E,source:G.stringifyIdent(I),path:v});if(this.verbose)for(let[E,[I]]of A)u.reportInfo(null,`${E.padEnd(h," ")} ${G.prettyLocator(r,I)}`);else for(let E of A.keys())u.reportInfo(null,E)})).exitCode()}};Ge();Pt();qt();var Ky=class extends ut{constructor(){super(...arguments);this.mirror=ge.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=ge.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}static{this.paths=[["cache","clean"],["cache","clear"]]}static{this.usage=it.Usage({description:"remove the shared cache files",details:`
|
||||
This command will remove all the files from the cache.
|
||||
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o=await Gr.find(r);return(await Rt.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&o.mirrorCwd!==null,u=!this.mirror;n&&(await oe.removePromise(o.mirrorCwd),await r.triggerHook(A=>A.cleanGlobalArtifacts,r)),u&&await oe.removePromise(o.cwd)})).exitCode()}};Ge();qt();var K0e=Ze(e2()),C8=ve("util"),Vy=class extends ut{constructor(){super(...arguments);this.why=ge.Boolean("--why",!1,{description:"Print the explanation for why a setting has its value"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=ge.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=ge.String()}static{this.paths=[["config","get"]]}static{this.usage=it.Usage({description:"read a configuration settings",details:`
|
||||
This command will print a configuration setting.
|
||||
|
||||
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
|
||||
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o=this.name.replace(/[.[].*$/,""),a=this.name.replace(/^[^.[]*/,"");if(typeof r.settings.get(o)>"u")throw new st(`Couldn't find a configuration settings named "${o}"`);let u=r.getSpecial(o,{hideSecrets:!this.unsafe,getNativePaths:!0}),A=He.convertMapsToIndexableObjects(u),p=a?(0,K0e.default)(A,a):A,h=await Rt.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async E=>{E.reportJson(p)});if(!this.json){if(typeof p=="string")return this.context.stdout.write(`${p}
|
||||
`),h.exitCode();C8.inspect.styles.name="cyan",this.context.stdout.write(`${(0,C8.inspect)(p,{depth:1/0,colors:r.get("enableColors"),compact:!1})}
|
||||
`)}return h.exitCode()}};Ge();qt();var Mge=Ze(v8()),Oge=Ze(e2()),Uge=Ze(D8()),P8=ve("util"),zy=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=ge.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=ge.String();this.value=ge.String()}static{this.paths=[["config","set"]]}static{this.usage=it.Usage({description:"change a configuration settings",details:`
|
||||
This command will set a configuration setting.
|
||||
|
||||
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
|
||||
|
||||
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
|
||||
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o=()=>{if(!r.projectCwd)throw new st("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new st(`Couldn't find a configuration settings named "${a}"`);if(a==="enableStrictSettings")throw new st("This setting only affects the file it's in, and thus cannot be set from the CLI");let A=this.json?JSON.parse(this.value):this.value;await(this.home?C=>Ke.updateHomeConfiguration(C):C=>Ke.updateConfiguration(o(),C))(C=>{if(n){let R=(0,Mge.default)(C);return(0,Uge.default)(R,this.name,A),R}else return{...C,[a]:A}});let E=(await Ke.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),I=He.convertMapsToIndexableObjects(E),v=n?(0,Oge.default)(I,n):I;return(await Rt.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async C=>{P8.inspect.styles.name="cyan",C.reportInfo(0,`Successfully set ${this.name} to ${(0,P8.inspect)(v,{depth:1/0,colors:r.get("enableColors"),compact:!1})}`)})).exitCode()}};Ge();qt();var Jge=Ze(v8()),Xge=Ze(jge()),Zge=Ze(b8()),Jy=class extends ut{constructor(){super(...arguments);this.home=ge.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=ge.String()}static{this.paths=[["config","unset"]]}static{this.usage=it.Usage({description:"unset a configuration setting",details:`
|
||||
This command will unset a configuration setting.
|
||||
`,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o=()=>{if(!r.projectCwd)throw new st("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new st(`Couldn't find a configuration settings named "${a}"`);let A=this.home?h=>Ke.updateHomeConfiguration(h):h=>Ke.updateConfiguration(o(),h);return(await Rt.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async h=>{let E=!1;await A(I=>{if(!(0,Xge.default)(I,this.name))return h.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),E=!0,I;let v=n?(0,Jge.default)(I):{...I};return(0,Zge.default)(v,this.name),v}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ge();Pt();qt();var tk=ve("util"),Xy=class extends ut{constructor(){super(...arguments);this.noDefaults=ge.Boolean("--no-defaults",!1,{description:"Omit the default values from the display"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.verbose=ge.Boolean("-v,--verbose",{hidden:!0});this.why=ge.Boolean("--why",{hidden:!0});this.names=ge.Rest()}static{this.paths=[["config"]]}static{this.usage=it.Usage({description:"display the current configuration",details:`
|
||||
This command prints the current active configuration settings.
|
||||
`,examples:[["Print the active configuration settings","$0 config"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins,{strict:!1}),o=await uy({configuration:r,stdout:this.context.stdout,forceError:this.json},[{option:this.verbose,message:"The --verbose option is deprecated, the settings' descriptions are now always displayed"},{option:this.why,message:"The --why option is deprecated, the settings' sources are now always displayed"}]);if(o!==null)return o;let a=this.names.length>0?[...new Set(this.names)].sort():[...r.settings.keys()].sort(),n,u=await Rt.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async A=>{if(r.invalid.size>0&&!this.json){for(let[p,h]of r.invalid)A.reportError(34,`Invalid configuration key "${p}" in ${h}`);A.reportSeparator()}if(this.json)for(let p of a){let h=r.settings.get(p);typeof h>"u"&&A.reportError(34,`No configuration key named "${p}"`);let E=r.getSpecial(p,{hideSecrets:!0,getNativePaths:!0}),I=r.sources.get(p)??"<default>",v=I&&I[0]!=="<"?ue.fromPortablePath(I):I;A.reportJson({key:p,effective:E,source:v,...h})}else{let p={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},h={},E={children:h};for(let I of a){if(this.noDefaults&&!r.sources.has(I))continue;let v=r.settings.get(I),x=r.sources.get(I)??"<default>",C=r.getSpecial(I,{hideSecrets:!0,getNativePaths:!0}),R={Description:{label:"Description",value:pe.tuple(pe.Type.MARKDOWN,{text:v.description,format:this.cli.format(),paragraphs:!1})},Source:{label:"Source",value:pe.tuple(x[0]==="<"?pe.Type.CODE:pe.Type.PATH,x)}};h[I]={value:pe.tuple(pe.Type.CODE,I),children:R};let L=(U,z)=>{for(let[te,ae]of z)if(ae instanceof Map){let le={};U[te]={children:le},L(le,ae)}else U[te]={label:te,value:pe.tuple(pe.Type.NO_HINT,(0,tk.inspect)(ae,p))}};C instanceof Map?L(R,C):R.Value={label:"Value",value:pe.tuple(pe.Type.NO_HINT,(0,tk.inspect)(C,p))}}a.length!==1&&(n=void 0),fs.emitTree(E,{configuration:r,json:this.json,stdout:this.context.stdout,separators:2})}});if(!this.json&&typeof n<"u"){let A=a[0],p=(0,tk.inspect)(r.getSpecial(A,{hideSecrets:!0,getNativePaths:!0}),{colors:r.get("enableColors")});this.context.stdout.write(`
|
||||
`),this.context.stdout.write(`${p}
|
||||
`)}return u.exitCode()}};Ge();qt();el();var rk={};Vt(rk,{Strategy:()=>t2,acceptedStrategies:()=>q0t,dedupe:()=>x8});Ge();Ge();var $ge=Ze($o()),t2=(e=>(e.HIGHEST="highest",e))(t2||{}),q0t=new Set(Object.values(t2)),j0t={highest:async(t,e,{resolver:r,fetcher:o,resolveOptions:a,fetchOptions:n})=>{let u=new Map;for(let[p,h]of t.storedResolutions){let E=t.storedDescriptors.get(p);if(typeof E>"u")throw new Error(`Assertion failed: The descriptor (${p}) should have been registered`);He.getSetWithDefault(u,E.identHash).add(h)}let A=new Map(He.mapAndFilter(t.storedDescriptors.values(),p=>G.isVirtualDescriptor(p)?He.mapAndFilter.skip:[p.descriptorHash,He.makeDeferred()]));for(let p of t.storedDescriptors.values()){let h=A.get(p.descriptorHash);if(typeof h>"u")throw new Error(`Assertion failed: The descriptor (${p.descriptorHash}) should have been registered`);let E=t.storedResolutions.get(p.descriptorHash);if(typeof E>"u")throw new Error(`Assertion failed: The resolution (${p.descriptorHash}) should have been registered`);let I=t.originalPackages.get(E);if(typeof I>"u")throw new Error(`Assertion failed: The package (${E}) should have been registered`);Promise.resolve().then(async()=>{let v=r.getResolutionDependencies(p,a),x=Object.fromEntries(await He.allSettledSafe(Object.entries(v).map(async([te,ae])=>{let le=A.get(ae.descriptorHash);if(typeof le>"u")throw new Error(`Assertion failed: The descriptor (${ae.descriptorHash}) should have been registered`);let ce=await le.promise;if(!ce)throw new Error("Assertion failed: Expected the dependency to have been through the dedupe process itself");return[te,ce.updatedPackage]})));if(e.length&&!$ge.default.isMatch(G.stringifyIdent(p),e)||!r.shouldPersistResolution(I,a))return I;let C=u.get(p.identHash);if(typeof C>"u")throw new Error(`Assertion failed: The resolutions (${p.identHash}) should have been registered`);if(C.size===1)return I;let R=[...C].map(te=>{let ae=t.originalPackages.get(te);if(typeof ae>"u")throw new Error(`Assertion failed: The package (${te}) should have been registered`);return ae}),L=await r.getSatisfying(p,x,R,a),U=L.locators?.[0];if(typeof U>"u"||!L.sorted)return I;let z=t.originalPackages.get(U.locatorHash);if(typeof z>"u")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return z}).then(async v=>{let x=await t.preparePackage(v,{resolver:r,resolveOptions:a});h.resolve({descriptor:p,currentPackage:I,updatedPackage:v,resolvedPackage:x})}).catch(v=>{h.reject(v)})}return[...A.values()].map(p=>p.promise)}};async function x8(t,{strategy:e,patterns:r,cache:o,report:a}){let{configuration:n}=t,u=new ki,A=n.makeResolver(),p=n.makeFetcher(),h={cache:o,checksums:t.storedChecksums,fetcher:p,project:t,report:u,cacheOptions:{skipIntegrityCheck:!0}},E={project:t,resolver:A,report:u,fetchOptions:h};return await a.startTimerPromise("Deduplication step",async()=>{let I=j0t[e],v=await I(t,r,{resolver:A,resolveOptions:E,fetcher:p,fetchOptions:h}),x=Zs.progressViaCounter(v.length);await a.reportProgress(x);let C=0;await Promise.all(v.map(U=>U.then(z=>{if(z===null||z.currentPackage.locatorHash===z.updatedPackage.locatorHash)return;C++;let{descriptor:te,currentPackage:ae,updatedPackage:le}=z;a.reportInfo(0,`${G.prettyDescriptor(n,te)} can be deduped from ${G.prettyLocator(n,ae)} to ${G.prettyLocator(n,le)}`),a.reportJson({descriptor:G.stringifyDescriptor(te),currentResolution:G.stringifyLocator(ae),updatedResolution:G.stringifyLocator(le)}),t.storedResolutions.set(te.descriptorHash,le.locatorHash)}).finally(()=>x.tick())));let R;switch(C){case 0:R="No packages";break;case 1:R="One package";break;default:R=`${C} packages`}let L=pe.pretty(n,e,pe.Type.CODE);return a.reportInfo(0,`${R} can be deduped using the ${L} strategy`),C})}var Zy=class extends ut{constructor(){super(...arguments);this.strategy=ge.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:Js(t2)});this.check=ge.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=ge.String("--mode",{description:"Change what artifacts installs generate",validator:Js(hl)});this.patterns=ge.Rest()}static{this.paths=[["dedupe"]]}static{this.usage=it.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.\n\n This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):\n\n - `highest`: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never dow
Line truncated
|
||||
`)}};var eE=class extends ut{static{this.paths=[["help"],["--help"],["-h"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ge();Pt();qt();var tE=class extends ut{constructor(){super(...arguments);this.leadingArgument=ge.String();this.args=ge.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!G.tryParseIdent(this.leadingArgument)){let r=K.resolve(this.context.cwd,ue.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}};Ge();var rE=class extends ut{static{this.paths=[["-v"],["--version"]]}async execute(){this.context.stdout.write(`${nn||"<unknown>"}
|
||||
`)}};Ge();Ge();qt();var nE=class extends ut{constructor(){super(...arguments);this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[["exec"]]}static{this.usage=it.Usage({description:"execute a shell script",details:`
|
||||
This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.
|
||||
|
||||
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
|
||||
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,locator:a}=await kt.find(r,this.context.cwd);return await o.restoreInstallState(),await An.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:o})}};Ge();qt();el();var iE=class extends ut{constructor(){super(...arguments);this.hash=ge.String({required:!1,validator:YD(om(),[qw(/^p[0-9a-f]{5}$/)])})}static{this.paths=[["explain","peer-requirements"]]}static{this.usage=it.Usage({description:"explain a set of peer requirements",details:`
|
||||
A peer requirement represents all peer requests that a subject must satisfy when providing a requested package to requesters.
|
||||
|
||||
When the hash argument is specified, this command prints a detailed explanation of the peer requirement corresponding to the hash and whether it is satisfied or not.
|
||||
|
||||
When used without arguments, this command lists all peer requirements and the corresponding hash that can be used to get detailed information about a given requirement.
|
||||
|
||||
**Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`).
|
||||
`,examples:[["Explain the corresponding peer requirement for a hash","$0 explain peer-requirements p1a4ed"],["List all peer requirements","$0 explain peer-requirements"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o}=await kt.find(r,this.context.cwd);return await o.restoreInstallState({restoreResolutions:!1}),await o.applyLightResolution(),typeof this.hash<"u"?await Y0t(this.hash,o,{stdout:this.context.stdout}):await W0t(o,{stdout:this.context.stdout})}};async function Y0t(t,e,r){let o=e.peerRequirementNodes.get(t);if(typeof o>"u")throw new Error(`No peerDependency requirements found for hash: "${t}"`);let a=new Set,n=p=>a.has(p.requester.locatorHash)?{value:pe.tuple(pe.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:pe.tuple(pe.Type.NO_HINT,"...")}]:[]}:(a.add(p.requester.locatorHash),{value:pe.tuple(pe.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[G.stringifyLocator(h.requester),n(h)]))}),u=e.peerWarnings.find(p=>p.hash===t);return(await Rt.start({configuration:e.configuration,stdout:r.stdout,includeFooter:!1,includePrefix:!1},async p=>{let h=pe.mark(e.configuration),E=u?h.Cross:h.Check;if(p.reportInfo(0,`Package ${pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)} is requested to provide ${pe.pretty(e.configuration,o.ident,pe.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)),fs.emitTree({children:Object.fromEntries(Array.from(o.requests.values(),I=>[G.stringifyLocator(I.requester),n(I)]))},{configuration:e.configuration,stdout:r.stdout,json:!1}),p.reportSeparator(),o.provided.range==="missing:"){let I=u?"":" , but all peer requests are optional";p.reportInfo(0,`${E} Package ${pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)} does not provide ${pe.pretty(e.configuration,o.ident,pe.Type.IDENT)}${I}.`)}else{let I=e.storedResolutions.get(o.provided.descriptorHash);if(!I)throw new Error("Assertion failed: Expected the descriptor to be registered");let v=e.storedPackages.get(I);if(!v)throw new Error("Assertion failed: Expected the package to be registered");p.reportInfo(0,`${E} Package ${pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)} provides ${pe.pretty(e.configuration,o.ident,pe.Type.IDENT)} with version ${G.prettyReference(e.configuration,v.version??"0.0.0")}, ${u?"which does not satisfy all requests.":"which satisfies all requests"}`),u?.type===3&&(u.range?p.reportInfo(0,` The combined requested range is ${pe.pretty(e.configuration,u.range,pe.Type.RANGE)}`):p.reportInfo(0," Unfortunately, the requested ranges have no overlap"))}})).exitCode()}async function W0t(t,e){return(await Rt.start({configuration:t.configuration,stdout:e.stdout,includeFooter:!1,includePrefix:!1},async o=>{let a=pe.mark(t.configuration),n=He.sortMap(t.peerRequirementNodes,[([,u])=>G.stringifyLocator(u.subject),([,u])=>G.stringifyIdent(u.ident)]);for(let[,u]of n.values()){if(!u.root)continue;let A=t.peerWarnings.find(E=>E.hash===u.hash),p=[...G.allPeerRequests(u)],h;if(p.length>2?h=` and ${p.length-1} other dependencies`:p.length===2?h=" and 1 other dependency":h="",u.provided.range!=="missing:"){let E=t.storedResolutions.get(u.provided.descriptorHash);if(!E)throw new Error("Assertion failed: Expected the resolution to have been registered");let I=t.storedPackages.get(E);if(!I)throw new Error("Assertion failed: Expected the provided package to have been registered");let v=`${pe.pretty(t.configuration,u.hash,pe.Type.CODE)} \u2192 ${A?a.Cross:a.Check} ${G.prettyLocator(t.configuration,u.subject)} provides ${G.prettyLocator(t.configuration,I)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;A?o.reportWarning(0,v):o.reportInfo(0,v)}else{let E=`${pe.pretty(t.configuration,u.hash,pe.Type.CODE)} \u2192 ${A?a.Cross:a.Check} ${G.prettyLocator(t.configuration,u.subject)} doesn't provide ${G.prettyIdent(t.configuration,u.ident)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;A?o.reportWarning(0,E):o.reportInfo(0,E)}}})).exitCode()}Ge();qt();el();Ge();Ge();Pt();qt();var tde=Ze(Jn()),sE=class extends ut{constructor(){super(...arguments);this.useYarnPath=ge.Boolean("--yarn-path",{description:"Set the yarnPath setting even if the version can be accessed by Corepack"});this.onlyIfNeeded=ge.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=ge.String()}static{this.paths=[["set","version"]]}static{this.usage=it.Usage({description:"lock the Yarn version used by the project",details:"\n This command will set a specific release of Yarn to be used by Corepack: https://nodejs.org/api/corepack.html.\n\n By default it only will set the `packageManager` field at the root of your project, but if the referenced release cannot be represented this way, if you already have `yarnPath` configured, or if you set th
Line truncated
|
||||
${e}`)})}let A=t.projectCwd??t.startingCwd,p=K.resolve(A,".yarn/releases"),h=K.resolve(p,`yarn-${e}.cjs`),E=K.relative(t.startingCwd,h),I=He.isTaggedYarnVersion(e),v=t.get("yarnPath"),x=!I,C=x||!!v||!!a;if(a===!1){if(x)throw new Jt(0,"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack");C=!1}else!C&&!process.env.COREPACK_ROOT&&(o.reportWarning(0,`You don't seem to have ${pe.applyHyperlink(t,"Corepack","https://nodejs.org/api/corepack.html")} enabled; we'll have to rely on ${pe.applyHyperlink(t,"yarnPath","https://yarnpkg.com/configuration/yarnrc#yarnPath")} instead`),C=!0);if(C){let te=await u();o.reportInfo(0,`Saving the new release in ${pe.pretty(t,E,"magenta")}`),await oe.removePromise(K.dirname(h)),await oe.mkdirPromise(K.dirname(h),{recursive:!0}),await oe.writeFilePromise(h,te,{mode:493}),await Ke.updateConfiguration(A,{yarnPath:K.relative(A,h)})}else await oe.removePromise(K.dirname(h)),await Ke.updateConfiguration(A,{yarnPath:Ke.deleteProperty});let R=await Ut.tryFind(A)||new Ut;R.packageManager=`yarn@${I?e:await r2(t,"stable")}`;let L={};R.exportTo(L);let U=K.join(A,Ut.fileName),z=`${JSON.stringify(L,null,R.indent)}
|
||||
`;return await oe.changeFilePromise(U,z,{automaticNewlines:!0}),{bundleVersion:e}}function rde(t){return wr[ZD(t)]}var V0t=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function z0t(t){let r=`https://repo.yarnpkg.com/${He.isTaggedYarnVersion(nn)?nn:await r2(t,"canary")}/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx`,o=await sn.get(r,{configuration:t});return new Map(Array.from(o.toString().matchAll(V0t),({groups:a})=>{if(!a)throw new Error("Assertion failed: Expected the match to have been successful");let n=rde(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected "${a.name}" to be named "${n}"`);return[a.code,a.details]}))}var oE=class extends ut{constructor(){super(...arguments);this.code=ge.String({required:!1,validator:jw(om(),[qw(/^YN[0-9]{4}$/)])});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["explain"]]}static{this.usage=it.Usage({description:"explain an error code",details:`
|
||||
When the code argument is specified, this command prints its name and its details.
|
||||
|
||||
When used without arguments, this command lists all error codes and their names.
|
||||
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins);if(typeof this.code<"u"){let o=rde(this.code),a=pe.pretty(r,o,pe.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),A=(await z0t(r)).get(this.code),p=typeof A<"u"?pe.jsonOrPretty(this.json,r,pe.tuple(pe.Type.MARKDOWN,{text:A,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
|
||||
|
||||
You can help us by editing this page on GitHub \u{1F642}:
|
||||
${pe.jsonOrPretty(this.json,r,pe.tuple(pe.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx"))}
|
||||
`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:o,details:p})}
|
||||
`):this.context.stdout.write(`${n}
|
||||
|
||||
${p}
|
||||
`)}else{let o={children:He.mapAndFilter(Object.entries(wr),([a,n])=>Number.isNaN(Number(a))?He.mapAndFilter.skip:{label:Ku(Number(a)),value:pe.tuple(pe.Type.CODE,n)})};fs.emitTree(o,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ge();Pt();qt();var nde=Ze($o()),aE=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=ge.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=ge.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=ge.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=ge.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=ge.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=ge.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=ge.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=ge.Rest()}static{this.paths=[["info"]]}static{this.usage=it.Usage({description:"see information related to packages",details:"\n This command prints various information related to the specified packages, accepting glob patterns.\n\n By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\n\n Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\n\n Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\n ",examples:[["Show information about Lodash","$0 info lodash"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd),n=await Gr.find(r);if(!a&&!this.all)throw new sr(o.cwd,this.context.cwd);await o.restoreInstallState();let u=new Set(this.extra);this.cache&&u.add("cache"),this.dependents&&u.add("dependents"),this.manifest&&u.add("manifest");let A=(ae,{recursive:le})=>{let ce=ae.anchoredLocator.locatorHash,Ce=new Map,de=[ce];for(;de.length>0;){let Be=de.shift();if(Ce.has(Be))continue;let Ee=o.storedPackages.get(Be);if(typeof Ee>"u")throw new Error("Assertion failed: Expected the package to be registered");if(Ce.set(Be,Ee),G.isVirtualLocator(Ee)&&de.push(G.devirtualizeLocator(Ee).locatorHash),!(!le&&Be!==ce))for(let g of Ee.dependencies.values()){let me=o.storedResolutions.get(g.descriptorHash);if(typeof me>"u")throw new Error("Assertion failed: Expected the resolution to be registered");de.push(me)}}return Ce.values()},p=({recursive:ae})=>{let le=new Map;for(let ce of o.workspaces)for(let Ce of A(ce,{recursive:ae}))le.set(Ce.locatorHash,Ce);return le.values()},h=({all:ae,recursive:le})=>ae&&le?o.storedPackages.values():ae?p({recursive:le}):A(a,{recursive:le}),E=({all:ae,recursive:le})=>{let ce=h({all:ae,recursive:le}),Ce=this.patterns.map(Ee=>{let g=G.parseLocator(Ee),me=nde.default.makeRe(G.stringifyIdent(g)),we=G.isVirtualLocator(g),Ae=we?G.devirtualizeLocator(g):g;return ne=>{let Z=G.stringifyIdent(ne);if(!me.test(Z))return!1;if(g.reference==="unknown")return!0;let xe=G.isVirtualLocator(ne),Ne=xe?G.devirtualizeLocator(ne):ne;return!(we&&xe&&g.reference!==ne.reference||Ae.reference!==Ne.reference)}}),de=He.sortMap([...ce],Ee=>G.stringifyLocator(Ee));return{selection:de.filter(Ee=>Ce.length===0||Ce.some(g=>g(Ee))),sortedLookup:de}},{selection:I,sortedLookup:v}=E({all:this.all,recursive:this.recursive});if(I.length===0)throw new st("No package matched your request");let x=new Map;if(this.dependents)for(let ae of v)for(let le of ae.dependencies.values()){let ce=o.storedResolutions.get(le.descriptorHash);if(typeof ce>"u")throw new Error("Assertion failed: Expected the resolution to be registered");He.getArrayWithDefault(x,ce).push(ae)}let C=new Map;for(let ae of v){if(!G.isVirtualLocator(ae))continue;let le=G.devirtualizeLocator(ae);He.getArrayWithDefault(C,le.locatorHash).push(ae)}let R={},L={children:R},U=r.makeFetcher(),z={project:o,fetcher:U,cache:n,checksums:o.storedChecksum
Line truncated
|
||||
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
|
||||
|
||||
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
|
||||
`,examples:[["Run a Node script","$0 node ./my-script.js"]]})}async execute(){return this.cli.run(["exec","node",...this.args])}};Ge();qt();var AE=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","check"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"find all third-party plugins that differ from their own spec",details:`
|
||||
Check only the plugins from https.
|
||||
|
||||
If this command detects any plugin differences in the CI environment, it will throw an error.
|
||||
`,examples:[["find all third-party plugins that differ from their own spec","$0 plugin check"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o=await Ke.findRcFiles(this.context.cwd);return(await Rt.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{for(let u of o)if(u.data?.plugins)for(let A of u.data.plugins){if(!A.checksum||!A.spec.match(/^https?:/))continue;let p=await sn.get(A.spec,{configuration:r}),h=wn.makeHash(p);if(A.checksum===h)continue;let E=pe.pretty(r,A.path,pe.Type.PATH),I=pe.pretty(r,A.spec,pe.Type.URL),v=`${E} is different from the file provided by ${I}`;n.reportJson({...A,newChecksum:h}),n.reportError(0,v)}})).exitCode()}};Ge();Ge();Pt();qt();var lde=ve("os");Ge();Pt();qt();var ide=ve("os");Ge();Nl();qt();var egt="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Hg(t,e){let r=await sn.get(egt,{configuration:t}),o=Ki(r.toString());return Object.fromEntries(Object.entries(o).filter(([a,n])=>!e||Lr.satisfiesWithPrereleases(e,n.range??"<4.0.0-rc.1")))}var fE=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","list"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins);return(await Rt.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await Hg(r,nn);for(let[u,{experimental:A,...p}]of Object.entries(n)){let h=u;A&&(h+=" [experimental]"),a.reportJson({name:u,experimental:A,...p}),a.reportInfo(null,h)}})).exitCode()}};var tgt=/^[0-9]+$/,rgt=process.platform==="win32";function sde(t){return tgt.test(t)?`pull/${t}/head`:t}var ngt=({repository:t,branch:e},r)=>[["git","init",ue.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin","--depth=1",sde(e)],["git","reset","--hard","FETCH_HEAD"]],igt=({branch:t})=>[["git","fetch","origin","--depth=1",sde(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx","-e","packages/yarnpkg-cli/bundles"]],sgt=({plugins:t,noMinify:e},r,o)=>[["yarn","build:cli",...new Array().concat(...t.map(a=>["--plugin",K.resolve(o,a)])),...e?["--no-minify"]:[],"|"],[rgt?"move":"mv","packages/yarnpkg-cli/bundles/yarn.js",ue.fromPortablePath(r),"|"]],pE=class extends ut{constructor(){super(...arguments);this.installPath=ge.String("--path",{description:"The path where the repository should be cloned to"});this.repository=ge.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=ge.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=ge.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.dryRun=ge.Boolean("-n,--dry-run",!1,{description:"If set, the bundle will be built but not added to the project"});this.noMinify=ge.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=ge.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=ge.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}static{this.paths=[["set","version","from","sources"]]}static{this.usage=it.Usage({description:"build Yarn from master",details:`
|
||||
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
|
||||
|
||||
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
|
||||
`,examples:[["Build Yarn from master","$0 set version from sources"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o}=await kt.find(r,this.context.cwd),a=typeof this.installPath<"u"?K.resolve(this.context.cwd,ue.toPortablePath(this.installPath)):K.resolve(ue.toPortablePath((0,ide.tmpdir)()),"yarnpkg-sources",wn.makeHash(this.repository).slice(0,6));return(await Rt.start({configuration:r,stdout:this.context.stdout},async u=>{await F8(this,{configuration:r,report:u,target:a}),u.reportSeparator(),u.reportInfo(0,"Building a fresh bundle"),u.reportSeparator();let A=await Ur.execvp("git",["rev-parse","--short","HEAD"],{cwd:a,strict:!0}),p=K.join(a,`packages/yarnpkg-cli/bundles/yarn-${A.stdout.trim()}.js`);oe.existsSync(p)||(await n2(sgt(this,p,a),{configuration:r,context:this.context,target:a}),u.reportSeparator());let h=await oe.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await k8(r,null,async()=>h,{report:u});this.skipPlugins||await ogt(this,E,{project:o,report:u,target:a})}})).exitCode()}};async function n2(t,{configuration:e,context:r,target:o}){for(let[a,...n]of t){let u=n[n.length-1]==="|";if(u&&n.pop(),u)await Ur.pipevp(a,n,{cwd:o,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${pe.pretty(e,` $ ${[a,...n].join(" ")}`,"grey")}
|
||||
`);try{await Ur.execvp(a,n,{cwd:o,strict:!0})}catch(A){throw r.stdout.write(A.stdout||A.stack),A}}}}async function F8(t,{configuration:e,report:r,target:o}){let a=!1;if(!t.force&&oe.existsSync(K.join(o,".git"))){r.reportInfo(0,"Fetching the latest commits"),r.reportSeparator();try{await n2(igt(t),{configuration:e,context:t.context,target:o}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,"Repository update failed; we'll try to regenerate it")}}a||(r.reportInfo(0,"Cloning the remote repository"),r.reportSeparator(),await oe.removePromise(o),await oe.mkdirPromise(o,{recursive:!0}),await n2(ngt(t,o),{configuration:e,context:t.context,target:o}))}async function ogt(t,e,{project:r,report:o,target:a}){let n=await Hg(r.configuration,e),u=new Set(Object.keys(n));for(let A of r.configuration.plugins.keys())u.has(A)&&await R8(A,t,{project:r,report:o,target:a})}Ge();Ge();Pt();qt();var ode=Ze(Jn()),ade=ve("vm");var hE=class extends ut{constructor(){super(...arguments);this.name=ge.String();this.checksum=ge.Boolean("--checksum",!0,{description:"Whether to care if this plugin is modified"})}static{this.paths=[["plugin","import"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
|
||||
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
|
||||
|
||||
Three types of plugin references are accepted:
|
||||
|
||||
- If the plugin is stored within the Yarn repository, it can be referenced by name.
|
||||
- Third-party plugins can be referenced directly through their public urls.
|
||||
- Local plugins can be referenced by their path on the disk.
|
||||
|
||||
If the \`--no-checksum\` option is set, Yarn will no longer care if the plugin is modified.
|
||||
|
||||
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
|
||||
`,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins);return(await Rt.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await kt.find(r,this.context.cwd),u,A;if(this.name.match(/^\.{0,2}[\\/]/)||ue.isAbsolute(this.name)){let p=K.resolve(this.context.cwd,ue.toPortablePath(this.name));a.reportInfo(0,`Reading ${pe.pretty(r,p,pe.Type.PATH)}`),u=K.relative(n.cwd,p),A=await oe.readFilePromise(p)}else{let p;if(this.name.match(/^https?:/)){try{new URL(this.name)}catch{throw new Jt(52,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}u=this.name,p=this.name}else{let h=G.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(h.reference!=="unknown"&&!ode.default.valid(h.reference))throw new Jt(0,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let E=G.stringifyIdent(h),I=await Hg(r,nn);if(!Object.hasOwn(I,E)){let v=`Couldn't find a plugin named ${G.prettyIdent(r,h)} on the remote registry.
|
||||
`;throw r.plugins.has(E)?v+=`A plugin named ${G.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:v+=`Note that only the plugins referenced on our website (${pe.pretty(r,"https://github.com/yarnpkg/berry/blob/master/plugins.yml",pe.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${pe.pretty(r,"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js",pe.Type.URL)}).`,new Jt(51,v)}u=E,p=I[E].url,h.reference!=="unknown"?p=p.replace(/\/master\//,`/${E}/${h.reference}/`):nn!==null&&(p=p.replace(/\/master\//,`/@yarnpkg/cli/${nn}/`))}a.reportInfo(0,`Downloading ${pe.pretty(r,p,"green")}`),A=await sn.get(p,{configuration:r})}await T8(u,A,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function T8(t,e,{checksum:r=!0,project:o,report:a}){let{configuration:n}=o,u={},A={exports:u};(0,ade.runInNewContext)(e.toString(),{module:A,exports:u});let h=`.yarn/plugins/${A.exports.name}.cjs`,E=K.resolve(o.cwd,h);a.reportInfo(0,`Saving the new plugin in ${pe.pretty(n,h,"magenta")}`),await oe.mkdirPromise(K.dirname(E),{recursive:!0}),await oe.writeFilePromise(E,e);let I={path:h,spec:t};r&&(I.checksum=wn.makeHash(e)),await Ke.addPlugin(o.cwd,[I])}var agt=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],gE=class extends ut{constructor(){super(...arguments);this.installPath=ge.String("--path",{description:"The path where the repository should be cloned to"});this.repository=ge.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=ge.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=ge.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=ge.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=ge.String()}static{this.paths=[["plugin","import","from","sources"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
|
||||
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
|
||||
|
||||
The plugins can be referenced by their short name if sourced from the official Yarn repository.
|
||||
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o=typeof this.installPath<"u"?K.resolve(this.context.cwd,ue.toPortablePath(this.installPath)):K.resolve(ue.toPortablePath((0,lde.tmpdir)()),"yarnpkg-sources",wn.makeHash(this.repository).slice(0,6));return(await Rt.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:u}=await kt.find(r,this.context.cwd),A=G.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),p=G.stringifyIdent(A),h=await Hg(r,nn);if(!Object.hasOwn(h,p))throw new Jt(51,`Couldn't find a plugin named "${p}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let E=p;await F8(this,{configuration:r,report:n,target:o}),await R8(E,this,{project:u,report:n,target:o})})).exitCode()}};async function R8(t,{context:e,noMinify:r},{project:o,report:a,target:n}){let u=t.replace(/@yarnpkg\//,""),{configuration:A}=o;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${u}`),a.reportSeparator(),await n2(agt({pluginName:u,noMinify:r},n),{configuration:A,context:e,target:n}),a.reportSeparator();let p=K.resolve(n,`packages/${u}/bundles/${t}.js`),h=await oe.readFilePromise(p);await T8(t,h,{project:o,report:a})}Ge();Pt();qt();var dE=class extends ut{constructor(){super(...arguments);this.name=ge.String()}static{this.paths=[["plugin","remove"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
|
||||
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
|
||||
|
||||
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
|
||||
`,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o}=await kt.find(r,this.context.cwd);return(await Rt.start({configuration:r,stdout:this.context.stdout},async n=>{let u=this.name,A=G.parseIdent(u);if(!r.plugins.has(u))throw new st(`${G.prettyIdent(r,A)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${u}.cjs`,h=K.resolve(o.cwd,p);oe.existsSync(h)&&(n.reportInfo(0,`Removing ${pe.pretty(r,p,pe.Type.PATH)}...`),await oe.removePromise(h)),n.reportInfo(0,"Updating the configuration..."),await Ke.updateConfiguration(o.cwd,{plugins:E=>{if(!Array.isArray(E))return E;let I=E.filter(v=>v.path!==p);return I.length===0?Ke.deleteProperty:I.length===E.length?E:I}})})).exitCode()}};Ge();qt();var mE=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","runtime"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
|
||||
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
|
||||
`,examples:[["List the currently active plugins","$0 plugin runtime"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins);return(await Rt.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let u=this.context.plugins.plugins.has(n),A=n;u&&(A+=" [builtin]"),a.reportJson({name:n,builtin:u}),a.reportInfo(null,`${A}`)}})).exitCode()}};Ge();Ge();qt();var yE=class extends ut{constructor(){super(...arguments);this.idents=ge.Rest()}static{this.paths=[["rebuild"]]}static{this.usage=it.Usage({description:"rebuild the project's native packages",details:`
|
||||
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
|
||||
|
||||
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
|
||||
|
||||
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
|
||||
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd),n=await Gr.find(r);if(!a)throw new sr(o.cwd,this.context.cwd);let u=new Set;for(let A of this.idents)u.add(G.parseIdent(A).identHash);if(await o.restoreInstallState({restoreResolutions:!1}),await o.resolveEverything({cache:n,report:new ki}),u.size>0)for(let A of o.storedPackages.values())u.has(A.identHash)&&(o.storedBuildState.delete(A.locatorHash),o.skippedBuilds.delete(A.locatorHash));else o.storedBuildState.clear(),o.skippedBuilds.clear();return await o.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();qt();var N8=Ze($o());el();var EE=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=ge.String("--mode",{description:"Change what artifacts installs generate",validator:Js(hl)});this.patterns=ge.Rest()}static{this.paths=[["remove"]]}static{this.usage=it.Usage({description:"remove dependencies from the project",details:`
|
||||
This command will remove the packages matching the specified patterns from the current workspace.
|
||||
|
||||
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
|
||||
|
||||
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
|
||||
|
||||
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
|
||||
|
||||
This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
|
||||
`,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd),n=await Gr.find(r);if(!a)throw new sr(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=this.all?o.workspaces:[a],A=["dependencies","devDependencies","peerDependencies"],p=[],h=!1,E=[];for(let C of this.patterns){let R=!1,L=G.parseIdent(C);for(let U of u){let z=[...U.manifest.peerDependenciesMeta.keys()];for(let te of(0,N8.default)(z,C))U.manifest.peerDependenciesMeta.delete(te),h=!0,R=!0;for(let te of A){let ae=U.manifest.getForScope(te),le=[...ae.values()].map(ce=>G.stringifyIdent(ce));for(let ce of(0,N8.default)(le,G.stringifyIdent(L))){let{identHash:Ce}=G.parseIdent(ce),de=ae.get(Ce);if(typeof de>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");U.manifest[te].delete(Ce),E.push([U,te,de]),h=!0,R=!0}}}R||p.push(C)}let I=p.length>1?"Patterns":"Pattern",v=p.length>1?"don't":"doesn't",x=this.all?"any":"this";if(p.length>0)throw new st(`${I} ${pe.prettyList(r,p,pe.Type.CODE)} ${v} match any packages referenced by ${x} workspace`);return h?(await r.triggerMultipleHooks(C=>C.afterWorkspaceDependencyRemoval,E),await o.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})):0}};Ge();Ge();qt();var cde=ve("util"),CE=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["run"]]}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd);if(!a)throw new sr(o.cwd,this.context.cwd);return(await Rt.start({configuration:r,stdout:this.context.stdout,json:this.json},async u=>{let A=a.manifest.scripts,p=He.sortMap(A.keys(),I=>I),h={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},E=p.reduce((I,v)=>Math.max(I,v.length),0);for(let[I,v]of A.entries())u.reportInfo(null,`${I.padEnd(E," ")} ${(0,cde.inspect)(v,h)}`),u.reportJson({name:I,script:v})})).exitCode()}};Ge();Ge();qt();var wE=class extends ut{constructor(){super(...arguments);this.inspect=ge.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=ge.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=ge.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=ge.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=ge.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=ge.Boolean("--silent",{hidden:!0});this.scriptName=ge.String();this.args=ge.Proxy()}static{this.paths=[["run"]]}static{this.usage=it.Usage({description:"run a script defined in the package.json",details:`
|
||||
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
|
||||
|
||||
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
|
||||
|
||||
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
|
||||
|
||||
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
|
||||
|
||||
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
|
||||
`,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a,locator:n}=await kt.find(r,this.context.cwd);await o.restoreInstallState();let u=this.topLevel?o.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await An.hasPackageScript(u,this.scriptName,{project:o}))return await An.executePackageScript(u,this.scriptName,this.args,{project:o,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let A=await An.getPackageAccessibleBinaries(u,{project:o});if(A.get(this.scriptName)){let h=[];return this.inspect&&(typeof this.inspect=="string"?h.push(`--inspect=${this.inspect}`):h.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?h.push(`--inspect-brk=${this.inspectBrk}`):h.push("--inspect-brk")),this.require&&h.push(`--require=${this.require}`),await An.executePackageAccessibleBinary(u,this.scriptName,this.args,{cwd:this.context.cwd,project:o,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:h,packageAccessibleBinaries:A})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(":")){let E=(await Promise.all(o.workspaces.map(async I=>I.manifest.scripts.has(this.scriptName)?I:null))).filter(I=>I!==null);if(E.length===1)return await An.executeWorkspaceScript(E[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new st(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${G.prettyLocator(r,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new st(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${G.prettyLocator(r,n)}).`);{if(this.scriptName==="global")throw new st("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let h=[this.scriptName].concat(this.args);for(let[E,I]of Uy)for(let v of I)if(h.length>=v.length&&JSON.stringify(h.slice(0,v.length))===JSON.stringify(v))throw new st(`Couldn't find a script named "${this.scriptName}", but a matching command can be found in the ${E} plugin. You can install it with "yarn plugin import ${E}".`);throw new st(`Couldn't find a script named "${this.scriptName}".`)}}};Ge();Ge();qt();var IE=class extends ut{constructor(){super(...arguments);this.descriptor=ge.String();this.resolution=ge.String()}static{this.paths=[["set","resolution"]]}static{this.usage=it.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, edit the `resolutions` field in your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 1.5.0"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd),n=await Gr.find(r);if(await o.restoreInstallState({restoreResolutions:!1}),!a)throw new sr(o.cwd,this.context.cwd);let u=G.parseDescriptor(this.descriptor,!0),A=G.makeDescriptor(u,this.resolution);return o.storedDescriptors.set(u.descriptorHash,u),o.storedDescriptors.set(A.descriptorHash,A),o.resolutionAliases.set(u.descriptorHash,A.descriptorHash),await o.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Ge();Pt();qt();var ude=Ze($o()),BE=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=ge.Rest()}static{this.paths=[["unlink"]]}static{this.usage=it.Usage({description:"disconnect the local project from another one",details:`
|
||||
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
|
||||
`,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd),n=await Gr.find(r);if(!a)throw new sr(o.cwd,this.context.cwd);let u=o.topLevelWorkspace,A=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:h}of u.manifest.resolutions)h.startsWith("portal:")&&A.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let h=K.resolve(this.context.cwd,ue.toPortablePath(p));if(He.isPathLike(p)){let E=await Ke.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:I,workspace:v}=await kt.find(E,h);if(!v)throw new sr(I.cwd,h);if(this.all){for(let x of I.workspaces)x.manifest.name&&A.add(G.stringifyIdent(x.anchoredLocator));if(A.size===0)throw new st("No workspace found to be unlinked in the target project")}else{if(!v.manifest.name)throw new st("The target workspace doesn't have a name and thus cannot be unlinked");A.add(G.stringifyIdent(v.anchoredLocator))}}else{let E=[...u.manifest.resolutions.map(({pattern:I})=>I.descriptor.fullName)];for(let I of(0,ude.default)(E,p))A.add(I)}}return u.manifest.resolutions=u.manifest.resolutions.filter(({pattern:p})=>!A.has(p.descriptor.fullName)),await o.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();qt();var Ade=Ze(J1()),L8=Ze($o());el();var vE=class extends ut{constructor(){super(...arguments);this.interactive=ge.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.fixed=ge.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=ge.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=ge.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=ge.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=ge.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=ge.String("--mode",{description:"Change what artifacts installs generate",validator:Js(hl)});this.patterns=ge.Rest()}static{this.paths=[["up"]]}static{this.usage=it.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up`Line truncated
|
||||
|
||||
${ce}`):L.reportError(27,`${G.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled)
|
||||
|
||||
${ce}`)}else ae.length>1&&!A&&L.reportError(27,`${G.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(x.hasErrors())return x.exitCode();let C=!1,R=[];for(let[L,U,,{suggestions:z}]of v){let te,ae=z.filter(de=>de.descriptor!==null),le=ae[0].descriptor,ce=ae.every(de=>G.areDescriptorsEqual(de.descriptor,le));ae.length===1||ce?te=le:(C=!0,{answer:te}=await(0,Ade.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${G.prettyWorkspace(r,L)} \u276F ${U}?`,choices:z.map(({descriptor:de,name:Be,reason:Ee})=>de?{name:Be,hint:Ee,descriptor:de}:{name:Be,hint:Ee,disabled:!0}),onCancel:()=>process.exit(130),result(de){return this.find(de,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let Ce=L.manifest[U].get(te.identHash);if(typeof Ce>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(Ce.descriptorHash!==te.descriptorHash)L.manifest[U].set(te.identHash,te),R.push([L,U,Ce,te]);else{let de=r.makeResolver(),Be={project:o,resolver:de},Ee=r.normalizeDependency(Ce),g=de.bindDescriptor(Ee,L.anchoredLocator,Be);o.forgetResolution(g)}}return await r.triggerMultipleHooks(L=>L.afterWorkspaceDependencyReplacement,R),C&&this.context.stdout.write(`
|
||||
`),await o.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}};Ge();Ge();Ge();qt();var DE=class extends ut{constructor(){super(...arguments);this.recursive=ge.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=ge.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=ge.String()}static{this.paths=[["why"]]}static{this.usage=it.Usage({description:"display the reason why a package is needed",details:`
|
||||
This command prints the exact reasons why a package appears in the dependency tree.
|
||||
|
||||
If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
|
||||
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd);if(!a)throw new sr(o.cwd,this.context.cwd);await o.restoreInstallState();let n=G.parseIdent(this.package).identHash,u=this.recursive?cgt(o,n,{configuration:r,peers:this.peers}):lgt(o,n,{configuration:r,peers:this.peers});fs.emitTree(u,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function lgt(t,e,{configuration:r,peers:o}){let a=He.sortMap(t.storedPackages.values(),A=>G.stringifyLocator(A)),n={},u={children:n};for(let A of a){let p={};for(let E of A.dependencies.values()){if(!o&&A.peerDependencies.has(E.identHash))continue;let I=t.storedResolutions.get(E.descriptorHash);if(!I)throw new Error("Assertion failed: The resolution should have been registered");let v=t.storedPackages.get(I);if(!v)throw new Error("Assertion failed: The package should have been registered");if(v.identHash!==e)continue;{let C=G.stringifyLocator(A);n[C]={value:[A,pe.Type.LOCATOR],children:p}}let x=G.stringifyLocator(v);p[x]={value:[{descriptor:E,locator:v},pe.Type.DEPENDENT]}}}return u}function cgt(t,e,{configuration:r,peers:o}){let a=He.sortMap(t.workspaces,v=>G.stringifyLocator(v.anchoredLocator)),n=new Set,u=new Set,A=v=>{if(n.has(v.locatorHash))return u.has(v.locatorHash);if(n.add(v.locatorHash),v.identHash===e)return u.add(v.locatorHash),!0;let x=!1;v.identHash===e&&(x=!0);for(let C of v.dependencies.values()){if(!o&&v.peerDependencies.has(C.identHash))continue;let R=t.storedResolutions.get(C.descriptorHash);if(!R)throw new Error("Assertion failed: The resolution should have been registered");let L=t.storedPackages.get(R);if(!L)throw new Error("Assertion failed: The package should have been registered");A(L)&&(x=!0)}return x&&u.add(v.locatorHash),x};for(let v of a)A(v.anchoredPackage);let p=new Set,h={},E={children:h},I=(v,x,C)=>{if(!u.has(v.locatorHash))return;let R=C!==null?pe.tuple(pe.Type.DEPENDENT,{locator:v,descriptor:C}):pe.tuple(pe.Type.LOCATOR,v),L={},U={value:R,children:L},z=G.stringifyLocator(v);if(x[z]=U,!(C!==null&&t.tryWorkspaceByLocator(v))&&!p.has(v.locatorHash)){p.add(v.locatorHash);for(let te of v.dependencies.values()){if(!o&&v.peerDependencies.has(te.identHash))continue;let ae=t.storedResolutions.get(te.descriptorHash);if(!ae)throw new Error("Assertion failed: The resolution should have been registered");let le=t.storedPackages.get(ae);if(!le)throw new Error("Assertion failed: The package should have been registered");I(le,L,te)}}};for(let v of a)I(v.anchoredPackage,h,null);return E}Ge();var W8={};Vt(W8,{GitFetcher:()=>s2,GitResolver:()=>o2,default:()=>kgt,gitUtils:()=>ia});Ge();Pt();var ia={};Vt(ia,{TreeishProtocols:()=>i2,clone:()=>Y8,fetchBase:()=>Rde,fetchChangedFiles:()=>Tde,fetchChangedWorkspaces:()=>bgt,fetchRoot:()=>Fde,isGitUrl:()=>bE,lsRemote:()=>Qde,normalizeLocator:()=>Sgt,normalizeRepoUrl:()=>PE,resolveUrl:()=>G8,splitRepoUrl:()=>bh,validateRepoUrl:()=>j8});Ge();Pt();qt();var bde=Ze(Dde()),xde=Ze(uU()),SE=Ze(ve("querystring")),H8=Ze(Jn());function _8(t,e,r){let o=t.indexOf(r);return t.lastIndexOf(e,o>-1?o:1/0)}function Pde(t){try{return new URL(t)}catch{return}}function Dgt(t){let e=_8(t,"@","#"),r=_8(t,":","#");return r>e&&(t=`${t.slice(0,r)}/${t.slice(r+1)}`),_8(t,":","#")===-1&&t.indexOf("//")===-1&&(t=`ssh://${t}`),t}function Sde(t){return Pde(t)||Pde(Dgt(t))}function PE(t,{git:e=!1}={}){if(t=t.replace(/^git\+https:/,"https:"),t=t.replace(/^(?:github:|https:\/\/github\.com\/|git:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\.git)?(#.*)?$/,"https://github.com/$1/$2.git$3"),t=t.replace(/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,"https://github.com/$1/$2.git#$3"),e){let r=Sde(t);r&&(t=r.href),t=t.replace(/^git\+([^:]+):/,"$1:")}return t}function kde(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`}}var Pgt=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],i2=(a=>(a.Commit="commit",a.Head="head",a.Tag="tag",a.Semver="semver",a))(i2||{});function bE(t){return t?Pgt.some(e=>!!t.match(e)):!1}function bh(t){t=PE(t);let e=t.indexOf("#");if(e===-1)return{repo:t,treeish:{protocol:"head",request:"HEAD"},extra:{}};let r=t.slice(0,e),o=t.slice(e+1);if(o.match(/^[a-z]+=/)){let a=SE.default.parse(o);for(let[p,h]of Object.entries(a))if(typeof h!="string")throw new Error(`Assertion failed: The ${p} parameter must be a literal string`);let n=Object.values(i2).find(p=>Object.hasOwn(a,p)),[u,A]=
Line truncated
|
||||
This command will run a given sub-command on a single workspace.
|
||||
`,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd);if(!a)throw new sr(o.cwd,this.context.cwd);let n=o.workspaces,u=new Map(n.map(p=>[G.stringifyIdent(p.anchoredLocator),p])),A=u.get(this.workspaceName);if(A===void 0){let p=Array.from(u.keys()).sort();throw new st(`Workspace '${this.workspaceName}' not found. Did you mean any of the following:
|
||||
- ${p.join(`
|
||||
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:A.cwd})}};var Qgt={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:Nde.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:"STRING",values:["^","~",""],default:"^"},preferReuse:{description:"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.",type:"BOOLEAN",default:!1}},commands:[Ky,Vy,zy,Jy,IE,pE,sE,xE,$y,eE,tE,rE,Yy,Wy,Xy,Zy,nE,iE,oE,aE,lE,cE,BE,uE,AE,gE,hE,dE,fE,mE,yE,EE,CE,wE,vE,DE,kE]},Fgt=Qgt;var Z8={};Vt(Z8,{default:()=>Tgt});Ge();var xt={optional:!0},V8=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:xt,zenObservable:xt}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:xt,zenObservable:xt}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{"supports-color":xt}}],["got@<11",{dependencies:{"@types/responselike":"^1.0.0","@types/keyv":"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{"@types/keyv":"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{"vscode-jsonrpc":"^5.0.1","vscode-languageserver-protocol":"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{"postcss-html":xt,"postcss-jsx":xt,"postcss-less":xt,"postcss-markdown":xt,"postcss-scss":xt}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{"tiny-warning":"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:xt}}],["snowpack@>=3.3.0",{dependencies:{"node-gyp":"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:xt}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:xt,"vue-template-compiler":xt}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],["ws@<7.2.1",{peerDependencies:{bufferutil:"^4.0.1","utf-8-validate":"^5.0.2"},peerDependenciesMeta:{bufferutil:xt,"utf-8-validate":xt}}],["react-portal@<4.2.2",{peerDependencies:{"react-dom":"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"}}],["react-scripts@<=4.0.1",{peerDependencies:{react:"*"}}],["testcafe@<=1.10.1",{dependencies:{"@babel/plugin-transform-for-of":"^7.12.1","@babel/runtime":"^7.12.5"}}],["testcafe-legacy-api@<=4.2.0",{dependencies:{"testcafe-hammerhead":"^17.0.1","read-file-relative":"^1.2.0"}}],["@google-cloud/firestore@<=4.9.3",{dependencies:{protobufjs:"^6.8.6"}}],["gatsby-source-apiserver@*",{dependencies:{"babel-polyfill":"^6.26.0"}}],["@webpack-cli/package-utils@<=1.0.1-alpha.4",{dependencies:{"cross-spawn":"^7.0.3"}}],["gatsby-remark-prismjs@<3.3.28",{dependencies:{lodash:"^4"}}],["gatsby-plugin-favicon@*",{peerDependencies:{webpack:"*"}}],["gatsby-plugin-sharp@<=4.6.0-next.3",{dependencies:{debug:"^4.3.1"}}],["gatsby-react-router-scroll@<=5.6.0-next.0",{dependencies:{"prop-types":"^15.7.2"}}],["@rebass/forms@*",{dependencies:{"@styled-system/should-forward-prop":"^5.0.0"},peerDependencies:{react:"^16.8.6"}}],["rebass@*",{peerDependencies:{react:"^16.8.6"}}],["@ant-design/react-slick@<=0.28.3",{peerDependencies:{react:">=16.0.0"}}],["mqtt@<4.2.7",{dependencies:{duplexify:"^4.1.1"}}],["vue-cli-plugin-vuetify@<=2.0.3",{dependencies:{semver:"^6.3.0"},peerDependenciesMeta:{"sass-loader":xt,"vuetify-loader":xt}}],["vue-cli-plugin-vuetify@<=2.0.4",{dependencies:{"null-loader":"^3.0.0"}}],["vue-cli-plugin-vuetify@>=2.4.3",{peerDependencies:{vue:"*"}}],["@vuetify/cli-plugin-utils@<=0.0.4",{dependencies:{semver:"^6.3.0"},peerDependenciesMeta:{"sass-loader":xt}}],["@vue/cli-plugin-typescript@<=5.0.0-alpha.0",{deLine truncated
|
||||
This command will output all matches to the given prolog query.
|
||||
`,examples:[["List all dependencies throughout the workspace","yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(f2(),A2)),o=await Ke.find(this.context.cwd,this.context.plugins),{project:a}=await kt.find(o,this.context.cwd),n=await r.find(a),u=this.query;return u.endsWith(".")||(u=`${u}.`),(await Rt.start({configuration:o,json:this.json,stdout:this.context.stdout},async p=>{for await(let h of n.query(u)){let E=Array.from(Object.entries(h)),I=E.length,v=E.reduce((x,[C])=>Math.max(x,C.length),0);for(let x=0;x<I;x++){let[C,R]=E[x];p.reportInfo(null,`${sdt(x,I)}${C.padEnd(v," ")} = ${idt(R)}`)}p.reportJson(h)}})).exitCode()}};function idt(t){return typeof t!="string"?`${t}`:t.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?t:`'${t}'`}function sdt(t,e){let r=t===0,o=t===e-1;return r&&o?"":r?"\u250C ":o?"\u2514 ":"\u2502 "}Ge();qt();var ME=class extends ut{constructor(){super(...arguments);this.verbose=ge.Boolean("-v,--verbose",!1,{description:"Also print the fact database automatically compiled from the workspace manifests"})}static{this.paths=[["constraints","source"]]}static{this.usage=it.Usage({category:"Constraints-related commands",description:"print the source code for the constraints",details:"\n This command will print the Prolog source code used by the constraints engine. Adding the `-v,--verbose` flag will print the *full* source code, including the fact database automatically compiled from the workspace manifests.\n ",examples:[["Prints the source code","yarn constraints source"],["Print the source code and the fact database","yarn constraints source -v"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(f2(),A2)),o=await Ke.find(this.context.cwd,this.context.plugins),{project:a}=await kt.find(o,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ge();Ge();qt();l2();var OE=class extends ut{constructor(){super(...arguments);this.fix=ge.Boolean("--fix",!1,{description:"Attempt to automatically fix unambiguous issues, following a multi-pass process"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["constraints"]]}static{this.usage=it.Usage({category:"Constraints-related commands",description:"check that the project constraints are met",details:`
|
||||
This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code.
|
||||
|
||||
If the \`--fix\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution.
|
||||
|
||||
For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints.
|
||||
`,examples:[["Check that all constraints are satisfied","yarn constraints"],["Autofix all unmet constraints","yarn constraints --fix"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o}=await kt.find(r,this.context.cwd);await o.restoreInstallState();let a=await o.loadUserConfig(),n;if(a?.constraints)n=new FE(o);else{let{Constraints:h}=await Promise.resolve().then(()=>(f2(),A2));n=await h.find(o)}let u,A=!1,p=!1;for(let h=this.fix?10:1;h>0;--h){let E=await n.process();if(!E)break;let{changedWorkspaces:I,remainingErrors:v}=ik(o,E,{fix:this.fix}),x=[];for(let[C,R]of I){let L=C.manifest.indent;C.manifest=new Ut,C.manifest.indent=L,C.manifest.load(R),x.push(C.persistManifest())}if(await Promise.all(x),!(I.size>0&&h>1)){u=Wde(v,{configuration:r}),A=!1,p=!0;for(let[,C]of v)for(let R of C)R.fixable?A=!0:p=!1}}if(u.children.length===0)return 0;if(A){let h=p?`Those errors can all be fixed by running ${pe.pretty(r,"yarn constraints --fix",pe.Type.CODE)}`:`Errors prefixed by '\u2699' can be fixed by running ${pe.pretty(r,"yarn constraints --fix",pe.Type.CODE)}`;await Rt.start({configuration:r,stdout:this.context.stdout,includeNames:!1,includeFooter:!1},async E=>{E.reportInfo(0,h),E.reportSeparator()})}return u.children=He.sortMap(u.children,h=>h.value[1]),fs.emitTree(u,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1}),1}};l2();var odt={configuration:{enableConstraintsChecks:{description:"If true, constraints will run during installs",type:"BOOLEAN",default:!1},constraintsPath:{description:"The path of the constraints file.",type:"ABSOLUTE_PATH",default:"./constraints.pro"}},commands:[LE,ME,OE],hooks:{async validateProjectAfterInstall(t,{reportError:e}){if(!t.configuration.get("enableConstraintsChecks"))return;let r=await t.loadUserConfig(),o;if(r?.constraints)o=new FE(t);else{let{Constraints:u}=await Promise.resolve().then(()=>(f2(),A2));o=await u.find(t)}let a=await o.process();if(!a)return;let{remainingErrors:n}=ik(t,a);if(n.size!==0)if(t.configuration.isCI)for(let[u,A]of n)for(let p of A)e(84,`${pe.pretty(t.configuration,u.anchoredLocator,pe.Type.IDENT)}: ${p.text}`);else e(84,`Constraint check failed; run ${pe.pretty(t.configuration,"yarn constraints",pe.Type.CODE)} for more details`)}}},adt=odt;var mH={};Vt(mH,{CreateCommand:()=>UE,DlxCommand:()=>_E,default:()=>cdt});Ge();qt();var UE=class extends ut{constructor(){super(...arguments);this.pkg=ge.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=ge.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[["create"]]}async execute(){let r=[];this.pkg&&r.push("--package",this.pkg),this.quiet&&r.push("--quiet");let o=this.command.replace(/^(@[^@/]+)(@|$)/,"$1/create$2"),a=G.parseDescriptor(o),n=a.name.match(/^create(-|$)/)?a:a.scope?G.makeIdent(a.scope,`create-${a.name}`):G.makeIdent(null,`create-${a.name}`),u=G.stringifyIdent(n);return a.range!=="unknown"&&(u+=`@${a.range}`),this.cli.run(["dlx",...r,u,...this.args])}};Ge();Ge();Pt();qt();var _E=class extends ut{constructor(){super(...arguments);this.packages=ge.Array("-p,--package",{description:"The package(s) to install before running the command"});this.quiet=ge.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[["dlx"]]}static{this.usage=it.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-react-app to create a new React app","yarn dlx create-react-app ./my-app"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]})}async execute(){return Ke.telemetry=null,await oe.mktempPromise(async r=>{let o=K.join(r,`dlx-${process.pid}`);await oe.mkdirPromise(o),await oe.writeFilePromise(K.join(o,"package.json"),`{}
|
||||
`),await oe.writeFilePromise(K.join(o,"yarn.lock"),"");let a=K.join(o,".yarnrc.yml"),n=await Ke.findProjectCwd(this.context.cwd),A={enableGlobalCache:!(await Ke.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),enableTelemetry:!1,logFilters:[{code:Ku(68),level:pe.LogLevel.Discard}]},p=n!==null?K.join(n,".yarnrc.yml"):null;p!==null&&oe.existsSync(p)?(await oe.copyFilePromise(p,a),await Ke.updateConfiguration(o,L=>{let U=He.toMerged(L,A);return Array.isArray(L.plugins)&&(U.plugins=L.plugins.map(z=>{let te=typeof z=="string"?z:z.path,ae=ue.isAbsolute(te)?te:ue.resolve(ue.fromPortablePath(n),te);return typeof z=="string"?ae:{path:ae,spec:z.spec}})),U})):await oe.writeJsonPromise(a,A);let h=this.packages??[this.command],E=G.parseDescriptor(this.command).name,I=await this.cli.run(["add","--fixed","--",...h],{cwd:o,quiet:this.quiet});if(I!==0)return I;this.quiet||this.context.stdout.write(`
|
||||
`);let v=await Ke.find(o,this.context.plugins),{project:x,workspace:C}=await kt.find(v,o);if(C===null)throw new sr(x.cwd,o);await x.restoreInstallState();let R=await An.getWorkspaceAccessibleBinaries(C);return R.has(E)===!1&&R.size===1&&typeof this.packages>"u"&&(E=Array.from(R)[0][0]),await An.executeWorkspaceAccessibleBinary(C,E,this.args,{packageAccessibleBinaries:R,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var ldt={commands:[UE,_E]},cdt=ldt;var CH={};Vt(CH,{ExecFetcher:()=>h2,ExecResolver:()=>g2,default:()=>fdt,execUtils:()=>lk});Ge();Ge();Pt();var fA="exec:";var lk={};Vt(lk,{loadGeneratorFile:()=>p2,makeLocator:()=>EH,makeSpec:()=>yme,parseSpec:()=>yH});Ge();Pt();function yH(t){let{params:e,selector:r}=G.parseRange(t),o=ue.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?G.parseLocator(e.locator):null,path:o}}function yme({parentLocator:t,path:e,generatorHash:r,protocol:o}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return G.makeRange({protocol:o,source:e,selector:e,params:{...n,...a}})}function EH(t,{parentLocator:e,path:r,generatorHash:o,protocol:a}){return G.makeLocator(t,yme({parentLocator:e,path:r,generatorHash:o,protocol:a}))}async function p2(t,e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(t,{protocol:e}),n=K.isAbsolute(a)?{packageFs:new gn(It.root),prefixPath:It.dot,localPath:It.root}:await r.fetcher.fetch(o,r),u=n.localPath?{packageFs:new gn(It.root),prefixPath:K.relative(It.root,n.localPath)}:n;n!==u&&n.releaseFs&&n.releaseFs();let A=u.packageFs,p=K.join(u.prefixPath,a);return await A.readFilePromise(p,"utf8")}var h2=class{supports(e,r){return!!e.reference.startsWith(fA)}getLocalPath(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:fA});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:K.resolve(n,a)}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:u}}async fetchFromDisk(e,r){let o=await p2(e.reference,fA,r);return oe.mktempPromise(async a=>{let n=K.join(a,"generator.js");return await oe.writeFilePromise(n,o),oe.mktempPromise(async u=>{if(await this.generatePackage(u,e,n,r),!oe.existsSync(K.join(u,"build")))throw new Error("The script should have generated a build directory");return await $i.makeArchiveFromDirectory(K.join(u,"build"),{prefixPath:G.getIdentVendorPath(e),compressionLevel:r.project.configuration.get("compressionLevel")})})})}async generatePackage(e,r,o,a){return await oe.mktempPromise(async n=>{let u=await An.makeScriptEnv({project:a.project,binFolder:n}),A=K.join(e,"runtime.js");return await oe.mktempPromise(async p=>{let h=K.join(p,"buildfile.log"),E=K.join(e,"generator"),I=K.join(e,"build");await oe.mkdirPromise(E),await oe.mkdirPromise(I);let v={tempDir:ue.fromPortablePath(E),buildDir:ue.fromPortablePath(I),locator:G.stringifyLocator(r)};await oe.writeFilePromise(A,`
|
||||
// Expose 'Module' as a global variable
|
||||
Object.defineProperty(global, 'Module', {
|
||||
get: () => require('module'),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
|
||||
// Expose non-hidden built-in modules as global variables
|
||||
for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) {
|
||||
Object.defineProperty(global, name, {
|
||||
get: () => require(name),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
}
|
||||
|
||||
// Expose the 'execEnv' global variable
|
||||
Object.defineProperty(global, 'execEnv', {
|
||||
value: {
|
||||
...${JSON.stringify(v)},
|
||||
},
|
||||
enumerable: true,
|
||||
});
|
||||
`);let x=u.NODE_OPTIONS||"",C=/\s*--require\s+\S*\.pnp\.c?js\s*/g;x=x.replace(C," ").trim(),u.NODE_OPTIONS=x;let{stdout:R,stderr:L}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${G.stringifyLocator(r)})
|
||||
`,prefix:G.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await Ur.pipevp(process.execPath,["--require",ue.fromPortablePath(A),ue.fromPortablePath(o),G.stringifyIdent(r)],{cwd:e,env:u,stdin:null,stdout:R,stderr:L});if(U!==0)throw oe.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${pe.pretty(a.project.configuration,h,pe.Type.PATH)})`)})})}};Ge();Ge();var udt=2,g2=class{supportsDescriptor(e,r){return!!e.range.startsWith(fA)}supportsLocator(e,r){return!!e.reference.startsWith(fA)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=yH(e.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let u=await p2(G.makeRange({protocol:fA,source:a,selector:a,params:{locator:G.stringifyLocator(n)}}),fA,o.fetchOptions),A=wn.makeHash(`${udt}`,u).slice(0,6);return[EH(e,{parentLocator:n,path:a,generatorHash:A,protocol:fA})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await He.releaseAfterUseAsync(async()=>await Ut.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var Adt={fetchers:[h2],resolvers:[g2]},fdt=Adt;var IH={};Vt(IH,{FileFetcher:()=>E2,FileResolver:()=>C2,TarballFileFetcher:()=>w2,TarballFileResolver:()=>I2,default:()=>gdt,fileUtils:()=>Yg});Ge();Pt();var HE=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,d2=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,Ui="file:";var Yg={};Vt(Yg,{fetchArchiveFromLocator:()=>y2,makeArchiveFromLocator:()=>ck,makeBufferFromLocator:()=>wH,makeLocator:()=>qE,makeSpec:()=>Eme,parseSpec:()=>m2});Ge();Pt();function m2(t){let{params:e,selector:r}=G.parseRange(t),o=ue.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?G.parseLocator(e.locator):null,path:o}}function Eme({parentLocator:t,path:e,hash:r,protocol:o}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return G.makeRange({protocol:o,source:e,selector:e,params:{...n,...a}})}function qE(t,{parentLocator:e,path:r,hash:o,protocol:a}){return G.makeLocator(t,Eme({parentLocator:e,path:r,hash:o,protocol:a}))}async function y2(t,e){let{parentLocator:r,path:o}=G.parseFileStyleRange(t.reference,{protocol:Ui}),a=K.isAbsolute(o)?{packageFs:new gn(It.root),prefixPath:It.dot,localPath:It.root}:await e.fetcher.fetch(r,e),n=a.localPath?{packageFs:new gn(It.root),prefixPath:K.relative(It.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let u=n.packageFs,A=K.join(n.prefixPath,o);return await He.releaseAfterUseAsync(async()=>await u.readFilePromise(A),n.releaseFs)}async function ck(t,{protocol:e,fetchOptions:r,inMemory:o=!1}){let{parentLocator:a,path:n}=G.parseFileStyleRange(t.reference,{protocol:e}),u=K.isAbsolute(n)?{packageFs:new gn(It.root),prefixPath:It.dot,localPath:It.root}:await r.fetcher.fetch(a,r),A=u.localPath?{packageFs:new gn(It.root),prefixPath:K.relative(It.root,u.localPath)}:u;u!==A&&u.releaseFs&&u.releaseFs();let p=A.packageFs,h=K.join(A.prefixPath,n);return await He.releaseAfterUseAsync(async()=>await $i.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:G.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:o}),A.releaseFs)}async function wH(t,{protocol:e,fetchOptions:r}){return(await ck(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var E2=class{supports(e,r){return!!e.reference.startsWith(Ui)}getLocalPath(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:Ui});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:K.resolve(n,a)}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:u}}async fetchFromDisk(e,r){return ck(e,{protocol:Ui,fetchOptions:r})}};Ge();Ge();var pdt=2,C2=c
Line truncated
|
||||
`,{automaticNewlines:!0});let h=[p],E=K.join(this.context.cwd,"README.md");if(oe.existsSync(E)||(await oe.writeFilePromise(E,`# ${G.stringifyIdent(n.name)}
|
||||
`),h.push(E)),!o||o.cwd===this.context.cwd){let I=K.join(this.context.cwd,dr.lockfile);oe.existsSync(I)||(await oe.writeFilePromise(I,""),h.push(I));let x=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Swap the comments on the following lines if you wish to use zero-installs","# In that case, don't forget to run `yarn config set enableGlobalCache false`!","# Documentation here: https://yarnpkg.com/features/caching#zero-installs","","#!.yarn/cache",".pnp.*"].map(le=>`${le}
|
||||
`).join(""),C=K.join(this.context.cwd,".gitignore");oe.existsSync(C)||(await oe.writeFilePromise(C,x),h.push(C));let L=["/.yarn/** linguist-vendored","/.yarn/releases/* binary","/.yarn/plugins/**/* binary","/.pnp.* binary linguist-generated"].map(le=>`${le}
|
||||
`).join(""),U=K.join(this.context.cwd,".gitattributes");oe.existsSync(U)||(await oe.writeFilePromise(U,L),h.push(U));let z={"*":{endOfLine:"lf",insertFinalNewline:!0},"*.{js,json,yml}":{charset:"utf-8",indentStyle:"space",indentSize:2}};He.mergeIntoTarget(z,r.get("initEditorConfig"));let te=`root = true
|
||||
`;for(let[le,ce]of Object.entries(z)){te+=`
|
||||
[${le}]
|
||||
`;for(let[Ce,de]of Object.entries(ce)){let Be=Ce.replace(/[A-Z]/g,Ee=>`_${Ee.toLowerCase()}`);te+=`${Be} = ${de}
|
||||
`}}let ae=K.join(this.context.cwd,".editorconfig");oe.existsSync(ae)||(await oe.writeFilePromise(ae,te),h.push(ae)),await this.cli.run(["install"],{quiet:!0}),oe.existsSync(K.join(this.context.cwd,".git"))||(await Ur.execvp("git",["init"],{cwd:this.context.cwd}),await Ur.execvp("git",["add","--",...h],{cwd:this.context.cwd}),await Ur.execvp("git",["commit","--allow-empty","-m","First commit"],{cwd:this.context.cwd}))}}};var Cdt={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:"STRING",default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:"MAP",valueDefinition:{description:"",type:"ANY"}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:"MAP",valueDefinition:{description:"",type:"ANY"}}},commands:[jE]},wdt=Cdt;var kq={};Vt(kq,{SearchCommand:()=>oC,UpgradeInteractiveCommand:()=>aC,default:()=>cIt});Ge();var vme=Ze(ve("os"));function GE({stdout:t}){if(vme.default.endianness()==="BE")throw new Error("Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures");if(!t.isTTY)throw new Error("Interactive commands can only be used inside a TTY environment")}qt();var Lye=Ze(YH()),WH={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},yyt=(0,Lye.default)(WH.appId,WH.apiKey).initIndex(WH.indexName),KH=async(t,e=0)=>await yyt.search(t,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:e,hitsPerPage:10});var vB=["regular","dev","peer"],oC=class extends ut{static{this.paths=[["search"]]}static{this.usage=it.Usage({category:"Interactive commands",description:"open the search interface",details:`
|
||||
This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.
|
||||
`,examples:[["Open the search window","yarn search"]]})}async execute(){GE(this.context);let{Gem:e}=await Promise.resolve().then(()=>(Zk(),Eq)),{ScrollableItems:r}=await Promise.resolve().then(()=>(rQ(),tQ)),{useKeypress:o}=await Promise.resolve().then(()=>(wB(),Xwe)),{useMinistore:a}=await Promise.resolve().then(()=>(Dq(),vq)),{renderForm:n}=await Promise.resolve().then(()=>(oQ(),sQ)),{default:u}=await Promise.resolve().then(()=>Ze(aIe())),{Box:A,Text:p}=await Promise.resolve().then(()=>Ze(ic())),{default:h,useEffect:E,useState:I}=await Promise.resolve().then(()=>Ze(an())),v=await Ke.find(this.context.cwd,this.context.plugins),x=()=>h.createElement(A,{flexDirection:"row"},h.createElement(A,{flexDirection:"column",width:48},h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to move between packages.")),h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," to select a package.")),h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," again to change the target."))),h.createElement(A,{flexDirection:"column"},h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to install the selected packages.")),h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),C=()=>h.createElement(h.Fragment,null,h.createElement(A,{width:15},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Owner")),h.createElement(A,{width:11},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Version")),h.createElement(A,{width:10},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Downloads"))),R=()=>h.createElement(A,{width:17},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Target")),L=({hit:de,active:Be})=>{let[Ee,g]=a(de.name,null);o({active:Be},(Ae,ne)=>{if(ne.name!=="space")return;if(!Ee){g(vB[0]);return}let Z=vB.indexOf(Ee)+1;Z===vB.length?g(null):g(vB[Z])},[Ee,g]);let me=G.parseIdent(de.name),we=G.prettyIdent(v,me);return h.createElement(A,null,h.createElement(A,{width:45},h.createElement(p,{bold:!0,wrap:"wrap"},we)),h.createElement(A,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:"truncate"},de.owner.name)),h.createElement(A,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:"truncate"},de.version)),h.createElement(A,{width:16,marginLeft:1},h.createElement(p,null,de.humanDownloadsLast30Days)))},U=({name:de,active:Be})=>{let[Ee]=a(de,null),g=G.parseIdent(de);return h.createElement(A,null,h.createElement(A,{width:47},h.createElement(p,{bold:!0}," - ",G.prettyIdent(v,g))),vB.map(me=>h.createElement(A,{key:me,width:14,marginLeft:1},h.createElement(p,null," ",h.createElement(e,{active:Ee===me})," ",h.createElement(p,{bold:!0},me)))))},z=()=>h.createElement(A,{marginTop:1},h.createElement(p,null,"Powered by Algolia.")),ae=await n(({useSubmit:de})=>{let Be=a();de(Be);let Ee=Array.from(Be.keys()).filter(H=>Be.get(H)!==null),[g,me]=I(""),[we,Ae]=I(0),[ne,Z]=I([]),xe=H=>{H.match(/\t| /)||me(H)},Ne=async()=>{Ae(0);let H=await KH(g);H.query===g&&Z(H.hits)},ht=async()=>{let H=await KH(g,we+1);H.query===g&&H.page-1===we&&(Ae(H.page),Z([...ne,...H.hits]))};return E(()=>{g?Ne():Z([])},[g]),h.createElement(A,{flexDirection:"column"},h.createElement(x,null),h.createElement(A,{flexDirection:"row",marginTop:1},h.createElement(p,{bold:!0},"Search: "),h.createElement(A,{width:41},h.createElement(u,{value:g,onChange:xe,placeholder:"i.e. babel, webpack, react...",showCursor:!1})),h.createElement(C,null)),ne.length?h.createElement(r,{radius:2,loop:!1,children:ne.map(H=>h.createElement(L,{key:H.name,hit:H,active:!1})),willReachEnd:ht}):h.createElement(p,{color:"gray"},"Start typing..."),h.createElement(A,{flexDirection:"row",marginTop:1},h.createElement(A,{width:49},h.createElement(p,{bold:!0},"Selected:")),h.createElement(R,null)),Ee.length?Ee.map(H=>h.createElement(U,{key:H,name:H,active:!1})):h.createElement(p,{color:"gray"},"No selected packages..."),h.createElement(z,null))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof ae>"u")return 1;let le=Array.from(ae.keys()).filter(de=>ae.get(de)==="regular"),ce=Array.from(ae.keys()).filter(de=>ae.get(de)==="dev"),Ce=Array.from(ae.keys()).filter(de=>ae.get(de)==="peer");return le.length&&await this.cli.run(["add",...le]),ce.length&&await this.cli.run(["add","--dev",...ce]),Ce&&await this.cli.run(["add","--peer",...Ce]),0}};Ge();qt();f_();var hIe=Ze(Jn()),pIe=/^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/,gIe=(t,e)=>t.length>0?[t.slice(0,e)].concat(gIe(t.slice(e),e)):[],aC=class extends ut{static{this.paths=[["upgrade-interactive"]]}static{this.usage=it.Usage({category:"Interactive commands",description:"open the upgrade interf
Line truncated
|
||||
This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade.
|
||||
`,examples:[["Open the upgrade window","yarn upgrade-interactive"]]})}async execute(){GE(this.context);let{ItemOptions:e}=await Promise.resolve().then(()=>(fIe(),AIe)),{Pad:r}=await Promise.resolve().then(()=>(xq(),uIe)),{ScrollableItems:o}=await Promise.resolve().then(()=>(rQ(),tQ)),{useMinistore:a}=await Promise.resolve().then(()=>(Dq(),vq)),{renderForm:n}=await Promise.resolve().then(()=>(oQ(),sQ)),{Box:u,Text:A}=await Promise.resolve().then(()=>Ze(ic())),{default:p,useEffect:h,useRef:E,useState:I}=await Promise.resolve().then(()=>Ze(an())),v=await Ke.find(this.context.cwd,this.context.plugins),{project:x,workspace:C}=await kt.find(v,this.context.cwd),R=await Gr.find(v);if(!C)throw new sr(x.cwd,this.context.cwd);await x.restoreInstallState({restoreResolutions:!1});let L=this.context.stdout.rows-7,U=(me,we)=>{let Ae=gpe(me,we),ne="";for(let Z of Ae)Z.added?ne+=pe.pretty(v,Z.value,"green"):Z.removed||(ne+=Z.value);return ne},z=(me,we)=>{if(me===we)return we;let Ae=G.parseRange(me),ne=G.parseRange(we),Z=Ae.selector.match(pIe),xe=ne.selector.match(pIe);if(!Z||!xe)return U(me,we);let Ne=["gray","red","yellow","green","magenta"],ht=null,H="";for(let rt=1;rt<Ne.length;++rt)ht!==null||Z[rt]!==xe[rt]?(ht===null&&(ht=Ne[rt-1]),H+=pe.pretty(v,xe[rt],ht)):H+=xe[rt];return H},te=async(me,we,Ae)=>{let ne=await Zc.fetchDescriptorFrom(me,Ae,{project:x,cache:R,preserveModifier:we,workspace:C});return ne!==null?ne.range:me.range},ae=async me=>{let we=hIe.default.valid(me.range)?`^${me.range}`:me.range,[Ae,ne]=await Promise.all([te(me,me.range,we).catch(()=>null),te(me,me.range,"latest").catch(()=>null)]),Z=[{value:null,label:me.range}];return Ae&&Ae!==me.range?Z.push({value:Ae,label:z(me.range,Ae)}):Z.push({value:null,label:""}),ne&&ne!==Ae&&ne!==me.range?Z.push({value:ne,label:z(me.range,ne)}):Z.push({value:null,label:""}),Z},le=()=>p.createElement(u,{flexDirection:"row"},p.createElement(u,{flexDirection:"column",width:49},p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},"<up>"),"/",p.createElement(A,{bold:!0,color:"cyanBright"},"<down>")," to select packages.")),p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},"<left>"),"/",p.createElement(A,{bold:!0,color:"cyanBright"},"<right>")," to select versions."))),p.createElement(u,{flexDirection:"column"},p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},"<enter>")," to install.")),p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),ce=()=>p.createElement(u,{flexDirection:"row",paddingTop:1,paddingBottom:1},p.createElement(u,{width:50},p.createElement(A,{bold:!0},p.createElement(A,{color:"greenBright"},"?")," Pick the packages you want to upgrade.")),p.createElement(u,{width:17},p.createElement(A,{bold:!0,underline:!0,color:"gray"},"Current")),p.createElement(u,{width:17},p.createElement(A,{bold:!0,underline:!0,color:"gray"},"Range")),p.createElement(u,{width:17},p.createElement(A,{bold:!0,underline:!0,color:"gray"},"Latest"))),Ce=({active:me,descriptor:we,suggestions:Ae})=>{let[ne,Z]=a(we.descriptorHash,null),xe=G.stringifyIdent(we),Ne=Math.max(0,45-xe.length);return p.createElement(p.Fragment,null,p.createElement(u,null,p.createElement(u,{width:45},p.createElement(A,{bold:!0},G.prettyIdent(v,we)),p.createElement(r,{active:me,length:Ne})),p.createElement(e,{active:me,options:Ae,value:ne,skewer:!0,onChange:Z,sizes:[17,17,17]})))},de=({dependencies:me})=>{let[we,Ae]=I(me.map(()=>null)),ne=E(!0),Z=async xe=>{let Ne=await ae(xe);return Ne.filter(ht=>ht.label!=="").length<=1?null:{descriptor:xe,suggestions:Ne}};return h(()=>()=>{ne.current=!1},[]),h(()=>{let xe=Math.trunc(L*1.75),Ne=me.slice(0,xe),ht=me.slice(xe),H=gIe(ht,L),rt=Ne.map(Z).reduce(async(Te,Fe)=>{await Te;let ke=await Fe;ke!==null&&ne.current&&Ae(Ye=>{let Se=Ye.findIndex(Ue=>Ue===null),et=[...Ye];return et[Se]=ke,et})},Promise.resolve());H.reduce((Te,Fe)=>Promise.all(Fe.map(ke=>Promise.resolve().then(()=>Z(ke)))).then(async ke=>{ke=ke.filter(Ye=>Ye!==null),await Te,ne.current&&Ae(Ye=>{let Se=Ye.findIndex(et=>et===null);return Ye.slice(0,Se).concat(ke).concat(Ye.slice(Se+ke.length))})}),rt).then(()=>{ne.current&&Ae(Te=>Te.filter(Fe=>Fe!==null))})},[]),we.length?p.createElement(o,{radius:L>>1,children:we.map((xe,Ne)=>xe!==null?p.createElement(Ce,{key:Ne,active:!1,descriptor:xe.descriptor,suggestions:xe.suggestions}):p.createElement(A,{key:Ne},"Loading..."))}):p.createElement(A,null,"No upgrades found")},Ee=await n(({useSubmit:me})=>{me(a());let we=new Map;for(let ne of x.workspaces)for(let Z of["dependencies","devDependencies"])for(let xe of ne.manifest[Z].values())x.tryWorkspaceByDescriptor(xe)===null&&(xe.range.startsWith("link:")||we.set(xe.descriptorHash,xe));let Ae=He.sortMap(we.values(),ne=>G.stringifyDescriptor(ne));return p.createEleme
Line truncated
|
||||
${E}, next tree:
|
||||
${kB(A)}`);let v=EIe(A);if(v)throw new Error(`${v}, after hoisting finished:
|
||||
${kB(A)}`)}return n.debugLevel>=2&&console.log(kB(A)),EIt(A)},fIt=t=>{let e=t[t.length-1],r=new Map,o=new Set,a=n=>{if(!o.has(n)){o.add(n);for(let u of n.hoistedDependencies.values())r.set(u.name,u);for(let u of n.dependencies.values())n.peerNames.has(u.name)||a(u)}};return a(e),r},pIt=t=>{let e=t[t.length-1],r=new Map,o=new Set,a=new Set,n=(u,A)=>{if(o.has(u))return;o.add(u);for(let h of u.hoistedDependencies.values())if(!A.has(h.name)){let E;for(let I of t)E=I.dependencies.get(h.name),E&&r.set(E.name,E)}let p=new Set;for(let h of u.dependencies.values())p.add(h.name);for(let h of u.dependencies.values())u.peerNames.has(h.name)||n(h,p)};return n(e,a),r},mIe=(t,e)=>{if(e.decoupled)return e;let{name:r,references:o,ident:a,locator:n,dependencies:u,originalDependencies:A,hoistedDependencies:p,peerNames:h,reasons:E,isHoistBorder:I,hoistPriority:v,dependencyKind:x,hoistedFrom:C,hoistedTo:R}=e,L={name:r,references:new Set(o),ident:a,locator:n,dependencies:new Map(u),originalDependencies:new Map(A),hoistedDependencies:new Map(p),peerNames:new Set(h),reasons:new Map(E),decoupled:!0,isHoistBorder:I,hoistPriority:v,dependencyKind:x,hoistedFrom:new Map(C),hoistedTo:new Map(R)},U=L.dependencies.get(r);return U&&U.ident==L.ident&&L.dependencies.set(r,L),t.dependencies.set(L.name,L),L},hIt=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let a of t.dependencies.values())t.peerNames.has(a.name)||r.set(a.name,[a.ident]);let o=Array.from(e.keys());o.sort((a,n)=>{let u=e.get(a),A=e.get(n);return A.hoistPriority!==u.hoistPriority?A.hoistPriority-u.hoistPriority:A.peerDependents.size!==u.peerDependents.size?A.peerDependents.size-u.peerDependents.size:A.dependents.size-u.dependents.size});for(let a of o){let n=a.substring(0,a.indexOf("@",1)),u=a.substring(n.length+1);if(!t.peerNames.has(n)){let A=r.get(n);A||(A=[],r.set(n,A)),A.indexOf(u)<0&&A.push(u)}}return r},Fq=t=>{let e=new Set,r=(o,a=new Set)=>{if(!a.has(o)){a.add(o);for(let n of o.peerNames)if(!t.peerNames.has(n)){let u=t.dependencies.get(n);u&&!e.has(u)&&r(u,a)}e.add(o)}};for(let o of t.dependencies.values())t.peerNames.has(o.name)||r(o);return e},Tq=(t,e,r,o,a,n=new Set)=>{let u=e[e.length-1];if(n.has(u))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(u);let A=CIt(u),p=hIt(u,A),h=t==u?new Map:a.fastLookupPossible?fIt(e):pIt(e),E,I=!1,v=!1,x=new Map(Array.from(p.entries()).map(([R,L])=>[R,L[0]])),C=new Map;do{let R=mIt(t,e,r,h,x,p,o,C,a);R.isGraphChanged&&(v=!0),R.anotherRoundNeeded&&(I=!0),E=!1;for(let[L,U]of p)U.length>1&&!u.dependencies.has(L)&&(x.delete(L),U.shift(),x.set(L,U[0]),E=!0)}while(E);for(let R of u.dependencies.values())if(!u.peerNames.has(R.name)&&!r.has(R.locator)){r.add(R.locator);let L=Tq(t,[...e,R],r,C,a);L.isGraphChanged&&(v=!0),L.anotherRoundNeeded&&(I=!0),r.delete(R.locator)}return{anotherRoundNeeded:I,isGraphChanged:v}},gIt=t=>{for(let[e,r]of t.dependencies)if(!t.peerNames.has(e)&&r.ident!==t.ident)return!0;return!1},dIt=(t,e,r,o,a,n,u,A,{outputReason:p,fastLookupPossible:h})=>{let E,I=null,v=new Set;p&&(E=`${Array.from(e).map(L=>no(L)).join("\u2192")}`);let x=r[r.length-1],R=!(o.ident===x.ident);if(p&&!R&&(I="- self-reference"),R&&(R=o.dependencyKind!==1,p&&!R&&(I="- workspace")),R&&o.dependencyKind===2&&(R=!gIt(o),p&&!R&&(I="- external soft link with unhoisted dependencies")),R&&(R=x.dependencyKind!==1||x.hoistedFrom.has(o.name)||e.size===1,p&&!R&&(I=x.reasons.get(o.name))),R&&(R=!t.peerNames.has(o.name),p&&!R&&(I=`- cannot shadow peer: ${no(t.originalDependencies.get(o.name).locator)} at ${E}`)),R){let L=!1,U=a.get(o.name);if(L=!U||U.ident===o.ident,p&&!L&&(I=`- filled by: ${no(U.locator)} at ${E}`),L)for(let z=r.length-1;z>=1;z--){let ae=r[z].dependencies.get(o.name);if(ae&&ae.ident!==o.ident){L=!1;let le=A.get(x);le||(le=new Set,A.set(x,le)),le.add(o.name),p&&(I=`- filled by ${no(ae.locator)} at ${r.slice(0,z).map(ce=>no(ce.locator)).join("\u2192")}`);break}}R=L}if(R&&(R=n.get(o.name)===o.ident,p&&!R&&(I=`- filled by: ${no(u.get(o.name)[0])} at ${E}`)),R){let L=!0,U=new Set(o.peerNames);for(let z=r.length-1;z>=1;z--){let te=r[z];for(let ae of U){if(te.peerNames.has(ae)&&te.originalDependencies.has(ae))continue;let le=te.dependencies.get(ae);le&&t.dependencies.get(ae)!==le&&(z===r.length-1?v.add(le):(v=null,L=!1,p&&(I=`- peer dependency ${no(le.locator)} from parent ${no(te.locator)} was not hoisted to ${E}`))),U.delete(ae)}if(!L)break}R=L}if(R&&!h)for(let L of o.hoistedDependencies.values()){let U=a.get(L.name)||t.dependencies.get(L.name);if(!U||L.ident!==U.ident){R=!1,p&&(I=`- previously hoisted dependency mismatch, needed: ${no(L.locator)}, available: ${no(U?.locator)}`);break}}return v!==null&&v.size>0?{isHoistable:2,dependsOn:v,reason:I}:{isHoistable:R?0:1,reason:I}},aQ=t=>`${t.name}@${t.locator}`,mIt=(t,e,r,o,a,n,u,A,p)=>{let h=e[e.length-1],E=new Set,I=!1,v=!1,x=(U,z,te,ae,le)=>{if(E.has(ae))return;let ce=[...z,aQ(ae)],Ce=[...te,aQ(ae)],de=new Map,Be=new Map;for(let Ae of Fq(ae)){let ne=dIt(h,r,[h,...U,ae],Ae,o,a,n,A,{outputReaso
Line truncated
|
||||
${kB(t)}`)}let we=Fq(ae);for(let Ae of we)if(Ee.has(Ae)){let ne=Be.get(Ae);if((a.get(Ae.name)===Ae.ident||!ae.reasons.has(Ae.name))&&ne.isHoistable!==0&&ae.reasons.set(Ae.name,ne.reason),!Ae.isHoistBorder&&Ce.indexOf(aQ(Ae))<0){E.add(ae);let xe=mIe(ae,Ae);x([...U,ae],ce,Ce,xe,R),E.delete(ae)}}},C,R=new Set(Fq(h)),L=Array.from(e).map(U=>aQ(U));do{C=R,R=new Set;for(let U of C){if(U.locator===h.locator||U.isHoistBorder)continue;let z=mIe(h,U);x([],Array.from(r),L,z,R)}}while(R.size>0);return{anotherRoundNeeded:I,isGraphChanged:v}},EIe=t=>{let e=[],r=new Set,o=new Set,a=(n,u,A)=>{if(r.has(n)||(r.add(n),o.has(n)))return;let p=new Map(u);for(let h of n.dependencies.values())n.peerNames.has(h.name)||p.set(h.name,h);for(let h of n.originalDependencies.values()){let E=p.get(h.name),I=()=>`${Array.from(o).concat([n]).map(v=>no(v.locator)).join("\u2192")}`;if(n.peerNames.has(h.name)){let v=u.get(h.name);(v!==E||!v||v.ident!==h.ident)&&e.push(`${I()} - broken peer promise: expected ${h.ident} but found ${v&&v.ident}`)}else{let v=A.hoistedFrom.get(n.name),x=n.hoistedTo.get(h.name),C=`${v?` hoisted from ${v.join(", ")}`:""}`,R=`${x?` hoisted to ${x}`:""}`,L=`${I()}${C}`;E?E.ident!==h.ident&&e.push(`${L} - broken require promise for ${h.name}${R}: expected ${h.ident}, but found: ${E.ident}`):e.push(`${L} - broken require promise: no required dependency ${h.name}${R} found`)}}o.add(n);for(let h of n.dependencies.values())n.peerNames.has(h.name)||a(h,p,n);o.delete(n)};return a(t,t.dependencies,t),e.join(`
|
||||
`)},yIt=(t,e)=>{let{identName:r,name:o,reference:a,peerNames:n}=t,u={name:o,references:new Set([a]),locator:Rq(r,a),ident:dIe(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},A=new Map([[t,u]]),p=(h,E)=>{let I=A.get(h),v=!!I;if(!I){let{name:x,identName:C,reference:R,peerNames:L,hoistPriority:U,dependencyKind:z}=h,te=e.hoistingLimits.get(E.locator);I={name:x,references:new Set([R]),locator:Rq(C,R),ident:dIe(C,R),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(L),reasons:new Map,decoupled:!0,isHoistBorder:te?te.has(x):!1,hoistPriority:U||0,dependencyKind:z||0,hoistedFrom:new Map,hoistedTo:new Map},A.set(h,I)}if(E.dependencies.set(h.name,I),E.originalDependencies.set(h.name,I),v){let x=new Set,C=R=>{if(!x.has(R)){x.add(R),R.decoupled=!1;for(let L of R.dependencies.values())R.peerNames.has(L.name)||C(L)}};C(I)}else for(let x of h.dependencies)p(x,I)};for(let h of t.dependencies)p(h,u);return u},Nq=t=>t.substring(0,t.indexOf("@",1)),EIt=t=>{let e={name:t.name,identName:Nq(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),o=(a,n,u)=>{let A=r.has(a),p;if(n===a)p=u;else{let{name:h,references:E,locator:I}=a;p={name:h,identName:Nq(I),references:E,dependencies:new Set}}if(u.dependencies.add(p),!A){r.add(a);for(let h of a.dependencies.values())a.peerNames.has(h.name)||o(h,a,p);r.delete(a)}};for(let a of t.dependencies.values())o(a,t,e);return e},CIt=t=>{let e=new Map,r=new Set([t]),o=u=>`${u.name}@${u.ident}`,a=u=>{let A=o(u),p=e.get(A);return p||(p={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(A,p)),p},n=(u,A)=>{let p=!!r.has(A);if(a(A).dependents.add(u.ident),!p){r.add(A);for(let E of A.dependencies.values()){let I=a(E);I.hoistPriority=Math.max(I.hoistPriority,E.hoistPriority),A.peerNames.has(E.name)?I.peerDependents.add(A.ident):n(A,E)}}};for(let u of t.dependencies.values())t.peerNames.has(u.name)||n(t,u);return e},no=t=>{if(!t)return"none";let e=t.indexOf("@",1),r=t.substring(0,e);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let o=t.substring(e+1);if(o==="workspace:.")return".";if(o){let a=(o.indexOf("#")>0?o.split("#")[1]:o).replace("npm:","");return o.startsWith("virtual")&&(r=`v:${r}`),a.startsWith("workspace")&&(r=`w:${r}`,a=""),`${r}${a?`@${a}`:""}`}else return`${r}`};var kB=t=>{let e=0,r=(a,n,u="")=>{if(e>5e4||n.has(a))return"";e++;let A=Array.from(a.dependencies.values()).sort((h,E)=>h.name===E.name?0:h.name>E.name?1:-1),p="";n.add(a);for(let h=0;h<A.length;h++){let E=A[h];if(!a.peerNames.has(E.name)&&E!==a){let I=a.reasons.get(E.name),v=Nq(E.locator);p+=`${u}${h<A.length-1?"\u251C\u2500":"\u2514\u2500"}${(n.has(E)?">":"")+(v!==E.name?`a:${E.name}:`:"")+no(E.locator)+(I?` ${I}`:"")}
|
||||
`,p+=r(E,n,`${u}${h<A.length-1?"\u2502 ":" "}`)}}return n.delete(a),p};return r(t,new Set)+(e>5e4?`
|
||||
Tree is too large, part of the tree has been dunped
|
||||
`:"")};var QB=(o=>(o.WORKSPACES="workspaces",o.DEPENDENCIES="dependencies",o.NONE="none",o))(QB||{}),CIe="node_modules",Oh="$wsroot$";var FB=(t,e)=>{let{packageTree:r,hoistingLimits:o,errors:a,preserveSymlinksRequired:n}=IIt(t,e),u=null;if(a.length===0){let A=yIe(r,{hoistingLimits:o});u=vIt(t,A,e)}return{tree:u,errors:a,preserveSymlinksRequired:n}},gA=t=>`${t.name}@${t.reference}`,Mq=t=>{let e=new Map;for(let[r,o]of t.entries())if(!o.dirList){let a=e.get(o.locator);a||(a={target:o.target,linkType:o.linkType,locations:[],aliases:o.aliases},e.set(o.locator,a)),a.locations.push(r)}for(let r of e.values())r.locations=r.locations.sort((o,a)=>{let n=o.split(K.delimiter).length,u=a.split(K.delimiter).length;return a===o?0:n!==u?u-n:a>o?1:-1});return e},wIe=(t,e)=>{let r=G.isVirtualLocator(t)?G.devirtualizeLocator(t):t,o=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e;return G.areLocatorsEqual(r,o)},Lq=(t,e,r,o)=>{if(t.linkType!=="SOFT")return!1;let a=ue.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?r.resolveVirtual(t.packageLocation):t.packageLocation);return K.contains(o,a)===null},wIt=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(t.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let o=ue.toPortablePath(e.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},u=t.getDependencyTreeRoots(),A=new Map,p=new Set,h=(v,x)=>{let C=gA(v);if(p.has(C))return;p.add(C);let R=t.getPackageInformation(v);if(R){let L=x?gA(x):"";if(gA(v)!==L&&R.linkType==="SOFT"&&!v.reference.startsWith("link:")&&!Lq(R,v,t,o)){let U=IIe(R,v,t);(!A.get(U)||v.reference.startsWith("workspace:"))&&A.set(U,v)}for(let[U,z]of R.packageDependencies)z!==null&&(R.packagePeers.has(U)||h(t.getLocator(U,z),v))}};for(let v of u)h(v,null);let E=o.split(K.sep);for(let v of A.values()){let x=t.getPackageInformation(v),R=ue.toPortablePath(x.packageLocation.slice(0,-1)).split(K.sep).slice(E.length),L=n;for(let U of R){let z=L.children.get(U);z||(z={children:new Map},L.children.set(U,z)),L=z}L.workspaceLocator=v}let I=(v,x)=>{if(v.workspaceLocator){let C=gA(x),R=a.get(C);R||(R=new Set,a.set(C,R)),R.add(v.workspaceLocator)}for(let C of v.children.values())I(C,v.workspaceLocator||x)};for(let v of n.children.values())I(v,n.workspaceLocator);return a},IIt=(t,e)=>{let r=[],o=!1,a=new Map,n=wIt(t),u=t.getPackageInformation(t.topLevel);if(u===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let A=t.findPackageLocator(u.packageLocation);if(A===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let p=ue.toPortablePath(u.packageLocation.slice(0,-1)),h={name:A.name,identName:A.name,reference:A.reference,peerNames:u.packagePeers,dependencies:new Set,dependencyKind:1},E=new Map,I=(x,C)=>`${gA(C)}:${x}`,v=(x,C,R,L,U,z,te,ae)=>{let le=I(x,R),ce=E.get(le),Ce=!!ce;!Ce&&R.name===A.name&&R.reference===A.reference&&(ce=h,E.set(le,h));let de=Lq(C,R,t,p);if(!ce){let Ae=0;de?Ae=2:C.linkType==="SOFT"&&R.name.endsWith(Oh)&&(Ae=1),ce={name:x,identName:R.name,reference:R.reference,dependencies:new Set,peerNames:Ae===1?new Set:C.packagePeers,dependencyKind:Ae},E.set(le,ce)}let Be;if(de?Be=2:U.linkType==="SOFT"?Be=1:Be=0,ce.hoistPriority=Math.max(ce.hoistPriority||0,Be),ae&&!de){let Ae=gA({name:L.identName,reference:L.reference}),ne=a.get(Ae)||new Set;a.set(Ae,ne),ne.add(ce.name)}let Ee=new Map(C.packageDependencies);if(e.project){let Ae=e.project.workspacesByCwd.get(ue.toPortablePath(C.packageLocation.slice(0,-1)));if(Ae){let ne=new Set([...Array.from(Ae.manifest.peerDependencies.values(),Z=>G.stringifyIdent(Z)),...Array.from(Ae.manifest.peerDependenciesMeta.keys())]);for(let Z of ne)Ee.has(Z)||(Ee.set(Z,z.get(Z)||null),ce.peerNames.add(Z))}}let g=gA({name:R.name.replace(Oh,""),reference:R.reference}),me=n.get(g);if(me)for(let Ae of me)Ee.set(`${Ae.name}${Oh}`,Ae.reference);(C!==U||C.linkType!=="SOFT"||!de&&(!e.selfReferencesByCwd||e.selfReferencesByCwd.get(te)))&&L.dependencies.add(ce);let we=R!==A&&C.linkType==="SOFT"&&!R.name.endsWith(Oh)&&!de;if(!Ce&&!we){let Ae=new Map;for(let[ne,Z]of Ee)if(Z!==null){let xe=t.getLocator(ne,Z),Ne=t.getLocator(ne.replace(Oh,""),Z),ht=t.getPackageInformation(Ne);if(ht===null)throw new Error("Assertion failed: Expected the package to have been registered");let H=Lq(ht,xe,t,p);if(e.validateExternalSoftLinks&&e.project&&H){ht.packageDependencies.size>0&&(o=!0);for(let[Ye,Se]of ht.packageDependencies)if(Se!==null){let et=G.parseLocator(Array.isArray(Se)?`${Se[0]}@${Se[1]}`:`${Ye}@${Se}`);if(gA(et)!==gA(xe)){let Ue=Ee.get(Ye);if(Ue){let b=G.parseLocator(Array.isArray(Ue)?`${Ue[0]}@${Ue[1]}`:`${Ye}@${Ue}`);wIe(b,et)||r.push({messageName:71,text:`Cannot link ${G.prettyIdent(e.project.configuration,G.parseIdent(xe.name))} into ${G.pretLine truncated
|
||||
`;for(let n=0,u=t.length;n<u;++n)a+=o+lQ(String(n),t[n],e,o).replace(/^ +/,""),n+1<u&&(a+=","),a+=`
|
||||
`;return a+=r,a+="]",a}function SIt(t,e,r){let o=Object.keys(t),a="";a+="{";for(let n=0,u=o.length,A=0;n<u;++n){let p=o[n],h=t[p];typeof h>"u"||(A!==0&&(a+=", "),a+=JSON.stringify(p),a+=": ",a+=lQ(p,h,e,r).replace(/^ +/g,""),A+=1)}return a+="}",a}function bIt(t,e,r){let o=Object.keys(t),a=`${r} `,n="";n+=r,n+=`{
|
||||
`;let u=0;for(let A=0,p=o.length;A<p;++A){let h=o[A],E=t[h];typeof E>"u"||(u!==0&&(n+=",",n+=`
|
||||
`),n+=a,n+=JSON.stringify(h),n+=": ",n+=lQ(h,E,e,a).replace(/^ +/g,""),u+=1)}return u!==0&&(n+=`
|
||||
`),n+=r,n+="}",n}function lQ(t,e,r,o){let{next:a}=BIe[r],n=a[t]||a["*"];return vIe(e,n,o)}function vIe(t,e,r){let{collapsed:o}=BIe[e];return Array.isArray(t)?o?DIt(t,e,r):PIt(t,e,r):typeof t=="object"&&t!==null?o?SIt(t,e,r):bIt(t,e,r):JSON.stringify(t)}function DIe(t){return vIe(t,"TOP_LEVEL","")}function RB(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let o=[];for(let n of e)o.push(r.map(u=>n(u)));let a=r.map((n,u)=>u);return a.sort((n,u)=>{for(let A of o){let p=A[n]<A[u]?-1:A[n]>A[u]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function xIt(t){let e=new Map,r=RB(t.fallbackExclusionList||[],[({name:o,reference:a})=>o,({name:o,reference:a})=>a]);for(let{name:o,reference:a}of r){let n=e.get(o);typeof n>"u"&&e.set(o,n=new Set),n.add(a)}return Array.from(e).map(([o,a])=>[o,Array.from(a)])}function kIt(t){return RB(t.fallbackPool||[],([e])=>e)}function QIt(t){let e=[];for(let[r,o]of RB(t.packageRegistry,([a])=>a===null?"0":`1${a}`)){let a=[];e.push([r,a]);for(let[n,{packageLocation:u,packageDependencies:A,packagePeers:p,linkType:h,discardFromLookup:E}]of RB(o,([I])=>I===null?"0":`1${I}`)){let I=[];r!==null&&n!==null&&!A.has(r)&&I.push([r,n]);for(let[C,R]of RB(A.entries(),([L])=>L))I.push([C,R]);let v=p&&p.size>0?Array.from(p):void 0,x=E||void 0;a.push([n,{packageLocation:u,packageDependencies:I,packagePeers:v,linkType:h,discardFromLookup:x}])}}return e}function TB(t){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost."],dependencyTreeRoots:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,fallbackExclusionList:xIt(t),fallbackPool:kIt(t),packageRegistryData:QIt(t)}}var bIe=Ze(SIe());function xIe(t,e){return[t?`${t}
|
||||
`:"",`/* eslint-disable */
|
||||
`,`// @ts-nocheck
|
||||
`,`"use strict";
|
||||
`,`
|
||||
`,e,`
|
||||
`,(0,bIe.default)()].join("")}function FIt(t){return JSON.stringify(t,null,2)}function RIt(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
|
||||
`)}'`}function TIt(t){return[`const RAW_RUNTIME_STATE =
|
||||
`,`${RIt(DIe(t))};
|
||||
|
||||
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
`,` return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});
|
||||
`,`}
|
||||
`].join("")}function NIt(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
`,` const fs = require('fs');
|
||||
`,` const path = require('path');
|
||||
`,` const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(dr.pnpData)});
|
||||
`,` return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname});
|
||||
`,`}
|
||||
`].join("")}function kIe(t){let e=TB(t),r=TIt(e);return xIe(t.shebang,r)}function QIe(t){let e=TB(t),r=NIt(),o=xIe(t.shebang,r);return{dataFile:FIt(e),loaderFile:o}}Pt();function Uq(t,{basePath:e}){let r=ue.toPortablePath(e),o=K.resolve(r),a=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,n=new Map,u=new Map(t.packageRegistryData.map(([I,v])=>[I,new Map(v.map(([x,C])=>{if(I===null!=(x===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let R=C.discardFromLookup??!1,L={name:I,reference:x},U=n.get(C.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&R,R||(U.locator=L)):n.set(C.packageLocation,{locator:L,discardFromLookup:R});let z=null;return[x,{packageDependencies:new Map(C.packageDependencies),packagePeers:new Set(C.packagePeers),linkType:C.linkType,discardFromLookup:R,get packageLocation(){return z||(z=K.join(o,C.packageLocation))}}]}))])),A=new Map(t.fallbackExclusionList.map(([I,v])=>[I,new Set(v)])),p=new Map(t.fallbackPool),h=t.dependencyTreeRoots,E=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:h,enableTopLevelFallback:E,fallbackExclusionList:A,fallbackPool:p,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:u}}Pt();Pt();var ep=ve("module"),id=ve("url"),zq=ve("util");var Oo=ve("url");var NIe=Ze(ve("assert"));var _q=Array.isArray,NB=JSON.stringify,LB=Object.getOwnPropertyNames,nd=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Hq=(t,e)=>RegExp.prototype.exec.call(t,e),qq=(t,...e)=>RegExp.prototype[Symbol.replace].apply(t,e),Uh=(t,...e)=>String.prototype.endsWith.apply(t,e),jq=(t,...e)=>String.prototype.includes.apply(t,e),Gq=(t,...e)=>String.prototype.lastIndexOf.apply(t,e),MB=(t,...e)=>String.prototype.indexOf.apply(t,e),FIe=(t,...e)=>String.prototype.replace.apply(t,e),_h=(t,...e)=>String.prototype.slice.apply(t,e),dA=(t,...e)=>String.prototype.startsWith.apply(t,e),RIe=Map,TIe=JSON.parse;function OB(t,e,r){return class extends r{constructor(...o){super(e(...o)),this.code=t,this.name=`${r.name} [${t}]`}}}var LIe=OB("ERR_PACKAGE_IMPORT_NOT_DEFINED",(t,e,r)=>`Package import specifier "${t}" is not defined${e?` in package ${e}package.json`:""} imported from ${r}`,TypeError),Yq=OB("ERR_INVALID_MODULE_SPECIFIER",(t,e,r=void 0)=>`Invalid module "${t}" ${e}${r?` imported from ${r}`:""}`,TypeError),MIe=OB("ERR_INVALID_PACKAGE_TARGET",(t,e,r,o=!1,a=void 0)=>{let n=typeof r=="string"&&!o&&r.length&&!dA(r,"./");return e==="."?((0,NIe.default)(o===!1),`Invalid "exports" main target ${NB(r)} defined in the package config ${t}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${o?"imports":"exports"}" target ${NB(r)} defined for '${e}' in the package config ${t}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`},Error),UB=OB("ERR_INVALID_PACKAGE_CONFIG",(t,e,r)=>`Invalid package config ${t}${e?` while importing ${e}`:""}${r?`. ${r}`:""}`,Error),OIe=OB("ERR_PACKAGE_PATH_NOT_EXPORTED",(t,e,r=void 0)=>e==="."?`No "exports" main defined in ${t}package.json${r?` imported from ${r}`:""}`:`Package subpath '${e}' is not defined by "exports" in ${t}package.json${r?` imported from ${r}`:""}`,Error);var uQ=ve("url");function UIe(t,e){let r=Object.create(null);for(let o=0;o<e.length;o++){let a=e[o];nd(t,a)&&(r[a]=t[a])}return r}var cQ=new RIe;function LIt(t,e,r,o){let a=cQ.get(t);if(a!==void 0)return a;let n=o(t);if(n===void 0){let x={pjsonPath:t,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return cQ.set(t,x),x}let u;try{u=TIe(n)}catch(x){throw new UB(t,(r?`"${e}" from `:"")+(0,uQ.fileURLToPath)(r||e),x.message)}let{imports:A,main:p,name:h,type:E}=UIe(u,["imports","main","name","type"]),I=nd(u,"exports")?u.exports:void 0;(typeof A!="object"||A===null)&&(A=void 0),typeof p!="string"&&(p=void 0),typeof h!="string"&&(h=void 0),E!=="module"&&E!=="commonjs"&&(E="none");let v={pjsonPath:t,exists:!0,main:p,name:h,type:E,exports:I,imports:A};return cQ.set(t,v),v}function _Ie(t,e){let r=new URL("./package.json",t);for(;;){let n=r.pathname;if(Uh(n,"node_modules/package.json"))break;let u=LIt((0,uQ.fileURLToPath)(r),t,void 0,e);if(u.exists)return u;let A=r;if(r=new URL("../package.json",r),r.pathname===A.pathname)break}let o=(0,uQ.fileURLToPath)(r),a={pjsonPath:o,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return cQ.set(o,a),a}function MIt(t,e,r){throw new LIe(t,e&&(0,Oo.fileURLToPath)(new URL(".",e)),(0,Oo.fileURLToPath)(r))}function OIt(t,e,r,o){let a=`request is not a valid subpath for the "${r?"imports":"exports"}" resolution of ${(0,Oo.fileURLToPath)(e)}`;throw new Yq(t,a,o&&(0,Oo.fileURLToPath)(o))}function _B(t,e,r,o,a){throw typeof e=="object"&&e!==null?e=NB(e,null,""):e=`${e}`,new MIe((0,Oo.fileURLToPath)(new URL(".",r)),t,e,o,a&&(0,Oo.fileURLToPath)(a))}var HIe=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|
Line truncated
|
||||
`),r;u=t[++n]}else if(u===" "&&!o){a=!0;continue}else if(u==='"'){o=!o;continue}a?(r.push(u),a=!1):r[r.length-1]+=u}return o&&e.push(`invalid value for NODE_OPTIONS (unterminated string)
|
||||
`),r}Pt();var[Ua,$f]=process.versions.node.split(".").map(t=>parseInt(t,10)),ZIe=Ua>19||Ua===19&&$f>=2||Ua===18&&$f>=13,xJt=Ua===20&&$f<6||Ua===19&&$f>=3,kJt=Ua>19||Ua===19&&$f>=6,QJt=Ua>=21||Ua===20&&$f>=10||Ua===18&&$f>=19,FJt=Ua>=21||Ua===20&&$f>=10||Ua===18&&$f>=20,RJt=Ua>=22;function $Ie(t){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send)if(t=t.map(e=>ue.fromPortablePath(zs.resolveVirtual(ue.toPortablePath(e)))),ZIe)process.send({"watch:require":t});else for(let e of t)process.send({"watch:require":e})}function Jq(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,o=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,n=/^(\/|\.{1,2}(\/|$))/,u=/\/$/,A=/^\.{0,2}\//,p={name:null,reference:null},h=[],E=new Set;if(t.enableTopLevelFallback===!0&&h.push(p),e.compatibilityMode!==!1)for(let Te of["react-scripts","gatsby"]){let Fe=t.packageRegistry.get(Te);if(Fe)for(let ke of Fe.keys()){if(ke===null)throw new Error("Assertion failed: This reference shouldn't be null");h.push({name:Te,reference:ke})}}let{ignorePattern:I,packageRegistry:v,packageLocatorsByLocations:x}=t;function C(Te,Fe){return{fn:Te,args:Fe,error:null,result:null}}function R(Te){let Fe=process.stderr?.hasColors?.()??process.stdout.isTTY,ke=(et,Ue)=>`\x1B[${et}m${Ue}\x1B[0m`,Ye=Te.error;console.error(Ye?ke("31;1",`\u2716 ${Te.error?.message.replace(/\n.*/s,"")}`):ke("33;1","\u203C Resolution")),Te.args.length>0&&console.error();for(let et of Te.args)console.error(` ${ke("37;1","In \u2190")} ${(0,zq.inspect)(et,{colors:Fe,compact:!0})}`);Te.result&&(console.error(),console.error(` ${ke("37;1","Out \u2192")} ${(0,zq.inspect)(Te.result,{colors:Fe,compact:!0})}`));let Se=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(Se.length>0){console.error();for(let et of Se)console.error(` ${ke("38;5;244",et)}`)}console.error()}function L(Te,Fe){if(e.allowDebug===!1)return Fe;if(Number.isFinite(o)){if(o>=2)return(...ke)=>{let Ye=C(Te,ke);try{return Ye.result=Fe(...ke)}catch(Se){throw Ye.error=Se}finally{R(Ye)}};if(o>=1)return(...ke)=>{try{return Fe(...ke)}catch(Ye){let Se=C(Te,ke);throw Se.error=Ye,R(Se),Ye}}}return Fe}function U(Te){let Fe=g(Te);if(!Fe)throw ts("INTERNAL","Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return Fe}function z(Te){if(Te.name===null)return!0;for(let Fe of t.dependencyTreeRoots)if(Fe.name===Te.name&&Fe.reference===Te.reference)return!0;return!1}let te=new Set(["node","require",...XIe("--conditions")]);function ae(Te,Fe=te,ke){let Ye=Ae(K.join(Te,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(Ye===null)throw ts("INTERNAL",`The locator that owns the "${Te}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:Se}=U(Ye),et=K.join(Se,dr.manifest);if(!e.fakeFs.existsSync(et))return null;let Ue=JSON.parse(e.fakeFs.readFileSync(et,"utf8"));if(Ue.exports==null)return null;let b=K.contains(Se,Te);if(b===null)throw ts("INTERNAL","unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)");b!=="."&&!A.test(b)&&(b=`./${b}`);try{let w=YIe({packageJSONUrl:(0,id.pathToFileURL)(ue.fromPortablePath(et)),packageSubpath:b,exports:Ue.exports,base:ke?(0,id.pathToFileURL)(ue.fromPortablePath(ke)):null,conditions:Fe});return ue.toPortablePath((0,id.fileURLToPath)(w))}catch(w){throw ts("EXPORTS_RESOLUTION_FAILED",w.message,{unqualifiedPath:cu(Te),locator:Ye,pkgJson:Ue,subpath:cu(b),conditions:Fe},w.code)}}function le(Te,Fe,{extensions:ke}){let Ye;try{Fe.push(Te),Ye=e.fakeFs.statSync(Te)}catch{}if(Ye&&!Ye.isDirectory())return e.fakeFs.realpathSync(Te);if(Ye&&Ye.isDirectory()){let Se;try{Se=JSON.parse(e.fakeFs.readFileSync(K.join(Te,dr.manifest),"utf8"))}catch{}let et;if(Se&&Se.main&&(et=K.resolve(Te,Se.main)),et&&et!==Te){let Ue=le(et,Fe,{extensions:ke});if(Ue!==null)return Ue}}for(let Se=0,et=ke.length;Se<et;Se++){let Ue=`${Te}${ke[Se]}`;if(Fe.push(Ue),e.fakeFs.existsSync(Ue))return Ue}if(Ye&&Ye.isDirectory())for(let Se=0,et=ke.length;Se<et;Se++){let Ue=K.format({dir:Te,name:"index",ext:ke[Se]});if(Fe.push(Ue),e.fakeFs.existsSync(Ue))return Ue}return null}function ce(Te){let Fe=new ep.Module(Te,null);return Fe.filename=Te,Fe.paths=ep.Module._nodeModulePaths(Te),Fe}function Ce(Te,Fe){return Fe.endsWith("/")&&(Fe=K.join(Fe,"internal.js")),ep.Module._resolveFilename(ue.fromPortablePath(Te),ce(ue.fromPortablePath(Fe)),!1,{plugnplay:!1})}function de(Te){if(I===null)return!1;let Fe=K.contains(t.basePath,Te);return Fe===null?!1:!!I.test(Fe.replace(/\/$/,""))}let Be={std:3,resolveVirtual:1,getAllLocators:1},Ee=p;function g({name:Te,reference:Fe}){let ke=v.get(Te);if(!ke)return null;let Ye=ke.get(Fe);return Ye||null}function me({name:Te,reference:Fe}){let ke=[];for(let[Ye,Se]of v)if(Ye!==null)for(let[et,Ue]of Se)et===null||Ue.packageDependencies.get(Te)!==Fe||Ye===Te&&et===Fe||ke.push({name:Ye,reLine truncated
|
||||
|
||||
Require request: "${Ye}"
|
||||
Required by: ${Se}
|
||||
`,{request:Ye,issuer:Se});return ue.toPortablePath(b)}let et,Ue=Te.match(a);if(Ue){if(!Fe)throw ts("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ye,issuer:Se});let[,b,w]=Ue,S=Ae(Fe);if(!S){let Re=Ce(Te,Fe);if(Re===!1)throw ts("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
|
||||
|
||||
Require path: "${Ye}"
|
||||
Required by: ${Se}
|
||||
`,{request:Ye,issuer:Se});return ue.toPortablePath(Re)}let F=U(S).packageDependencies.get(b),J=null;if(F==null&&S.name!==null){let Re=t.fallbackExclusionList.get(S.name);if(!Re||!Re.has(S.reference)){for(let dt=0,jt=h.length;dt<jt;++dt){let St=U(h[dt]).packageDependencies.get(b);if(St!=null){r?J=St:F=St;break}}if(t.enableTopLevelFallback&&F==null&&J===null){let dt=t.fallbackPool.get(b);dt!=null&&(J=dt)}}}let X=null;if(F===null)if(z(S))X=ts("MISSING_PEER_DEPENDENCY",`Your application tried to access ${b} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
|
||||
|
||||
Required package: ${b}${b!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${Se}
|
||||
`,{request:Ye,issuer:Se,dependencyName:b});else{let Re=we(b,S);Re.every(at=>z(at))?X=ts("MISSING_PEER_DEPENDENCY",`${S.name} tried to access ${b} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${b}${b!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${S.name}@${S.reference} (via ${Se})
|
||||
${Re.map(at=>`Ancestor breaking the chain: ${at.name}@${at.reference}
|
||||
`).join("")}
|
||||
`,{request:Ye,issuer:Se,issuerLocator:Object.assign({},S),dependencyName:b,brokenAncestors:Re}):X=ts("MISSING_PEER_DEPENDENCY",`${S.name} tried to access ${b} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${b}${b!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${S.name}@${S.reference} (via ${Se})
|
||||
|
||||
${Re.map(at=>`Ancestor breaking the chain: ${at.name}@${at.reference}
|
||||
`).join("")}
|
||||
`,{request:Ye,issuer:Se,issuerLocator:Object.assign({},S),dependencyName:b,brokenAncestors:Re})}else F===void 0&&(!ke&&(0,ep.isBuiltin)(Te)?z(S)?X=ts("UNDECLARED_DEPENDENCY",`Your application tried to access ${b}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${b} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${b}${b!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${Se}
|
||||
`,{request:Ye,issuer:Se,dependencyName:b}):X=ts("UNDECLARED_DEPENDENCY",`${S.name} tried to access ${b}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${b} isn't otherwise declared in ${S.name}'s dependencies, this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${b}${b!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${Se}
|
||||
`,{request:Ye,issuer:Se,issuerLocator:Object.assign({},S),dependencyName:b}):z(S)?X=ts("UNDECLARED_DEPENDENCY",`Your application tried to access ${b}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${b}${b!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${Se}
|
||||
`,{request:Ye,issuer:Se,dependencyName:b}):X=ts("UNDECLARED_DEPENDENCY",`${S.name} tried to access ${b}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
|
||||
|
||||
Required package: ${b}${b!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${S.name}@${S.reference} (via ${Se})
|
||||
`,{request:Ye,issuer:Se,issuerLocator:Object.assign({},S),dependencyName:b}));if(F==null){if(J===null||X===null)throw X||new Error("Assertion failed: Expected an error to have been set");F=J;let Re=X.message.replace(/\n.*/g,"");X.message=Re,!E.has(Re)&&o!==0&&(E.add(Re),process.emitWarning(X))}let $=Array.isArray(F)?{name:F[0],reference:F[1]}:{name:b,reference:F},ie=U($);if(!ie.packageLocation)throw ts("MISSING_DEPENDENCY",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
|
||||
|
||||
Required package: ${$.name}@${$.reference}${$.name!==Ye?` (via "${Ye}")`:""}
|
||||
Required by: ${S.name}@${S.reference} (via ${Se})
|
||||
`,{request:Ye,issuer:Se,dependencyLocator:Object.assign({},$)});let be=ie.packageLocation;w?et=K.join(be,w):et=be}else if(K.isAbsolute(Te))et=K.normalize(Te);else{if(!Fe)throw ts("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ye,issuer:Se});let b=K.resolve(Fe);Fe.match(u)?et=K.normalize(K.join(b,Te)):et=K.normalize(K.join(K.dirname(b),Te))}return K.normalize(et)}function xe(Te,Fe,ke=te,Ye){if(n.test(Te))return Fe;let Se=ae(Fe,ke,Ye);return Se?K.normalize(Se):Fe}function Ne(Te,{extensions:Fe=Object.keys(ep.Module._extensions)}={}){let ke=[],Ye=le(Te,ke,{extensions:Fe});if(Ye)return K.normalize(Ye);{$Ie(ke.map(Ue=>ue.fromPortablePath(Ue)));let Se=cu(Te),et=Ae(Te);if(et){let{packageLocation:Ue}=U(et),b=!0;try{e.fakeFs.accessSync(Ue)}catch(w){if(w?.code==="ENOENT")b=!1;else{let S=(w?.message??w??"empty exception thrown").replace(/^[A-Z]/,y=>y.toLowerCase());throw ts("QUALIFIED_PATH_RESOLUTION_FAILED",`Required package exists but could not be accessed (${S}).
|
||||
|
||||
Missing package: ${et.name}@${et.reference}
|
||||
Expected package location: ${cu(Ue)}
|
||||
`,{unqualifiedPath:Se,extensions:Fe})}}if(!b){let w=Ue.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw ts("QUALIFIED_PATH_RESOLUTION_FAILED",`${w}
|
||||
|
||||
Missing package: ${et.name}@${et.reference}
|
||||
Expected package location: ${cu(Ue)}
|
||||
`,{unqualifiedPath:Se,extensions:Fe})}}throw ts("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
|
||||
|
||||
Source path: ${Se}
|
||||
${ke.map(Ue=>`Not found: ${cu(Ue)}
|
||||
`).join("")}`,{unqualifiedPath:Se,extensions:Fe})}}function ht(Te,Fe,ke){if(!Fe)throw new Error("Assertion failed: An issuer is required to resolve private import mappings");let Ye=WIe({name:Te,base:(0,id.pathToFileURL)(ue.fromPortablePath(Fe)),conditions:ke.conditions??te,readFileSyncFn:ne});if(Ye instanceof URL)return Ne(ue.toPortablePath((0,id.fileURLToPath)(Ye)),{extensions:ke.extensions});if(Ye.startsWith("#"))throw new Error("Mapping from one private import to another isn't allowed");return H(Ye,Fe,ke)}function H(Te,Fe,ke={}){try{if(Te.startsWith("#"))return ht(Te,Fe,ke);let{considerBuiltins:Ye,extensions:Se,conditions:et}=ke,Ue=Z(Te,Fe,{considerBuiltins:Ye});if(Te==="pnpapi")return Ue;if(Ue===null)return null;let b=()=>Fe!==null?de(Fe):!1,w=(!Ye||!(0,ep.isBuiltin)(Te))&&!b()?xe(Te,Ue,et,Fe):Ue;return Ne(w,{extensions:Se})}catch(Ye){throw Object.hasOwn(Ye,"pnpCode")&&Object.assign(Ye.data,{request:cu(Te),issuer:Fe&&cu(Fe)}),Ye}}function rt(Te){let Fe=K.normalize(Te),ke=zs.resolveVirtual(Fe);return ke!==Fe?ke:null}return{VERSIONS:Be,topLevel:Ee,getLocator:(Te,Fe)=>Array.isArray(Fe)?{name:Fe[0],reference:Fe[1]}:{name:Te,reference:Fe},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let Te=[];for(let[Fe,ke]of v)for(let Ye of ke.keys())Fe!==null&&Ye!==null&&Te.push({name:Fe,reference:Ye});return Te},getPackageInformation:Te=>{let Fe=g(Te);if(Fe===null)return null;let ke=ue.fromPortablePath(Fe.packageLocation);return{...Fe,packageLocation:ke}},findPackageLocator:Te=>Ae(ue.toPortablePath(Te)),resolveToUnqualified:L("resolveToUnqualified",(Te,Fe,ke)=>{let Ye=Fe!==null?ue.toPortablePath(Fe):null,Se=Z(ue.toPortablePath(Te),Ye,ke);return Se===null?null:ue.fromPortablePath(Se)}),resolveUnqualified:L("resolveUnqualified",(Te,Fe)=>ue.fromPortablePath(Ne(ue.toPortablePath(Te),Fe))),resolveRequest:L("resolveRequest",(Te,Fe,ke)=>{let Ye=Fe!==null?ue.toPortablePath(Fe):null,Se=H(ue.toPortablePath(Te),Ye,ke);return Se===null?null:ue.fromPortablePath(Se)}),resolveVirtual:L("resolveVirtual",Te=>{let Fe=rt(ue.toPortablePath(Te));return Fe!==null?ue.fromPortablePath(Fe):null})}}Pt();var e1e=(t,e,r)=>{let o=TB(t),a=Uq(o,{basePath:e}),n=ue.join(e,dr.pnpCjs);return Jq(a,{fakeFs:r,pnpapiResolution:n})};var Zq=Ze(r1e());qt();var mA={};Vt(mA,{checkManifestCompatibility:()=>n1e,extractBuildRequest:()=>AQ,getExtractHint:()=>$q,hasBindingGyp:()=>ej});Ge();Pt();function n1e(t){return G.isPackageCompatible(t,Xi.getArchitectureSet())}function AQ(t,e,r,{configuration:o}){let a=[];for(let n of["preinstall","install","postinstall"])e.manifest.scripts.has(n)&&a.push({type:0,script:n});return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&a.push({type:1,script:"node-gyp rebuild"}),a.length===0?null:t.linkType!=="HARD"?{skipped:!0,explain:n=>n.reportWarningOnce(6,`${G.prettyLocator(o,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`)}:r&&r.built===!1?{skipped:!0,explain:n=>n.reportInfoOnce(5,`${G.prettyLocator(o,t)} lists build scripts, but its build has been explicitly disabled through configuration.`)}:!o.get("enableScripts")&&!r.built?{skipped:!0,explain:n=>n.reportWarningOnce(4,`${G.prettyLocator(o,t)} lists build scripts, but all build scripts have been disabled.`)}:n1e(t)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${G.prettyLocator(o,t)} The ${Xi.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var VIt=new Set([".exe",".bin",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function $q(t){return t.packageFs.getExtractHint({relevantExtensions:VIt})}function ej(t){let e=K.join(t.prefixPath,"binding.gyp");return t.packageFs.existsSync(e)}var jB={};Vt(jB,{getUnpluggedPath:()=>qB});Ge();Pt();function qB(t,{configuration:e}){return K.resolve(e.get("pnpUnpluggedFolder"),G.slugifyLocator(t))}var zIt=new Set([G.makeIdent(null,"open").identHash,G.makeIdent(null,"opn").identHash]),Hh=class{constructor(){this.mode="strict";this.pnpCache=new Map}getCustomDataKey(){return JSON.stringify({name:"PnpLinker",version:2})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let o=qh(r.project).cjs;if(!oe.existsSync(o))throw new st(`The project in ${pe.pretty(r.project.configuration,`${r.project.cwd}/package.json`,pe.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let a=He.getFactoryWithDefault(this.pnpCache,o,()=>He.dynamicRequire(o,{cachingStrategy:He.CachingStrategy.FsTime})),n={name:G.stringifyIdent(e),reference:e.reference},u=a.getPackageInformation(n);if(!u)throw new st(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed PnP map - running an install might help`);return ue.toPortablePath(u.packageLocation)}async findPackageLocator(e,r){if(!this.isEnabled(r))return nullLine truncated
|
||||
`,n+=`# cause your node_modules installation to become invalidated.
|
||||
`,n+=`
|
||||
`,n+=`__metadata:
|
||||
`,n+=` version: ${d1e}
|
||||
`,n+=` nmMode: ${o.value}
|
||||
`;let u=Array.from(e.keys()).sort(),A=G.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let E of u){let I=e.get(E);n+=`
|
||||
`,n+=`${JSON.stringify(E)}:
|
||||
`,n+=` locations:
|
||||
`;for(let v of I.locations){let x=K.contains(t.cwd,v);if(x===null)throw new Error(`Assertion failed: Expected the path to be within the project (${v})`);n+=` - ${JSON.stringify(x)}
|
||||
`}if(I.aliases.length>0){n+=` aliases:
|
||||
`;for(let v of I.aliases)n+=` - ${JSON.stringify(v)}
|
||||
`}if(E===A&&r.size>0){n+=` bin:
|
||||
`;for(let[v,x]of r){let C=K.contains(t.cwd,v);if(C===null)throw new Error(`Assertion failed: Expected the path to be within the project (${v})`);n+=` ${JSON.stringify(C)}:
|
||||
`;for(let[R,L]of x){let U=K.relative(K.join(v,Di),L);n+=` ${JSON.stringify(R)}: ${JSON.stringify(U)}
|
||||
`}}}}let p=t.cwd,h=K.join(p,Di,m1e);a&&await oe.removePromise(h),await oe.changeFilePromise(h,n,{automaticNewlines:!0})}async function lj(t,{unrollAliases:e=!1}={}){let r=t.cwd,o=K.join(r,Di,m1e),a;try{a=await oe.statPromise(o)}catch{}if(!a)return null;let n=Ki(await oe.readFilePromise(o,"utf8"));if(n.__metadata.version>d1e)return null;let u=n.__metadata.nmMode||"classic",A=new Map,p=new Map;delete n.__metadata;for(let[h,E]of Object.entries(n)){let I=E.locations.map(x=>K.join(r,x)),v=E.bin;if(v)for(let[x,C]of Object.entries(v)){let R=K.join(r,ue.toPortablePath(x)),L=He.getMapWithDefault(p,R);for(let[U,z]of Object.entries(C))L.set(U,ue.toPortablePath([R,Di,z].join(K.sep)))}if(A.set(h,{target:It.dot,linkType:"HARD",locations:I,aliases:E.aliases||[]}),e&&E.aliases)for(let x of E.aliases){let{scope:C,name:R}=G.parseLocator(h),L=G.makeLocator(G.makeIdent(C,R),x),U=G.stringifyLocator(L);A.set(U,{target:It.dot,linkType:"HARD",locations:I,aliases:[]})}}return{locatorMap:A,binSymlinks:p,locationTree:y1e(A,{skipPrefix:t.cwd}),nmMode:u,mtimeMs:a.mtimeMs}}var AC=async(t,e)=>{if(t.split(K.sep).indexOf(Di)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{if(!e.innerLoop){let o=e.allowSymlink?await oe.statPromise(t):await oe.lstatPromise(t);if(e.allowSymlink&&!o.isDirectory()||!e.allowSymlink&&o.isSymbolicLink()){await oe.unlinkPromise(t);return}}let r=await oe.readdirPromise(t,{withFileTypes:!0});for(let o of r){let a=K.join(t,o.name);o.isDirectory()?(o.name!==Di||e&&e.innerLoop)&&await AC(a,{innerLoop:!0,contentsOnly:!1}):await oe.unlinkPromise(a)}e.contentsOnly||await oe.rmdirPromise(t)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},f1e=4,pQ=(t,{skipPrefix:e})=>{let r=K.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let o=r.split(K.sep).filter(p=>p!==""),a=o.indexOf(Di),n=o.slice(0,a).join(K.sep),u=K.join(e,n),A=o.slice(a);return{locationRoot:u,segments:A}},y1e=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let o=()=>({children:new Map,linkType:"HARD"});for(let[a,n]of t.entries()){if(n.linkType==="SOFT"&&K.contains(e,n.target)!==null){let A=He.getFactoryWithDefault(r,n.target,o);A.locator=a,A.linkType=n.linkType}for(let u of n.locations){let{locationRoot:A,segments:p}=pQ(u,{skipPrefix:e}),h=He.getFactoryWithDefault(r,A,o);for(let E=0;E<p.length;++E){let I=p[E];if(I!=="."){let v=He.getFactoryWithDefault(h.children,I,o);h.children.set(I,v),h=v}E===p.length-1&&(h.locator=a,h.linkType=n.linkType)}}}return r},Aj=async(t,e,r)=>{if(process.platform==="win32"&&r==="junctions"){let o;try{o=await oe.lstatPromise(t)}catch{}if(!o||o.isDirectory()){await oe.symlinkPromise(t,e,"junction");return}}await oe.symlinkPromise(K.relative(K.dirname(e),t),e)};async function E1e(t,e,r){let o=K.join(t,`${cj.default.randomBytes(16).toString("hex")}.tmp`);try{await oe.writeFilePromise(o,r);try{await oe.linkPromise(o,e)}catch{}}finally{await oe.unlinkPromise(o)}}async function C1t({srcPath:t,dstPath:e,entry:r,globalHardlinksStore:o,baseFs:a,nmMode:n}){if(r.kind==="file"){if(n.value==="hardlinks-global"&&o&&r.digest){let A=K.join(o,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await oe.statPromise(A);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs<r.mtimeMs-m1t))if(await wn.checksumFile(A,{baseFs:oe,algorithm:"sha1"})!==r.digest){let I=K.join(o,`${cj.default.randomBytes(16).toString("hex")}.tmp`);await oe.renamePromise(A,I);let v=await a.readFilePromise(t);await oe.writeFilePromise(I,v);try{await oe.linkPromise(I,A),r.mtimeMs=new Date().getTime(),await oe.unlinkPromise(I)}catch{}}else r.mtimeMs||(r.mtimeMs=Math.ceil(h.mtimeMs));await oe.linkPromise(A,e),p=!0}catch{p=!1}if(!p){let h=await a.readFilePromise(t);await E1e(o,A,h),r.mtimeMs=new Date().getTime();try{await oe.linkPromise(A,e)}catch(E){E&&E.code&&E.code=="EXDEV"&&(n.value="hardlinks-local",await a.copyFilePromise(t,e))}}}else await a.copyFilePromise(t,e);let u=r.mode&511;u!==420&&await oe.chmodPromise(e,u)}}var w1t=async(t,e,{baseFs:r,globalHardlinksStore:o,nmMode:a,windowsLinkType:n,packageChecksum:u})=>{await oe.mkdirPromise(t,{recursive:!0});let A=async(E=It.dot)=>{let I=K.join(e,E),v=await r.readdirPromise(I,{withFileTypes:!0}),x=new Map;for(let C of v){let R=K.join(E,C.name),L,U=K.join(I,C.name);if(C.isFile()){if(L={kind:"file",mode:(await r.lstatPromise(U)).mode},a.value==="hardlinks-global"){let z=await wn.checksumFile(U,{baseFs:r,algorithm:"sha1"});L.digest=z}}else if(C.isDirectory())L={kind:"directory"};else if(C.isSymbolicLink())L={kind:"symlink",symlinkTo:await r.readlinkPromise(U)};else throw new Error(`Unsupported file type (file: ${U}, mode: 0o${await r.statSync(U).mode.toString(8).padStart(6,"0")})`);if(x.set(R,L),C.isDirectory()&&R!==Di){let z=await A(R);for(let[te,ae]of z)x.set(te,ae)}}return x},p;if(a.value==="hardlinks-global"&&o&&u){let E=K.join(o,u.substring(0,2),`${u.substring(2)}.Line truncated
|
||||
`)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||"";let{otp:o}=await(0,mj.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`
|
||||
`),o}function dQ(t){if(t.originalError?.name!=="HTTPError")return!1;try{return(t.originalError?.response.headers["www-authenticate"].split(/,\s*/).map(r=>r.toLowerCase())).includes("otp")}catch{return!1}}function pC(t){return{"npm-otp":t}}var VB=class{supports(e,r){if(!e.reference.startsWith(Wn))return!1;let{selector:o,params:a}=G.parseRange(e.reference);return!(!b1e.default.valid(o)||a===null||typeof a.__archiveUrl!="string")}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:u}}async fetchFromNetwork(e,r){let{params:o}=G.parseRange(e.reference);if(o===null||typeof o.__archiveUrl!="string")throw new Error("Assertion failed: The archiveUrl querystring parameter should have been available");let a=await ad(o.__archiveUrl,{customErrorMessage:od,configuration:r.project.configuration,ident:e});return await $i.convertToZip(a,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ge();var zB=class{supportsDescriptor(e,r){return!(!e.range.startsWith(Wn)||!G.tryParseDescriptor(e.range.slice(Wn.length),!0))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Unreachable")}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){let o=r.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(Wn.length),!0));return r.resolver.getResolutionDependencies(o,r)}async getCandidates(e,r,o){let a=o.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(Wn.length),!0));return await o.resolver.getCandidates(a,r,o)}async getSatisfying(e,r,o,a){let n=a.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(Wn.length),!0));return a.resolver.getSatisfying(n,r,o,a)}resolve(e,r){throw new Error("Unreachable")}};Ge();Ge();var x1e=Ze(Jn());var tp=class t{supports(e,r){if(!e.reference.startsWith(Wn))return!1;let o=new URL(e.reference);return!(!x1e.default.valid(o.pathname)||o.searchParams.has("__archiveUrl"))}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:u}}async fetchFromNetwork(e,r){let o;try{o=await ad(t.getLocatorUrl(e),{customErrorMessage:od,configuration:r.project.configuration,ident:e})}catch{o=await ad(t.getLocatorUrl(e).replace(/%2f/g,"/"),{customErrorMessage:od,configuration:r.project.configuration,ident:e})}return await $i.convertToZip(o,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}static isConventionalTarballUrl(e,r,{configuration:o}){let a=fC(e.scope,{configuration:o}),n=t.getLocatorUrl(e);return r=r.replace(/^https?:(\/\/(?:[^/]+\.)?npmjs.org(?:$|\/))/,"https:$1"),a=a.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r=r.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r===a+n||r===a+n.replace(/%2f/g,"/")}static getLocatorUrl(e){let r=Lr.clean(e.reference.slice(Wn.length));if(r===null)throw new Jt(10,"The npm semver resolver got selected, but the version isn't semver");return`${hQ(e)}/-/${e.name}-${r}.tgz`}};Ge();Ge();Ge();var Ej=Ze(Jn());var mQ=G.makeIdent(null,"node-gyp"),q1t=/\b(node-gyp|prebuild-install)\b/,JB=class{supportsDescriptor(e,r){return e.range.startsWith(Wn)?!!Lr.validRange(e.range.slice(Wn.length)):!1}supportsLocator(e,r){if(!e.reference.startsWith(Wn))return!1;let{selector:o}=G.parseRange(e.reference);return!!Ej.default.valid(o)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=Lr.validRange(e.range.slice(Wn.length));if(a===null)throw new Error(`Expected a valid range, got ${e.range.slice(Wn.length)}`);let n=await hC(e,{cache:o.fetchOptions?.cache,project:o.project,version:Ej.default.valid(a.raw)?a.raw:void 0}),u=He.mapAndFilter(Object.keys(n.versions),h=>{try{let E=new Lr.SemVer(h);if(a.test(E))return E}catch{}return He.mapAndFilter.skip}),A=u.filter(h=>!n.versions[h.raw].deprecated),p=A.length>0?A:u;return p.sort((h,E)=>-h.compare(E)),p.map(h=>{let E=G.makeLocator(e,`${Wn}${h.raw}`),I=n.versions[h.raw].dist.tarball;return tp.isConventionalTarballUrl(E,I,{configuration:o.project.configuration})?E:G.bindLocator(E,{__archiveUrl:I})})}async getSatisfying(e,r,oLine truncated
|
||||
`;try{a=await oe.readFilePromise(e,"utf8")}catch(n){if(n.code==="ENOENT")return a;throw n}return a}var A5={npmAlwaysAuth:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"BOOLEAN",default:!1},npmAuthIdent:{description:"Authentication identity for the npm registry (_auth in npm and yarn v1)",type:"SECRET",default:null},npmAuthToken:{description:"Authentication token for the npm registry (_authToken in npm and yarn v1)",type:"SECRET",default:null}},wBe={npmAuditRegistry:{description:"Registry to query for audit reports",type:"STRING",default:null},npmPublishRegistry:{description:"Registry to push packages to",type:"STRING",default:null},npmRegistryServer:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"STRING",default:"https://registry.yarnpkg.com"}},Hvt={configuration:{...A5,...wBe,npmScopes:{description:"Settings per package scope",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{...A5,...wBe}}},npmRegistries:{description:"Settings per registry",type:"MAP",normalizeKeys:ac,valueDefinition:{description:"",type:"SHAPE",properties:{...A5}}}},fetchers:[VB,tp],resolvers:[zB,JB,XB]},qvt=Hvt;var w5={};Vt(w5,{NpmAuditCommand:()=>bC,NpmInfoCommand:()=>xC,NpmLoginCommand:()=>kC,NpmLogoutCommand:()=>FC,NpmPublishCommand:()=>RC,NpmTagAddCommand:()=>NC,NpmTagListCommand:()=>TC,NpmTagRemoveCommand:()=>LC,NpmWhoamiCommand:()=>MC,default:()=>zvt,npmAuditTypes:()=>dv,npmAuditUtils:()=>HQ});Ge();Ge();qt();var m5=Ze($o());el();var dv={};Vt(dv,{Environment:()=>hv,Severity:()=>gv});var hv=(o=>(o.All="all",o.Production="production",o.Development="development",o))(hv||{}),gv=(n=>(n.Info="info",n.Low="low",n.Moderate="moderate",n.High="high",n.Critical="critical",n))(gv||{});var HQ={};Vt(HQ,{allSeverities:()=>SC,getPackages:()=>d5,getReportTree:()=>h5,getSeverityInclusions:()=>p5,getTopLevelDependencies:()=>g5});Ge();var IBe=Ze(Jn());var SC=["info","low","moderate","high","critical"];function p5(t){if(typeof t>"u")return new Set(SC);let e=SC.indexOf(t),r=SC.slice(e);return new Set(r)}function h5(t){let e={},r={children:e};for(let[o,a]of He.sortMap(Object.entries(t),n=>n[0]))for(let n of He.sortMap(a,u=>`${u.id}`))e[`${o}/${n.id}`]={value:pe.tuple(pe.Type.IDENT,G.parseIdent(o)),children:{ID:typeof n.id<"u"&&{label:"ID",value:pe.tuple(pe.Type.ID,n.id)},Issue:{label:"Issue",value:pe.tuple(pe.Type.NO_HINT,n.title)},URL:typeof n.url<"u"&&{label:"URL",value:pe.tuple(pe.Type.URL,n.url)},Severity:{label:"Severity",value:pe.tuple(pe.Type.NO_HINT,n.severity)},"Vulnerable Versions":{label:"Vulnerable Versions",value:pe.tuple(pe.Type.RANGE,n.vulnerable_versions)},"Tree Versions":{label:"Tree Versions",children:[...n.versions].sort(IBe.default.compare).map(u=>({value:pe.tuple(pe.Type.REFERENCE,u)}))},Dependents:{label:"Dependents",children:He.sortMap(n.dependents,u=>G.stringifyLocator(u)).map(u=>({value:pe.tuple(pe.Type.LOCATOR,u)}))}}};return r}function g5(t,e,{all:r,environment:o}){let a=[],n=r?t.workspaces:[e],u=["all","production"].includes(o),A=["all","development"].includes(o);for(let p of n)for(let h of p.anchoredPackage.dependencies.values())(p.manifest.devDependencies.has(h.identHash)?!A:!u)||a.push({workspace:p,dependency:h});return a}function d5(t,e,{recursive:r}){let o=new Map,a=new Set,n=[],u=(A,p)=>{let h=t.storedResolutions.get(p.descriptorHash);if(typeof h>"u")throw new Error("Assertion failed: The resolution should have been registered");if(!a.has(h))a.add(h);else return;let E=t.storedPackages.get(h);if(typeof E>"u")throw new Error("Assertion failed: The package should have been registered");if(G.ensureDevirtualizedLocator(E).reference.startsWith("npm:")&&E.version!==null){let v=G.stringifyIdent(E),x=He.getMapWithDefault(o,v);He.getArrayWithDefault(x,E.version).push(A)}if(r)for(let v of E.dependencies.values())n.push([E,v])};for(let{workspace:A,dependency:p}of e)n.push([A.anchoredLocator,p]);for(;n.length>0;){let[A,p]=n.shift();u(A,p)}return o}var bC=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("-A,--all",!1,{description:"Audit dependencies from all workspaces"});this.recursive=ge.Boolean("-R,--recursive",!1,{description:"Audit transitive dependencies as well"});this.environment=ge.String("--environment","all",{description:"Which environments to cover",validator:Js(hv)});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.noDeprecations=ge.Boolean("--no-deprecations",!1,{description:"Don't warn about deprecated packages"});this.severity=ge.String("--severity","info",{description:"Minimal severity requested for packages to be displayed",validator:Js(gv)});this.excludes=ge.Array("--exclude",[],{description:"Array of glob patterns of packages to exclude from audit"});this.ignores=ge.Array("--ignore",[],{description:"Array of glob patterns of advisory ID's to ignore in the audit report"})}static{this.paths=[["npm","audit"]]}static{this.usage=it.Usage({descript
Line truncated
|
||||
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
|
||||
|
||||
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
|
||||
|
||||
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${SC.map(r=>`\`${r}\``).join(", ")}.
|
||||
|
||||
If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
|
||||
|
||||
If certain packages produce false positives for a particular environment, the \`--exclude\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \`npmAuditExcludePackages\` option.
|
||||
|
||||
If particular advisories are needed to be ignored, the \`--ignore\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \`npmAuditIgnoreAdvisories\` option.
|
||||
|
||||
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why package\` to get more information as to who depends on them.
|
||||
`,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd);if(!a)throw new sr(o.cwd,this.context.cwd);await o.restoreInstallState();let n=g5(o,a,{all:this.all,environment:this.environment}),u=d5(o,n,{recursive:this.recursive}),A=Array.from(new Set([...r.get("npmAuditExcludePackages"),...this.excludes])),p=Object.create(null);for(let[L,U]of u)A.some(z=>m5.default.isMatch(L,z))||(p[L]=[...U.keys()]);let h=Zn.getAuditRegistry({configuration:r}),E,I=await AA.start({configuration:r,stdout:this.context.stdout},async()=>{let L=Zr.post("/-/npm/v1/security/advisories/bulk",p,{authType:Zr.AuthType.BEST_EFFORT,configuration:r,jsonResponse:!0,registry:h}),U=this.noDeprecations?[]:await Promise.all(Array.from(Object.entries(p),async([te,ae])=>{let le=await Zr.getPackageMetadata(G.parseIdent(te),{project:o});return He.mapAndFilter(ae,ce=>{let{deprecated:Ce}=le.versions[ce];return Ce?[te,ce,Ce]:He.mapAndFilter.skip})})),z=await L;for(let[te,ae,le]of U.flat(1))Object.hasOwn(z,te)&&z[te].some(ce=>Lr.satisfiesWithPrereleases(ae,ce.vulnerable_versions))||(z[te]??=[],z[te].push({id:`${te} (deprecation)`,title:le.trim()||"This package has been deprecated.",severity:"moderate",vulnerable_versions:ae}));E=z});if(I.hasErrors())return I.exitCode();let v=p5(this.severity),x=Array.from(new Set([...r.get("npmAuditIgnoreAdvisories"),...this.ignores])),C=Object.create(null);for(let[L,U]of Object.entries(E)){let z=U.filter(te=>!m5.default.isMatch(`${te.id}`,x)&&v.has(te.severity));z.length>0&&(C[L]=z.map(te=>{let ae=u.get(L);if(typeof ae>"u")throw new Error("Assertion failed: Expected the registry to only return packages that were requested");let le=[...ae.keys()].filter(Ce=>Lr.satisfiesWithPrereleases(Ce,te.vulnerable_versions)),ce=new Map;for(let Ce of le)for(let de of ae.get(Ce))ce.set(de.locatorHash,de);return{...te,versions:le,dependents:[...ce.values()]}}))}let R=Object.keys(C).length>0;return R?(fs.emitTree(h5(C),{configuration:r,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Rt.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async L=>{L.reportInfo(1,"No audit suggestions")}),R?1:0)}};Ge();Ge();Pt();qt();var y5=Ze(Jn()),E5=ve("util"),xC=class extends ut{constructor(){super(...arguments);this.fields=ge.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=ge.Rest()}static{this.paths=[["npm","info"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Sh
Line truncated
|
||||
`),this.context.stdout.write(`${(0,E5.inspect)(p,{depth:1/0,colors:!0,compact:!1})}
|
||||
`);return A.exitCode()}};function C5(t){if(Array.isArray(t)){let e=[];for(let r of t)r=C5(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let o=C5(t[r]);o&&(e[r]=o)}return e}else return t||null}Ge();Ge();qt();var BBe=Ze(J1()),kC=class extends ut{constructor(){super(...arguments);this.scope=ge.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=ge.Boolean("--publish",!1,{description:"Login to the publish registry"});this.alwaysAuth=ge.Boolean("--always-auth",{description:"Set the npmAlwaysAuth configuration"})}static{this.paths=[["npm","login"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o=await qQ({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Rt.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let u=await Yvt({configuration:r,registry:o,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),A=await jvt(o,u,r);return await Gvt(o,A,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,"Successfully logged in")})).exitCode()}};async function qQ({scope:t,publish:e,configuration:r,cwd:o}){return t&&e?Zn.getScopeRegistry(t,{configuration:r,type:Zn.RegistryType.PUBLISH_REGISTRY}):t?Zn.getScopeRegistry(t,{configuration:r}):e?Zn.getPublishRegistry((await _y(r,o)).manifest,{configuration:r}):Zn.getDefaultRegistry({configuration:r})}async function jvt(t,e,r){let o=`/-/user/org.couchdb.user:${encodeURIComponent(e.name)}`,a={_id:`org.couchdb.user:${e.name}`,name:e.name,password:e.password,type:"user",roles:[],date:new Date().toISOString()},n={attemptedAs:e.name,configuration:r,registry:t,jsonResponse:!0,authType:Zr.AuthType.NO_AUTH};try{return(await Zr.put(o,a,n)).token}catch(E){if(!(E.originalError?.name==="HTTPError"&&E.originalError?.response.statusCode===409))throw E}let u={...n,authType:Zr.AuthType.NO_AUTH,headers:{authorization:`Basic ${Buffer.from(`${e.name}:${e.password}`).toString("base64")}`}},A=await Zr.get(o,u);for(let[E,I]of Object.entries(A))(!a[E]||E==="roles")&&(a[E]=I);let p=`${o}/-rev/${a._rev}`;return(await Zr.put(p,a,u)).token}async function Gvt(t,e,{alwaysAuth:r,scope:o}){let a=u=>A=>{let p=He.isIndexableObject(A)?A:{},h=p[u],E=He.isIndexableObject(h)?h:{};return{...p,[u]:{...E,...r!==void 0?{npmAlwaysAuth:r}:{},npmAuthToken:e}}},n=o?{npmScopes:a(o)}:{npmRegistries:a(t)};return await Ke.updateHomeConfiguration(n)}async function Yvt({configuration:t,registry:e,report:r,stdin:o,stdout:a}){r.reportInfo(0,`Logging in to ${pe.pretty(t,e,pe.Type.URL)}`);let n=!1;if(e.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(r.reportInfo(0,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),n=!0),r.reportSeparator(),t.env.YARN_IS_TEST_ENV)return{name:t.env.YARN_INJECT_NPM_USER||"",password:t.env.YARN_INJECT_NPM_PASSWORD||""};let u=await(0,BBe.prompt)([{type:"input",name:"name",message:"Username:",required:!0,onCancel:()=>process.exit(130),stdin:o,stdout:a},{type:"password",name:"password",message:n?"Token:":"Password:",required:!0,onCancel:()=>process.exit(130),stdin:o,stdout:a}]);return r.reportSeparator(),u}Ge();Ge();qt();var QC=new Set(["npmAuthIdent","npmAuthToken"]),FC=class extends ut{constructor(){super(...arguments);this.scope=ge.String("-s,--scope",{description:"Logout of the registry configured for a given scope"});this.publish=ge.Boolean("--publish",!1,{description:"Logout of the publish registry"});this.all=ge.Boolean("-A,--all",!1,{description:"Logout of all registries"})}static{this.paths=[["npm","logout"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"logout of the npm registry",details:"\n This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\Line truncated
|
||||
This command will list all tags of a package from the npm registry.
|
||||
|
||||
If the package is not specified, Yarn will default to the current workspace.
|
||||
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd),n;if(typeof this.package<"u")n=G.parseIdent(this.package);else{if(!a)throw new sr(o.cwd,this.context.cwd);if(!a.manifest.name)throw new st(`Missing 'name' field in ${ue.fromPortablePath(K.join(a.cwd,dr.manifest))}`);n=a.manifest.name}let u=await mv(n,r),p={children:He.sortMap(Object.entries(u),([h])=>h).map(([h,E])=>({value:pe.tuple(pe.Type.RESOLUTION,{descriptor:G.makeDescriptor(n,h),locator:G.makeLocator(n,E)})}))};return fs.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function mv(t,e){let r=`/-/package${Zr.getIdentUrl(t)}/dist-tags`;return Zr.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:Zr.customPackageError})}var NC=class extends ut{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[["npm","tag","add"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
|
||||
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
|
||||
`,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd);if(!a)throw new sr(o.cwd,this.context.cwd);let n=G.parseDescriptor(this.package,!0),u=n.range;if(!DBe.default.valid(u))throw new st(`The range ${pe.pretty(r,n.range,pe.Type.RANGE)} must be a valid semver version`);let A=Zn.getPublishRegistry(a.manifest,{configuration:r}),p=pe.pretty(r,n,pe.Type.IDENT),h=pe.pretty(r,u,pe.Type.RANGE),E=pe.pretty(r,this.tag,pe.Type.CODE);return(await Rt.start({configuration:r,stdout:this.context.stdout},async v=>{let x=await mv(n,r);Object.hasOwn(x,this.tag)&&x[this.tag]===u&&v.reportWarning(0,`Tag ${E} is already set to version ${h}`);let C=`/-/package${Zr.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Zr.put(C,u,{configuration:r,registry:A,ident:n,jsonRequest:!0,jsonResponse:!0}),v.reportInfo(0,`Tag ${E} added to version ${h} of package ${p}`)})).exitCode()}};Ge();qt();var LC=class extends ut{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[["npm","tag","remove"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
|
||||
This command will remove a tag from a package from the npm registry.
|
||||
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]})}async execute(){if(this.tag==="latest")throw new st("The 'latest' tag cannot be removed.");let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd);if(!a)throw new sr(o.cwd,this.context.cwd);let n=G.parseIdent(this.package),u=Zn.getPublishRegistry(a.manifest,{configuration:r}),A=pe.pretty(r,this.tag,pe.Type.CODE),p=pe.pretty(r,n,pe.Type.IDENT),h=await mv(n,r);if(!Object.hasOwn(h,this.tag))throw new st(`${A} is not a tag of package ${p}`);return(await Rt.start({configuration:r,stdout:this.context.stdout},async I=>{let v=`/-/package${Zr.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Zr.del(v,{configuration:r,registry:u,ident:n,jsonResponse:!0}),I.reportInfo(0,`Tag ${A} removed from package ${p}`)})).exitCode()}};Ge();Ge();qt();var MC=class extends ut{constructor(){super(...arguments);this.scope=ge.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=ge.Boolean("--publish",!1,{description:"Print username for the publish registry"})}static{this.paths=[["npm","whoami"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),o;return this.scope&&this.publish?o=Zn.getScopeRegistry(this.scope,{configuration:r,type:Zn.RegistryType.PUBLISH_REGISTRY}):this.scope?o=Zn.getScopeRegistry(this.scope,{configuration:r}):this.publish?o=Zn.getPublishRegistry((await _y(r,this.context.cwd)).manifest,{configuration:r}):o=Zn.getDefaultRegistry({configuration:r}),(await Rt.start({configuration:r,stdout:this.context.stdout},async n=>{let u;try{u=await Zr.get("/-/whoami",{configuration:r,registry:o,authType:Zr.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?G.makeIdent(this.scope,""):void 0})}catch(A){if(A.response?.statusCode===401||A.response?.statusCode===403){n.reportError(41,"Authentication failed - your credentials may have expired");return}else throw A}n.reportInfo(0,u.username)})).exitCode()}};var Vvt={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[bC,xC,kC,FC,RC,NC,TC,LC,MC]},zvt=Vvt;var b5={};Vt(b5,{PatchCommand:()=>jC,PatchCommitCommand:()=>qC,PatchFetcher:()=>Iv,PatchResolver:()=>Bv,default:()=>pDt,patchUtils:()=>pd});Ge();Ge();Pt();nA();var pd={};Vt(pd,{applyPatchFile:()=>GQ,diffFolders:()=>P5,ensureUnpatchedDescriptor:()=>I5,ensureUnpatchedLocator:()=>WQ,extractPackageToDisk:()=>D5,extractPatchFlags:()=>FBe,isParentRequired:()=>v5,isPatchDescriptor:()=>YQ,isPatchLocator:()=>$h,loadPatchFiles:()=>wv,makeDescriptor:()=>KQ,makeLocator:()=>B5,makePatchHash:()=>S5,parseDescriptor:()=>Ev,parseLocator:()=>Cv,parsePatchFile:()=>yv,unpatchDescriptor:()=>uDt,unpatchLocator:()=>ADt});Ge();Pt();Ge();Pt();var Jvt=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function OC(t){return K.relative(It.root,K.resolve(It.root,ue.toPortablePath(t)))}function Xvt(t){let e=t.trim().match(Jvt);if(!e)throw new Error(`Bad header line: '${t}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var Zvt=420,$vt=493;var PBe=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),eDt=t=>({header:Xvt(t),parts:[]}),tDt={"@":"header","-":"deletion","+":"insertion"," ":"context","\\":"pragma",undefined:"context"};function rDt(t){let e=[],r=PBe(),o="parsing header",a=null,n=null;function u(){a&&(n&&(a.parts.push(n),n=null),r.hunks.push(a),a=null)}function A(){Line truncated
|
||||
`)+(a.hunk.parts[0].noNewlineAtEndOfFile?"":`
|
||||
`):"";await e.mkdirpPromise(K.dirname(a.path),{chmod:493,utimes:[Bi.SAFE_TIME,Bi.SAFE_TIME]}),await e.writeFilePromise(a.path,n,{mode:a.mode}),await e.utimesPromise(a.path,Bi.SAFE_TIME,Bi.SAFE_TIME)}break;case"patch":await _C(e,a.path,async()=>{await aDt(a,{baseFs:e,dryRun:r})});break;case"mode change":{let u=(await e.statPromise(a.path)).mode;if(SBe(a.newMode)!==SBe(u))continue;await _C(e,a.path,async()=>{await e.chmodPromise(a.path,a.newMode)})}break;default:He.assertNever(a);break}}function SBe(t){return(t&64)>0}function bBe(t){return t.replace(/\s+$/,"")}function oDt(t,e){return bBe(t)===bBe(e)}async function aDt({hunks:t,path:e},{baseFs:r,dryRun:o=!1}){let a=await r.statSync(e).mode,u=(await r.readFileSync(e,"utf8")).split(/\n/),A=[],p=0,h=0;for(let I of t){let v=Math.max(h,I.header.patched.start+p),x=Math.max(0,v-h),C=Math.max(0,u.length-v-I.header.original.length),R=Math.max(x,C),L=0,U=0,z=null;for(;L<=R;){if(L<=x&&(U=v-L,z=xBe(I,u,U),z!==null)){L=-L;break}if(L<=C&&(U=v+L,z=xBe(I,u,U),z!==null))break;L+=1}if(z===null)throw new UC(t.indexOf(I),I);A.push(z),p+=L,h=U+I.header.original.length}if(o)return;let E=0;for(let I of A)for(let v of I)switch(v.type){case"splice":{let x=v.index+E;u.splice(x,v.numToDelete,...v.linesToInsert),E+=v.linesToInsert.length-v.numToDelete}break;case"pop":u.pop();break;case"push":u.push(v.line);break;default:He.assertNever(v);break}await r.writeFilePromise(e,u.join(`
|
||||
`),{mode:a})}function xBe(t,e,r){let o=[];for(let a of t.parts)switch(a.type){case"context":case"deletion":{for(let n of a.lines){let u=e[r];if(u==null||!oDt(u,n))return null;r+=1}a.type==="deletion"&&(o.push({type:"splice",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&o.push({type:"push",line:""}))}break;case"insertion":o.push({type:"splice",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&o.push({type:"pop"});break;default:He.assertNever(a.type);break}return o}var cDt=/^builtin<([^>]+)>$/;function HC(t,e){let{protocol:r,source:o,selector:a,params:n}=G.parseRange(t);if(r!=="patch:")throw new Error("Invalid patch range");if(o===null)throw new Error("Patch locators must explicitly define their source");let u=a?a.split(/&/).map(E=>ue.toPortablePath(E)):[],A=n&&typeof n.locator=="string"?G.parseLocator(n.locator):null,p=n&&typeof n.version=="string"?n.version:null,h=e(o);return{parentLocator:A,sourceItem:h,patchPaths:u,sourceVersion:p}}function YQ(t){return t.range.startsWith("patch:")}function $h(t){return t.reference.startsWith("patch:")}function Ev(t){let{sourceItem:e,...r}=HC(t.range,G.parseDescriptor);return{...r,sourceDescriptor:e}}function Cv(t){let{sourceItem:e,...r}=HC(t.reference,G.parseLocator);return{...r,sourceLocator:e}}function uDt(t){let{sourceItem:e}=HC(t.range,G.parseDescriptor);return e}function ADt(t){let{sourceItem:e}=HC(t.reference,G.parseLocator);return e}function I5(t){if(!YQ(t))return t;let{sourceItem:e}=HC(t.range,G.parseDescriptor);return e}function WQ(t){if(!$h(t))return t;let{sourceItem:e}=HC(t.reference,G.parseLocator);return e}function kBe({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:o,patchHash:a},n){let u=t!==null?{locator:G.stringifyLocator(t)}:{},A=typeof o<"u"?{version:o}:{},p=typeof a<"u"?{hash:a}:{};return G.makeRange({protocol:"patch:",source:n(e),selector:r.join("&"),params:{...A,...p,...u}})}function KQ(t,{parentLocator:e,sourceDescriptor:r,patchPaths:o}){return G.makeDescriptor(t,kBe({parentLocator:e,sourceItem:r,patchPaths:o},G.stringifyDescriptor))}function B5(t,{parentLocator:e,sourcePackage:r,patchPaths:o,patchHash:a}){return G.makeLocator(t,kBe({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:o,patchHash:a},G.stringifyLocator))}function QBe({onAbsolute:t,onRelative:e,onProject:r,onBuiltin:o},a){let n=a.lastIndexOf("!");n!==-1&&(a=a.slice(n+1));let u=a.match(cDt);return u!==null?o(u[1]):a.startsWith("~/")?r(a.slice(2)):K.isAbsolute(a)?t(a):e(a)}function FBe(t){let e=t.lastIndexOf("!");return{optional:(e!==-1?new Set(t.slice(0,e).split(/!/)):new Set).has("optional")}}function v5(t){return QBe({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},t)}async function wv(t,e,r){let o=t!==null?await r.fetcher.fetch(t,r):null,a=o&&o.localPath?{packageFs:new gn(It.root),prefixPath:K.relative(It.root,o.localPath)}:o;o&&o!==a&&o.releaseFs&&o.releaseFs();let n=await He.releaseAfterUseAsync(async()=>await Promise.all(e.map(async u=>{let A=FBe(u),p=await QBe({onAbsolute:async h=>await oe.readFilePromise(h,"utf8"),onRelative:async h=>{if(a===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await a.packageFs.readFilePromise(K.join(a.prefixPath,h),"utf8")},onProject:async h=>await oe.readFilePromise(K.join(r.project.cwd,h),"utf8"),onBuiltin:async h=>await r.project.configuration.firstHook(E=>E.getBuiltinPatch,r.project,h)},u);return{...A,source:p}})));for(let u of n)typeof u.source=="string"&&(u.source=u.source.replace(/\r\n?/g,`
|
||||
`));return n}async function D5(t,{cache:e,project:r}){let o=r.storedPackages.get(t.locatorHash);if(typeof o>"u")throw new Error("Assertion failed: Expected the package to be registered");let a=WQ(t),n=r.storedChecksums,u=new ki,A=await oe.mktempPromise(),p=K.join(A,"source"),h=K.join(A,"user"),E=K.join(A,".yarn-patch.json"),I=r.configuration.makeFetcher(),v=[];try{let x,C;if(t.locatorHash===a.locatorHash){let R=await I.fetch(t,{cache:e,project:r,fetcher:I,checksums:n,report:u});v.push(()=>R.releaseFs?.()),x=R,C=R}else x=await I.fetch(t,{cache:e,project:r,fetcher:I,checksums:n,report:u}),v.push(()=>x.releaseFs?.()),C=await I.fetch(t,{cache:e,project:r,fetcher:I,checksums:n,report:u}),v.push(()=>C.releaseFs?.());await Promise.all([oe.copyPromise(p,x.prefixPath,{baseFs:x.packageFs}),oe.copyPromise(h,C.prefixPath,{baseFs:C.packageFs}),oe.writeJsonPromise(E,{locator:G.stringifyLocator(t),version:o.version})])}finally{for(let x of v)x()}return oe.detachTemp(A),h}async function P5(t,e){let r=ue.fromPortablePath(t).replace(/\\/g,"/"),o=ue.fromPortablePath(e).replace(/\\/g,"/"),{stdout:a,stderr:n}=await Ur.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",r,o],{cwd:ue.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
|
||||
The following error was reported by 'git':
|
||||
${n}`);let u=r.startsWith("/")?A=>A.slice(1):A=>A;return a.replace(new RegExp(`(a|b)(${He.escapeRegExp(`/${u(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${He.escapeRegExp(`/${u(o)}/`)}`,"g"),"$1/").replace(new RegExp(He.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(He.escapeRegExp(`${o}/`),"g"),"")}function S5(t,e){let r=[];for(let{source:o}of t){if(o===null)continue;let a=yv(o);for(let n of a){let{semverExclusivity:u,...A}=n;u!==null&&e!==null&&!Lr.satisfiesWithPrereleases(e,u)||r.push(JSON.stringify(A))}}return wn.makeHash(`${3}`,...r).slice(0,6)}Ge();function RBe(t,{configuration:e,report:r}){for(let o of t.parts)for(let a of o.lines)switch(o.type){case"context":r.reportInfo(null,` ${pe.pretty(e,a,"grey")}`);break;case"deletion":r.reportError(28,`- ${pe.pretty(e,a,pe.Type.REMOVED)}`);break;case"insertion":r.reportError(28,`+ ${pe.pretty(e,a,pe.Type.ADDED)}`);break;default:He.assertNever(o.type)}}var Iv=class{supports(e,r){return!!$h(e)}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:u}}async patchPackage(e,r){let{parentLocator:o,sourceLocator:a,sourceVersion:n,patchPaths:u}=Cv(e),A=await wv(o,u,r),p=await oe.mktempPromise(),h=K.join(p,"current.zip"),E=await r.fetcher.fetch(a,r),I=G.getIdentVendorPath(e),v=new Zi(h,{create:!0,level:r.project.configuration.get("compressionLevel")});await He.releaseAfterUseAsync(async()=>{await v.copyPromise(I,E.prefixPath,{baseFs:E.packageFs,stableSort:!0})},E.releaseFs),v.saveAndClose();for(let{source:x,optional:C}of A){if(x===null)continue;let R=new Zi(h,{level:r.project.configuration.get("compressionLevel")}),L=new gn(K.resolve(It.root,I),{baseFs:R});try{await GQ(yv(x),{baseFs:L,version:n})}catch(U){if(!(U instanceof UC))throw U;let z=r.project.configuration.get("enableInlineHunks"),te=!z&&!C?" (set enableInlineHunks for details)":"",ae=`${G.prettyLocator(r.project.configuration,e)}: ${U.message}${te}`,le=ce=>{z&&RBe(U.hunk,{configuration:r.project.configuration,report:ce})};if(R.discardAndClose(),C){r.report.reportWarningOnce(66,ae,{reportExtra:le});continue}else throw new Jt(66,ae,le)}R.saveAndClose()}return new Zi(h,{level:r.project.configuration.get("compressionLevel")})}};Ge();var Bv=class{supportsDescriptor(e,r){return!!YQ(e)}supportsLocator(e,r){return!!$h(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){let{patchPaths:a}=Ev(e);return a.every(n=>!v5(n))?e:G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:o}=Ev(e);return{sourceDescriptor:r.project.configuration.normalizeDependency(o)}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:a,patchPaths:n}=Ev(e),u=await wv(a,n,o.fetchOptions),A=r.sourceDescriptor;if(typeof A>"u")throw new Error("Assertion failed: The dependency should have been resolved");let p=S5(u,A.version);return[B5(e,{parentLocator:a,sourcePackage:A,patchPaths:n,patchHash:p})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let{sourceLocator:o}=Cv(e);return{...await r.resolver.resolve(o,r),...e}}};Ge();Pt();qt();var qC=class extends ut{constructor(){super(...arguments);this.save=ge.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=ge.String()}static{this.paths=[["patch-commit"]]}static{this.usage=it.Usage({description:"generate a patch out of a directory",details:"\n By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of the package. Such file is suitable for consumption with the `patch:` protocol.\n\n With the `-s,--save` option set, the patchfile won't be printed on stdout anymore and will instead be stored within a local file (by default kept within `.yarn/patches`, but configurable via the `patchFolder` setting). A `resolutions` entry will also be added to your top-level manifest, referencing the patched package via the `patch:` protocol.\n\n Note that only folders generated by `yarn patch` are accepted as valid input for `yarn patch-commit`.\n "})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd);if(!a)throw new sr(o.cwd,this.context.cwd);await o.restoreInstallState();let n=K.resolve(this.context.cwd,ue.toPortablePath(this.patchFolder)),u=K.join(n,"../source"),A=K.join(n,"../.yarn-patch.json");if(!oe.existsSLine truncated
|
||||
${A.map(p=>`
|
||||
- ${G.prettyLocator(r,p)}`).join("")}`);u=A[0]}if(!o.storedPackages.has(u.locatorHash))throw new st("No package found in the project for the given locator");await Rt.start({configuration:r,json:this.json,stdout:this.context.stdout},async A=>{let p=WQ(u),h=await D5(u,{cache:n,project:o});A.reportJson({locator:G.stringifyLocator(p),path:ue.fromPortablePath(h)});let E=this.update?" along with its current modifications":"";A.reportInfo(0,`Package ${G.prettyLocator(r,p)} got extracted with success${E}!`),A.reportInfo(0,`You can now edit the following folder: ${pe.pretty(r,ue.fromPortablePath(h),"magenta")}`),A.reportInfo(0,`Once you are done run ${pe.pretty(r,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${ue.fromPortablePath(h)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};var fDt={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:"BOOLEAN",default:!1},patchFolder:{description:"Folder where the patch files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/patches"}},commands:[qC,jC],fetchers:[Iv],resolvers:[Bv]},pDt=fDt;var Q5={};Vt(Q5,{PnpmLinker:()=>vv,default:()=>yDt});Ge();Pt();qt();var vv=class{getCustomDataKey(){return JSON.stringify({name:"PnpmLinker",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let o=this.getCustomDataKey(),a=r.project.linkersCustomData.get(o);if(!a)throw new st(`The project in ${pe.pretty(r.project.configuration,`${r.project.cwd}/package.json`,pe.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(e.locatorHash);if(typeof n>"u")throw new st(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let o=this.getCustomDataKey(),a=r.project.linkersCustomData.get(o);if(!a)throw new st(`The project in ${pe.pretty(r.project.configuration,`${r.project.cwd}/package.json`,pe.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(n){let p=a.locatorByPath.get(n[1]);if(p)return p}let u=e,A=e;do{A=u,u=K.dirname(A);let p=a.locatorByPath.get(A);if(p)return p}while(u!==A);return null}makeInstaller(e){return new x5(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},x5=class{constructor(e){this.opts=e;this.asyncActions=new He.AsyncActions(10);this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.indexFolderPromise=cD(oe,{indexPath:K.join(e.project.configuration.get("globalFolder"),"index")})}attachCustomData(e){}async installPackage(e,r,o){switch(e.linkType){case"SOFT":return this.installPackageSoft(e,r,o);case"HARD":return this.installPackageHard(e,r,o)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,r,o){let a=K.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(e)?K.join(a,dr.nodeModules):null;return this.customData.pathsByLocator.set(e.locatorHash,{packageLocation:a,dependenciesLocation:n}),{packageLocation:a,buildRequest:null}}async installPackageHard(e,r,o){let a=hDt(e,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,G.stringifyLocator(e)),this.customData.pathsByLocator.set(e.locatorHash,a),o.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await oe.mkdirPromise(n,{recursive:!0}),await oe.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:"HardlinkFromIndex",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let A=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e,p={manifest:await Ut.tryFind(r.prefixPath,{baseFs:r.packageFs})??new Ut,misc:{hasBindingGyp:mA.hasBindingGyp(r)}},h=this.opts.project.getDependencyMeta(A,e.version),E=mA.extractBuildRequest(e,p,h,{configuration:this.opts.project.configuration});return{packageLocation:n,buildRequest:E}}async attachInternalDependencies(e,r){if(this.opts.project.configuration.get("nodeLinker")!=="pnpm"||!TBe(e,{project:this.opts.project}))return;let o=this.customData.pathsByLocator.get(e.locatorHash);if(typeof o>"u")throw new Error(`Assertion failed: Expected the package to have been registered (${G.stringifyLocator(e)})`);let{dependenciesLocation:a}=o;a&&this.asyncActions.reduce(e.locatorHash,async n=>{await oe.mkdirPromise(a,{recursive:!0});let u=await gDt(a),A=new Map(u),p=[n],h=(I,v)=>{let x=v;TBe(v,{project:this.opts.project})||(this.opts.report.reportWarningOnce(0,"The pnpm linker doesn't support providing different versions to workspaces' peer dependencies"),x=G.devirtualizeLocator(v));let C=this.customData.pathsByLocator.get(x.locatorHash);if(typeof C>"Line truncated
|
||||
|
||||
${CDt}
|
||||
`,"--",...o],{cwd:t,strict:!0})},async makeReset(t,e){let r=e.map(o=>ue.fromPortablePath(o.path));await Ur.execvp("git",["reset","HEAD","--",...r],{cwd:t,strict:!0})}};var DDt=[UBe],GC=class extends ut{constructor(){super(...arguments);this.commit=ge.Boolean("-c,--commit",!1,{description:"Commit the staged files"});this.reset=ge.Boolean("-r,--reset",!1,{description:"Remove all files from the staging area"});this.dryRun=ge.Boolean("-n,--dry-run",!1,{description:"Print the commit message and the list of modified files without staging / committing"});this.update=ge.Boolean("-u,--update",!1,{hidden:!0})}static{this.paths=[["stage"]]}static{this.usage=it.Usage({description:"add all yarn files to your vcs",details:"\n This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\n\n Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\n\n Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\n ",examples:[["Adds all modified project files to the staging area","yarn stage"],["Creates a new commit containing all modified project files","yarn stage --commit"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o}=await kt.find(r,this.context.cwd),{driver:a,root:n}=await PDt(o.cwd),u=[r.get("cacheFolder"),r.get("globalFolder"),r.get("virtualFolder"),r.get("yarnPath")];await r.triggerHook(I=>I.populateYarnPaths,o,I=>{u.push(I)});let A=new Set;for(let I of u)for(let v of SDt(n,I))A.add(v);let p=new Set([r.get("rcFilename"),dr.lockfile,dr.manifest]),h=await a.filterChanges(n,A,p),E=await a.genCommitMessage(n,h);if(this.dryRun)if(this.commit)this.context.stdout.write(`${E}
|
||||
`);else for(let I of h)this.context.stdout.write(`${ue.fromPortablePath(I.path)}
|
||||
`);else if(this.reset){let I=await a.filterChanges(n,A,p,{staged:!0});I.length===0?this.context.stdout.write("No staged changes found!"):await a.makeReset(n,I)}else h.length===0?this.context.stdout.write("No changes found!"):this.commit?await a.makeCommit(n,h,E):(await a.makeStage(n,h),this.context.stdout.write(E))}};async function PDt(t){let e=null,r=null;for(let o of DDt)if((r=await o.findRoot(t))!==null){e=o;break}if(e===null||r===null)throw new st("No stage driver has been found for your current project");return{driver:e,root:r}}function SDt(t,e){let r=[];if(e===null)return r;for(;;){(e===t||e.startsWith(`${t}/`))&&r.push(e);let o;try{o=oe.statSync(e)}catch{break}if(o.isSymbolicLink())e=K.resolve(K.dirname(e),oe.readlinkSync(e));else break}return r}var bDt={commands:[GC]},xDt=bDt;var U5={};Vt(U5,{default:()=>MDt});Ge();Ge();Pt();var qBe=Ze(Jn());Ge();var _Be=Ze(YH()),kDt="e8e1bd300d860104bb8c58453ffa1eb4",QDt="OFCNCOG2CU",HBe=async(t,e)=>{let r=G.stringifyIdent(t),a=FDt(e).initIndex("npm-search");try{return(await a.getObject(r,{attributesToRetrieve:["types"]})).types?.ts==="definitely-typed"}catch{return!1}},FDt=t=>(0,_Be.default)(QDt,kDt,{requester:{async send(r){try{let o=await sn.request(r.url,r.data||null,{configuration:t,headers:r.headers});return{content:o.body,isTimedOut:!1,status:o.statusCode}}catch(o){return{content:o.response.body,isTimedOut:!1,status:o.response.statusCode}}}}});var jBe=t=>t.scope?`${t.scope}__${t.name}`:`${t.name}`,RDt=async(t,e,r,o)=>{if(r.scope==="types")return;let{project:a}=t,{configuration:n}=a;if(!(n.get("tsEnableAutoTypes")??(oe.existsSync(K.join(t.cwd,"tsconfig.json"))||oe.existsSync(K.join(a.cwd,"tsconfig.json")))))return;let A=n.makeResolver(),p={project:a,resolver:A,report:new ki};if(!await HBe(r,n))return;let E=jBe(r),I=G.parseRange(r.range).selector;if(!Lr.validRange(I)){let L=n.normalizeDependency(r),U=await A.getCandidates(L,{},p);I=G.parseRange(U[0].reference).selector}let v=qBe.default.coerce(I);if(v===null)return;let x=`${Zc.Modifier.CARET}${v.major}`,C=G.makeDescriptor(G.makeIdent("types",E),x),R=He.mapAndFind(a.workspaces,L=>{let U=L.manifest.dependencies.get(r.identHash)?.descriptorHash,z=L.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&z!==r.descriptorHash)return He.mapAndFind.skip;let te=[];for(let ae of Ut.allDependencies){let le=L.manifest[ae].get(C.identHash);typeof le>"u"||te.push([ae,le])}return te.length===0?He.mapAndFind.skip:te});if(typeof R<"u")for(let[L,U]of R)t.manifest[L].set(U.identHash,U);else{try{let L=n.normalizeDependency(C);if((await A.getCandidates(L,{},p)).length===0)return}catch{return}t.manifest[Zc.Target.DEVELOPMENT].set(C.identHash,C)}},TDt=async(t,e,r)=>{if(r.scope==="types")return;let{project:o}=t,{configuration:a}=o;if(!(a.get("tsEnableAutoTypes")??(oe.existsSync(K.join(t.cwd,"tsconfig.json"))||oe.existsSync(K.join(o.cwd,"tsconfig.json")))))return;let u=jBe(r),A=G.makeIdent("types",u);for(let p of Ut.allDependencies)typeof t.manifest[p].get(A.identHash)>"u"||t.manifest[p].delete(A.identHash)},NDt=(t,e)=>{e.publishConfig&&e.publishConfig.typings&&(e.typings=e.publishConfig.typings),e.publishConfig&&e.publishConfig.types&&(e.types=e.publishConfig.types)},LDt={configuration:{tsEnableAutoTypes:{description:"Whether Yarn should auto-install @types/ dependencies on 'yarn add'",type:"BOOLEAN",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:RDt,afterWorkspaceDependencyRemoval:TDt,beforeWorkspacePacking:NDt}},MDt=LDt;var G5={};Vt(G5,{VersionApplyCommand:()=>zC,VersionCheckCommand:()=>JC,VersionCommand:()=>XC,default:()=>rPt,versionUtils:()=>VC});Ge();Ge();qt();var VC={};Vt(VC,{Decision:()=>WC,applyPrerelease:()=>zBe,applyReleases:()=>j5,applyStrategy:()=>XQ,clearVersionFiles:()=>_5,getUndecidedDependentWorkspaces:()=>Pv,getUndecidedWorkspaces:()=>JQ,openVersionFile:()=>KC,requireMoreDecisions:()=>$Dt,resolveVersionFiles:()=>Dv,suggestStrategy:()=>q5,updateVersionFiles:()=>H5,validateReleaseDecision:()=>YC});Ge();Pt();Nl();qt();var VBe=Ze(KBe()),BA=Ze(Jn()),ZDt=/^(>=|[~^]|)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/,WC=(u=>(u.UNDECIDED="undecided",u.DECLINE="decline",u.MAJOR="major",u.MINOR="minor",u.PATCH="patch",u.PRERELEASE="prerelease",u))(WC||{});function YC(t){let e=BA.default.valid(t);return e||He.validateEnum((0,VBe.default)(WC,"UNDECIDED"),t)}async function Dv(t,{prerelease:e=null}={}){let r=new Map,o=t.configuration.get("deferredVersionFolder");if(!oe.existsSync(o))return r;let a=await oe.readdirPromise(o);for(let n of a){if(!n.endsWith(".yml"))continue;let u=K.join(o,n),A=await oe.readFilePromise(u,"utf8"),p=Ki(A);for(let[h,E]of Object.entries(p.releases||{})){if(E==="decline")continue;let I=G.parseIdent(h),v=t.tryWorkspaceByIdent(I);if(v===null)throw new Error(`Assertion failed: Expected a release definition file to only reference existing workspacesLine truncated
|
||||
- ${A.map(x=>ue.fromPortablePath(x)).join(`
|
||||
- `)}`);let p=new Set(He.mapAndFilter(n,x=>{let C=t.tryWorkspaceByFilePath(x);return C===null?He.mapAndFilter.skip:C}));if(A.length===0&&p.size===0&&!e)return null;let h=A.length===1?A[0]:K.join(u,`${wn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=oe.existsSync(h)?await oe.readFilePromise(h,"utf8"):"{}",I=Ki(E),v=new Map;for(let x of I.declined||[]){let C=G.parseIdent(x),R=t.getWorkspaceByIdent(C);v.set(R,"decline")}for(let[x,C]of Object.entries(I.releases||{})){let R=G.parseIdent(x),L=t.getWorkspaceByIdent(R);v.set(L,YC(C))}return{project:t,root:o,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:p,releaseRoots:new Set([...p].filter(x=>x.manifest.version!==null)),releases:v,async saveAll(){let x={},C=[],R=[];for(let L of t.workspaces){if(L.manifest.version===null)continue;let U=G.stringifyIdent(L.anchoredLocator),z=v.get(L);z==="decline"?C.push(U):typeof z<"u"?x[U]=YC(z):p.has(L)&&R.push(U)}await oe.mkdirPromise(K.dirname(h),{recursive:!0}),await oe.changeFilePromise(h,Da(new Da.PreserveOrdering({releases:Object.keys(x).length>0?x:void 0,declined:C.length>0?C:void 0,undecided:R.length>0?R:void 0})))}}}function $Dt(t){return JQ(t).size>0||Pv(t).length>0}function JQ(t){let e=new Set;for(let r of t.changedWorkspaces)r.manifest.version!==null&&(t.releases.has(r)||e.add(r));return e}function Pv(t,{include:e=new Set}={}){let r=[],o=new Map(He.mapAndFilter([...t.releases],([n,u])=>u==="decline"?He.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(He.mapAndFilter([...t.releases],([n,u])=>u!=="decline"?He.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of t.project.workspaces)if(!(!e.has(n)&&(a.has(n.anchoredLocator.locatorHash)||o.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let u of Ut.hardDependencies)for(let A of n.manifest.getForScope(u).values()){let p=t.project.tryWorkspaceByDescriptor(A);p!==null&&o.has(p.anchoredLocator.locatorHash)&&r.push([n,p])}return r}function q5(t,e){let r=BA.default.clean(e);for(let o of Object.values(WC))if(o!=="undecided"&&o!=="decline"&&BA.default.inc(t,o)===r)return o;return null}function XQ(t,e){if(BA.default.valid(e))return e;if(t===null)throw new st(`Cannot apply the release strategy "${e}" unless the workspace already has a valid version`);if(!BA.default.valid(t))throw new st(`Cannot apply the release strategy "${e}" on a non-semver version (${t})`);let r=BA.default.inc(t,e);if(r===null)throw new st(`Cannot apply the release strategy "${e}" on the specified version (${t})`);return r}function j5(t,e,{report:r}){let o=new Map;for(let a of t.workspaces)for(let n of Ut.allDependencies)for(let u of a.manifest[n].values()){let A=t.tryWorkspaceByDescriptor(u);if(A===null||!e.has(A))continue;He.getArrayWithDefault(o,A).push([a,n,u.identHash])}for(let[a,n]of e){let u=a.manifest.version;a.manifest.version=n,BA.default.prerelease(n)===null?delete a.manifest.raw.stableVersion:a.manifest.raw.stableVersion||(a.manifest.raw.stableVersion=u);let A=a.manifest.name!==null?G.stringifyIdent(a.manifest.name):null;r.reportInfo(0,`${G.prettyLocator(t.configuration,a.anchoredLocator)}: Bumped to ${n}`),r.reportJson({cwd:ue.fromPortablePath(a.cwd),ident:A,oldVersion:u,newVersion:n});let p=o.get(a);if(!(typeof p>"u"))for(let[h,E,I]of p){let v=h.manifest[E].get(I);if(typeof v>"u")throw new Error("Assertion failed: The dependency should have existed");let x=v.range,C=!1;if(x.startsWith(ei.protocol)&&(x=x.slice(ei.protocol.length),C=!0,x===a.relativeCwd))continue;let R=x.match(ZDt);if(!R){r.reportWarning(0,`Couldn't auto-upgrade range ${x} (in ${G.prettyLocator(t.configuration,h.anchoredLocator)})`);continue}let L=`${R[1]}${n}`;C&&(L=`${ei.protocol}${L}`);let U=G.makeDescriptor(v,L);h.manifest[E].set(I,U)}}}var ePt=new Map([["%n",{extract:t=>t.length>=1?[t[0],t.slice(1)]:null,generate:(t=0)=>`${t+1}`}]]);function zBe(t,{current:e,prerelease:r}){let o=new BA.default.SemVer(e),a=o.prerelease.slice(),n=[];o.prerelease=[],o.format()!==t&&(a.length=0);let u=!0,A=r.split(/\./g);for(let p of A){let h=ePt.get(p);if(typeof h>"u")n.push(p),a[0]===p?a.shift():u=!1;else{let E=u?h.extract(a):null;E!==null&&typeof E[0]=="number"?(n.push(h.generate(E[0])),a=E[1]):(n.push(h.generate()),u=!1)}}return o.prerelease&&(o.prerelease=[]),`${t}-${n.join(".")}`}var zC=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("--all",!1,{description:"Apply the deferred version changes on all workspaces"});this.dryRun=ge.Boolean("--dry-run",!1,{description:"Print the versions without actually generating the package archive"});this.prerelease=ge.String("--prerelease",{description:"Add a prerelease identifier to new versions",tolerateBoolean:!0});this.recursive=ge.Boolean("-R,--recursive",{description:"Release the transitive workspaces as well"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["version","apply"]]}static{this.usage=it.Usage({catLine truncated
|
||||
This command will apply the deferred version changes and remove their definitions from the repository.
|
||||
|
||||
Note that if \`--prerelease\` is set, the given prerelease identifier (by default \`rc.%n\`) will be used on all new versions and the version definitions will be kept as-is.
|
||||
|
||||
By default only the current workspace will be bumped, but you can configure this behavior by using one of:
|
||||
|
||||
- \`--recursive\` to also apply the version bump on its dependencies
|
||||
- \`--all\` to apply the version bump on all packages in the repository
|
||||
|
||||
Note that this command will also update the \`workspace:\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.
|
||||
`,examples:[["Apply the version change to the local workspace","yarn version apply"],["Apply the version change to all the workspaces in the local workspace","yarn version apply --all"]]})}async execute(){let r=await Ke.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await kt.find(r,this.context.cwd),n=await Gr.find(r);if(!a)throw new sr(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=await Rt.start({configuration:r,json:this.json,stdout:this.context.stdout},async A=>{let p=this.prerelease?typeof this.prerelease!="boolean"?this.prerelease:"rc.%n":null,h=await Dv(o,{prerelease:p}),E=new Map;if(this.all)E=h;else{let I=this.recursive?a.getRecursiveWorkspaceDependencies():[a];for(let v of I){let x=h.get(v);typeof x<"u"&&E.set(v,x)}}if(E.size===0){let I=h.size>0?" Did you want to add --all?":"";A.reportWarning(0,`The current workspace doesn't seem to require a version bump.${I}`);return}j5(o,E,{report:A}),this.dryRun||(p||(this.all?await _5(o):await H5(o,[...E.keys()])),A.reportSeparator())});return this.dryRun||u.hasErrors()?u.exitCode():await o.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};Ge();Pt();qt();var ZQ=Ze(Jn());var JC=class extends ut{constructor(){super(...arguments);this.interactive=ge.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})}static{this.paths=[["version","check"]]}static{this.usage=it.Usage({category:"Release-related commands",description:"check that all the relevant packages have been bumped",details:"\n **Warning:** This command currently requires Git.\n\n This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\n\n In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\n\n In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\n ",examples:[["Check whether the modified packages need a bump","yarn version check"]]})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){GE(this.context);let{Gem:r}=await Promise.resolve().then(()=>(Zk(),Eq)),{ScrollableItems:o}=await Promise.resolve().then(()=>(rQ(),tQ)),{FocusRequest:a}=await Promise.resolve().then(()=>(wq(),$we)),{useListInput:n}=await Promise.resolve().then(()=>(eQ(),eIe)),{renderForm:u}=await Promise.resolve().then(()=>(oQ(),sQ)),{Box:A,Text:p}=await Promise.resolve().then(()=>Ze(ic())),{default:h,useCallback:E,useState:I}=await Promise.resolve().then(()=>Ze(an())),v=await Ke.find(this.context.cwd,this.context.plugins),{project:x,workspace:C}=await kt.find(v,this.context.cwd);if(!C)throw new sr(x.cwd,this.context.cwd);await x.restoreInstallState();let R=await KC(x);if(R===null||R.releaseRoots.size===0)return 0;if(R.root===null)throw new st("This command can only be run on Git repositories");let L=()=>h.createElement(A,{flexDirection:"row",paddingBottom:1},h.createElement(A,{flexDirection:"column",width:60},h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to select workspaces.")),h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<left>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<right>")," to select release strategies."))),h.createElement(A,{flexDirection:"column"},h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to save.")),h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),U=({workspace:Ce,active:de,decision:Be,setDecision:Ee})=>{let g=Ce.manifest.raw.stableVersion??Ce.manifest.version;if(g===null)throw new Error(`Assertion failed: The version should have been set (${G.prettyLocator(v,Ce.anchoredLocator)})`);if(ZQ.default.prerelease(g)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${g})`);let me=["undecided","decline","patch","minor","major"];n(Be,me,{active:de,minus:"left",plus:"right",set:Ee});let we=Be==="undecided"?h.createElement(p,{color:"yellow"},g):Be==="decline"?h.createElement(p,{color:"green"},g):h.createElement(p,null,h.createElement(p,{color:"magenta"},g)," \u2192 ",h.createElement(p,{color:"green"},ZQ.default.valid(Be)?Be:ZQ.default.inc(g,Be)));return h.createElement(A,{flexDirection:"column"},h.createElement(A,null,h.createElement(p,null,G.prettyLocator(v,Ce.anchoredLocator)," - ",we)),h.createElement(A,null,me.map(Ae=>h.createElementLine truncated
|
||||
`)},p=()=>{let Ee=this.from.map(g=>$C.default.matcher(g));return o.workspaces.filter(g=>{let me=G.stringifyIdent(g.anchoredLocator),we=g.relativeCwd;return Ee.some(Ae=>Ae(me)||Ae(we))})},h=[];if(this.since?(A("Option --since is set; selecting the changed workspaces as root for workspace selection"),h=Array.from(await ia.fetchChangedWorkspaces({ref:this.since,project:o}))):this.from?(A("Option --from is set; selecting the specified workspaces"),h=[...p()]):this.worktree?(A("Option --worktree is set; selecting the current workspace"),h=[a]):this.recursive?(A("Option --recursive is set; selecting the current workspace"),h=[a]):this.all&&(A("Option --all is set; selecting all workspaces"),h=[...o.workspaces]),this.dryRun&&!this.all){for(let Ee of h)A(`
|
||||
- ${Ee.relativeCwd}
|
||||
${G.prettyLocator(r,Ee.anchoredLocator)}`);h.length>0&&A("")}let E;if(this.recursive?this.since?(A("Option --recursive --since is set; recursively selecting all dependent workspaces"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceDependents()]).flat())):(A("Option --recursive is set; recursively selecting all transitive dependencies"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(A("Option --worktree is set; recursively selecting all nested workspaces"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let Ee of E)A(`
|
||||
- ${Ee.relativeCwd}
|
||||
${G.prettyLocator(r,Ee.anchoredLocator)}`);let I=[],v=!1;if(u?.includes(":")){for(let Ee of o.workspaces)if(Ee.manifest.scripts.has(u)&&(v=!v,v===!1))break}for(let Ee of h){if(u&&!Ee.manifest.scripts.has(u)&&!v&&!(await An.getWorkspaceAccessibleBinaries(Ee)).has(u)){A(`Excluding ${Ee.relativeCwd} because it doesn't have a "${u}" script`);continue}if(!(u===r.env.npm_lifecycle_event&&Ee.cwd===a.cwd)){if(this.include.length>0&&!$C.default.isMatch(G.stringifyIdent(Ee.anchoredLocator),this.include)&&!$C.default.isMatch(Ee.relativeCwd,this.include)){A(`Excluding ${Ee.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&($C.default.isMatch(G.stringifyIdent(Ee.anchoredLocator),this.exclude)||$C.default.isMatch(Ee.relativeCwd,this.exclude))){A(`Excluding ${Ee.relativeCwd} because it matches the --include filter`);continue}if(this.publicOnly&&Ee.manifest.private===!0){A(`Excluding ${Ee.relativeCwd} because it's a private workspace and --no-private was set`);continue}I.push(Ee)}}if(this.dryRun)return 0;let x=this.verbose??(this.context.stdout.isTTY?1/0:0),C=x>0,R=x>1,L=this.parallel?this.jobs==="unlimited"?1/0:Number(this.jobs)||Math.ceil(Xi.availableParallelism()/2):1,U=L===1?!1:this.parallel,z=U?this.interlaced:!0,te=(0,XBe.default)(L),ae=new Map,le=new Set,ce=0,Ce=null,de=!1,Be=await Rt.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async Ee=>{let g=async(me,{commandIndex:we})=>{if(de)return-1;!U&&R&&we>1&&Ee.reportSeparator();let Ae=nPt(me,{configuration:r,label:C,commandIndex:we}),[ne,Z]=JBe(Ee,{prefix:Ae,interlaced:z}),[xe,Ne]=JBe(Ee,{prefix:Ae,interlaced:z});try{R&&Ee.reportInfo(null,`${Ae?`${Ae} `:""}Process started`);let ht=Date.now(),H=await this.cli.run([this.commandName,...this.args],{cwd:me.cwd,stdout:ne,stderr:xe})||0;ne.end(),xe.end(),await Z,await Ne;let rt=Date.now();if(R){let Te=r.get("enableTimers")?`, completed in ${pe.pretty(r,rt-ht,pe.Type.DURATION)}`:"";Ee.reportInfo(null,`${Ae?`${Ae} `:""}Process exited (exit code ${H})${Te}`)}return H===130&&(de=!0,Ce=H),H}catch(ht){throw ne.end(),xe.end(),await Z,await Ne,ht}};for(let me of I)ae.set(me.anchoredLocator.locatorHash,me);for(;ae.size>0&&!Ee.hasErrors();){let me=[];for(let[ne,Z]of ae){if(le.has(Z.anchoredDescriptor.descriptorHash))continue;let xe=!0;if(this.topological||this.topologicalDev){let Ne=this.topologicalDev?new Map([...Z.manifest.dependencies,...Z.manifest.devDependencies]):Z.manifest.dependencies;for(let ht of Ne.values()){let H=o.tryWorkspaceByDescriptor(ht);if(xe=H===null||!ae.has(H.anchoredLocator.locatorHash),!xe)break}}if(xe&&(le.add(Z.anchoredDescriptor.descriptorHash),me.push(te(async()=>{let Ne=await g(Z,{commandIndex:++ce});return ae.delete(ne),le.delete(Z.anchoredDescriptor.descriptorHash),Ne})),!U))break}if(me.length===0){let ne=Array.from(ae.values()).map(Z=>G.prettyLocator(r,Z.anchoredLocator)).join(", ");Ee.reportError(3,`Dependency cycle detected (${ne})`);return}let Ae=(await Promise.all(me)).find(ne=>ne!==0);Ce===null&&(Ce=typeof Ae<"u"?1:Ce),(this.topological||this.topologicalDev)&&typeof Ae<"u"&&Ee.reportError(0,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return Ce!==null?Ce:Be.exitCode()}};function JBe(t,{prefix:e,interlaced:r}){let o=t.createStreamReporter(e),a=new He.DefaultStream;a.pipe(o,{end:!1}),a.on("finish",()=>{o.end()});let n=new Promise(A=>{o.on("finish",()=>{A(a.active)})});if(r)return[a,n];let u=new He.BufferStream;return u.pipe(a,{end:!1}),u.on("finish",()=>{a.end()}),[u,n]}function nPt(t,{configuration:e,commandIndex:r,label:o}){if(!o)return null;let n=`[${G.stringifyIdent(t.anchoredLocator)}]:`,u=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],A=u[r%u.length];return pe.pretty(e,n,A)}var iPt={commands:[ZC,ew]},sPt=iPt;var Hy=()=>({modules:new Map([["@yarnpkg/cli",W1],["@yarnpkg/core",Y1],["@yarnpkg/fslib",kw],["@yarnpkg/libzip",p1],["@yarnpkg/parsers",Ow],["@yarnpkg/shell",E1],["clipanion",Jw],["semver",oPt],["typanion",Vo],["@yarnpkg/plugin-essentials",K8],["@yarnpkg/plugin-compat",Z8],["@yarnpkg/plugin-constraints",dH],["@yarnpkg/plugin-dlx",mH],["@yarnpkg/plugin-exec",CH],["@yarnpkg/plugin-file",IH],["@yarnpkg/plugin-git",W8],["@yarnpkg/plugin-github",DH],["@yarnpkg/plugin-http",PH],["@yarnpkg/plugin-init",SH],["@yarnpkg/plugin-interactive-tools",kq],["@yarnpkg/plugin-link",Qq],["@yarnpkg/plugin-nm",hj],["@yarnpkg/plugin-npm",f5],["@yarnpkg/plugin-npm-cli",w5],["@yarnpkg/plugin-pack",a5],["@yarnpkg/plugin-patch",b5],["@yarnpkg/plugin-pnp",rj],["@yarnpkg/plugin-pnpm",Q5],["@yarnpkg/plugin-stage",O5],["@yarnpkg/plugin-typescript",U5],["@yarnpkg/plugin-version",G5],["@yarnpkg/plugin-workspace-tools",Y5]]),plugins:new Set(["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-constraints","@yarnpkg/plugin-dlx","@yarnpkg/plugin-exec","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-inLine truncated
|
||||
Please report this issue at https://github.com/yarnpkg/berry/issues.`)}process.once("beforeExit",n);try{process.exitCode=42,process.exitCode=await APt(a,t,{selfPath:r,pluginConfiguration:o})}catch(u){Jo.defaultContext.stdout.write(a.error(u)),process.exitCode=1}finally{process.off("beforeExit",n),await oe.rmtempPromise()}}Wx(process.argv.slice(2),{cwd:K.cwd(),selfPath:ue.toPortablePath(ue.resolve(process.argv[1])),pluginConfiguration:Hy()});})();
|
||||
/**
|
||||
@license
|
||||
Copyright (c) 2015, Rebecca Turner
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
@license
|
||||
Copyright Node.js contributors. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
@license
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
@license
|
||||
Copyright Joyent, Inc. and other Node contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/*! Bundled license information:
|
||||
|
||||
is-number/index.js:
|
||||
(*!
|
||||
* is-number <https://github.com/jonschlinkert/is-number>
|
||||
*
|
||||
* Copyright (c) 2014-present, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
|
||||
to-regex-range/index.js:
|
||||
(*!
|
||||
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
||||
*
|
||||
* Copyright (c) 2015-present, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
|
||||
fill-range/index.js:
|
||||
(*!
|
||||
* fill-range <https://github.com/jonschlinkert/fill-range>
|
||||
*
|
||||
* Copyright (c) 2014-present, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*)
|
||||
|
||||
is-extglob/index.js:
|
||||
(*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*)
|
||||
|
||||
is-glob/index.js:
|
||||
(*!
|
||||
* is-glob <https://github.com/jonschlinkert/is-glob>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
|
||||
queue-microtask/index.js:
|
||||
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||
|
||||
run-parallel/index.js:
|
||||
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||
|
||||
git-url-parse/lib/index.js:
|
||||
(*!
|
||||
* buildToken
|
||||
* Builds OAuth token prefix (helper function)
|
||||
*
|
||||
* @name buildToken
|
||||
* @function
|
||||
* @param {GitUrl} obj The parsed Git url object.
|
||||
* @return {String} token prefix
|
||||
*)
|
||||
|
||||
object-assign/index.js:
|
||||
(*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*)
|
||||
|
||||
react/cjs/react.production.min.js:
|
||||
(** @license React v16.13.1
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
scheduler/cjs/scheduler.production.min.js:
|
||||
(** @license React v0.18.0
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
react-reconciler/cjs/react-reconciler.production.min.js:
|
||||
(** @license React v0.24.0
|
||||
* react-reconciler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
is-windows/index.js:
|
||||
(*!
|
||||
* is-windows <https://github.com/jonschlinkert/is-windows>
|
||||
*
|
||||
* Copyright © 2015-2018, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*)
|
||||
*/
|
||||
+9
-1
@@ -1,3 +1,11 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.4.0.cjs
|
||||
enableScripts: true
|
||||
yarnPath: .yarn/releases/yarn-4.17.1.cjs
|
||||
npmPreapprovedPackages:
|
||||
- "@mui/*"
|
||||
- "expo"
|
||||
- "@expo/*"
|
||||
- "expo-*"
|
||||
- "babel-preset-expo"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
ARG VERSION=unknown
|
||||
# Source : https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
|
||||
FROM node:18-alpine3.18 AS base
|
||||
FROM node:24-alpine3.23 AS base
|
||||
FROM base AS builder
|
||||
ARG VERSION
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:18-alpine3.18
|
||||
FROM node:24-alpine3.23
|
||||
WORKDIR /app
|
||||
ENV VERSION=dev
|
||||
ENV NEXT_PUBLIC_VERSION=dev
|
||||
|
||||
@@ -1,32 +1,44 @@
|
||||
import type { ExpoConfig } from "expo/config";
|
||||
import type { ConfigContext, ExpoConfig } from "expo/config";
|
||||
|
||||
const IS_DEV = process.env.APP_VARIANT === "development";
|
||||
|
||||
module.exports = (_: ExpoConfig): ExpoConfig => ({
|
||||
export default (_: ConfigContext): ExpoConfig => ({
|
||||
name: IS_DEV ? "Meelo (Dev)" : "Meelo",
|
||||
slug: "meelo",
|
||||
version: "1.0.0",
|
||||
icon: "./assets/icon-black.png",
|
||||
scheme: "mobile",
|
||||
userInterfaceStyle: "automatic",
|
||||
newArchEnabled: true,
|
||||
android: {
|
||||
icon: "./assets/icon-black.png",
|
||||
edgeToEdgeEnabled: true,
|
||||
userInterfaceStyle: "automatic",
|
||||
package: IS_DEV ? "dev.arthichaud.meelo.dev" : "dev.artichaud.meelo",
|
||||
permissions: [
|
||||
"android.permission.FOREGROUND_SERVICE",
|
||||
"android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK",
|
||||
],
|
||||
},
|
||||
updates: { enabled: false },
|
||||
ios: {
|
||||
icon: "./assets/icon.icon",
|
||||
userInterfaceStyle: "automatic",
|
||||
bundleIdentifier: "com.arthichaud.meelo",
|
||||
appleTeamId: "HJ45QP4WWR",
|
||||
supportsTablet: true,
|
||||
config: { usesNonExemptEncryption: false },
|
||||
infoPlist: {
|
||||
UIBackgroundModes: "audio",
|
||||
UIViewControllerBasedStatusBarAppearance: true,
|
||||
CFBundleShortVersionString: "$(MARKETING_VERSION)",
|
||||
CFBundleVersion: "$(CURRENT_PROJECT_VERSION)",
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
"expo-router",
|
||||
[
|
||||
"@kesha-antonov/react-native-background-downloader",
|
||||
{
|
||||
skipMmkvDependency: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
"expo-screen-orientation",
|
||||
{
|
||||
@@ -54,6 +66,13 @@ module.exports = (_: ExpoConfig): ExpoConfig => ({
|
||||
},
|
||||
},
|
||||
],
|
||||
// [
|
||||
// "expo-media-control",
|
||||
// {
|
||||
// enableBackgroundAudio: true,
|
||||
// audioSessionCategory: "playback",
|
||||
// },
|
||||
// ],
|
||||
[
|
||||
"expo-asset",
|
||||
{
|
||||
@@ -63,7 +82,6 @@ module.exports = (_: ExpoConfig): ExpoConfig => ({
|
||||
],
|
||||
},
|
||||
],
|
||||
"./plugins/withMediaServicePlugin.ts",
|
||||
[
|
||||
// https://docs.thewidlarzgroup.com/react-native-video/docs/v7/configuration/expo-plugin
|
||||
"react-native-video",
|
||||
@@ -75,6 +93,7 @@ module.exports = (_: ExpoConfig): ExpoConfig => ({
|
||||
],
|
||||
experiments: {
|
||||
typedRoutes: true,
|
||||
reactCompiler: true,
|
||||
},
|
||||
extra: {
|
||||
router: {},
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 374 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 402 KiB |
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"fill" : "automatic",
|
||||
"groups" : [
|
||||
{
|
||||
"layers" : [
|
||||
{
|
||||
"blend-mode" : "normal",
|
||||
"fill" : "none",
|
||||
"glass" : false,
|
||||
"hidden-specializations" : [
|
||||
{
|
||||
"appearance" : "dark",
|
||||
"value" : true
|
||||
}
|
||||
],
|
||||
"image-name" : "icon-white.png",
|
||||
"name" : "icon-white",
|
||||
"position" : {
|
||||
"scale" : 0.5,
|
||||
"translation-in-points" : [
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"blend-mode" : "normal",
|
||||
"glass" : false,
|
||||
"hidden-specializations" : [
|
||||
{
|
||||
"value" : false
|
||||
},
|
||||
{
|
||||
"appearance" : "dark",
|
||||
"value" : false
|
||||
}
|
||||
],
|
||||
"image-name" : "icon-black.png",
|
||||
"name" : "icon-black",
|
||||
"position" : {
|
||||
"scale" : 0.5,
|
||||
"translation-in-points" : [
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"shadow" : {
|
||||
"kind" : "neutral",
|
||||
"opacity" : 0.5
|
||||
},
|
||||
"translucency" : {
|
||||
"enabled" : true,
|
||||
"value" : 0.5
|
||||
}
|
||||
}
|
||||
],
|
||||
"supported-platforms" : {
|
||||
"squares" : [
|
||||
"iOS"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"cli": {
|
||||
"version": ">= 10.2.2"
|
||||
"version": ">=16.0.0"
|
||||
},
|
||||
"build": {
|
||||
"development": {
|
||||
|
||||
@@ -6,75 +6,78 @@
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"start": "APP_VARIANT=development expo start",
|
||||
"android": "APP_VARIANT=development expo run:android",
|
||||
"android": "DISABLE_SVG=1 APP_VARIANT=development expo run:android",
|
||||
"android:prebuild": "APP_VARIANT=development expo prebuild -p android",
|
||||
"ios": "expo run:ios"
|
||||
},
|
||||
"dependencies": {
|
||||
"@d11/react-native-fast-image": "^8.12.0",
|
||||
"@expo-google-fonts/rubik": "^0.3.0",
|
||||
"@expo/config-plugins": "^54.0.2",
|
||||
"@gorhom/bottom-sheet": "^5.2.8",
|
||||
"@react-native-community/checkbox": "^0.5.20",
|
||||
"@shopify/flash-list": "2.0.2",
|
||||
"@shopify/react-native-skia": "2.2.12",
|
||||
"@tanstack/react-query": "^5.77.0",
|
||||
"@expo-google-fonts/rubik": "^0.4.2",
|
||||
"@gorhom/bottom-sheet": "^5.2.14",
|
||||
"@kesha-antonov/react-native-background-downloader": "^4.5.6",
|
||||
"@shopify/flash-list": "2.3.2",
|
||||
"@shopify/react-native-skia": "2.9.0",
|
||||
"@tanstack/react-query": "^5.100.5",
|
||||
"api": "workspace:^",
|
||||
"expo": "^54.0.0",
|
||||
"expo-asset": "~12.0.9",
|
||||
"expo-blur": "~15.0.7",
|
||||
"expo-build-properties": "~1.0.9",
|
||||
"expo-constants": "~18.0.9",
|
||||
"expo-dev-client": "~6.0.15",
|
||||
"expo-device": "~8.0.9",
|
||||
"expo-font": "~14.0.9",
|
||||
"expo-haptics": "~15.0.7",
|
||||
"expo-linear-gradient": "^15.0.7",
|
||||
"expo-linking": "~8.0.8",
|
||||
"expo-router": "~6.0.12",
|
||||
"expo-screen-orientation": "~9.0.7",
|
||||
"expo-splash-screen": "~31.0.10",
|
||||
"expo-status-bar": "~3.0.8",
|
||||
"expo-system-ui": "~6.0.7",
|
||||
"expo-web-browser": "~15.0.8",
|
||||
"i18next": "^23.7.16",
|
||||
"babel-preset-expo": "^56.0.17",
|
||||
"expo": "^56.0.15",
|
||||
"expo-asset": "~56.0.19",
|
||||
"expo-blur": "~56.0.3",
|
||||
"expo-build-properties": "~56.0.22",
|
||||
"expo-checkbox": "^56.0.1",
|
||||
"expo-constants": "~56.0.20",
|
||||
"expo-dev-client": "~56.0.22",
|
||||
"expo-device": "~56.0.4",
|
||||
"expo-file-system": "^56.0.8",
|
||||
"expo-font": "~56.0.7",
|
||||
"expo-haptics": "~56.0.3",
|
||||
"expo-image": "^56.0.11",
|
||||
"expo-linear-gradient": "^56.0.4",
|
||||
"expo-linking": "~56.0.15",
|
||||
"expo-router": "~56.2.14",
|
||||
"expo-screen-orientation": "~56.0.5",
|
||||
"expo-splash-screen": "~56.0.12",
|
||||
"expo-status-bar": "~56.0.4",
|
||||
"expo-system-ui": "~56.0.5",
|
||||
"expo-web-browser": "~56.0.5",
|
||||
"i18next": "^26.0.8",
|
||||
"iconsax-react-nativejs": "^0.0.8",
|
||||
"infinite-controls": "workspace:^",
|
||||
"intl-pluralrules": "^2.0.1",
|
||||
"jotai": "^2.12.5",
|
||||
"lodash": "^4.17.21",
|
||||
"jotai": "2.20.2",
|
||||
"models": "workspace:^",
|
||||
"react": "19.1.0",
|
||||
"react-hook-form": "^7.58.0",
|
||||
"react-i18next": "^12.2.2",
|
||||
"react-native": "0.81.4",
|
||||
"react": "19.2.3",
|
||||
"react-hook-form": "^7.75.0",
|
||||
"react-i18next": "^17.0.6",
|
||||
"react-native": "0.85.3",
|
||||
"react-native-awesome-slider": "^2.9.0",
|
||||
"react-native-blurhash": "patch:react-native-blurhash@npm%3A2.1.1#~/.yarn/patches/react-native-blurhash-npm-2.1.1-baca87b7fa.patch",
|
||||
"react-native-base64": "^0.2.2",
|
||||
"react-native-draggable-flatlist": "^4.0.3",
|
||||
"react-native-edge-to-edge": "^1.6.1",
|
||||
"react-native-gesture-handler": "~2.28.0",
|
||||
"react-native-keyboard-controller": "1.18.5",
|
||||
"react-native-mmkv": "4.0.0-beta.12",
|
||||
"react-native-nitro-modules": "0.30.1",
|
||||
"react-native-reanimated": "~4.1.1",
|
||||
"react-native-safe-area-context": "~5.6.0",
|
||||
"react-native-screens": "~4.16.0",
|
||||
"react-native-svg": "15.12.1",
|
||||
"react-native-edge-to-edge": "^1.8.1",
|
||||
"react-native-gesture-handler": "~2.31.2",
|
||||
"react-native-keyboard-controller": "1.22.2",
|
||||
"react-native-media-notification": "0.5.0-beta.6",
|
||||
"react-native-mmkv": "4.3.2",
|
||||
"react-native-nitro-modules": "0.36.4",
|
||||
"react-native-reanimated": "~4.5.1",
|
||||
"react-native-safe-area-context": "~5.8.0",
|
||||
"react-native-screens": "~4.26.2",
|
||||
"react-native-svg": "15.15.5",
|
||||
"react-native-toast-message": "^2.3.3",
|
||||
"react-native-unistyles": "3.0.15",
|
||||
"react-native-uuid": "^2.0.3",
|
||||
"react-native-video": "^7.0.0-alpha.7",
|
||||
"react-native-worklets": "^0.5.1",
|
||||
"react-native-unistyles": "3.3.0",
|
||||
"react-native-uuid": "^2.0.4",
|
||||
"react-native-video": "^7.0.0-beta.10",
|
||||
"react-native-worklets": "^0.10.1",
|
||||
"state": "workspace:^",
|
||||
"type-fest": "^4.33.0",
|
||||
"type-fest": "^5.6.0",
|
||||
"ui": "workspace:^",
|
||||
"utils": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@types/lodash": "^4",
|
||||
"@babel/core": "^7.29.7",
|
||||
"@expo/ngrok": "^4.1.3",
|
||||
"@types/react": "~19.1.10",
|
||||
"typescript": "~5.9.2"
|
||||
"@types/react-native-base64": "^0",
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"packageManager": "yarn@4.4.0"
|
||||
"packageManager": "yarn@4.17.1"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import type { ConfigPlugin } from "@expo/config-plugins";
|
||||
import { getMainApplicationOrThrow } from "@expo/config-plugins/build/android/Manifest";
|
||||
import { withAndroidManifest } from "@expo/config-plugins/build/plugins/android-plugins";
|
||||
|
||||
const withMediaServicePlugin: ConfigPlugin = (oldConfig) => {
|
||||
return withAndroidManifest(oldConfig, (config) => {
|
||||
const mainApplication = getMainApplicationOrThrow(config.modResults);
|
||||
mainApplication.service ??= [];
|
||||
mainApplication.service.push({
|
||||
$: {
|
||||
"android:name":
|
||||
"com.twg.video.core.services.playback.VideoPlaybackService",
|
||||
"android:exported": "false",
|
||||
"android:foregroundServiceType": "mediaPlayback",
|
||||
},
|
||||
"intent-filter": [
|
||||
{
|
||||
action: [
|
||||
{
|
||||
$: {
|
||||
"android:name":
|
||||
"androidx.media3.session.MediaSessionService",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
return config;
|
||||
});
|
||||
};
|
||||
|
||||
export default withMediaServicePlugin;
|
||||
@@ -2,9 +2,11 @@ import { BottomSheetFlatList, useBottomSheetModal } from "@gorhom/bottom-sheet";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Alert } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import type { AddToPlaylistPayload } from "@/api";
|
||||
import { getPlaylists } from "@/api/queries";
|
||||
import { getPlaylists, isSongInPlaylist } from "@/api/queries";
|
||||
import type { PlaylistWithRelations } from "@/models/playlist";
|
||||
import { AddIcon, PlaylistIcon } from "@/ui/icons";
|
||||
import { generateArray } from "@/utils/gen-list";
|
||||
import { useQuery, useQueryClient } from "~/api";
|
||||
@@ -38,6 +40,8 @@ export const useAddToPlaylistAction = (
|
||||
};
|
||||
};
|
||||
|
||||
type PlaylistItemType = PlaylistWithRelations<"illustration">;
|
||||
|
||||
const ChoosePlaylistModal = ({
|
||||
payload,
|
||||
}: {
|
||||
@@ -45,24 +49,53 @@ const ChoosePlaylistModal = ({
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { dismiss } = useBottomSheetModal();
|
||||
const submit = (playlistId: number) => {
|
||||
queryClient.api
|
||||
.addToPlaylist(payload, playlistId)
|
||||
.then(() => {
|
||||
showSuccessToast({
|
||||
text: t("toasts.playlist.addedToPlaylist"),
|
||||
});
|
||||
dismiss();
|
||||
queryClient.client.invalidateQueries({
|
||||
queryKey: ["playlists"],
|
||||
});
|
||||
})
|
||||
.catch((e) =>
|
||||
showErrorToast({
|
||||
text: t(e.message ?? e.error ?? JSON.stringify(e)),
|
||||
}),
|
||||
);
|
||||
};
|
||||
const addToPlaylist = useMutation({
|
||||
mutationFn: (playlistId: number) =>
|
||||
queryClient.api
|
||||
.addToPlaylist(payload, playlistId)
|
||||
.then(() => {
|
||||
showSuccessToast({
|
||||
text: t("toasts.playlist.addedToPlaylist"),
|
||||
});
|
||||
dismiss();
|
||||
queryClient.client.invalidateQueries({
|
||||
queryKey: ["playlists"],
|
||||
});
|
||||
})
|
||||
.catch((e) =>
|
||||
showErrorToast({
|
||||
text: t(e.message ?? e.error ?? JSON.stringify(e)),
|
||||
}),
|
||||
),
|
||||
mutationFn: async (playlistId: number) => {
|
||||
if (payload.songId) {
|
||||
const songIsInPlaylist = await isSongInPlaylist(
|
||||
payload.songId,
|
||||
playlistId,
|
||||
).exec(queryClient.api)();
|
||||
if (songIsInPlaylist) {
|
||||
Alert.alert(
|
||||
t("actions.warningModalTitle"),
|
||||
t("actions.addToPlaylist.duplicateWarning"),
|
||||
[
|
||||
{
|
||||
text: t("form.cancel"),
|
||||
onPress: () => {},
|
||||
style: "cancel",
|
||||
},
|
||||
{
|
||||
text: t("actions.addToPlaylist.label"),
|
||||
onPress: () => submit(playlistId),
|
||||
style: "default",
|
||||
},
|
||||
],
|
||||
);
|
||||
} else {
|
||||
submit(playlistId);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
const { openFormModal } = useCreatePlaylistFormModal(undefined, (p) =>
|
||||
addToPlaylist.mutate(p.id),
|
||||
@@ -77,6 +110,7 @@ const ChoosePlaylistModal = ({
|
||||
};
|
||||
});
|
||||
const queryClient = useQueryClient();
|
||||
const items: PlaylistItemType[] | undefined = playlists?.items;
|
||||
return (
|
||||
<BottomSheetFlatList
|
||||
style={styles.root}
|
||||
@@ -85,7 +119,7 @@ const ChoosePlaylistModal = ({
|
||||
<>
|
||||
<Text
|
||||
content={t("actions.addToPlaylist.modalTitle")}
|
||||
variant="h4"
|
||||
variant="secondaryTitle"
|
||||
/>
|
||||
<ListItem
|
||||
title={t("actions.new")}
|
||||
@@ -97,8 +131,12 @@ const ChoosePlaylistModal = ({
|
||||
<Divider h />
|
||||
</>
|
||||
}
|
||||
data={playlists?.items ?? generateArray(3)}
|
||||
renderItem={({ item: playlist }) => (
|
||||
data={items ?? generateArray(1, undefined)}
|
||||
renderItem={({
|
||||
item: playlist,
|
||||
}: {
|
||||
item: PlaylistItemType | undefined;
|
||||
}) => (
|
||||
<PlaylistItem
|
||||
playlist={playlist}
|
||||
onPress={() =>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Href } from "expo-router";
|
||||
import i18next from "i18next";
|
||||
import type { QueryClient } from "@/api/hook";
|
||||
import { getReleaseTracklist } from "@/api/queries";
|
||||
import { transformPage } from "@/api/query";
|
||||
@@ -24,16 +25,22 @@ import {
|
||||
SongIcon,
|
||||
VideoIcon,
|
||||
} from "@/ui/icons";
|
||||
import { showSuccessToast } from "~/primitives/toast";
|
||||
export type Action = {
|
||||
icon: IconType;
|
||||
icon?: IconType;
|
||||
label: TranslationKey;
|
||||
subtitle?: string;
|
||||
onPress?: () => void;
|
||||
href?: Href;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
export const GoToArtist = (artistId: string | number): Action => ({
|
||||
export const GoToArtist = (
|
||||
artistId: string | number,
|
||||
artistName?: string,
|
||||
): Action => ({
|
||||
label: "actions.goToArtist",
|
||||
subtitle: artistName,
|
||||
icon: ArtistIcon,
|
||||
href: `/artists/${artistId}`,
|
||||
});
|
||||
@@ -72,13 +79,27 @@ export const Play = (track: TrackState): Action => ({
|
||||
export const PlayNext = (track: TrackState): Action => ({
|
||||
label: "actions.playback.playNext",
|
||||
icon: PlayNextIcon,
|
||||
onPress: () => store.set(playNextAtom, track),
|
||||
onPress: () => {
|
||||
store.set(playNextAtom, track);
|
||||
showSuccessToast({
|
||||
text: i18next.t("toasts.willPlayNext", {
|
||||
songName: track.track.name,
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export const PlayAfter = (track: TrackState): Action => ({
|
||||
label: "actions.playback.playAfter",
|
||||
icon: PlayAfterIcon,
|
||||
onPress: () => store.set(playAfterAtom, track),
|
||||
onPress: () => {
|
||||
store.set(playAfterAtom, track);
|
||||
showSuccessToast({
|
||||
text: i18next.t("toasts.willPlayAfter", {
|
||||
songName: track.track.name,
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export const PlayReleaseAction = (
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
import { useAtomValue } from "jotai";
|
||||
import { useMemo } from "react";
|
||||
import API from "@/api";
|
||||
import {
|
||||
mkUseInfiniteQuery,
|
||||
@@ -31,10 +32,13 @@ import { currentInstanceAtom } from "./state/user";
|
||||
|
||||
export const useAPI = () => {
|
||||
const currentInstance = useAtomValue(currentInstanceAtom);
|
||||
return getAPI_(
|
||||
currentInstance?.accessToken ?? null,
|
||||
currentInstance?.url ?? "",
|
||||
);
|
||||
const api = useMemo(() => {
|
||||
return getAPI_(
|
||||
currentInstance?.accessToken ?? null,
|
||||
currentInstance?.url ?? "",
|
||||
);
|
||||
}, [currentInstance]);
|
||||
return api;
|
||||
};
|
||||
|
||||
// Get API instance using atom to resolve access token
|
||||
@@ -68,7 +72,7 @@ export const useQuery = <
|
||||
query: QueryFn<ReturnType, Transformed, Params>,
|
||||
...queryParams: Partial<Params>
|
||||
) => {
|
||||
return mkUseQuery(getAPI, query, ...queryParams);
|
||||
return mkUseQuery(useAPI, query, ...queryParams);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -96,4 +100,4 @@ export const useInfiniteQuery = <
|
||||
return mkUseInfiniteQuery(useAPI, query, ...queryParams);
|
||||
};
|
||||
|
||||
export const useQueryClient = () => mkUseQueryClient(getAPI);
|
||||
export const useQueryClient = () => mkUseQueryClient(useAPI);
|
||||
@@ -8,95 +8,134 @@ import {
|
||||
ArtistIcon,
|
||||
CompilationIcon,
|
||||
GenreIcon,
|
||||
HistoryIcon,
|
||||
type Icon,
|
||||
LabelIcon,
|
||||
MoreIcon,
|
||||
PlaylistIcon,
|
||||
SongIcon,
|
||||
VideoIcon,
|
||||
} from "@/ui/icons";
|
||||
import { StaticHeader, useIosLargeTitle } from "~/components/header";
|
||||
import { ListItem } from "~/components/item/list-item";
|
||||
import { SafeView } from "~/components/safe-view";
|
||||
import { SafeFlashList } from "~/components/safe-view";
|
||||
import { Divider } from "~/primitives/divider";
|
||||
import { Icon as IconComponent } from "~/primitives/icon";
|
||||
|
||||
const tabs: { title: TranslationKey; href: Href; icon: Icon }[] = [
|
||||
{
|
||||
title: "models.artist_plural",
|
||||
href: "/(protected)/(nav)/(browse)/artists",
|
||||
icon: ArtistIcon,
|
||||
},
|
||||
{
|
||||
title: "models.album_plural",
|
||||
href: "/(protected)/(nav)/(browse)/albums",
|
||||
icon: AlbumIcon,
|
||||
},
|
||||
const TabGroups: { title: TranslationKey; href: Href; icon: Icon }[][] = [
|
||||
[
|
||||
{
|
||||
title: "models.artist_plural",
|
||||
href: "/(protected)/(nav)/(browse)/artists",
|
||||
icon: ArtistIcon,
|
||||
},
|
||||
{
|
||||
title: "models.album_plural",
|
||||
href: "/(protected)/(nav)/(browse)/albums",
|
||||
icon: AlbumIcon,
|
||||
},
|
||||
|
||||
{
|
||||
title: "models.song_plural",
|
||||
href: "/(protected)/(nav)/(browse)/songs",
|
||||
icon: SongIcon,
|
||||
},
|
||||
{
|
||||
title: "models.song_plural",
|
||||
href: "/(protected)/(nav)/(browse)/songs",
|
||||
icon: SongIcon,
|
||||
},
|
||||
|
||||
{
|
||||
title: "models.video_plural",
|
||||
href: "/(protected)/(nav)/(browse)/videos",
|
||||
icon: VideoIcon,
|
||||
},
|
||||
{
|
||||
title: "nav.compilations",
|
||||
href: "/(protected)/(nav)/(browse)/albums?compilations=true",
|
||||
icon: CompilationIcon,
|
||||
},
|
||||
{
|
||||
title: "models.video_plural",
|
||||
href: "/(protected)/(nav)/(browse)/videos",
|
||||
icon: VideoIcon,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
title: "nav.compilations",
|
||||
href: "/(protected)/(nav)/(browse)/albums?compilations=true",
|
||||
icon: CompilationIcon,
|
||||
},
|
||||
{
|
||||
title: "models.playlist_plural",
|
||||
href: "/(protected)/(nav)/(browse)/playlists",
|
||||
icon: PlaylistIcon,
|
||||
},
|
||||
],
|
||||
|
||||
{
|
||||
title: "models.playlist_plural",
|
||||
href: "/(protected)/(nav)/(browse)/playlists",
|
||||
icon: PlaylistIcon,
|
||||
},
|
||||
[
|
||||
{
|
||||
title: "models.genre_plural",
|
||||
href: "/(protected)/(nav)/(browse)/genres",
|
||||
icon: GenreIcon,
|
||||
},
|
||||
|
||||
{
|
||||
title: "models.genre_plural",
|
||||
href: "/(protected)/(nav)/(browse)/genres",
|
||||
icon: GenreIcon,
|
||||
},
|
||||
{
|
||||
title: "models.label_plural",
|
||||
href: "/(protected)/(nav)/(browse)/labels",
|
||||
icon: LabelIcon,
|
||||
},
|
||||
],
|
||||
|
||||
[
|
||||
{
|
||||
title: "home.playHistory",
|
||||
href: "/(protected)/(nav)/(browse)/songs?playHistory=true",
|
||||
icon: HistoryIcon,
|
||||
},
|
||||
],
|
||||
];
|
||||
|
||||
export default function BrowseList() {
|
||||
const router = useRouter();
|
||||
const { t } = useTranslation();
|
||||
const { screenOptions, flashlistOptions } = useIosLargeTitle();
|
||||
return (
|
||||
<SafeView style={[styles.root]}>
|
||||
{tabs.map(({ title, href, icon }) => (
|
||||
<Fragment key={title}>
|
||||
<ListItem
|
||||
leading={
|
||||
<View style={styles.icon}>
|
||||
<IconComponent icon={icon} />
|
||||
</View>
|
||||
}
|
||||
title={t(title)}
|
||||
subtitle={null}
|
||||
onPress={() => router.navigate(href)}
|
||||
/>
|
||||
<Divider h withInsets />
|
||||
</Fragment>
|
||||
))}
|
||||
</SafeView>
|
||||
<StaticHeader options={screenOptions}>
|
||||
<SafeFlashList
|
||||
{...flashlistOptions}
|
||||
data={TabGroups}
|
||||
contentContainerStyle={[styles.root]}
|
||||
renderItem={({ item: group }) => (
|
||||
<>
|
||||
{group.map(({ title, href, icon }) => (
|
||||
<Fragment key={title}>
|
||||
<ListItem
|
||||
leading={
|
||||
<View
|
||||
style={styles.leadingIconContainer}
|
||||
>
|
||||
<IconComponent icon={icon} />
|
||||
</View>
|
||||
}
|
||||
title={t(title)}
|
||||
subtitle={null}
|
||||
trailing={
|
||||
<MoreIcon style={styles.trailingIcon} />
|
||||
}
|
||||
onPress={() => router.navigate(href)}
|
||||
/>
|
||||
<Divider h withInsets />
|
||||
</Fragment>
|
||||
))}
|
||||
<Divider h withInsets />
|
||||
</>
|
||||
)}
|
||||
ItemSeparatorComponent={() => <Divider h withInsets />}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
root: {
|
||||
padding: theme.gap(0.5),
|
||||
display: "flex",
|
||||
height: "100%",
|
||||
alignItems: "flex-start",
|
||||
justifyContent: "flex-start",
|
||||
},
|
||||
icon: {
|
||||
leadingIconContainer: {
|
||||
height: "100%",
|
||||
backgroundColor: theme.colors.skeleton,
|
||||
borderRadius: theme.borderRadius,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
trailingIcon: {
|
||||
color: theme.colors.text.primary,
|
||||
},
|
||||
}));
|
||||
@@ -17,47 +17,55 @@
|
||||
*/
|
||||
|
||||
import { FlashList, type FlashListProps } from "@shopify/flash-list";
|
||||
import { useCallback } from "react";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import {
|
||||
getAlbums,
|
||||
getArtists,
|
||||
getCurrentUserStatus,
|
||||
getGenres,
|
||||
getLabels,
|
||||
getReleases,
|
||||
getSongs,
|
||||
} from "@/api/queries";
|
||||
import type { AlbumSortingKey, AlbumWithRelations } from "@/models/album";
|
||||
import type { ArtistSortingKey, ArtistWithRelations } from "@/models/artist";
|
||||
import type Genre from "@/models/genre";
|
||||
import type { SongSortingKey } from "@/models/song";
|
||||
import { EmptyStateIcon } from "@/ui/icons";
|
||||
import { generateArray } from "@/utils/gen-list";
|
||||
import { useInfiniteQuery } from "~/api";
|
||||
import { useInfiniteQuery, useQuery } from "~/api";
|
||||
import { useSetKeyIllustration } from "~/components/background-gradient";
|
||||
import { EmptyState } from "~/components/empty-state";
|
||||
import { GoToWebSettingsButton } from "~/components/go-to-web";
|
||||
import { StaticHeader, useIosLargeTitle } from "~/components/header";
|
||||
import { AlbumTile } from "~/components/item/resource/album";
|
||||
import { ArtistTile } from "~/components/item/resource/artist";
|
||||
import { GenreChip } from "~/components/item/resource/genre";
|
||||
import { LabelChip } from "~/components/item/resource/label";
|
||||
import ReleaseTile from "~/components/item/resource/release";
|
||||
import { Row, type RowProps } from "~/components/row";
|
||||
import { SafeFlashList } from "~/components/safe-view";
|
||||
import { SafeFlashList, SafeView } from "~/components/safe-view";
|
||||
import { SongGrid, type SongGridProps } from "~/components/song-grid";
|
||||
import { Text } from "~/primitives/text";
|
||||
import type { Sorting } from "~/utils/sorting";
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
main: { gap: theme.gap(2) },
|
||||
lastSection: {
|
||||
paddingBottom: theme.gap(1),
|
||||
main: { paddingTop: theme.gap(3) },
|
||||
section: { paddingBottom: theme.gap(2) },
|
||||
emptyState: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
paddingHorizontal: theme.gap(1),
|
||||
},
|
||||
title: { paddingLeft: theme.gap(2) },
|
||||
genreRow: {
|
||||
chipRow: {
|
||||
alignItems: "center",
|
||||
paddingHorizontal: theme.gap(2),
|
||||
paddingVertical: theme.gap(1),
|
||||
marginBottom: theme.gap(1),
|
||||
},
|
||||
genreChip: {
|
||||
chip: {
|
||||
paddingLeft: theme.gap(1.5),
|
||||
alignItems: "center",
|
||||
},
|
||||
@@ -65,7 +73,7 @@ const styles = StyleSheet.create((theme) => ({
|
||||
|
||||
type HomePageSection =
|
||||
| { type: "tileRow"; props: RowProps<any> }
|
||||
| { type: "genreRow"; props: FlashListProps<Genre | undefined> }
|
||||
| { type: "chipRow"; props: FlashListProps<any | undefined> }
|
||||
| { type: "songGrid"; props: SongGridProps };
|
||||
|
||||
const renderHomePageSection = (s: HomePageSection) => {
|
||||
@@ -74,17 +82,30 @@ const renderHomePageSection = (s: HomePageSection) => {
|
||||
return <SongGrid {...s.props} />;
|
||||
case "tileRow":
|
||||
return <Row {...s.props} />;
|
||||
case "genreRow":
|
||||
case "chipRow":
|
||||
return <FlashList {...s.props} />;
|
||||
}
|
||||
};
|
||||
|
||||
const filterSections = (ss: HomePageSection[]) =>
|
||||
ss.filter((s) => {
|
||||
switch (s.type) {
|
||||
case "songGrid":
|
||||
return s.props.songs?.length !== 0;
|
||||
case "tileRow":
|
||||
return s.props.items?.length !== 0;
|
||||
case "chipRow":
|
||||
return s.props.data?.length !== 0;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
export default function Root() {
|
||||
const { t } = useTranslation();
|
||||
const newlyAddedAlbums = useInfiniteQuery(() =>
|
||||
getAlbums({}, { sortBy: "addDate", order: "desc" }, [
|
||||
"illustration",
|
||||
"artist",
|
||||
"artists",
|
||||
]),
|
||||
);
|
||||
const newlyAddedArtists = useInfiniteQuery(() =>
|
||||
@@ -94,21 +115,26 @@ export default function Root() {
|
||||
const latestAlbums = useInfiniteQuery(() =>
|
||||
getAlbums({}, { sortBy: "releaseDate", order: "desc" }, [
|
||||
"illustration",
|
||||
"artist",
|
||||
"artists",
|
||||
]),
|
||||
);
|
||||
|
||||
const newlyAddedReleases = useInfiniteQuery(() =>
|
||||
getReleases({}, { sortBy: "addDate", order: "desc" }, [
|
||||
"illustration",
|
||||
"album",
|
||||
]),
|
||||
getReleases(
|
||||
{ isFirstRegistered: false },
|
||||
{ sortBy: "addDate", order: "desc" },
|
||||
["illustration", "album"],
|
||||
),
|
||||
);
|
||||
|
||||
const topGenres = useInfiniteQuery(() =>
|
||||
getGenres({}, { sortBy: "songCount", order: "desc" }),
|
||||
);
|
||||
|
||||
const topLabels = useInfiniteQuery(() =>
|
||||
getLabels({}, { sortBy: "albumCount", order: "desc" }, ["area"]),
|
||||
);
|
||||
|
||||
useSetKeyIllustration(newlyAddedAlbums.items?.at(0));
|
||||
const topSongs = useInfiniteQuery(() =>
|
||||
getSongs({}, { sortBy: "userPlayCount", order: "desc" }, [
|
||||
@@ -118,27 +144,30 @@ export default function Root() {
|
||||
"illustration",
|
||||
]),
|
||||
);
|
||||
const queries = [
|
||||
newlyAddedAlbums,
|
||||
newlyAddedArtists,
|
||||
latestAlbums,
|
||||
topSongs,
|
||||
newlyAddedReleases,
|
||||
];
|
||||
const refresh = useCallback(
|
||||
() =>
|
||||
queries.forEach((q) => {
|
||||
q.refetch();
|
||||
}),
|
||||
[queries],
|
||||
);
|
||||
const sync = useCallback(
|
||||
<T,>(q: T) => {
|
||||
if (
|
||||
!!newlyAddedAlbums.data &&
|
||||
!!newlyAddedArtists.data &&
|
||||
!!latestAlbums.data &&
|
||||
!!topSongs.data &&
|
||||
!!newlyAddedReleases.data
|
||||
) {
|
||||
return q;
|
||||
if (queries.find((q1) => q1.data === undefined)) {
|
||||
return undefined;
|
||||
}
|
||||
return undefined;
|
||||
return q;
|
||||
},
|
||||
[
|
||||
newlyAddedAlbums.data,
|
||||
newlyAddedArtists.data,
|
||||
latestAlbums.data,
|
||||
topSongs.data,
|
||||
newlyAddedReleases.data,
|
||||
],
|
||||
[queries],
|
||||
);
|
||||
const { data: user } = useQuery(getCurrentUserStatus);
|
||||
|
||||
const sections: HomePageSection[] = [
|
||||
{
|
||||
@@ -146,6 +175,7 @@ export default function Root() {
|
||||
props: {
|
||||
header: t("home.newlyAddedAlbums"),
|
||||
items: sync(newlyAddedAlbums.items),
|
||||
hideIfEmpty: true,
|
||||
render: (album) => {
|
||||
return <AlbumTile album={album} subtitle="artistName" />;
|
||||
},
|
||||
@@ -158,13 +188,16 @@ export default function Root() {
|
||||
} satisfies Sorting<AlbumSortingKey>,
|
||||
}
|
||||
: undefined,
|
||||
} satisfies RowProps<AlbumWithRelations<"illustration" | "artist">>,
|
||||
} satisfies RowProps<
|
||||
AlbumWithRelations<"illustration" | "artists">
|
||||
>,
|
||||
},
|
||||
/* TODO Featured albums */
|
||||
{
|
||||
type: "tileRow",
|
||||
props: {
|
||||
header: t("home.newlyAddedArtists"),
|
||||
hideIfEmpty: true,
|
||||
items: sync(newlyAddedArtists.items),
|
||||
render: (artist) => {
|
||||
return <ArtistTile artist={artist} />;
|
||||
@@ -185,6 +218,7 @@ export default function Root() {
|
||||
props: {
|
||||
header: t("home.latestAlbums"),
|
||||
items: sync(latestAlbums.items),
|
||||
hideIfEmpty: true,
|
||||
render: (album) => {
|
||||
return <AlbumTile album={album} subtitle="artistName" />;
|
||||
},
|
||||
@@ -197,42 +231,92 @@ export default function Root() {
|
||||
} satisfies Sorting<AlbumSortingKey>,
|
||||
}
|
||||
: undefined,
|
||||
} satisfies RowProps<AlbumWithRelations<"illustration" | "artist">>,
|
||||
} satisfies RowProps<
|
||||
AlbumWithRelations<"illustration" | "artists">
|
||||
>,
|
||||
},
|
||||
{
|
||||
type: "tileRow",
|
||||
props: {
|
||||
header: t("home.newlyAddedReleases"),
|
||||
items: sync(newlyAddedReleases.items),
|
||||
hideIfEmpty: true,
|
||||
render: (release) => {
|
||||
return <ReleaseTile release={release} />;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "genreRow",
|
||||
props: {
|
||||
horizontal: true,
|
||||
data: topGenres.items ?? generateArray(3, undefined),
|
||||
|
||||
ListHeaderComponent: (
|
||||
<Text content={t("home.topGenres")} variant="h4" />
|
||||
),
|
||||
CellRendererComponent: (props) => {
|
||||
return (
|
||||
<View
|
||||
{...props}
|
||||
style={[styles.genreChip, props.style]}
|
||||
/>
|
||||
);
|
||||
},
|
||||
renderItem: ({ item: genre, index }) => (
|
||||
<GenreChip genre={genre} key={genre?.slug ?? index} />
|
||||
),
|
||||
...(topLabels.items?.length
|
||||
? [
|
||||
{
|
||||
type: "chipRow",
|
||||
props: {
|
||||
horizontal: true,
|
||||
data:
|
||||
topGenres.items ?? generateArray(1, undefined),
|
||||
ListHeaderComponent: (
|
||||
<Text
|
||||
content={t("home.topGenres")}
|
||||
variant="secondaryTitle"
|
||||
/>
|
||||
),
|
||||
CellRendererComponent: (props) => {
|
||||
return (
|
||||
<View
|
||||
{...props}
|
||||
style={[styles.chip, props.style]}
|
||||
/>
|
||||
);
|
||||
},
|
||||
renderItem: ({ item: genre, index }) => (
|
||||
<GenreChip
|
||||
genre={genre}
|
||||
key={genre?.slug ?? index}
|
||||
/>
|
||||
),
|
||||
|
||||
contentContainerStyle: styles.genreRow,
|
||||
},
|
||||
},
|
||||
contentContainerStyle: styles.chipRow,
|
||||
},
|
||||
} satisfies HomePageSection,
|
||||
]
|
||||
: []),
|
||||
|
||||
...(topLabels.items?.length
|
||||
? [
|
||||
{
|
||||
type: "chipRow",
|
||||
props: {
|
||||
horizontal: true,
|
||||
data:
|
||||
topLabels.items ?? generateArray(1, undefined),
|
||||
|
||||
ListHeaderComponent: (
|
||||
<Text
|
||||
content={t("home.topLabels")}
|
||||
variant="secondaryTitle"
|
||||
/>
|
||||
),
|
||||
CellRendererComponent: (props) => {
|
||||
return (
|
||||
<View
|
||||
{...props}
|
||||
style={[styles.chip, props.style]}
|
||||
/>
|
||||
);
|
||||
},
|
||||
renderItem: ({ item: label, index }) => (
|
||||
<LabelChip
|
||||
label={label}
|
||||
key={label?.slug ?? index}
|
||||
/>
|
||||
),
|
||||
|
||||
contentContainerStyle: styles.chipRow,
|
||||
},
|
||||
} satisfies HomePageSection,
|
||||
]
|
||||
: []),
|
||||
{
|
||||
type: "songGrid",
|
||||
props: {
|
||||
@@ -249,16 +333,41 @@ export default function Root() {
|
||||
header: t("home.mostPlayedSongs"),
|
||||
songs: sync(topSongs.data?.pages.at(0)?.items),
|
||||
subtitle: () => "artists",
|
||||
style: styles.lastSection,
|
||||
},
|
||||
},
|
||||
];
|
||||
const isEmpty = useMemo(() => {
|
||||
return queries.every((q) => q.data?.pages.at(0)?.items.length === 0);
|
||||
}, [queries]);
|
||||
const { screenOptions, flashlistOptions } = useIosLargeTitle();
|
||||
return (
|
||||
<SafeFlashList
|
||||
data={sections}
|
||||
getItemType={(t) => t.type}
|
||||
renderItem={({ item }) => renderHomePageSection(item)}
|
||||
contentContainerStyle={[styles.main]}
|
||||
/>
|
||||
<StaticHeader options={screenOptions}>
|
||||
{(scrollRef) =>
|
||||
isEmpty ? (
|
||||
<SafeView style={[styles.main, styles.emptyState]}>
|
||||
<EmptyState
|
||||
icon={EmptyStateIcon}
|
||||
text="emptyState.home"
|
||||
/>
|
||||
{user?.admin && <GoToWebSettingsButton />}
|
||||
</SafeView>
|
||||
) : (
|
||||
<SafeFlashList
|
||||
{...flashlistOptions}
|
||||
ref={scrollRef}
|
||||
data={filterSections(sections)}
|
||||
refreshing={!!queries.find((q) => q.isRefetching)}
|
||||
onRefresh={refresh}
|
||||
getItemType={(t) => t.type}
|
||||
renderItem={({ item }) => (
|
||||
<View style={styles.section}>
|
||||
{renderHomePageSection(item)}
|
||||
</View>
|
||||
)}
|
||||
contentContainerStyle={[styles.main]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Stack } from "expo-router";
|
||||
import { type ComponentProps, useMemo } from "react";
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { Platform } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import { Icon as MeeloIcon } from "~/components/meelo";
|
||||
import { BackButton, HeaderBackground } from "~/components/navigation";
|
||||
import { useScreenOptions } from "~/utils/screen-options";
|
||||
|
||||
export const unstable_settings = {
|
||||
home: {
|
||||
@@ -21,6 +21,7 @@ const SharedRoutes: {
|
||||
{ name: "albums/index", options: { headerTitle: "models.album_plural" } },
|
||||
{ name: "songs/index", options: { headerTitle: "models.song_plural" } },
|
||||
{ name: "genres", options: { headerTitle: "models.genre_plural" } },
|
||||
{ name: "labels", options: { headerTitle: "models.label_plural" } },
|
||||
{ name: "videos/index", options: { headerTitle: "models.video_plural" } },
|
||||
{ name: "tracks/index", options: { headerTitle: "models.track_plural" } },
|
||||
{
|
||||
@@ -35,26 +36,17 @@ const SharedRoutes: {
|
||||
|
||||
export default function Layout({ segment }: { segment: string }) {
|
||||
const { t } = useTranslation();
|
||||
// Cant memo-ise this, we need this to be updated when theme changes
|
||||
const screenOptions = {
|
||||
animation: "none", //TODO slide_from_right without flicker
|
||||
animationTypeForReplace: "pop",
|
||||
freezeOnBlur: true,
|
||||
contentStyle: [styles.screen],
|
||||
// headerStyle: styles.header,
|
||||
headerTitleStyle: styles.headerTitle,
|
||||
headerLeft: () => <BackButton />,
|
||||
headerBackground: () => <HeaderBackground />,
|
||||
headerTransparent: true,
|
||||
headerTintColor: styles.headerTitle.color,
|
||||
} satisfies ComponentProps<typeof Stack>["screenOptions"];
|
||||
const screenOptions = useScreenOptions();
|
||||
const screenProps = useMemo(() => {
|
||||
switch (segment) {
|
||||
case "(home)": {
|
||||
return {
|
||||
options: {
|
||||
headerTitle: t("nav.home"),
|
||||
headerLeft: () => <MeeloIcon style={styles.icon} />,
|
||||
headerLeft:
|
||||
Platform.OS !== "ios"
|
||||
? () => <MeeloIcon style={styles.icon} />
|
||||
: () => null,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -63,7 +55,7 @@ export default function Layout({ segment }: { segment: string }) {
|
||||
options: {
|
||||
headerTitle: t("nav.browse"),
|
||||
// TODO IDK why we canGoBack when we are at the browse's index
|
||||
headerLeft: () => <View />,
|
||||
headerLeft: () => null,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -72,7 +64,7 @@ export default function Layout({ segment }: { segment: string }) {
|
||||
options: {
|
||||
headerTitle: t("nav.search"),
|
||||
// TODO IDK why we canGoBack when we are at the browse's index
|
||||
headerLeft: () => <View />,
|
||||
headerLeft: () => null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,12 +16,15 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Stack, useLocalSearchParams } from "expo-router";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getAlbums, getArtist, getGenre, getLabel } from "@/api/queries";
|
||||
import { AlbumSortingKeys, AlbumType } from "@/models/album";
|
||||
import { albumTypeToTranslationKey } from "@/models/utils";
|
||||
import { useQuery } from "~/api";
|
||||
import { CoverflowIcon } from "@/ui/icons";
|
||||
import { useInfiniteQuery, useQuery } from "~/api";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import {
|
||||
useLibraryFiltersControl,
|
||||
useTypeFiltersControl,
|
||||
@@ -31,6 +34,7 @@ import { useSortControl } from "~/components/infinite/controls/sort";
|
||||
import { InfiniteView } from "~/components/infinite/view";
|
||||
import { AlbumItem, AlbumTile } from "~/components/item/resource/album";
|
||||
import { ArtistHeader } from "~/components/resource-header";
|
||||
import { coverflowQueryAtom } from "~/state/coverflow";
|
||||
|
||||
export default function AlbumBrowseView() {
|
||||
const { t } = useTranslation();
|
||||
@@ -62,25 +66,37 @@ export default function AlbumBrowseView() {
|
||||
(artistId) => getArtist(artistId, ["illustration"]),
|
||||
artistId,
|
||||
);
|
||||
const setCoverflowQuery = useSetAtom(coverflowQueryAtom);
|
||||
|
||||
const { data: genre } = useQuery((genreId) => getGenre(genreId), genreId);
|
||||
const { data: label } = useQuery((labelId) => getLabel(labelId), labelId);
|
||||
const Item = layout === "list" ? AlbumItem : AlbumTile;
|
||||
const query = getAlbums(
|
||||
{
|
||||
library: libraries,
|
||||
type: types,
|
||||
artist: compilations ? "compilations" : artistId,
|
||||
genre: genreId,
|
||||
label: labelId,
|
||||
},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["artists", "illustration"],
|
||||
);
|
||||
const { items } = useInfiniteQuery(() => query);
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerTitle: genreId
|
||||
? (genre?.name ?? "")
|
||||
: labelId
|
||||
? (label?.name ?? "")
|
||||
: t(
|
||||
compilations
|
||||
? "nav.compilations"
|
||||
: "models.album_plural",
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<StaticHeader
|
||||
options={{
|
||||
headerTitle: genreId
|
||||
? (genre?.name ?? "")
|
||||
: labelId
|
||||
? (label?.name ?? "")
|
||||
: t(
|
||||
compilations
|
||||
? "nav.compilations"
|
||||
: "models.album_plural",
|
||||
),
|
||||
}}
|
||||
>
|
||||
<InfiniteView
|
||||
layout={layout}
|
||||
header={artistId ? <ArtistHeader artist={artist} /> : undefined}
|
||||
@@ -88,18 +104,16 @@ export default function AlbumBrowseView() {
|
||||
layout: layoutControl,
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl, albumTypeFilterControl],
|
||||
actions: [
|
||||
{
|
||||
icon: CoverflowIcon,
|
||||
href: "/coverflow",
|
||||
onPress: () => setCoverflowQuery(query),
|
||||
disabled: items?.length === 0,
|
||||
},
|
||||
],
|
||||
}}
|
||||
query={getAlbums(
|
||||
{
|
||||
library: libraries,
|
||||
type: types,
|
||||
artist: compilations ? "compilations" : artistId,
|
||||
genre: genreId,
|
||||
label: labelId,
|
||||
},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["artist", "illustration"],
|
||||
)}
|
||||
query={query}
|
||||
render={(album) => (
|
||||
<Item
|
||||
album={album}
|
||||
@@ -108,6 +122,6 @@ export default function AlbumBrowseView() {
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
+180
-73
@@ -1,44 +1,60 @@
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { type ComponentProps, useCallback, useMemo } from "react";
|
||||
import { type ComponentProps, Fragment, useCallback, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import {
|
||||
getAlbums,
|
||||
getArtist,
|
||||
getArtistExternalMetadata,
|
||||
getParentAreas,
|
||||
getSongs,
|
||||
getVideos,
|
||||
} from "@/api/queries";
|
||||
import type { Query } from "@/api/query";
|
||||
import {
|
||||
type AlbumSortingKey,
|
||||
AlbumType,
|
||||
type AlbumWithRelations,
|
||||
} from "@/models/album";
|
||||
import type { Area } from "@/models/area";
|
||||
import { albumTypeToTranslationKey } from "@/models/utils";
|
||||
import type { VideoSortingKey, VideoWithRelations } from "@/models/video";
|
||||
import { VideoTypeIsExtra } from "@/models/video";
|
||||
import { playTracksAtom } from "@/state/player";
|
||||
import { useInfiniteQuery, useQuery } from "~/api";
|
||||
import { useInfiniteQuery, useQueries, useQuery } from "~/api";
|
||||
import { AreaButton } from "~/components/area-button";
|
||||
import { useSetKeyIllustration } from "~/components/background-gradient";
|
||||
import {
|
||||
ExternalMetadataDescriptionSection,
|
||||
ExternalMetadataSourcesSection,
|
||||
} from "~/components/external-metadata";
|
||||
import { FadingHeader } from "~/components/header";
|
||||
import { AlbumTile } from "~/components/item/resource/album";
|
||||
import { VideoTile } from "~/components/item/resource/video";
|
||||
import { ArtistHeader } from "~/components/resource-header";
|
||||
import { Row } from "~/components/row";
|
||||
import { SafeFlashList } from "~/components/safe-view";
|
||||
import { SongGrid } from "~/components/song-grid";
|
||||
import { useQueryErrorModal } from "~/hooks/error";
|
||||
import { Text } from "~/primitives/text";
|
||||
import type { Sorting } from "~/utils/sorting";
|
||||
|
||||
const albumTypeQuery = (albumType: AlbumType, artistId: string) =>
|
||||
getAlbums(
|
||||
const albumTypeQuery = (
|
||||
albumType: AlbumType,
|
||||
artistId: string,
|
||||
): Query<AlbumWithRelations<"illustration" | "artists">[]> => {
|
||||
const { key, exec } = getAlbums(
|
||||
{ artist: artistId, type: [albumType] },
|
||||
{ sortBy: "releaseDate", order: "desc" },
|
||||
["illustration", "artist"],
|
||||
["illustration", "artists"],
|
||||
);
|
||||
return {
|
||||
key: [...key, "first-page"],
|
||||
exec: (api) => () => exec(api)({}).then(({ items }) => items),
|
||||
};
|
||||
};
|
||||
|
||||
// Note: we show the 'seeMore' button for song grids and video rows iff there's more items than ShowSeeMoreThreshold
|
||||
// since the user may want to shuffle them through the dedicated page
|
||||
@@ -48,14 +64,10 @@ const ShowSeeMoreThreshold = 3;
|
||||
type ArtistPageSection =
|
||||
| { type: "header"; props: ComponentProps<typeof ArtistHeader> }
|
||||
| { type: "songGrid"; props: ComponentProps<typeof SongGrid> }
|
||||
| {
|
||||
type: "artistAlbumRow";
|
||||
props: ComponentProps<typeof AlbumTypeRow>;
|
||||
}
|
||||
| {
|
||||
type: "albumRow";
|
||||
props: ComponentProps<
|
||||
typeof Row<AlbumWithRelations<"illustration" | "artist">>
|
||||
typeof Row<AlbumWithRelations<"illustration" | "artists">>
|
||||
>;
|
||||
}
|
||||
| {
|
||||
@@ -70,38 +82,122 @@ type ArtistPageSection =
|
||||
type: "aboutSection";
|
||||
props: ComponentProps<typeof ExternalMetadataDescriptionSection>;
|
||||
}
|
||||
| {
|
||||
type: "fromSection";
|
||||
props: ComponentProps<typeof AreaSection>;
|
||||
}
|
||||
| {
|
||||
type: "externalLinks";
|
||||
props: ComponentProps<typeof ExternalMetadataSourcesSection>;
|
||||
};
|
||||
|
||||
const AreaSection = ({ areas }: { areas: Area[] | null | undefined }) => {
|
||||
const { t } = useTranslation();
|
||||
if (!areas) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<View style={styles.areaSection}>
|
||||
<Text
|
||||
variant="itemLabel"
|
||||
style={[{ flex: 0 }, styles.areaText]}
|
||||
content={`${t("misc.from")} `}
|
||||
/>
|
||||
<View style={styles.areaListContainer}>
|
||||
{areas.map((area, index) => (
|
||||
<Fragment key={area.id}>
|
||||
<AreaButton
|
||||
area={area}
|
||||
textProps={{
|
||||
variant: "itemText",
|
||||
style: styles.areaText,
|
||||
}}
|
||||
containerProps={{ style: styles.areaButton }}
|
||||
/>
|
||||
|
||||
{index < areas.length - 1 ? (
|
||||
<Text content=", " style={styles.areaText} />
|
||||
) : null}
|
||||
</Fragment>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const renderSection = (section: ArtistPageSection) => {
|
||||
switch (section.type) {
|
||||
case "header":
|
||||
return <ArtistHeader {...section.props} />;
|
||||
case "songGrid":
|
||||
return <SongGrid {...section.props} />;
|
||||
case "artistAlbumRow":
|
||||
return <AlbumTypeRow {...section.props} />;
|
||||
case "albumRow":
|
||||
return <Row {...section.props} />;
|
||||
case "videoRow":
|
||||
return <Row {...section.props} />;
|
||||
case "aboutSection":
|
||||
return <ExternalMetadataDescriptionSection {...section.props} />;
|
||||
case "fromSection":
|
||||
return <AreaSection {...section.props} />;
|
||||
case "externalLinks":
|
||||
return <ExternalMetadataSourcesSection {...section.props} />;
|
||||
}
|
||||
};
|
||||
|
||||
const filterSections = (sections: ArtistPageSection[]): ArtistPageSection[] => {
|
||||
return sections.filter((section) => {
|
||||
switch (section.type) {
|
||||
case "header":
|
||||
return true;
|
||||
case "songGrid":
|
||||
return section.props.songs?.length !== 0;
|
||||
case "albumRow":
|
||||
return section.props.items?.length !== 0;
|
||||
case "videoRow":
|
||||
return section.props.items?.length !== 0;
|
||||
case "aboutSection":
|
||||
return section.props.externalMetadata !== null;
|
||||
case "fromSection":
|
||||
return section.props.areas !== null;
|
||||
case "externalLinks":
|
||||
return section.props.externalMetadata?.sources.length !== 0;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
export default function ArtistView() {
|
||||
const playTracks = useSetAtom(playTracksAtom);
|
||||
const { id: artistId } = useLocalSearchParams<{ id: string }>();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data: artist } = useQuery(() =>
|
||||
getArtist(artistId, ["illustration"]),
|
||||
const artistQuery = useQuery(() =>
|
||||
getArtist(artistId, ["illustration", "birthArea", "activityArea"]),
|
||||
);
|
||||
const { data: artist } = artistQuery;
|
||||
const area = artist ? (artist.birthArea ?? artist.activityArea) : undefined;
|
||||
const { data: parentAreas } = useQuery(getParentAreas, area?.id);
|
||||
const albumTypeQueries = useQueries(
|
||||
...AlbumType.map(
|
||||
(
|
||||
type,
|
||||
): Parameters<
|
||||
typeof useQuery<
|
||||
AlbumWithRelations<"illustration" | "artists">[],
|
||||
[]
|
||||
>
|
||||
> => [() => albumTypeQuery(type, artistId)],
|
||||
),
|
||||
);
|
||||
const areas = useMemo(() => {
|
||||
if (!area) {
|
||||
return area;
|
||||
}
|
||||
if (parentAreas === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return [area, ...parentAreas];
|
||||
}, [area, parentAreas]);
|
||||
const topSongs = useInfiniteQuery(() =>
|
||||
getSongs(
|
||||
{ artist: artistId },
|
||||
@@ -129,7 +225,7 @@ export default function ArtistView() {
|
||||
getAlbums(
|
||||
{ appearance: artistId },
|
||||
{ sortBy: "releaseDate", order: "desc" },
|
||||
["artist", "illustration"],
|
||||
["artists", "illustration"],
|
||||
),
|
||||
);
|
||||
const { data: externalMetadata } = useQuery(
|
||||
@@ -169,8 +265,8 @@ export default function ArtistView() {
|
||||
type: "songGrid",
|
||||
props: {
|
||||
header: t("artist.topSongs"),
|
||||
parentArtistId: artist?.id,
|
||||
style: styles.section,
|
||||
mainArtists: artist ? [artist] : undefined,
|
||||
hideIfEmpty: true,
|
||||
seeMore:
|
||||
(topSongs.items?.length ?? 0) >= ShowSeeMoreThreshold
|
||||
? {
|
||||
@@ -188,12 +284,35 @@ export default function ArtistView() {
|
||||
: "artists",
|
||||
},
|
||||
},
|
||||
...AlbumType.map(
|
||||
(albumType): ArtistPageSection => ({
|
||||
type: "artistAlbumRow",
|
||||
props: { artistId, type: albumType },
|
||||
}),
|
||||
),
|
||||
...AlbumType.map((type, idx): ArtistPageSection => {
|
||||
const query = albumTypeQueries[idx];
|
||||
return {
|
||||
type: "albumRow",
|
||||
props: {
|
||||
hideIfEmpty: true,
|
||||
header: t(albumTypeToTranslationKey(type, true)),
|
||||
items: query.data,
|
||||
render: (item) => (
|
||||
<AlbumTile album={item} subtitle="year" />
|
||||
),
|
||||
seeMore:
|
||||
query.data && query.data.length >= 5
|
||||
? {
|
||||
pathname: "/albums",
|
||||
params: {
|
||||
artist: artistId,
|
||||
sort: "releaseDate",
|
||||
order: "desc",
|
||||
type: type,
|
||||
} satisfies Sorting<AlbumSortingKey> & {
|
||||
type: AlbumType;
|
||||
artist: string;
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
};
|
||||
}),
|
||||
{
|
||||
type: "songGrid",
|
||||
props: {
|
||||
@@ -206,10 +325,8 @@ export default function ArtistView() {
|
||||
params: { rare: artistId },
|
||||
}
|
||||
: undefined,
|
||||
|
||||
style: styles.section,
|
||||
songs: rareSongs.data?.pages.at(0)?.items,
|
||||
parentArtistId: artist?.id,
|
||||
mainArtists: artist ? [artist] : undefined,
|
||||
subtitle: !rareSongs.data
|
||||
? null
|
||||
: (song) =>
|
||||
@@ -231,7 +348,6 @@ export default function ArtistView() {
|
||||
props: {
|
||||
hideIfEmpty: true,
|
||||
items: items,
|
||||
style: styles.section,
|
||||
header: t(`browsing.sections.${label}`),
|
||||
render: (item) => (
|
||||
<VideoTile
|
||||
@@ -265,7 +381,6 @@ export default function ArtistView() {
|
||||
type: "albumRow",
|
||||
props: {
|
||||
hideIfEmpty: true,
|
||||
style: styles.section,
|
||||
header: t("artist.appearsOn"),
|
||||
items: relatedAlbums.items,
|
||||
render: (album) => (
|
||||
@@ -280,67 +395,59 @@ export default function ArtistView() {
|
||||
type: "aboutSection",
|
||||
props: {
|
||||
externalMetadata: externalMetadata,
|
||||
style: styles.section,
|
||||
},
|
||||
},
|
||||
]
|
||||
: []) satisfies ArtistPageSection[]),
|
||||
{ type: "fromSection", props: { areas } },
|
||||
...((externalMetadata !== null
|
||||
? [
|
||||
{
|
||||
type: "externalLinks",
|
||||
props: {
|
||||
externalMetadata: externalMetadata,
|
||||
style: styles.section,
|
||||
},
|
||||
},
|
||||
]
|
||||
: []) satisfies ArtistPageSection[]),
|
||||
];
|
||||
useSetKeyIllustration(artist ?? undefined);
|
||||
useQueryErrorModal([artistQuery]);
|
||||
return (
|
||||
<SafeFlashList
|
||||
data={sections}
|
||||
getItemType={({ type }) => type}
|
||||
renderItem={({ item }) => renderSection(item)}
|
||||
/>
|
||||
<FadingHeader>
|
||||
{(props) => (
|
||||
<SafeFlashList
|
||||
{...props}
|
||||
ref={props.scrollRef}
|
||||
data={filterSections(sections)}
|
||||
getItemType={({ type }) => type}
|
||||
renderItem={({ item }) => (
|
||||
<View style={styles.section}>
|
||||
{renderSection(item)}
|
||||
</View>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</FadingHeader>
|
||||
);
|
||||
}
|
||||
|
||||
const AlbumTypeRow = ({
|
||||
type,
|
||||
artistId,
|
||||
}: {
|
||||
type: AlbumType;
|
||||
artistId: string;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const query = useInfiniteQuery(() => albumTypeQuery(type, artistId));
|
||||
return (
|
||||
<Row
|
||||
hideIfEmpty
|
||||
style={styles.section}
|
||||
header={t(albumTypeToTranslationKey(type, true))}
|
||||
items={query.items}
|
||||
render={(item) => <AlbumTile album={item} subtitle="year" />}
|
||||
seeMore={
|
||||
query.hasNextPage
|
||||
? {
|
||||
pathname: "/albums",
|
||||
params: {
|
||||
artist: artistId,
|
||||
sort: "releaseDate",
|
||||
order: "desc",
|
||||
type: type,
|
||||
} satisfies Sorting<AlbumSortingKey> & {
|
||||
type: AlbumType;
|
||||
artist: string;
|
||||
},
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
section: {
|
||||
paddingBottom: theme.gap(1),
|
||||
section: { paddingBottom: theme.gap(2) },
|
||||
areaSection: {
|
||||
flexDirection: "row",
|
||||
alignItems: "flex-start",
|
||||
paddingHorizontal: theme.gap(2),
|
||||
},
|
||||
areaText: { lineHeight: theme.fontSize.rem(1.3) }, // NOTE: Copied from text component, for consistency across font
|
||||
areaListContainer: {
|
||||
flex: 1,
|
||||
flexWrap: "wrap",
|
||||
flexDirection: "row",
|
||||
justifyContent: "flex-start",
|
||||
},
|
||||
areaButton: {
|
||||
// NOTE: Overriding Pressable's padding
|
||||
paddingHorizontal: 0,
|
||||
},
|
||||
}));
|
||||
+52
-17
@@ -18,14 +18,18 @@
|
||||
|
||||
import { useLocalSearchParams, useNavigation } from "expo-router";
|
||||
import { useEffect } from "react";
|
||||
import { getArtists, getLabel } from "@/api/queries";
|
||||
import { getArea, getArtists, getLabel } from "@/api/queries";
|
||||
import { ArtistSortingKeys } from "@/models/artist";
|
||||
import type { Action } from "~/actions";
|
||||
import { useQuery } from "~/api";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { useLibraryFiltersControl } from "~/components/infinite/controls/filters";
|
||||
import { useLayoutControl } from "~/components/infinite/controls/layout";
|
||||
import { usePrimaryArtistsToggleControl } from "~/components/infinite/controls/primary-artists";
|
||||
import { useSortControl } from "~/components/infinite/controls/sort";
|
||||
import { InfiniteView } from "~/components/infinite/view";
|
||||
import { ArtistItem, ArtistTile } from "~/components/item/resource/artist";
|
||||
import { AreaHeader } from "~/components/resource-header";
|
||||
|
||||
export default function ArtistBrowseView() {
|
||||
const [{ layout }, layoutControl] = useLayoutControl({
|
||||
@@ -37,12 +41,28 @@ export default function ArtistBrowseView() {
|
||||
translate: (s) => `browsing.controls.sort.${s}`,
|
||||
});
|
||||
|
||||
const { label: labelId } = useLocalSearchParams<{
|
||||
const { label: labelId, area: areaId } = useLocalSearchParams<{
|
||||
label?: string;
|
||||
area?: string;
|
||||
}>();
|
||||
const [libraries, libraryFilterControl] = useLibraryFiltersControl();
|
||||
|
||||
const enablePrimaryArtistsToggle =
|
||||
(!labelId && !areaId) || areaId !== undefined;
|
||||
const [{ primaryArtistsOnly }, primaryArtistsToggleControl] =
|
||||
usePrimaryArtistsToggleControl({
|
||||
enableToggle: enablePrimaryArtistsToggle,
|
||||
});
|
||||
const primaryArtistsAction: Action = {
|
||||
label: primaryArtistsOnly
|
||||
? "browsing.controls.filter.allArtists"
|
||||
: "browsing.controls.filter.primaryArtists",
|
||||
onPress: () =>
|
||||
primaryArtistsToggleControl.onUpdate({
|
||||
primaryArtistsOnly: !primaryArtistsOnly,
|
||||
}),
|
||||
};
|
||||
const { data: label } = useQuery((labelId) => getLabel(labelId), labelId);
|
||||
const { data: area } = useQuery((areaId) => getArea(areaId), areaId);
|
||||
const Item = layout === "list" ? ArtistItem : ArtistTile;
|
||||
const nav = useNavigation();
|
||||
|
||||
@@ -52,19 +72,34 @@ export default function ArtistBrowseView() {
|
||||
}
|
||||
}, [labelId, label]);
|
||||
return (
|
||||
<InfiniteView
|
||||
layout={layout}
|
||||
controls={{
|
||||
layout: layoutControl,
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl],
|
||||
}}
|
||||
query={getArtists(
|
||||
{ library: libraries, label: labelId },
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["illustration"],
|
||||
)}
|
||||
render={(artist) => <Item artist={artist} />}
|
||||
/>
|
||||
<StaticHeader>
|
||||
<InfiniteView
|
||||
layout={layout}
|
||||
header={
|
||||
areaId !== undefined ? (
|
||||
<AreaHeader area={area} />
|
||||
) : undefined
|
||||
}
|
||||
controls={{
|
||||
layout: layoutControl,
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl],
|
||||
actions: enablePrimaryArtistsToggle
|
||||
? [primaryArtistsAction]
|
||||
: undefined,
|
||||
}}
|
||||
query={getArtists(
|
||||
{
|
||||
library: libraries,
|
||||
label: labelId,
|
||||
area: areaId,
|
||||
primaryArtistsOnly,
|
||||
},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["illustration"],
|
||||
)}
|
||||
render={(artist) => <Item artist={artist} />}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { useMemo } from "react";
|
||||
import { getGenres } from "@/api/queries";
|
||||
import { transformPage } from "@/api/query";
|
||||
import { GenreSortingKeys } from "@/models/genre";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { useSortControl } from "~/components/infinite/controls/sort";
|
||||
import { InfiniteView } from "~/components/infinite/view";
|
||||
import { GenreItem } from "~/components/item/resource/genre";
|
||||
@@ -20,13 +21,15 @@ export default function GenreList() {
|
||||
}, [sort, order]);
|
||||
|
||||
return (
|
||||
<InfiniteView
|
||||
layout={"list"}
|
||||
controls={{
|
||||
sort: sortControl,
|
||||
}}
|
||||
query={query}
|
||||
render={(genre) => <GenreItem genre={genre} />}
|
||||
/>
|
||||
<StaticHeader>
|
||||
<InfiniteView
|
||||
layout={"list"}
|
||||
controls={{
|
||||
sort: sortControl,
|
||||
}}
|
||||
query={query}
|
||||
render={(genre) => <GenreItem genre={genre} />}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useMemo } from "react";
|
||||
import { getArea, getLabels } from "@/api/queries";
|
||||
import { transformPage } from "@/api/query";
|
||||
import { LabelSortingKeys } from "@/models/label";
|
||||
import { useQuery } from "~/api";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { useSortControl } from "~/components/infinite/controls/sort";
|
||||
import { InfiniteView } from "~/components/infinite/view";
|
||||
import { LabelItem } from "~/components/item/resource/label";
|
||||
import { AreaHeader } from "~/components/resource-header";
|
||||
|
||||
export default function LabelsList() {
|
||||
const [{ sort, order }, sortControl] = useSortControl({
|
||||
sortingKeys: LabelSortingKeys,
|
||||
translate: (s) => `browsing.controls.sort.${s}`,
|
||||
});
|
||||
|
||||
const { area: areaId } = useLocalSearchParams<{
|
||||
area?: string;
|
||||
}>();
|
||||
const { data: area } = useQuery((areaId) => getArea(areaId), areaId);
|
||||
const query = useMemo(() => {
|
||||
const base = getLabels(
|
||||
{ area: areaId },
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["area"],
|
||||
);
|
||||
return transformPage(base, (g) => ({ ...g, illustration: null }));
|
||||
}, [sort, order, areaId]);
|
||||
|
||||
return (
|
||||
<StaticHeader>
|
||||
<InfiniteView
|
||||
layout={"list"}
|
||||
header={
|
||||
areaId !== undefined ? (
|
||||
<AreaHeader area={area} />
|
||||
) : undefined
|
||||
}
|
||||
controls={{
|
||||
sort: sortControl,
|
||||
}}
|
||||
query={query}
|
||||
render={(label) => <LabelItem label={label} />}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
+37
-26
@@ -1,7 +1,6 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { shuffle } from "lodash";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
@@ -15,7 +14,7 @@ import {
|
||||
getPlaylistEntries,
|
||||
} from "@/api/queries";
|
||||
import type { PlaylistEntryWithRelations } from "@/models/playlist";
|
||||
import { playTracksAtom } from "@/state/player";
|
||||
import { emptyPlaylistAtom, playTracksAtom } from "@/state/player";
|
||||
import {
|
||||
DoneIcon,
|
||||
EditIcon,
|
||||
@@ -25,14 +24,17 @@ import {
|
||||
ShuffleIcon,
|
||||
} from "@/ui/icons";
|
||||
import { generateArray } from "@/utils/gen-list";
|
||||
import { shuffle } from "@/utils/random";
|
||||
import { useUpdatePlaylistFormModal } from "~/actions/playlist/create-update";
|
||||
import { useDeletePlaylistAction } from "~/actions/playlist/delete";
|
||||
import { useUpdateIllustrationAction } from "~/actions/update-illustration";
|
||||
import { useAPI, useQuery, useQueryClient } from "~/api";
|
||||
import { usePlaylistContextMenu } from "~/components/context-menu/resource/playlist";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { SongItem } from "~/components/item/resource/song";
|
||||
import { ResourceHeader } from "~/components/resource-header";
|
||||
import * as Haptics from "~/haptics";
|
||||
import { useQueryErrorModal } from "~/hooks/error";
|
||||
import { useRootViewStyle } from "~/hooks/root-view-style";
|
||||
import { Button } from "~/primitives/button";
|
||||
import { Divider } from "~/primitives/divider";
|
||||
@@ -49,6 +51,7 @@ const playlistQuery = (playlistId: string | number) =>
|
||||
export default function PlaylistView() {
|
||||
const rootStyle = useRootViewStyle();
|
||||
const queryClient = useQueryClient();
|
||||
const emptyPlaylist = useSetAtom(emptyPlaylistAtom);
|
||||
const { id: playlistId } = useLocalSearchParams<{ id: string }>();
|
||||
const playTracks = useSetAtom(playTracksAtom);
|
||||
|
||||
@@ -91,29 +94,37 @@ export default function PlaylistView() {
|
||||
[playlistEntries],
|
||||
);
|
||||
const onShuffle = useCallback(() => {
|
||||
emptyPlaylist();
|
||||
playTracks({ tracks: shuffle(tracksForPlayer) });
|
||||
}, [playlistEntries]);
|
||||
const onPlay = useCallback(() => {
|
||||
emptyPlaylist();
|
||||
onItemPress(0);
|
||||
}, [onItemPress, emptyPlaylist]);
|
||||
|
||||
return (
|
||||
<View style={[styles.root, rootStyle]}>
|
||||
<Header
|
||||
playlistId={playlistId}
|
||||
{...(playlistEntries && !isReordering
|
||||
? { onPlay: () => onItemPress(0), onShuffle: onShuffle }
|
||||
: {})}
|
||||
/>
|
||||
<Divider h />
|
||||
<Items
|
||||
playlistId={playlistId}
|
||||
playlistEntries={playlistEntries?.items}
|
||||
isReordering={isReordering}
|
||||
startReordering={() => setIsReordering(true)}
|
||||
onReorderingEnd={(entryIds) => {
|
||||
setIsReordering(false);
|
||||
reorderEntries.mutate(entryIds);
|
||||
}}
|
||||
onItemPress={onItemPress}
|
||||
/>
|
||||
</View>
|
||||
<StaticHeader>
|
||||
<View style={[styles.root, rootStyle]}>
|
||||
<Header
|
||||
playlistId={playlistId}
|
||||
{...(playlistEntries && !isReordering
|
||||
? { onPlay, onShuffle }
|
||||
: {})}
|
||||
/>
|
||||
<Divider h />
|
||||
<Items
|
||||
playlistId={playlistId}
|
||||
playlistEntries={playlistEntries?.items}
|
||||
isReordering={isReordering}
|
||||
startReordering={() => setIsReordering(true)}
|
||||
onReorderingEnd={(entryIds) => {
|
||||
setIsReordering(false);
|
||||
reorderEntries.mutate(entryIds);
|
||||
}}
|
||||
onItemPress={onItemPress}
|
||||
/>
|
||||
</View>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -127,8 +138,11 @@ const Header = ({
|
||||
onPlay?: () => void;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { data: playlist } = useQuery(() => playlistQuery(playlistId));
|
||||
const playlistQ = useQuery(() => playlistQuery(playlistId));
|
||||
const { data: playlist } = playlistQ;
|
||||
const contextMenu = usePlaylistContextMenu(playlist);
|
||||
|
||||
useQueryErrorModal([playlistQ]);
|
||||
return (
|
||||
<>
|
||||
<ResourceHeader
|
||||
@@ -194,7 +208,6 @@ const Items = ({
|
||||
playlistEntries?.map(({ entryId }) => entryId) ?? [];
|
||||
}, [isReordering, playlistEntries]);
|
||||
return (
|
||||
/* @ts-expect-error */
|
||||
<DraggableFlatList
|
||||
containerStyle={styles.itemsContainer}
|
||||
contentContainerStyle={styles.items}
|
||||
@@ -204,7 +217,6 @@ const Items = ({
|
||||
item?.entryId.toString() ?? `skeleton-${idx}`
|
||||
}
|
||||
renderItem={({ item, drag, getIndex }) => (
|
||||
/* @ts-expect-error */
|
||||
<ScaleDecorator>
|
||||
<SongItem
|
||||
song={item}
|
||||
@@ -291,7 +303,6 @@ const Footer = ({
|
||||
<Button
|
||||
size="small"
|
||||
width="fitContent"
|
||||
// @ts-expect-error
|
||||
icon={isReordering ? DoneIcon : ReorderPlaylistIcon}
|
||||
title={t(
|
||||
isReordering
|
||||
|
||||
+17
-14
@@ -4,6 +4,7 @@ import {
|
||||
CreatePlaylist,
|
||||
useCreatePlaylistFormModal,
|
||||
} from "~/actions/playlist/create-update";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { useLayoutControl } from "~/components/infinite/controls/layout";
|
||||
import { useSortControl } from "~/components/infinite/controls/sort";
|
||||
import { InfiniteView } from "~/components/infinite/view";
|
||||
@@ -25,19 +26,21 @@ export default function PlaylistsView() {
|
||||
const Item = layout === "list" ? PlaylistItem : PlaylistTile;
|
||||
|
||||
return (
|
||||
<InfiniteView
|
||||
layout={layout}
|
||||
controls={{
|
||||
actions: [CreatePlaylist(openFormModal)],
|
||||
sort: sortControl,
|
||||
layout: layoutControl,
|
||||
}}
|
||||
query={getPlaylists(
|
||||
{},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["illustration"],
|
||||
)}
|
||||
render={(playlist) => <Item playlist={playlist} />}
|
||||
/>
|
||||
<StaticHeader>
|
||||
<InfiniteView
|
||||
layout={layout}
|
||||
controls={{
|
||||
actions: [CreatePlaylist(openFormModal)],
|
||||
sort: sortControl,
|
||||
layout: layoutControl,
|
||||
}}
|
||||
query={getPlaylists(
|
||||
{},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["illustration"],
|
||||
)}
|
||||
render={(playlist) => <Item playlist={playlist} />}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -1,51 +1,15 @@
|
||||
import { Stack, useLocalSearchParams } from "expo-router";
|
||||
import Animated, {
|
||||
interpolate,
|
||||
useAnimatedScrollHandler,
|
||||
useAnimatedStyle,
|
||||
useSharedValue,
|
||||
} from "react-native-reanimated";
|
||||
import { HeaderBackground } from "~/components/navigation";
|
||||
import { useRootViewStyle } from "~/hooks/root-view-style";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { FadingHeader } from "~/components/header";
|
||||
import ReleasePage from "~/pages/release";
|
||||
|
||||
export default function Page() {
|
||||
const rootStyle = useRootViewStyle();
|
||||
const { id: releaseId } = useLocalSearchParams<{ id: string }>();
|
||||
const scrollY = useSharedValue(0);
|
||||
const scrollHandler = useAnimatedScrollHandler({
|
||||
onScroll: (event) => {
|
||||
scrollY.value = event.contentOffset.y;
|
||||
},
|
||||
});
|
||||
const headerStyle = useAnimatedStyle(
|
||||
() => ({
|
||||
opacity: interpolate(scrollY.value, [30, 100], [0, 1], {
|
||||
extrapolateLeft: "clamp",
|
||||
}),
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerBackground: () => (
|
||||
<HeaderBackground
|
||||
style={[{ opacity: 0 }, headerStyle]}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Animated.ScrollView
|
||||
onScroll={scrollHandler}
|
||||
scrollEventThrottle={16}
|
||||
contentContainerStyle={rootStyle}
|
||||
>
|
||||
<ReleasePage releaseId={releaseId} />
|
||||
</Animated.ScrollView>
|
||||
</>
|
||||
<FadingHeader>
|
||||
{(scrollProps) => (
|
||||
<ReleasePage releaseId={releaseId} scrollProps={scrollProps} />
|
||||
)}
|
||||
</FadingHeader>
|
||||
);
|
||||
}
|
||||
@@ -21,9 +21,11 @@ import {
|
||||
ExternalMetadataDescription,
|
||||
ExternalMetadataSourceComponent,
|
||||
} from "~/components/external-metadata";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { GenreChip } from "~/components/item/resource/genre";
|
||||
import { LoadableText } from "~/components/loadable_text";
|
||||
import { SongHeader } from "~/components/resource-header";
|
||||
import { useQueryErrorModal } from "~/hooks/error";
|
||||
import { useRootViewStyle } from "~/hooks/root-view-style";
|
||||
import { Button } from "~/primitives/button";
|
||||
import { Divider } from "~/primitives/divider";
|
||||
@@ -46,7 +48,7 @@ export default function SongPage() {
|
||||
}
|
||||
return tabQuery;
|
||||
});
|
||||
const { data: song } = useQuery(() =>
|
||||
const songQuery = useQuery(() =>
|
||||
getSong(id, [
|
||||
"artist",
|
||||
"illustration",
|
||||
@@ -55,6 +57,8 @@ export default function SongPage() {
|
||||
"master",
|
||||
]),
|
||||
);
|
||||
const { data: song } = songQuery;
|
||||
useQueryErrorModal([songQuery]);
|
||||
useSetKeyIllustration(song);
|
||||
const playButtonCallback = useCallback(() => {
|
||||
if (!song) {
|
||||
@@ -69,41 +73,43 @@ export default function SongPage() {
|
||||
}, [song]);
|
||||
|
||||
return (
|
||||
<View style={{ paddingTop }}>
|
||||
<View style={styles.content}>
|
||||
<SongHeader song={song} />
|
||||
<View style={styles.playButton}>
|
||||
<Button
|
||||
title="Play"
|
||||
width="fill"
|
||||
icon={PlayIcon}
|
||||
disabled={!song}
|
||||
onPress={playButtonCallback}
|
||||
containerStyle={styles.playButtonContent}
|
||||
<StaticHeader>
|
||||
<View style={{ paddingTop }}>
|
||||
<View style={styles.content}>
|
||||
<SongHeader song={song} />
|
||||
<View style={styles.playButton}>
|
||||
<Button
|
||||
title="Play"
|
||||
width="fill"
|
||||
icon={PlayIcon}
|
||||
disabled={!song}
|
||||
onPress={playButtonCallback}
|
||||
containerStyle={styles.playButtonContent}
|
||||
/>
|
||||
</View>
|
||||
<TabComponent
|
||||
currentTab={currentTab}
|
||||
enabled={!!song}
|
||||
setCurrentTab={setCurrentTab}
|
||||
/>
|
||||
<Divider h withInsets />
|
||||
{song && (
|
||||
<ScrollView
|
||||
style={styles.content}
|
||||
contentContainerStyle={{ paddingBottom }}
|
||||
>
|
||||
{currentTab === "lyrics" && (
|
||||
<LyricsView
|
||||
lyrics={song?.lyrics}
|
||||
songName={song?.name}
|
||||
/>
|
||||
)}
|
||||
{currentTab === "infos" && <InfoView song={song} />}
|
||||
</ScrollView>
|
||||
)}
|
||||
</View>
|
||||
<TabComponent
|
||||
currentTab={currentTab}
|
||||
enabled={!!song}
|
||||
setCurrentTab={setCurrentTab}
|
||||
/>
|
||||
<Divider h withInsets />
|
||||
{song && (
|
||||
<ScrollView
|
||||
style={styles.content}
|
||||
contentContainerStyle={{ paddingBottom }}
|
||||
>
|
||||
{currentTab === "lyrics" && (
|
||||
<LyricsView
|
||||
lyrics={song?.lyrics}
|
||||
songName={song?.name}
|
||||
/>
|
||||
)}
|
||||
{currentTab === "infos" && <InfoView song={song} />}
|
||||
</ScrollView>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,7 +138,7 @@ const LyricsView = ({
|
||||
variant={
|
||||
lowerSongName &&
|
||||
line.toLowerCase().includes(lowerSongName)
|
||||
? "subtitle"
|
||||
? "itemText"
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
@@ -155,7 +161,7 @@ const InfoView = ({ song }: { song: Song | undefined }) => {
|
||||
return (
|
||||
<View style={[styles.tab, styles.info]}>
|
||||
<View style={styles.row}>
|
||||
<Text content={`${t("song.songType")}:`} variant="subtitle" />
|
||||
<Text content={`${t("song.songType")}:`} variant="itemLabel" />
|
||||
<View style={styles.row}>
|
||||
{song && (
|
||||
<Icon
|
||||
@@ -177,7 +183,7 @@ const InfoView = ({ song }: { song: Song | undefined }) => {
|
||||
<View style={styles.row}>
|
||||
<Text
|
||||
content={`${t("models.genre_plural")}:`}
|
||||
variant="subtitle"
|
||||
variant="itemLabel"
|
||||
/>
|
||||
<ScrollView
|
||||
horizontal
|
||||
@@ -199,7 +205,7 @@ const InfoView = ({ song }: { song: Song | undefined }) => {
|
||||
<View style={styles.row}>
|
||||
<Text
|
||||
content={`${t("models.externalLink_plural")}:`}
|
||||
variant="subtitle"
|
||||
variant="itemLabel"
|
||||
/>
|
||||
<ScrollView
|
||||
horizontal
|
||||
|
||||
@@ -20,19 +20,28 @@ import { useLocalSearchParams, useNavigation } from "expo-router";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { useCallback, useEffect, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getArtist, getGenre, getSong, getSongs } from "@/api/queries";
|
||||
import { transformPage } from "@/api/query";
|
||||
import Song, {
|
||||
import {
|
||||
getArtist,
|
||||
getGenre,
|
||||
getSong,
|
||||
getSongHistory,
|
||||
getSongs,
|
||||
} from "@/api/queries";
|
||||
import { type InfiniteQuery, transformPage } from "@/api/query";
|
||||
import {
|
||||
type PlayHistoryEntry,
|
||||
SongSortingKeys,
|
||||
SongType,
|
||||
type SongWithRelations,
|
||||
} from "@/models/song";
|
||||
import { songTypeToTranslationKey } from "@/models/utils";
|
||||
import { playFromInfiniteQuery } from "@/state/player";
|
||||
import { playFromInfiniteQuery, playTrackAtom } from "@/state/player";
|
||||
import { PlayIcon, ShuffleIcon } from "@/ui/icons";
|
||||
import { shouldShowArtists } from "@/utils/format-artists";
|
||||
import { getRandomNumber } from "@/utils/random";
|
||||
import type { Action } from "~/actions";
|
||||
import { useQuery, useQueryClient } from "~/api";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import {
|
||||
useLibraryFiltersControl,
|
||||
useTypeFiltersControl,
|
||||
@@ -44,8 +53,13 @@ import { ArtistHeader, SongHeader } from "~/components/resource-header";
|
||||
|
||||
// TODO song subtitle: allow it to be album
|
||||
|
||||
type SongT = SongWithRelations<
|
||||
"artist" | "master" | "featuring" | "illustration"
|
||||
>;
|
||||
|
||||
export default function SongBrowseView() {
|
||||
const playTracks = useSetAtom(playFromInfiniteQuery);
|
||||
const playTrack = useSetAtom(playTrackAtom);
|
||||
const queryClient = useQueryClient();
|
||||
const nav = useNavigation();
|
||||
const { t } = useTranslation();
|
||||
@@ -54,12 +68,18 @@ export default function SongBrowseView() {
|
||||
rare: rareArtistId,
|
||||
genre: genreId,
|
||||
versionsOf: versionsOfSongId,
|
||||
playHistory: playHistoryStr,
|
||||
} = useLocalSearchParams<{
|
||||
playHistory?: string;
|
||||
artist?: string;
|
||||
rare?: string;
|
||||
versionsOf?: string;
|
||||
genre?: string;
|
||||
}>();
|
||||
const isPlayHistory = useMemo(
|
||||
() => playHistoryStr === "true",
|
||||
[playHistoryStr],
|
||||
);
|
||||
const [{ sort, order }, sortControl] = useSortControl({
|
||||
sortingKeys: SongSortingKeys,
|
||||
translate: (s) => `browsing.controls.sort.${s}`,
|
||||
@@ -81,7 +101,9 @@ export default function SongBrowseView() {
|
||||
versionsOfSongId,
|
||||
);
|
||||
useEffect(() => {
|
||||
if (rareArtistId !== undefined) {
|
||||
if (isPlayHistory) {
|
||||
nav.setOptions({ headerTitle: t("home.playHistory") });
|
||||
} else if (rareArtistId !== undefined) {
|
||||
nav.setOptions({ headerTitle: t("artist.rareSongs") });
|
||||
} else if (versionsOfSongId !== undefined) {
|
||||
nav.setOptions({ headerTitle: t("models.versions") });
|
||||
@@ -90,7 +112,7 @@ export default function SongBrowseView() {
|
||||
}
|
||||
}, [rareArtistId, versionsOfSongId, genreId, genre]);
|
||||
const subtitle = useCallback(
|
||||
(songItem: SongWithRelations<"featuring"> | undefined) => {
|
||||
(songItem: SongT | undefined) => {
|
||||
if (
|
||||
artistId === undefined &&
|
||||
versionsOfSongId === undefined &&
|
||||
@@ -104,24 +126,32 @@ export default function SongBrowseView() {
|
||||
// If song's artist matches the main song's artist
|
||||
// + if there is no featuring, don;t display artist name
|
||||
if (
|
||||
songItem.featuring.length === 0 &&
|
||||
songItem.artistId === song?.artistId
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
if (
|
||||
songItem.featuring.length > 0 ||
|
||||
songItem.artistId !== artist?.id
|
||||
shouldShowArtists(
|
||||
songItem.artist,
|
||||
songItem.featuring,
|
||||
artist ? [artist] : [],
|
||||
)
|
||||
) {
|
||||
return "artists";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
[artistId, rareArtistId, song],
|
||||
[artistId, rareArtistId, song, artist],
|
||||
);
|
||||
const getQuery = useCallback(
|
||||
(random?: number) =>
|
||||
getSongs(
|
||||
(random?: number) => {
|
||||
const includes = [
|
||||
"artist",
|
||||
"illustration",
|
||||
"featuring",
|
||||
"master",
|
||||
] as const;
|
||||
if (isPlayHistory) {
|
||||
return getSongHistory(
|
||||
includes,
|
||||
) as unknown as InfiniteQuery<SongT>;
|
||||
}
|
||||
return getSongs(
|
||||
{
|
||||
library: libraries,
|
||||
type: types,
|
||||
@@ -132,9 +162,11 @@ export default function SongBrowseView() {
|
||||
genre: genreId,
|
||||
},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["artist", "illustration", "featuring", "master"],
|
||||
),
|
||||
includes,
|
||||
);
|
||||
},
|
||||
[
|
||||
isPlayHistory,
|
||||
song,
|
||||
order,
|
||||
libraries,
|
||||
@@ -160,14 +192,23 @@ export default function SongBrowseView() {
|
||||
[query],
|
||||
);
|
||||
const onItemPress = useCallback(
|
||||
(index: number, songs: Song[] | undefined) => {
|
||||
(index: number, songs: SongT[] | undefined) => {
|
||||
if (songs === undefined) {
|
||||
return;
|
||||
}
|
||||
const afterId = index > 0 ? songs[index - 1]?.id : undefined;
|
||||
playTracks(getQueryForPlayer(), queryClient, afterId);
|
||||
if (isPlayHistory) {
|
||||
const song = songs[index];
|
||||
playTrack({
|
||||
artist: song.artist,
|
||||
featuring: song.featuring,
|
||||
track: { ...song.master, illustration: song.illustration },
|
||||
});
|
||||
} else {
|
||||
const afterId = index > 0 ? songs[index - 1]?.id : undefined;
|
||||
playTracks(getQueryForPlayer(), queryClient, afterId);
|
||||
}
|
||||
},
|
||||
[query],
|
||||
[query, isPlayHistory],
|
||||
);
|
||||
const playAction = useMemo(() => {
|
||||
return {
|
||||
@@ -189,30 +230,51 @@ export default function SongBrowseView() {
|
||||
} satisfies Action;
|
||||
}, [getQueryForPlayer, queryClient]);
|
||||
return (
|
||||
<InfiniteView
|
||||
layout={"list"}
|
||||
header={
|
||||
(artistId ?? rareArtistId) !== undefined ? (
|
||||
<ArtistHeader artist={artist} />
|
||||
) : versionsOfSongId !== undefined ? (
|
||||
<SongHeader song={song} />
|
||||
) : undefined
|
||||
}
|
||||
controls={{
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl, songTypeFilterControl],
|
||||
actions: [playAction, shuffleAction],
|
||||
}}
|
||||
query={query}
|
||||
render={(songItem, idx, songs) => (
|
||||
<SongItem
|
||||
song={songItem}
|
||||
parentArtistId={artist?.id ?? song?.artistId}
|
||||
onPress={() => onItemPress(idx, songs)}
|
||||
subtitle={subtitle(song)}
|
||||
illustrationProps={{}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<StaticHeader>
|
||||
<InfiniteView
|
||||
layout={"list"}
|
||||
header={
|
||||
(artistId ?? rareArtistId) !== undefined ? (
|
||||
<ArtistHeader artist={artist} />
|
||||
) : versionsOfSongId !== undefined ? (
|
||||
<SongHeader song={song} />
|
||||
) : undefined
|
||||
}
|
||||
keyExtractor={
|
||||
isPlayHistory
|
||||
? (s) =>
|
||||
(
|
||||
s as any as PlayHistoryEntry
|
||||
).playedAt.toString()
|
||||
: undefined
|
||||
}
|
||||
controls={
|
||||
isPlayHistory
|
||||
? {}
|
||||
: {
|
||||
sort: sortControl,
|
||||
filters: [
|
||||
libraryFilterControl,
|
||||
songTypeFilterControl,
|
||||
],
|
||||
actions: [playAction, shuffleAction],
|
||||
}
|
||||
}
|
||||
query={query}
|
||||
render={(songItem, idx, songs) => (
|
||||
<SongItem
|
||||
song={songItem}
|
||||
mainArtists={
|
||||
artist || song
|
||||
? [artist ?? song!.artist]
|
||||
: undefined
|
||||
}
|
||||
onPress={() => onItemPress(idx, songs)}
|
||||
subtitle={subtitle(songItem)}
|
||||
illustrationProps={{}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { getArtist, getSong, getTracks } from "@/api/queries";
|
||||
import { TrackSortingKeys, type TrackWithRelations } from "@/models/track";
|
||||
import { playTrackAtom } from "@/state/player";
|
||||
import { useQuery, useQueryClient } from "~/api";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { useLibraryFiltersControl } from "~/components/infinite/controls/filters";
|
||||
import { useSortControl } from "~/components/infinite/controls/sort";
|
||||
import { InfiniteView } from "~/components/infinite/view";
|
||||
@@ -38,30 +39,34 @@ export default function TracksView() {
|
||||
[queryClient],
|
||||
);
|
||||
return (
|
||||
<InfiniteView
|
||||
layout={"list"}
|
||||
header={
|
||||
songId !== undefined ? <SongHeader song={song} /> : undefined
|
||||
}
|
||||
controls={{
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl],
|
||||
}}
|
||||
query={getTracks(
|
||||
{
|
||||
song: songId,
|
||||
library: libraries,
|
||||
},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["illustration", "release", "song", "video"],
|
||||
)}
|
||||
render={(track) => (
|
||||
<TrackItem
|
||||
onPress={() => track && onItemPress(track)}
|
||||
track={track}
|
||||
illustrationProps={{}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<StaticHeader>
|
||||
<InfiniteView
|
||||
layout={"list"}
|
||||
header={
|
||||
songId !== undefined ? (
|
||||
<SongHeader song={song} />
|
||||
) : undefined
|
||||
}
|
||||
controls={{
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl],
|
||||
}}
|
||||
query={getTracks(
|
||||
{
|
||||
song: songId,
|
||||
library: libraries,
|
||||
},
|
||||
{ sortBy: sort ?? "name", order: order ?? "asc" },
|
||||
["illustration", "release", "song", "video"],
|
||||
)}
|
||||
render={(track) => (
|
||||
<TrackItem
|
||||
onPress={() => track && onItemPress(track)}
|
||||
track={track}
|
||||
illustrationProps={{}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import { PlayIcon, ShuffleIcon } from "@/ui/icons";
|
||||
import { getRandomNumber } from "@/utils/random";
|
||||
import type { Action } from "~/actions";
|
||||
import { useQuery, useQueryClient } from "~/api";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import {
|
||||
useLibraryFiltersControl,
|
||||
useTypeFiltersControl,
|
||||
@@ -132,32 +133,36 @@ export default function VideoBrowseView() {
|
||||
} satisfies Action;
|
||||
}, [getQueryForPlayer, queryClient]);
|
||||
return (
|
||||
<InfiniteView
|
||||
layout={layout}
|
||||
header={
|
||||
artistId ? (
|
||||
<ArtistHeader artist={artist} />
|
||||
) : songId ? (
|
||||
<SongHeader song={song} />
|
||||
) : undefined
|
||||
}
|
||||
controls={{
|
||||
layout: layoutControl,
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl, albumTypeFilterControl],
|
||||
actions: [playAction, shuffleAction],
|
||||
}}
|
||||
query={query}
|
||||
render={(video, idx, videos) => (
|
||||
<Item
|
||||
video={video}
|
||||
onPress={() => video && onItemPress(idx, videos)}
|
||||
subtitle={artistId || songId ? "duration" : "artistName"}
|
||||
illustrationProps={{
|
||||
normalizedThumbnail: true,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<StaticHeader>
|
||||
<InfiniteView
|
||||
layout={layout}
|
||||
header={
|
||||
artistId ? (
|
||||
<ArtistHeader artist={artist} />
|
||||
) : songId ? (
|
||||
<SongHeader song={song} />
|
||||
) : undefined
|
||||
}
|
||||
controls={{
|
||||
layout: layoutControl,
|
||||
sort: sortControl,
|
||||
filters: [libraryFilterControl, albumTypeFilterControl],
|
||||
actions: [playAction, shuffleAction],
|
||||
}}
|
||||
query={query}
|
||||
render={(video, idx, videos) => (
|
||||
<Item
|
||||
video={video}
|
||||
onPress={() => video && onItemPress(idx, videos)}
|
||||
subtitle={
|
||||
artistId || songId ? "duration" : "artistName"
|
||||
}
|
||||
illustrationProps={{
|
||||
normalizedThumbnail: true,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import type Resource from "@/models/resource";
|
||||
import type { SaveSearchItem, SearchResult } from "@/models/search";
|
||||
import { playTrackAtom } from "@/state/player";
|
||||
import { useAPI, useQueryClient } from "~/api";
|
||||
import { StaticHeader } from "~/components/header";
|
||||
import { useSearchTypeFilterControl } from "~/components/infinite/controls/filters";
|
||||
import { InfiniteView } from "~/components/infinite/view";
|
||||
import { SearchResultItem } from "~/components/item/resource/search-result";
|
||||
@@ -49,7 +50,7 @@ import { TextInput } from "~/primitives/text_input";
|
||||
type SearchFilter = ReturnType<typeof useSearchTypeFilterControl>[0];
|
||||
|
||||
export default function SearchView() {
|
||||
const timeoutRef = useRef<number>(null);
|
||||
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
const api = useAPI();
|
||||
const [filter, filterControl] = useSearchTypeFilterControl();
|
||||
const playTrack = useSetAtom(playTrackAtom);
|
||||
@@ -72,7 +73,11 @@ export default function SearchView() {
|
||||
? { albumId: item.album.id }
|
||||
: item.song
|
||||
? { songId: item.song.id }
|
||||
: { videoId: item.video.id };
|
||||
: item.video
|
||||
? { videoId: item.video.id }
|
||||
: item.genre
|
||||
? { genreId: item.genre.id }
|
||||
: { labelId: item.label.id };
|
||||
await api.saveSearchHistoryEntry(dto);
|
||||
// Sometimes, it refreshes to fast, and shifts the history
|
||||
// before openning a page (for artists) is done
|
||||
@@ -110,39 +115,44 @@ export default function SearchView() {
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<InfiniteView
|
||||
header={
|
||||
<View style={styles.searchHeader}>
|
||||
<TextInput
|
||||
inModal={false}
|
||||
autoCorrect={false}
|
||||
autoCapitalize={"none"}
|
||||
placeholder={t("nav.search")}
|
||||
onChangeText={debounceSearch}
|
||||
/>
|
||||
</View>
|
||||
}
|
||||
// NOTE: Since the original type of the query is SearchResult, it does not have an id,
|
||||
// that's why it complains
|
||||
query={
|
||||
query as unknown as InfiniteQuery<
|
||||
Resource,
|
||||
IllustratedSearchResultWithId
|
||||
>
|
||||
}
|
||||
controls={{
|
||||
filters: searchValue.trim() === "" ? [] : [filterControl],
|
||||
}}
|
||||
render={(item) => (
|
||||
<SearchResultItem
|
||||
searchResult={item}
|
||||
onPress={() => onSearchResultPress(item)}
|
||||
<StaticHeader>
|
||||
{(scrollRef) => (
|
||||
<InfiniteView
|
||||
scrollRef={scrollRef}
|
||||
header={
|
||||
<View style={styles.searchHeader}>
|
||||
<TextInput
|
||||
inModal={false}
|
||||
autoCorrect={false}
|
||||
autoCapitalize={"none"}
|
||||
placeholder={t("nav.search")}
|
||||
onChangeText={debounceSearch}
|
||||
/>
|
||||
</View>
|
||||
}
|
||||
// NOTE: Since the original type of the query is SearchResult, it does not have an id,
|
||||
// that's why it complains
|
||||
query={
|
||||
query as unknown as InfiniteQuery<
|
||||
Resource,
|
||||
IllustratedSearchResultWithId
|
||||
>
|
||||
}
|
||||
controls={{
|
||||
filters:
|
||||
searchValue.trim() === "" ? [] : [filterControl],
|
||||
}}
|
||||
render={(item) => (
|
||||
<SearchResultItem
|
||||
searchResult={item}
|
||||
onPress={() => onSearchResultPress(item)}
|
||||
/>
|
||||
)}
|
||||
layout="list"
|
||||
/>
|
||||
)}
|
||||
layout="list"
|
||||
/>
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -172,7 +182,7 @@ const useSearchQuery = (
|
||||
case "album":
|
||||
query = transformPage(
|
||||
getAlbums({ query: searchValue }, undefined, [
|
||||
"artist",
|
||||
"artists",
|
||||
"illustration",
|
||||
]),
|
||||
(album): SearchResult => ({ album }),
|
||||
@@ -218,7 +228,11 @@ const withStringId = (q: InfiniteQuery<any, SearchResult>) =>
|
||||
? `album-${item.album.id}`
|
||||
: item.video
|
||||
? `video-${item.video.id}`
|
||||
: `artist-${item.artist.id}`,
|
||||
: item.artist
|
||||
? `artist-${item.artist.id}`
|
||||
: item.genre
|
||||
? `genre-${item.genre.id}`
|
||||
: `label-${item.label.id}`,
|
||||
}));
|
||||
|
||||
const searchResultQueryToResourceQuery = (query: Query<SearchResult[]>) => {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Stack } from "expo-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useScreenOptions } from "~/utils/screen-options";
|
||||
|
||||
export default function Layout() {
|
||||
const { t } = useTranslation();
|
||||
const screenOptions = useScreenOptions();
|
||||
return (
|
||||
<Stack screenOptions={screenOptions}>
|
||||
<Stack.Screen
|
||||
name="index"
|
||||
options={{
|
||||
headerTitle: t("nav.settings"),
|
||||
// TODO IDK why we canGoBack when we are at the index
|
||||
headerLeft: () => null,
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { StaticHeader, useIosLargeTitle } from "~/components/header";
|
||||
import { SettingsPage } from "~/pages/settings";
|
||||
|
||||
export default function SettingsView() {
|
||||
const { screenOptions, flashlistOptions } = useIosLargeTitle();
|
||||
return (
|
||||
<StaticHeader options={screenOptions}>
|
||||
{(scrollRef) => (
|
||||
<SettingsPage
|
||||
scrollRef={scrollRef}
|
||||
flashlistOptions={flashlistOptions}
|
||||
/>
|
||||
)}
|
||||
</StaticHeader>
|
||||
);
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
import { useQuery as useTanStackQuery } from "@tanstack/react-query";
|
||||
import { BlurTargetView } from "expo-blur";
|
||||
import { Redirect } from "expo-router";
|
||||
import {
|
||||
TabList,
|
||||
@@ -34,7 +35,7 @@ import {
|
||||
} from "react-native";
|
||||
import Animated, {
|
||||
useAnimatedStyle,
|
||||
withSpring,
|
||||
withTiming,
|
||||
} from "react-native-reanimated";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import { getCurrentUserStatus } from "@/api/queries";
|
||||
@@ -48,7 +49,7 @@ import {
|
||||
SettingsIcon,
|
||||
} from "@/ui/icons";
|
||||
import { useAPI } from "~/api";
|
||||
import { BlurView } from "~/components/blur-view";
|
||||
import { BlurView, bvTarget } from "~/components/blur-view";
|
||||
import { PlayerContext } from "~/components/player/context";
|
||||
import { ExpandedPlayerSlot } from "~/components/player/expanded/slot";
|
||||
import { MinimisedPlayer } from "~/components/player/minimised";
|
||||
@@ -56,6 +57,7 @@ import { bottomTabBarHeightAtom } from "~/hooks/root-view-style";
|
||||
import { Icon } from "~/primitives/icon";
|
||||
import { Pressable } from "~/primitives/pressable";
|
||||
import { currentInstanceAtom, popCurrentInstanceAtom } from "~/state/user";
|
||||
import { animations } from "~/theme";
|
||||
|
||||
//TODO DRY: The header style for settings is very similar to the shared routed ones.
|
||||
//TODO I suspect that the setting header style is not updated when theme changes because we don't use withUnistyles
|
||||
@@ -85,14 +87,11 @@ const styles = StyleSheet.create((theme) => ({
|
||||
paddingBottom: theme.gap(4),
|
||||
flexDirection: "row",
|
||||
backgroundColor: "transparent",
|
||||
justifyContent: "space-around",
|
||||
},
|
||||
tabBarBackground: {
|
||||
...StyleSheet.absoluteFillObject,
|
||||
|
||||
borderTopLeftRadius: theme.borderRadius,
|
||||
borderTopRightRadius: theme.borderRadius,
|
||||
overflow: "hidden",
|
||||
backgroundColor: "transparent",
|
||||
justifyContent: "space-around",
|
||||
},
|
||||
hiddenTabList: { display: "none" },
|
||||
player: {
|
||||
@@ -125,11 +124,7 @@ export default function ProtectedLayout() {
|
||||
);
|
||||
const showPlayer = !queueIsEmpty || queueIsInfinite;
|
||||
const playerPresence = useAnimatedStyle(() => {
|
||||
const style = {
|
||||
stiffness: 1110,
|
||||
damping: 510,
|
||||
};
|
||||
return { opacity: withSpring(showPlayer ? 1 : 0, style) };
|
||||
return { opacity: withTiming(showPlayer ? 1 : 0, animations.fades) };
|
||||
}, [showPlayer]);
|
||||
if (user.error || !currentInstance) {
|
||||
if (currentInstance) popCurrentInstance();
|
||||
@@ -137,22 +132,21 @@ export default function ProtectedLayout() {
|
||||
}
|
||||
//TODO Proper handling of when user is loading
|
||||
return (
|
||||
<Tabs options={{ screenOptions: { freezeOnBlur: true } }}>
|
||||
<TabSlot style={styles.screen} />
|
||||
<Tabs>
|
||||
<BlurTargetView ref={bvTarget} style={{ flex: 1 }}>
|
||||
<TabSlot style={styles.screen} />
|
||||
</BlurTargetView>
|
||||
<View style={styles.footer} onLayout={onLayout}>
|
||||
<View style={styles.player}>
|
||||
{/* TODO blur behing player, like iOS */}
|
||||
{showPlayer && (
|
||||
<Animated.View style={playerPresence}>
|
||||
<MinimisedPlayer />
|
||||
<MinimisedPlayer blurTarget={bvTarget} />
|
||||
</Animated.View>
|
||||
)}
|
||||
</View>
|
||||
<ExpandedPlayerSlot />
|
||||
<ExpandedPlayerSlot blurTarget={bvTarget} />
|
||||
<PlayerContext />
|
||||
<View style={styles.tabBar}>
|
||||
<BlurView style={styles.tabBarBackground} />
|
||||
|
||||
<BlurView blurTarget={bvTarget} style={styles.tabBar}>
|
||||
<TabTrigger name="(home)" asChild>
|
||||
<TabButton icon={HomeIcon} />
|
||||
</TabTrigger>
|
||||
@@ -165,7 +159,7 @@ export default function ProtectedLayout() {
|
||||
<TabTrigger name="settings" asChild>
|
||||
<TabButton icon={SettingsIcon} />
|
||||
</TabTrigger>
|
||||
</View>
|
||||
</BlurView>
|
||||
</View>
|
||||
{/* Shrug https://docs.expo.dev/router/advanced/custom-tabs/#multiple-tab-bars */}
|
||||
<TabList style={styles.hiddenTabList}>
|
||||
@@ -180,7 +174,7 @@ export default function ProtectedLayout() {
|
||||
/>
|
||||
<TabTrigger
|
||||
name="settings"
|
||||
href="/(protected)/(nav)/settings"
|
||||
href="/(protected)/(nav)/(settings)"
|
||||
/>
|
||||
</TabList>
|
||||
</Tabs>
|
||||
|
||||
@@ -1,383 +0,0 @@
|
||||
/*
|
||||
* Meelo is a music server and application to enjoy your personal music files anywhere, anytime you want.
|
||||
* Copyright (C) 2023
|
||||
*
|
||||
* Meelo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Meelo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useNavigation } from "expo-router";
|
||||
import { openBrowserAsync } from "expo-web-browser";
|
||||
import i18next from "i18next";
|
||||
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||
import { Fragment, useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import {
|
||||
getCurrentUserStatus,
|
||||
getMatcherVersion,
|
||||
getScannerVersion,
|
||||
getSettings,
|
||||
} from "@/api/queries";
|
||||
import { emptyPlaylistAtom } from "@/state/player";
|
||||
import {
|
||||
CheckIcon,
|
||||
DeleteIcon,
|
||||
ExpandMoreIcon,
|
||||
MoreIcon,
|
||||
OpenExternalIcon,
|
||||
UncheckIcon,
|
||||
} from "@/ui/icons";
|
||||
import { getAPI_, useQuery, useQueryClient } from "~/api";
|
||||
import { SelectModalButton } from "~/components/bottom-modal-sheet/select";
|
||||
import { InstanceButton } from "~/components/instance-button";
|
||||
import { LoadableText } from "~/components/loadable_text";
|
||||
import { useLoginForm } from "~/components/login-form";
|
||||
import { SafeScrollView } from "~/components/safe-view";
|
||||
import { SectionHeader } from "~/components/section-header";
|
||||
import { useColorScheme } from "~/hooks/color-scheme";
|
||||
import { Button } from "~/primitives/button";
|
||||
import { Divider } from "~/primitives/divider";
|
||||
import { Icon } from "~/primitives/icon";
|
||||
import { Pressable } from "~/primitives/pressable";
|
||||
import { Text } from "~/primitives/text";
|
||||
import { showSuccessToast } from "~/primitives/toast";
|
||||
import { colorSchemePreference } from "~/state/color-scheme";
|
||||
import { languagePreference } from "~/state/lang";
|
||||
import {
|
||||
currentInstanceAtom,
|
||||
deleteOtherInstanceAtom,
|
||||
type MeeloInstance,
|
||||
otherInstancesAtom,
|
||||
popCurrentInstanceAtom,
|
||||
} from "~/state/user";
|
||||
import { Languages } from "../../../../../../translations";
|
||||
|
||||
const BuildCommit =
|
||||
process.env.EXPO_PUBLIC_BUILD_COMMIT ??
|
||||
(process.env.NODE_ENV === "development" ? "dev" : "unknown");
|
||||
|
||||
const useResetAllTabs = () => {
|
||||
const navigation = useNavigation();
|
||||
|
||||
return useCallback(() => {
|
||||
const st = navigation.getState();
|
||||
if (!st) {
|
||||
return;
|
||||
}
|
||||
navigation.reset({
|
||||
...st,
|
||||
history: [],
|
||||
routes: st.routes.map((r) => ({
|
||||
...r,
|
||||
state: undefined,
|
||||
})),
|
||||
} as any);
|
||||
}, [navigation]);
|
||||
};
|
||||
|
||||
export default function SettingsView() {
|
||||
const resetAllTabs = useResetAllTabs();
|
||||
const queryClient = useQueryClient();
|
||||
const { data: user } = useQuery(getCurrentUserStatus);
|
||||
const emptyPlaylist = useSetAtom(emptyPlaylistAtom);
|
||||
const otherInstances = useAtomValue(otherInstancesAtom);
|
||||
const [currentInstance, setCurrentInstance] = useAtom(currentInstanceAtom);
|
||||
const { t } = useTranslation();
|
||||
const popCurrentInstance = useSetAtom(popCurrentInstanceAtom);
|
||||
const deleteOtherInstance = useSetAtom(deleteOtherInstanceAtom);
|
||||
const insets = useSafeAreaInsets();
|
||||
const [colorSchemePref, setColorSchemePref] = useAtom(
|
||||
colorSchemePreference,
|
||||
);
|
||||
const onLeavingInstance = useCallback(() => {
|
||||
emptyPlaylist();
|
||||
queryClient.client.clear();
|
||||
resetAllTabs();
|
||||
}, [emptyPlaylist, queryClient, resetAllTabs]);
|
||||
const { openLoginForm } = useLoginForm({
|
||||
onLogin: async (data) => {
|
||||
const api = getAPI_(data.token, data.instanceUrl);
|
||||
const res = await getCurrentUserStatus().exec(api)();
|
||||
onLeavingInstance();
|
||||
popCurrentInstance();
|
||||
setCurrentInstance({
|
||||
url: data.instanceUrl,
|
||||
accessToken: data.token,
|
||||
username: res.name,
|
||||
});
|
||||
showSuccessToast({ text: t("toasts.auth.serverSwitchSuccessful") });
|
||||
},
|
||||
});
|
||||
const [lng, setLng] = useAtom(languagePreference);
|
||||
const { data: apiSettings } = useQuery(getSettings);
|
||||
const { data: scannerVersion } = useQuery(getScannerVersion);
|
||||
const { data: matcherVersion } = useQuery(getMatcherVersion);
|
||||
const actualColorScheme = useColorScheme();
|
||||
const onOtherInstanceSelect = useCallback(
|
||||
(instance: MeeloInstance) => {
|
||||
onLeavingInstance();
|
||||
popCurrentInstance();
|
||||
deleteOtherInstance(instance);
|
||||
setCurrentInstance(instance);
|
||||
},
|
||||
[onLeavingInstance, popCurrentInstanceAtom, setCurrentInstance],
|
||||
);
|
||||
return (
|
||||
<SafeScrollView style={[styles.root, { paddingTop: insets.top }]}>
|
||||
<View style={styles.header}>
|
||||
<Text content={t("nav.settings")} variant="h2" />
|
||||
</View>
|
||||
<Divider h />
|
||||
<View style={styles.section}>
|
||||
<SectionHeader
|
||||
style={styles.sectionHeader}
|
||||
content={t("settings.interface")}
|
||||
skeletonWidth={0}
|
||||
/>
|
||||
<View style={styles.sectionRow}>
|
||||
<Text
|
||||
content={t("settings.ui.useSystemTheme")}
|
||||
variant="h5"
|
||||
/>
|
||||
<Pressable
|
||||
onPress={() => {
|
||||
if (colorSchemePref === "system") {
|
||||
setColorSchemePref(actualColorScheme);
|
||||
} else {
|
||||
setColorSchemePref("system");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
variant={
|
||||
colorSchemePref === "system"
|
||||
? "Bold"
|
||||
: "Outline"
|
||||
}
|
||||
icon={
|
||||
colorSchemePref === "system"
|
||||
? CheckIcon
|
||||
: UncheckIcon
|
||||
}
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
|
||||
<View style={styles.sectionRow}>
|
||||
<Text
|
||||
content={t("settings.ui.useDarkTheme")}
|
||||
variant="h5"
|
||||
/>
|
||||
<Pressable
|
||||
disabled={colorSchemePref === "system"}
|
||||
onPress={() => {
|
||||
setColorSchemePref(
|
||||
colorSchemePref === "dark" ? "light" : "dark",
|
||||
);
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
style={
|
||||
colorSchemePref === "system"
|
||||
? styles.disabledCheckButton
|
||||
: undefined
|
||||
}
|
||||
icon={
|
||||
actualColorScheme === "dark"
|
||||
? CheckIcon
|
||||
: UncheckIcon
|
||||
}
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
|
||||
<View style={styles.sectionRow}>
|
||||
<Text content={t("settings.ui.language")} variant="h5" />
|
||||
<SelectModalButton
|
||||
header={t("settings.ui.language")}
|
||||
closeOnSelect
|
||||
values={Languages}
|
||||
isSelected={(item) => lng === item}
|
||||
buttonProps={{
|
||||
title: t(
|
||||
`settings.ui.lang.${i18next.language as "en"}`,
|
||||
),
|
||||
width: "fitContent",
|
||||
icon: ExpandMoreIcon,
|
||||
iconPosition: "right",
|
||||
size: "small",
|
||||
}}
|
||||
onSelect={(selected) => {
|
||||
setLng(selected);
|
||||
}}
|
||||
formatItem={(item) =>
|
||||
t(`settings.ui.lang.${item}`, {
|
||||
lng: item,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{user?.admin && (
|
||||
<>
|
||||
<Divider h />
|
||||
<View style={styles.section}>
|
||||
<SectionHeader
|
||||
style={styles.sectionHeader}
|
||||
content={t("settings.users.admin")}
|
||||
skeletonWidth={0}
|
||||
/>
|
||||
<Button
|
||||
title={t("settings.manageFromWebApp")}
|
||||
onPress={() =>
|
||||
openBrowserAsync(
|
||||
queryClient.api.urls.api.replace(
|
||||
"/api",
|
||||
"/settings",
|
||||
),
|
||||
)
|
||||
}
|
||||
width="fill"
|
||||
icon={OpenExternalIcon}
|
||||
iconPosition="right"
|
||||
containerStyle={{ justifyContent: "center" }}
|
||||
/>
|
||||
</View>
|
||||
</>
|
||||
)}
|
||||
<Divider h />
|
||||
|
||||
{otherInstances.length > 0 && (
|
||||
<View style={styles.section}>
|
||||
<SectionHeader
|
||||
style={styles.sectionHeader}
|
||||
content={t("actions.switchServer")}
|
||||
skeletonWidth={0}
|
||||
/>
|
||||
|
||||
{currentInstance && (
|
||||
<>
|
||||
<View style={styles.instanceButtonContainer}>
|
||||
<InstanceButton
|
||||
enabled={false}
|
||||
instance={currentInstance}
|
||||
trailing="(Current)"
|
||||
/>
|
||||
</View>
|
||||
<Divider h withInsets />
|
||||
</>
|
||||
)}
|
||||
{otherInstances.map((instance, idx) => (
|
||||
<Fragment key={idx}>
|
||||
<View style={styles.instanceButtonContainer}>
|
||||
<InstanceButton
|
||||
enabled
|
||||
instance={instance}
|
||||
actions={[
|
||||
{
|
||||
icon: DeleteIcon,
|
||||
onPress: () =>
|
||||
deleteOtherInstance(instance),
|
||||
},
|
||||
{
|
||||
icon: MoreIcon,
|
||||
onPress: () =>
|
||||
onOtherInstanceSelect(instance),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</View>
|
||||
<Divider h withInsets />
|
||||
</Fragment>
|
||||
))}
|
||||
</View>
|
||||
)}
|
||||
<View style={styles.section}>
|
||||
<Button
|
||||
title={t("actions.connectToNewServer")}
|
||||
containerStyle={{ alignItems: "center" }}
|
||||
labelStyle={styles.logoutButtonStyle}
|
||||
onPress={openLoginForm}
|
||||
width="fill"
|
||||
/>
|
||||
<Button
|
||||
title={t("actions.logout")}
|
||||
width="fill"
|
||||
containerStyle={{ alignItems: "center" }}
|
||||
labelStyle={styles.logoutButtonStyle}
|
||||
onPress={() => {
|
||||
onLeavingInstance();
|
||||
popCurrentInstance();
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<Divider h />
|
||||
<View style={[styles.footer, styles.section]}>
|
||||
<Text
|
||||
style={styles.versionNumber}
|
||||
content={`Build: ${BuildCommit}`}
|
||||
/>
|
||||
{(
|
||||
[
|
||||
["API", apiSettings],
|
||||
["Scanner", scannerVersion],
|
||||
["Matcher", matcherVersion],
|
||||
] as const
|
||||
).map(([serviceName, versionQuery]) => (
|
||||
<LoadableText
|
||||
key={serviceName}
|
||||
style={styles.versionNumber}
|
||||
content={
|
||||
apiSettings
|
||||
? `${serviceName} version: ${versionQuery ? (versionQuery.version ?? "Unknown") : "Loading"}`
|
||||
: undefined
|
||||
}
|
||||
skeletonWidth={15}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
</SafeScrollView>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
root: { paddingHorizontal: theme.gap(1) },
|
||||
header: { paddingHorizontal: theme.gap(1), paddingVertical: theme.gap(2) },
|
||||
section: {
|
||||
paddingVertical: theme.gap(1),
|
||||
gap: theme.gap(1),
|
||||
},
|
||||
sectionHeader: { marginLeft: -theme.gap(1) },
|
||||
sectionRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
width: "100%",
|
||||
paddingBottom: theme.gap(0.5),
|
||||
paddingHorizontal: theme.gap(1),
|
||||
},
|
||||
disabledCheckButton: { color: theme.colors.text.secondary },
|
||||
logoutButtonStyle: { flex: 1 },
|
||||
footer: {
|
||||
color: theme.colors.text.secondary,
|
||||
width: "100%",
|
||||
alignItems: "center",
|
||||
gap: theme.gap(2),
|
||||
},
|
||||
versionNumber: { color: theme.colors.text.secondary },
|
||||
instanceButtonContainer: { paddingHorizontal: theme.gap(1) },
|
||||
}));
|
||||
@@ -5,7 +5,6 @@ export default function ProtectedRoot() {
|
||||
<Stack
|
||||
screenOptions={{
|
||||
freezeOnBlur: true,
|
||||
animation: "none",
|
||||
headerShown: false,
|
||||
headerTransparent: true,
|
||||
contentStyle: { backgroundColor: "transparent", flex: 1 },
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import * as Device from "expo-device";
|
||||
import { Stack } from "expo-router";
|
||||
import * as ScreenOrientation from "expo-screen-orientation";
|
||||
import { useEffect } from "react";
|
||||
import Coverflow from "~/pages/coverflow";
|
||||
|
||||
export default function CoverflowView() {
|
||||
//NOTE: This is broken for ios in expo 55.0 (?)
|
||||
useEffect(() => {
|
||||
const isMobile = Device.deviceType === Device.DeviceType.PHONE;
|
||||
if (isMobile) {
|
||||
ScreenOrientation.lockAsync(
|
||||
ScreenOrientation.OrientationLock.LANDSCAPE,
|
||||
);
|
||||
}
|
||||
return () => {
|
||||
if (isMobile) {
|
||||
ScreenOrientation.lockAsync(
|
||||
ScreenOrientation.OrientationLock.PORTRAIT_UP,
|
||||
);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
orientation: "landscape",
|
||||
headerShown: false,
|
||||
statusBarHidden: true,
|
||||
navigationBarHidden: true,
|
||||
animation: "fade",
|
||||
gestureEnabled: false,
|
||||
}}
|
||||
/>
|
||||
<Coverflow />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,11 @@ import * as ScreenOrientation from "expo-screen-orientation";
|
||||
import { setStatusBarHidden } from "expo-status-bar";
|
||||
import { useAtom, useAtomValue } from "jotai";
|
||||
import { useCallback, useEffect } from "react";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { Platform } from "react-native";
|
||||
import {
|
||||
SafeAreaView,
|
||||
useSafeAreaInsets,
|
||||
} from "react-native-safe-area-context";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import { VideoView } from "react-native-video";
|
||||
import { videoPlayerAtom } from "~/components/player/context";
|
||||
@@ -19,12 +23,9 @@ export default function FullscreenVideoPlayer() {
|
||||
const [currentTrack] = useAtom(currentTrackAtom);
|
||||
const player = useAtomValue(videoPlayerAtom);
|
||||
const closePlayer = useCallback(() => {
|
||||
if (isMobile) {
|
||||
ScreenOrientation.lockAsync(
|
||||
ScreenOrientation.OrientationLock.PORTRAIT,
|
||||
).then(() => router.back());
|
||||
} else router.back();
|
||||
router.back();
|
||||
}, [isMobile]);
|
||||
|
||||
useEffect(() => {
|
||||
if (currentTrack?.track.type !== "Video") closePlayer();
|
||||
}, [currentTrack, closePlayer]);
|
||||
@@ -33,21 +34,38 @@ export default function FullscreenVideoPlayer() {
|
||||
// Allowing mobiles to use landscape mode
|
||||
ScreenOrientation.unlockAsync();
|
||||
}
|
||||
setStatusBarHidden(true);
|
||||
if (Platform.OS !== "ios") {
|
||||
setStatusBarHidden(true);
|
||||
}
|
||||
return () => {
|
||||
if (isMobile) {
|
||||
ScreenOrientation.lockAsync(
|
||||
ScreenOrientation.OrientationLock.PORTRAIT_UP,
|
||||
);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
const insets = useSafeAreaInsets();
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerShown: false,
|
||||
presentation: "fullScreenModal",
|
||||
// NOTE: Bugged on iOS, and actually not needed anyway
|
||||
// presentation: "fullScreenModal",
|
||||
statusBarHidden: true,
|
||||
navigationBarHidden: true,
|
||||
animation: "none",
|
||||
animation: "slide_from_right",
|
||||
}}
|
||||
/>
|
||||
<SafeAreaView style={styles.root}>
|
||||
<Controls style={styles.controls} close={closePlayer} />
|
||||
<Controls
|
||||
style={[
|
||||
styles.controls,
|
||||
{ top: insets.top, bottom: insets.bottom },
|
||||
]}
|
||||
close={closePlayer}
|
||||
/>
|
||||
{player && (
|
||||
<VideoView
|
||||
player={player}
|
||||
@@ -63,11 +81,8 @@ export default function FullscreenVideoPlayer() {
|
||||
const styles = StyleSheet.create(() => ({
|
||||
root: { flex: 1, backgroundColor: "#000000" },
|
||||
controls: {
|
||||
alignSelf: "center",
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
zIndex: 1,
|
||||
},
|
||||
}));
|
||||
@@ -26,17 +26,18 @@ import {
|
||||
Rubik_900Black,
|
||||
} from "@expo-google-fonts/rubik";
|
||||
import { useFonts } from "expo-font";
|
||||
import { Stack } from "expo-router";
|
||||
import { DefaultTheme, Stack, ThemeProvider } from "expo-router";
|
||||
import * as SplashScreen from "expo-splash-screen";
|
||||
import i18next from "i18next";
|
||||
import { Provider } from "jotai";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
||||
import { store } from "@/state/store";
|
||||
import "intl-pluralrules";
|
||||
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { BlurTargetView } from "expo-blur";
|
||||
import * as Device from "expo-device";
|
||||
import * as ScreenOrientation from "expo-screen-orientation";
|
||||
import { KeyboardProvider } from "react-native-keyboard-controller";
|
||||
@@ -44,6 +45,7 @@ import { UnistylesRuntime } from "react-native-unistyles";
|
||||
import { DefaultQueryOptions } from "@/api/query";
|
||||
import { BackgroundGradient } from "~/components/background-gradient";
|
||||
import { Modal } from "~/components/bottom-modal-sheet";
|
||||
import { DownloadManager } from "~/downloads";
|
||||
import { useColorScheme } from "~/hooks/color-scheme";
|
||||
import { ToastManager } from "~/primitives/toast";
|
||||
import { colorSchemePreference } from "~/state/color-scheme";
|
||||
@@ -81,7 +83,11 @@ export default function RootLayout() {
|
||||
() =>
|
||||
new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: DefaultQueryOptions,
|
||||
queries: {
|
||||
...DefaultQueryOptions,
|
||||
refetchOnMount: false,
|
||||
refetchOnWindowFocus: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
@@ -108,63 +114,85 @@ export default function RootLayout() {
|
||||
lock.then(() => SplashScreen.hideAsync());
|
||||
}
|
||||
}, [loaded, error]);
|
||||
const blurTarget = useRef(null);
|
||||
|
||||
if (!loaded) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<GestureHandlerRootView>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Provider store={store}>
|
||||
<ColorSchemeProvider>
|
||||
<BottomSheetModalProvider>
|
||||
<KeyboardProvider>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
animation: "none",
|
||||
animationTypeForReplace: "pop",
|
||||
headerShown: false,
|
||||
contentStyle: {
|
||||
flex: 1,
|
||||
},
|
||||
statusBarStyle:
|
||||
actualColorScheme === "light"
|
||||
? "dark"
|
||||
: "light",
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="(protected)"
|
||||
options={{
|
||||
contentStyle: {
|
||||
backgroundColor: "transparent",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<ThemeProvider
|
||||
value={{
|
||||
...DefaultTheme,
|
||||
// NOTE: PR #47121 from expo forces the bg color of stacks to be set
|
||||
// We do not want this becase we rely on the bg to be transparent for the bg gradient
|
||||
colors: { ...DefaultTheme.colors, background: "transparent" },
|
||||
}}
|
||||
>
|
||||
<GestureHandlerRootView>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Provider store={store}>
|
||||
<ColorSchemeProvider>
|
||||
<BottomSheetModalProvider>
|
||||
<KeyboardProvider>
|
||||
<DownloadManager />
|
||||
<BlurTargetView
|
||||
ref={blurTarget}
|
||||
style={{ flex: 1 }}
|
||||
>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
animation: "default",
|
||||
headerShown: false,
|
||||
contentStyle: {
|
||||
flex: 1,
|
||||
},
|
||||
statusBarStyle:
|
||||
actualColorScheme ===
|
||||
"light"
|
||||
? "dark"
|
||||
: "light",
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="(protected)"
|
||||
options={{
|
||||
animationTypeForReplace:
|
||||
"push",
|
||||
contentStyle: {
|
||||
zIndex: 1,
|
||||
backgroundColor:
|
||||
"transparent",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="auth"
|
||||
options={{
|
||||
contentStyle: {
|
||||
backgroundColor:
|
||||
(actualColorScheme ===
|
||||
"dark"
|
||||
? appThemes.dark
|
||||
: appThemes.light
|
||||
).colors.background,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
<Modal />
|
||||
</KeyboardProvider>
|
||||
</BottomSheetModalProvider>
|
||||
<BackgroundGradient />
|
||||
</ColorSchemeProvider>
|
||||
</Provider>
|
||||
<ToastManager />
|
||||
</QueryClientProvider>
|
||||
</GestureHandlerRootView>
|
||||
<Stack.Screen
|
||||
name="auth"
|
||||
options={{
|
||||
animationTypeForReplace:
|
||||
"pop",
|
||||
contentStyle: {
|
||||
backgroundColor:
|
||||
(actualColorScheme ===
|
||||
"dark"
|
||||
? appThemes.dark
|
||||
: appThemes.light
|
||||
).colors.background,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
</BlurTargetView>
|
||||
<Modal blurTarget={blurTarget} />
|
||||
</KeyboardProvider>
|
||||
</BottomSheetModalProvider>
|
||||
<BackgroundGradient />
|
||||
</ColorSchemeProvider>
|
||||
</Provider>
|
||||
<ToastManager />
|
||||
</QueryClientProvider>
|
||||
</GestureHandlerRootView>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { FlashList } from "@shopify/flash-list";
|
||||
import Animated from "react-native-reanimated";
|
||||
|
||||
export const AnimatedFlashlist = Animated.createAnimatedComponent(
|
||||
FlashList,
|
||||
) as typeof FlashList;
|
||||
@@ -0,0 +1,25 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import type { View } from "react-native";
|
||||
import type { Area } from "@/models/area";
|
||||
import { Pressable } from "~/primitives/pressable";
|
||||
import { Text } from "~/primitives/text";
|
||||
import { useContextMenu } from "./context-menu";
|
||||
import { useAreaContextMenu } from "./context-menu/resource/area";
|
||||
|
||||
export const AreaButton = ({
|
||||
area,
|
||||
textProps,
|
||||
containerProps,
|
||||
}: {
|
||||
area: Area;
|
||||
textProps: Omit<ComponentProps<typeof Text>, "children" | "content">;
|
||||
containerProps: ComponentProps<typeof View>;
|
||||
}) => {
|
||||
const areaContextMenu = useAreaContextMenu(area);
|
||||
const { openContextMenu } = useContextMenu(areaContextMenu);
|
||||
return (
|
||||
<Pressable onPress={openContextMenu} {...containerProps}>
|
||||
<Text content={area.name} {...textProps} />
|
||||
</Pressable>
|
||||
);
|
||||
};
|
||||
@@ -10,6 +10,7 @@ import { atom, useAtom, useAtomValue } from "jotai";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { View } from "react-native";
|
||||
import {
|
||||
ReduceMotion,
|
||||
useDerivedValue,
|
||||
useSharedValue,
|
||||
withTiming,
|
||||
@@ -80,18 +81,23 @@ export const BackgroundGradient = () => {
|
||||
if (keyIllustration) {
|
||||
currentColor1.value = withTiming(keyIllustration.colors[0], {
|
||||
duration: transitionDuration,
|
||||
reduceMotion: ReduceMotion.Never,
|
||||
});
|
||||
currentColor2.value = withTiming(keyIllustration.colors[1], {
|
||||
duration: transitionDuration,
|
||||
reduceMotion: ReduceMotion.Never,
|
||||
});
|
||||
currentColor3.value = withTiming(keyIllustration.colors[2], {
|
||||
duration: transitionDuration,
|
||||
reduceMotion: ReduceMotion.Never,
|
||||
});
|
||||
currentColor4.value = withTiming(keyIllustration.colors[3], {
|
||||
duration: transitionDuration,
|
||||
reduceMotion: ReduceMotion.Never,
|
||||
});
|
||||
currentColor5.value = withTiming(keyIllustration.colors[4], {
|
||||
duration: transitionDuration,
|
||||
reduceMotion: ReduceMotion.Never,
|
||||
});
|
||||
}
|
||||
}, [keyIllustration]);
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import { BlurView as BV } from "expo-blur";
|
||||
import { createRef } from "react";
|
||||
import type { View } from "react-native";
|
||||
import { withUnistyles } from "react-native-unistyles";
|
||||
|
||||
export const bvTarget = createRef<View | null>();
|
||||
|
||||
export const BlurView = withUnistyles(
|
||||
BV,
|
||||
(theme) =>
|
||||
({
|
||||
tint: theme.name === "light" ? "light" : "dark",
|
||||
experimentalBlurMethod: "dimezisBlurView",
|
||||
tint:
|
||||
theme.name === "light"
|
||||
? "systemThinMaterialLight"
|
||||
: "systemThinMaterialDark",
|
||||
blurMethod: "dimezisBlurViewSdk31Plus",
|
||||
intensity: 80,
|
||||
}) as const,
|
||||
);
|
||||
@@ -4,25 +4,44 @@ import {
|
||||
BottomSheetModal,
|
||||
BottomSheetView,
|
||||
} from "@gorhom/bottom-sheet";
|
||||
import { atom, useAtom, useSetAtom } from "jotai";
|
||||
import { type ReactNode, useCallback, useEffect, useRef } from "react";
|
||||
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||
import {
|
||||
type ReactNode,
|
||||
type RefObject,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useRef,
|
||||
} from "react";
|
||||
import { View } from "react-native";
|
||||
import { ReduceMotion } from "react-native-reanimated";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import { BlurView } from "~/components/blur-view";
|
||||
import { BlurView } from "../blur-view";
|
||||
|
||||
type ModalAtom = { content: () => ReactNode; onDismiss?: () => void };
|
||||
type ModalAtom<Args extends any[] = []> = {
|
||||
content: (...args: Args) => ReactNode;
|
||||
onDismiss?: () => void;
|
||||
cannotBeDismissed?: boolean;
|
||||
};
|
||||
|
||||
const modalAtom = atom<ModalAtom | null>(null);
|
||||
|
||||
export const closeModalAtom = atom(null, (_, set) => set(modalAtom, null));
|
||||
|
||||
export const useModal = (p: ModalAtom) => {
|
||||
export const useModal = <Args extends any[] = []>(p: ModalAtom<Args>) => {
|
||||
const setModalContent = useSetAtom(modalAtom);
|
||||
const openModal = useCallback(() => setModalContent(p), [p]);
|
||||
const openModal = useCallback(
|
||||
(...args: Args) =>
|
||||
setModalContent({ ...p, content: () => p.content(...args) }),
|
||||
[p],
|
||||
);
|
||||
return { openModal };
|
||||
};
|
||||
|
||||
export const Modal = () => {
|
||||
export const Modal = ({
|
||||
blurTarget,
|
||||
}: {
|
||||
blurTarget: RefObject<View | null>;
|
||||
}) => {
|
||||
const [modalContent, setModalContent] = useAtom(modalAtom);
|
||||
const onClose = useCallback(() => {
|
||||
modalContent?.onDismiss?.();
|
||||
@@ -43,13 +62,14 @@ export const Modal = () => {
|
||||
<BottomSheetModal
|
||||
ref={modalRef}
|
||||
enableDynamicSizing
|
||||
overrideReduceMotion={ReduceMotion.Never}
|
||||
// Note: When a ctx menu is open from the expanded player, we don't want to 'switch'
|
||||
stackBehavior="push"
|
||||
handleIndicatorStyle={styles.handleIndicator}
|
||||
onDismiss={onClose}
|
||||
backgroundComponent={() => (
|
||||
<View style={styles.modalBackground}>
|
||||
<BlurView style={{ flex: 1 }} />
|
||||
<BlurView blurTarget={blurTarget} style={{ flex: 1 }} />
|
||||
</View>
|
||||
)}
|
||||
keyboardBehavior="interactive"
|
||||
@@ -65,13 +85,14 @@ export const Modal = () => {
|
||||
|
||||
// The expanded player uses this as well
|
||||
export const ModalBackdrop = (props: BottomSheetBackdropProps) => {
|
||||
const modal = useAtomValue(modalAtom);
|
||||
return (
|
||||
<BottomSheetBackdrop
|
||||
{...props}
|
||||
opacity={0.4}
|
||||
disappearsOnIndex={-1}
|
||||
appearsOnIndex={0}
|
||||
pressBehavior={"close"}
|
||||
pressBehavior={modal?.cannotBeDismissed ? "none" : "close"}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,57 +1,93 @@
|
||||
import { useBottomSheetModal } from "@gorhom/bottom-sheet";
|
||||
import { type ComponentProps, useCallback } from "react";
|
||||
import { type ComponentProps, useCallback, useEffect, useState } from "react";
|
||||
import { View } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import type { Icon as IconType } from "@/ui/icons";
|
||||
import { CheckIcon, CloseIcon, type Icon as IconType } from "@/ui/icons";
|
||||
import { Chip } from "~/components/chip";
|
||||
import { Button } from "~/primitives/button";
|
||||
import { Text } from "~/primitives/text";
|
||||
import { useModal } from ".";
|
||||
|
||||
type Props<T> = {
|
||||
type Props<T, S> = {
|
||||
header?: string;
|
||||
values: readonly T[];
|
||||
isSelected: (item: T) => boolean;
|
||||
onSelect: (item: T) => void;
|
||||
selected: S;
|
||||
checkIcon?: (st: S) => IconType;
|
||||
isSelected: (item: T, state: S) => boolean;
|
||||
onSave: (selected: S) => void;
|
||||
formatItem: (item: T) => string;
|
||||
checkIcon?: IconType;
|
||||
onItemSelect: (item: T, state: S) => S;
|
||||
closeOnSelect?: boolean;
|
||||
};
|
||||
|
||||
export const SelectBottomModalContent = <T,>({
|
||||
export const SelectBottomModalContent = <T, S>({
|
||||
header,
|
||||
values,
|
||||
isSelected,
|
||||
onSelect,
|
||||
selected,
|
||||
onItemSelect,
|
||||
onSave,
|
||||
formatItem,
|
||||
isSelected,
|
||||
checkIcon,
|
||||
closeOnSelect: dismissOnSelect,
|
||||
}: Props<T>) => {
|
||||
closeOnSelect,
|
||||
}: Props<T, S>) => {
|
||||
const [selectedState, setSelectedState] = useState<S>(selected);
|
||||
styles.useVariants({ hasButtons: !closeOnSelect });
|
||||
|
||||
const { dismiss } = useBottomSheetModal();
|
||||
useEffect(() => {
|
||||
setSelectedState(selected);
|
||||
}, [selected]);
|
||||
const onPress = useCallback(
|
||||
(t: T) => {
|
||||
if (dismissOnSelect) {
|
||||
dismiss();
|
||||
}
|
||||
onSelect(t);
|
||||
setSelectedState((st) => {
|
||||
const st1 = onItemSelect(t, st);
|
||||
if (closeOnSelect) {
|
||||
onSave(st1);
|
||||
dismiss();
|
||||
}
|
||||
return st1;
|
||||
});
|
||||
},
|
||||
[onSelect, dismiss],
|
||||
[onSave, setSelectedState, onItemSelect, dismiss],
|
||||
);
|
||||
return (
|
||||
<View style={styles.root}>
|
||||
{header && (
|
||||
<View style={styles.header}>
|
||||
<Text content={header} variant="h4" />
|
||||
</View>
|
||||
)}
|
||||
<View style={styles.header}>
|
||||
{!closeOnSelect && (
|
||||
<Button
|
||||
icon={CloseIcon}
|
||||
size="small"
|
||||
onPress={() => {
|
||||
dismiss();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{header && <Text content={header} variant="secondaryTitle" />}
|
||||
|
||||
{!closeOnSelect && (
|
||||
<Button
|
||||
icon={CheckIcon}
|
||||
size="small"
|
||||
onPress={() => {
|
||||
onSave(selectedState);
|
||||
dismiss();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
<View style={styles.grid}>
|
||||
{values.map((value, idx) => (
|
||||
<Chip
|
||||
filled={isSelected(value)}
|
||||
filled={isSelected(value, selectedState)}
|
||||
key={idx}
|
||||
title={formatItem(value)}
|
||||
onPress={() => onPress(value)}
|
||||
icon={isSelected(value) ? checkIcon : undefined}
|
||||
icon={
|
||||
isSelected(value, selectedState)
|
||||
? checkIcon?.(selectedState)
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
@@ -61,7 +97,23 @@ export const SelectBottomModalContent = <T,>({
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
root: { width: "100%" },
|
||||
header: { width: "100%", alignItems: "center" },
|
||||
header: {
|
||||
width: "100%",
|
||||
alignItems: "center",
|
||||
flexDirection: "row",
|
||||
variants: {
|
||||
hasButtons: {
|
||||
true: {
|
||||
justifyContent: "space-between",
|
||||
},
|
||||
false: {
|
||||
justifyContent: "center",
|
||||
},
|
||||
},
|
||||
},
|
||||
gap: theme.gap(1),
|
||||
paddingHorizontal: theme.gap(1),
|
||||
},
|
||||
grid: {
|
||||
padding: theme.gap(2),
|
||||
paddingBottom: theme.gap(3),
|
||||
@@ -72,10 +124,10 @@ const styles = StyleSheet.create((theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const SelectModalButton = <T,>({
|
||||
export const SelectModalButton = <T, S>({
|
||||
buttonProps,
|
||||
...props
|
||||
}: Props<T> & {
|
||||
}: Props<T, S> & {
|
||||
buttonProps: Omit<
|
||||
ComponentProps<typeof Button>,
|
||||
"propagateToParent" | "onPress"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type Album from "@/models/album";
|
||||
import { AlbumType } from "@/models/album";
|
||||
@@ -139,32 +139,20 @@ export const useChangeTypeModal = <Type extends string>(
|
||||
return { openModal };
|
||||
};
|
||||
|
||||
// We don't dismiss the modal when an item is clicked
|
||||
export const ChangeTypeModal = <T extends string>({
|
||||
types,
|
||||
translate,
|
||||
onSelect,
|
||||
selectedType,
|
||||
}: ChangeTypeModal<T>) => {
|
||||
const [selectedTypeState, setSelectedState] = useState(selectedType);
|
||||
const { t } = useTranslation();
|
||||
const onPress = useCallback(
|
||||
(t: T) => {
|
||||
if (t !== selectedTypeState) {
|
||||
onSelect(t);
|
||||
setSelectedState(t);
|
||||
}
|
||||
},
|
||||
[onSelect, selectedTypeState],
|
||||
);
|
||||
useEffect(() => {
|
||||
setSelectedState(selectedType);
|
||||
}, [selectedType]);
|
||||
return (
|
||||
<SelectBottomModalContent
|
||||
values={types}
|
||||
onSelect={onPress}
|
||||
isSelected={(v) => selectedTypeState === v}
|
||||
selected={selectedType ?? types[0]}
|
||||
onSave={onSelect}
|
||||
onItemSelect={(v) => v}
|
||||
isSelected={(v, st) => st === v}
|
||||
formatItem={(v) => t(translate(v))}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -46,7 +46,7 @@ export const Chip = ({
|
||||
content={title}
|
||||
skeletonWidth={5}
|
||||
style={styles.chipText}
|
||||
variant="subtitle"
|
||||
variant="buttonLabel"
|
||||
/>
|
||||
</Pressable>
|
||||
);
|
||||
@@ -59,6 +59,8 @@ const styles = StyleSheet.create((theme) => ({
|
||||
gap: theme.gap(1),
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
borderWidth: 1,
|
||||
borderColor: theme.colors.text.primary,
|
||||
variants: {
|
||||
disabled: {
|
||||
true: { opacity: 0.5 },
|
||||
@@ -67,15 +69,11 @@ const styles = StyleSheet.create((theme) => ({
|
||||
filled: {
|
||||
true: {
|
||||
backgroundColor: theme.colors.text.primary,
|
||||
borderWidth: 0,
|
||||
},
|
||||
false: {
|
||||
borderColor: theme.colors.text.primary,
|
||||
borderWidth: 1,
|
||||
},
|
||||
false: {},
|
||||
},
|
||||
},
|
||||
paddingVertical: theme.gap(0.5),
|
||||
paddingVertical: theme.gap(0.25),
|
||||
paddingHorizontal: theme.gap(1.5),
|
||||
},
|
||||
chipIcon: {
|
||||
|
||||
@@ -98,7 +98,6 @@ const ContextMenuHeader = ({ header }: { header: ContextMenuHeader }) => {
|
||||
illustration={header.illustration}
|
||||
quality={isThumbnail ? "medium" : "low"}
|
||||
{...(header.illustrationProps ?? {
|
||||
useBlurhash: true,
|
||||
variant: "center",
|
||||
})}
|
||||
/>
|
||||
@@ -106,7 +105,7 @@ const ContextMenuHeader = ({ header }: { header: ContextMenuHeader }) => {
|
||||
<View style={headerStyles.text}>
|
||||
<LoadableText
|
||||
content={header.title}
|
||||
variant="h6"
|
||||
variant="itemLabel"
|
||||
numberOfLines={1}
|
||||
skeletonWidth={15}
|
||||
/>
|
||||
@@ -114,7 +113,7 @@ const ContextMenuHeader = ({ header }: { header: ContextMenuHeader }) => {
|
||||
{header.subtitle !== null && (
|
||||
<LoadableText
|
||||
content={header.subtitle}
|
||||
variant="body"
|
||||
variant="itemText"
|
||||
numberOfLines={1}
|
||||
skeletonWidth={10}
|
||||
/>
|
||||
@@ -146,18 +145,24 @@ const ContextMenuItemComponent = ({ item }: { item: ContextMenuItem }) => {
|
||||
item.onPress?.();
|
||||
}}
|
||||
>
|
||||
<View style={styles.itemIcon}>
|
||||
<Icon
|
||||
icon={item.icon}
|
||||
style={item.disabled ? styles.disabled : undefined}
|
||||
/>
|
||||
</View>
|
||||
{item.icon && (
|
||||
<View style={styles.itemIcon}>
|
||||
<Icon
|
||||
icon={item.icon}
|
||||
style={item.disabled ? styles.disabled : undefined}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
<View style={styles.itemLabel}>
|
||||
<Text
|
||||
content={t(item.label)}
|
||||
variant="subtitle"
|
||||
variant="buttonLabel"
|
||||
style={item.disabled ? styles.disabled : undefined}
|
||||
/>
|
||||
|
||||
{item.subtitle && (
|
||||
<Text content={item.subtitle} style={styles.disabled} />
|
||||
)}
|
||||
</View>
|
||||
</Pressable>
|
||||
);
|
||||
@@ -176,7 +181,6 @@ const styles = StyleSheet.create((theme) => ({
|
||||
itemIcon: { aspectRatio: 1, alignItems: "center" },
|
||||
itemLabel: { width: "100%" },
|
||||
button: {
|
||||
transform: [{ rotate: "90deg" }],
|
||||
flex: 1,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { getCurrentUserStatus } from "@/api/queries";
|
||||
import type { AlbumWithRelations } from "@/models/album";
|
||||
import { getYear } from "@/utils/date";
|
||||
import { formatArtists_ } from "@/utils/format-artists";
|
||||
import {
|
||||
ChangeType,
|
||||
GoToArtist,
|
||||
@@ -22,7 +23,7 @@ import type {
|
||||
//TODO Refresh Metadata
|
||||
|
||||
export const useAlbumContextMenu = (
|
||||
album: AlbumWithRelations<"artist" | "illustration"> | undefined,
|
||||
album: AlbumWithRelations<"artists" | "illustration"> | undefined,
|
||||
): ContextMenuBuilder => {
|
||||
const { data: user } = useQuery(getCurrentUserStatus);
|
||||
const { t } = useTranslation();
|
||||
@@ -33,7 +34,10 @@ export const useAlbumContextMenu = (
|
||||
if (!album) {
|
||||
return undefined;
|
||||
}
|
||||
const artistName = album.artist?.name ?? t("compilationArtistLabel");
|
||||
const artistName =
|
||||
album.artists.length > 0
|
||||
? formatArtists_(album.artists)
|
||||
: t("compilationArtistLabel");
|
||||
if (album.releaseDate) {
|
||||
return [artistName, getYear(album.releaseDate)?.toString()].join(
|
||||
" • ",
|
||||
@@ -49,8 +53,12 @@ export const useAlbumContextMenu = (
|
||||
if (album?.masterId) {
|
||||
goToItems.push(GoToRelease(album.masterId));
|
||||
}
|
||||
if (album?.artistId) {
|
||||
goToItems.push(GoToArtist(album.artistId));
|
||||
if (album?.artists.length === 1) {
|
||||
goToItems.push(GoToArtist(album.artists[0].id));
|
||||
} else {
|
||||
for (const artist of album?.artists ?? []) {
|
||||
goToItems.push(GoToArtist(artist.id, artist.name));
|
||||
}
|
||||
}
|
||||
return {
|
||||
header: {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { getParentAreas } from "@/api/queries";
|
||||
import type { Area } from "@/models/area";
|
||||
import { AreaIcon, ArtistIcon, LabelIcon } from "@/ui/icons";
|
||||
import { useQuery } from "~/api";
|
||||
import type { ContextMenu, ContextMenuBuilder } from "..";
|
||||
|
||||
export const useAreaContextMenu = (
|
||||
area: Area | undefined,
|
||||
): ContextMenuBuilder => {
|
||||
const { data: parentAreas } = useQuery(getParentAreas, area?.id);
|
||||
const formattedParentAreas = useMemo(
|
||||
() =>
|
||||
parentAreas?.length === 0
|
||||
? null
|
||||
: parentAreas?.map((area) => area.name).join(", "),
|
||||
[parentAreas],
|
||||
);
|
||||
return useCallback(() => {
|
||||
return {
|
||||
header: {
|
||||
title: area?.name,
|
||||
subtitle: formattedParentAreas,
|
||||
illustration: null,
|
||||
illustrationProps: { fallbackIcon: AreaIcon },
|
||||
},
|
||||
items: area
|
||||
? [
|
||||
[
|
||||
{
|
||||
label: "actions.seeArtists",
|
||||
icon: ArtistIcon,
|
||||
href: `/artists?area=${area?.id}`,
|
||||
},
|
||||
|
||||
{
|
||||
label: "actions.seeLabels",
|
||||
icon: LabelIcon,
|
||||
href: `/labels?area=${area?.id}`,
|
||||
},
|
||||
],
|
||||
]
|
||||
: [],
|
||||
} satisfies ContextMenu;
|
||||
}, [area, parentAreas]);
|
||||
};
|
||||
@@ -20,7 +20,7 @@ export const useArtistContextMenu = (
|
||||
return {
|
||||
header: {
|
||||
illustration: artist?.illustration,
|
||||
illustrationProps: { variant: "circle", useBlurhash: true },
|
||||
illustrationProps: { variant: "circle" },
|
||||
title: artist?.name,
|
||||
subtitle: null,
|
||||
},
|
||||
|
||||
@@ -2,9 +2,11 @@ import { useSetAtom } from "jotai";
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getSongs } from "@/api/queries";
|
||||
import { transformPage } from "@/api/query";
|
||||
import type Genre from "@/models/genre";
|
||||
import { playFromInfiniteQuery } from "@/state/player";
|
||||
import {
|
||||
infiniteSongQueryToPlayerQuery,
|
||||
playFromInfiniteQuery,
|
||||
} from "@/state/player";
|
||||
import { AlbumIcon, GenreIcon, RadioIcon, SongIcon } from "@/ui/icons";
|
||||
import { getRandomNumber } from "@/utils/random";
|
||||
import { useQueryClient } from "~/api";
|
||||
@@ -19,19 +21,13 @@ export const useGenreContextMenu = (genre: Genre | undefined) => {
|
||||
return;
|
||||
}
|
||||
const seed = getRandomNumber();
|
||||
const query = transformPage(
|
||||
const query = infiniteSongQueryToPlayerQuery(
|
||||
getSongs({ genre: genre.id, random: seed }, undefined, [
|
||||
"artist",
|
||||
"featuring",
|
||||
"master",
|
||||
"illustration",
|
||||
]),
|
||||
(s) => ({
|
||||
id: s.id,
|
||||
track: { ...s.master, illustration: s.illustration },
|
||||
artist: s.artist,
|
||||
featuring: s.featuring,
|
||||
}),
|
||||
);
|
||||
playFromQuery(query, queryClient);
|
||||
}, [genre, queryClient]);
|
||||
|
||||
@@ -1,20 +1,68 @@
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { getSongs } from "@/api/queries";
|
||||
import type { Area } from "@/models/area";
|
||||
import type Label from "@/models/label";
|
||||
import { AlbumIcon, ArtistIcon, LabelIcon } from "@/ui/icons";
|
||||
import {
|
||||
infiniteSongQueryToPlayerQuery,
|
||||
playFromInfiniteQuery,
|
||||
} from "@/state/player";
|
||||
import { AlbumIcon, ArtistIcon, LabelIcon, RadioIcon } from "@/ui/icons";
|
||||
import { formatLabelDates } from "@/utils/format-label-dates";
|
||||
import { getRandomNumber } from "@/utils/random";
|
||||
import { useQueryClient } from "~/api";
|
||||
import type { ContextMenu } from "..";
|
||||
|
||||
export const useLabelContextMenu = (label: Label | undefined) => {
|
||||
const { t } = useTranslation();
|
||||
export const useLabelContextMenu = (
|
||||
label: (Label & { area?: Area | null }) | undefined,
|
||||
) => {
|
||||
const queryClient = useQueryClient();
|
||||
const playFromQuery = useSetAtom(playFromInfiniteQuery);
|
||||
const startLabelRadio = useCallback(() => {
|
||||
if (!label) {
|
||||
return;
|
||||
}
|
||||
const seed = getRandomNumber();
|
||||
const query = infiniteSongQueryToPlayerQuery(
|
||||
getSongs({ label: label.id, random: seed }, undefined, [
|
||||
"artist",
|
||||
"featuring",
|
||||
"master",
|
||||
"illustration",
|
||||
]),
|
||||
);
|
||||
playFromQuery(query, queryClient);
|
||||
}, [label, queryClient]);
|
||||
const subtitle = useMemo(() => {
|
||||
if (!label) {
|
||||
return undefined;
|
||||
}
|
||||
if (!label.startDate && !label.area) {
|
||||
return null;
|
||||
}
|
||||
return [
|
||||
formatLabelDates(label.startDate, label.endDate),
|
||||
label.area?.name,
|
||||
]
|
||||
.filter((item) => !!item)
|
||||
.join(" • ");
|
||||
}, [label]);
|
||||
return useCallback(() => {
|
||||
return {
|
||||
header: {
|
||||
title: label?.name,
|
||||
subtitle: t("models.label"),
|
||||
subtitle: subtitle,
|
||||
illustration: null,
|
||||
illustrationProps: { fallbackIcon: LabelIcon },
|
||||
},
|
||||
items: [
|
||||
[
|
||||
{
|
||||
label: "actions.label.startRadio",
|
||||
icon: RadioIcon,
|
||||
onPress: startLabelRadio,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
label: "actions.artist.seeAlbums",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useRoute } from "@react-navigation/native";
|
||||
import { useRoute } from "expo-router";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { useCallback } from "react";
|
||||
import { getCurrentUserStatus, getPlaylistEntries } from "@/api/queries";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useRoute } from "@react-navigation/native";
|
||||
import { useRouter } from "expo-router";
|
||||
import { useRoute, useRouter } from "expo-router";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { getAlbum, getCurrentUserStatus } from "@/api/queries";
|
||||
import type { ReleaseWithRelations } from "@/models/release";
|
||||
@@ -43,10 +42,11 @@ export const useReleaseContextMenu = (
|
||||
disabled: !release,
|
||||
onPress: () => {
|
||||
queryClient
|
||||
.fetchQuery(getAlbum(release!.albumId))
|
||||
.fetchQuery(getAlbum(release!.albumId, ["artists"]))
|
||||
.then(
|
||||
({ artistId }) =>
|
||||
artistId && router.navigate(`/artists/${artistId}`),
|
||||
({ artists }) =>
|
||||
artists.length > 0 &&
|
||||
router.navigate(`/artists/${artists[0].id}`),
|
||||
);
|
||||
},
|
||||
} satisfies Action;
|
||||
|
||||
@@ -47,7 +47,6 @@ export const useVideoContextMenu = (
|
||||
illustration: video?.illustration,
|
||||
illustrationProps: {
|
||||
normalizedThumbnail: true,
|
||||
useBlurhash: true,
|
||||
},
|
||||
},
|
||||
items: video
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import { useRouter } from "expo-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import { BackIcon, ErrorIcon, RetryIcon, SettingsIcon } from "@/ui/icons";
|
||||
import { Button } from "~/primitives/button";
|
||||
import { Icon } from "~/primitives/icon";
|
||||
import { Text } from "~/primitives/text";
|
||||
|
||||
export const ErrorModal = ({
|
||||
error,
|
||||
tryAgain,
|
||||
dismiss,
|
||||
}: {
|
||||
error: Error;
|
||||
tryAgain: () => void;
|
||||
dismiss: () => void;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
return (
|
||||
<View style={styles.root}>
|
||||
<Icon icon={ErrorIcon} style={styles.icon} />
|
||||
<Text content={t("errors.errorOccured")} variant="secondaryTitle" />
|
||||
<Text content={error.toString()} variant="itemText" />
|
||||
<View style={styles.buttons}>
|
||||
{router.canGoBack() ? (
|
||||
<Button
|
||||
icon={BackIcon}
|
||||
title={t("errors.goBack")}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
) : (
|
||||
<Button
|
||||
icon={SettingsIcon}
|
||||
title={t("actions.goToSettingsPage")}
|
||||
onPress={() => {
|
||||
dismiss();
|
||||
router.navigate("/(protected)/(nav)/(settings)");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
icon={RetryIcon}
|
||||
title={t("errors.tryAgain")}
|
||||
onPress={tryAgain}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
root: { alignItems: "center", gap: theme.gap(2), padding: theme.gap(2) },
|
||||
icon: { color: theme.colors.error, size: theme.gap(5) },
|
||||
buttons: {
|
||||
flexDirection: "row",
|
||||
gap: theme.gap(2),
|
||||
paddingTop: theme.gap(1),
|
||||
},
|
||||
}));
|
||||
@@ -1,6 +1,6 @@
|
||||
import Image from "@d11/react-native-fast-image";
|
||||
import { Image } from "expo-image";
|
||||
import { openBrowserAsync } from "expo-web-browser";
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ScrollView, View, type ViewStyle } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
@@ -13,7 +13,7 @@ import type {
|
||||
import { ExpandLessIcon, ExpandMoreIcon } from "@/ui/icons";
|
||||
import { generateArray } from "@/utils/gen-list";
|
||||
import { useAPI } from "~/api";
|
||||
import { Icon } from "~/primitives/icon";
|
||||
import { Button } from "~/primitives/button";
|
||||
import { Pressable } from "~/primitives/pressable";
|
||||
import { Text, TextSkeleton } from "~/primitives/text";
|
||||
import { LoadableText } from "./loadable_text";
|
||||
@@ -40,6 +40,16 @@ export const ExternalMetadataDescriptionSection = ({
|
||||
// If null, no need to be able to expand.
|
||||
// If boolean, reflect whether the line clamp is enabled
|
||||
const [isExpanded, expand] = useState<boolean | null>(null);
|
||||
useEffect(() => {
|
||||
expand((isExpanded_) => {
|
||||
if (!externalMetadata || externalMetadata.description === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return isExpanded_ || false;
|
||||
});
|
||||
}, [externalMetadata?.description]);
|
||||
|
||||
if (externalMetadata?.description === null) {
|
||||
return null;
|
||||
}
|
||||
@@ -50,15 +60,11 @@ export const ExternalMetadataDescriptionSection = ({
|
||||
content={externalMetadata === undefined ? undefined : heading}
|
||||
trailing={
|
||||
isExpanded !== null ? (
|
||||
<Pressable
|
||||
<Button
|
||||
size="small"
|
||||
onPress={() => expand((expanded) => !expanded)}
|
||||
>
|
||||
<Icon
|
||||
icon={
|
||||
isExpanded ? ExpandLessIcon : ExpandMoreIcon
|
||||
}
|
||||
/>
|
||||
</Pressable>
|
||||
icon={isExpanded ? ExpandLessIcon : ExpandMoreIcon}
|
||||
/>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
@@ -70,25 +76,25 @@ export const ExternalMetadataDescriptionSection = ({
|
||||
<TextSkeleton
|
||||
key={idx}
|
||||
width={"100%"}
|
||||
variant="body"
|
||||
variant="itemText"
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
) : (
|
||||
externalMetadata.description !== null && (
|
||||
<Text
|
||||
content={externalMetadata.description}
|
||||
variant="body"
|
||||
content={externalMetadata.description.trimEnd()}
|
||||
variant="itemText"
|
||||
style={styles.descriptionText}
|
||||
numberOfLines={
|
||||
isExpanded ? undefined : DescriptionLineCount
|
||||
}
|
||||
onTextLayout={(e) => {
|
||||
if (
|
||||
e.nativeEvent.lines.length >
|
||||
e.nativeEvent.lines.length <
|
||||
DescriptionLineCount
|
||||
) {
|
||||
expand(false);
|
||||
expand(null);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
@@ -108,7 +114,7 @@ export const ExternalMetadataDescription = ({
|
||||
return (
|
||||
<>
|
||||
{generateArray(DescriptionLineCount).map((_, idx) => (
|
||||
<TextSkeleton key={idx} width={"100%"} variant="body" />
|
||||
<TextSkeleton key={idx} width={"100%"} variant="itemText" />
|
||||
))}
|
||||
</>
|
||||
);
|
||||
@@ -116,7 +122,7 @@ export const ExternalMetadataDescription = ({
|
||||
return (
|
||||
<Text
|
||||
content={description}
|
||||
variant="body"
|
||||
variant="itemText"
|
||||
style={styles.descriptionText}
|
||||
/>
|
||||
);
|
||||
@@ -174,7 +180,7 @@ export const ExternalMetadataSourceComponent = ({
|
||||
>
|
||||
{source ? (
|
||||
<Image
|
||||
resizeMode="contain"
|
||||
contentFit="contain"
|
||||
source={{
|
||||
uri: source
|
||||
? api.getIllustrationURL(
|
||||
@@ -182,9 +188,7 @@ export const ExternalMetadataSourceComponent = ({
|
||||
"original",
|
||||
)
|
||||
: undefined,
|
||||
headers: {
|
||||
Authorization: `Bearer ${api.accessToken}`,
|
||||
},
|
||||
headers: api.getAuthHeaders(),
|
||||
}}
|
||||
style={styles.externalLinkIcon}
|
||||
/>
|
||||
@@ -198,7 +202,7 @@ export const ExternalMetadataSourceComponent = ({
|
||||
)}
|
||||
<LoadableText
|
||||
content={source?.providerName}
|
||||
variant="body"
|
||||
variant="itemText"
|
||||
skeletonWidth={10}
|
||||
/>
|
||||
</Pressable>
|
||||
@@ -234,9 +238,7 @@ const styles = StyleSheet.create((theme) => ({
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
descriptionText: {
|
||||
lineHeight: theme.gap(2.5),
|
||||
},
|
||||
descriptionText: {},
|
||||
descriptionContainer: {
|
||||
flex: 1,
|
||||
paddingHorizontal: theme.gap(1.5),
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { openBrowserAsync } from "expo-web-browser";
|
||||
import type { ComponentProps } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { OpenExternalIcon } from "@/ui/icons";
|
||||
import { useQueryClient } from "~/api";
|
||||
import { Button } from "~/primitives/button";
|
||||
|
||||
// NOTE: Should only be displayed if the user is admin
|
||||
export const GoToWebSettingsButton = (buttonProps: {
|
||||
buttonProps?: Partial<ComponentProps<typeof Button>>;
|
||||
}) => {
|
||||
const queryClient = useQueryClient();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Button
|
||||
title={t("settings.manageFromWebApp")}
|
||||
onPress={() =>
|
||||
openBrowserAsync(
|
||||
queryClient.api.urls.api.replace("/api", "/settings"),
|
||||
)
|
||||
}
|
||||
icon={OpenExternalIcon}
|
||||
iconPosition="right"
|
||||
width="fill"
|
||||
containerStyle={{ justifyContent: "center" }}
|
||||
{...buttonProps}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,143 @@
|
||||
import type { FlashListRef } from "@shopify/flash-list";
|
||||
import { BlurTargetView } from "expo-blur";
|
||||
import { type ScreenProps, Stack, useScrollToTop } from "expo-router";
|
||||
import {
|
||||
type ComponentProps,
|
||||
type ReactNode,
|
||||
type Ref,
|
||||
type RefObject,
|
||||
useRef,
|
||||
} from "react";
|
||||
import { Platform } from "react-native";
|
||||
import {
|
||||
interpolate,
|
||||
type ScrollHandlerProcessed,
|
||||
useAnimatedScrollHandler,
|
||||
useAnimatedStyle,
|
||||
useSharedValue,
|
||||
} from "react-native-reanimated";
|
||||
import { useUnistyles } from "react-native-unistyles";
|
||||
import { HeaderBackground } from "./navigation";
|
||||
|
||||
export type ScrollHandler = ScrollHandlerProcessed<Record<string, unknown>>;
|
||||
|
||||
export type PageScrollProps = {
|
||||
onScroll: ScrollHandler;
|
||||
scrollRef: Ref<FlashListRef<any>>;
|
||||
scrollEventThrottle: number;
|
||||
};
|
||||
|
||||
// To be used only on top-level, screen components
|
||||
export const FadingHeader = ({
|
||||
children,
|
||||
options,
|
||||
}: {
|
||||
children: (props: PageScrollProps) => ReactNode;
|
||||
options?: ScreenProps["options"];
|
||||
}) => {
|
||||
const scrollY = useSharedValue(0);
|
||||
const scrollHandler = useAnimatedScrollHandler({
|
||||
onScroll: (event) => {
|
||||
scrollY.value = event.contentOffset.y;
|
||||
},
|
||||
});
|
||||
const headerStyle = useAnimatedStyle(
|
||||
() => ({
|
||||
opacity: interpolate(scrollY.value, [30, 100], [0, 1], {
|
||||
extrapolateLeft: "clamp",
|
||||
}),
|
||||
}),
|
||||
[],
|
||||
);
|
||||
const blurRef = useRef(null);
|
||||
const scrollRef = useRef<FlashListRef<any>>(null);
|
||||
const showHeader = Platform.OS !== "ios";
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerBackground: showHeader
|
||||
? () => (
|
||||
<HeaderBackground
|
||||
blurTarget={blurRef}
|
||||
style={[{ opacity: 0 }, headerStyle]}
|
||||
/>
|
||||
)
|
||||
: () => null,
|
||||
...options,
|
||||
}}
|
||||
/>
|
||||
<BlurTargetView ref={blurRef} style={{ flex: 1 }}>
|
||||
{children({
|
||||
scrollRef,
|
||||
onScroll: scrollHandler,
|
||||
scrollEventThrottle: 16,
|
||||
})}
|
||||
</BlurTargetView>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export const useIosLargeTitle = () => {
|
||||
const { theme } = useUnistyles();
|
||||
return {
|
||||
screenOptions: {
|
||||
headerLargeTitleEnabled: Platform.OS === "ios",
|
||||
headerLargeTitleStyle:
|
||||
Platform.OS === "ios" ? theme.fontStyles.medium : undefined,
|
||||
headerBlurEffect: // NOTE: https://amanhimself.dev/blog/large-header-title-in-expo-router/
|
||||
Platform.OS === "ios" && parseInt(Platform.Version, 10) < 26
|
||||
? ("regular" as const)
|
||||
: undefined,
|
||||
},
|
||||
flashlistOptions: {
|
||||
contentInsetAdjustmentBehavior:
|
||||
Platform.OS === "ios"
|
||||
? ("automatic" as const)
|
||||
: ("never" as const),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const StaticHeader = ({
|
||||
children,
|
||||
options,
|
||||
}: {
|
||||
children:
|
||||
| ReactNode
|
||||
| ((scrollRef: RefObject<FlashListRef<any> | null>) => ReactNode);
|
||||
options?: ComponentProps<typeof Stack.Screen>["options"];
|
||||
}) => {
|
||||
const contentRef = useRef(null);
|
||||
const scrollRef = useRef<FlashListRef<any>>(null);
|
||||
const { theme } = useUnistyles();
|
||||
|
||||
useScrollToTop(
|
||||
useRef({
|
||||
scrollToTop: () =>
|
||||
scrollRef?.current?.scrollToTop({ animated: true }),
|
||||
}),
|
||||
);
|
||||
return (
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerTitleStyle: theme.fontStyles.regular,
|
||||
headerBackground:
|
||||
// @ts-expect-error
|
||||
options?.headerLargeTitleEnabled ||
|
||||
// @ts-expect-error
|
||||
options?.headerLargeTitle
|
||||
? undefined
|
||||
: () => <HeaderBackground blurTarget={contentRef} />,
|
||||
...options,
|
||||
}}
|
||||
>
|
||||
<BlurTargetView style={{ flex: 1 }} ref={contentRef}>
|
||||
{typeof children === "function"
|
||||
? children(scrollRef)
|
||||
: children}
|
||||
</BlurTargetView>
|
||||
</Stack.Screen>
|
||||
);
|
||||
};
|
||||
@@ -16,10 +16,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import Image from "@d11/react-native-fast-image";
|
||||
import { Image } from "expo-image";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { View, type ViewStyle } from "react-native";
|
||||
import { Blurhash } from "react-native-blurhash";
|
||||
import Animated, {
|
||||
useAnimatedStyle,
|
||||
useSharedValue,
|
||||
@@ -30,18 +29,15 @@ import type { IllustrationQuality } from "@/models/illustration";
|
||||
import type { Icon as IconType } from "@/ui/icons";
|
||||
import { useAPI } from "~/api";
|
||||
import { Icon } from "~/primitives/icon";
|
||||
import { animations } from "~/theme";
|
||||
|
||||
type Props = {
|
||||
illustration: IllustrationModel | undefined | null;
|
||||
fallbackIcon?: IconType;
|
||||
dropShadow?: boolean;
|
||||
shadowStyle?: Pick<ViewStyle, "boxShadow">;
|
||||
quality: IllustrationQuality;
|
||||
normalizedThumbnail?: boolean;
|
||||
variant?: "fill" | "circle" | "center";
|
||||
// If false, the blurhash will not be ecoded/displayed.
|
||||
// Instead it will use the color from the illustration model as a place holder
|
||||
// To enhance performance in infinite lists
|
||||
useBlurhash?: boolean;
|
||||
style?: ViewStyle;
|
||||
};
|
||||
|
||||
@@ -50,8 +46,7 @@ export const Illustration = ({
|
||||
fallbackIcon,
|
||||
quality,
|
||||
variant,
|
||||
useBlurhash,
|
||||
dropShadow = false,
|
||||
shadowStyle,
|
||||
normalizedThumbnail,
|
||||
style,
|
||||
}: Props) => {
|
||||
@@ -66,7 +61,6 @@ export const Illustration = ({
|
||||
[illustration],
|
||||
);
|
||||
styles.useVariants({
|
||||
hasShadow: dropShadow,
|
||||
imageType: innerAspectRatio > 1 ? "wide" : "tall",
|
||||
shape: variant === "circle" ? "circle" : undefined,
|
||||
align: variant === "center" ? "center" : "bottom",
|
||||
@@ -75,20 +69,13 @@ export const Illustration = ({
|
||||
const [loadStatus, setLoadStatus] = useState<"done" | "loading" | "error">(
|
||||
"loading",
|
||||
);
|
||||
const imageOpacity = useSharedValue(0);
|
||||
const fallbackOpacity = useSharedValue(0);
|
||||
|
||||
const imageOpacityStyle = useAnimatedStyle(() => ({
|
||||
opacity: imageOpacity.value,
|
||||
}));
|
||||
const fallbackOpacityStyle = useAnimatedStyle(() => ({
|
||||
opacity: fallbackOpacity.value,
|
||||
}));
|
||||
|
||||
useEffect(() => {
|
||||
// Whatever the new illustration props is,
|
||||
// we need to reset the blurhash and the image
|
||||
imageOpacity.value = 0;
|
||||
if (illustration === null) {
|
||||
fallbackOpacity.value = 1;
|
||||
} else {
|
||||
@@ -103,56 +90,34 @@ export const Illustration = ({
|
||||
{
|
||||
aspectRatio: innerAspectRatio,
|
||||
},
|
||||
styles.innerContainer(
|
||||
!useBlurhash ? illustration?.colors.at(0) : undefined,
|
||||
),
|
||||
styles.shadow,
|
||||
styles.innerContainer,
|
||||
shadowStyle,
|
||||
]}
|
||||
>
|
||||
{illustration && loadStatus !== "error" && (
|
||||
<>
|
||||
{useBlurhash && (
|
||||
<View style={[styles.slot]}>
|
||||
<Blurhash
|
||||
decodeAsync
|
||||
style={[
|
||||
styles.slotContent,
|
||||
styles.blurhash,
|
||||
]}
|
||||
blurhash={illustration.blurhash}
|
||||
decodeWidth={16}
|
||||
decodeHeight={16}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
|
||||
<Animated.View style={[imageOpacityStyle, styles.slot]}>
|
||||
<Image
|
||||
style={[styles.slotContent]}
|
||||
onLoad={() => {
|
||||
imageOpacity.value = 1;
|
||||
setLoadStatus("done");
|
||||
}}
|
||||
resizeMode={
|
||||
variant === "circle" || normalizedThumbnail
|
||||
? "cover"
|
||||
: "contain"
|
||||
}
|
||||
onError={() => {
|
||||
setLoadStatus("error");
|
||||
}}
|
||||
source={{
|
||||
headers: {
|
||||
Authorization: `Bearer ${api.accessToken}`,
|
||||
},
|
||||
uri: api.getIllustrationURL(
|
||||
illustration.url,
|
||||
quality,
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Animated.View>
|
||||
</>
|
||||
<Animated.View style={[styles.slot]}>
|
||||
<Image
|
||||
style={[styles.slotContent]}
|
||||
placeholder={{
|
||||
blurhash: illustration.blurhash,
|
||||
}}
|
||||
recyclingKey={illustration.id?.toString()}
|
||||
onLoad={() => setLoadStatus("done")}
|
||||
contentFit={"cover"}
|
||||
placeholderContentFit={"cover"}
|
||||
onError={() => {
|
||||
setLoadStatus("error");
|
||||
}}
|
||||
transition={animations.fades.duration}
|
||||
source={{
|
||||
headers: api.getAuthHeaders(),
|
||||
uri: api.getIllustrationURL(
|
||||
illustration.url,
|
||||
quality,
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Animated.View>
|
||||
)}
|
||||
{(!illustration || loadStatus === "error") && (
|
||||
<Animated.View
|
||||
@@ -192,8 +157,8 @@ const styles = StyleSheet.create((theme) => ({
|
||||
},
|
||||
},
|
||||
},
|
||||
innerContainer: (illustrationColor: string | undefined) => ({
|
||||
backgroundColor: illustrationColor ?? theme.colors.skeleton,
|
||||
innerContainer: {
|
||||
backgroundColor: theme.colors.skeleton,
|
||||
borderRadius: theme.borderRadius,
|
||||
variants: {
|
||||
imageType: {
|
||||
@@ -205,7 +170,7 @@ const styles = StyleSheet.create((theme) => ({
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
blurhash: {
|
||||
backgroundColor: theme.colors.skeleton,
|
||||
},
|
||||
@@ -220,16 +185,6 @@ const styles = StyleSheet.create((theme) => ({
|
||||
slotContent: {
|
||||
flex: 1,
|
||||
},
|
||||
shadow: {
|
||||
variants: {
|
||||
hasShadow: {
|
||||
true: {
|
||||
boxShadow: theme.illustrationShadow,
|
||||
},
|
||||
false: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
fallbackContainer: {
|
||||
flex: 1,
|
||||
display: "flex",
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { useRouter } from "expo-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { StyleSheet, withUnistyles } from "react-native-unistyles";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
import type { SetOptional } from "type-fest";
|
||||
import type { FilterControl } from "@/infinite-controls/filters/control";
|
||||
import type { LayoutControl } from "@/infinite-controls/layout";
|
||||
import type { SortControl } from "@/infinite-controls/sort";
|
||||
import type { SelectedSort, SortControl } from "@/infinite-controls/sort";
|
||||
import { AscIcon, DescIcon, GridIcon, ListIcon } from "@/ui/icons";
|
||||
import type { Action } from "~/actions";
|
||||
import { SelectModalButton } from "~/components/bottom-modal-sheet/select";
|
||||
@@ -13,23 +15,17 @@ type Props<SortingKey extends string> = {
|
||||
layout?: LayoutControl;
|
||||
sort?: SortControl<SortingKey>;
|
||||
filters?: FilterControl<any>[];
|
||||
actions?: Omit<Action, "href">[];
|
||||
actions?: SetOptional<Action, "label">[];
|
||||
};
|
||||
|
||||
export const Controls = <S extends string>({
|
||||
export const Controls = <SortingKey extends string>({
|
||||
layout,
|
||||
sort,
|
||||
filters,
|
||||
actions,
|
||||
}: Props<S>) => {
|
||||
}: Props<SortingKey>) => {
|
||||
const { t } = useTranslation();
|
||||
const OrderIcon = withUnistyles(
|
||||
sort?.selected.order === "desc" ? DescIcon : AscIcon,
|
||||
(theme) => ({
|
||||
color: theme.colors.text.primary,
|
||||
size: theme.fontSize.rem(1),
|
||||
}),
|
||||
);
|
||||
const router = useRouter();
|
||||
return (
|
||||
<View style={styles.row}>
|
||||
<View style={styles.row}>
|
||||
@@ -37,7 +33,6 @@ export const Controls = <S extends string>({
|
||||
<SelectModalButton
|
||||
header={t("browsing.controls.filter.header")}
|
||||
key={idx}
|
||||
closeOnSelect
|
||||
buttonProps={{
|
||||
title: t(filter.buttonLabel),
|
||||
icon: filter.buttonIcon as any,
|
||||
@@ -46,37 +41,43 @@ export const Controls = <S extends string>({
|
||||
iconPosition: "right",
|
||||
}}
|
||||
values={filter.values ?? []}
|
||||
isSelected={(item) =>
|
||||
filter.multipleChoice
|
||||
? filter.selected.includes(item)
|
||||
: filter.selected === item
|
||||
}
|
||||
formatItem={(item) => t(filter.formatItem(item))}
|
||||
onSelect={(selected) => {
|
||||
selected={filter.selected}
|
||||
onItemSelect={(selected, st) => {
|
||||
if (filter.multipleChoice) {
|
||||
const selectedKeys = filter.selected.includes(
|
||||
selected,
|
||||
)
|
||||
? filter.selected.filter(
|
||||
(k) => k !== selected,
|
||||
)
|
||||
: [selected, ...filter.selected];
|
||||
filter.onUpdate(selectedKeys);
|
||||
return st.includes(selected)
|
||||
? st.filter((k: any) => k !== selected)
|
||||
: [selected, ...st];
|
||||
} else {
|
||||
filter.onUpdate(
|
||||
filter.selected === selected
|
||||
? null
|
||||
: selected,
|
||||
);
|
||||
return st === selected ? null : selected;
|
||||
}
|
||||
}}
|
||||
isSelected={(item, st) =>
|
||||
filter.multipleChoice
|
||||
? st.includes(item)
|
||||
: st === item
|
||||
}
|
||||
formatItem={(item) => t(filter.formatItem(item))}
|
||||
onSave={(selected) => filter.onUpdate(selected)}
|
||||
/>
|
||||
))}
|
||||
{sort && (
|
||||
<SelectModalButton
|
||||
header={t("browsing.controls.sortBy")}
|
||||
closeOnSelect
|
||||
values={sort.sortingKeys}
|
||||
selected={sort.selected}
|
||||
onItemSelect={(
|
||||
sortingKey,
|
||||
st,
|
||||
): SelectedSort<SortingKey> => {
|
||||
if (sortingKey === st.sort) {
|
||||
return {
|
||||
sort: sortingKey,
|
||||
order: st.order === "asc" ? "desc" : "asc",
|
||||
};
|
||||
} else {
|
||||
return { sort: sortingKey, order: "asc" };
|
||||
}
|
||||
}}
|
||||
formatItem={(item) => t(sort.formatItem(item))}
|
||||
buttonProps={{
|
||||
title: t(sort.formatItem(sort.selected.sort)),
|
||||
@@ -88,21 +89,11 @@ export const Controls = <S extends string>({
|
||||
: DescIcon,
|
||||
iconPosition: "left",
|
||||
}}
|
||||
isSelected={(item) => sort.selected.sort === item}
|
||||
checkIcon={OrderIcon}
|
||||
onSelect={(selected: S) => {
|
||||
if (selected === sort.selected.sort) {
|
||||
sort.onUpdate({
|
||||
sort: selected,
|
||||
order:
|
||||
sort.selected.order === "asc"
|
||||
? "desc"
|
||||
: "asc",
|
||||
});
|
||||
} else {
|
||||
sort.onUpdate({ sort: selected, order: "asc" });
|
||||
}
|
||||
}}
|
||||
isSelected={(item, st) => st.sort === item}
|
||||
checkIcon={({ order }) =>
|
||||
order === "desc" ? DescIcon : AscIcon
|
||||
}
|
||||
onSave={(selected) => sort.onUpdate(selected)}
|
||||
/>
|
||||
)}
|
||||
{layout && (
|
||||
@@ -128,9 +119,13 @@ export const Controls = <S extends string>({
|
||||
width="fitContent"
|
||||
key={idx}
|
||||
icon={action.icon}
|
||||
title={t(action.label)}
|
||||
disabled={action.disabled}
|
||||
title={action.label ? t(action.label) : undefined}
|
||||
onPress={() => {
|
||||
action.onPress?.();
|
||||
if (action.href) {
|
||||
router.push(action.href);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -103,8 +103,8 @@ export const useSearchTypeFilterControl = () => {
|
||||
};
|
||||
|
||||
export {
|
||||
useTypeFiltersControl,
|
||||
useTypeFilterControl,
|
||||
useLibraryFilterControl,
|
||||
useLibraryFiltersControl,
|
||||
useTypeFilterControl,
|
||||
useTypeFiltersControl,
|
||||
};
|
||||
@@ -16,8 +16,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useRoute } from "expo-router";
|
||||
import { useLayoutControl as useLayoutControlBase } from "@/infinite-controls/layout";
|
||||
import type { LayoutOption } from "@/models/layout";
|
||||
import { useViewPreference } from "~/state/view-preferences";
|
||||
|
||||
// Hook to get Layout data to pass to Controls
|
||||
export const useLayoutControl = ({
|
||||
@@ -27,12 +29,18 @@ export const useLayoutControl = ({
|
||||
defaultLayout: LayoutOption;
|
||||
enableToggle: boolean;
|
||||
}) => {
|
||||
const route = useRoute();
|
||||
const [_, setPrefs] = useViewPreference(route.name);
|
||||
return useLayoutControlBase({
|
||||
hook: () => {
|
||||
return null;
|
||||
const route = useRoute();
|
||||
const [{ layout }] = useViewPreference(route.name);
|
||||
return layout?.layout ?? null;
|
||||
},
|
||||
defaultLayout,
|
||||
enableToggle,
|
||||
onUpdate: () => {},
|
||||
onUpdate: (layout) => {
|
||||
setPrefs((p) => ({ ...p, layout }));
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Meelo is a music server and application to enjoy your personal music files anywhere, anytime you want.
|
||||
* Copyright (C) 2023
|
||||
*
|
||||
* Meelo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Meelo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useRoute } from "expo-router";
|
||||
import { usePrimaryArtistToggleControl as useToggleControlBase } from "@/infinite-controls/primary-artists";
|
||||
import { usePrimaryArtistsPreference } from "~/state/primary-artists-preference";
|
||||
|
||||
export const usePrimaryArtistsToggleControl = ({
|
||||
enableToggle,
|
||||
}: {
|
||||
enableToggle: boolean;
|
||||
}) => {
|
||||
const route = useRoute();
|
||||
const [defaultPref, setPrefs] = usePrimaryArtistsPreference(route.name);
|
||||
return useToggleControlBase({
|
||||
enableToggle,
|
||||
defaultValue: defaultPref.primaryArtistsOnly,
|
||||
hook: () => {
|
||||
const route = useRoute();
|
||||
const [pref] = usePrimaryArtistsPreference(route.name);
|
||||
return { primaryArtistsOnly: pref.primaryArtistsOnly ?? true };
|
||||
},
|
||||
onUpdate: ({ primaryArtistsOnly }) => {
|
||||
setPrefs(() => ({
|
||||
primaryArtistsOnly,
|
||||
}));
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -16,8 +16,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useLocalSearchParams, useRoute } from "expo-router";
|
||||
import { useSortControl as useSortControlBase } from "@/infinite-controls/sort";
|
||||
import { useViewPreference } from "~/state/view-preferences";
|
||||
import type { Sorting } from "~/utils/sorting";
|
||||
|
||||
export const useSortControl = <SortingKey extends string>({
|
||||
@@ -27,15 +28,22 @@ export const useSortControl = <SortingKey extends string>({
|
||||
sortingKeys: readonly SortingKey[];
|
||||
translate: (s: SortingKey) => TranslationKey;
|
||||
}) => {
|
||||
const route = useRoute();
|
||||
const [_, setPrefs] = useViewPreference(route.name);
|
||||
return useSortControlBase({
|
||||
hook: () => {
|
||||
let { sort, order } = useLocalSearchParams<Sorting<SortingKey>>();
|
||||
sort ??= sortingKeys[0];
|
||||
order ??= "asc";
|
||||
return { sort, order };
|
||||
const route = useRoute();
|
||||
const { sort, order } = useLocalSearchParams<Sorting<SortingKey>>();
|
||||
const [prefs] = useViewPreference(route.name);
|
||||
return {
|
||||
sort: sort ?? prefs.sort?.sortBy ?? sortingKeys[0],
|
||||
order: order ?? prefs.sort?.order ?? "asc",
|
||||
};
|
||||
},
|
||||
sortingKeys,
|
||||
translate,
|
||||
onUpdate: () => {},
|
||||
onUpdate: ({ sort: sortBy, order }) => {
|
||||
setPrefs((p) => ({ ...p, sort: { order, sortBy } }));
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useIsFocused } from "@react-navigation/native";
|
||||
import { FlashList } from "@shopify/flash-list";
|
||||
import { FlashList, type FlashListRef } from "@shopify/flash-list";
|
||||
import type React from "react";
|
||||
import { type ComponentProps, useMemo, useState } from "react";
|
||||
import { type ComponentProps, type RefObject, useMemo, useState } from "react";
|
||||
import { type StyleProp, View, type ViewStyle } from "react-native";
|
||||
import { StyleSheet, withUnistyles } from "react-native-unistyles";
|
||||
import type { InfiniteQuery } from "@/api/query";
|
||||
@@ -37,6 +36,8 @@ type Props<T, T1, Sort extends string> = {
|
||||
layout: LayoutOption;
|
||||
header?: React.ReactElement;
|
||||
controls: Omit<ComponentProps<typeof Controls<Sort>>, "style">;
|
||||
keyExtractor?: (item: T1) => string;
|
||||
scrollRef?: RefObject<FlashListRef<unknown> | null>;
|
||||
render: (
|
||||
item: T1 | undefined,
|
||||
index: number,
|
||||
@@ -70,13 +71,8 @@ export const InfiniteView = <
|
||||
];
|
||||
}, [queryRes.items, queryRes.isFetching, queryRes.isFetchingNextPage]);
|
||||
const ScrollView = props.layout === "list" ? List : Grid;
|
||||
const isFocused = useIsFocused();
|
||||
useSetKeyIllustrationFromInfiniteQuery(props.query);
|
||||
// Note: When video is fullscreen + screen is rotated, unistyle freaksout and rerenders every frame (?) and ends upcrashing
|
||||
// Ugly workaround, but fixes it
|
||||
if (!isFocused) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={[styles.rootStyle]}>
|
||||
{props.header && (
|
||||
@@ -101,6 +97,7 @@ export const InfiniteView = <
|
||||
</View>
|
||||
) : controlsHeight !== null ? (
|
||||
<ScrollView
|
||||
ref={props.scrollRef}
|
||||
data={itemList}
|
||||
refreshing={queryRes.isRefetching}
|
||||
contentContainerStyle={
|
||||
@@ -144,7 +141,7 @@ export const InfiniteView = <
|
||||
if (!item) {
|
||||
return `skeleton-${idx}-cc:${columnCount}`;
|
||||
}
|
||||
return `item-${item.id}-cc:${columnCount}`;
|
||||
return `item-${props.keyExtractor?.(item) ?? item.id}-cc:${columnCount}`;
|
||||
},
|
||||
}),
|
||||
}
|
||||
@@ -154,7 +151,7 @@ export const InfiniteView = <
|
||||
if (!item) {
|
||||
return `skeleton-${idx}`;
|
||||
}
|
||||
return `item-${item.id}`;
|
||||
return `item-${props.keyExtractor?.(item) ?? item.id}`;
|
||||
},
|
||||
})}
|
||||
/>
|
||||
|
||||
@@ -28,11 +28,15 @@ export const InstanceButton = ({
|
||||
return (
|
||||
<View style={styles.root}>
|
||||
<View style={styles.label}>
|
||||
<Text content={cleanUrl} color={textColor} variant="h5" />
|
||||
<Text
|
||||
content={cleanUrl}
|
||||
color={textColor}
|
||||
variant="thirdTitle"
|
||||
/>
|
||||
<Text
|
||||
content={instance.username}
|
||||
color={textColor}
|
||||
variant="body"
|
||||
variant="itemText"
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.trailing}>
|
||||
|
||||
@@ -87,14 +87,13 @@ export const ListItem = ({
|
||||
}
|
||||
}}
|
||||
onLongPress={onLongPressCallback}
|
||||
style={[styles.root]}
|
||||
style={styles.root}
|
||||
>
|
||||
{leading === undefined ? (
|
||||
<View style={styles.illustration}>
|
||||
<IllustrationComponent
|
||||
{...illustrationProps}
|
||||
illustration={illustration}
|
||||
useBlurhash={illustrationProps?.useBlurhash ?? false}
|
||||
variant={illustrationProps?.variant ?? "center"}
|
||||
quality="low"
|
||||
/>
|
||||
@@ -106,14 +105,14 @@ export const ListItem = ({
|
||||
<LoadableText
|
||||
content={title}
|
||||
skeletonWidth={15}
|
||||
variant="h6"
|
||||
variant="itemLabel"
|
||||
numberOfLines={1}
|
||||
/>
|
||||
{subtitle !== null && (
|
||||
<LoadableText
|
||||
content={subtitle}
|
||||
skeletonWidth={10}
|
||||
variant="body"
|
||||
variant="itemText"
|
||||
numberOfLines={1}
|
||||
/>
|
||||
)}
|
||||
@@ -168,7 +167,7 @@ const styles = StyleSheet.create((theme) => ({
|
||||
display: "flex",
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
gap: theme.gap(1),
|
||||
gap: theme.gap(0.5),
|
||||
|
||||
variants: {
|
||||
hasIllustration: {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { type ComponentProps, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { AlbumWithRelations } from "@/models/album";
|
||||
import { getYear } from "@/utils/date";
|
||||
import { formatArtists_ } from "@/utils/format-artists";
|
||||
import { useAlbumContextMenu } from "~/components/context-menu/resource/album";
|
||||
import { ListItem } from "../list-item";
|
||||
import { Tile } from "../tile";
|
||||
|
||||
type Props = {
|
||||
album: AlbumWithRelations<"artist" | "illustration"> | undefined;
|
||||
album: AlbumWithRelations<"artists" | "illustration"> | undefined;
|
||||
subtitle: "artistName" | "year";
|
||||
illustrationProps?: ComponentProps<typeof Tile>["illustrationProps"];
|
||||
onPress?: () => void;
|
||||
@@ -81,7 +82,11 @@ const useFormattedSubtitle = ({
|
||||
return f(getYear(album.releaseDate)?.toString() ?? "");
|
||||
}
|
||||
if (subtitle === "artistName") {
|
||||
return f(album.artist?.name ?? t("compilationArtistLabel"));
|
||||
return f(
|
||||
album.artists.length > 0
|
||||
? formatArtists_(album.artists)
|
||||
: t("compilationArtistLabel"),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}, [subtitle, formatSubtitle, album]);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import type { ArtistWithRelations } from "@/models/artist";
|
||||
import { ArtistIcon } from "@/ui/icons";
|
||||
import { useArtistContextMenu } from "~/components/context-menu/resource/artist";
|
||||
import { ListItem } from "../list-item";
|
||||
import { Tile } from "../tile";
|
||||
@@ -22,6 +23,7 @@ export const ArtistTile = ({ artist, illustrationProps, onPress }: Props) => {
|
||||
href={artist ? `/artists/${artist.id}` : null}
|
||||
illustrationProps={{
|
||||
...illustrationProps,
|
||||
fallbackIcon: ArtistIcon,
|
||||
variant: "circle",
|
||||
}}
|
||||
/>
|
||||
@@ -40,6 +42,7 @@ export const ArtistItem = ({ artist, illustrationProps, onPress }: Props) => {
|
||||
illustration={artist?.illustration}
|
||||
illustrationProps={{
|
||||
...illustrationProps,
|
||||
fallbackIcon: ArtistIcon,
|
||||
variant: "circle",
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -1,20 +1,39 @@
|
||||
import type Genre from "@/models/genre";
|
||||
import { GenreIcon } from "@/ui/icons";
|
||||
import { Chip } from "~/components/chip";
|
||||
import { useContextMenu } from "~/components/context-menu";
|
||||
import { useGenreContextMenu } from "~/components/context-menu/resource/genre";
|
||||
import { ListItem } from "../list-item";
|
||||
|
||||
type Props = { genre: Genre | undefined };
|
||||
type Props = {
|
||||
genre: Genre | undefined;
|
||||
withLeadingIcon?: boolean;
|
||||
onPress?: () => void;
|
||||
subtitle?: string;
|
||||
};
|
||||
|
||||
export const GenreItem = ({ genre }: Props) => {
|
||||
export const GenreItem = ({
|
||||
genre,
|
||||
withLeadingIcon,
|
||||
subtitle,
|
||||
onPress,
|
||||
}: Props) => {
|
||||
const ctxMenu = useGenreContextMenu(genre);
|
||||
const { openContextMenu } = useContextMenu(ctxMenu);
|
||||
return (
|
||||
<ListItem
|
||||
leading={null}
|
||||
{...(withLeadingIcon
|
||||
? {
|
||||
illustration: null,
|
||||
illustrationProps: { fallbackIcon: GenreIcon },
|
||||
}
|
||||
: { leading: null })}
|
||||
title={genre?.name}
|
||||
subtitle={null}
|
||||
onPress={openContextMenu}
|
||||
subtitle={subtitle ?? null}
|
||||
onPress={() => {
|
||||
onPress?.();
|
||||
openContextMenu();
|
||||
}}
|
||||
contextMenu={ctxMenu}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,9 +1,44 @@
|
||||
import type { Area } from "@/models/area";
|
||||
import type Label from "@/models/label";
|
||||
import { LabelIcon } from "@/ui/icons";
|
||||
import { Chip } from "~/components/chip";
|
||||
import { useContextMenu } from "~/components/context-menu";
|
||||
import { useLabelContextMenu } from "~/components/context-menu/resource/label";
|
||||
import { ListItem } from "../list-item";
|
||||
|
||||
type Props = { label: Label | undefined };
|
||||
type Props = {
|
||||
label: (Label & { area?: Area | null }) | undefined;
|
||||
withLeadingIcon?: boolean;
|
||||
subtitle?: string;
|
||||
onPress?: () => void;
|
||||
};
|
||||
|
||||
export const LabelItem = ({
|
||||
label,
|
||||
subtitle,
|
||||
withLeadingIcon,
|
||||
onPress,
|
||||
}: Props) => {
|
||||
const ctxMenu = useLabelContextMenu(label);
|
||||
const { openContextMenu } = useContextMenu(ctxMenu);
|
||||
return (
|
||||
<ListItem
|
||||
{...(withLeadingIcon
|
||||
? {
|
||||
illustration: null,
|
||||
illustrationProps: { fallbackIcon: LabelIcon },
|
||||
}
|
||||
: { leading: null })}
|
||||
title={label?.name}
|
||||
subtitle={subtitle ?? null}
|
||||
onPress={() => {
|
||||
onPress?.();
|
||||
openContextMenu();
|
||||
}}
|
||||
contextMenu={ctxMenu}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export const LabelChip = ({ label }: Props) => {
|
||||
const ctxMenu = useLabelContextMenu(label);
|
||||
|
||||
@@ -3,6 +3,8 @@ import { View } from "react-native";
|
||||
import type { SearchResult } from "@/models/search";
|
||||
import { AlbumItem } from "./album";
|
||||
import { ArtistItem } from "./artist";
|
||||
import { GenreItem } from "./genre";
|
||||
import { LabelItem } from "./label";
|
||||
import { SongItem } from "./song";
|
||||
import { VideoItem } from "./video";
|
||||
|
||||
@@ -56,6 +58,28 @@ export const SearchResultItem = ({
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (searchResult.label) {
|
||||
return (
|
||||
<LabelItem
|
||||
label={searchResult.label}
|
||||
onPress={onPress}
|
||||
withLeadingIcon
|
||||
subtitle={t("models.label")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (searchResult.genre) {
|
||||
return (
|
||||
<GenreItem
|
||||
genre={searchResult.genre}
|
||||
onPress={onPress}
|
||||
withLeadingIcon
|
||||
subtitle={t("models.genre")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
// biome-ignore lint/suspicious/noConsole: Debug
|
||||
console.error("Unexpected search result");
|
||||
// biome-ignore lint/suspicious/noConsole: Debug
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type ComponentProps, useMemo } from "react";
|
||||
import type Artist from "@/models/artist";
|
||||
import type { SongWithRelations } from "@/models/song";
|
||||
import formatArtists from "@/utils/format-artists";
|
||||
import { useSongContextMenu } from "~/components/context-menu/resource/song";
|
||||
@@ -10,7 +11,7 @@ type Props = {
|
||||
| undefined;
|
||||
illustrationProps: ComponentProps<typeof ListItem>["illustrationProps"];
|
||||
subtitle: "artists" | null | undefined;
|
||||
parentArtistId?: number;
|
||||
mainArtists?: Artist[];
|
||||
formatSubtitle?: (s: string) => string;
|
||||
onPress: () => void;
|
||||
// If set, overrides 'open context menu'
|
||||
@@ -24,7 +25,7 @@ export const SongItem = ({
|
||||
formatSubtitle,
|
||||
onLongPress,
|
||||
onPress,
|
||||
parentArtistId,
|
||||
mainArtists,
|
||||
}: Props) => {
|
||||
const contextMenu = useSongContextMenu(song);
|
||||
const formattedSubtitle = useMemo(() => {
|
||||
@@ -36,16 +37,10 @@ export const SongItem = ({
|
||||
return undefined;
|
||||
}
|
||||
if (subtitle === "artists") {
|
||||
return f(
|
||||
formatArtists(
|
||||
song.artist,
|
||||
song.featuring,
|
||||
parentArtistId ? { id: parentArtistId } : undefined,
|
||||
),
|
||||
);
|
||||
return f(formatArtists(song.artist, song.featuring, mainArtists));
|
||||
}
|
||||
return null;
|
||||
}, [subtitle, formatSubtitle, song, parentArtistId]);
|
||||
}, [subtitle, formatSubtitle, song, mainArtists]);
|
||||
return (
|
||||
<ListItem
|
||||
title={song?.name}
|
||||
|
||||
@@ -33,7 +33,6 @@ const styles = StyleSheet.create((theme) => ({
|
||||
flexDirection: "column",
|
||||
paddingHorizontal: theme.gap(0.5),
|
||||
paddingVertical: theme.gap(1),
|
||||
gap: theme.gap(0.5),
|
||||
variants: {
|
||||
normalizedThumbnail: {
|
||||
true: {},
|
||||
@@ -98,20 +97,19 @@ export const Tile = ({
|
||||
<Illustration
|
||||
illustration={illustration}
|
||||
{...props.illustrationProps}
|
||||
useBlurhash={props.illustrationProps?.useBlurhash ?? false}
|
||||
quality="medium"
|
||||
/>
|
||||
</View>
|
||||
<View style={[styles.textColumn]}>
|
||||
<LoadableText
|
||||
variant="h6"
|
||||
variant="itemLabel"
|
||||
numberOfLines={1}
|
||||
skeletonWidth={10}
|
||||
content={title}
|
||||
/>
|
||||
{subtitle !== null && (
|
||||
<LoadableText
|
||||
variant="body"
|
||||
variant="itemText"
|
||||
skeletonWidth={8}
|
||||
numberOfLines={1}
|
||||
content={subtitle}
|
||||
|
||||
Loaded 100 of 542 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user