@music-lyric-player/base 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -14
- package/dist/index.comm.js +1 -1
- package/dist/index.comm.js.map +1 -1
- package/dist/index.ecma.d.ts +34 -3
- package/dist/index.ecma.js +1279 -823
- package/dist/index.ecma.js.map +1 -1
- package/package.json +3 -3
package/dist/index.ecma.js
CHANGED
|
@@ -1,190 +1,660 @@
|
|
|
1
|
-
import { freezeObjectDeep as
|
|
1
|
+
import { freezeObjectDeep as fr, ConfigManager as mr, Event as pr } from "@music-lyric-player/utils";
|
|
2
2
|
import "lodash-es";
|
|
3
|
-
const
|
|
3
|
+
const Ht = fr({
|
|
4
4
|
driver: "animation",
|
|
5
5
|
bridgeActive: !0,
|
|
6
|
+
mergeWindow: 300,
|
|
7
|
+
mergeLimit: 3,
|
|
6
8
|
offset: {
|
|
7
9
|
global: 0,
|
|
8
10
|
useMeta: !0,
|
|
9
11
|
resetTempOnLyricChange: !0
|
|
10
12
|
}
|
|
11
|
-
}),
|
|
13
|
+
}), ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
14
|
__proto__: null,
|
|
13
|
-
DEFAULT:
|
|
14
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (let r = 0; r < n.length; r++)
|
|
20
|
-
n[r] = Math.floor(Math.random() * 256);
|
|
21
|
-
return Array.from(n).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
15
|
+
DEFAULT: Ht
|
|
16
|
+
}, Symbol.toStringTag, { value: "Module" })), B = (s = 8) => {
|
|
17
|
+
let e = "";
|
|
18
|
+
for (; e.length < s; )
|
|
19
|
+
e += Math.random().toString(36).slice(2);
|
|
20
|
+
return e.slice(0, s);
|
|
22
21
|
};
|
|
23
|
-
|
|
22
|
+
var zt = /* @__PURE__ */ ((s) => (s.ChineseSimplified = "zh-hans", s.ChineseTraditional = "zh-hant", s.English = "en", s.Japanese = "ja", s.Korean = "ko", s.Russian = "ru", s.French = "fr", s.German = "de", s.Spanish = "es", s.Italian = "it", s.Portuguese = "pt", s))(zt || {});
|
|
23
|
+
class dr {
|
|
24
|
+
/**
|
|
25
|
+
* Language tag.
|
|
26
|
+
*/
|
|
27
|
+
tag = "";
|
|
28
|
+
/**
|
|
29
|
+
* Share within the lyric, ranging from 0 to 100.
|
|
30
|
+
* Recommended to be computed from word-level language counts.
|
|
31
|
+
*/
|
|
32
|
+
percent = 0;
|
|
33
|
+
}
|
|
34
|
+
class Yt {
|
|
35
|
+
/**
|
|
36
|
+
* All languages with their shares.
|
|
37
|
+
*/
|
|
38
|
+
list = [];
|
|
39
|
+
/**
|
|
40
|
+
* The language with the highest share.
|
|
41
|
+
*/
|
|
42
|
+
get primary() {
|
|
43
|
+
let e;
|
|
44
|
+
for (let t = 0, n = this.list.length; t < n; t++)
|
|
45
|
+
(!e || this.list[t].percent > e.percent) && (e = this.list[t]);
|
|
46
|
+
return e;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class Kt {
|
|
50
|
+
/**
|
|
51
|
+
* Start time in milliseconds.
|
|
52
|
+
*/
|
|
24
53
|
start = 0;
|
|
54
|
+
/**
|
|
55
|
+
* End time in milliseconds.
|
|
56
|
+
*/
|
|
25
57
|
end = 0;
|
|
58
|
+
/**
|
|
59
|
+
* Duration in milliseconds, derived from end minus start.
|
|
60
|
+
*/
|
|
26
61
|
get duration() {
|
|
27
62
|
return this.end - this.start;
|
|
28
63
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
64
|
+
}
|
|
65
|
+
class Er {
|
|
66
|
+
/**
|
|
67
|
+
* Unique identifier of the token.
|
|
68
|
+
*/
|
|
69
|
+
id = B(6).toUpperCase();
|
|
70
|
+
/**
|
|
71
|
+
* Time range of the token.
|
|
72
|
+
*/
|
|
73
|
+
time;
|
|
74
|
+
/**
|
|
75
|
+
* Text content of the token.
|
|
76
|
+
*/
|
|
77
|
+
content = "";
|
|
78
|
+
}
|
|
79
|
+
class Jt {
|
|
80
|
+
/**
|
|
81
|
+
* Unique identifier of the item.
|
|
82
|
+
*/
|
|
83
|
+
id = B(6).toUpperCase();
|
|
84
|
+
/**
|
|
85
|
+
* Time range of the item, independent from its words.
|
|
86
|
+
*/
|
|
87
|
+
time;
|
|
88
|
+
/**
|
|
89
|
+
* Tokens composing the item in order.
|
|
90
|
+
*/
|
|
91
|
+
words = [];
|
|
92
|
+
/**
|
|
93
|
+
* Language or transliteration scheme of this item.
|
|
94
|
+
* Should be set when multiple languages coexist, since line-level aggregation groups items by it.
|
|
95
|
+
*/
|
|
96
|
+
language;
|
|
97
|
+
/**
|
|
98
|
+
* Flat text joined from every word.
|
|
99
|
+
*/
|
|
100
|
+
get content() {
|
|
101
|
+
let e = "";
|
|
102
|
+
for (let t = 0, n = this.words.length; t < n; t++)
|
|
103
|
+
e += this.words[t].content;
|
|
104
|
+
return e;
|
|
35
105
|
}
|
|
36
106
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
107
|
+
class gr extends Jt {
|
|
108
|
+
/**
|
|
109
|
+
* Original annotation type name.
|
|
110
|
+
*/
|
|
111
|
+
key = "";
|
|
112
|
+
}
|
|
113
|
+
class Rr {
|
|
114
|
+
/**
|
|
115
|
+
* Ruby annotation such as furigana.
|
|
116
|
+
*/
|
|
117
|
+
ruby;
|
|
118
|
+
/**
|
|
119
|
+
* Romanized transliterations.
|
|
120
|
+
*/
|
|
121
|
+
romans;
|
|
122
|
+
/**
|
|
123
|
+
* Unknown annotations keyed by their original type name.
|
|
124
|
+
*/
|
|
125
|
+
unknowns;
|
|
40
126
|
}
|
|
41
|
-
|
|
127
|
+
var k = /* @__PURE__ */ ((s) => (s.Normal = "Normal", s.Space = "Space", s))(k || {});
|
|
128
|
+
class vr {
|
|
129
|
+
/**
|
|
130
|
+
* Unique identifier of the word.
|
|
131
|
+
*/
|
|
132
|
+
id = B(6).toUpperCase();
|
|
133
|
+
/**
|
|
134
|
+
* Discriminant marking this as a normal word.
|
|
135
|
+
*/
|
|
42
136
|
type = "Normal";
|
|
43
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Time range of the word.
|
|
139
|
+
*/
|
|
140
|
+
time;
|
|
141
|
+
/**
|
|
142
|
+
* Text content of the word.
|
|
143
|
+
*/
|
|
44
144
|
content = "";
|
|
45
|
-
|
|
46
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Language of this word.
|
|
147
|
+
*/
|
|
148
|
+
language;
|
|
149
|
+
/**
|
|
150
|
+
* Annotations attached to this word.
|
|
151
|
+
*/
|
|
152
|
+
annotation;
|
|
153
|
+
/**
|
|
154
|
+
* Whether the word is stressed.
|
|
155
|
+
*/
|
|
156
|
+
stress = !1;
|
|
47
157
|
}
|
|
48
|
-
class
|
|
158
|
+
class Ir {
|
|
159
|
+
/**
|
|
160
|
+
* Discriminant marking this as a space.
|
|
161
|
+
*/
|
|
49
162
|
type = "Space";
|
|
163
|
+
/**
|
|
164
|
+
* Number of consecutive space characters.
|
|
165
|
+
*/
|
|
50
166
|
count = 1;
|
|
51
167
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
168
|
+
class Y {
|
|
169
|
+
/**
|
|
170
|
+
* Language or transliteration scheme of this item.
|
|
171
|
+
* Should be set when multiple languages coexist, since aggregation from words groups by it.
|
|
172
|
+
*/
|
|
173
|
+
language;
|
|
174
|
+
/**
|
|
175
|
+
* Original text.
|
|
176
|
+
*/
|
|
55
177
|
content = "";
|
|
56
178
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
179
|
+
class Zt extends Y {
|
|
180
|
+
/**
|
|
181
|
+
* Original annotation type name.
|
|
182
|
+
*/
|
|
183
|
+
key = "";
|
|
62
184
|
}
|
|
63
|
-
class
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return this.words.map((n) => n.type === Ye.Normal ? n.content : " ".repeat(n.count)).join("");
|
|
185
|
+
class Qt {
|
|
186
|
+
#e;
|
|
187
|
+
constructor(e) {
|
|
188
|
+
this.#e = e;
|
|
68
189
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Aggregate one per-word item into a single line item, padding spaces to follow word spacing.
|
|
192
|
+
*/
|
|
193
|
+
#i(e) {
|
|
194
|
+
let t = "", n = 0, i, c = !1;
|
|
195
|
+
for (let h = 0, o = this.#e.words.length; h < o; h++) {
|
|
196
|
+
const a = this.#e.words[h];
|
|
197
|
+
if (a.type === k.Space) {
|
|
198
|
+
n += a.count;
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const r = e(a);
|
|
202
|
+
r && (c && (t += " ".repeat(n)), t += r.content, i ??= r.language, n = 0, c = !0);
|
|
203
|
+
}
|
|
204
|
+
if (!c)
|
|
205
|
+
return;
|
|
206
|
+
const l = new Y();
|
|
207
|
+
return l.content = t, l.language = i, l;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Aggregate multi-value per-word items into line items, one per language.
|
|
211
|
+
*/
|
|
212
|
+
#a(e) {
|
|
213
|
+
const t = [];
|
|
214
|
+
for (let i = 0, c = this.#e.words.length; i < c; i++) {
|
|
215
|
+
const l = this.#e.words[i];
|
|
216
|
+
if (l.type === k.Space)
|
|
217
|
+
continue;
|
|
218
|
+
const h = e(l);
|
|
219
|
+
if (h)
|
|
220
|
+
for (const o of h) {
|
|
221
|
+
const a = o.language ?? "";
|
|
222
|
+
t.includes(a) || t.push(a);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (!t.length)
|
|
226
|
+
return;
|
|
227
|
+
const n = [];
|
|
228
|
+
for (const i of t) {
|
|
229
|
+
let c = "", l = 0, h = !1;
|
|
230
|
+
for (let a = 0, r = this.#e.words.length; a < r; a++) {
|
|
231
|
+
const u = this.#e.words[a];
|
|
232
|
+
if (u.type === k.Space) {
|
|
233
|
+
l += u.count;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
const f = e(u)?.find((E) => (E.language ?? "") === i);
|
|
237
|
+
f && (h && (c += " ".repeat(l)), c += f.content, l = 0, h = !0);
|
|
238
|
+
}
|
|
239
|
+
const o = new Y();
|
|
240
|
+
o.content = c, o.language = i || void 0, n.push(o);
|
|
241
|
+
}
|
|
242
|
+
return n;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Aggregate unknown per-word items into line items, one per key.
|
|
246
|
+
*/
|
|
247
|
+
#o() {
|
|
248
|
+
const e = [];
|
|
249
|
+
for (let n = 0, i = this.#e.words.length; n < i; n++) {
|
|
250
|
+
const c = this.#e.words[n];
|
|
251
|
+
if (c.type === k.Space)
|
|
252
|
+
continue;
|
|
253
|
+
const l = c.annotation?.unknowns;
|
|
254
|
+
if (l)
|
|
255
|
+
for (const h of l)
|
|
256
|
+
e.includes(h.key) || e.push(h.key);
|
|
257
|
+
}
|
|
258
|
+
if (!e.length)
|
|
259
|
+
return;
|
|
260
|
+
const t = [];
|
|
261
|
+
for (const n of e) {
|
|
262
|
+
let i = "", c = 0, l, h = !1;
|
|
263
|
+
for (let a = 0, r = this.#e.words.length; a < r; a++) {
|
|
264
|
+
const u = this.#e.words[a];
|
|
265
|
+
if (u.type === k.Space) {
|
|
266
|
+
c += u.count;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
const f = u.annotation?.unknowns?.find((E) => E.key === n);
|
|
270
|
+
f && (h && (i += " ".repeat(c)), i += f.content, l ??= f.language, c = 0, h = !0);
|
|
271
|
+
}
|
|
272
|
+
const o = new Zt();
|
|
273
|
+
o.key = n, o.content = i, o.language = l, t.push(o);
|
|
274
|
+
}
|
|
275
|
+
return t;
|
|
276
|
+
}
|
|
277
|
+
#t;
|
|
278
|
+
/**
|
|
279
|
+
* Ruby annotation: the explicit value, otherwise aggregated from words.
|
|
280
|
+
*/
|
|
281
|
+
get ruby() {
|
|
282
|
+
return this.#t ?? this.#i((e) => e.annotation?.ruby);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Override the words-derived ruby with an explicit value.
|
|
286
|
+
*/
|
|
287
|
+
set ruby(e) {
|
|
288
|
+
this.#t = e;
|
|
289
|
+
}
|
|
290
|
+
#r;
|
|
291
|
+
/**
|
|
292
|
+
* Romanized transliterations: the explicit value, otherwise aggregated from words grouped by language.
|
|
293
|
+
*/
|
|
294
|
+
get romans() {
|
|
295
|
+
return this.#r ?? this.#a((e) => e.annotation?.romans);
|
|
75
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Override the words-derived romans with explicit values.
|
|
299
|
+
*/
|
|
300
|
+
set romans(e) {
|
|
301
|
+
this.#r = e;
|
|
302
|
+
}
|
|
303
|
+
#s;
|
|
304
|
+
/**
|
|
305
|
+
* Translations, explicit only since words carry no line-level translation.
|
|
306
|
+
*/
|
|
307
|
+
get translates() {
|
|
308
|
+
return this.#s;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Set the explicit translations.
|
|
312
|
+
*/
|
|
313
|
+
set translates(e) {
|
|
314
|
+
this.#s = e;
|
|
315
|
+
}
|
|
316
|
+
#n;
|
|
317
|
+
/**
|
|
318
|
+
* Unknown annotations: the explicit value, otherwise aggregated from words grouped by key.
|
|
319
|
+
*/
|
|
320
|
+
get unknowns() {
|
|
321
|
+
return this.#n ?? this.#o();
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Override the words-derived unknowns with explicit values.
|
|
325
|
+
*/
|
|
326
|
+
set unknowns(e) {
|
|
327
|
+
this.#n = e;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
var er = /* @__PURE__ */ ((s) => (s.Normal = "Normal", s.Interlude = "Interlude", s))(er || {});
|
|
331
|
+
class tr {
|
|
332
|
+
/**
|
|
333
|
+
* Unique identifier of the line.
|
|
334
|
+
*/
|
|
335
|
+
id = B(6).toUpperCase();
|
|
336
|
+
/**
|
|
337
|
+
* Time range of the line.
|
|
338
|
+
*/
|
|
339
|
+
time = new Kt();
|
|
76
340
|
}
|
|
77
|
-
class
|
|
341
|
+
class rr extends tr {
|
|
342
|
+
/**
|
|
343
|
+
* Discriminant marking this as a normal line.
|
|
344
|
+
*/
|
|
78
345
|
type = "Normal";
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
346
|
+
/**
|
|
347
|
+
* Performing agent of this line.
|
|
348
|
+
*/
|
|
82
349
|
agent;
|
|
350
|
+
/**
|
|
351
|
+
* Words composing the line in order.
|
|
352
|
+
*/
|
|
353
|
+
words = [];
|
|
354
|
+
/**
|
|
355
|
+
* Plain text of the line joined from every word.
|
|
356
|
+
*/
|
|
357
|
+
get original() {
|
|
358
|
+
let e = "";
|
|
359
|
+
for (let t = 0, n = this.words.length; t < n; t++) {
|
|
360
|
+
const i = this.words[t];
|
|
361
|
+
e += i.type === k.Normal ? i.content : " ".repeat(i.count);
|
|
362
|
+
}
|
|
363
|
+
return e;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Annotations applied to the whole line, derived from words unless set explicitly.
|
|
367
|
+
*/
|
|
368
|
+
annotation = new Qt(this);
|
|
369
|
+
#e;
|
|
370
|
+
/**
|
|
371
|
+
* Language tags of this line: the value set explicitly, otherwise collected from words.
|
|
372
|
+
*/
|
|
373
|
+
get languages() {
|
|
374
|
+
if (this.#e?.length)
|
|
375
|
+
return this.#e;
|
|
376
|
+
const e = /* @__PURE__ */ new Set();
|
|
377
|
+
for (let t = 0, n = this.words.length; t < n; t++) {
|
|
378
|
+
const i = this.words[t];
|
|
379
|
+
i.type === k.Normal && i.language && e.add(i.language);
|
|
380
|
+
}
|
|
381
|
+
return [...e];
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Override the words-derived languages with explicit tags.
|
|
385
|
+
*/
|
|
386
|
+
set languages(e) {
|
|
387
|
+
this.#e = e;
|
|
388
|
+
}
|
|
83
389
|
}
|
|
84
|
-
class
|
|
85
|
-
|
|
86
|
-
|
|
390
|
+
class $r extends rr {
|
|
391
|
+
/**
|
|
392
|
+
* Background lines attached to this line.
|
|
393
|
+
*/
|
|
87
394
|
background;
|
|
88
395
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
type = "Offset";
|
|
95
|
-
content = 0;
|
|
96
|
-
}
|
|
97
|
-
class Rr extends F {
|
|
98
|
-
type = "Duration";
|
|
99
|
-
content = 0;
|
|
100
|
-
}
|
|
101
|
-
class vr extends F {
|
|
102
|
-
type = "Title";
|
|
103
|
-
content = "";
|
|
104
|
-
}
|
|
105
|
-
class Ir extends F {
|
|
106
|
-
type = "Singer";
|
|
107
|
-
content = "";
|
|
108
|
-
}
|
|
109
|
-
class $r extends F {
|
|
110
|
-
type = "Album";
|
|
111
|
-
content = "";
|
|
112
|
-
}
|
|
113
|
-
class gr extends F {
|
|
114
|
-
type = "Creator";
|
|
115
|
-
content = {
|
|
116
|
-
role: "",
|
|
117
|
-
name: []
|
|
118
|
-
};
|
|
396
|
+
class Lr extends tr {
|
|
397
|
+
/**
|
|
398
|
+
* Discriminant marking this as an interlude line.
|
|
399
|
+
*/
|
|
400
|
+
type = "Interlude";
|
|
119
401
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
402
|
+
var _ = /* @__PURE__ */ ((s) => (s.Offset = "Offset", s.Duration = "Duration", s.Title = "Title", s.Singer = "Singer", s.Album = "Album", s.Creator = "Creator", s.Author = "Author", s.Isrc = "Isrc", s.Unknown = "Unknown", s))(_ || {});
|
|
403
|
+
const Tr = (s, e, t) => ({
|
|
404
|
+
id: B(6).toUpperCase(),
|
|
405
|
+
type: s,
|
|
406
|
+
key: e,
|
|
407
|
+
value: t
|
|
408
|
+
});
|
|
409
|
+
class sr {
|
|
410
|
+
/**
|
|
411
|
+
* All meta entries in order.
|
|
412
|
+
*/
|
|
413
|
+
list = [];
|
|
414
|
+
listOf(e) {
|
|
415
|
+
return this.list.filter((t) => t.type === e);
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* All offset meta entries.
|
|
419
|
+
*/
|
|
420
|
+
get offsets() {
|
|
421
|
+
return this.listOf(_.Offset);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* All duration meta entries.
|
|
425
|
+
*/
|
|
426
|
+
get durations() {
|
|
427
|
+
return this.listOf(_.Duration);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* All title meta entries.
|
|
431
|
+
*/
|
|
432
|
+
get titles() {
|
|
433
|
+
return this.listOf(_.Title);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* All singer meta entries.
|
|
437
|
+
*/
|
|
438
|
+
get singers() {
|
|
439
|
+
return this.listOf(_.Singer);
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* All album meta entries.
|
|
443
|
+
*/
|
|
444
|
+
get albums() {
|
|
445
|
+
return this.listOf(_.Album);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* All creator meta entries.
|
|
449
|
+
*/
|
|
450
|
+
get creators() {
|
|
451
|
+
return this.listOf(_.Creator);
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* All author meta entries.
|
|
455
|
+
*/
|
|
456
|
+
get authors() {
|
|
457
|
+
return this.listOf(_.Author);
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* All isrc meta entries.
|
|
461
|
+
*/
|
|
462
|
+
get isrcs() {
|
|
463
|
+
return this.listOf(_.Isrc);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* All unknown meta entries.
|
|
467
|
+
*/
|
|
468
|
+
get unknowns() {
|
|
469
|
+
return this.listOf(_.Unknown);
|
|
470
|
+
}
|
|
123
471
|
}
|
|
124
|
-
|
|
472
|
+
var nr = /* @__PURE__ */ ((s) => (s.Person = "Person", s.Group = "Group", s.Other = "Other", s.Unknown = "Unknown", s))(nr || {});
|
|
473
|
+
class Or {
|
|
474
|
+
/**
|
|
475
|
+
* Unique identifier of the agent.
|
|
476
|
+
*/
|
|
125
477
|
id = "";
|
|
126
|
-
|
|
478
|
+
/**
|
|
479
|
+
* Performing type of the agent.
|
|
480
|
+
*/
|
|
481
|
+
type = "Unknown";
|
|
482
|
+
/**
|
|
483
|
+
* Number of lines performed by this agent.
|
|
484
|
+
*/
|
|
127
485
|
count = 0;
|
|
486
|
+
/**
|
|
487
|
+
* Display names of the agent; a group may carry more than one.
|
|
488
|
+
*/
|
|
489
|
+
names = [];
|
|
128
490
|
}
|
|
129
|
-
class
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
block = 0;
|
|
134
|
-
}
|
|
135
|
-
class Nr {
|
|
491
|
+
class Sr {
|
|
492
|
+
/**
|
|
493
|
+
* Identifier of the referenced Agent.
|
|
494
|
+
*/
|
|
136
495
|
id = "";
|
|
137
|
-
|
|
496
|
+
/**
|
|
497
|
+
* Index of this agent occurrence among all lines.
|
|
498
|
+
*/
|
|
499
|
+
globalIndex = 0;
|
|
500
|
+
/**
|
|
501
|
+
* Index of this agent occurrence within its block.
|
|
502
|
+
*/
|
|
503
|
+
blockIndex = 0;
|
|
138
504
|
}
|
|
139
|
-
const
|
|
140
|
-
var
|
|
141
|
-
class
|
|
142
|
-
|
|
505
|
+
const ir = "0.8.0";
|
|
506
|
+
var ar = /* @__PURE__ */ ((s) => (s.Invalid = "Invalid", s.Empty = "Empty", s.Normal = "Normal", s))(ar || {}), or = /* @__PURE__ */ ((s) => (s.None = "None", s.Line = "Line", s.Syllable = "Syllable", s))(or || {});
|
|
507
|
+
class Nr {
|
|
508
|
+
/**
|
|
509
|
+
* Schema version of this data model.
|
|
510
|
+
*/
|
|
511
|
+
version = ir;
|
|
512
|
+
/**
|
|
513
|
+
* Overall classification of the lyric.
|
|
514
|
+
*/
|
|
143
515
|
type = "Invalid";
|
|
144
|
-
|
|
145
|
-
|
|
516
|
+
/**
|
|
517
|
+
* Timing precision of the lyric.
|
|
518
|
+
*/
|
|
519
|
+
timing = "None";
|
|
520
|
+
/**
|
|
521
|
+
* Metadata of the lyric.
|
|
522
|
+
*/
|
|
523
|
+
meta = new sr();
|
|
524
|
+
/**
|
|
525
|
+
* Language distribution of the lyric.
|
|
526
|
+
*/
|
|
527
|
+
language = new Yt();
|
|
528
|
+
/**
|
|
529
|
+
* Performing agents referenced by lines.
|
|
530
|
+
*/
|
|
146
531
|
agents = [];
|
|
532
|
+
/**
|
|
533
|
+
* Lyric lines in order.
|
|
534
|
+
*/
|
|
535
|
+
lines = [];
|
|
147
536
|
}
|
|
148
|
-
const
|
|
537
|
+
const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
149
538
|
__proto__: null,
|
|
150
|
-
Agent:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
InfoType:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
WordSpace:
|
|
175
|
-
WordType:
|
|
539
|
+
Agent: Or,
|
|
540
|
+
AgentType: nr,
|
|
541
|
+
Info: Nr,
|
|
542
|
+
InfoTiming: or,
|
|
543
|
+
InfoType: ar,
|
|
544
|
+
Language: Yt,
|
|
545
|
+
LanguageItem: dr,
|
|
546
|
+
LanguageType: zt,
|
|
547
|
+
LineAgent: Sr,
|
|
548
|
+
LineAnnotation: Qt,
|
|
549
|
+
LineAnnotationItem: Y,
|
|
550
|
+
LineInterlude: Lr,
|
|
551
|
+
LineNormal: $r,
|
|
552
|
+
LineNormalBase: rr,
|
|
553
|
+
LineType: er,
|
|
554
|
+
LineUnknownAnnotation: Zt,
|
|
555
|
+
Meta: sr,
|
|
556
|
+
MetaType: _,
|
|
557
|
+
Time: Kt,
|
|
558
|
+
Version: ir,
|
|
559
|
+
WordAnnotation: Rr,
|
|
560
|
+
WordAnnotationContent: Er,
|
|
561
|
+
WordAnnotationItem: Jt,
|
|
562
|
+
WordNormal: vr,
|
|
563
|
+
WordSpace: Ir,
|
|
564
|
+
WordType: k,
|
|
565
|
+
WordUnknownAnnotation: gr,
|
|
566
|
+
createMetaItem: Tr
|
|
176
567
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
568
|
+
class wr {
|
|
569
|
+
lines = [];
|
|
570
|
+
mergedEnd = [];
|
|
571
|
+
/**
|
|
572
|
+
* Raw deactivation time of a line: the later of its own end and the next line's start.
|
|
573
|
+
*
|
|
574
|
+
* The final line never deactivates, and out-of-range indices resolve to 0.
|
|
575
|
+
*/
|
|
576
|
+
getRawTime(e) {
|
|
577
|
+
const t = this.lines;
|
|
578
|
+
return e < 0 || e >= t.length ? 0 : e === t.length - 1 ? 1 / 0 : Math.max(t[e].time.end, t[e + 1].time.start);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Rebuild the merged end-time table from the given lines and merge settings.
|
|
582
|
+
*/
|
|
583
|
+
build(e, t, n) {
|
|
584
|
+
this.lines = e;
|
|
585
|
+
const i = e.length, c = new Array(i);
|
|
586
|
+
if (i === 0) {
|
|
587
|
+
this.mergedEnd = c;
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
const l = Math.max(0, t), h = n > 0 ? n : 1 / 0;
|
|
591
|
+
let o = this.getRawTime(i - 1);
|
|
592
|
+
c[i - 1] = o;
|
|
593
|
+
let a = 1;
|
|
594
|
+
for (let r = i - 2; r >= 0; r--) {
|
|
595
|
+
const u = this.getRawTime(r);
|
|
596
|
+
l > 0 && a < h && Math.abs(o - u) < l ? (c[r] = Math.max(u, c[r + 1]), a++) : (c[r] = u, a = 1), o = u;
|
|
597
|
+
}
|
|
598
|
+
this.mergedEnd = c;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Merged deactivation time of a line, falling back to the raw time when unbuilt.
|
|
602
|
+
*/
|
|
603
|
+
getMergedTime(e) {
|
|
604
|
+
const t = this.mergedEnd[e];
|
|
605
|
+
return t === void 0 ? this.getRawTime(e) : t;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
class Ar {
|
|
609
|
+
temp = 0;
|
|
610
|
+
meta = 0;
|
|
611
|
+
setTemp(e) {
|
|
612
|
+
this.temp = Number.isFinite(e) ? e : 0;
|
|
613
|
+
}
|
|
614
|
+
resetTemp() {
|
|
615
|
+
this.temp = 0;
|
|
616
|
+
}
|
|
617
|
+
refreshFromMeta(e, t) {
|
|
618
|
+
if (!t) {
|
|
619
|
+
this.meta = 0;
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
const n = e.meta.offsets[0]?.value;
|
|
623
|
+
this.meta = typeof n == "number" && Number.isFinite(n) ? n : 0;
|
|
624
|
+
}
|
|
625
|
+
resolve(e) {
|
|
626
|
+
const t = e + this.meta + this.temp;
|
|
627
|
+
return Number.isFinite(t) ? t : 0;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
class yr {
|
|
631
|
+
frameId = null;
|
|
632
|
+
timerId = null;
|
|
633
|
+
schedule(e, t) {
|
|
634
|
+
switch (e) {
|
|
635
|
+
case "animation":
|
|
636
|
+
this.frameId = globalThis.requestAnimationFrame(t);
|
|
637
|
+
break;
|
|
638
|
+
case "timer":
|
|
639
|
+
this.timerId = globalThis.setTimeout(t, 16);
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
cancel() {
|
|
644
|
+
this.frameId !== null && (globalThis.cancelAnimationFrame(this.frameId), this.frameId = null), this.timerId !== null && (globalThis.clearTimeout(this.timerId), this.timerId = null);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
var H = { exports: {} }, ie, tt;
|
|
648
|
+
function K() {
|
|
649
|
+
if (tt) return ie;
|
|
180
650
|
tt = 1;
|
|
181
|
-
const
|
|
182
|
-
9007199254740991,
|
|
183
|
-
return
|
|
184
|
-
MAX_LENGTH:
|
|
185
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
651
|
+
const s = "2.0.0", e = 256, t = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
652
|
+
9007199254740991, n = 16, i = e - 6;
|
|
653
|
+
return ie = {
|
|
654
|
+
MAX_LENGTH: e,
|
|
655
|
+
MAX_SAFE_COMPONENT_LENGTH: n,
|
|
186
656
|
MAX_SAFE_BUILD_LENGTH: i,
|
|
187
|
-
MAX_SAFE_INTEGER:
|
|
657
|
+
MAX_SAFE_INTEGER: t,
|
|
188
658
|
RELEASE_TYPES: [
|
|
189
659
|
"major",
|
|
190
660
|
"premajor",
|
|
@@ -194,99 +664,99 @@ function Y() {
|
|
|
194
664
|
"prepatch",
|
|
195
665
|
"prerelease"
|
|
196
666
|
],
|
|
197
|
-
SEMVER_SPEC_VERSION:
|
|
667
|
+
SEMVER_SPEC_VERSION: s,
|
|
198
668
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
199
669
|
FLAG_LOOSE: 2
|
|
200
|
-
},
|
|
670
|
+
}, ie;
|
|
201
671
|
}
|
|
202
|
-
var
|
|
203
|
-
function
|
|
204
|
-
return rt || (rt = 1,
|
|
205
|
-
}),
|
|
672
|
+
var ae, rt;
|
|
673
|
+
function J() {
|
|
674
|
+
return rt || (rt = 1, ae = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {
|
|
675
|
+
}), ae;
|
|
206
676
|
}
|
|
207
677
|
var st;
|
|
208
|
-
function
|
|
209
|
-
return st || (st = 1, (function(
|
|
678
|
+
function W() {
|
|
679
|
+
return st || (st = 1, (function(s, e) {
|
|
210
680
|
const {
|
|
211
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
212
|
-
MAX_SAFE_BUILD_LENGTH:
|
|
681
|
+
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
682
|
+
MAX_SAFE_BUILD_LENGTH: n,
|
|
213
683
|
MAX_LENGTH: i
|
|
214
|
-
} =
|
|
215
|
-
|
|
216
|
-
const l =
|
|
217
|
-
let
|
|
218
|
-
const f = "[a-zA-Z0-9-]",
|
|
684
|
+
} = K(), c = J();
|
|
685
|
+
e = s.exports = {};
|
|
686
|
+
const l = e.re = [], h = e.safeRe = [], o = e.src = [], a = e.safeSrc = [], r = e.t = {};
|
|
687
|
+
let u = 0;
|
|
688
|
+
const f = "[a-zA-Z0-9-]", E = [
|
|
219
689
|
["\\s", 1],
|
|
220
690
|
["\\d", i],
|
|
221
|
-
[f,
|
|
222
|
-
],
|
|
223
|
-
for (const [
|
|
224
|
-
|
|
225
|
-
return
|
|
226
|
-
},
|
|
227
|
-
const
|
|
228
|
-
|
|
691
|
+
[f, n]
|
|
692
|
+
], S = (O) => {
|
|
693
|
+
for (const [w, G] of E)
|
|
694
|
+
O = O.split(`${w}*`).join(`${w}{0,${G}}`).split(`${w}+`).join(`${w}{1,${G}}`);
|
|
695
|
+
return O;
|
|
696
|
+
}, p = (O, w, G) => {
|
|
697
|
+
const A = S(w), b = u++;
|
|
698
|
+
c(O, b, w), r[O] = b, o[b] = w, a[b] = A, l[b] = new RegExp(w, G ? "g" : void 0), h[b] = new RegExp(A, G ? "g" : void 0);
|
|
229
699
|
};
|
|
230
|
-
|
|
700
|
+
p("NUMERICIDENTIFIER", "0|[1-9]\\d*"), p("NUMERICIDENTIFIERLOOSE", "\\d+"), p("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), p("MAINVERSION", `(${o[r.NUMERICIDENTIFIER]})\\.(${o[r.NUMERICIDENTIFIER]})\\.(${o[r.NUMERICIDENTIFIER]})`), p("MAINVERSIONLOOSE", `(${o[r.NUMERICIDENTIFIERLOOSE]})\\.(${o[r.NUMERICIDENTIFIERLOOSE]})\\.(${o[r.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASEIDENTIFIER", `(?:${o[r.NONNUMERICIDENTIFIER]}|${o[r.NUMERICIDENTIFIER]})`), p("PRERELEASEIDENTIFIERLOOSE", `(?:${o[r.NONNUMERICIDENTIFIER]}|${o[r.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASE", `(?:-(${o[r.PRERELEASEIDENTIFIER]}(?:\\.${o[r.PRERELEASEIDENTIFIER]})*))`), p("PRERELEASELOOSE", `(?:-?(${o[r.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[r.PRERELEASEIDENTIFIERLOOSE]})*))`), p("BUILDIDENTIFIER", `${f}+`), p("BUILD", `(?:\\+(${o[r.BUILDIDENTIFIER]}(?:\\.${o[r.BUILDIDENTIFIER]})*))`), p("FULLPLAIN", `v?${o[r.MAINVERSION]}${o[r.PRERELEASE]}?${o[r.BUILD]}?`), p("FULL", `^${o[r.FULLPLAIN]}$`), p("LOOSEPLAIN", `[v=\\s]*${o[r.MAINVERSIONLOOSE]}${o[r.PRERELEASELOOSE]}?${o[r.BUILD]}?`), p("LOOSE", `^${o[r.LOOSEPLAIN]}$`), p("GTLT", "((?:<|>)?=?)"), p("XRANGEIDENTIFIERLOOSE", `${o[r.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), p("XRANGEIDENTIFIER", `${o[r.NUMERICIDENTIFIER]}|x|X|\\*`), p("XRANGEPLAIN", `[v=\\s]*(${o[r.XRANGEIDENTIFIER]})(?:\\.(${o[r.XRANGEIDENTIFIER]})(?:\\.(${o[r.XRANGEIDENTIFIER]})(?:${o[r.PRERELEASE]})?${o[r.BUILD]}?)?)?`), p("XRANGEPLAINLOOSE", `[v=\\s]*(${o[r.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[r.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[r.XRANGEIDENTIFIERLOOSE]})(?:${o[r.PRERELEASELOOSE]})?${o[r.BUILD]}?)?)?`), p("XRANGE", `^${o[r.GTLT]}\\s*${o[r.XRANGEPLAIN]}$`), p("XRANGELOOSE", `^${o[r.GTLT]}\\s*${o[r.XRANGEPLAINLOOSE]}$`), p("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), p("COERCE", `${o[r.COERCEPLAIN]}(?:$|[^\\d])`), p("COERCEFULL", o[r.COERCEPLAIN] + `(?:${o[r.PRERELEASE]})?(?:${o[r.BUILD]})?(?:$|[^\\d])`), p("COERCERTL", o[r.COERCE], !0), p("COERCERTLFULL", o[r.COERCEFULL], !0), p("LONETILDE", "(?:~>?)"), p("TILDETRIM", `(\\s*)${o[r.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", p("TILDE", `^${o[r.LONETILDE]}${o[r.XRANGEPLAIN]}$`), p("TILDELOOSE", `^${o[r.LONETILDE]}${o[r.XRANGEPLAINLOOSE]}$`), p("LONECARET", "(?:\\^)"), p("CARETTRIM", `(\\s*)${o[r.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", p("CARET", `^${o[r.LONECARET]}${o[r.XRANGEPLAIN]}$`), p("CARETLOOSE", `^${o[r.LONECARET]}${o[r.XRANGEPLAINLOOSE]}$`), p("COMPARATORLOOSE", `^${o[r.GTLT]}\\s*(${o[r.LOOSEPLAIN]})$|^$`), p("COMPARATOR", `^${o[r.GTLT]}\\s*(${o[r.FULLPLAIN]})$|^$`), p("COMPARATORTRIM", `(\\s*)${o[r.GTLT]}\\s*(${o[r.LOOSEPLAIN]}|${o[r.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", p("HYPHENRANGE", `^\\s*(${o[r.XRANGEPLAIN]})\\s+-\\s+(${o[r.XRANGEPLAIN]})\\s*$`), p("HYPHENRANGELOOSE", `^\\s*(${o[r.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[r.XRANGEPLAINLOOSE]})\\s*$`), p("STAR", "(<|>)?=?\\s*\\*"), p("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), p("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
231
701
|
})(H, H.exports)), H.exports;
|
|
232
702
|
}
|
|
233
|
-
var
|
|
234
|
-
function
|
|
235
|
-
if (nt) return
|
|
703
|
+
var oe, nt;
|
|
704
|
+
function Ye() {
|
|
705
|
+
if (nt) return oe;
|
|
236
706
|
nt = 1;
|
|
237
|
-
const
|
|
238
|
-
return
|
|
707
|
+
const s = Object.freeze({ loose: !0 }), e = Object.freeze({});
|
|
708
|
+
return oe = (n) => n ? typeof n != "object" ? s : n : e, oe;
|
|
239
709
|
}
|
|
240
|
-
var
|
|
241
|
-
function
|
|
242
|
-
if (it) return
|
|
710
|
+
var le, it;
|
|
711
|
+
function lr() {
|
|
712
|
+
if (it) return le;
|
|
243
713
|
it = 1;
|
|
244
|
-
const
|
|
245
|
-
if (typeof
|
|
246
|
-
return
|
|
247
|
-
const
|
|
248
|
-
return
|
|
714
|
+
const s = /^[0-9]+$/, e = (n, i) => {
|
|
715
|
+
if (typeof n == "number" && typeof i == "number")
|
|
716
|
+
return n === i ? 0 : n < i ? -1 : 1;
|
|
717
|
+
const c = s.test(n), l = s.test(i);
|
|
718
|
+
return c && l && (n = +n, i = +i), n === i ? 0 : c && !l ? -1 : l && !c ? 1 : n < i ? -1 : 1;
|
|
249
719
|
};
|
|
250
|
-
return
|
|
251
|
-
compareIdentifiers:
|
|
252
|
-
rcompareIdentifiers: (
|
|
253
|
-
},
|
|
254
|
-
}
|
|
255
|
-
var
|
|
256
|
-
function
|
|
257
|
-
if (at) return
|
|
720
|
+
return le = {
|
|
721
|
+
compareIdentifiers: e,
|
|
722
|
+
rcompareIdentifiers: (n, i) => e(i, n)
|
|
723
|
+
}, le;
|
|
724
|
+
}
|
|
725
|
+
var ce, at;
|
|
726
|
+
function x() {
|
|
727
|
+
if (at) return ce;
|
|
258
728
|
at = 1;
|
|
259
|
-
const
|
|
729
|
+
const s = J(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: t } = K(), { safeRe: n, t: i } = W(), c = Ye(), { compareIdentifiers: l } = lr();
|
|
260
730
|
class h {
|
|
261
|
-
constructor(a,
|
|
262
|
-
if (
|
|
263
|
-
if (a.loose === !!
|
|
731
|
+
constructor(a, r) {
|
|
732
|
+
if (r = c(r), a instanceof h) {
|
|
733
|
+
if (a.loose === !!r.loose && a.includePrerelease === !!r.includePrerelease)
|
|
264
734
|
return a;
|
|
265
735
|
a = a.version;
|
|
266
736
|
} else if (typeof a != "string")
|
|
267
737
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);
|
|
268
|
-
if (a.length >
|
|
738
|
+
if (a.length > e)
|
|
269
739
|
throw new TypeError(
|
|
270
|
-
`version is longer than ${
|
|
740
|
+
`version is longer than ${e} characters`
|
|
271
741
|
);
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
if (!
|
|
742
|
+
s("SemVer", a, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
|
|
743
|
+
const u = a.trim().match(r.loose ? n[i.LOOSE] : n[i.FULL]);
|
|
744
|
+
if (!u)
|
|
275
745
|
throw new TypeError(`Invalid Version: ${a}`);
|
|
276
|
-
if (this.raw = a, this.major = +
|
|
746
|
+
if (this.raw = a, this.major = +u[1], this.minor = +u[2], this.patch = +u[3], this.major > t || this.major < 0)
|
|
277
747
|
throw new TypeError("Invalid major version");
|
|
278
|
-
if (this.minor >
|
|
748
|
+
if (this.minor > t || this.minor < 0)
|
|
279
749
|
throw new TypeError("Invalid minor version");
|
|
280
|
-
if (this.patch >
|
|
750
|
+
if (this.patch > t || this.patch < 0)
|
|
281
751
|
throw new TypeError("Invalid patch version");
|
|
282
|
-
|
|
752
|
+
u[4] ? this.prerelease = u[4].split(".").map((f) => {
|
|
283
753
|
if (/^[0-9]+$/.test(f)) {
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
286
|
-
return
|
|
754
|
+
const E = +f;
|
|
755
|
+
if (E >= 0 && E < t)
|
|
756
|
+
return E;
|
|
287
757
|
}
|
|
288
758
|
return f;
|
|
289
|
-
}) : this.prerelease = [], this.build =
|
|
759
|
+
}) : this.prerelease = [], this.build = u[5] ? u[5].split(".") : [], this.format();
|
|
290
760
|
}
|
|
291
761
|
format() {
|
|
292
762
|
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
|
|
@@ -295,7 +765,7 @@ function b() {
|
|
|
295
765
|
return this.version;
|
|
296
766
|
}
|
|
297
767
|
compare(a) {
|
|
298
|
-
if (
|
|
768
|
+
if (s("SemVer.compare", this.version, this.options, a), !(a instanceof h)) {
|
|
299
769
|
if (typeof a == "string" && a === this.version)
|
|
300
770
|
return 0;
|
|
301
771
|
a = new h(a, this.options);
|
|
@@ -312,62 +782,62 @@ function b() {
|
|
|
312
782
|
return 1;
|
|
313
783
|
if (!this.prerelease.length && !a.prerelease.length)
|
|
314
784
|
return 0;
|
|
315
|
-
let
|
|
785
|
+
let r = 0;
|
|
316
786
|
do {
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
787
|
+
const u = this.prerelease[r], f = a.prerelease[r];
|
|
788
|
+
if (s("prerelease compare", r, u, f), u === void 0 && f === void 0)
|
|
319
789
|
return 0;
|
|
320
790
|
if (f === void 0)
|
|
321
791
|
return 1;
|
|
322
|
-
if (
|
|
792
|
+
if (u === void 0)
|
|
323
793
|
return -1;
|
|
324
|
-
if (
|
|
794
|
+
if (u === f)
|
|
325
795
|
continue;
|
|
326
|
-
return l(
|
|
327
|
-
} while (++
|
|
796
|
+
return l(u, f);
|
|
797
|
+
} while (++r);
|
|
328
798
|
}
|
|
329
799
|
compareBuild(a) {
|
|
330
800
|
a instanceof h || (a = new h(a, this.options));
|
|
331
|
-
let
|
|
801
|
+
let r = 0;
|
|
332
802
|
do {
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
803
|
+
const u = this.build[r], f = a.build[r];
|
|
804
|
+
if (s("build compare", r, u, f), u === void 0 && f === void 0)
|
|
335
805
|
return 0;
|
|
336
806
|
if (f === void 0)
|
|
337
807
|
return 1;
|
|
338
|
-
if (
|
|
808
|
+
if (u === void 0)
|
|
339
809
|
return -1;
|
|
340
|
-
if (
|
|
810
|
+
if (u === f)
|
|
341
811
|
continue;
|
|
342
|
-
return l(
|
|
343
|
-
} while (++
|
|
812
|
+
return l(u, f);
|
|
813
|
+
} while (++r);
|
|
344
814
|
}
|
|
345
815
|
// preminor will bump the version up to the next minor release, and immediately
|
|
346
816
|
// down to pre-release. premajor and prepatch work the same way.
|
|
347
|
-
inc(a,
|
|
817
|
+
inc(a, r, u) {
|
|
348
818
|
if (a.startsWith("pre")) {
|
|
349
|
-
if (!
|
|
819
|
+
if (!r && u === !1)
|
|
350
820
|
throw new Error("invalid increment argument: identifier is empty");
|
|
351
|
-
if (
|
|
352
|
-
const f = `-${
|
|
353
|
-
if (!f || f[1] !==
|
|
354
|
-
throw new Error(`invalid identifier: ${
|
|
821
|
+
if (r) {
|
|
822
|
+
const f = `-${r}`.match(this.options.loose ? n[i.PRERELEASELOOSE] : n[i.PRERELEASE]);
|
|
823
|
+
if (!f || f[1] !== r)
|
|
824
|
+
throw new Error(`invalid identifier: ${r}`);
|
|
355
825
|
}
|
|
356
826
|
}
|
|
357
827
|
switch (a) {
|
|
358
828
|
case "premajor":
|
|
359
|
-
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre",
|
|
829
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", r, u);
|
|
360
830
|
break;
|
|
361
831
|
case "preminor":
|
|
362
|
-
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre",
|
|
832
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", r, u);
|
|
363
833
|
break;
|
|
364
834
|
case "prepatch":
|
|
365
|
-
this.prerelease.length = 0, this.inc("patch",
|
|
835
|
+
this.prerelease.length = 0, this.inc("patch", r, u), this.inc("pre", r, u);
|
|
366
836
|
break;
|
|
367
837
|
// If the input is a non-prerelease version, this acts the same as
|
|
368
838
|
// prepatch.
|
|
369
839
|
case "prerelease":
|
|
370
|
-
this.prerelease.length === 0 && this.inc("patch",
|
|
840
|
+
this.prerelease.length === 0 && this.inc("patch", r, u), this.inc("pre", r, u);
|
|
371
841
|
break;
|
|
372
842
|
case "release":
|
|
373
843
|
if (this.prerelease.length === 0)
|
|
@@ -386,22 +856,22 @@ function b() {
|
|
|
386
856
|
// This probably shouldn't be used publicly.
|
|
387
857
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
388
858
|
case "pre": {
|
|
389
|
-
const f = Number(
|
|
859
|
+
const f = Number(u) ? 1 : 0;
|
|
390
860
|
if (this.prerelease.length === 0)
|
|
391
861
|
this.prerelease = [f];
|
|
392
862
|
else {
|
|
393
|
-
let
|
|
394
|
-
for (; --
|
|
395
|
-
typeof this.prerelease[
|
|
396
|
-
if (
|
|
397
|
-
if (
|
|
863
|
+
let E = this.prerelease.length;
|
|
864
|
+
for (; --E >= 0; )
|
|
865
|
+
typeof this.prerelease[E] == "number" && (this.prerelease[E]++, E = -2);
|
|
866
|
+
if (E === -1) {
|
|
867
|
+
if (r === this.prerelease.join(".") && u === !1)
|
|
398
868
|
throw new Error("invalid increment argument: identifier already exists");
|
|
399
869
|
this.prerelease.push(f);
|
|
400
870
|
}
|
|
401
871
|
}
|
|
402
|
-
if (
|
|
403
|
-
let
|
|
404
|
-
|
|
872
|
+
if (r) {
|
|
873
|
+
let E = [r, f];
|
|
874
|
+
u === !1 && (E = [r]), l(this.prerelease[0], r) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = E) : this.prerelease = E;
|
|
405
875
|
}
|
|
406
876
|
break;
|
|
407
877
|
}
|
|
@@ -411,206 +881,206 @@ function b() {
|
|
|
411
881
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
412
882
|
}
|
|
413
883
|
}
|
|
414
|
-
return
|
|
884
|
+
return ce = h, ce;
|
|
415
885
|
}
|
|
416
|
-
var
|
|
417
|
-
function
|
|
418
|
-
if (ot) return
|
|
886
|
+
var ue, ot;
|
|
887
|
+
function M() {
|
|
888
|
+
if (ot) return ue;
|
|
419
889
|
ot = 1;
|
|
420
|
-
const
|
|
421
|
-
return
|
|
422
|
-
if (
|
|
423
|
-
return
|
|
890
|
+
const s = x();
|
|
891
|
+
return ue = (t, n, i = !1) => {
|
|
892
|
+
if (t instanceof s)
|
|
893
|
+
return t;
|
|
424
894
|
try {
|
|
425
|
-
return new t
|
|
426
|
-
} catch (
|
|
895
|
+
return new s(t, n);
|
|
896
|
+
} catch (c) {
|
|
427
897
|
if (!i)
|
|
428
898
|
return null;
|
|
429
|
-
throw
|
|
899
|
+
throw c;
|
|
430
900
|
}
|
|
431
|
-
},
|
|
901
|
+
}, ue;
|
|
432
902
|
}
|
|
433
|
-
var
|
|
434
|
-
function
|
|
435
|
-
if (lt) return
|
|
903
|
+
var he, lt;
|
|
904
|
+
function Cr() {
|
|
905
|
+
if (lt) return he;
|
|
436
906
|
lt = 1;
|
|
437
|
-
const
|
|
438
|
-
return
|
|
439
|
-
const i = t
|
|
907
|
+
const s = M();
|
|
908
|
+
return he = (t, n) => {
|
|
909
|
+
const i = s(t, n);
|
|
440
910
|
return i ? i.version : null;
|
|
441
|
-
},
|
|
911
|
+
}, he;
|
|
442
912
|
}
|
|
443
|
-
var
|
|
444
|
-
function
|
|
445
|
-
if (ct) return
|
|
913
|
+
var fe, ct;
|
|
914
|
+
function Pr() {
|
|
915
|
+
if (ct) return fe;
|
|
446
916
|
ct = 1;
|
|
447
|
-
const
|
|
448
|
-
return
|
|
449
|
-
const i = t
|
|
917
|
+
const s = M();
|
|
918
|
+
return fe = (t, n) => {
|
|
919
|
+
const i = s(t.trim().replace(/^[=v]+/, ""), n);
|
|
450
920
|
return i ? i.version : null;
|
|
451
|
-
},
|
|
921
|
+
}, fe;
|
|
452
922
|
}
|
|
453
|
-
var
|
|
454
|
-
function
|
|
455
|
-
if (ut) return
|
|
923
|
+
var me, ut;
|
|
924
|
+
function qr() {
|
|
925
|
+
if (ut) return me;
|
|
456
926
|
ut = 1;
|
|
457
|
-
const
|
|
458
|
-
return
|
|
459
|
-
typeof i == "string" && (l =
|
|
927
|
+
const s = x();
|
|
928
|
+
return me = (t, n, i, c, l) => {
|
|
929
|
+
typeof i == "string" && (l = c, c = i, i = void 0);
|
|
460
930
|
try {
|
|
461
|
-
return new
|
|
462
|
-
|
|
931
|
+
return new s(
|
|
932
|
+
t instanceof s ? t.version : t,
|
|
463
933
|
i
|
|
464
|
-
).inc(
|
|
934
|
+
).inc(n, c, l).version;
|
|
465
935
|
} catch {
|
|
466
936
|
return null;
|
|
467
937
|
}
|
|
468
|
-
},
|
|
938
|
+
}, me;
|
|
469
939
|
}
|
|
470
|
-
var
|
|
471
|
-
function
|
|
472
|
-
if (
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
return
|
|
476
|
-
const i = t
|
|
940
|
+
var pe, ht;
|
|
941
|
+
function Gr() {
|
|
942
|
+
if (ht) return pe;
|
|
943
|
+
ht = 1;
|
|
944
|
+
const s = M();
|
|
945
|
+
return pe = (t, n) => {
|
|
946
|
+
const i = s(t, null, !0), c = s(n, null, !0), l = i.compare(c);
|
|
477
947
|
if (l === 0)
|
|
478
948
|
return null;
|
|
479
|
-
const h = l > 0, o = h ? i :
|
|
480
|
-
if (!!a.prerelease.length && !
|
|
949
|
+
const h = l > 0, o = h ? i : c, a = h ? c : i, r = !!o.prerelease.length;
|
|
950
|
+
if (!!a.prerelease.length && !r) {
|
|
481
951
|
if (!a.patch && !a.minor)
|
|
482
952
|
return "major";
|
|
483
953
|
if (a.compareMain(o) === 0)
|
|
484
954
|
return a.minor && !a.patch ? "minor" : "patch";
|
|
485
955
|
}
|
|
486
|
-
const f =
|
|
487
|
-
return i.major !==
|
|
488
|
-
},
|
|
956
|
+
const f = r ? "pre" : "";
|
|
957
|
+
return i.major !== c.major ? f + "major" : i.minor !== c.minor ? f + "minor" : i.patch !== c.patch ? f + "patch" : "prerelease";
|
|
958
|
+
}, pe;
|
|
489
959
|
}
|
|
490
|
-
var
|
|
491
|
-
function
|
|
492
|
-
if (
|
|
493
|
-
|
|
494
|
-
const
|
|
495
|
-
return
|
|
496
|
-
}
|
|
497
|
-
var Ee, pt;
|
|
498
|
-
function qr() {
|
|
499
|
-
if (pt) return Ee;
|
|
500
|
-
pt = 1;
|
|
501
|
-
const t = b();
|
|
502
|
-
return Ee = (r, s) => new t(r, s).minor, Ee;
|
|
503
|
-
}
|
|
504
|
-
var me, Et;
|
|
505
|
-
function Pr() {
|
|
506
|
-
if (Et) return me;
|
|
507
|
-
Et = 1;
|
|
508
|
-
const t = b();
|
|
509
|
-
return me = (r, s) => new t(r, s).patch, me;
|
|
960
|
+
var de, ft;
|
|
961
|
+
function br() {
|
|
962
|
+
if (ft) return de;
|
|
963
|
+
ft = 1;
|
|
964
|
+
const s = x();
|
|
965
|
+
return de = (t, n) => new s(t, n).major, de;
|
|
510
966
|
}
|
|
511
|
-
var
|
|
512
|
-
function
|
|
513
|
-
if (mt) return
|
|
967
|
+
var Ee, mt;
|
|
968
|
+
function Dr() {
|
|
969
|
+
if (mt) return Ee;
|
|
514
970
|
mt = 1;
|
|
515
|
-
const
|
|
516
|
-
return
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
971
|
+
const s = x();
|
|
972
|
+
return Ee = (t, n) => new s(t, n).minor, Ee;
|
|
973
|
+
}
|
|
974
|
+
var ge, pt;
|
|
975
|
+
function xr() {
|
|
976
|
+
if (pt) return ge;
|
|
977
|
+
pt = 1;
|
|
978
|
+
const s = x();
|
|
979
|
+
return ge = (t, n) => new s(t, n).patch, ge;
|
|
520
980
|
}
|
|
521
981
|
var Re, dt;
|
|
522
|
-
function
|
|
982
|
+
function Ur() {
|
|
523
983
|
if (dt) return Re;
|
|
524
984
|
dt = 1;
|
|
525
|
-
const
|
|
526
|
-
return Re = (
|
|
985
|
+
const s = M();
|
|
986
|
+
return Re = (t, n) => {
|
|
987
|
+
const i = s(t, n);
|
|
988
|
+
return i && i.prerelease.length ? i.prerelease : null;
|
|
989
|
+
}, Re;
|
|
527
990
|
}
|
|
528
|
-
var ve,
|
|
529
|
-
function
|
|
530
|
-
if (
|
|
991
|
+
var ve, Et;
|
|
992
|
+
function F() {
|
|
993
|
+
if (Et) return ve;
|
|
994
|
+
Et = 1;
|
|
995
|
+
const s = x();
|
|
996
|
+
return ve = (t, n, i) => new s(t, i).compare(new s(n, i)), ve;
|
|
997
|
+
}
|
|
998
|
+
var Ie, gt;
|
|
999
|
+
function _r() {
|
|
1000
|
+
if (gt) return Ie;
|
|
1001
|
+
gt = 1;
|
|
1002
|
+
const s = F();
|
|
1003
|
+
return Ie = (t, n, i) => s(n, t, i), Ie;
|
|
1004
|
+
}
|
|
1005
|
+
var $e, Rt;
|
|
1006
|
+
function Fr() {
|
|
1007
|
+
if (Rt) return $e;
|
|
531
1008
|
Rt = 1;
|
|
532
|
-
const
|
|
533
|
-
return
|
|
1009
|
+
const s = F();
|
|
1010
|
+
return $e = (t, n) => s(t, n, !0), $e;
|
|
534
1011
|
}
|
|
535
|
-
var
|
|
536
|
-
function
|
|
537
|
-
if (vt) return
|
|
1012
|
+
var Le, vt;
|
|
1013
|
+
function Ke() {
|
|
1014
|
+
if (vt) return Le;
|
|
538
1015
|
vt = 1;
|
|
539
|
-
const
|
|
540
|
-
return
|
|
1016
|
+
const s = x();
|
|
1017
|
+
return Le = (t, n, i) => {
|
|
1018
|
+
const c = new s(t, i), l = new s(n, i);
|
|
1019
|
+
return c.compare(l) || c.compareBuild(l);
|
|
1020
|
+
}, Le;
|
|
541
1021
|
}
|
|
542
|
-
var
|
|
543
|
-
function
|
|
544
|
-
if (It) return
|
|
1022
|
+
var Te, It;
|
|
1023
|
+
function jr() {
|
|
1024
|
+
if (It) return Te;
|
|
545
1025
|
It = 1;
|
|
546
|
-
const
|
|
547
|
-
return
|
|
548
|
-
const u = new t(r, i), l = new t(s, i);
|
|
549
|
-
return u.compare(l) || u.compareBuild(l);
|
|
550
|
-
}, $e;
|
|
1026
|
+
const s = Ke();
|
|
1027
|
+
return Te = (t, n) => t.sort((i, c) => s(i, c, n)), Te;
|
|
551
1028
|
}
|
|
552
|
-
var
|
|
553
|
-
function
|
|
554
|
-
if ($t) return
|
|
1029
|
+
var Oe, $t;
|
|
1030
|
+
function kr() {
|
|
1031
|
+
if ($t) return Oe;
|
|
555
1032
|
$t = 1;
|
|
556
|
-
const
|
|
557
|
-
return
|
|
558
|
-
}
|
|
559
|
-
var Le, gt;
|
|
560
|
-
function _r() {
|
|
561
|
-
if (gt) return Le;
|
|
562
|
-
gt = 1;
|
|
563
|
-
const t = Je();
|
|
564
|
-
return Le = (r, s) => r.sort((i, u) => t(u, i, s)), Le;
|
|
1033
|
+
const s = Ke();
|
|
1034
|
+
return Oe = (t, n) => t.sort((i, c) => s(c, i, n)), Oe;
|
|
565
1035
|
}
|
|
566
|
-
var
|
|
567
|
-
function
|
|
568
|
-
if (Lt) return
|
|
1036
|
+
var Se, Lt;
|
|
1037
|
+
function Z() {
|
|
1038
|
+
if (Lt) return Se;
|
|
569
1039
|
Lt = 1;
|
|
570
|
-
const
|
|
571
|
-
return
|
|
1040
|
+
const s = F();
|
|
1041
|
+
return Se = (t, n, i) => s(t, n, i) > 0, Se;
|
|
572
1042
|
}
|
|
573
1043
|
var Ne, Tt;
|
|
574
|
-
function
|
|
1044
|
+
function Je() {
|
|
575
1045
|
if (Tt) return Ne;
|
|
576
1046
|
Tt = 1;
|
|
577
|
-
const
|
|
578
|
-
return Ne = (
|
|
1047
|
+
const s = F();
|
|
1048
|
+
return Ne = (t, n, i) => s(t, n, i) < 0, Ne;
|
|
579
1049
|
}
|
|
580
|
-
var
|
|
581
|
-
function
|
|
582
|
-
if (
|
|
583
|
-
Nt = 1;
|
|
584
|
-
const t = U();
|
|
585
|
-
return Oe = (r, s, i) => t(r, s, i) === 0, Oe;
|
|
586
|
-
}
|
|
587
|
-
var Se, Ot;
|
|
588
|
-
function ir() {
|
|
589
|
-
if (Ot) return Se;
|
|
1050
|
+
var we, Ot;
|
|
1051
|
+
function cr() {
|
|
1052
|
+
if (Ot) return we;
|
|
590
1053
|
Ot = 1;
|
|
591
|
-
const
|
|
592
|
-
return
|
|
1054
|
+
const s = F();
|
|
1055
|
+
return we = (t, n, i) => s(t, n, i) === 0, we;
|
|
593
1056
|
}
|
|
594
1057
|
var Ae, St;
|
|
595
|
-
function
|
|
1058
|
+
function ur() {
|
|
596
1059
|
if (St) return Ae;
|
|
597
1060
|
St = 1;
|
|
598
|
-
const
|
|
599
|
-
return Ae = (
|
|
1061
|
+
const s = F();
|
|
1062
|
+
return Ae = (t, n, i) => s(t, n, i) !== 0, Ae;
|
|
600
1063
|
}
|
|
601
|
-
var
|
|
602
|
-
function
|
|
603
|
-
if (
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
return
|
|
1064
|
+
var ye, Nt;
|
|
1065
|
+
function Ze() {
|
|
1066
|
+
if (Nt) return ye;
|
|
1067
|
+
Nt = 1;
|
|
1068
|
+
const s = F();
|
|
1069
|
+
return ye = (t, n, i) => s(t, n, i) >= 0, ye;
|
|
607
1070
|
}
|
|
608
|
-
var
|
|
609
|
-
function
|
|
610
|
-
if (wt) return
|
|
1071
|
+
var Ce, wt;
|
|
1072
|
+
function Qe() {
|
|
1073
|
+
if (wt) return Ce;
|
|
611
1074
|
wt = 1;
|
|
612
|
-
const
|
|
613
|
-
return
|
|
1075
|
+
const s = F();
|
|
1076
|
+
return Ce = (t, n, i) => s(t, n, i) <= 0, Ce;
|
|
1077
|
+
}
|
|
1078
|
+
var Pe, At;
|
|
1079
|
+
function hr() {
|
|
1080
|
+
if (At) return Pe;
|
|
1081
|
+
At = 1;
|
|
1082
|
+
const s = cr(), e = ur(), t = Z(), n = Ze(), i = Je(), c = Qe();
|
|
1083
|
+
return Pe = (h, o, a, r) => {
|
|
614
1084
|
switch (o) {
|
|
615
1085
|
case "===":
|
|
616
1086
|
return typeof h == "object" && (h = h.version), typeof a == "object" && (a = a.version), h === a;
|
|
@@ -619,99 +1089,99 @@ function ar() {
|
|
|
619
1089
|
case "":
|
|
620
1090
|
case "=":
|
|
621
1091
|
case "==":
|
|
622
|
-
return
|
|
1092
|
+
return s(h, a, r);
|
|
623
1093
|
case "!=":
|
|
624
|
-
return
|
|
1094
|
+
return e(h, a, r);
|
|
625
1095
|
case ">":
|
|
626
|
-
return
|
|
1096
|
+
return t(h, a, r);
|
|
627
1097
|
case ">=":
|
|
628
|
-
return
|
|
1098
|
+
return n(h, a, r);
|
|
629
1099
|
case "<":
|
|
630
|
-
return i(h, a,
|
|
1100
|
+
return i(h, a, r);
|
|
631
1101
|
case "<=":
|
|
632
|
-
return
|
|
1102
|
+
return c(h, a, r);
|
|
633
1103
|
default:
|
|
634
1104
|
throw new TypeError(`Invalid operator: ${o}`);
|
|
635
1105
|
}
|
|
636
|
-
},
|
|
1106
|
+
}, Pe;
|
|
637
1107
|
}
|
|
638
|
-
var
|
|
639
|
-
function
|
|
640
|
-
if (yt) return
|
|
1108
|
+
var qe, yt;
|
|
1109
|
+
function Mr() {
|
|
1110
|
+
if (yt) return qe;
|
|
641
1111
|
yt = 1;
|
|
642
|
-
const
|
|
643
|
-
return
|
|
644
|
-
if (
|
|
645
|
-
return
|
|
646
|
-
if (typeof
|
|
1112
|
+
const s = x(), e = M(), { safeRe: t, t: n } = W();
|
|
1113
|
+
return qe = (c, l) => {
|
|
1114
|
+
if (c instanceof s)
|
|
1115
|
+
return c;
|
|
1116
|
+
if (typeof c == "number" && (c = String(c)), typeof c != "string")
|
|
647
1117
|
return null;
|
|
648
1118
|
l = l || {};
|
|
649
1119
|
let h = null;
|
|
650
1120
|
if (!l.rtl)
|
|
651
|
-
h =
|
|
1121
|
+
h = c.match(l.includePrerelease ? t[n.COERCEFULL] : t[n.COERCE]);
|
|
652
1122
|
else {
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
for (; (
|
|
656
|
-
(!h ||
|
|
657
|
-
|
|
1123
|
+
const E = l.includePrerelease ? t[n.COERCERTLFULL] : t[n.COERCERTL];
|
|
1124
|
+
let S;
|
|
1125
|
+
for (; (S = E.exec(c)) && (!h || h.index + h[0].length !== c.length); )
|
|
1126
|
+
(!h || S.index + S[0].length !== h.index + h[0].length) && (h = S), E.lastIndex = S.index + S[1].length + S[2].length;
|
|
1127
|
+
E.lastIndex = -1;
|
|
658
1128
|
}
|
|
659
1129
|
if (h === null)
|
|
660
1130
|
return null;
|
|
661
|
-
const o = h[2], a = h[3] || "0",
|
|
662
|
-
return
|
|
663
|
-
},
|
|
1131
|
+
const o = h[2], a = h[3] || "0", r = h[4] || "0", u = l.includePrerelease && h[5] ? `-${h[5]}` : "", f = l.includePrerelease && h[6] ? `+${h[6]}` : "";
|
|
1132
|
+
return e(`${o}.${a}.${r}${u}${f}`, l);
|
|
1133
|
+
}, qe;
|
|
664
1134
|
}
|
|
665
|
-
var
|
|
666
|
-
function
|
|
667
|
-
if (Ct) return
|
|
1135
|
+
var Ge, Ct;
|
|
1136
|
+
function Vr() {
|
|
1137
|
+
if (Ct) return Ge;
|
|
668
1138
|
Ct = 1;
|
|
669
|
-
class
|
|
1139
|
+
class s {
|
|
670
1140
|
constructor() {
|
|
671
1141
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
672
1142
|
}
|
|
673
|
-
get(
|
|
674
|
-
const
|
|
675
|
-
if (
|
|
676
|
-
return this.map.delete(
|
|
1143
|
+
get(t) {
|
|
1144
|
+
const n = this.map.get(t);
|
|
1145
|
+
if (n !== void 0)
|
|
1146
|
+
return this.map.delete(t), this.map.set(t, n), n;
|
|
677
1147
|
}
|
|
678
|
-
delete(
|
|
679
|
-
return this.map.delete(
|
|
1148
|
+
delete(t) {
|
|
1149
|
+
return this.map.delete(t);
|
|
680
1150
|
}
|
|
681
|
-
set(
|
|
682
|
-
if (!this.delete(
|
|
1151
|
+
set(t, n) {
|
|
1152
|
+
if (!this.delete(t) && n !== void 0) {
|
|
683
1153
|
if (this.map.size >= this.max) {
|
|
684
|
-
const
|
|
685
|
-
this.delete(
|
|
1154
|
+
const c = this.map.keys().next().value;
|
|
1155
|
+
this.delete(c);
|
|
686
1156
|
}
|
|
687
|
-
this.map.set(
|
|
1157
|
+
this.map.set(t, n);
|
|
688
1158
|
}
|
|
689
1159
|
return this;
|
|
690
1160
|
}
|
|
691
1161
|
}
|
|
692
|
-
return
|
|
1162
|
+
return Ge = s, Ge;
|
|
693
1163
|
}
|
|
694
|
-
var
|
|
1164
|
+
var be, Pt;
|
|
695
1165
|
function j() {
|
|
696
|
-
if (
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
class
|
|
700
|
-
constructor(
|
|
701
|
-
if (
|
|
702
|
-
return
|
|
703
|
-
if (
|
|
704
|
-
return this.raw =
|
|
705
|
-
if (this.options =
|
|
1166
|
+
if (Pt) return be;
|
|
1167
|
+
Pt = 1;
|
|
1168
|
+
const s = /\s+/g;
|
|
1169
|
+
class e {
|
|
1170
|
+
constructor(m, v) {
|
|
1171
|
+
if (v = i(v), m instanceof e)
|
|
1172
|
+
return m.loose === !!v.loose && m.includePrerelease === !!v.includePrerelease ? m : new e(m.raw, v);
|
|
1173
|
+
if (m instanceof c)
|
|
1174
|
+
return this.raw = m.value, this.set = [[m]], this.formatted = void 0, this;
|
|
1175
|
+
if (this.options = v, this.loose = !!v.loose, this.includePrerelease = !!v.includePrerelease, this.raw = m.trim().replace(s, " "), this.set = this.raw.split("||").map((g) => this.parseRange(g.trim())).filter((g) => g.length), !this.set.length)
|
|
706
1176
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
707
1177
|
if (this.set.length > 1) {
|
|
708
|
-
const
|
|
709
|
-
if (this.set = this.set.filter((
|
|
710
|
-
this.set = [
|
|
1178
|
+
const g = this.set[0];
|
|
1179
|
+
if (this.set = this.set.filter((I) => !p(I[0])), this.set.length === 0)
|
|
1180
|
+
this.set = [g];
|
|
711
1181
|
else if (this.set.length > 1) {
|
|
712
|
-
for (const
|
|
713
|
-
if (
|
|
714
|
-
this.set = [
|
|
1182
|
+
for (const I of this.set)
|
|
1183
|
+
if (I.length === 1 && O(I[0])) {
|
|
1184
|
+
this.set = [I];
|
|
715
1185
|
break;
|
|
716
1186
|
}
|
|
717
1187
|
}
|
|
@@ -721,11 +1191,11 @@ function j() {
|
|
|
721
1191
|
get range() {
|
|
722
1192
|
if (this.formatted === void 0) {
|
|
723
1193
|
this.formatted = "";
|
|
724
|
-
for (let
|
|
725
|
-
|
|
726
|
-
const
|
|
727
|
-
for (let
|
|
728
|
-
|
|
1194
|
+
for (let m = 0; m < this.set.length; m++) {
|
|
1195
|
+
m > 0 && (this.formatted += "||");
|
|
1196
|
+
const v = this.set[m];
|
|
1197
|
+
for (let g = 0; g < v.length; g++)
|
|
1198
|
+
g > 0 && (this.formatted += " "), this.formatted += v[g].toString().trim();
|
|
729
1199
|
}
|
|
730
1200
|
}
|
|
731
1201
|
return this.formatted;
|
|
@@ -736,478 +1206,478 @@ function j() {
|
|
|
736
1206
|
toString() {
|
|
737
1207
|
return this.range;
|
|
738
1208
|
}
|
|
739
|
-
parseRange(
|
|
740
|
-
const
|
|
741
|
-
if (
|
|
742
|
-
return
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
let
|
|
746
|
-
|
|
747
|
-
const T = /* @__PURE__ */ new Map(), y =
|
|
748
|
-
for (const
|
|
749
|
-
if (
|
|
750
|
-
return [
|
|
751
|
-
T.set(
|
|
1209
|
+
parseRange(m) {
|
|
1210
|
+
const g = ((this.options.includePrerelease && E) | (this.options.loose && S)) + ":" + m, I = n.get(g);
|
|
1211
|
+
if (I)
|
|
1212
|
+
return I;
|
|
1213
|
+
const R = this.options.loose, $ = R ? o[a.HYPHENRANGELOOSE] : o[a.HYPHENRANGE];
|
|
1214
|
+
m = m.replace($, se(this.options.includePrerelease)), l("hyphen replace", m), m = m.replace(o[a.COMPARATORTRIM], r), l("comparator trim", m), m = m.replace(o[a.TILDETRIM], u), l("tilde trim", m), m = m.replace(o[a.CARETTRIM], f), l("caret trim", m);
|
|
1215
|
+
let N = m.split(" ").map((P) => G(P, this.options)).join(" ").split(/\s+/).map((P) => re(P, this.options));
|
|
1216
|
+
R && (N = N.filter((P) => (l("loose invalid filter", P, this.options), !!P.match(o[a.COMPARATORLOOSE])))), l("range list", N);
|
|
1217
|
+
const T = /* @__PURE__ */ new Map(), y = N.map((P) => new c(P, this.options));
|
|
1218
|
+
for (const P of y) {
|
|
1219
|
+
if (p(P))
|
|
1220
|
+
return [P];
|
|
1221
|
+
T.set(P.value, P);
|
|
752
1222
|
}
|
|
753
1223
|
T.size > 1 && T.has("") && T.delete("");
|
|
754
1224
|
const D = [...T.values()];
|
|
755
|
-
return
|
|
1225
|
+
return n.set(g, D), D;
|
|
756
1226
|
}
|
|
757
|
-
intersects(
|
|
758
|
-
if (!(
|
|
1227
|
+
intersects(m, v) {
|
|
1228
|
+
if (!(m instanceof e))
|
|
759
1229
|
throw new TypeError("a Range is required");
|
|
760
|
-
return this.set.some((
|
|
1230
|
+
return this.set.some((g) => w(g, v) && m.set.some((I) => w(I, v) && g.every((R) => I.every(($) => R.intersects($, v)))));
|
|
761
1231
|
}
|
|
762
1232
|
// if ANY of the sets match ALL of its comparators, then pass
|
|
763
|
-
test(
|
|
764
|
-
if (!
|
|
1233
|
+
test(m) {
|
|
1234
|
+
if (!m)
|
|
765
1235
|
return !1;
|
|
766
|
-
if (typeof
|
|
1236
|
+
if (typeof m == "string")
|
|
767
1237
|
try {
|
|
768
|
-
|
|
1238
|
+
m = new h(m, this.options);
|
|
769
1239
|
} catch {
|
|
770
1240
|
return !1;
|
|
771
1241
|
}
|
|
772
|
-
for (let
|
|
773
|
-
if (
|
|
1242
|
+
for (let v = 0; v < this.set.length; v++)
|
|
1243
|
+
if (ne(this.set[v], m, this.options))
|
|
774
1244
|
return !0;
|
|
775
1245
|
return !1;
|
|
776
1246
|
}
|
|
777
1247
|
}
|
|
778
|
-
|
|
779
|
-
const
|
|
1248
|
+
be = e;
|
|
1249
|
+
const t = Vr(), n = new t(), i = Ye(), c = Q(), l = J(), h = x(), {
|
|
780
1250
|
safeRe: o,
|
|
781
1251
|
t: a,
|
|
782
|
-
comparatorTrimReplace:
|
|
783
|
-
tildeTrimReplace:
|
|
1252
|
+
comparatorTrimReplace: r,
|
|
1253
|
+
tildeTrimReplace: u,
|
|
784
1254
|
caretTrimReplace: f
|
|
785
|
-
} =
|
|
786
|
-
let
|
|
787
|
-
const
|
|
788
|
-
let
|
|
789
|
-
for (;
|
|
790
|
-
|
|
791
|
-
return
|
|
792
|
-
}, G = (
|
|
793
|
-
const
|
|
794
|
-
return
|
|
795
|
-
l("tilde",
|
|
1255
|
+
} = W(), { FLAG_INCLUDE_PRERELEASE: E, FLAG_LOOSE: S } = K(), p = (d) => d.value === "<0.0.0-0", O = (d) => d.value === "", w = (d, m) => {
|
|
1256
|
+
let v = !0;
|
|
1257
|
+
const g = d.slice();
|
|
1258
|
+
let I = g.pop();
|
|
1259
|
+
for (; v && g.length; )
|
|
1260
|
+
v = g.every((R) => I.intersects(R, m)), I = g.pop();
|
|
1261
|
+
return v;
|
|
1262
|
+
}, G = (d, m) => (d = d.replace(o[a.BUILD], ""), l("comp", d, m), d = C(d, m), l("caret", d), d = b(d, m), l("tildes", d), d = L(d, m), l("xrange", d), d = te(d, m), l("stars", d), d), A = (d) => !d || d.toLowerCase() === "x" || d === "*", b = (d, m) => d.trim().split(/\s+/).map((v) => U(v, m)).join(" "), U = (d, m) => {
|
|
1263
|
+
const v = m.loose ? o[a.TILDELOOSE] : o[a.TILDE];
|
|
1264
|
+
return d.replace(v, (g, I, R, $, N) => {
|
|
1265
|
+
l("tilde", d, g, I, R, $, N);
|
|
796
1266
|
let T;
|
|
797
|
-
return
|
|
1267
|
+
return A(I) ? T = "" : A(R) ? T = `>=${I}.0.0 <${+I + 1}.0.0-0` : A($) ? T = `>=${I}.${R}.0 <${I}.${+R + 1}.0-0` : N ? (l("replaceTilde pr", N), T = `>=${I}.${R}.${$}-${N} <${I}.${+R + 1}.0-0`) : T = `>=${I}.${R}.${$} <${I}.${+R + 1}.0-0`, l("tilde return", T), T;
|
|
798
1268
|
});
|
|
799
|
-
}, C = (
|
|
800
|
-
l("caret",
|
|
801
|
-
const
|
|
802
|
-
return
|
|
803
|
-
l("caret",
|
|
1269
|
+
}, C = (d, m) => d.trim().split(/\s+/).map((v) => q(v, m)).join(" "), q = (d, m) => {
|
|
1270
|
+
l("caret", d, m);
|
|
1271
|
+
const v = m.loose ? o[a.CARETLOOSE] : o[a.CARET], g = m.includePrerelease ? "-0" : "";
|
|
1272
|
+
return d.replace(v, (I, R, $, N, T) => {
|
|
1273
|
+
l("caret", d, I, R, $, N, T);
|
|
804
1274
|
let y;
|
|
805
|
-
return
|
|
1275
|
+
return A(R) ? y = "" : A($) ? y = `>=${R}.0.0${g} <${+R + 1}.0.0-0` : A(N) ? R === "0" ? y = `>=${R}.${$}.0${g} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.0${g} <${+R + 1}.0.0-0` : T ? (l("replaceCaret pr", T), R === "0" ? $ === "0" ? y = `>=${R}.${$}.${N}-${T} <${R}.${$}.${+N + 1}-0` : y = `>=${R}.${$}.${N}-${T} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.${N}-${T} <${+R + 1}.0.0-0`) : (l("no pr"), R === "0" ? $ === "0" ? y = `>=${R}.${$}.${N}${g} <${R}.${$}.${+N + 1}-0` : y = `>=${R}.${$}.${N}${g} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.${N} <${+R + 1}.0.0-0`), l("caret return", y), y;
|
|
806
1276
|
});
|
|
807
|
-
}, L = (
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
return
|
|
811
|
-
l("xRange",
|
|
812
|
-
const y =
|
|
813
|
-
return
|
|
1277
|
+
}, L = (d, m) => (l("replaceXRanges", d, m), d.split(/\s+/).map((v) => V(v, m)).join(" ")), V = (d, m) => {
|
|
1278
|
+
d = d.trim();
|
|
1279
|
+
const v = m.loose ? o[a.XRANGELOOSE] : o[a.XRANGE];
|
|
1280
|
+
return d.replace(v, (g, I, R, $, N, T) => {
|
|
1281
|
+
l("xRange", d, g, I, R, $, N, T);
|
|
1282
|
+
const y = A(R), D = y || A($), P = D || A(N), X = P;
|
|
1283
|
+
return I === "=" && X && (I = ""), T = m.includePrerelease ? "-0" : "", y ? I === ">" || I === "<" ? g = "<0.0.0-0" : g = "*" : I && X ? (D && ($ = 0), N = 0, I === ">" ? (I = ">=", D ? (R = +R + 1, $ = 0, N = 0) : ($ = +$ + 1, N = 0)) : I === "<=" && (I = "<", D ? R = +R + 1 : $ = +$ + 1), I === "<" && (T = "-0"), g = `${I + R}.${$}.${N}${T}`) : D ? g = `>=${R}.0.0${T} <${+R + 1}.0.0-0` : P && (g = `>=${R}.${$}.0${T} <${R}.${+$ + 1}.0-0`), l("xRange return", g), g;
|
|
814
1284
|
});
|
|
815
|
-
},
|
|
816
|
-
for (let
|
|
817
|
-
if (!
|
|
1285
|
+
}, te = (d, m) => (l("replaceStars", d, m), d.trim().replace(o[a.STAR], "")), re = (d, m) => (l("replaceGTE0", d, m), d.trim().replace(o[m.includePrerelease ? a.GTE0PRE : a.GTE0], "")), se = (d) => (m, v, g, I, R, $, N, T, y, D, P, X) => (A(g) ? v = "" : A(I) ? v = `>=${g}.0.0${d ? "-0" : ""}` : A(R) ? v = `>=${g}.${I}.0${d ? "-0" : ""}` : $ ? v = `>=${v}` : v = `>=${v}${d ? "-0" : ""}`, A(y) ? T = "" : A(D) ? T = `<${+y + 1}.0.0-0` : A(P) ? T = `<${y}.${+D + 1}.0-0` : X ? T = `<=${y}.${D}.${P}-${X}` : d ? T = `<${y}.${D}.${+P + 1}-0` : T = `<=${T}`, `${v} ${T}`.trim()), ne = (d, m, v) => {
|
|
1286
|
+
for (let g = 0; g < d.length; g++)
|
|
1287
|
+
if (!d[g].test(m))
|
|
818
1288
|
return !1;
|
|
819
|
-
if (
|
|
820
|
-
for (let
|
|
821
|
-
if (l(
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
1289
|
+
if (m.prerelease.length && !v.includePrerelease) {
|
|
1290
|
+
for (let g = 0; g < d.length; g++)
|
|
1291
|
+
if (l(d[g].semver), d[g].semver !== c.ANY && d[g].semver.prerelease.length > 0) {
|
|
1292
|
+
const I = d[g].semver;
|
|
1293
|
+
if (I.major === m.major && I.minor === m.minor && I.patch === m.patch)
|
|
824
1294
|
return !0;
|
|
825
1295
|
}
|
|
826
1296
|
return !1;
|
|
827
1297
|
}
|
|
828
1298
|
return !0;
|
|
829
1299
|
};
|
|
830
|
-
return
|
|
1300
|
+
return be;
|
|
831
1301
|
}
|
|
832
|
-
var
|
|
833
|
-
function
|
|
834
|
-
if (
|
|
835
|
-
|
|
836
|
-
const
|
|
837
|
-
class
|
|
1302
|
+
var De, qt;
|
|
1303
|
+
function Q() {
|
|
1304
|
+
if (qt) return De;
|
|
1305
|
+
qt = 1;
|
|
1306
|
+
const s = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1307
|
+
class e {
|
|
838
1308
|
static get ANY() {
|
|
839
|
-
return
|
|
1309
|
+
return s;
|
|
840
1310
|
}
|
|
841
|
-
constructor(
|
|
842
|
-
if (
|
|
843
|
-
if (
|
|
844
|
-
return
|
|
845
|
-
|
|
1311
|
+
constructor(r, u) {
|
|
1312
|
+
if (u = t(u), r instanceof e) {
|
|
1313
|
+
if (r.loose === !!u.loose)
|
|
1314
|
+
return r;
|
|
1315
|
+
r = r.value;
|
|
846
1316
|
}
|
|
847
|
-
|
|
1317
|
+
r = r.trim().split(/\s+/).join(" "), l("comparator", r, u), this.options = u, this.loose = !!u.loose, this.parse(r), this.semver === s ? this.value = "" : this.value = this.operator + this.semver.version, l("comp", this);
|
|
848
1318
|
}
|
|
849
|
-
parse(
|
|
850
|
-
const
|
|
1319
|
+
parse(r) {
|
|
1320
|
+
const u = this.options.loose ? n[i.COMPARATORLOOSE] : n[i.COMPARATOR], f = r.match(u);
|
|
851
1321
|
if (!f)
|
|
852
|
-
throw new TypeError(`Invalid comparator: ${
|
|
853
|
-
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new h(f[2], this.options.loose) : this.semver =
|
|
1322
|
+
throw new TypeError(`Invalid comparator: ${r}`);
|
|
1323
|
+
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new h(f[2], this.options.loose) : this.semver = s;
|
|
854
1324
|
}
|
|
855
1325
|
toString() {
|
|
856
1326
|
return this.value;
|
|
857
1327
|
}
|
|
858
|
-
test(
|
|
859
|
-
if (l("Comparator.test",
|
|
1328
|
+
test(r) {
|
|
1329
|
+
if (l("Comparator.test", r, this.options.loose), this.semver === s || r === s)
|
|
860
1330
|
return !0;
|
|
861
|
-
if (typeof
|
|
1331
|
+
if (typeof r == "string")
|
|
862
1332
|
try {
|
|
863
|
-
|
|
1333
|
+
r = new h(r, this.options);
|
|
864
1334
|
} catch {
|
|
865
1335
|
return !1;
|
|
866
1336
|
}
|
|
867
|
-
return
|
|
1337
|
+
return c(r, this.operator, this.semver, this.options);
|
|
868
1338
|
}
|
|
869
|
-
intersects(
|
|
870
|
-
if (!(
|
|
1339
|
+
intersects(r, u) {
|
|
1340
|
+
if (!(r instanceof e))
|
|
871
1341
|
throw new TypeError("a Comparator is required");
|
|
872
|
-
return this.operator === "" ? this.value === "" ? !0 : new o(
|
|
1342
|
+
return this.operator === "" ? this.value === "" ? !0 : new o(r.value, u).test(this.value) : r.operator === "" ? r.value === "" ? !0 : new o(this.value, u).test(r.semver) : (u = t(u), u.includePrerelease && (this.value === "<0.0.0-0" || r.value === "<0.0.0-0") || !u.includePrerelease && (this.value.startsWith("<0.0.0") || r.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && r.operator.startsWith(">") || this.operator.startsWith("<") && r.operator.startsWith("<") || this.semver.version === r.semver.version && this.operator.includes("=") && r.operator.includes("=") || c(this.semver, "<", r.semver, u) && this.operator.startsWith(">") && r.operator.startsWith("<") || c(this.semver, ">", r.semver, u) && this.operator.startsWith("<") && r.operator.startsWith(">")));
|
|
873
1343
|
}
|
|
874
1344
|
}
|
|
875
|
-
|
|
876
|
-
const
|
|
877
|
-
return
|
|
1345
|
+
De = e;
|
|
1346
|
+
const t = Ye(), { safeRe: n, t: i } = W(), c = hr(), l = J(), h = x(), o = j();
|
|
1347
|
+
return De;
|
|
878
1348
|
}
|
|
879
1349
|
var xe, Gt;
|
|
880
|
-
function
|
|
1350
|
+
function ee() {
|
|
881
1351
|
if (Gt) return xe;
|
|
882
1352
|
Gt = 1;
|
|
883
|
-
const
|
|
884
|
-
return xe = (
|
|
1353
|
+
const s = j();
|
|
1354
|
+
return xe = (t, n, i) => {
|
|
885
1355
|
try {
|
|
886
|
-
|
|
1356
|
+
n = new s(n, i);
|
|
887
1357
|
} catch {
|
|
888
1358
|
return !1;
|
|
889
1359
|
}
|
|
890
|
-
return
|
|
1360
|
+
return n.test(t);
|
|
891
1361
|
}, xe;
|
|
892
1362
|
}
|
|
893
|
-
var
|
|
894
|
-
function
|
|
895
|
-
if (
|
|
896
|
-
|
|
897
|
-
const
|
|
898
|
-
return
|
|
1363
|
+
var Ue, bt;
|
|
1364
|
+
function Xr() {
|
|
1365
|
+
if (bt) return Ue;
|
|
1366
|
+
bt = 1;
|
|
1367
|
+
const s = j();
|
|
1368
|
+
return Ue = (t, n) => new s(t, n).set.map((i) => i.map((c) => c.value).join(" ").trim().split(" ")), Ue;
|
|
899
1369
|
}
|
|
900
|
-
var
|
|
901
|
-
function
|
|
902
|
-
if (Dt) return
|
|
1370
|
+
var _e, Dt;
|
|
1371
|
+
function Br() {
|
|
1372
|
+
if (Dt) return _e;
|
|
903
1373
|
Dt = 1;
|
|
904
|
-
const
|
|
905
|
-
return
|
|
1374
|
+
const s = x(), e = j();
|
|
1375
|
+
return _e = (n, i, c) => {
|
|
906
1376
|
let l = null, h = null, o = null;
|
|
907
1377
|
try {
|
|
908
|
-
o = new
|
|
1378
|
+
o = new e(i, c);
|
|
909
1379
|
} catch {
|
|
910
1380
|
return null;
|
|
911
1381
|
}
|
|
912
|
-
return
|
|
913
|
-
o.test(a) && (!l || h.compare(a) === -1) && (l = a, h = new
|
|
1382
|
+
return n.forEach((a) => {
|
|
1383
|
+
o.test(a) && (!l || h.compare(a) === -1) && (l = a, h = new s(l, c));
|
|
914
1384
|
}), l;
|
|
915
|
-
},
|
|
1385
|
+
}, _e;
|
|
916
1386
|
}
|
|
917
|
-
var
|
|
918
|
-
function
|
|
919
|
-
if (
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
return
|
|
1387
|
+
var Fe, xt;
|
|
1388
|
+
function Wr() {
|
|
1389
|
+
if (xt) return Fe;
|
|
1390
|
+
xt = 1;
|
|
1391
|
+
const s = x(), e = j();
|
|
1392
|
+
return Fe = (n, i, c) => {
|
|
923
1393
|
let l = null, h = null, o = null;
|
|
924
1394
|
try {
|
|
925
|
-
o = new
|
|
1395
|
+
o = new e(i, c);
|
|
926
1396
|
} catch {
|
|
927
1397
|
return null;
|
|
928
1398
|
}
|
|
929
|
-
return
|
|
930
|
-
o.test(a) && (!l || h.compare(a) === 1) && (l = a, h = new
|
|
1399
|
+
return n.forEach((a) => {
|
|
1400
|
+
o.test(a) && (!l || h.compare(a) === 1) && (l = a, h = new s(l, c));
|
|
931
1401
|
}), l;
|
|
932
|
-
},
|
|
1402
|
+
}, Fe;
|
|
933
1403
|
}
|
|
934
|
-
var
|
|
935
|
-
function
|
|
936
|
-
if (
|
|
937
|
-
|
|
938
|
-
const
|
|
939
|
-
return
|
|
940
|
-
i = new
|
|
941
|
-
let l = new
|
|
942
|
-
if (i.test(l) || (l = new
|
|
1404
|
+
var je, Ut;
|
|
1405
|
+
function Hr() {
|
|
1406
|
+
if (Ut) return je;
|
|
1407
|
+
Ut = 1;
|
|
1408
|
+
const s = x(), e = j(), t = Z();
|
|
1409
|
+
return je = (i, c) => {
|
|
1410
|
+
i = new e(i, c);
|
|
1411
|
+
let l = new s("0.0.0");
|
|
1412
|
+
if (i.test(l) || (l = new s("0.0.0-0"), i.test(l)))
|
|
943
1413
|
return l;
|
|
944
1414
|
l = null;
|
|
945
1415
|
for (let h = 0; h < i.set.length; ++h) {
|
|
946
1416
|
const o = i.set[h];
|
|
947
1417
|
let a = null;
|
|
948
|
-
o.forEach((
|
|
949
|
-
const
|
|
950
|
-
switch (
|
|
1418
|
+
o.forEach((r) => {
|
|
1419
|
+
const u = new s(r.semver.version);
|
|
1420
|
+
switch (r.operator) {
|
|
951
1421
|
case ">":
|
|
952
|
-
|
|
1422
|
+
u.prerelease.length === 0 ? u.patch++ : u.prerelease.push(0), u.raw = u.format();
|
|
953
1423
|
/* fallthrough */
|
|
954
1424
|
case "":
|
|
955
1425
|
case ">=":
|
|
956
|
-
(!a ||
|
|
1426
|
+
(!a || t(u, a)) && (a = u);
|
|
957
1427
|
break;
|
|
958
1428
|
case "<":
|
|
959
1429
|
case "<=":
|
|
960
1430
|
break;
|
|
961
1431
|
/* istanbul ignore next */
|
|
962
1432
|
default:
|
|
963
|
-
throw new Error(`Unexpected operation: ${
|
|
1433
|
+
throw new Error(`Unexpected operation: ${r.operator}`);
|
|
964
1434
|
}
|
|
965
|
-
}), a && (!l ||
|
|
1435
|
+
}), a && (!l || t(l, a)) && (l = a);
|
|
966
1436
|
}
|
|
967
1437
|
return l && i.test(l) ? l : null;
|
|
968
|
-
},
|
|
1438
|
+
}, je;
|
|
969
1439
|
}
|
|
970
|
-
var
|
|
971
|
-
function
|
|
972
|
-
if (
|
|
973
|
-
|
|
974
|
-
const
|
|
975
|
-
return
|
|
1440
|
+
var ke, _t;
|
|
1441
|
+
function zr() {
|
|
1442
|
+
if (_t) return ke;
|
|
1443
|
+
_t = 1;
|
|
1444
|
+
const s = j();
|
|
1445
|
+
return ke = (t, n) => {
|
|
976
1446
|
try {
|
|
977
|
-
return new t
|
|
1447
|
+
return new s(t, n).range || "*";
|
|
978
1448
|
} catch {
|
|
979
1449
|
return null;
|
|
980
1450
|
}
|
|
981
|
-
},
|
|
1451
|
+
}, ke;
|
|
982
1452
|
}
|
|
983
|
-
var
|
|
1453
|
+
var Me, Ft;
|
|
984
1454
|
function et() {
|
|
985
|
-
if (
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
return
|
|
989
|
-
|
|
990
|
-
let
|
|
1455
|
+
if (Ft) return Me;
|
|
1456
|
+
Ft = 1;
|
|
1457
|
+
const s = x(), e = Q(), { ANY: t } = e, n = j(), i = ee(), c = Z(), l = Je(), h = Qe(), o = Ze();
|
|
1458
|
+
return Me = (r, u, f, E) => {
|
|
1459
|
+
r = new s(r, E), u = new n(u, E);
|
|
1460
|
+
let S, p, O, w, G;
|
|
991
1461
|
switch (f) {
|
|
992
1462
|
case ">":
|
|
993
|
-
|
|
1463
|
+
S = c, p = h, O = l, w = ">", G = ">=";
|
|
994
1464
|
break;
|
|
995
1465
|
case "<":
|
|
996
|
-
|
|
1466
|
+
S = l, p = o, O = c, w = "<", G = "<=";
|
|
997
1467
|
break;
|
|
998
1468
|
default:
|
|
999
1469
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1000
1470
|
}
|
|
1001
|
-
if (i(
|
|
1471
|
+
if (i(r, u, E))
|
|
1002
1472
|
return !1;
|
|
1003
|
-
for (let
|
|
1004
|
-
const
|
|
1005
|
-
let
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1008
|
-
}),
|
|
1473
|
+
for (let A = 0; A < u.set.length; ++A) {
|
|
1474
|
+
const b = u.set[A];
|
|
1475
|
+
let U = null, C = null;
|
|
1476
|
+
if (b.forEach((q) => {
|
|
1477
|
+
q.semver === t && (q = new e(">=0.0.0")), U = U || q, C = C || q, S(q.semver, U.semver, E) ? U = q : O(q.semver, C.semver, E) && (C = q);
|
|
1478
|
+
}), U.operator === w || U.operator === G || (!C.operator || C.operator === w) && p(r, C.semver))
|
|
1009
1479
|
return !1;
|
|
1010
|
-
if (C.operator === G &&
|
|
1480
|
+
if (C.operator === G && O(r, C.semver))
|
|
1011
1481
|
return !1;
|
|
1012
1482
|
}
|
|
1013
1483
|
return !0;
|
|
1014
|
-
},
|
|
1015
|
-
}
|
|
1016
|
-
var Ve, Ft;
|
|
1017
|
-
function Br() {
|
|
1018
|
-
if (Ft) return Ve;
|
|
1019
|
-
Ft = 1;
|
|
1020
|
-
const t = et();
|
|
1021
|
-
return Ve = (r, s, i) => t(r, s, ">", i), Ve;
|
|
1484
|
+
}, Me;
|
|
1022
1485
|
}
|
|
1023
|
-
var
|
|
1024
|
-
function
|
|
1025
|
-
if (
|
|
1026
|
-
|
|
1027
|
-
const
|
|
1028
|
-
return
|
|
1486
|
+
var Ve, jt;
|
|
1487
|
+
function Yr() {
|
|
1488
|
+
if (jt) return Ve;
|
|
1489
|
+
jt = 1;
|
|
1490
|
+
const s = et();
|
|
1491
|
+
return Ve = (t, n, i) => s(t, n, ">", i), Ve;
|
|
1029
1492
|
}
|
|
1030
1493
|
var Xe, kt;
|
|
1031
|
-
function
|
|
1494
|
+
function Kr() {
|
|
1032
1495
|
if (kt) return Xe;
|
|
1033
1496
|
kt = 1;
|
|
1034
|
-
const
|
|
1035
|
-
return Xe = (
|
|
1036
|
-
}
|
|
1037
|
-
var Me, Xt;
|
|
1038
|
-
function Yr() {
|
|
1039
|
-
if (Xt) return Me;
|
|
1040
|
-
Xt = 1;
|
|
1041
|
-
const t = Z(), n = U();
|
|
1042
|
-
return Me = (r, s, i) => {
|
|
1043
|
-
const u = [];
|
|
1044
|
-
let l = null, h = null;
|
|
1045
|
-
const o = r.sort((f, d) => n(f, d, i));
|
|
1046
|
-
for (const f of o)
|
|
1047
|
-
t(f, s, i) ? (h = f, l || (l = f)) : (h && u.push([l, h]), h = null, l = null);
|
|
1048
|
-
l && u.push([l, null]);
|
|
1049
|
-
const a = [];
|
|
1050
|
-
for (const [f, d] of u)
|
|
1051
|
-
f === d ? a.push(f) : !d && f === o[0] ? a.push("*") : d ? f === o[0] ? a.push(`<=${d}`) : a.push(`${f} - ${d}`) : a.push(`>=${f}`);
|
|
1052
|
-
const e = a.join(" || "), c = typeof s.raw == "string" ? s.raw : String(s);
|
|
1053
|
-
return e.length < c.length ? e : s;
|
|
1054
|
-
}, Me;
|
|
1497
|
+
const s = et();
|
|
1498
|
+
return Xe = (t, n, i) => s(t, n, "<", i), Xe;
|
|
1055
1499
|
}
|
|
1056
1500
|
var Be, Mt;
|
|
1057
|
-
function
|
|
1501
|
+
function Jr() {
|
|
1058
1502
|
if (Mt) return Be;
|
|
1059
1503
|
Mt = 1;
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1504
|
+
const s = j();
|
|
1505
|
+
return Be = (t, n, i) => (t = new s(t, i), n = new s(n, i), t.intersects(n, i)), Be;
|
|
1506
|
+
}
|
|
1507
|
+
var We, Vt;
|
|
1508
|
+
function Zr() {
|
|
1509
|
+
if (Vt) return We;
|
|
1510
|
+
Vt = 1;
|
|
1511
|
+
const s = ee(), e = F();
|
|
1512
|
+
return We = (t, n, i) => {
|
|
1513
|
+
const c = [];
|
|
1514
|
+
let l = null, h = null;
|
|
1515
|
+
const o = t.sort((f, E) => e(f, E, i));
|
|
1516
|
+
for (const f of o)
|
|
1517
|
+
s(f, n, i) ? (h = f, l || (l = f)) : (h && c.push([l, h]), h = null, l = null);
|
|
1518
|
+
l && c.push([l, null]);
|
|
1519
|
+
const a = [];
|
|
1520
|
+
for (const [f, E] of c)
|
|
1521
|
+
f === E ? a.push(f) : !E && f === o[0] ? a.push("*") : E ? f === o[0] ? a.push(`<=${E}`) : a.push(`${f} - ${E}`) : a.push(`>=${f}`);
|
|
1522
|
+
const r = a.join(" || "), u = typeof n.raw == "string" ? n.raw : String(n);
|
|
1523
|
+
return r.length < u.length ? r : n;
|
|
1524
|
+
}, We;
|
|
1525
|
+
}
|
|
1526
|
+
var He, Xt;
|
|
1527
|
+
function Qr() {
|
|
1528
|
+
if (Xt) return He;
|
|
1529
|
+
Xt = 1;
|
|
1530
|
+
const s = j(), e = Q(), { ANY: t } = e, n = ee(), i = F(), c = (u, f, E = {}) => {
|
|
1531
|
+
if (u === f)
|
|
1062
1532
|
return !0;
|
|
1063
|
-
|
|
1064
|
-
let
|
|
1065
|
-
e: for (const
|
|
1066
|
-
for (const
|
|
1067
|
-
const
|
|
1068
|
-
if (
|
|
1533
|
+
u = new s(u, E), f = new s(f, E);
|
|
1534
|
+
let S = !1;
|
|
1535
|
+
e: for (const p of u.set) {
|
|
1536
|
+
for (const O of f.set) {
|
|
1537
|
+
const w = o(p, O, E);
|
|
1538
|
+
if (S = S || w !== null, w)
|
|
1069
1539
|
continue e;
|
|
1070
1540
|
}
|
|
1071
|
-
if (
|
|
1541
|
+
if (S)
|
|
1072
1542
|
return !1;
|
|
1073
1543
|
}
|
|
1074
1544
|
return !0;
|
|
1075
|
-
}, l = [new
|
|
1076
|
-
if (
|
|
1545
|
+
}, l = [new e(">=0.0.0-0")], h = [new e(">=0.0.0")], o = (u, f, E) => {
|
|
1546
|
+
if (u === f)
|
|
1077
1547
|
return !0;
|
|
1078
|
-
if (
|
|
1079
|
-
if (f.length === 1 && f[0].semver ===
|
|
1548
|
+
if (u.length === 1 && u[0].semver === t) {
|
|
1549
|
+
if (f.length === 1 && f[0].semver === t)
|
|
1080
1550
|
return !0;
|
|
1081
|
-
|
|
1551
|
+
E.includePrerelease ? u = l : u = h;
|
|
1082
1552
|
}
|
|
1083
|
-
if (f.length === 1 && f[0].semver ===
|
|
1084
|
-
if (
|
|
1553
|
+
if (f.length === 1 && f[0].semver === t) {
|
|
1554
|
+
if (E.includePrerelease)
|
|
1085
1555
|
return !0;
|
|
1086
1556
|
f = h;
|
|
1087
1557
|
}
|
|
1088
|
-
const
|
|
1089
|
-
let
|
|
1090
|
-
for (const L of
|
|
1091
|
-
L.operator === ">" || L.operator === ">=" ?
|
|
1092
|
-
if (
|
|
1558
|
+
const S = /* @__PURE__ */ new Set();
|
|
1559
|
+
let p, O;
|
|
1560
|
+
for (const L of u)
|
|
1561
|
+
L.operator === ">" || L.operator === ">=" ? p = a(p, L, E) : L.operator === "<" || L.operator === "<=" ? O = r(O, L, E) : S.add(L.semver);
|
|
1562
|
+
if (S.size > 1)
|
|
1093
1563
|
return null;
|
|
1094
|
-
let
|
|
1095
|
-
if (
|
|
1096
|
-
if (
|
|
1564
|
+
let w;
|
|
1565
|
+
if (p && O) {
|
|
1566
|
+
if (w = i(p.semver, O.semver, E), w > 0)
|
|
1097
1567
|
return null;
|
|
1098
|
-
if (
|
|
1568
|
+
if (w === 0 && (p.operator !== ">=" || O.operator !== "<="))
|
|
1099
1569
|
return null;
|
|
1100
1570
|
}
|
|
1101
|
-
for (const L of
|
|
1102
|
-
if (
|
|
1571
|
+
for (const L of S) {
|
|
1572
|
+
if (p && !n(L, String(p), E) || O && !n(L, String(O), E))
|
|
1103
1573
|
return null;
|
|
1104
|
-
for (const
|
|
1105
|
-
if (!
|
|
1574
|
+
for (const V of f)
|
|
1575
|
+
if (!n(L, String(V), E))
|
|
1106
1576
|
return !1;
|
|
1107
1577
|
return !0;
|
|
1108
1578
|
}
|
|
1109
|
-
let G,
|
|
1110
|
-
C && C.prerelease.length === 1 &&
|
|
1579
|
+
let G, A, b, U, C = O && !E.includePrerelease && O.semver.prerelease.length ? O.semver : !1, q = p && !E.includePrerelease && p.semver.prerelease.length ? p.semver : !1;
|
|
1580
|
+
C && C.prerelease.length === 1 && O.operator === "<" && C.prerelease[0] === 0 && (C = !1);
|
|
1111
1581
|
for (const L of f) {
|
|
1112
|
-
if (
|
|
1113
|
-
if (
|
|
1114
|
-
if (G = a(
|
|
1582
|
+
if (U = U || L.operator === ">" || L.operator === ">=", b = b || L.operator === "<" || L.operator === "<=", p) {
|
|
1583
|
+
if (q && L.semver.prerelease && L.semver.prerelease.length && L.semver.major === q.major && L.semver.minor === q.minor && L.semver.patch === q.patch && (q = !1), L.operator === ">" || L.operator === ">=") {
|
|
1584
|
+
if (G = a(p, L, E), G === L && G !== p)
|
|
1115
1585
|
return !1;
|
|
1116
|
-
} else if (
|
|
1586
|
+
} else if (p.operator === ">=" && !n(p.semver, String(L), E))
|
|
1117
1587
|
return !1;
|
|
1118
1588
|
}
|
|
1119
|
-
if (
|
|
1589
|
+
if (O) {
|
|
1120
1590
|
if (C && L.semver.prerelease && L.semver.prerelease.length && L.semver.major === C.major && L.semver.minor === C.minor && L.semver.patch === C.patch && (C = !1), L.operator === "<" || L.operator === "<=") {
|
|
1121
|
-
if (
|
|
1591
|
+
if (A = r(O, L, E), A === L && A !== O)
|
|
1122
1592
|
return !1;
|
|
1123
|
-
} else if (
|
|
1593
|
+
} else if (O.operator === "<=" && !n(O.semver, String(L), E))
|
|
1124
1594
|
return !1;
|
|
1125
1595
|
}
|
|
1126
|
-
if (!L.operator && (
|
|
1596
|
+
if (!L.operator && (O || p) && w !== 0)
|
|
1127
1597
|
return !1;
|
|
1128
1598
|
}
|
|
1129
|
-
return !(
|
|
1130
|
-
}, a = (
|
|
1131
|
-
if (!
|
|
1599
|
+
return !(p && b && !O && w !== 0 || O && U && !p && w !== 0 || q || C);
|
|
1600
|
+
}, a = (u, f, E) => {
|
|
1601
|
+
if (!u)
|
|
1132
1602
|
return f;
|
|
1133
|
-
const
|
|
1134
|
-
return
|
|
1135
|
-
},
|
|
1136
|
-
if (!
|
|
1603
|
+
const S = i(u.semver, f.semver, E);
|
|
1604
|
+
return S > 0 ? u : S < 0 || f.operator === ">" && u.operator === ">=" ? f : u;
|
|
1605
|
+
}, r = (u, f, E) => {
|
|
1606
|
+
if (!u)
|
|
1137
1607
|
return f;
|
|
1138
|
-
const
|
|
1139
|
-
return
|
|
1608
|
+
const S = i(u.semver, f.semver, E);
|
|
1609
|
+
return S < 0 ? u : S > 0 || f.operator === "<" && u.operator === "<=" ? f : u;
|
|
1140
1610
|
};
|
|
1141
|
-
return
|
|
1611
|
+
return He = c, He;
|
|
1142
1612
|
}
|
|
1143
|
-
var
|
|
1144
|
-
function
|
|
1145
|
-
if (Bt) return
|
|
1613
|
+
var ze, Bt;
|
|
1614
|
+
function es() {
|
|
1615
|
+
if (Bt) return ze;
|
|
1146
1616
|
Bt = 1;
|
|
1147
|
-
const
|
|
1148
|
-
return
|
|
1617
|
+
const s = W(), e = K(), t = x(), n = lr(), i = M(), c = Cr(), l = Pr(), h = qr(), o = Gr(), a = br(), r = Dr(), u = xr(), f = Ur(), E = F(), S = _r(), p = Fr(), O = Ke(), w = jr(), G = kr(), A = Z(), b = Je(), U = cr(), C = ur(), q = Ze(), L = Qe(), V = hr(), te = Mr(), re = Q(), se = j(), ne = ee(), d = Xr(), m = Br(), v = Wr(), g = Hr(), I = zr(), R = et(), $ = Yr(), N = Kr(), T = Jr(), y = Zr(), D = Qr();
|
|
1618
|
+
return ze = {
|
|
1149
1619
|
parse: i,
|
|
1150
|
-
valid:
|
|
1620
|
+
valid: c,
|
|
1151
1621
|
clean: l,
|
|
1152
1622
|
inc: h,
|
|
1153
1623
|
diff: o,
|
|
1154
1624
|
major: a,
|
|
1155
|
-
minor:
|
|
1156
|
-
patch:
|
|
1625
|
+
minor: r,
|
|
1626
|
+
patch: u,
|
|
1157
1627
|
prerelease: f,
|
|
1158
|
-
compare:
|
|
1159
|
-
rcompare:
|
|
1160
|
-
compareLoose:
|
|
1161
|
-
compareBuild:
|
|
1162
|
-
sort:
|
|
1628
|
+
compare: E,
|
|
1629
|
+
rcompare: S,
|
|
1630
|
+
compareLoose: p,
|
|
1631
|
+
compareBuild: O,
|
|
1632
|
+
sort: w,
|
|
1163
1633
|
rsort: G,
|
|
1164
|
-
gt:
|
|
1165
|
-
lt:
|
|
1166
|
-
eq:
|
|
1634
|
+
gt: A,
|
|
1635
|
+
lt: b,
|
|
1636
|
+
eq: U,
|
|
1167
1637
|
neq: C,
|
|
1168
|
-
gte:
|
|
1638
|
+
gte: q,
|
|
1169
1639
|
lte: L,
|
|
1170
|
-
cmp:
|
|
1171
|
-
coerce:
|
|
1172
|
-
Comparator:
|
|
1173
|
-
Range:
|
|
1174
|
-
satisfies:
|
|
1175
|
-
toComparators:
|
|
1176
|
-
maxSatisfying:
|
|
1177
|
-
minSatisfying:
|
|
1178
|
-
minVersion:
|
|
1179
|
-
validRange:
|
|
1180
|
-
outside:
|
|
1181
|
-
gtr:
|
|
1182
|
-
ltr:
|
|
1640
|
+
cmp: V,
|
|
1641
|
+
coerce: te,
|
|
1642
|
+
Comparator: re,
|
|
1643
|
+
Range: se,
|
|
1644
|
+
satisfies: ne,
|
|
1645
|
+
toComparators: d,
|
|
1646
|
+
maxSatisfying: m,
|
|
1647
|
+
minSatisfying: v,
|
|
1648
|
+
minVersion: g,
|
|
1649
|
+
validRange: I,
|
|
1650
|
+
outside: R,
|
|
1651
|
+
gtr: $,
|
|
1652
|
+
ltr: N,
|
|
1183
1653
|
intersects: T,
|
|
1184
1654
|
simplifyRange: y,
|
|
1185
1655
|
subset: D,
|
|
1186
|
-
SemVer:
|
|
1187
|
-
re:
|
|
1188
|
-
src:
|
|
1189
|
-
tokens:
|
|
1190
|
-
SEMVER_SPEC_VERSION:
|
|
1191
|
-
RELEASE_TYPES:
|
|
1192
|
-
compareIdentifiers:
|
|
1193
|
-
rcompareIdentifiers:
|
|
1194
|
-
},
|
|
1195
|
-
}
|
|
1196
|
-
var
|
|
1197
|
-
const
|
|
1198
|
-
class
|
|
1199
|
-
config = new
|
|
1200
|
-
event = new
|
|
1656
|
+
SemVer: t,
|
|
1657
|
+
re: s.re,
|
|
1658
|
+
src: s.src,
|
|
1659
|
+
tokens: s.t,
|
|
1660
|
+
SEMVER_SPEC_VERSION: e.SEMVER_SPEC_VERSION,
|
|
1661
|
+
RELEASE_TYPES: e.RELEASE_TYPES,
|
|
1662
|
+
compareIdentifiers: n.compareIdentifiers,
|
|
1663
|
+
rcompareIdentifiers: n.rcompareIdentifiers
|
|
1664
|
+
}, ze;
|
|
1665
|
+
}
|
|
1666
|
+
var ts = es();
|
|
1667
|
+
const Wt = `^${z.Version}`;
|
|
1668
|
+
class is {
|
|
1669
|
+
config = new mr(Ht);
|
|
1670
|
+
event = new pr();
|
|
1201
1671
|
state;
|
|
1202
1672
|
active;
|
|
1203
1673
|
time;
|
|
1204
|
-
offset;
|
|
1205
1674
|
info;
|
|
1675
|
+
merger = new wr();
|
|
1676
|
+
offset = new Ar();
|
|
1677
|
+
driver = new yr();
|
|
1206
1678
|
constructor() {
|
|
1207
1679
|
this.state = {
|
|
1208
1680
|
playing: !1,
|
|
1209
|
-
frameId: null,
|
|
1210
|
-
timerId: null,
|
|
1211
1681
|
scanIndex: 0
|
|
1212
1682
|
}, this.active = {
|
|
1213
1683
|
lines: [],
|
|
@@ -1215,14 +1685,11 @@ class ts {
|
|
|
1215
1685
|
}, this.time = {
|
|
1216
1686
|
start: 0,
|
|
1217
1687
|
seek: 0
|
|
1218
|
-
}, this.
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
onConfigUpdate = (n) => {
|
|
1224
|
-
const r = n.has("offset.useMeta");
|
|
1225
|
-
r && this.handleRefreshOffset(), (r || n.has("offset.global")) && this.handleSyncTime();
|
|
1688
|
+
}, this.info = new z.Info(), this.config.event.add("update", this.onConfigUpdate);
|
|
1689
|
+
}
|
|
1690
|
+
onConfigUpdate = (e) => {
|
|
1691
|
+
const t = e.has("offset.useMeta");
|
|
1692
|
+
t && this.offset.refreshFromMeta(this.info, this.config.current.offset.useMeta), (t || e.has("offset.global")) && this.handleSyncTime(), (e.has("mergeWindow") || e.has("mergeLimit")) && (this.handleBuildMergedLineEnd(), this.handleSyncTime());
|
|
1226
1693
|
};
|
|
1227
1694
|
// Get current playback time.
|
|
1228
1695
|
handleGetCurrentTime() {
|
|
@@ -1232,144 +1699,134 @@ class ts {
|
|
|
1232
1699
|
handleGetEffectiveTime() {
|
|
1233
1700
|
return this.handleGetCurrentTime() + this.currentOffset;
|
|
1234
1701
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
} else
|
|
1241
|
-
this.offset.meta = 0;
|
|
1242
|
-
}
|
|
1243
|
-
handleGetLineTime(n) {
|
|
1244
|
-
if (n < 0 || n >= this.info.lines.length)
|
|
1245
|
-
return 0;
|
|
1246
|
-
if (n === this.info.lines.length - 1)
|
|
1247
|
-
return 1 / 0;
|
|
1248
|
-
const r = this.info.lines[n], s = this.info.lines[n + 1];
|
|
1249
|
-
return Math.max(r.time.end, s.time.start);
|
|
1702
|
+
/**
|
|
1703
|
+
* Rebuild the merged line-end table from the current lyric and merge config.
|
|
1704
|
+
*/
|
|
1705
|
+
handleBuildMergedLineEnd() {
|
|
1706
|
+
this.merger.build(this.info.lines, this.config.current.mergeWindow, this.config.current.mergeLimit);
|
|
1250
1707
|
}
|
|
1251
1708
|
handleGetActiveIndex() {
|
|
1252
1709
|
return this.active.index.length > 0 ? this.active.index[0] : -1;
|
|
1253
1710
|
}
|
|
1254
|
-
handleBridgeActive(
|
|
1255
|
-
if (!this.config.current.bridgeActive ||
|
|
1256
|
-
return { lines:
|
|
1257
|
-
const
|
|
1258
|
-
if (i -
|
|
1259
|
-
return { lines:
|
|
1260
|
-
const
|
|
1261
|
-
for (let o = 0; o <
|
|
1262
|
-
|
|
1711
|
+
handleBridgeActive(e, t) {
|
|
1712
|
+
if (!this.config.current.bridgeActive || t.length < 2)
|
|
1713
|
+
return { lines: e, index: t };
|
|
1714
|
+
const n = t[0], i = t[t.length - 1];
|
|
1715
|
+
if (i - n + 1 === t.length)
|
|
1716
|
+
return { lines: e, index: t };
|
|
1717
|
+
const c = /* @__PURE__ */ new Map();
|
|
1718
|
+
for (let o = 0; o < t.length; o++)
|
|
1719
|
+
c.set(t[o], e[o]);
|
|
1263
1720
|
const l = [], h = [];
|
|
1264
|
-
for (let o =
|
|
1265
|
-
const a =
|
|
1721
|
+
for (let o = n; o <= i; o++) {
|
|
1722
|
+
const a = c.get(o) ?? this.info.lines[o];
|
|
1266
1723
|
a && (l.push(a), h.push(o));
|
|
1267
1724
|
}
|
|
1268
1725
|
return { lines: l, index: h };
|
|
1269
1726
|
}
|
|
1270
|
-
handleEmitLinesUpdate(
|
|
1271
|
-
const
|
|
1272
|
-
this.event.emit("linesUpdate",
|
|
1727
|
+
handleEmitLinesUpdate(e) {
|
|
1728
|
+
const t = this.handleBridgeActive(this.active.lines, this.active.index);
|
|
1729
|
+
this.event.emit("linesUpdate", t.lines, t.index, this.handleGetActiveIndex(), e);
|
|
1273
1730
|
}
|
|
1274
|
-
handleSyncTime(
|
|
1275
|
-
if (!this.info.lines.length || (
|
|
1731
|
+
handleSyncTime(e) {
|
|
1732
|
+
if (!this.info.lines.length || (e === void 0 && (e = this.handleGetEffectiveTime()), !Number.isFinite(e)))
|
|
1276
1733
|
return;
|
|
1277
|
-
const
|
|
1734
|
+
const t = [], n = [];
|
|
1278
1735
|
let i = this.info.lines.length;
|
|
1279
|
-
for (let
|
|
1280
|
-
const l = this.info.lines[
|
|
1281
|
-
if (l.time.start >
|
|
1282
|
-
i =
|
|
1736
|
+
for (let c = 0; c < this.info.lines.length; c++) {
|
|
1737
|
+
const l = this.info.lines[c];
|
|
1738
|
+
if (l.time.start > e) {
|
|
1739
|
+
i = c;
|
|
1283
1740
|
break;
|
|
1284
1741
|
}
|
|
1285
|
-
this.
|
|
1742
|
+
this.merger.getMergedTime(c) > e && (t.push(l), n.push(c));
|
|
1286
1743
|
}
|
|
1287
|
-
this.state.scanIndex = i, this.active.lines =
|
|
1288
|
-
}
|
|
1289
|
-
handleUpdateActiveLines(
|
|
1290
|
-
let
|
|
1291
|
-
const
|
|
1292
|
-
for (let
|
|
1293
|
-
const l = this.active.lines[
|
|
1294
|
-
|
|
1744
|
+
this.state.scanIndex = i, this.active.lines = t, this.active.index = n, this.handleEmitLinesUpdate(!0);
|
|
1745
|
+
}
|
|
1746
|
+
handleUpdateActiveLines(e) {
|
|
1747
|
+
let t = !1;
|
|
1748
|
+
const n = [], i = [];
|
|
1749
|
+
for (let c = 0; c < this.active.lines.length; c++) {
|
|
1750
|
+
const l = this.active.lines[c], h = this.active.index[c];
|
|
1751
|
+
e >= this.merger.getMergedTime(h) ? t = !0 : (n.push(l), i.push(h));
|
|
1295
1752
|
}
|
|
1296
1753
|
for (; this.state.scanIndex < this.info.lines.length; ) {
|
|
1297
|
-
const
|
|
1298
|
-
if (
|
|
1299
|
-
|
|
1754
|
+
const c = this.info.lines[this.state.scanIndex];
|
|
1755
|
+
if (e >= c.time.start)
|
|
1756
|
+
e < this.merger.getMergedTime(this.state.scanIndex) && (n.push(c), i.push(this.state.scanIndex), t = !0), this.state.scanIndex++;
|
|
1300
1757
|
else
|
|
1301
1758
|
break;
|
|
1302
1759
|
}
|
|
1303
|
-
|
|
1760
|
+
t && (this.active.lines = n, this.active.index = i, this.handleEmitLinesUpdate(!1));
|
|
1304
1761
|
}
|
|
1305
1762
|
onTick = () => {
|
|
1306
1763
|
if (!this.state.playing)
|
|
1307
1764
|
return;
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1310
|
-
case "animation":
|
|
1311
|
-
this.state.frameId = globalThis.requestAnimationFrame(this.onTick);
|
|
1312
|
-
break;
|
|
1313
|
-
case "timer":
|
|
1314
|
-
this.state.timerId = globalThis.setTimeout(this.onTick, 16);
|
|
1315
|
-
break;
|
|
1316
|
-
}
|
|
1765
|
+
const e = this.handleGetEffectiveTime();
|
|
1766
|
+
this.handleUpdateActiveLines(e), this.driver.schedule(this.config.current.driver, this.onTick);
|
|
1317
1767
|
};
|
|
1318
|
-
updateLyric(
|
|
1319
|
-
if (!
|
|
1768
|
+
updateLyric(e) {
|
|
1769
|
+
if (!e)
|
|
1320
1770
|
return;
|
|
1321
|
-
let
|
|
1322
|
-
|
|
1771
|
+
let t = e;
|
|
1772
|
+
ts.satisfies(e.version, Wt) || (console.warn(`[music-lyric-player] ignored lyric with incompatible version "${e.version}", expected "${Wt}"`), t = new z.Info()), this.pause(), this.info = t, this.handleBuildMergedLineEnd(), this.offset.refreshFromMeta(this.info, this.config.current.offset.useMeta), this.config.current.offset.resetTempOnLyricChange && this.offset.resetTemp(), this.active.lines = [], this.active.index = [], this.state.scanIndex = 0, this.time.seek = 0, this.event.emit("lyricUpdate", t), this.event.emit("linesUpdate", [], [], -1, !1);
|
|
1323
1773
|
}
|
|
1324
1774
|
/**
|
|
1325
1775
|
* Start playback
|
|
1776
|
+
*
|
|
1326
1777
|
* @param time Optional time in ms to seek to before starting playback. If not provided, playback will start from the current position.
|
|
1327
1778
|
*/
|
|
1328
|
-
play(
|
|
1329
|
-
this.pause(), typeof
|
|
1779
|
+
play(e) {
|
|
1780
|
+
this.pause(), typeof e == "number" && Number.isFinite(e) && (this.time.seek = e, this.handleSyncTime()), this.time.start = performance.now(), this.state.playing = !0, this.onTick(), this.event.emit("play", this.handleGetCurrentTime());
|
|
1330
1781
|
}
|
|
1331
1782
|
/**
|
|
1332
1783
|
* Pause playback
|
|
1333
1784
|
*/
|
|
1334
1785
|
pause() {
|
|
1335
|
-
this.state.playing && (this.time.seek = this.handleGetCurrentTime(), this.state.playing = !1, this.event.emit("pause", this.time.seek)), this.
|
|
1786
|
+
this.state.playing && (this.time.seek = this.handleGetCurrentTime(), this.state.playing = !1, this.event.emit("pause", this.time.seek)), this.driver.cancel();
|
|
1336
1787
|
}
|
|
1337
1788
|
/**
|
|
1338
1789
|
* Stop playback
|
|
1339
1790
|
*/
|
|
1340
1791
|
dispose() {
|
|
1341
|
-
this.pause(), this.event.clear(), this.config.event.remove("update", this.onConfigUpdate), this.active.lines = [], this.active.index = [], this.info = new
|
|
1792
|
+
this.pause(), this.event.clear(), this.config.event.remove("update", this.onConfigUpdate), this.active.lines = [], this.active.index = [], this.info = new z.Info();
|
|
1342
1793
|
}
|
|
1343
1794
|
/**
|
|
1344
1795
|
* Update the temp offset in ms (the user's temporary adjustment).
|
|
1796
|
+
*
|
|
1345
1797
|
* Stacked on top of the global config offset and the lyric's meta offset, then resyncs immediately.
|
|
1798
|
+
*
|
|
1346
1799
|
* @param value temp offset in ms; non-finite values are treated as 0.
|
|
1347
1800
|
*/
|
|
1348
|
-
updateTempOffset(
|
|
1349
|
-
this.offset.
|
|
1801
|
+
updateTempOffset(e) {
|
|
1802
|
+
this.offset.setTemp(e), this.handleSyncTime();
|
|
1350
1803
|
}
|
|
1351
1804
|
/**
|
|
1352
1805
|
* Find all active lines at the given time (ms). Does not mutate internal state.
|
|
1806
|
+
*
|
|
1353
1807
|
* Assumes `info.lines` is sorted by `time.start` ascending.
|
|
1808
|
+
*
|
|
1354
1809
|
* @param time time in ms to find active lines for.
|
|
1355
1810
|
*/
|
|
1356
|
-
matchLinesWithTime(
|
|
1357
|
-
const
|
|
1358
|
-
for (let
|
|
1359
|
-
const l = this.info.lines[
|
|
1360
|
-
if (l.time.start >
|
|
1811
|
+
matchLinesWithTime(e) {
|
|
1812
|
+
const t = e + this.currentOffset, n = [], i = [];
|
|
1813
|
+
for (let c = 0; c < this.info.lines.length; c++) {
|
|
1814
|
+
const l = this.info.lines[c];
|
|
1815
|
+
if (l.time.start > t)
|
|
1361
1816
|
break;
|
|
1362
|
-
this.
|
|
1817
|
+
this.merger.getMergedTime(c) > t && (n.push(l), i.push(c));
|
|
1363
1818
|
}
|
|
1364
|
-
return this.handleBridgeActive(
|
|
1819
|
+
return this.handleBridgeActive(n, i);
|
|
1365
1820
|
}
|
|
1366
1821
|
/**
|
|
1367
1822
|
* Convert a content (lyric) time to the playback clock by removing the active offset.
|
|
1823
|
+
*
|
|
1368
1824
|
* Seeking playback to the returned time makes a line at `contentTime` become active.
|
|
1825
|
+
*
|
|
1369
1826
|
* @param contentTime content time in ms (e.g. a line's start).
|
|
1370
1827
|
*/
|
|
1371
|
-
convertContentTime(
|
|
1372
|
-
return
|
|
1828
|
+
convertContentTime(e) {
|
|
1829
|
+
return e - this.currentOffset;
|
|
1373
1830
|
}
|
|
1374
1831
|
/**
|
|
1375
1832
|
* Whether the player is currently playing.
|
|
@@ -1411,12 +1868,11 @@ class ts {
|
|
|
1411
1868
|
* The current effective lyric offset in ms (config offset + lyric meta offset + temp offset).
|
|
1412
1869
|
*/
|
|
1413
1870
|
get currentOffset() {
|
|
1414
|
-
|
|
1415
|
-
return Number.isFinite(n) ? n : 0;
|
|
1871
|
+
return this.offset.resolve(this.config.current.offset.global);
|
|
1416
1872
|
}
|
|
1417
1873
|
}
|
|
1418
1874
|
export {
|
|
1419
|
-
|
|
1420
|
-
|
|
1875
|
+
is as BaseLyricPlayer,
|
|
1876
|
+
ns as BaseLyricPlayerConfig
|
|
1421
1877
|
};
|
|
1422
1878
|
//# sourceMappingURL=index.ecma.js.map
|