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