quickvo-player 0.3.9 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -43,8 +43,8 @@ function a(e, t) {
43
43
  }
44
44
  function o(e, t) {
45
45
  if ({lo: e, hi: t} = s(e, t), t <= 2097151) return String(r * t + e);
46
- let n = e & 16777215, i = (e >>> 24 | t << 8) & 16777215, a = t >> 16 & 65535, o = n + i * 6777216 + a * 6710656, c = i + a * 8147497, l = a * 2, u = 1e7;
47
- return o >= u && (c += Math.floor(o / u), o %= u), c >= u && (l += Math.floor(c / u), c %= u), l.toString() + ee(c) + ee(o);
46
+ let n = e & 16777215, i = (e >>> 24 | t << 8) & 16777215, a = t >> 16 & 65535, o = n + i * 6777216 + a * 6710656, c = i + a * 8147497, l = a * 2, d = 1e7;
47
+ return o >= d && (c += Math.floor(o / d), o %= d), c >= d && (l += Math.floor(c / d), c %= d), l.toString() + u(c) + u(o);
48
48
  }
49
49
  function s(e, t) {
50
50
  return {
@@ -61,11 +61,11 @@ function c(e, t) {
61
61
  function l(e, t) {
62
62
  return t = ~t, e ? e = ~e + 1 : t += 1, c(e, t);
63
63
  }
64
- var ee = (e) => {
64
+ var u = (e) => {
65
65
  let t = String(e);
66
66
  return "0000000".slice(t.length) + t;
67
67
  };
68
- function u(e, t) {
68
+ function d(e, t) {
69
69
  if (e >= 0) {
70
70
  for (; e > 127;) t.push(e & 127 | 128), e >>>= 7;
71
71
  t.push(e);
@@ -74,7 +74,7 @@ function u(e, t) {
74
74
  t.push(1);
75
75
  }
76
76
  }
77
- function te() {
77
+ function ee() {
78
78
  let e = this.buf[this.pos++], t = e & 127;
79
79
  if (!(e & 128) || (e = this.buf[this.pos++], t |= (e & 127) << 7, !(e & 128)) || (e = this.buf[this.pos++], t |= (e & 127) << 14, !(e & 128)) || (e = this.buf[this.pos++], t |= (e & 127) << 21, !(e & 128))) return this.assertBounds(), t;
80
80
  e = this.buf[this.pos++], t |= (e & 15) << 28;
@@ -84,8 +84,8 @@ function te() {
84
84
  }
85
85
  //#endregion
86
86
  //#region node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js
87
- var d = /* @__PURE__ */ ne();
88
- function ne() {
87
+ var f = /*@__PURE__*/ te();
88
+ function te() {
89
89
  let e = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
90
90
  if (typeof BigInt == "function" && typeof e.getBigInt64 == "function" && typeof e.getBigUint64 == "function" && typeof e.setBigInt64 == "function" && typeof e.setBigUint64 == "function" && (globalThis.Deno || typeof process != "object" || typeof process.env != "object" || process.env.BUF_BIGINT_DISABLE !== "1")) {
91
91
  let t = BigInt("-9223372036854775808"), n = BigInt("9223372036854775807"), r = BigInt("0"), i = BigInt("18446744073709551615");
@@ -126,16 +126,16 @@ function ne() {
126
126
  zero: "0",
127
127
  supported: !1,
128
128
  parse(e) {
129
- return typeof e != "string" && (e = e.toString()), re(e), e;
129
+ return typeof e != "string" && (e = e.toString()), ne(e), e;
130
130
  },
131
131
  uParse(e) {
132
- return typeof e != "string" && (e = e.toString()), ie(e), e;
132
+ return typeof e != "string" && (e = e.toString()), re(e), e;
133
133
  },
134
134
  enc(e) {
135
- return typeof e != "string" && (e = e.toString()), re(e), i(e);
135
+ return typeof e != "string" && (e = e.toString()), ne(e), i(e);
136
136
  },
137
137
  uEnc(e) {
138
- return typeof e != "string" && (e = e.toString()), ie(e), i(e);
138
+ return typeof e != "string" && (e = e.toString()), re(e), i(e);
139
139
  },
140
140
  dec(e, t) {
141
141
  return a(e, t);
@@ -145,15 +145,15 @@ function ne() {
145
145
  }
146
146
  };
147
147
  }
148
- function re(e) {
148
+ function ne(e) {
149
149
  if (!/^-?[0-9]+$/.test(e)) throw Error("invalid int64: " + e);
150
150
  }
151
- function ie(e) {
151
+ function re(e) {
152
152
  if (!/^[0-9]+$/.test(e)) throw Error("invalid uint64: " + e);
153
153
  }
154
154
  //#endregion
155
155
  //#region node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js
156
- function f(e, n) {
156
+ function p(e, n) {
157
157
  switch (e) {
158
158
  case t.STRING: return "";
159
159
  case t.BOOL: return !1;
@@ -163,12 +163,12 @@ function f(e, n) {
163
163
  case t.UINT64:
164
164
  case t.SFIXED64:
165
165
  case t.FIXED64:
166
- case t.SINT64: return n ? "0" : d.zero;
167
- case t.BYTES: return new Uint8Array();
166
+ case t.SINT64: return n ? "0" : f.zero;
167
+ case t.BYTES: return /* @__PURE__ */ new Uint8Array();
168
168
  default: return 0;
169
169
  }
170
170
  }
171
- function ae(e, n) {
171
+ function m(e, n) {
172
172
  switch (e) {
173
173
  case t.BOOL: return n === !1;
174
174
  case t.STRING: return n === "";
@@ -178,45 +178,45 @@ function ae(e, n) {
178
178
  }
179
179
  //#endregion
180
180
  //#region node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js
181
- var oe = 2, p = Symbol.for("reflect unsafe local");
182
- function se(e, t) {
181
+ var h = 2, g = Symbol.for("reflect unsafe local");
182
+ function ie(e, t) {
183
183
  let n = e[t.localName].case;
184
184
  return n === void 0 ? n : t.fields.find((e) => e.localName === n);
185
185
  }
186
- function ce(e, t) {
186
+ function ae(e, t) {
187
187
  let n = t.localName;
188
188
  if (t.oneof) return e[t.oneof.localName].case === n;
189
- if (t.presence != oe) return e[n] !== void 0 && Object.prototype.hasOwnProperty.call(e, n);
189
+ if (t.presence != h) return e[n] !== void 0 && Object.prototype.hasOwnProperty.call(e, n);
190
190
  switch (t.fieldKind) {
191
191
  case "list": return e[n].length > 0;
192
192
  case "map": return Object.keys(e[n]).length > 0;
193
- case "scalar": return !ae(t.scalar, e[n]);
193
+ case "scalar": return !m(t.scalar, e[n]);
194
194
  case "enum": return e[n] !== t.enum.values[0].number;
195
195
  }
196
196
  throw Error("message field with implicit presence");
197
197
  }
198
- function m(e, t) {
198
+ function _(e, t) {
199
199
  return Object.prototype.hasOwnProperty.call(e, t) && e[t] !== void 0;
200
200
  }
201
- function le(e, t) {
201
+ function oe(e, t) {
202
202
  if (t.oneof) {
203
203
  let n = e[t.oneof.localName];
204
204
  return n.case === t.localName ? n.value : void 0;
205
205
  }
206
206
  return e[t.localName];
207
207
  }
208
- function ue(e, t, n) {
208
+ function se(e, t, n) {
209
209
  t.oneof ? e[t.oneof.localName] = {
210
210
  case: t.localName,
211
211
  value: n
212
212
  } : e[t.localName] = n;
213
213
  }
214
- function de(e, t) {
214
+ function ce(e, t) {
215
215
  let n = t.localName;
216
216
  if (t.oneof) {
217
217
  let r = t.oneof.localName;
218
218
  e[r].case === n && (e[r] = { case: void 0 });
219
- } else if (t.presence != oe) delete e[n];
219
+ } else if (t.presence != h) delete e[n];
220
220
  else switch (t.fieldKind) {
221
221
  case "map":
222
222
  e[n] = {};
@@ -228,17 +228,17 @@ function de(e, t) {
228
228
  e[n] = t.enum.values[0].number;
229
229
  break;
230
230
  case "scalar":
231
- e[n] = f(t.scalar, t.longAsString);
231
+ e[n] = p(t.scalar, t.longAsString);
232
232
  break;
233
233
  }
234
234
  }
235
235
  //#endregion
236
236
  //#region node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js
237
- function h(e) {
237
+ function v(e) {
238
238
  return typeof e == "object" && !!e && !Array.isArray(e);
239
239
  }
240
- function g(e, t) {
241
- if (h(e) && p in e && "add" in e && "field" in e && typeof e.field == "function") {
240
+ function y(e, t) {
241
+ if (v(e) && g in e && "add" in e && "field" in e && typeof e.field == "function") {
242
242
  if (t !== void 0) {
243
243
  let n = t, r = e.field();
244
244
  return n.listKind == r.listKind && n.scalar === r.scalar && n.message?.typeName === r.message?.typeName && n.enum?.typeName === r.enum?.typeName;
@@ -247,8 +247,8 @@ function g(e, t) {
247
247
  }
248
248
  return !1;
249
249
  }
250
- function fe(e, t) {
251
- if (h(e) && p in e && "has" in e && "field" in e && typeof e.field == "function") {
250
+ function le(e, t) {
251
+ if (v(e) && g in e && "has" in e && "field" in e && typeof e.field == "function") {
252
252
  if (t !== void 0) {
253
253
  let n = t, r = e.field();
254
254
  return n.mapKey === r.mapKey && n.mapKind == r.mapKind && n.scalar === r.scalar && n.message?.typeName === r.message?.typeName && n.enum?.typeName === r.enum?.typeName;
@@ -257,19 +257,19 @@ function fe(e, t) {
257
257
  }
258
258
  return !1;
259
259
  }
260
- function _(e, t) {
261
- return h(e) && p in e && "desc" in e && h(e.desc) && e.desc.kind === "message" && (t === void 0 || e.desc.typeName == t.typeName);
260
+ function b(e, t) {
261
+ return v(e) && g in e && "desc" in e && v(e.desc) && e.desc.kind === "message" && (t === void 0 || e.desc.typeName == t.typeName);
262
262
  }
263
263
  //#endregion
264
264
  //#region node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js
265
- function pe(e) {
266
- return he(e.$typeName);
265
+ function ue(e) {
266
+ return fe(e.$typeName);
267
267
  }
268
- function me(e) {
268
+ function de(e) {
269
269
  let t = e.fields[0];
270
- return he(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
270
+ return fe(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
271
271
  }
272
- function he(e) {
272
+ function fe(e) {
273
273
  return e.startsWith("google.protobuf.") && [
274
274
  "DoubleValue",
275
275
  "FloatValue",
@@ -284,121 +284,121 @@ function he(e) {
284
284
  }
285
285
  //#endregion
286
286
  //#region node_modules/@bufbuild/protobuf/dist/esm/create.js
287
- var ge = 999, _e = 998, v = 2;
288
- function ve(t, n) {
287
+ var pe = 999, me = 998, x = 2;
288
+ function he(t, n) {
289
289
  if (e(n, t)) return n;
290
- let r = Ee(t);
291
- return n !== void 0 && ye(t, r, n), r;
290
+ let r = Ce(t);
291
+ return n !== void 0 && ge(t, r, n), r;
292
292
  }
293
- function ye(e, t, n) {
293
+ function ge(e, t, n) {
294
294
  for (let r of e.members) {
295
295
  let e = n[r.localName];
296
296
  if (e == null) continue;
297
297
  let i;
298
298
  if (r.kind == "oneof") {
299
- let t = se(n, r);
299
+ let t = ie(n, r);
300
300
  if (!t) continue;
301
- i = t, e = le(n, t);
301
+ i = t, e = oe(n, t);
302
302
  } else i = r;
303
303
  switch (i.fieldKind) {
304
304
  case "message":
305
- e = y(i, e);
305
+ e = S(i, e);
306
306
  break;
307
307
  case "scalar":
308
- e = be(i, e);
308
+ e = _e(i, e);
309
309
  break;
310
310
  case "list":
311
- e = Se(i, e);
311
+ e = ye(i, e);
312
312
  break;
313
313
  case "map":
314
- e = xe(i, e);
314
+ e = ve(i, e);
315
315
  break;
316
316
  }
317
- ue(t, i, e);
317
+ se(t, i, e);
318
318
  }
319
319
  return t;
320
320
  }
321
- function be(e, n) {
322
- return e.scalar == t.BYTES ? b(n) : n;
321
+ function _e(e, n) {
322
+ return e.scalar == t.BYTES ? C(n) : n;
323
323
  }
324
- function xe(e, n) {
325
- if (h(n)) {
326
- if (e.scalar == t.BYTES) return Ce(n, b);
327
- if (e.mapKind == "message") return Ce(n, (t) => y(e, t));
324
+ function ve(e, n) {
325
+ if (v(n)) {
326
+ if (e.scalar == t.BYTES) return be(n, C);
327
+ if (e.mapKind == "message") return be(n, (t) => S(e, t));
328
328
  }
329
329
  return n;
330
330
  }
331
- function Se(e, n) {
331
+ function ye(e, n) {
332
332
  if (Array.isArray(n)) {
333
- if (e.scalar == t.BYTES) return n.map(b);
334
- if (e.listKind == "message") return n.map((t) => y(e, t));
333
+ if (e.scalar == t.BYTES) return n.map(C);
334
+ if (e.listKind == "message") return n.map((t) => S(e, t));
335
335
  }
336
336
  return n;
337
337
  }
338
- function y(t, n) {
339
- if (t.fieldKind == "message" && !t.oneof && me(t.message)) return be(t.message.fields[0], n);
340
- if (h(n)) {
338
+ function S(t, n) {
339
+ if (t.fieldKind == "message" && !t.oneof && de(t.message)) return _e(t.message.fields[0], n);
340
+ if (v(n)) {
341
341
  if (t.message.typeName == "google.protobuf.Struct" && t.parent.typeName !== "google.protobuf.Value") return n;
342
- if (!e(n, t.message)) return ve(t.message, n);
342
+ if (!e(n, t.message)) return he(t.message, n);
343
343
  }
344
344
  return n;
345
345
  }
346
- function b(e) {
346
+ function C(e) {
347
347
  return Array.isArray(e) ? new Uint8Array(e) : e;
348
348
  }
349
- function Ce(e, t) {
349
+ function be(e, t) {
350
350
  let n = {};
351
351
  for (let r of Object.entries(e)) n[r[0]] = t(r[1]);
352
352
  return n;
353
353
  }
354
- var we = Symbol(), Te = /* @__PURE__ */ new WeakMap();
355
- function Ee(e) {
354
+ var xe = Symbol(), Se = /* @__PURE__ */ new WeakMap();
355
+ function Ce(e) {
356
356
  let t;
357
- if (De(e)) {
358
- let n = Te.get(e), r, i;
357
+ if (we(e)) {
358
+ let n = Se.get(e), r, i;
359
359
  if (n) ({prototype: r, members: i} = n);
360
360
  else {
361
361
  r = {}, i = /* @__PURE__ */ new Set();
362
- for (let t of e.members) t.kind != "oneof" && (t.fieldKind != "scalar" && t.fieldKind != "enum" || t.presence != v && (i.add(t), r[t.localName] = x(t)));
363
- Te.set(e, {
362
+ for (let t of e.members) t.kind != "oneof" && (t.fieldKind != "scalar" && t.fieldKind != "enum" || t.presence != x && (i.add(t), r[t.localName] = w(t)));
363
+ Se.set(e, {
364
364
  prototype: r,
365
365
  members: i
366
366
  });
367
367
  }
368
368
  t = Object.create(r), t.$typeName = e.typeName;
369
- for (let n of e.members) i.has(n) || n.kind == "field" && (n.fieldKind == "message" || (n.fieldKind == "scalar" || n.fieldKind == "enum") && n.presence != v) || (t[n.localName] = x(n));
369
+ for (let n of e.members) i.has(n) || n.kind == "field" && (n.fieldKind == "message" || (n.fieldKind == "scalar" || n.fieldKind == "enum") && n.presence != x) || (t[n.localName] = w(n));
370
370
  } else {
371
371
  t = { $typeName: e.typeName };
372
- for (let n of e.members) (n.kind == "oneof" || n.presence == v) && (t[n.localName] = x(n));
372
+ for (let n of e.members) (n.kind == "oneof" || n.presence == x) && (t[n.localName] = w(n));
373
373
  }
374
374
  return t;
375
375
  }
376
- function De(e) {
376
+ function we(e) {
377
377
  switch (e.file.edition) {
378
- case ge: return !1;
379
- case _e: return !0;
380
- default: return e.fields.some((e) => e.presence != v && e.fieldKind != "message" && !e.oneof);
378
+ case pe: return !1;
379
+ case me: return !0;
380
+ default: return e.fields.some((e) => e.presence != x && e.fieldKind != "message" && !e.oneof);
381
381
  }
382
382
  }
383
- function x(e) {
383
+ function w(e) {
384
384
  if (e.kind == "oneof") return { case: void 0 };
385
385
  if (e.fieldKind == "list") return [];
386
386
  if (e.fieldKind == "map") return {};
387
- if (e.fieldKind == "message") return we;
387
+ if (e.fieldKind == "message") return xe;
388
388
  let t = e.getDefaultValue();
389
- return t === void 0 ? e.fieldKind == "scalar" ? f(e.scalar, e.longAsString) : e.enum.values[0].number : e.fieldKind == "scalar" && e.longAsString ? t.toString() : t;
389
+ return t === void 0 ? e.fieldKind == "scalar" ? p(e.scalar, e.longAsString) : e.enum.values[0].number : e.fieldKind == "scalar" && e.longAsString ? t.toString() : t;
390
390
  }
391
391
  //#endregion
392
392
  //#region node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js
393
- var S = class extends Error {
393
+ var T = class extends Error {
394
394
  constructor(e, t, n = "FieldValueInvalidError") {
395
395
  super(t), this.name = n, this.field = () => e;
396
396
  }
397
- }, Oe = Symbol.for("@bufbuild/protobuf/text-encoding");
398
- function ke() {
399
- if (globalThis[Oe] == null) {
397
+ }, Te = Symbol.for("@bufbuild/protobuf/text-encoding");
398
+ function Ee() {
399
+ if (globalThis[Te] == null) {
400
400
  let e = new globalThis.TextEncoder(), t = new globalThis.TextDecoder();
401
- globalThis[Oe] = {
401
+ globalThis[Te] = {
402
402
  encodeUtf8(t) {
403
403
  return e.encode(t);
404
404
  },
@@ -414,17 +414,17 @@ function ke() {
414
414
  }
415
415
  };
416
416
  }
417
- return globalThis[Oe];
417
+ return globalThis[Te];
418
418
  }
419
419
  //#endregion
420
420
  //#region node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js
421
- var C;
421
+ var E;
422
422
  (function(e) {
423
423
  e[e.Varint = 0] = "Varint", e[e.Bit64 = 1] = "Bit64", e[e.LengthDelimited = 2] = "LengthDelimited", e[e.StartGroup = 3] = "StartGroup", e[e.EndGroup = 4] = "EndGroup", e[e.Bit32 = 5] = "Bit32";
424
- })(C ||= {});
425
- var Ae = class {
426
- constructor(e, t = ke().decodeUtf8) {
427
- this.decodeUtf8 = t, this.varint64 = n, this.uint32 = te, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength);
424
+ })(E ||= {});
425
+ var De = class {
426
+ constructor(e, t = Ee().decodeUtf8) {
427
+ this.decodeUtf8 = t, this.varint64 = n, this.uint32 = ee, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength);
428
428
  }
429
429
  tag() {
430
430
  let e = this.uint32(), t = e >>> 3, n = e & 7;
@@ -434,21 +434,21 @@ var Ae = class {
434
434
  skip(e, t) {
435
435
  let n = this.pos;
436
436
  switch (e) {
437
- case C.Varint:
437
+ case E.Varint:
438
438
  for (; this.buf[this.pos++] & 128;);
439
439
  break;
440
- case C.Bit64: this.pos += 4;
441
- case C.Bit32:
440
+ case E.Bit64: this.pos += 4;
441
+ case E.Bit32:
442
442
  this.pos += 4;
443
443
  break;
444
- case C.LengthDelimited:
444
+ case E.LengthDelimited:
445
445
  let n = this.uint32();
446
446
  this.pos += n;
447
447
  break;
448
- case C.StartGroup:
448
+ case E.StartGroup:
449
449
  for (;;) {
450
450
  let [e, n] = this.tag();
451
- if (n === C.EndGroup) {
451
+ if (n === E.EndGroup) {
452
452
  if (t !== void 0 && e !== t) throw Error("invalid end group tag");
453
453
  break;
454
454
  }
@@ -470,14 +470,14 @@ var Ae = class {
470
470
  return e >>> 1 ^ -(e & 1);
471
471
  }
472
472
  int64() {
473
- return d.dec(...this.varint64());
473
+ return f.dec(...this.varint64());
474
474
  }
475
475
  uint64() {
476
- return d.uDec(...this.varint64());
476
+ return f.uDec(...this.varint64());
477
477
  }
478
478
  sint64() {
479
479
  let [e, t] = this.varint64(), n = -(e & 1);
480
- return e = (e >>> 1 | (t & 1) << 31) ^ n, t = t >>> 1 ^ n, d.dec(e, t);
480
+ return e = (e >>> 1 | (t & 1) << 31) ^ n, t = t >>> 1 ^ n, f.dec(e, t);
481
481
  }
482
482
  bool() {
483
483
  let [e, t] = this.varint64();
@@ -490,10 +490,10 @@ var Ae = class {
490
490
  return this.view.getInt32((this.pos += 4) - 4, !0);
491
491
  }
492
492
  fixed64() {
493
- return d.uDec(this.sfixed32(), this.sfixed32());
493
+ return f.uDec(this.sfixed32(), this.sfixed32());
494
494
  }
495
495
  sfixed64() {
496
- return d.dec(this.sfixed32(), this.sfixed32());
496
+ return f.dec(this.sfixed32(), this.sfixed32());
497
497
  }
498
498
  float() {
499
499
  return this.view.getFloat32((this.pos += 4) - 4, !0);
@@ -511,35 +511,35 @@ var Ae = class {
511
511
  };
512
512
  //#endregion
513
513
  //#region node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js
514
- function je(e, t) {
515
- let n = e.fieldKind == "list" ? g(t, e) : e.fieldKind == "map" ? fe(t, e) : Pe(e, t);
514
+ function Oe(e, t) {
515
+ let n = e.fieldKind == "list" ? y(t, e) : e.fieldKind == "map" ? le(t, e) : je(e, t);
516
516
  if (n === !0) return;
517
517
  let r;
518
518
  switch (e.fieldKind) {
519
519
  case "list":
520
- r = `expected ${Le(e)}, got ${T(t)}`;
520
+ r = `expected ${Pe(e)}, got ${O(t)}`;
521
521
  break;
522
522
  case "map":
523
- r = `expected ${Re(e)}, got ${T(t)}`;
523
+ r = `expected ${Fe(e)}, got ${O(t)}`;
524
524
  break;
525
- default: r = w(e, t, n);
525
+ default: r = D(e, t, n);
526
526
  }
527
- return new S(e, r);
527
+ return new T(e, r);
528
528
  }
529
- function Me(e, t, n) {
530
- let r = Pe(e, n);
531
- if (r !== !0) return new S(e, `list item #${t + 1}: ${w(e, n, r)}`);
529
+ function ke(e, t, n) {
530
+ let r = je(e, n);
531
+ if (r !== !0) return new T(e, `list item #${t + 1}: ${D(e, n, r)}`);
532
532
  }
533
- function Ne(e, t, n) {
534
- let r = Fe(t, e.mapKey);
535
- if (r !== !0) return new S(e, `invalid map key: ${w({ scalar: e.mapKey }, t, r)}`);
536
- let i = Pe(e, n);
537
- if (i !== !0) return new S(e, `map entry ${T(t)}: ${w(e, n, i)}`);
533
+ function Ae(e, t, n) {
534
+ let r = Me(t, e.mapKey);
535
+ if (r !== !0) return new T(e, `invalid map key: ${D({ scalar: e.mapKey }, t, r)}`);
536
+ let i = je(e, n);
537
+ if (i !== !0) return new T(e, `map entry ${O(t)}: ${D(e, n, i)}`);
538
538
  }
539
- function Pe(e, t) {
540
- return e.scalar === void 0 ? e.enum === void 0 ? _(t, e.message) : e.enum.open ? Number.isInteger(t) : e.enum.values.some((e) => e.number === t) : Fe(t, e.scalar);
539
+ function je(e, t) {
540
+ return e.scalar === void 0 ? e.enum === void 0 ? b(t, e.message) : e.enum.open ? Number.isInteger(t) : e.enum.values.some((e) => e.number === t) : Me(t, e.scalar);
541
541
  }
542
- function Fe(e, n) {
542
+ function Me(e, n) {
543
543
  switch (n) {
544
544
  case t.DOUBLE: return typeof e == "number";
545
545
  case t.FLOAT: return typeof e == "number" ? Number.isNaN(e) || !Number.isFinite(e) ? !0 : e > 34028234663852886e22 || e < -34028234663852886e22 ? `${e.toFixed()} out of range` : !0 : !1;
@@ -549,13 +549,13 @@ function Fe(e, n) {
549
549
  case t.FIXED32:
550
550
  case t.UINT32: return typeof e != "number" || !Number.isInteger(e) ? !1 : e > 4294967295 || e < 0 ? `${e.toFixed()} out of range` : !0;
551
551
  case t.BOOL: return typeof e == "boolean";
552
- case t.STRING: return typeof e == "string" ? ke().checkUtf8(e) || "invalid UTF8" : !1;
552
+ case t.STRING: return typeof e == "string" ? Ee().checkUtf8(e) || "invalid UTF8" : !1;
553
553
  case t.BYTES: return e instanceof Uint8Array;
554
554
  case t.INT64:
555
555
  case t.SFIXED64:
556
556
  case t.SINT64:
557
557
  if (typeof e == "bigint" || typeof e == "number" || typeof e == "string" && e.length > 0) try {
558
- return d.parse(e), !0;
558
+ return f.parse(e), !0;
559
559
  } catch {
560
560
  return `${e} out of range`;
561
561
  }
@@ -563,19 +563,19 @@ function Fe(e, n) {
563
563
  case t.FIXED64:
564
564
  case t.UINT64:
565
565
  if (typeof e == "bigint" || typeof e == "number" || typeof e == "string" && e.length > 0) try {
566
- return d.uParse(e), !0;
566
+ return f.uParse(e), !0;
567
567
  } catch {
568
568
  return `${e} out of range`;
569
569
  }
570
570
  return !1;
571
571
  }
572
572
  }
573
- function w(e, t, n) {
574
- return n = typeof n == "string" ? `: ${n}` : `, got ${T(t)}`, e.scalar === void 0 ? e.enum === void 0 ? `expected ${Ie(e.message)}` + n : `expected ${e.enum.toString()}` + n : `expected ${ze(e.scalar)}` + n;
573
+ function D(e, t, n) {
574
+ return n = typeof n == "string" ? `: ${n}` : `, got ${O(t)}`, e.scalar === void 0 ? e.enum === void 0 ? `expected ${Ne(e.message)}` + n : `expected ${e.enum.toString()}` + n : `expected ${Ie(e.scalar)}` + n;
575
575
  }
576
- function T(t) {
576
+ function O(t) {
577
577
  switch (typeof t) {
578
- case "object": return t === null ? "null" : t instanceof Uint8Array ? `Uint8Array(${t.length})` : Array.isArray(t) ? `Array(${t.length})` : g(t) ? Le(t.field()) : fe(t) ? Re(t.field()) : _(t) ? Ie(t.desc) : e(t) ? `message ${t.$typeName}` : "object";
578
+ case "object": return t === null ? "null" : t instanceof Uint8Array ? `Uint8Array(${t.length})` : Array.isArray(t) ? `Array(${t.length})` : y(t) ? Pe(t.field()) : le(t) ? Fe(t.field()) : b(t) ? Ne(t.desc) : e(t) ? `message ${t.$typeName}` : "object";
579
579
  case "string": return t.length > 30 ? "string" : `"${t.split("\"").join("\\\"")}"`;
580
580
  case "boolean": return String(t);
581
581
  case "number": return String(t);
@@ -583,24 +583,24 @@ function T(t) {
583
583
  default: return typeof t;
584
584
  }
585
585
  }
586
- function Ie(e) {
586
+ function Ne(e) {
587
587
  return `ReflectMessage (${e.typeName})`;
588
588
  }
589
- function Le(e) {
589
+ function Pe(e) {
590
590
  switch (e.listKind) {
591
591
  case "message": return `ReflectList (${e.message.toString()})`;
592
592
  case "enum": return `ReflectList (${e.enum.toString()})`;
593
593
  case "scalar": return `ReflectList (${t[e.scalar]})`;
594
594
  }
595
595
  }
596
- function Re(e) {
596
+ function Fe(e) {
597
597
  switch (e.mapKind) {
598
598
  case "message": return `ReflectMap (${t[e.mapKey]}, ${e.message.toString()})`;
599
599
  case "enum": return `ReflectMap (${t[e.mapKey]}, ${e.enum.toString()})`;
600
600
  case "scalar": return `ReflectMap (${t[e.mapKey]}, ${t[e.scalar]})`;
601
601
  }
602
602
  }
603
- function ze(e) {
603
+ function Ie(e) {
604
604
  switch (e) {
605
605
  case t.STRING: return "string";
606
606
  case t.BOOL: return "boolean";
@@ -621,53 +621,53 @@ function ze(e) {
621
621
  }
622
622
  //#endregion
623
623
  //#region node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js
624
- function E(e, t, n = !0) {
625
- return new Ve(e, t, n);
624
+ function Le(e, t, n = !0) {
625
+ return new ze(e, t, n);
626
626
  }
627
- var Be = /* @__PURE__ */ new WeakMap(), Ve = class {
627
+ var Re = /* @__PURE__ */ new WeakMap(), ze = class {
628
628
  get sortedFields() {
629
- let e = Be.get(this.desc);
629
+ let e = Re.get(this.desc);
630
630
  if (e) return e;
631
631
  let t = this.desc.fields.concat().sort((e, t) => e.number - t.number);
632
- return Be.set(this.desc, t), t;
632
+ return Re.set(this.desc, t), t;
633
633
  }
634
634
  constructor(e, t, n = !0) {
635
- this.lists = /* @__PURE__ */ new Map(), this.maps = /* @__PURE__ */ new Map(), this.check = n, this.desc = e, this.message = this[p] = t ?? ve(e), this.fields = e.fields, this.oneofs = e.oneofs, this.members = e.members;
635
+ this.lists = /* @__PURE__ */ new Map(), this.maps = /* @__PURE__ */ new Map(), this.check = n, this.desc = e, this.message = this[g] = t ?? he(e), this.fields = e.fields, this.oneofs = e.oneofs, this.members = e.members;
636
636
  }
637
637
  findNumber(e) {
638
638
  return this._fieldsByNumber ||= new Map(this.desc.fields.map((e) => [e.number, e])), this._fieldsByNumber.get(e);
639
639
  }
640
640
  oneofCase(e) {
641
- return D(this.message, e), se(this.message, e);
641
+ return k(this.message, e), ie(this.message, e);
642
642
  }
643
643
  isSet(e) {
644
- return D(this.message, e), ce(this.message, e);
644
+ return k(this.message, e), ae(this.message, e);
645
645
  }
646
646
  clear(e) {
647
- D(this.message, e), de(this.message, e);
647
+ k(this.message, e), ce(this.message, e);
648
648
  }
649
649
  get(e) {
650
- D(this.message, e);
651
- let t = le(this.message, e);
650
+ k(this.message, e);
651
+ let t = oe(this.message, e);
652
652
  switch (e.fieldKind) {
653
653
  case "list":
654
654
  let n = this.lists.get(e);
655
- return (!n || n[p] !== t) && this.lists.set(e, n = new He(e, t, this.check)), n;
655
+ return (!n || n[g] !== t) && this.lists.set(e, n = new Be(e, t, this.check)), n;
656
656
  case "map":
657
657
  let r = this.maps.get(e);
658
- return (!r || r[p] !== t) && this.maps.set(e, r = new Ue(e, t, this.check)), r;
659
- case "message": return k(e, t, this.check);
660
- case "scalar": return t === void 0 ? f(e.scalar, !1) : N(e, t);
658
+ return (!r || r[g] !== t) && this.maps.set(e, r = new Ve(e, t, this.check)), r;
659
+ case "message": return j(e, t, this.check);
660
+ case "scalar": return t === void 0 ? p(e.scalar, !1) : N(e, t);
661
661
  case "enum": return t ?? e.enum.values[0].number;
662
662
  }
663
663
  }
664
664
  set(e, t) {
665
- if (D(this.message, e), this.check) {
666
- let n = je(e, t);
665
+ if (k(this.message, e), this.check) {
666
+ let n = Oe(e, t);
667
667
  if (n) throw n;
668
668
  }
669
669
  let n;
670
- n = e.fieldKind == "message" ? O(e, t) : fe(t) || g(t) ? t[p] : P(e, t), ue(this.message, e, n);
670
+ n = e.fieldKind == "message" ? A(e, t) : le(t) || y(t) ? t[g] : P(e, t), se(this.message, e, n);
671
671
  }
672
672
  getUnknown() {
673
673
  return this.message.$unknown;
@@ -676,10 +676,10 @@ var Be = /* @__PURE__ */ new WeakMap(), Ve = class {
676
676
  this.message.$unknown = e;
677
677
  }
678
678
  };
679
- function D(e, t) {
680
- if (t.parent.typeName !== e.$typeName) throw new S(t, `cannot use ${t.toString()} with message ${e.$typeName}`, "ForeignFieldError");
679
+ function k(e, t) {
680
+ if (t.parent.typeName !== e.$typeName) throw new T(t, `cannot use ${t.toString()} with message ${e.$typeName}`, "ForeignFieldError");
681
681
  }
682
- var He = class {
682
+ var Be = class {
683
683
  field() {
684
684
  return this._field;
685
685
  }
@@ -687,26 +687,26 @@ var He = class {
687
687
  return this._arr.length;
688
688
  }
689
689
  constructor(e, t, n) {
690
- this._field = e, this._arr = this[p] = t, this.check = n;
690
+ this._field = e, this._arr = this[g] = t, this.check = n;
691
691
  }
692
692
  get(e) {
693
693
  let t = this._arr[e];
694
- return t === void 0 ? void 0 : A(this._field, t, this.check);
694
+ return t === void 0 ? void 0 : Ue(this._field, t, this.check);
695
695
  }
696
696
  set(e, t) {
697
- if (e < 0 || e >= this._arr.length) throw new S(this._field, `list item #${e + 1}: out of range`);
697
+ if (e < 0 || e >= this._arr.length) throw new T(this._field, `list item #${e + 1}: out of range`);
698
698
  if (this.check) {
699
- let n = Me(this._field, e, t);
699
+ let n = ke(this._field, e, t);
700
700
  if (n) throw n;
701
701
  }
702
- this._arr[e] = We(this._field, t);
702
+ this._arr[e] = He(this._field, t);
703
703
  }
704
704
  add(e) {
705
705
  if (this.check) {
706
- let t = Me(this._field, this._arr.length, e);
706
+ let t = ke(this._field, this._arr.length, e);
707
707
  if (t) throw t;
708
708
  }
709
- this._arr.push(We(this._field, e));
709
+ this._arr.push(He(this._field, e));
710
710
  }
711
711
  clear() {
712
712
  this._arr.splice(0, this._arr.length);
@@ -718,24 +718,24 @@ var He = class {
718
718
  return this._arr.keys();
719
719
  }
720
720
  *values() {
721
- for (let e of this._arr) yield A(this._field, e, this.check);
721
+ for (let e of this._arr) yield Ue(this._field, e, this.check);
722
722
  }
723
723
  *entries() {
724
- for (let e = 0; e < this._arr.length; e++) yield [e, A(this._field, this._arr[e], this.check)];
724
+ for (let e = 0; e < this._arr.length; e++) yield [e, Ue(this._field, this._arr[e], this.check)];
725
725
  }
726
- }, Ue = class {
726
+ }, Ve = class {
727
727
  constructor(e, t, n = !0) {
728
- this.obj = this[p] = t ?? {}, this.check = n, this._field = e;
728
+ this.obj = this[g] = t ?? {}, this.check = n, this._field = e;
729
729
  }
730
730
  field() {
731
731
  return this._field;
732
732
  }
733
733
  set(e, t) {
734
734
  if (this.check) {
735
- let n = Ne(this._field, e, t);
735
+ let n = Ae(this._field, e, t);
736
736
  if (n) throw n;
737
737
  }
738
- return this.obj[M(e)] = Ge(this._field, t), this;
738
+ return this.obj[M(e)] = We(this._field, t), this;
739
739
  }
740
740
  delete(e) {
741
741
  let t = M(e), n = Object.prototype.hasOwnProperty.call(this.obj, t);
@@ -746,7 +746,7 @@ var He = class {
746
746
  }
747
747
  get(e) {
748
748
  let t = this.obj[M(e)];
749
- return t !== void 0 && (t = j(this._field, t, this.check)), t;
749
+ return t !== void 0 && (t = Ge(this._field, t, this.check)), t;
750
750
  }
751
751
  has(e) {
752
752
  return Object.prototype.hasOwnProperty.call(this.obj, M(e));
@@ -755,7 +755,7 @@ var He = class {
755
755
  for (let e of Object.keys(this.obj)) yield Ke(e, this._field.mapKey);
756
756
  }
757
757
  *entries() {
758
- for (let e of Object.entries(this.obj)) yield [Ke(e[0], this._field.mapKey), j(this._field, e[1], this.check)];
758
+ for (let e of Object.entries(this.obj)) yield [Ke(e[0], this._field.mapKey), Ge(this._field, e[1], this.check)];
759
759
  }
760
760
  [Symbol.iterator]() {
761
761
  return this.entries();
@@ -764,32 +764,32 @@ var He = class {
764
764
  return Object.keys(this.obj).length;
765
765
  }
766
766
  *values() {
767
- for (let e of Object.values(this.obj)) yield j(this._field, e, this.check);
767
+ for (let e of Object.values(this.obj)) yield Ge(this._field, e, this.check);
768
768
  }
769
769
  forEach(e, t) {
770
770
  for (let n of this.entries()) e.call(t, n[1], n[0], this);
771
771
  }
772
772
  };
773
- function O(e, t) {
774
- return _(t) ? pe(t.message) && !e.oneof && e.fieldKind == "message" ? t.message.value : t.desc.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" ? Je(t.message) : t.message : t;
773
+ function A(e, t) {
774
+ return b(t) ? ue(t.message) && !e.oneof && e.fieldKind == "message" ? t.message.value : t.desc.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" ? Je(t.message) : t.message : t;
775
775
  }
776
- function k(e, t, n) {
777
- return t !== void 0 && (me(e.message) && !e.oneof && e.fieldKind == "message" ? t = {
776
+ function j(e, t, n) {
777
+ return t !== void 0 && (de(e.message) && !e.oneof && e.fieldKind == "message" ? t = {
778
778
  $typeName: e.message.typeName,
779
779
  value: N(e.message.fields[0], t)
780
- } : e.message.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" && h(t) && (t = qe(t))), new Ve(e.message, t, n);
780
+ } : e.message.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" && v(t) && (t = qe(t))), new ze(e.message, t, n);
781
781
  }
782
- function We(e, t) {
783
- return e.listKind == "message" ? O(e, t) : P(e, t);
782
+ function He(e, t) {
783
+ return e.listKind == "message" ? A(e, t) : P(e, t);
784
784
  }
785
- function A(e, t, n) {
786
- return e.listKind == "message" ? k(e, t, n) : N(e, t);
785
+ function Ue(e, t, n) {
786
+ return e.listKind == "message" ? j(e, t, n) : N(e, t);
787
787
  }
788
- function Ge(e, t) {
789
- return e.mapKind == "message" ? O(e, t) : P(e, t);
788
+ function We(e, t) {
789
+ return e.mapKind == "message" ? A(e, t) : P(e, t);
790
790
  }
791
- function j(e, t, n) {
792
- return e.mapKind == "message" ? k(e, t, n) : t;
791
+ function Ge(e, t, n) {
792
+ return e.mapKind == "message" ? j(e, t, n) : t;
793
793
  }
794
794
  function M(e) {
795
795
  return typeof e == "string" || typeof e == "number" ? e : String(e);
@@ -815,12 +815,12 @@ function Ke(e, n) {
815
815
  case t.UINT64:
816
816
  case t.FIXED64:
817
817
  try {
818
- return d.uParse(e);
818
+ return f.uParse(e);
819
819
  } catch {}
820
820
  break;
821
821
  default:
822
822
  try {
823
- return d.parse(e);
823
+ return f.parse(e);
824
824
  } catch {}
825
825
  break;
826
826
  }
@@ -831,11 +831,11 @@ function N(e, n) {
831
831
  case t.INT64:
832
832
  case t.SFIXED64:
833
833
  case t.SINT64:
834
- "longAsString" in e && e.longAsString && typeof n == "string" && (n = d.parse(n));
834
+ "longAsString" in e && e.longAsString && typeof n == "string" && (n = f.parse(n));
835
835
  break;
836
836
  case t.FIXED64:
837
837
  case t.UINT64:
838
- "longAsString" in e && e.longAsString && typeof n == "string" && (n = d.uParse(n));
838
+ "longAsString" in e && e.longAsString && typeof n == "string" && (n = f.uParse(n));
839
839
  break;
840
840
  }
841
841
  return n;
@@ -845,11 +845,11 @@ function P(e, n) {
845
845
  case t.INT64:
846
846
  case t.SFIXED64:
847
847
  case t.SINT64:
848
- "longAsString" in e && e.longAsString ? n = String(n) : (typeof n == "string" || typeof n == "number") && (n = d.parse(n));
848
+ "longAsString" in e && e.longAsString ? n = String(n) : (typeof n == "string" || typeof n == "number") && (n = f.parse(n));
849
849
  break;
850
850
  case t.FIXED64:
851
851
  case t.UINT64:
852
- "longAsString" in e && e.longAsString ? n = String(n) : (typeof n == "string" || typeof n == "number") && (n = d.uParse(n));
852
+ "longAsString" in e && e.longAsString ? n = String(n) : (typeof n == "string" || typeof n == "number") && (n = f.uParse(n));
853
853
  break;
854
854
  }
855
855
  return n;
@@ -859,7 +859,7 @@ function qe(e) {
859
859
  $typeName: "google.protobuf.Struct",
860
860
  fields: {}
861
861
  };
862
- if (h(e)) for (let [n, r] of Object.entries(e)) t.fields[n] = Xe(r);
862
+ if (v(e)) for (let [n, r] of Object.entries(e)) t.fields[n] = Xe(r);
863
863
  return t;
864
864
  }
865
865
  function Je(e) {
@@ -998,7 +998,7 @@ function L(e) {
998
998
  }
999
999
  return n.join("");
1000
1000
  }
1001
- var tt = new Set([
1001
+ var tt = /* @__PURE__ */ new Set([
1002
1002
  "constructor",
1003
1003
  "toString",
1004
1004
  "toJSON",
@@ -1010,7 +1010,7 @@ function R(e) {
1010
1010
  //#endregion
1011
1011
  //#region node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js
1012
1012
  function z(e) {
1013
- for (let t of e.field) m(t, "jsonName") || (t.jsonName = L(t.name));
1013
+ for (let t of e.field) _(t, "jsonName") || (t.jsonName = L(t.name));
1014
1014
  e.nestedType.forEach(z);
1015
1015
  }
1016
1016
  //#endregion
@@ -1030,9 +1030,9 @@ function rt(e, n) {
1030
1030
  }
1031
1031
  case t.INT64:
1032
1032
  case t.SFIXED64:
1033
- case t.SINT64: return d.parse(n);
1033
+ case t.SINT64: return f.parse(n);
1034
1034
  case t.UINT64:
1035
- case t.FIXED64: return d.uParse(n);
1035
+ case t.FIXED64: return f.uParse(n);
1036
1036
  case t.DOUBLE:
1037
1037
  case t.FLOAT: switch (n) {
1038
1038
  case "inf": return Infinity;
@@ -1115,14 +1115,14 @@ function it(e) {
1115
1115
  if (r === !1) return !1;
1116
1116
  let i = parseInt(e + r, 16);
1117
1117
  if (Number.isNaN(i)) return !1;
1118
- let a = new Uint8Array(4);
1118
+ let a = /* @__PURE__ */ new Uint8Array(4);
1119
1119
  new DataView(a.buffer).setInt32(0, i, !0), t.push(a[0], a[1], a[2], a[3]);
1120
1120
  break;
1121
1121
  }
1122
1122
  case "U": {
1123
1123
  let e = n.c, r = n.take(8);
1124
1124
  if (r === !1) return !1;
1125
- let i = d.uEnc(e + r), a = new Uint8Array(8), o = new DataView(a.buffer);
1125
+ let i = f.uEnc(e + r), a = /* @__PURE__ */ new Uint8Array(8), o = new DataView(a.buffer);
1126
1126
  o.setInt32(0, i.lo, !0), o.setInt32(4, i.hi, !0), t.push(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]);
1127
1127
  break;
1128
1128
  }
@@ -1268,9 +1268,9 @@ function St(e, t) {
1268
1268
  kind: "file",
1269
1269
  proto: e,
1270
1270
  deprecated: e.options?.deprecated ?? !1,
1271
- edition: Ot(e),
1271
+ edition: kt(e),
1272
1272
  name: e.name.replace(/\.proto$/, ""),
1273
- dependencies: kt(e, t),
1273
+ dependencies: At(e, t),
1274
1274
  enums: [],
1275
1275
  messages: [],
1276
1276
  extensions: [],
@@ -1283,7 +1283,7 @@ function St(e, t) {
1283
1283
  return r.get(e);
1284
1284
  },
1285
1285
  add(e) {
1286
- X(e.proto.options?.mapEntry === !0), r.set(e.typeName, e);
1286
+ Y(e.proto.options?.mapEntry === !0), r.set(e.typeName, e);
1287
1287
  }
1288
1288
  };
1289
1289
  for (let r of e.enumType) Ct(r, n, void 0, t);
@@ -1298,13 +1298,13 @@ function W(e, t) {
1298
1298
  switch (e.kind) {
1299
1299
  case "file":
1300
1300
  for (let n of e.proto.extension) {
1301
- let r = K(n, e, t);
1301
+ let r = Ot(n, e, t);
1302
1302
  e.extensions.push(r), t.add(r);
1303
1303
  }
1304
1304
  break;
1305
1305
  case "message":
1306
1306
  for (let n of e.proto.extension) {
1307
- let r = K(n, e, t);
1307
+ let r = Ot(n, e, t);
1308
1308
  e.nestedExtensions.push(r), t.add(r);
1309
1309
  }
1310
1310
  for (let n of e.nestedMessages) W(n, t);
@@ -1314,14 +1314,14 @@ function W(e, t) {
1314
1314
  function G(e, t, n) {
1315
1315
  let r = e.proto.oneofDecl.map((t) => Dt(t, e)), i = /* @__PURE__ */ new Set();
1316
1316
  for (let a of e.proto.field) {
1317
- let o = Mt(a, r), s = K(a, e, t, o, n);
1317
+ let o = Nt(a, r), s = Ot(a, e, t, o, n);
1318
1318
  e.fields.push(s), e.field[s.localName] = s, o === void 0 ? e.members.push(s) : (o.fields.push(s), i.has(o) || (i.add(o), e.members.push(o)));
1319
1319
  }
1320
1320
  for (let t of r.filter((e) => i.has(e))) e.oneofs.push(t);
1321
1321
  for (let r of e.nestedMessages) G(r, t, n);
1322
1322
  }
1323
1323
  function Ct(e, t, n, r) {
1324
- let i = At(e.name, e.value), a = {
1324
+ let i = jt(e.name, e.value), a = {
1325
1325
  kind: "enum",
1326
1326
  proto: e,
1327
1327
  deprecated: e.options?.deprecated ?? !1,
@@ -1329,7 +1329,7 @@ function Ct(e, t, n, r) {
1329
1329
  parent: n,
1330
1330
  open: !0,
1331
1331
  name: e.name,
1332
- typeName: q(e, n, t),
1332
+ typeName: K(e, n, t),
1333
1333
  value: {},
1334
1334
  values: [],
1335
1335
  sharedPrefix: i,
@@ -1337,7 +1337,7 @@ function Ct(e, t, n, r) {
1337
1337
  return `enum ${this.typeName}`;
1338
1338
  }
1339
1339
  };
1340
- a.open = It(a), r.add(a);
1340
+ a.open = Lt(a), r.add(a);
1341
1341
  for (let t of e.value) {
1342
1342
  let e = t.name;
1343
1343
  a.values.push(a.value[t.number] = {
@@ -1363,7 +1363,7 @@ function wt(e, t, n, r, i) {
1363
1363
  file: t,
1364
1364
  parent: n,
1365
1365
  name: e.name,
1366
- typeName: q(e, n, t),
1366
+ typeName: K(e, n, t),
1367
1367
  fields: [],
1368
1368
  field: {},
1369
1369
  oneofs: [],
@@ -1386,7 +1386,7 @@ function Tt(e, t, n) {
1386
1386
  deprecated: e.options?.deprecated ?? !1,
1387
1387
  file: t,
1388
1388
  name: e.name,
1389
- typeName: q(e, void 0, t),
1389
+ typeName: K(e, void 0, t),
1390
1390
  methods: [],
1391
1391
  method: {},
1392
1392
  toString() {
@@ -1402,8 +1402,8 @@ function Tt(e, t, n) {
1402
1402
  function Et(e, t, n) {
1403
1403
  let r;
1404
1404
  r = e.clientStreaming && e.serverStreaming ? "bidi_streaming" : e.clientStreaming ? "client_streaming" : e.serverStreaming ? "server_streaming" : "unary";
1405
- let i = n.getMessage(J(e.inputType)), a = n.getMessage(J(e.outputType));
1406
- X(i, `invalid MethodDescriptorProto: input_type ${e.inputType} not found`), X(a, `invalid MethodDescriptorProto: output_type ${e.inputType} not found`);
1405
+ let i = n.getMessage(q(e.inputType)), a = n.getMessage(q(e.outputType));
1406
+ Y(i, `invalid MethodDescriptorProto: input_type ${e.inputType} not found`), Y(a, `invalid MethodDescriptorProto: output_type ${e.inputType} not found`);
1407
1407
  let o = e.name;
1408
1408
  return {
1409
1409
  kind: "rpc",
@@ -1435,7 +1435,7 @@ function Dt(e, t) {
1435
1435
  }
1436
1436
  };
1437
1437
  }
1438
- function K(e, t, n, r, i) {
1438
+ function Ot(e, t, n, r, i) {
1439
1439
  let a = i === void 0, o = {
1440
1440
  kind: "field",
1441
1441
  proto: e,
@@ -1445,7 +1445,7 @@ function K(e, t, n, r, i) {
1445
1445
  scalar: void 0,
1446
1446
  message: void 0,
1447
1447
  enum: void 0,
1448
- presence: Nt(e, r, a, t),
1448
+ presence: Pt(e, r, a, t),
1449
1449
  listKind: void 0,
1450
1450
  mapKind: void 0,
1451
1451
  mapKey: void 0,
@@ -1455,53 +1455,53 @@ function K(e, t, n, r, i) {
1455
1455
  getDefaultValue: void 0
1456
1456
  };
1457
1457
  if (a) {
1458
- let r = t.kind == "file" ? t : t.file, i = t.kind == "file" ? void 0 : t, a = q(e, i, r);
1458
+ let r = t.kind == "file" ? t : t.file, i = t.kind == "file" ? void 0 : t, a = K(e, i, r);
1459
1459
  o.kind = "extension", o.file = r, o.parent = i, o.oneof = void 0, o.typeName = a, o.jsonName = `[${a}]`, o.toString = () => `extension ${a}`;
1460
- let s = n.getMessage(J(e.extendee));
1461
- X(s, `invalid FieldDescriptorProto: extendee ${e.extendee} not found`), o.extendee = s;
1460
+ let s = n.getMessage(q(e.extendee));
1461
+ Y(s, `invalid FieldDescriptorProto: extendee ${e.extendee} not found`), o.extendee = s;
1462
1462
  } else {
1463
1463
  let n = t;
1464
- X(n.kind == "message"), o.parent = n, o.oneof = r, o.localName = r ? L(e.name) : R(L(e.name)), o.jsonName = e.jsonName, o.toString = () => `field ${n.typeName}.${e.name}`;
1464
+ Y(n.kind == "message"), o.parent = n, o.oneof = r, o.localName = r ? L(e.name) : R(L(e.name)), o.jsonName = e.jsonName, o.toString = () => `field ${n.typeName}.${e.name}`;
1465
1465
  }
1466
1466
  let s = e.label, c = e.type, l = e.options?.jstype;
1467
1467
  if (s === U) {
1468
- let r = c == H ? i?.get(J(e.typeName)) : void 0;
1468
+ let r = c == H ? i?.get(q(e.typeName)) : void 0;
1469
1469
  if (r) {
1470
1470
  o.fieldKind = "map";
1471
- let { key: e, value: t } = Ft(r);
1471
+ let { key: e, value: t } = It(r);
1472
1472
  return o.mapKey = e.scalar, o.mapKind = t.fieldKind, o.message = t.message, o.delimitedEncoding = !1, o.enum = t.enum, o.scalar = t.scalar, o;
1473
1473
  }
1474
1474
  switch (o.fieldKind = "list", c) {
1475
1475
  case H:
1476
1476
  case V:
1477
- o.listKind = "message", o.message = n.getMessage(J(e.typeName)), X(o.message), o.delimitedEncoding = Lt(e, t);
1477
+ o.listKind = "message", o.message = n.getMessage(q(e.typeName)), Y(o.message), o.delimitedEncoding = Rt(e, t);
1478
1478
  break;
1479
1479
  case dt:
1480
- o.listKind = "enum", o.enum = n.getEnum(J(e.typeName)), X(o.enum);
1480
+ o.listKind = "enum", o.enum = n.getEnum(q(e.typeName)), Y(o.enum);
1481
1481
  break;
1482
1482
  default:
1483
1483
  o.listKind = "scalar", o.scalar = c, o.longAsString = l == pt;
1484
1484
  break;
1485
1485
  }
1486
- return o.packed = Pt(e, t), o;
1486
+ return o.packed = Ft(e, t), o;
1487
1487
  }
1488
1488
  switch (c) {
1489
1489
  case H:
1490
1490
  case V:
1491
- o.fieldKind = "message", o.message = n.getMessage(J(e.typeName)), X(o.message, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), o.delimitedEncoding = Lt(e, t), o.getDefaultValue = () => void 0;
1491
+ o.fieldKind = "message", o.message = n.getMessage(q(e.typeName)), Y(o.message, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), o.delimitedEncoding = Rt(e, t), o.getDefaultValue = () => void 0;
1492
1492
  break;
1493
1493
  case dt: {
1494
- let t = n.getEnum(J(e.typeName));
1495
- X(t !== void 0, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), o.fieldKind = "enum", o.enum = n.getEnum(J(e.typeName)), o.getDefaultValue = () => m(e, "defaultValue") ? nt(t, e.defaultValue) : void 0;
1494
+ let t = n.getEnum(q(e.typeName));
1495
+ Y(t !== void 0, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), o.fieldKind = "enum", o.enum = n.getEnum(q(e.typeName)), o.getDefaultValue = () => _(e, "defaultValue") ? nt(t, e.defaultValue) : void 0;
1496
1496
  break;
1497
1497
  }
1498
1498
  default:
1499
- o.fieldKind = "scalar", o.scalar = c, o.longAsString = l == pt, o.getDefaultValue = () => m(e, "defaultValue") ? rt(c, e.defaultValue) : void 0;
1499
+ o.fieldKind = "scalar", o.scalar = c, o.longAsString = l == pt, o.getDefaultValue = () => _(e, "defaultValue") ? rt(c, e.defaultValue) : void 0;
1500
1500
  break;
1501
1501
  }
1502
1502
  return o;
1503
1503
  }
1504
- function Ot(e) {
1504
+ function kt(e) {
1505
1505
  switch (e.syntax) {
1506
1506
  case "":
1507
1507
  case "proto2": return st;
@@ -1512,15 +1512,15 @@ function Ot(e) {
1512
1512
  default: throw Error(`${e.name}: unsupported syntax "${e.syntax}"`);
1513
1513
  }
1514
1514
  }
1515
- function kt(e, t) {
1515
+ function At(e, t) {
1516
1516
  return e.dependency.map((n) => {
1517
1517
  let r = t.getFile(n);
1518
1518
  if (!r) throw Error(`Cannot find ${n}, imported by ${e.name}`);
1519
1519
  return r;
1520
1520
  });
1521
1521
  }
1522
- function At(e, t) {
1523
- let n = jt(e) + "_";
1522
+ function jt(e, t) {
1523
+ let n = Mt(e) + "_";
1524
1524
  for (let e of t) {
1525
1525
  if (!e.name.toLowerCase().startsWith(n)) return;
1526
1526
  let t = e.name.substring(n.length);
@@ -1528,32 +1528,32 @@ function At(e, t) {
1528
1528
  }
1529
1529
  return n;
1530
1530
  }
1531
- function jt(e) {
1531
+ function Mt(e) {
1532
1532
  return (e.substring(0, 1) + e.substring(1).replace(/[A-Z]/g, (e) => "_" + e)).toLowerCase();
1533
1533
  }
1534
- function q(e, t, n) {
1534
+ function K(e, t, n) {
1535
1535
  let r;
1536
1536
  return r = t ? `${t.typeName}.${e.name}` : n.proto.package.length > 0 ? `${n.proto.package}.${e.name}` : `${e.name}`, r;
1537
1537
  }
1538
- function J(e) {
1538
+ function q(e) {
1539
1539
  return e.startsWith(".") ? e.substring(1) : e;
1540
1540
  }
1541
- function Mt(e, t) {
1542
- if (!m(e, "oneofIndex") || e.proto3Optional) return;
1541
+ function Nt(e, t) {
1542
+ if (!_(e, "oneofIndex") || e.proto3Optional) return;
1543
1543
  let n = t[e.oneofIndex];
1544
- return X(n, `invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`), n;
1544
+ return Y(n, `invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`), n;
1545
1545
  }
1546
- function Nt(e, t, n, r) {
1546
+ function Pt(e, t, n, r) {
1547
1547
  if (e.label == ft) return _t;
1548
1548
  if (e.label == U) return gt;
1549
1549
  if (t || e.proto3Optional || n) return ht;
1550
- let i = Y("fieldPresence", {
1550
+ let i = J("fieldPresence", {
1551
1551
  proto: e,
1552
1552
  parent: r
1553
1553
  });
1554
1554
  return i == gt && (e.type == H || e.type == V) ? ht : i;
1555
1555
  }
1556
- function Pt(e, t) {
1556
+ function Ft(e, t) {
1557
1557
  if (e.label != U) return !1;
1558
1558
  switch (e.type) {
1559
1559
  case lt:
@@ -1562,54 +1562,54 @@ function Pt(e, t) {
1562
1562
  case H: return !1;
1563
1563
  }
1564
1564
  let n = e.options;
1565
- return n && m(n, "packed") ? n.packed : vt == Y("repeatedFieldEncoding", {
1565
+ return n && _(n, "packed") ? n.packed : vt == J("repeatedFieldEncoding", {
1566
1566
  proto: e,
1567
1567
  parent: t
1568
1568
  });
1569
1569
  }
1570
- function Ft(e) {
1570
+ function It(e) {
1571
1571
  let n = e.fields.find((e) => e.number === 1), r = e.fields.find((e) => e.number === 2);
1572
- return X(n && n.fieldKind == "scalar" && n.scalar != t.BYTES && n.scalar != t.FLOAT && n.scalar != t.DOUBLE && r && r.fieldKind != "list" && r.fieldKind != "map"), {
1572
+ return Y(n && n.fieldKind == "scalar" && n.scalar != t.BYTES && n.scalar != t.FLOAT && n.scalar != t.DOUBLE && r && r.fieldKind != "list" && r.fieldKind != "map"), {
1573
1573
  key: n,
1574
1574
  value: r
1575
1575
  };
1576
1576
  }
1577
- function It(e) {
1578
- return bt == Y("enumType", {
1577
+ function Lt(e) {
1578
+ return bt == J("enumType", {
1579
1579
  proto: e.proto,
1580
1580
  parent: e.parent ?? e.file
1581
1581
  });
1582
1582
  }
1583
- function Lt(e, t) {
1584
- return e.type == V ? !0 : yt == Y("messageEncoding", {
1583
+ function Rt(e, t) {
1584
+ return e.type == V ? !0 : yt == J("messageEncoding", {
1585
1585
  proto: e,
1586
1586
  parent: t
1587
1587
  });
1588
1588
  }
1589
- function Y(e, t) {
1589
+ function J(e, t) {
1590
1590
  let n = t.proto.options?.features;
1591
1591
  if (n) {
1592
1592
  let t = n[e];
1593
1593
  if (t != 0) return t;
1594
1594
  }
1595
1595
  if ("kind" in t) {
1596
- if (t.kind == "message") return Y(e, t.parent ?? t.file);
1596
+ if (t.kind == "message") return J(e, t.parent ?? t.file);
1597
1597
  let n = xt[t.edition];
1598
1598
  if (!n) throw Error(`feature default for edition ${t.edition} not found`);
1599
1599
  return n[e];
1600
1600
  }
1601
- return Y(e, t.parent);
1601
+ return J(e, t.parent);
1602
1602
  }
1603
- function X(e, t) {
1603
+ function Y(e, t) {
1604
1604
  if (!e) throw Error(t);
1605
1605
  }
1606
1606
  //#endregion
1607
1607
  //#region node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js
1608
- function Rt(e) {
1609
- let t = zt(e);
1608
+ function zt(e) {
1609
+ let t = Bt(e);
1610
1610
  return t.messageType.forEach(z), at(t, () => void 0).getFile(t.name);
1611
1611
  }
1612
- function zt(e) {
1612
+ function Bt(e) {
1613
1613
  return Object.assign(Object.create({
1614
1614
  syntax: "",
1615
1615
  edition: 0
@@ -1622,25 +1622,25 @@ function zt(e) {
1622
1622
  service: [],
1623
1623
  extension: []
1624
1624
  }, e), {
1625
- messageType: e.messageType.map(Bt),
1626
- enumType: e.enumType.map(Ut)
1625
+ messageType: e.messageType.map(Vt),
1626
+ enumType: e.enumType.map(Wt)
1627
1627
  }));
1628
1628
  }
1629
- function Bt(e) {
1629
+ function Vt(e) {
1630
1630
  return Object.assign(Object.create({ visibility: 0 }), {
1631
1631
  $typeName: "google.protobuf.DescriptorProto",
1632
1632
  name: e.name,
1633
- field: e.field?.map(Vt) ?? [],
1633
+ field: e.field?.map(Ht) ?? [],
1634
1634
  extension: [],
1635
- nestedType: e.nestedType?.map(Bt) ?? [],
1636
- enumType: e.enumType?.map(Ut) ?? [],
1635
+ nestedType: e.nestedType?.map(Vt) ?? [],
1636
+ enumType: e.enumType?.map(Wt) ?? [],
1637
1637
  extensionRange: e.extensionRange?.map((e) => Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e)) ?? [],
1638
1638
  oneofDecl: [],
1639
1639
  reservedRange: [],
1640
1640
  reservedName: []
1641
1641
  });
1642
1642
  }
1643
- function Vt(e) {
1643
+ function Ht(e) {
1644
1644
  return Object.assign(Object.create({
1645
1645
  label: 1,
1646
1646
  typeName: "",
@@ -1649,9 +1649,9 @@ function Vt(e) {
1649
1649
  oneofIndex: 0,
1650
1650
  jsonName: "",
1651
1651
  proto3Optional: !1
1652
- }), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, e), { options: e.options ? Ht(e.options) : void 0 }));
1652
+ }), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, e), { options: e.options ? Ut(e.options) : void 0 }));
1653
1653
  }
1654
- function Ht(e) {
1654
+ function Ut(e) {
1655
1655
  return Object.assign(Object.create({
1656
1656
  ctype: 0,
1657
1657
  packed: !1,
@@ -1668,7 +1668,7 @@ function Ht(e) {
1668
1668
  uninterpretedOption: []
1669
1669
  }));
1670
1670
  }
1671
- function Ut(e) {
1671
+ function Wt(e) {
1672
1672
  return Object.assign(Object.create({ visibility: 0 }), {
1673
1673
  $typeName: "google.protobuf.EnumDescriptorProto",
1674
1674
  name: e.name,
@@ -1679,10 +1679,10 @@ function Ut(e) {
1679
1679
  }
1680
1680
  //#endregion
1681
1681
  //#region node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js
1682
- function Z(e, t, ...n) {
1682
+ function X(e, t, ...n) {
1683
1683
  return n.reduce((e, t) => e.nestedMessages[t], e.messages[t]);
1684
1684
  }
1685
- var Wt = /* @__PURE__ */ Z(/* @__PURE__ */ Rt({
1685
+ var Gt = /*@__PURE__*/ X(/* @__PURE__ */ zt({
1686
1686
  name: "google/protobuf/descriptor.proto",
1687
1687
  package: "google.protobuf",
1688
1688
  messageType: [
@@ -3635,99 +3635,99 @@ var Wt = /* @__PURE__ */ Z(/* @__PURE__ */ Rt({
3635
3635
  }
3636
3636
  ]
3637
3637
  }]
3638
- }), 1), Gt;
3638
+ }), 1), Kt;
3639
3639
  (function(e) {
3640
3640
  e[e.DECLARATION = 0] = "DECLARATION", e[e.UNVERIFIED = 1] = "UNVERIFIED";
3641
- })(Gt ||= {});
3642
- var Kt;
3643
- (function(e) {
3644
- e[e.DOUBLE = 1] = "DOUBLE", e[e.FLOAT = 2] = "FLOAT", e[e.INT64 = 3] = "INT64", e[e.UINT64 = 4] = "UINT64", e[e.INT32 = 5] = "INT32", e[e.FIXED64 = 6] = "FIXED64", e[e.FIXED32 = 7] = "FIXED32", e[e.BOOL = 8] = "BOOL", e[e.STRING = 9] = "STRING", e[e.GROUP = 10] = "GROUP", e[e.MESSAGE = 11] = "MESSAGE", e[e.BYTES = 12] = "BYTES", e[e.UINT32 = 13] = "UINT32", e[e.ENUM = 14] = "ENUM", e[e.SFIXED32 = 15] = "SFIXED32", e[e.SFIXED64 = 16] = "SFIXED64", e[e.SINT32 = 17] = "SINT32", e[e.SINT64 = 18] = "SINT64";
3645
3641
  })(Kt ||= {});
3646
3642
  var qt;
3647
3643
  (function(e) {
3648
- e[e.OPTIONAL = 1] = "OPTIONAL", e[e.REPEATED = 3] = "REPEATED", e[e.REQUIRED = 2] = "REQUIRED";
3644
+ e[e.DOUBLE = 1] = "DOUBLE", e[e.FLOAT = 2] = "FLOAT", e[e.INT64 = 3] = "INT64", e[e.UINT64 = 4] = "UINT64", e[e.INT32 = 5] = "INT32", e[e.FIXED64 = 6] = "FIXED64", e[e.FIXED32 = 7] = "FIXED32", e[e.BOOL = 8] = "BOOL", e[e.STRING = 9] = "STRING", e[e.GROUP = 10] = "GROUP", e[e.MESSAGE = 11] = "MESSAGE", e[e.BYTES = 12] = "BYTES", e[e.UINT32 = 13] = "UINT32", e[e.ENUM = 14] = "ENUM", e[e.SFIXED32 = 15] = "SFIXED32", e[e.SFIXED64 = 16] = "SFIXED64", e[e.SINT32 = 17] = "SINT32", e[e.SINT64 = 18] = "SINT64";
3649
3645
  })(qt ||= {});
3650
3646
  var Jt;
3651
3647
  (function(e) {
3652
- e[e.SPEED = 1] = "SPEED", e[e.CODE_SIZE = 2] = "CODE_SIZE", e[e.LITE_RUNTIME = 3] = "LITE_RUNTIME";
3648
+ e[e.OPTIONAL = 1] = "OPTIONAL", e[e.REPEATED = 3] = "REPEATED", e[e.REQUIRED = 2] = "REQUIRED";
3653
3649
  })(Jt ||= {});
3654
3650
  var Yt;
3655
3651
  (function(e) {
3656
- e[e.STRING = 0] = "STRING", e[e.CORD = 1] = "CORD", e[e.STRING_PIECE = 2] = "STRING_PIECE";
3652
+ e[e.SPEED = 1] = "SPEED", e[e.CODE_SIZE = 2] = "CODE_SIZE", e[e.LITE_RUNTIME = 3] = "LITE_RUNTIME";
3657
3653
  })(Yt ||= {});
3658
3654
  var Xt;
3659
3655
  (function(e) {
3660
- e[e.JS_NORMAL = 0] = "JS_NORMAL", e[e.JS_STRING = 1] = "JS_STRING", e[e.JS_NUMBER = 2] = "JS_NUMBER";
3656
+ e[e.STRING = 0] = "STRING", e[e.CORD = 1] = "CORD", e[e.STRING_PIECE = 2] = "STRING_PIECE";
3661
3657
  })(Xt ||= {});
3662
3658
  var Zt;
3663
3659
  (function(e) {
3664
- e[e.RETENTION_UNKNOWN = 0] = "RETENTION_UNKNOWN", e[e.RETENTION_RUNTIME = 1] = "RETENTION_RUNTIME", e[e.RETENTION_SOURCE = 2] = "RETENTION_SOURCE";
3660
+ e[e.JS_NORMAL = 0] = "JS_NORMAL", e[e.JS_STRING = 1] = "JS_STRING", e[e.JS_NUMBER = 2] = "JS_NUMBER";
3665
3661
  })(Zt ||= {});
3666
3662
  var Qt;
3667
3663
  (function(e) {
3668
- e[e.TARGET_TYPE_UNKNOWN = 0] = "TARGET_TYPE_UNKNOWN", e[e.TARGET_TYPE_FILE = 1] = "TARGET_TYPE_FILE", e[e.TARGET_TYPE_EXTENSION_RANGE = 2] = "TARGET_TYPE_EXTENSION_RANGE", e[e.TARGET_TYPE_MESSAGE = 3] = "TARGET_TYPE_MESSAGE", e[e.TARGET_TYPE_FIELD = 4] = "TARGET_TYPE_FIELD", e[e.TARGET_TYPE_ONEOF = 5] = "TARGET_TYPE_ONEOF", e[e.TARGET_TYPE_ENUM = 6] = "TARGET_TYPE_ENUM", e[e.TARGET_TYPE_ENUM_ENTRY = 7] = "TARGET_TYPE_ENUM_ENTRY", e[e.TARGET_TYPE_SERVICE = 8] = "TARGET_TYPE_SERVICE", e[e.TARGET_TYPE_METHOD = 9] = "TARGET_TYPE_METHOD";
3664
+ e[e.RETENTION_UNKNOWN = 0] = "RETENTION_UNKNOWN", e[e.RETENTION_RUNTIME = 1] = "RETENTION_RUNTIME", e[e.RETENTION_SOURCE = 2] = "RETENTION_SOURCE";
3669
3665
  })(Qt ||= {});
3670
3666
  var $t;
3671
3667
  (function(e) {
3672
- e[e.IDEMPOTENCY_UNKNOWN = 0] = "IDEMPOTENCY_UNKNOWN", e[e.NO_SIDE_EFFECTS = 1] = "NO_SIDE_EFFECTS", e[e.IDEMPOTENT = 2] = "IDEMPOTENT";
3668
+ e[e.TARGET_TYPE_UNKNOWN = 0] = "TARGET_TYPE_UNKNOWN", e[e.TARGET_TYPE_FILE = 1] = "TARGET_TYPE_FILE", e[e.TARGET_TYPE_EXTENSION_RANGE = 2] = "TARGET_TYPE_EXTENSION_RANGE", e[e.TARGET_TYPE_MESSAGE = 3] = "TARGET_TYPE_MESSAGE", e[e.TARGET_TYPE_FIELD = 4] = "TARGET_TYPE_FIELD", e[e.TARGET_TYPE_ONEOF = 5] = "TARGET_TYPE_ONEOF", e[e.TARGET_TYPE_ENUM = 6] = "TARGET_TYPE_ENUM", e[e.TARGET_TYPE_ENUM_ENTRY = 7] = "TARGET_TYPE_ENUM_ENTRY", e[e.TARGET_TYPE_SERVICE = 8] = "TARGET_TYPE_SERVICE", e[e.TARGET_TYPE_METHOD = 9] = "TARGET_TYPE_METHOD";
3673
3669
  })($t ||= {});
3674
3670
  var en;
3675
3671
  (function(e) {
3676
- e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", e[e.EXPORT_ALL = 1] = "EXPORT_ALL", e[e.EXPORT_TOP_LEVEL = 2] = "EXPORT_TOP_LEVEL", e[e.LOCAL_ALL = 3] = "LOCAL_ALL", e[e.STRICT = 4] = "STRICT";
3672
+ e[e.IDEMPOTENCY_UNKNOWN = 0] = "IDEMPOTENCY_UNKNOWN", e[e.NO_SIDE_EFFECTS = 1] = "NO_SIDE_EFFECTS", e[e.IDEMPOTENT = 2] = "IDEMPOTENT";
3677
3673
  })(en ||= {});
3678
3674
  var tn;
3679
3675
  (function(e) {
3680
- e[e.FIELD_PRESENCE_UNKNOWN = 0] = "FIELD_PRESENCE_UNKNOWN", e[e.EXPLICIT = 1] = "EXPLICIT", e[e.IMPLICIT = 2] = "IMPLICIT", e[e.LEGACY_REQUIRED = 3] = "LEGACY_REQUIRED";
3676
+ e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", e[e.EXPORT_ALL = 1] = "EXPORT_ALL", e[e.EXPORT_TOP_LEVEL = 2] = "EXPORT_TOP_LEVEL", e[e.LOCAL_ALL = 3] = "LOCAL_ALL", e[e.STRICT = 4] = "STRICT";
3681
3677
  })(tn ||= {});
3682
3678
  var nn;
3683
3679
  (function(e) {
3684
- e[e.ENUM_TYPE_UNKNOWN = 0] = "ENUM_TYPE_UNKNOWN", e[e.OPEN = 1] = "OPEN", e[e.CLOSED = 2] = "CLOSED";
3680
+ e[e.FIELD_PRESENCE_UNKNOWN = 0] = "FIELD_PRESENCE_UNKNOWN", e[e.EXPLICIT = 1] = "EXPLICIT", e[e.IMPLICIT = 2] = "IMPLICIT", e[e.LEGACY_REQUIRED = 3] = "LEGACY_REQUIRED";
3685
3681
  })(nn ||= {});
3686
3682
  var rn;
3687
3683
  (function(e) {
3688
- e[e.REPEATED_FIELD_ENCODING_UNKNOWN = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN", e[e.PACKED = 1] = "PACKED", e[e.EXPANDED = 2] = "EXPANDED";
3684
+ e[e.ENUM_TYPE_UNKNOWN = 0] = "ENUM_TYPE_UNKNOWN", e[e.OPEN = 1] = "OPEN", e[e.CLOSED = 2] = "CLOSED";
3689
3685
  })(rn ||= {});
3690
3686
  var an;
3691
3687
  (function(e) {
3692
- e[e.UTF8_VALIDATION_UNKNOWN = 0] = "UTF8_VALIDATION_UNKNOWN", e[e.VERIFY = 2] = "VERIFY", e[e.NONE = 3] = "NONE";
3688
+ e[e.REPEATED_FIELD_ENCODING_UNKNOWN = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN", e[e.PACKED = 1] = "PACKED", e[e.EXPANDED = 2] = "EXPANDED";
3693
3689
  })(an ||= {});
3694
3690
  var on;
3695
3691
  (function(e) {
3696
- e[e.MESSAGE_ENCODING_UNKNOWN = 0] = "MESSAGE_ENCODING_UNKNOWN", e[e.LENGTH_PREFIXED = 1] = "LENGTH_PREFIXED", e[e.DELIMITED = 2] = "DELIMITED";
3692
+ e[e.UTF8_VALIDATION_UNKNOWN = 0] = "UTF8_VALIDATION_UNKNOWN", e[e.VERIFY = 2] = "VERIFY", e[e.NONE = 3] = "NONE";
3697
3693
  })(on ||= {});
3698
3694
  var sn;
3699
3695
  (function(e) {
3700
- e[e.JSON_FORMAT_UNKNOWN = 0] = "JSON_FORMAT_UNKNOWN", e[e.ALLOW = 1] = "ALLOW", e[e.LEGACY_BEST_EFFORT = 2] = "LEGACY_BEST_EFFORT";
3696
+ e[e.MESSAGE_ENCODING_UNKNOWN = 0] = "MESSAGE_ENCODING_UNKNOWN", e[e.LENGTH_PREFIXED = 1] = "LENGTH_PREFIXED", e[e.DELIMITED = 2] = "DELIMITED";
3701
3697
  })(sn ||= {});
3702
3698
  var cn;
3703
3699
  (function(e) {
3704
- e[e.ENFORCE_NAMING_STYLE_UNKNOWN = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN", e[e.STYLE2024 = 1] = "STYLE2024", e[e.STYLE_LEGACY = 2] = "STYLE_LEGACY";
3700
+ e[e.JSON_FORMAT_UNKNOWN = 0] = "JSON_FORMAT_UNKNOWN", e[e.ALLOW = 1] = "ALLOW", e[e.LEGACY_BEST_EFFORT = 2] = "LEGACY_BEST_EFFORT";
3705
3701
  })(cn ||= {});
3706
3702
  var ln;
3707
3703
  (function(e) {
3708
- e[e.NONE = 0] = "NONE", e[e.SET = 1] = "SET", e[e.ALIAS = 2] = "ALIAS";
3704
+ e[e.ENFORCE_NAMING_STYLE_UNKNOWN = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN", e[e.STYLE2024 = 1] = "STYLE2024", e[e.STYLE_LEGACY = 2] = "STYLE_LEGACY";
3709
3705
  })(ln ||= {});
3710
3706
  var un;
3711
3707
  (function(e) {
3712
- e[e.EDITION_UNKNOWN = 0] = "EDITION_UNKNOWN", e[e.EDITION_LEGACY = 900] = "EDITION_LEGACY", e[e.EDITION_PROTO2 = 998] = "EDITION_PROTO2", e[e.EDITION_PROTO3 = 999] = "EDITION_PROTO3", e[e.EDITION_2023 = 1e3] = "EDITION_2023", e[e.EDITION_2024 = 1001] = "EDITION_2024", e[e.EDITION_UNSTABLE = 9999] = "EDITION_UNSTABLE", e[e.EDITION_1_TEST_ONLY = 1] = "EDITION_1_TEST_ONLY", e[e.EDITION_2_TEST_ONLY = 2] = "EDITION_2_TEST_ONLY", e[e.EDITION_99997_TEST_ONLY = 99997] = "EDITION_99997_TEST_ONLY", e[e.EDITION_99998_TEST_ONLY = 99998] = "EDITION_99998_TEST_ONLY", e[e.EDITION_99999_TEST_ONLY = 99999] = "EDITION_99999_TEST_ONLY", e[e.EDITION_MAX = 2147483647] = "EDITION_MAX";
3708
+ e[e.NONE = 0] = "NONE", e[e.SET = 1] = "SET", e[e.ALIAS = 2] = "ALIAS";
3713
3709
  })(un ||= {});
3714
3710
  var dn;
3715
3711
  (function(e) {
3716
- e[e.VISIBILITY_UNSET = 0] = "VISIBILITY_UNSET", e[e.VISIBILITY_LOCAL = 1] = "VISIBILITY_LOCAL", e[e.VISIBILITY_EXPORT = 2] = "VISIBILITY_EXPORT";
3712
+ e[e.EDITION_UNKNOWN = 0] = "EDITION_UNKNOWN", e[e.EDITION_LEGACY = 900] = "EDITION_LEGACY", e[e.EDITION_PROTO2 = 998] = "EDITION_PROTO2", e[e.EDITION_PROTO3 = 999] = "EDITION_PROTO3", e[e.EDITION_2023 = 1e3] = "EDITION_2023", e[e.EDITION_2024 = 1001] = "EDITION_2024", e[e.EDITION_UNSTABLE = 9999] = "EDITION_UNSTABLE", e[e.EDITION_1_TEST_ONLY = 1] = "EDITION_1_TEST_ONLY", e[e.EDITION_2_TEST_ONLY = 2] = "EDITION_2_TEST_ONLY", e[e.EDITION_99997_TEST_ONLY = 99997] = "EDITION_99997_TEST_ONLY", e[e.EDITION_99998_TEST_ONLY = 99998] = "EDITION_99998_TEST_ONLY", e[e.EDITION_99999_TEST_ONLY = 99999] = "EDITION_99999_TEST_ONLY", e[e.EDITION_MAX = 2147483647] = "EDITION_MAX";
3717
3713
  })(dn ||= {});
3714
+ var fn;
3715
+ (function(e) {
3716
+ e[e.VISIBILITY_UNSET = 0] = "VISIBILITY_UNSET", e[e.VISIBILITY_LOCAL = 1] = "VISIBILITY_LOCAL", e[e.VISIBILITY_EXPORT = 2] = "VISIBILITY_EXPORT";
3717
+ })(fn ||= {});
3718
3718
  //#endregion
3719
3719
  //#region node_modules/@bufbuild/protobuf/dist/esm/from-binary.js
3720
- var fn = { readUnknownFields: !0 };
3721
- function pn(e) {
3722
- return e ? Object.assign(Object.assign({}, fn), e) : fn;
3720
+ var pn = { readUnknownFields: !0 };
3721
+ function mn(e) {
3722
+ return e ? Object.assign(Object.assign({}, pn), e) : pn;
3723
3723
  }
3724
- function Q(e, t, n) {
3725
- let r = E(e, void 0, !1);
3726
- return mn(r, new Ae(t), pn(n), !1, t.byteLength), r.message;
3724
+ function Z(e, t, n) {
3725
+ let r = Le(e, void 0, !1);
3726
+ return hn(r, new De(t), mn(n), !1, t.byteLength), r.message;
3727
3727
  }
3728
- function mn(e, t, n, r, i) {
3728
+ function hn(e, t, n, r, i) {
3729
3729
  let a = r ? t.len : t.pos + i, o, s, c = e.getUnknown() ?? [];
3730
- for (; t.pos < a && ([o, s] = t.tag(), !(r && s == C.EndGroup));) {
3730
+ for (; t.pos < a && ([o, s] = t.tag(), !(r && s == E.EndGroup));) {
3731
3731
  let r = e.findNumber(o);
3732
3732
  if (!r) {
3733
3733
  let e = t.skip(s, o);
@@ -3738,23 +3738,23 @@ function mn(e, t, n, r, i) {
3738
3738
  });
3739
3739
  continue;
3740
3740
  }
3741
- hn(e, t, r, s, n);
3741
+ gn(e, t, r, s, n);
3742
3742
  }
3743
- if (r && (s != C.EndGroup || o !== i)) throw Error("invalid end group tag");
3743
+ if (r && (s != E.EndGroup || o !== i)) throw Error("invalid end group tag");
3744
3744
  c.length > 0 && e.setUnknown(c);
3745
3745
  }
3746
- function hn(e, n, r, i, a) {
3746
+ function gn(e, n, r, i, a) {
3747
3747
  switch (r.fieldKind) {
3748
3748
  case "scalar":
3749
- e.set(r, $(n, r.scalar));
3749
+ e.set(r, Q(n, r.scalar));
3750
3750
  break;
3751
3751
  case "enum":
3752
- let o = $(n, t.INT32);
3752
+ let o = Q(n, t.INT32);
3753
3753
  if (r.enum.open) e.set(r, o);
3754
3754
  else if (r.enum.values.some((e) => e.number === o)) e.set(r, o);
3755
3755
  else if (a.readUnknownFields) {
3756
3756
  let t = [];
3757
- u(o, t);
3757
+ d(o, t);
3758
3758
  let n = e.getUnknown() ?? [];
3759
3759
  n.push({
3760
3760
  no: r.number,
@@ -3764,71 +3764,71 @@ function hn(e, n, r, i, a) {
3764
3764
  }
3765
3765
  break;
3766
3766
  case "message":
3767
- e.set(r, vn(n, a, r, e.get(r)));
3767
+ e.set(r, yn(n, a, r, e.get(r)));
3768
3768
  break;
3769
3769
  case "list":
3770
- _n(n, i, e.get(r), a);
3770
+ vn(n, i, e.get(r), a);
3771
3771
  break;
3772
3772
  case "map":
3773
- gn(n, e.get(r), a);
3773
+ _n(n, e.get(r), a);
3774
3774
  break;
3775
3775
  }
3776
3776
  }
3777
- function gn(e, t, n) {
3777
+ function _n(e, t, n) {
3778
3778
  let r = t.field(), i, a, o = e.uint32(), s = e.pos + o;
3779
3779
  for (; e.pos < s;) {
3780
3780
  let [t] = e.tag();
3781
3781
  switch (t) {
3782
3782
  case 1:
3783
- i = $(e, r.mapKey);
3783
+ i = Q(e, r.mapKey);
3784
3784
  break;
3785
3785
  case 2:
3786
3786
  switch (r.mapKind) {
3787
3787
  case "scalar":
3788
- a = $(e, r.scalar);
3788
+ a = Q(e, r.scalar);
3789
3789
  break;
3790
3790
  case "enum":
3791
3791
  a = e.int32();
3792
3792
  break;
3793
3793
  case "message":
3794
- a = vn(e, n, r);
3794
+ a = yn(e, n, r);
3795
3795
  break;
3796
3796
  }
3797
3797
  break;
3798
3798
  }
3799
3799
  }
3800
- if (i === void 0 && (i = f(r.mapKey, !1)), a === void 0) switch (r.mapKind) {
3800
+ if (i === void 0 && (i = p(r.mapKey, !1)), a === void 0) switch (r.mapKind) {
3801
3801
  case "scalar":
3802
- a = f(r.scalar, !1);
3802
+ a = p(r.scalar, !1);
3803
3803
  break;
3804
3804
  case "enum":
3805
3805
  a = r.enum.values[0].number;
3806
3806
  break;
3807
3807
  case "message":
3808
- a = E(r.message, void 0, !1);
3808
+ a = Le(r.message, void 0, !1);
3809
3809
  break;
3810
3810
  }
3811
3811
  t.set(i, a);
3812
3812
  }
3813
- function _n(e, n, r, i) {
3813
+ function vn(e, n, r, i) {
3814
3814
  let a = r.field();
3815
3815
  if (a.listKind === "message") {
3816
- r.add(vn(e, i, a));
3816
+ r.add(yn(e, i, a));
3817
3817
  return;
3818
3818
  }
3819
3819
  let o = a.scalar ?? t.INT32;
3820
- if (!(n == C.LengthDelimited && o != t.STRING && o != t.BYTES)) {
3821
- r.add($(e, o));
3820
+ if (!(n == E.LengthDelimited && o != t.STRING && o != t.BYTES)) {
3821
+ r.add(Q(e, o));
3822
3822
  return;
3823
3823
  }
3824
3824
  let s = e.uint32() + e.pos;
3825
- for (; e.pos < s;) r.add($(e, o));
3825
+ for (; e.pos < s;) r.add(Q(e, o));
3826
3826
  }
3827
- function vn(e, t, n, r) {
3828
- let i = n.delimitedEncoding, a = r ?? E(n.message, void 0, !1);
3829
- return mn(a, e, t, i, i ? n.number : e.uint32()), a;
3827
+ function yn(e, t, n, r) {
3828
+ let i = n.delimitedEncoding, a = r ?? Le(n.message, void 0, !1);
3829
+ return hn(a, e, t, i, i ? n.number : e.uint32()), a;
3830
3830
  }
3831
- function $(e, n) {
3831
+ function Q(e, n) {
3832
3832
  switch (n) {
3833
3833
  case t.STRING: return e.string();
3834
3834
  case t.BOOL: return e.bool();
@@ -3849,27 +3849,27 @@ function $(e, n) {
3849
3849
  }
3850
3850
  //#endregion
3851
3851
  //#region node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js
3852
- function yn(e, t) {
3853
- let n = Q(Wt, Ze(e));
3852
+ function bn(e, t) {
3853
+ let n = Z(Gt, Ze(e));
3854
3854
  return n.messageType.forEach(z), n.dependency = t?.map((e) => e.proto.name) ?? [], at(n, (e) => t?.find((t) => t.proto.name === e)).getFile(n.name);
3855
3855
  }
3856
3856
  //#endregion
3857
3857
  //#region node_modules/pr-player/dist/index.js
3858
- var bn = "(function(){var e=class{pendingPayloads=[];payload=new Uint8Array;chunks=[];push=e=>{this.pendingPayloads.push(e)};next=(e=0)=>{this.payload=this.payload.slice(e);let t=this.pendingPayloads.shift();if(!t)return!1;let n=new Uint8Array(this.payload.byteLength+t.byteLength);return n.set(this.payload,0),n.set(t,this.payload.byteLength),this.payload=n,new DataView(this.payload.buffer)};pushChunk=e=>{this.chunks.push(e),this.chunks.length>100&&this.chunks.shift()};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array,this.chunks=[]}};let t=(e,t)=>{let n=new Uint8Array(e),r=new Uint8Array(t),i=new Uint8Array(11+n.length+r.length),a=0;return i[a++]=1,i[a++]=n[1],i[a++]=n[2],i[a++]=n[3],i[a++]=255,i[a++]=225,i[a++]=n.length>>8&255,i[a++]=n.length&255,i.set(n,a),a+=n.length,i[a++]=1,i[a++]=r.length>>8&255,i[a++]=r.length&255,i.set(r,a),i},n=e=>{let t=0,n=new DataView(e.buffer),r=n.getUint8(t);if(t+=1,r!==1)throw Error(`Invalid AVC version`);let i=n.getUint8(t)&255;t+=1;let a=n.getUint8(t)&255;t+=1;let o=n.getUint8(t)&255;t+=1;let s=`avc1.${Array.from([i,a,o],e=>e.toString(16).padStart(2,`0`)).join(``)}`,c=(n.getUint8(t)&3)-1;t+=1;let l=n.getUint8(t)&31;t+=1;let u=n.getUint16(t,!1);t+=2;let d=new Uint8Array(n.buffer.slice(t,t+u));t+=u;let f=n.getUint8(t)&31;t+=1;let p=n.getUint16(t,!1);t+=2;let m=new Uint8Array(n.buffer.slice(t,t+p));return t+=p,{version:r,codec:s,profile:i,compatibility:a,level:o,lengthSizeMinusOne:c,numOfSequenceParameterSets:l,sequenceParameterSetLength:u,sps:d,numOfPictureParameterSets:f,pictureParameterSetLength:p,pps:m}},r=e=>{let t=new Uint8Array(4+e.length);return new DataView(t.buffer).setUint32(0,e.length,!1),t.set(e,4),t},i=e=>{let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e){let e=t;n.set(e,r),r+=e.length}return n},a=e=>{let t=`unknown`;switch(e){case 1:case 2:case 27:case 36:t=`video`;break;case 3:case 4:case 15:t=`audio`;break;case 6:t=`subtitle`;break;case 134:t=`ad`;break}return t};var o=class{pat;pmt;audioConfig;videoConfig;payloadMap=new Map;on={};constructor(){}parse=async e=>{let t=0;for(;!(t+188>e.byteLength);){if(e.getInt8(t)!=71){t++;continue}await this.parsePacket(e,t),t+=188}return t};parsePacket=async(e,t)=>{if(t+188>e.byteLength||e.getUint8(t)!==71)throw Error(`Invalid TS packet`);let n=t,r=this.parseHeader(e,n);n+=4;let{transport_error_indicator:i,pid:a,payload_unit_start_indicator:o,adaptation_field_control:s}=r;if(i===1||a===void 0)return;let c=184;if(s===2||s===3){let t=e.getUint8(n);n+=1,this.parseAdaptationField(e,n),n+=t,c-=t}if(s===3&&--c,s===1||s===3){let t=new Uint8Array(e.buffer.slice(n,n+c));if(a===0)return this.parsePAT(e,n);{let{programs:t=[]}=this.pat||{};if(t.find(e=>e.pmt_pid===a))return this.parsePMT(e,n)}let{streams:r=[]}=this.pmt||{},i=r.find(e=>e.elementary_pid===a);if(i){if(o===1){let e=this.payloadMap.get(a);if(e){switch(i.kind){case`audio`:{let t=await this.parseAudio(e);this.on.chunk&&this.on.chunk(t)}break;case`video`:{let t=await this.parseVideo(e);this.on.chunk&&this.on.chunk(t),await new Promise(e=>setTimeout(()=>e(!0),0))}break}this.payloadMap.delete(a)}}{this.payloadMap.has(a)||this.payloadMap.set(a,new Uint8Array);let e=this.payloadMap.get(a),n=new Uint8Array(e.byteLength+t.byteLength);n.set(e,0),n.set(t,e.byteLength),this.payloadMap.set(a,n)}}}};parseHeader=(e,t)=>{let n=t,r=e.getUint8(n),i=e.getUint8(n+1),a=e.getUint8(n+2),o=e.getUint8(n+3),s=(i&128)>>7;return s===1?{sync_byte:r,transport_error_indicator:s}:{sync_byte:r,transport_error_indicator:s,payload_unit_start_indicator:(i&64)>>6,transport_priority:(i&32)>>5,pid:(i&31)<<8|a,transport_scrambling_control:(o&192)>>6,adaptation_field_control:o>>4&3,continuity_counter:o&15}};parsePAT=(e,t)=>{let n=t,r;{let t=e.getUint8(n);n+=1;let i=e.getUint8(n);if(n+=1,i!==0)throw Error(`Invalid PAT table_id`);let a=e.getUint16(n)&4095;n+=2;let o=e.getUint16(n);n+=2;let s=(e.getUint8(n)&62)>>1,c=e.getUint8(n)&1;n+=1;let l=e.getUint8(n);n+=1;let u=e.getUint8(n);n+=1,r={pointer_field:t,table_id:i,section_length:a,transport_stream_id:o,version_number:s,current_next_indicator:c,section_number:l,last_section_number:u}}let i=[];{let t=r.section_length-5-4,a=n+t;for(;n<a;){let t=e.getUint16(n),r=e.getUint16(n+2)&8191;n+=4,t!==0&&r>=32&&r<=8190&&i.push({program_number:t,pmt_pid:r})}}let a=e.getUint32(n);this.pat={header:r,programs:i,crc32:a},this.on.debug&&this.on.debug({pat:this.pat})};parsePMT=(e,t)=>{let n=t,r;{let t=e.getUint8(n);n+=1;let i=e.getUint8(n);if(n+=1,i!==2)throw Error(`Invalid PMT table_id`);let a=e.getUint16(n)&4095;n+=2;let o=e.getUint16(n);n+=2;let s=(e.getUint8(n)&62)>>1,c=e.getUint8(n)&1;n+=1;let l=e.getUint8(n);n+=1;let u=e.getUint8(n);n+=1;let d=e.getUint16(n)&8191;n+=2;let f=e.getUint16(n)&4095;n+=2,r={pointer_field:t,table_id:i,section_length:a,transport_stream_id:o,version_number:s,current_next_indicator:c,section_number:l,last_section_number:u,pcr_pid:d,program_info_length:f}}let i=[];{let t=r.section_length-9-4,o=n+t;for(;n<o;){let t=e.getUint8(n),r=a(t),o=e.getUint16(n+1)&8191,s=e.getUint16(n+3)&4095;if(n+=5,o<32||o>8190){console.warn(`Invalid elementary_pid: 0x${o.toString(16)}`);continue}i.push({kind:r,stream_type:t,elementary_pid:o,es_info_length:s})}}let o=e.getUint32(n);this.pmt={header:r,streams:i,crc32:o},this.on.debug&&this.on.debug({pmt:this.pmt})};parseAdaptationField=(e,t)=>{let n=t,r,i,a,o,s=e.getUint8(n),c=!!(s&128),l=!!(s&64),u=!!(s&32),d=!!(s&16),f=!!(s&8),p=!!(s&4),m=!!(s&2),h=!!(s&1);n+=1;let g=(e,t)=>{let n=BigInt(0);n|=BigInt(e.getUint16(t))<<25n,n|=BigInt(e.getUint16(t+1))<<17n,n|=BigInt(e.getUint16(t+2))<<9n,n|=BigInt(e.getUint16(t+3))<<1n,n|=BigInt(e.getUint16(t+4)>>7);let r=(e.getUint16(t+4)&1)<<8|e.getUint16(t+5);return n=n*300n+BigInt(r),n};if(d&&(r=g(e,n),n+=6),f&&(i=g(e,n),n+=6),p&&(a=e.getInt8(n),n+=1),m){let t=e.getUint8(n);n+=1,o=new Uint8Array(e.buffer,n,t),n+=t}return{discontinuity_indicator:c,random_access_indicator:l,elementary_stream_priority_indicator:u,pcr_flag:d,opcr_flag:f,splicing_point_flag:p,transport_private_data_flag:m,adaptation_field_extension_flag:h,pcr:r,opcr:i,splice_countdown:a,transport_private_data:o}};parseAudio=async e=>{let t=new DataView(e.buffer),n=0,r,i;{let e=t.getUint8(n)===0&&t.getUint8(n+1)===0&&t.getUint8(n+2)===1;if(n+=3,!e)throw Error(`invalid ts audio payload.`);let i=t.getUint8(n);n+=1;let a=t.getUint8(n)<<8|t.getUint8(n+1);n+=2;let o,s,c,l,u;{let e=t.getUint8(n);n+=1,o=e>>4&3,s=(e>>3&1)==1,c=(e>>2&1)==1,l=(e>>1&1)==1,u=(e&1)==1}let d,f;{let e=t.getUint8(n);n+=1;let r=e>>6,i=t.getUint8(n);n+=1,(r&2)==2&&(d=this.parsePtsDts(t,n)),f=(r&1)==1?this.parsePtsDts(t,n+5):d,n+=i}r={stream_id:i,pes_packet_length:a,scrambling_control:o,priority:s,data_alignment:c,copyright:l,original_copy:u,pts:d,dts:f}}i=e.slice(n);{if(!this.audioConfig&&t.getUint8(n)===255){let e=t.getUint8(n+2),r=t.getUint8(n+3),i,a;a=e>>2&15,i=(e&1)<<2|r>>6,this.audioConfig={kind:`audio`,codec:`mp4a.40.${i}`,sampleRate:[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][a],numberOfChannels:i},this.on.config&&this.on.config(this.audioConfig)}let{dts:e=0,pts:a=0}=r;return{kind:`audio`,type:`key`,dts:e,pts:a,cts:a-e,data:i.slice(7)}}};parseVideo=async e=>{let r=new DataView(e.buffer),a=0,o,s;{let e=r.getUint8(a)===0&&r.getUint8(a+1)===0&&r.getUint8(a+2)===1;if(a+=3,!e)throw Error(`invalid ts video payload.`);let t=r.getUint8(a);a+=1;let n=r.getUint8(a)<<8|r.getUint8(a+1);a+=2;let i,s,c,l,u;{let e=r.getUint8(a);a+=1,i=e>>4&3,s=(e>>3&1)==1,c=(e>>2&1)==1,l=(e>>1&1)==1,u=(e&1)==1}let d,f;{let e=r.getUint8(a);a+=1;let t=e>>6,n=r.getUint8(a);a+=1,(t&2)==2&&(d=this.parsePtsDts(r,a)),f=(t&1)==1?this.parsePtsDts(r,a+5):d,a+=n}o={stream_id:t,pes_packet_length:n,scrambling_control:i,priority:s,data_alignment:c,copyright:l,original_copy:u,pts:d,dts:f}}s=e.slice(a);{let e=this.getNalus(s);if(!this.videoConfig){let r,i;if(r=e.find(e=>e.type===7)?.nalu.slice(4),i=e.find(e=>e.type===8)?.nalu.slice(4),r&&i){let e=t(r,i),{codec:a}=n(e);this.videoConfig={kind:`video`,codec:a,description:e,sps:r,pps:i},this.on.config&&this.on.config(this.videoConfig)}}let r=[],a=`delta`;for(let t of e){let{type:e,nalu:n}=t;switch(e){case 6:case 9:r.push(n);break;case 1:a=`delta`,r.push(n);break;case 5:a=`key`,r.push(n);break}}let c=i(r),{dts:l=0,pts:u=0}=o,d=u-l;return{kind:`video`,type:a,dts:l,pts:u,cts:d,data:c,nalus:r}}};parsePtsDts(e,t){let n=e.getUint8(t),r=e.getUint8(t+1),i=e.getUint8(t+2),a=e.getUint8(t+3),o=e.getUint8(t+4),s=(BigInt(n)&14n)<<29n|(BigInt(r)&255n)<<22n|(BigInt(i)&254n)<<14n|(BigInt(a)&255n)<<7n|(BigInt(o)&254n)>>1n;return Number(s)/90}getNalus=e=>{let t=[],n=0;for(;!(n+4>e.byteLength);){if(e[n]!==0||e[n+1]!==0||e[n+2]!==1){n+=1;continue}n+=3;let i=n,a=e[n]&31;for(n+=1;!(n+1>e.byteLength);){if(e[n]!==0||e[n+1]!==0||e[n+2]!==1){n+=1;continue}break}let o=n-i;if(e[n-1]===0&&--o,o!==0){let n=r(e.slice(i,i+o));t.push({type:a,nalu:n})}}return t}};let s=(e,t)=>e.getUint8(t)<<16|e.getUint8(t+1)<<8|e.getUint8(t+2);var c=class{audioConfig;videoConfig;header;textDecoder=new TextDecoder(`utf-8`);on={};constructor(){}parse=async e=>{let t=0;for(this.header||(this.parseHeader(e,t),t+=9);this.isSurplusTag(e,t)!==!1;){let{tagType:n,dataSize:r,timestamp:i}=this.parseTagHeader(e,t+4);if(n){let a=this.parseTagBody(n,e,t+4+11,r);switch(n){case`script`:this.on.info&&this.on.info(a);break;case`audio`:{let{accPacketType:e}=a;if(e===0){let{codec:e,sampleRate:t,channelConfiguration:n}=a;this.audioConfig={kind:`audio`,codec:e,sampleRate:t,numberOfChannels:n},this.on.config&&this.on.config(this.audioConfig)}else{let{cts:e,data:t}=a,n=e===void 0?void 0:e+i;this.on.chunk&&this.on.chunk({kind:`audio`,type:`key`,dts:i,pts:n,cts:e,data:t})}}break;case`video`:{let{avcPacketType:e}=a;if(e===0){let{codec:e,sps:t,pps:n,data:r}=a;this.videoConfig={kind:`video`,codec:e,description:r,sps:t,pps:n},this.on.config&&this.on.config(this.videoConfig)}else{let{frameType:e,cts:t,data:n,nalus:r}=a,o=e===1?`key`:`delta`,s=t===void 0?void 0:t+i;this.on.chunk&&this.on.chunk({kind:`video`,type:o,dts:i,pts:s,cts:t,data:n,nalus:r})}}break}t=t+4+11+r}await new Promise(e=>setTimeout(()=>e(!0),8))}return t};parseHeader=(e,t)=>{let n,r,i,a;n=e.getUint8(t)<<16|e.getUint8(t+1)<<8|e.getUint8(t+2),r=e.getUint8(3);{let[,,t,,n]=e.getUint8(0).toString(2).padStart(5,`0`).split(``);i={audio:n===`1`,video:t===`1`}}a=e.getUint32(5),this.header={signature:n,version:r,flags:i,dataOffset:a}};isSurplusTag=(e,t)=>{let n=!0,r=e.byteLength;if(t+4>r)n=!1;else if(t+4+11>r)n=!1;else{let i=s(e,t+4+1);t+4+11+i>r&&(n=!1)}return n};parseTagHeader=(e,t)=>{let n,r,i,a,o;{let r=e.getUint8(t),i;switch(r){case 18:i=`script`;break;case 8:i=`audio`;break;case 9:i=`video`;break}n=i}return r=s(e,t+1),i=s(e,t+4),a=e.getUint8(t+7),o=s(e,t+8),{tagType:n,dataSize:r,timestamp:i,timestampExtended:a,streamID:o}};parseTagBody=(e,t,n,r)=>{let i;switch(e){case`script`:i=this.parseMetaData(t,n);break;case`audio`:i=this.parseAudio(t,n,r);break;case`video`:i=this.parseVideo(t,n,r);break}return i};parseMetaData=(e,t)=>{let n=t;if(e.getUint8(n)!==2)throw Error(`Invalid AMF type for onMetaData (expected 0x02)`);n+=1;let r=e.getUint16(n,!1);n+=2;{let t=new Int8Array(e.buffer.slice(n,n+r));if((this.textDecoder?.decode(t)||``)!==`onMetaData`)throw Error(`Expected 'onMetaData' string`);n+=r}let i=this.getAmfType(e,n);return n+=1,this.getAMFValue(e,n,i).value};parseAudio=(e,t,n)=>{let r=t,i=e.getUint8(r),a=i>>4&15,o=i>>2&3,s=i>>1&1,c=i&1;r+=1;let l=e.getUint8(r);r+=1;let u=n,d=new Uint8Array(e.buffer.slice(r,r+u));if(a===10&&l===0){let t=e.getUint8(r),n=e.getUint8(r+1),i=t>>3&31,u=(t&7)<<1|n>>7;return{soundFormat:a,soundRate:o,soundSize:s,soundType:c,accPacketType:l,data:d,samplingFrequencyIndex:u,channelConfiguration:n>>3&15,codec:`mp4a.40.${i}`,sampleRate:[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][u]}}return{soundFormat:a,soundRate:o,soundSize:s,soundType:c,accPacketType:l,data:d}};parseVideo=(e,t,r)=>{let i=t,a=e.getUint8(i),o=a>>4&15,c=a&15;i+=1;let l=e.getUint8(i);i+=1;let u=s(e,i);i+=3;let d=r-5,f=new Uint8Array(e.buffer.slice(i,i+d));switch(c){case 7:if(l===0)return{frameType:o,codecID:c,avcPacketType:l,cts:u,data:f,...n(f)};if(l===1){let t=[],n=i+r-5;for(;!(i+4>n);){let n=e.getUint32(i,!1),r=new Uint8Array(e.buffer.slice(i,i+4+n));i+=4+n,t.push(r)}return{frameType:o,codecID:c,avcPacketType:l,cts:u,data:f,nalus:t}}break;default:throw Error(`Unsupported codecID`)}return{frameType:o,codecID:c,avcPacketType:l,cts:u,data:f}};getAmfType=(e,t)=>e.getUint8(t);getAMFName=(e,t,n)=>{let r=new Uint8Array(e.buffer.slice(t,t+n));return this.textDecoder?.decode(r)||``};getAMFValue=(e,t,n)=>{let r=t,i,a=0;switch(n){case 0:i=e.getFloat64(r,!1),a=8;break;case 1:i=!!e.getUint8(r),a=1;break;case 2:{i=``;let t=e.getUint16(r,!1);r+=2;let n=new Int8Array(e.buffer,r,t).filter(e=>e!==0);i=(this.textDecoder?.decode(n)||``).trim(),a=2+t}break;case 3:for(i={};r<e.byteLength;){let t=e.getUint16(r,!1);if(t===0)break;r+=2;let n=this.getAMFName(e,r,t);r+=t;let o=this.getAmfType(e,r);if(o===6)break;r+=1;let s=this.getAMFValue(e,r,o);r+=s.length,i[n]=s.value,a=2+t+1+s.length}break;case 8:{i={};let t=e.getUint32(r,!1);r+=4;for(let n=0;n<t;n++){let t=e.getUint16(r,!1);r+=2;let n=this.getAMFName(e,r,t);r+=t;let o=this.getAmfType(e,r);r+=1;let s=this.getAMFValue(e,r,o);r+=s.length,i[n]=s.value,a=2+t+1+s.length}}break;case 10:{i=[];let t=e.getUint32(r,!1);r+=4;for(let n=0;n<t;n++){let t=this.getAmfType(e,r);r+=1;let n=this.getAMFValue(e,r,t);r+=n.length,i.push(n.value),a=1+n.length}}break}return{amfType:n,length:a,value:i}}};let l=new class{pattern;cacher=new e;isParseing=!1;offset=0;parser;on={};constructor(){}init=e=>{switch(this.destroy(),this.pattern=e,this.pattern){case`flv`:this.parser=new c;break;case`hls`:this.parser=new o;break;default:throw Error(`is error pattern.`)}this.parser.on.debug=e=>this.on.debug&&this.on.debug(e),this.parser.on.info=e=>this.on.info&&this.on.info(e),this.parser.on.config=e=>this.on.config&&this.on.config(e),this.parser.on.chunk=e=>{this.cacher.pushChunk(e),this.on.chunk&&this.on.chunk(e)}};push=e=>{this.cacher.push(e),this.isParseing===!1&&this.parse()};destroy=()=>{this.cacher.destroy(),this.isParseing=!1,this.offset=0};parse=async()=>{try{if(this.isParseing=!0,!this.pattern)throw Error(`You need to set the pattern.`);if(!this.parser)throw Error(`You need to init parser.`);for(;;){let e=this.cacher.next(this.offset);if(this.offset=0,!e)break;this.offset=await this.parser.parse(e)}this.isParseing=!1}catch{this.destroy()}}};l.on.info=e=>postMessage({action:`on.info`,data:e}),l.on.config=e=>postMessage({action:`on.config`,data:e}),l.on.chunk=e=>postMessage({action:`on.chunk`,data:e}),l.on.debug=e=>postMessage({action:`on.debug`,data:e}),onmessage=e=>{let{action:t,data:n}=e.data,r=l[t];r&&r(n)}})();", xn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", bn], { type: "text/javascript;charset=utf-8" });
3859
- function Sn(e) {
3858
+ var xn = "(function(){var e=class{pendingPayloads=[];payload=new Uint8Array;chunks=[];push=e=>{this.pendingPayloads.push(e)};next=(e=0)=>{this.payload=this.payload.slice(e);let t=this.pendingPayloads.shift();if(!t)return!1;let n=new Uint8Array(this.payload.byteLength+t.byteLength);return n.set(this.payload,0),n.set(t,this.payload.byteLength),this.payload=n,new DataView(this.payload.buffer)};pushChunk=e=>{this.chunks.push(e),this.chunks.length>100&&this.chunks.shift()};discardPayload=()=>{this.payload=new Uint8Array};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array,this.chunks=[]}};let t=(e,t)=>{let n=new Uint8Array(e),r=new Uint8Array(t),i=new Uint8Array(11+n.length+r.length),a=0;return i[a++]=1,i[a++]=n[1],i[a++]=n[2],i[a++]=n[3],i[a++]=255,i[a++]=225,i[a++]=n.length>>8&255,i[a++]=n.length&255,i.set(n,a),a+=n.length,i[a++]=1,i[a++]=r.length>>8&255,i[a++]=r.length&255,i.set(r,a),i},n=e=>{let t=0,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n.getUint8(t);if(t+=1,r!==1)throw Error(`Invalid AVC version`);let i=n.getUint8(t)&255;t+=1;let a=n.getUint8(t)&255;t+=1;let o=n.getUint8(t)&255;t+=1;let s=`avc1.${Array.from([i,a,o],e=>e.toString(16).padStart(2,`0`)).join(``)}`;t+=1,t+=1;let c=n.getUint16(t,!1);t+=2;let l=new Uint8Array(e.buffer,e.byteOffset+t,c);t+=c,t+=1;let u=n.getUint16(t,!1);return t+=2,{version:r,codec:s,profile:i,compatibility:a,level:o,sps:l,pps:new Uint8Array(e.buffer,e.byteOffset+t,u)}},r=e=>{let t=new Uint8Array(4+e.length);return new DataView(t.buffer).setUint32(0,e.length,!1),t.set(e,4),t},i=e=>{let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n},a=(e,t)=>e.getUint8(t)<<16|e.getUint8(t+1)<<8|e.getUint8(t+2),o=(e,t)=>{let n=a(e,t);return n&8388608&&(n|=-16777216),n},s=(e,t)=>t<<24|e,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var l=class{audioConfig;videoConfig;header;textDecoder=new TextDecoder(`utf-8`);on={};constructor(){}parse=async e=>{let t=0;for(this.header||(this.parseHeader(e,t),t+=9);this.isSurplusTag(e,t)!==!1;){let{tagType:n,dataSize:r,dts:i}=this.parseTagHeader(e,t+4);if(n){let a=this.parseTagBody(n,e,t+4+11,r);if(!a){t=t+4+11+r,await new Promise(e=>setTimeout(()=>e(!0),8));continue}switch(n){case`script`:this.on.info&&this.on.info(a);break;case`audio`:{let{accPacketType:e}=a;if(e===0){let{codec:e,sampleRate:t,channelConfiguration:n,data:r}=a;this.audioConfig={kind:`audio`,codec:e,sampleRate:t,numberOfChannels:n,...r?{description:r}:{}},this.on.config&&this.on.config(this.audioConfig)}else{let{cts:e,data:t}=a,n=e===void 0?void 0:e+i;this.on.chunk&&this.on.chunk({kind:`audio`,type:`key`,dts:i,pts:n,cts:e,data:t})}}break;case`video`:{let{avcPacketType:e}=a;if(e===0){let{codec:e,sps:t,pps:n,data:r}=a;this.videoConfig={kind:`video`,codec:e,description:r,sps:t,pps:n},this.on.config&&this.on.config(this.videoConfig)}else{let{frameType:e,cts:t,data:n,nalus:r}=a,o=e===1?`key`:`delta`,s=t===void 0?void 0:t+i;this.on.chunk&&this.on.chunk({kind:`video`,type:o,dts:i,pts:s,cts:t,data:n,nalus:r})}}break}t=t+4+11+r}await new Promise(e=>setTimeout(()=>e(!0),8))}return t};parseHeader=(e,t)=>{let n,r,i,a;n=e.getUint8(t)<<16|e.getUint8(t+1)<<8|e.getUint8(t+2),r=e.getUint8(t+3);{let n=e.getUint8(t+4);i={audio:!!(n&4),video:!!(n&1)}}a=e.getUint32(t+5),this.header={signature:n,version:r,flags:i,dataOffset:a}};isSurplusTag=(e,t)=>{let n=!0,r=e.byteLength;if(t+4>r)n=!1;else if(t+4+11>r)n=!1;else{let i=a(e,t+4+1);t+4+11+i>r&&(n=!1)}return n};parseTagHeader=(e,t)=>{let n,r,i,o,c;{let r=e.getUint8(t),i;switch(r){case 18:i=`script`;break;case 8:i=`audio`;break;case 9:i=`video`;break}n=i}r=a(e,t+1),i=a(e,t+4),o=e.getUint8(t+7),c=a(e,t+8);let l=s(i,o);return{tagType:n,dataSize:r,timestamp:i,timestampExtended:o,dts:l,streamID:c}};parseTagBody=(e,t,n,r)=>{let i;switch(e){case`script`:i=this.parseMetaData(t,n);break;case`audio`:i=this.parseAudio(t,n,r);break;case`video`:i=this.parseVideo(t,n,r);break}return i};parseMetaData=(e,t)=>{let n=t;if(e.getUint8(n)!==2)return null;n+=1;let r=e.getUint16(n,!1);n+=2;{let t=new Int8Array(e.buffer.slice(n,n+r)),i=this.textDecoder?.decode(t)||``;if(n+=r,i!==`onMetaData`)return{name:i}}let i=this.getAmfType(e,n);return n+=1,this.getAMFValue(e,n,i).value};parseAudio=(e,t,n)=>{let r=t,i=e.getUint8(r),a=i>>4&15,o=i>>2&3,s=i>>1&1,l=i&1;r+=1;let u=e.getUint8(r);r+=1;let d=n-(r-t);if(d<=0)return{soundFormat:a,soundRate:o,soundSize:s,soundType:l,accPacketType:u,data:new Uint8Array};let f=new Uint8Array(e.buffer.slice(r,r+d));if(a===10&&u===0){let t=e.getUint8(r),n=e.getUint8(r+1),i=t>>3&31,d=(t&7)<<1|n>>7;return{soundFormat:a,soundRate:o,soundSize:s,soundType:l,accPacketType:u,data:f,samplingFrequencyIndex:d,channelConfiguration:n>>3&15,codec:`mp4a.40.${i}`,sampleRate:c[d]}}return{soundFormat:a,soundRate:o,soundSize:s,soundType:l,accPacketType:u,data:f}};parseVideo=(e,t,r)=>{let i=t,a=e.getUint8(i),s=a>>4&15,c=a&15;i+=1;let l=e.getUint8(i);i+=1;let u=o(e,i);i+=3;let d=r-5;if(d<0)return null;let f=new Uint8Array(e.buffer.slice(i,i+d));switch(c){case 7:if(l===0)return{frameType:s,codecID:c,avcPacketType:l,cts:u,data:f,...n(f)};if(l===1){let t=[],n=i+d;for(;!(i+4>n);){let r=e.getUint32(i,!1);if(r<=0||i+4+r>n)break;let a=new Uint8Array(e.buffer.slice(i,i+4+r));i+=4+r,t.push(a)}return{frameType:s,codecID:c,avcPacketType:l,cts:u,data:f,nalus:t}}break;default:return null}return{frameType:s,codecID:c,avcPacketType:l,cts:u,data:f}};getAmfType=(e,t)=>e.getUint8(t);getAMFName=(e,t,n)=>{let r=new Uint8Array(e.buffer.slice(t,t+n));return this.textDecoder?.decode(r)||``};getAMFValue=(e,t,n)=>{let r=t,i,a=0;switch(n){case 0:i=e.getFloat64(r,!1),a=8;break;case 1:i=!!e.getUint8(r),a=1;break;case 2:{i=``;let t=e.getUint16(r,!1);r+=2;let n=new Int8Array(e.buffer,r,t).filter(e=>e!==0);i=(this.textDecoder?.decode(n)||``).trim(),a=2+t}break;case 3:for(i={};r<e.byteLength;){let t=e.getUint16(r,!1);if(t===0)break;r+=2;let n=this.getAMFName(e,r,t);r+=t;let o=this.getAmfType(e,r);if(o===6)break;r+=1;let s=this.getAMFValue(e,r,o);r+=s.length,i[n]=s.value,a=2+t+1+s.length}break;case 8:{i={};let t=e.getUint32(r,!1);r+=4;for(let n=0;n<t;n++){let t=e.getUint16(r,!1);r+=2;let n=this.getAMFName(e,r,t);r+=t;let o=this.getAmfType(e,r);r+=1;let s=this.getAMFValue(e,r,o);r+=s.length,i[n]=s.value,a=2+t+1+s.length}}break;case 10:{i=[];let t=e.getUint32(r,!1);r+=4;for(let n=0;n<t;n++){let t=this.getAmfType(e,r);r+=1;let n=this.getAMFValue(e,r,t);r+=n.length,i.push(n.value),a=1+n.length}}break}return{amfType:n,length:a,value:i}}};let u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],d=e=>{let t=`unknown`;switch(e){case 1:case 2:case 27:case 36:t=`video`;break;case 3:case 4:case 15:t=`audio`;break;case 6:t=`subtitle`;break;case 134:t=`ad`;break}return t};var f=class{pat;pmt;audioConfig;videoConfig;payloadMap=new Map;on={};constructor(){}parse=async e=>{let t=0;for(;!(t+188>e.byteLength);){if(e.getInt8(t)!=71){t++;continue}await this.parsePacket(e,t),t+=188}return t};parsePacket=async(e,t)=>{if(t+188>e.byteLength||e.getUint8(t)!==71)throw Error(`Invalid TS packet`);let n=t,r=this.parseHeader(e,n);n+=4;let{transport_error_indicator:i,pid:a,payload_unit_start_indicator:o,adaptation_field_control:s}=r;if(i===1||a===void 0)return;let c=184;if(s===2||s===3){let t=e.getUint8(n);n+=1,t>0&&(this.parseAdaptationField(e,n),n+=t),c-=1+t}if(s===1||s===3){if(c<=0)return;let t=new Uint8Array(e.buffer.slice(n,n+c));if(a===0)return this.parsePAT(e,n);{let{programs:t=[]}=this.pat||{};if(t.find(e=>e.pmt_pid===a))return this.parsePMT(e,n)}let{streams:r=[]}=this.pmt||{},i=r.find(e=>e.elementary_pid===a);if(i){if(o===1){let e=this.payloadMap.get(a);if(e){switch(i.kind){case`audio`:{let t=await this.parseAudio(e);this.on.chunk&&this.on.chunk(t)}break;case`video`:{let t=await this.parseVideo(e);this.on.chunk&&this.on.chunk(t),await new Promise(e=>setTimeout(()=>e(!0),0))}break}this.payloadMap.delete(a)}}{this.payloadMap.has(a)||this.payloadMap.set(a,new Uint8Array);let e=this.payloadMap.get(a),n=new Uint8Array(e.byteLength+t.byteLength);n.set(e,0),n.set(t,e.byteLength),this.payloadMap.set(a,n)}}}};parseHeader=(e,t)=>{let n=t,r=e.getUint8(n),i=e.getUint8(n+1),a=e.getUint8(n+2),o=e.getUint8(n+3),s=(i&128)>>7;return s===1?{sync_byte:r,transport_error_indicator:s}:{sync_byte:r,transport_error_indicator:s,payload_unit_start_indicator:(i&64)>>6,transport_priority:(i&32)>>5,pid:(i&31)<<8|a,transport_scrambling_control:(o&192)>>6,adaptation_field_control:o>>4&3,continuity_counter:o&15}};parsePAT=(e,t)=>{let n=t,r;{let t=e.getUint8(n);n+=1;let i=e.getUint8(n);if(n+=1,i!==0)throw Error(`Invalid PAT table_id`);let a=e.getUint16(n)&4095;n+=2;let o=e.getUint16(n);n+=2;let s=(e.getUint8(n)&62)>>1,c=e.getUint8(n)&1;n+=1;let l=e.getUint8(n);n+=1;let u=e.getUint8(n);n+=1,r={pointer_field:t,table_id:i,section_length:a,transport_stream_id:o,version_number:s,current_next_indicator:c,section_number:l,last_section_number:u}}let i=[];{let t=r.section_length-5-4,a=n+t;for(;n<a;){let t=e.getUint16(n),r=e.getUint16(n+2)&8191;n+=4,t!==0&&r>=32&&r<=8190&&i.push({program_number:t,pmt_pid:r})}}let a=e.getUint32(n);this.pat={header:r,programs:i,crc32:a}};parsePMT=(e,t)=>{let n=t,r;{let t=e.getUint8(n);n+=1;let i=e.getUint8(n);if(n+=1,i!==2)throw Error(`Invalid PMT table_id`);let a=e.getUint16(n)&4095;n+=2;let o=e.getUint16(n);n+=2;let s=(e.getUint8(n)&62)>>1,c=e.getUint8(n)&1;n+=1;let l=e.getUint8(n);n+=1;let u=e.getUint8(n);n+=1;let d=e.getUint16(n)&8191;n+=2;let f=e.getUint16(n)&4095;n+=2,r={pointer_field:t,table_id:i,section_length:a,transport_stream_id:o,version_number:s,current_next_indicator:c,section_number:l,last_section_number:u,pcr_pid:d,program_info_length:f}}n+=r.program_info_length;let i=[];{let t=r.section_length-9-4,a=n+t;for(;n<a;){let t=e.getUint8(n),r=d(t),a=e.getUint16(n+1)&8191,o=e.getUint16(n+3)&4095;if(n+=5+o,a<32||a>8190){console.warn(`Invalid elementary_pid: 0x${a.toString(16)}`);continue}i.push({kind:r,stream_type:t,elementary_pid:a,es_info_length:o})}}let a=e.getUint32(n);this.pmt={header:r,streams:i,crc32:a}};parseAdaptationField=(e,t)=>{let n=t,r,i,a,o,s=e.getUint8(n),c=!!(s&128),l=!!(s&64),u=!!(s&32),d=!!(s&16),f=!!(s&8),p=!!(s&4),m=!!(s&2),h=!!(s&1);n+=1;let g=(e,t)=>{let n=BigInt(0);n|=BigInt(e.getUint16(t))<<25n,n|=BigInt(e.getUint16(t+1))<<17n,n|=BigInt(e.getUint16(t+2))<<9n,n|=BigInt(e.getUint16(t+3))<<1n,n|=BigInt(e.getUint16(t+4)>>7);let r=(e.getUint16(t+4)&1)<<8|e.getUint16(t+5);return n=n*300n+BigInt(r),n};if(d&&(r=g(e,n),n+=6),f&&(i=g(e,n),n+=6),p&&(a=e.getInt8(n),n+=1),m){let t=e.getUint8(n);n+=1,o=new Uint8Array(e.buffer,n,t),n+=t}return{discontinuity_indicator:c,random_access_indicator:l,elementary_stream_priority_indicator:u,pcr_flag:d,opcr_flag:f,splicing_point_flag:p,transport_private_data_flag:m,adaptation_field_extension_flag:h,pcr:r,opcr:i,splice_countdown:a,transport_private_data:o}};parseAudio=async e=>{let t=new DataView(e.buffer),n=0,r,i;{let e=t.getUint8(n)===0&&t.getUint8(n+1)===0&&t.getUint8(n+2)===1;if(n+=3,!e)throw Error(`invalid ts audio payload.`);let i=t.getUint8(n);n+=1;let a=t.getUint8(n)<<8|t.getUint8(n+1);n+=2;let o,s,c,l,u;{let e=t.getUint8(n);n+=1,o=e>>4&3,s=(e>>3&1)==1,c=(e>>2&1)==1,l=(e>>1&1)==1,u=(e&1)==1}let d,f;{let e=t.getUint8(n);n+=1;let r=e>>6,i=t.getUint8(n);n+=1,(r&2)==2&&(d=this.parsePtsDts(t,n)),f=(r&1)==1?this.parsePtsDts(t,n+5):d,n+=i}r={stream_id:i,pes_packet_length:a,scrambling_control:o,priority:s,data_alignment:c,copyright:l,original_copy:u,pts:d,dts:f}}i=e.slice(n);{let e=this.parseAdts(i);!this.audioConfig&&e&&(this.audioConfig={kind:`audio`,codec:e.codec,sampleRate:e.sampleRate,numberOfChannels:e.channelConfiguration},this.on.config&&this.on.config(this.audioConfig));let{dts:t=0,pts:n=0}=r;return{kind:`audio`,type:`key`,dts:t,pts:n,cts:n-t,data:e?i.slice(e.headerLength):i}}};parseAdts=e=>{if(e.length<7||e[0]!==255||(e[1]&240)!=240)return null;let t=e[1]&1?7:9;if(e.length<t)return null;let n=(e[2]>>6&3)+1,r=e[2]>>2&15,i=(e[2]&1)<<2|e[3]>>6,a=u[r]??44100;return{headerLength:t,codec:`mp4a.40.${n}`,sampleRate:a,channelConfiguration:i}};parseVideo=async e=>{let r=new DataView(e.buffer),a=0,o,s;{let e=r.getUint8(a)===0&&r.getUint8(a+1)===0&&r.getUint8(a+2)===1;if(a+=3,!e)throw Error(`invalid ts video payload.`);let t=r.getUint8(a);a+=1;let n=r.getUint8(a)<<8|r.getUint8(a+1);a+=2;let i,s,c,l,u;{let e=r.getUint8(a);a+=1,i=e>>4&3,s=(e>>3&1)==1,c=(e>>2&1)==1,l=(e>>1&1)==1,u=(e&1)==1}let d,f;{let e=r.getUint8(a);a+=1;let t=e>>6,n=r.getUint8(a);a+=1,(t&2)==2&&(d=this.parsePtsDts(r,a)),f=(t&1)==1?this.parsePtsDts(r,a+5):d,a+=n}o={stream_id:t,pes_packet_length:n,scrambling_control:i,priority:s,data_alignment:c,copyright:l,original_copy:u,pts:d,dts:f}}s=e.slice(a);{let e=this.getNalus(s);if(!this.videoConfig){let r,i;if(r=e.find(e=>e.type===7)?.nalu.slice(4),i=e.find(e=>e.type===8)?.nalu.slice(4),r&&i){let e=t(r,i),{codec:a}=n(e);this.videoConfig={kind:`video`,codec:a,description:e,sps:r,pps:i},this.on.config&&this.on.config(this.videoConfig)}}let r=[],a=`delta`;for(let t of e){let{type:e,nalu:n}=t;switch(e){case 6:case 9:r.push(n);break;case 1:a=`delta`,r.push(n);break;case 5:a=`key`,r.push(n);break}}let c=i(r),{dts:l=0,pts:u=0}=o,d=u-l;return{kind:`video`,type:a,dts:l,pts:u,cts:d,data:c,nalus:r}}};parsePtsDts(e,t){let n=e.getUint8(t),r=e.getUint8(t+1),i=e.getUint8(t+2),a=e.getUint8(t+3),o=e.getUint8(t+4),s=(BigInt(n)&14n)<<29n|(BigInt(r)&255n)<<22n|(BigInt(i)&254n)<<14n|(BigInt(a)&255n)<<7n|(BigInt(o)&254n)>>1n;return Number(s)/90}getNalus=e=>{let t=[],n=0;for(;n<e.byteLength-2;){let i=this.findAnnexBStart(e,n);if(!i)break;let a=e[i.naluOffset]&31,o=this.findAnnexBStart(e,i.nextSearchOffset),s=(o?o.startOffset:e.byteLength)-i.naluOffset;if(s>0){let n=e.slice(i.naluOffset,i.naluOffset+s);t.push({type:a,nalu:r(n)})}n=o?o.startOffset:e.byteLength}return t};findAnnexBStart=(e,t)=>{for(let n=t;n<e.length-2;n++)if(!(e[n]!==0||e[n+1]!==0)){if(e[n+2]===1)return{startOffset:n,naluOffset:n+3,nextSearchOffset:n+3};if(n+3<e.length&&e[n+2]===0&&e[n+3]===1)return{startOffset:n,naluOffset:n+4,nextSearchOffset:n+4}}return null}};let p=(e,t)=>String.fromCharCode(e.getUint8(t),e.getUint8(t+1),e.getUint8(t+2),e.getUint8(t+3)),m=(e,t,n)=>{if(t+8>n)return null;let r=e.getUint32(t,!1),i=p(e,t+4),a=8;if(r===1){if(t+16>n)return null;r=Number(e.getBigUint64(t+8,!1)),a=16}else r===0&&(r=n-t);return r<a||t+r>n?null:{offset:t,size:r,type:i,headerSize:a,contentStart:t+a}},h=(e,t,n,r)=>{let i=t;for(;i<n;){let t=m(e,i,n);if(!t)break;r(t),i+=t.size}},g=(e,t,n,r)=>{let i=null;return h(e,t,n,t=>{if(t.type===r)i=t;else if(t.type!==`mdat`){let n=g(e,t.contentStart,t.offset+t.size,r);n&&(i=n)}}),i},_=(e,t,n,r)=>{for(let i=t;i+8<=n;i++){if(p(e,i+4)!==r)continue;let t=m(e,i,n);if(t?.type===r)return t}return null},v=(e,t,n,r,i=86)=>_(e,t+i,n,r)||_(e,t+8,n,r),y=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],b=(e,t)=>{let n=0,r=t;for(;r<e.length;){if(n=n<<7|e[r]&127,!(e[r]&128))return{len:n,next:r+1};r++}return{len:0,next:t}};var x=class{audioConfig;videoConfig;tracks=new Map;mdatBox=null;progressiveParsed=!1;on={};getDiscardOffset=(e,t)=>this.progressiveParsed||g(t,0,e,`moof`)||this.tracks.size>0&&!g(t,0,e,`mdat`)?e:0;constructor(){}parse=async e=>{let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=t.byteLength,r=0;for(;r<n;){let i=m(e,r,n);if(!i)return 0;switch(i.type){case`moov`:this.parseMoov(e,i),this.tryRunProgressive(e,t);break;case`moof`:this.parseMoof(e,i,t);break;case`mdat`:this.mdatBox=i,this.tryRunProgressive(e,t);break;case`sidx`:case`styp`:case`free`:case`skip`:case`ftyp`:break;default:break}r+=i.size,(i.type===`moov`||i.type===`moof`||i.type===`mdat`)&&await new Promise(e=>setTimeout(()=>e(!0),8))}return this.progressiveParsed?n:0};tryRunProgressive=(e,t)=>{if(this.progressiveParsed||this.tracks.size===0)return;let n=this.mdatBox??g(e,0,t.byteLength,`mdat`),r=g(e,0,t.byteLength,`moov`);!n||!r||this.isProgressiveReady(n,r,t.byteLength)&&(this.parseProgressive(e,n,t),this.progressiveParsed=!0)};isProgressiveReady=(e,t,n)=>e.offset+e.size<=n&&t.offset+t.size<=n;parseMoov=(e,t)=>{h(e,t.contentStart,t.offset+t.size,t=>{t.type===`trak`&&this.parseTrak(e,t)});let n=g(e,t.contentStart,t.offset+t.size,`mvex`);n&&h(e,n.contentStart,n.offset+n.size,t=>{if(t.type!==`trex`)return;let n=e.getUint32(t.contentStart+4,!1),r=this.tracks.get(n);r&&(r.defaultSampleDuration=e.getUint32(t.contentStart+12,!1),r.defaultSampleSize=e.getUint32(t.contentStart+16,!1))});let r=g(e,t.contentStart,t.offset+t.size,`mvhd`);if(r){let t=e.getUint8(r.contentStart),n=e.getUint32(r.contentStart+(t===1?20:12),!1),i=t===1?Number(e.getBigUint64(r.contentStart+24,!1)):e.getUint32(r.contentStart+16,!1);this.on.info?.({width:[...this.tracks.values()].find(e=>e.kind===`video`)?.width,height:[...this.tracks.values()].find(e=>e.kind===`video`)?.height,duration:n?i/n:void 0})}};readTkhdSize=(e,t)=>{let n=e.getUint8(t.contentStart),r=n===1?72:64,i=n===1?76:68;return{width:e.getUint32(t.contentStart+r,!1)>>16,height:e.getUint32(t.contentStart+i,!1)>>16}};readSampleEntrySize=(e,t)=>({width:e.getUint16(t+32,!1),height:e.getUint16(t+34,!1)});parseTrak=(e,t)=>{let r=g(e,t.contentStart,t.offset+t.size,`tkhd`),i=g(e,t.contentStart,t.offset+t.size,`mdia`);if(!r||!i)return;let a=e.getUint8(r.contentStart),o=e.getUint32(r.contentStart+(a===1?20:12),!1),{width:s,height:c}=this.readTkhdSize(e,r),l=g(e,i.contentStart,i.offset+i.size,`hdlr`),u=g(e,i.contentStart,i.offset+i.size,`mdhd`);if(!l||!u)return;let d=p(e,l.contentStart+8),f=d===`vide`?`video`:d===`soun`?`audio`:void 0;if(!f)return;let m=e.getUint8(u.contentStart),h=e.getUint32(u.contentStart+(m===1?20:12),!1);this.tracks.set(o,{kind:f,trackId:o,timescale:h,width:s,height:c});let _=g(e,i.contentStart,i.offset+i.size,`minf`),y=_&&g(e,_.contentStart,_.offset+_.size,`stbl`),b=y&&g(e,y.contentStart,y.offset+y.size,`stsd`);if(!b)return;let x=b.contentStart+8,S=x+e.getUint32(x,!1),C=p(e,x+4);if(f===`video`&&(C===`avc1`||C===`avc3`)){let t=this.readSampleEntrySize(e,x);t.width&&t.height&&(s=t.width,c=t.height);let r=v(e,x,S,`avcC`,86);if(!r)return;let i=new Uint8Array(e.buffer,r.contentStart,r.size-r.headerSize),a=n(i),o=a.codec.replace(/^avc1\\./,`${C}.`);this.videoConfig={kind:`video`,codec:o,description:i,sps:a.sps,pps:a.pps},this.on.config?.(this.videoConfig)}if(f===`video`){let e=this.tracks.get(o);e&&(e.width=s,e.height=c)}if(f===`audio`&&C===`mp4a`){let t=v(e,x,S,`esds`,36),n=t&&this.parseEsds(e,t);n&&(this.audioConfig=n,this.on.config?.(n))}};parseEsds=(e,t)=>{let n=new Uint8Array(e.buffer,t.contentStart,t.size-t.headerSize);for(let e=0;e<n.length-2;e++){if(n[e]!==5)continue;let{len:t,next:r}=b(n,e+1);if(t<2||r+t>n.length)continue;let i=n.slice(r,r+t),a=i[0],o=i[1],s=a>>3&31,c=(a&7)<<1|o>>7,l=o>>3&15;return{kind:`audio`,codec:`mp4a.40.${s}`,sampleRate:y[c]??44100,numberOfChannels:l,description:i}}return null};findMdatForMoof=(e,t,n)=>{let r=t.offset+t.size;for(;r+8<=n;){let t=m(e,r,n);if(!t||t.type===`moof`)break;if(t.type===`mdat`)return t;r+=t.size}return null};parseMoof=(e,t,n)=>{let r=this.findMdatForMoof(e,t,n.byteLength);r&&h(e,t.contentStart,t.offset+t.size,i=>{i.type===`traf`&&this.parseTraf(e,i,t.offset,r,n)})};ticksToMs=(e,t)=>e/t*1e3;readCttsOffsets=(e,t,n)=>{let r=new Int32Array(n);if(!t||n===0)return r;let i=e.getUint32(t.contentStart+4,!1),a=0,o=0,s=0,c=t.contentStart+8;for(let t=0;t<n;t++)o===0&&a<i&&(o=e.getUint32(c,!1),s=e.getInt32(c+4,!1),c+=8,a++),r[t]=s,--o;return r};parseTraf=(e,t,n,r,i)=>{let a=g(e,t.contentStart,t.offset+t.size,`tfhd`),o=g(e,t.contentStart,t.offset+t.size,`tfdt`),s=g(e,t.contentStart,t.offset+t.size,`trun`);if(!a||!o||!s)return;let c=e.getUint32(a.contentStart+4,!1),l=this.tracks.get(c);if(!l)return;let u=e.getUint32(a.contentStart,!1)&16777215,d=(u&131072)!=0,f=a.contentStart+8,p=null,m=0,h=0;u&1&&(p=Number(e.getBigUint64(f,!1)),f+=8),u&2&&(f+=4),u&8&&(m=e.getUint32(f,!1),f+=4),u&16&&(h=e.getUint32(f,!1),f+=4),u&32&&(f+=4),u&8||(m=l.defaultSampleDuration??0),u&16||(h=l.defaultSampleSize??0);let _=e.getUint8(o.contentStart)===1?Number(e.getBigUint64(o.contentStart+4,!1)):e.getUint32(o.contentStart+4,!1),v=e.getUint32(s.contentStart,!1)&16777215,y=s.offset+s.size,b=s.contentStart+4;if(b+4>y)return;let x=e.getUint32(b,!1);if(b+=4,x===0||x>1e4)return;let S=0;if(v&1){if(b+4>y)return;S=e.getInt32(b,!1),b+=4}v&4&&(b+=4);let C;C=d?n:p===null?r.offset:p;let w=C+(v&1?S:0),T=_;for(let t=0;t<x;t++){let t=m,n=h,r=0;if(v&256){if(b+4>y)break;t=e.getUint32(b,!1),b+=4}if(v&512){if(b+4>y)break;n=e.getUint32(b,!1),b+=4}if(v&1024){if(b+4>y)break;r=e.getUint32(b,!1),b+=4}let a=0;if(v&2048){if(b+4>y)break;a=e.getInt32(b,!1),b+=4}if(t<=0&&l.kind===`audio`){let e=this.audioConfig?.sampleRate??l.timescale;t=Math.round(1024*l.timescale/e)}if(n<=0)continue;if(w+n>i.byteLength)break;let o=i.slice(w,w+n);w+=n;let s=this.ticksToMs(T,l.timescale),c=this.ticksToMs(T+a,l.timescale),u=c-s,d=l.kind!==`video`||!(r>>16&1)||this.isAvccKeyFrame(o)?`key`:`delta`;if(l.kind===`video`){let e=this.splitAvccNalus(o);this.on.chunk?.({kind:`video`,type:d,dts:s,pts:c,cts:u,data:o,nalus:e})}else this.on.chunk?.({kind:`audio`,type:`key`,dts:s,pts:c,cts:u,data:o});T+=t}};parseProgressive=(e,t,n)=>{let r=g(e,0,n.byteLength,`moov`);if(!r)return;let i=[];h(e,r.contentStart,r.offset+r.size,t=>{if(t.type!==`trak`)return;let r=this.collectProgressiveTrackSamples(e,t,n);i.push(...r)}),i.sort((e,t)=>e.dts-t.dts||(e.kind===`video`?-1:1));for(let e of i)this.on.chunk?.(e)};collectProgressiveTrackSamples=(e,t,n)=>{let r=[],i=g(e,t.contentStart,t.offset+t.size,`tkhd`),a=g(e,t.contentStart,t.offset+t.size,`mdia`);if(!i||!a)return r;let o=e.getUint32(i.contentStart+(e.getUint8(i.contentStart)===1?20:12),!1),s=this.tracks.get(o);if(!s)return r;let c=g(e,a.contentStart,a.offset+a.size,`minf`),l=c&&g(e,c.contentStart,c.offset+c.size,`stbl`);if(!l)return r;let u=g(e,l.contentStart,l.offset+l.size,`stsz`),d=g(e,l.contentStart,l.offset+l.size,`stco`),f=g(e,l.contentStart,l.offset+l.size,`co64`),p=g(e,l.contentStart,l.offset+l.size,`stsc`),m=g(e,l.contentStart,l.offset+l.size,`stts`),h=g(e,l.contentStart,l.offset+l.size,`stss`),_=g(e,l.contentStart,l.offset+l.size,`ctts`);if(!u||!d&&!f||!m)return r;let v=e.getUint32(u.contentStart+4,!1),y=e.getUint32(u.contentStart+8,!1),b=this.readCttsOffsets(e,_,y),x=d?e.getUint32(d.contentStart+4,!1):e.getUint32(f.contentStart+4,!1),S=t=>d?e.getUint32(d.contentStart+8+(t-1)*4,!1):Number(e.getBigUint64(f.contentStart+8+(t-1)*8,!1)),C=new Set;if(h){let t=e.getUint32(h.contentStart+4,!1);for(let n=0;n<t;n++)C.add(e.getUint32(h.contentStart+8+n*4,!1))}let w=[];if(p){let t=e.getUint32(p.contentStart+4,!1);for(let n=0;n<t;n++){let t=p.contentStart+8+n*12;w.push({firstChunk:e.getUint32(t,!1),samplesPerChunk:e.getUint32(t+4,!1)})}}let T=e=>{if(w.length===0)return y===x?1:Math.max(1,Math.ceil(y/x));let t=w[0].samplesPerChunk;for(let n of w)if(n.firstChunk<=e)t=n.samplesPerChunk;else break;return t},E=0,D=m.contentStart+8,O=e.getUint32(m.contentStart+4,!1),k=0,A=O>0?e.getUint32(D,!1):0,j=O>0?e.getUint32(D+4,!1):0;D+=8;let M=1;for(let t=1;t<=x&&M<=y;t++){let i=T(t),a=S(t);for(let t=0;t<i&&M<=y;t++,M++){let t=v===0?e.getUint32(u.contentStart+12+(M-1)*4,!1):v;if(a+t>n.byteLength)return r;let i=n.slice(a,a+t);a+=t;let o=this.ticksToMs(E,s.timescale),c=b[M-1]??0,l=this.ticksToMs(E+c,s.timescale),d=l-o,f=s.kind===`video`?this.isAvccKeyFrame(i)||C.has(M)||C.size===0:!0;s.kind===`video`?r.push({kind:`video`,type:f?`key`:`delta`,dts:o,pts:l,cts:d,data:i,nalus:this.splitAvccNalus(i)}):r.push({kind:`audio`,type:`key`,dts:o,pts:l,cts:d,data:i}),E+=j,--A,A===0&&k+1<O&&(k+=1,D=m.contentStart+8+k*8,A=e.getUint32(D,!1),j=e.getUint32(D+4,!1))}}return r};isAvccKeyFrame=e=>{let t=0,n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;t+4<=e.byteLength;){let r=n.getUint32(t,!1);if(r<=0||t+4+r>e.byteLength)break;if((e[t+4]&31)==5)return!0;t+=4+r}return!1};splitAvccNalus=e=>{let t=[],n=0,r=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;n+4<=e.byteLength;){let i=r.getUint32(n,!1);if(i<=0||n+4+i>e.byteLength)break;t.push(e.slice(n,n+4+i)),n+=4+i}return t}};let S=new class{pattern;cacher=new e;isParseing=!1;offset=0;parser;on={};constructor(){}init=e=>{switch(this.destroy(),this.pattern=e,this.pattern){case`flv`:this.parser=new l;break;case`hls`:this.parser=new f;break;case`dash`:case`mp4`:this.parser=new x;break;default:throw Error(`is error pattern.`)}this.parser.on.info=e=>this.on.info&&this.on.info(e),this.parser.on.config=e=>this.on.config&&this.on.config(e),this.parser.on.chunk=e=>{this.cacher.pushChunk(e),this.on.chunk&&this.on.chunk(e)}};push=e=>{this.cacher.push(e),this.isParseing===!1&&this.parse()};destroy=()=>{this.cacher.destroy(),this.isParseing=!1,this.offset=0};parse=async()=>{try{if(this.isParseing=!0,!this.pattern)throw Error(`You need to set the pattern.`);if(!this.parser)throw Error(`You need to init parser.`);for(;;){let e=this.cacher.next(this.offset);if(this.offset=0,!e)break;try{let t=await this.parser.parse(e);if(this.pattern===`mp4`||this.pattern===`dash`){let t=this.parser;this.offset=t.getDiscardOffset(e.byteLength,e)}else this.offset=t}catch{this.cacher.discardPayload();continue}}this.isParseing=!1}catch{this.isParseing=!1,this.cacher.discardPayload()}}};S.on.info=e=>postMessage({action:`on.info`,data:e}),S.on.config=e=>postMessage({action:`on.config`,data:e}),S.on.chunk=e=>postMessage({action:`on.chunk`,data:e}),onmessage=e=>{let{action:t,data:n}=e.data,r=S[t];r&&r(n)}})();", Sn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", xn], { type: "text/javascript;charset=utf-8" });
3859
+ function Cn(e) {
3860
3860
  let t;
3861
3861
  try {
3862
- if (t = xn && (self.URL || self.webkitURL).createObjectURL(xn), !t) throw "";
3862
+ if (t = Sn && (self.URL || self.webkitURL).createObjectURL(Sn), !t) throw "";
3863
3863
  let n = new Worker(t, { name: e?.name });
3864
3864
  return n.addEventListener("error", () => {
3865
3865
  (self.URL || self.webkitURL).revokeObjectURL(t);
3866
3866
  }), n;
3867
3867
  } catch {
3868
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(bn), { name: e?.name });
3868
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(xn), { name: e?.name });
3869
3869
  }
3870
3870
  }
3871
- var Cn = "pr-player-demuxer", wn = class {
3872
- worker = new Sn({ name: Cn });
3871
+ var wn = "pr-player-demuxer", Tn = class {
3872
+ worker = new Cn({ name: wn });
3873
3873
  on = {};
3874
3874
  constructor() {
3875
3875
  this.worker.onmessage = (e) => {
@@ -3884,9 +3884,6 @@ var Cn = "pr-player-demuxer", wn = class {
3884
3884
  case "on.chunk":
3885
3885
  this.on.chunk && this.on.chunk(n);
3886
3886
  break;
3887
- case "on.debug":
3888
- this.on.debug && this.on.debug(n);
3889
- break;
3890
3887
  }
3891
3888
  };
3892
3889
  }
@@ -3904,21 +3901,21 @@ var Cn = "pr-player-demuxer", wn = class {
3904
3901
  data: {}
3905
3902
  }), this.worker.terminate();
3906
3903
  };
3907
- }, Tn = "(function(){let e=new class{pattern=`flv`;audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;baseTime=0;pendingChunks=[];currentChunk;isProcessing=!1;decodeTimer=0;frameTrack=!1;isFrameTrack=!1;fameTrackOption={flv:[30,50],hls:[200,300],dash:[50,100],rtmp:[50,100]};decodingSpeedRatio=1;maxDecodingSpeedRatio=2;decodingSpeed=16;fps=0;firstVideoChunkTimestamp;secondVideoChunkTimestamp;frameStartTime;lastRenderTime;nextRenderTime;on={audio:{},video:{}};constructor(){}init=e=>{this.destroy(),this.pattern=e,this.baseTime=new Date().getTime()-performance.now(),this.initDecodeInterval()};initAudio=e=>{this.audio.destroy(),this.audioDecoderConfig={...e},this.audioDecoder=new AudioDecoder({output:e=>{let t=this.decodingSpeedRatio;this.on.audio.decode&&this.on.audio.decode({audioData:e,playbackRate:t})},error:e=>{this.on.audio.error&&this.on.audio.error(e)}}),this.audioDecoder.configure(this.audioDecoderConfig)};initVideo=e=>{this.video.destroy(),this.videoDecoderConfig={...e},this.videoDecoder=new VideoDecoder({output:async e=>{this.frameStartTime||=e.timestamp;try{let t=e.timestamp-this.frameStartTime+this.baseTime*1e3,n=await createImageBitmap(e);if(e.close(),!n.width||!n.height)return n.close();this.on.video.decode&&this.on.video.decode({timestamp:t,bitmap:n}),this.currentChunk&&this.currentChunk.kind===`video`&&this.currentChunk.nalus&&this.on.nalus&&this.on.nalus(this.currentChunk.nalus)}catch{e.close()}},error:e=>{this.on.video.error&&this.on.video.error(e)}}),this.videoDecoder.configure(this.videoDecoderConfig)};setFrameTrack=e=>{this.frameTrack=e,this.frameTrack===!1&&(this.decodingSpeedRatio=1)};push=e=>{this.pendingChunks.push(e)};destroy=()=>{this.audio.destroy(),this.video.destroy(),this.pendingChunks=[],this.firstVideoChunkTimestamp=void 0,this.secondVideoChunkTimestamp=void 0,this.frameStartTime=void 0,this.lastRenderTime=void 0,this.nextRenderTime=void 0,clearInterval(this.decodeTimer)};initDecodeInterval=()=>{let e=this.decodingSpeed/this.decodingSpeedRatio,t=this.baseTime+performance.now();if(this.lastRenderTime||=t,this.fps=Math.round(1e3/(t-this.lastRenderTime)),this.lastRenderTime=t,this.nextRenderTime){let t=this.lastRenderTime-this.nextRenderTime;e-=t}this.nextRenderTime=this.lastRenderTime+e,this.decodeTimer=setTimeout(()=>{this.decode(),this.initDecodeInterval()},e)};decode=()=>{if(this.isProcessing!==!0){for(this.isProcessing=!0;this.currentChunk=this.pendingChunks.shift(),this.currentChunk;){let e=this.pendingChunks.length;if(this.frameTrack){let[t,n]=this.fameTrackOption[this.pattern];if(e<=t&&(this.isFrameTrack=!1),e>=n&&(this.isFrameTrack=!0),this.isFrameTrack){let n=Math.min(1+(e-t)/100,this.maxDecodingSpeedRatio);this.decodingSpeedRatio=Number(n.toFixed(1))}else this.decodingSpeedRatio=1}if(this.on.analysis){let{decodingSpeed:t,decodingSpeedRatio:n,fps:r}=this;this.on.analysis({decodingSpeed:t,decodingSpeedRatio:n,fps:r,cacheLength:e})}let{kind:t,init:n}=this.currentChunk;switch(t){case`audio`:this.decodeAudio(n);break;case`video`:this.decodeVideo(n);break}if(t===`video`)break}this.isProcessing=!1}};decodeAudio=e=>{if(!this.audioDecoder)return;let t=new EncodedAudioChunk(e);this.audioDecoder.decode(t)};decodeVideo=e=>{if(this.videoDecoder&&(e.type===`key`&&(this.hasKeyFrame=!0),this.firstVideoChunkTimestamp?this.secondVideoChunkTimestamp||(this.secondVideoChunkTimestamp=e.timestamp,this.decodingSpeed=(this.secondVideoChunkTimestamp-this.firstVideoChunkTimestamp)/1e3):this.firstVideoChunkTimestamp=e.timestamp,this.hasKeyFrame)){let t=new EncodedVideoChunk(e);this.videoDecoder.decode(t)}};audio={flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}};e.on.audio.decode=e=>postMessage({action:`on.audio.decode`,data:e},[e.audioData]),e.on.audio.error=e=>postMessage({action:`on.audio.error`,data:e}),e.on.video.decode=e=>postMessage({action:`on.video.decode`,data:e},[e.bitmap]),e.on.video.error=e=>postMessage({action:`on.video.error`,data:e}),e.on.nalus=e=>postMessage({action:`on.nalus`,data:e}),e.on.analysis=e=>postMessage({action:`on.analysis`,data:e}),onmessage=t=>{let{action:n,data:r}=t.data,i=e[n];i&&i(r)}})();", En = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Tn], { type: "text/javascript;charset=utf-8" });
3908
- function Dn(e) {
3904
+ }, En = "(function(){let e=new class{pattern=`flv`;audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;baseTime=0;pendingChunks=[];currentChunk;isProcessing=!1;decodeTimer=0;frameTrack=!1;isFrameTrack=!1;fameTrackOption={flv:[30,50],hls:[200,300],dash:[50,100],mp4:[30,50],rtmp:[50,100]};decodingSpeedRatio=1;maxDecodingSpeedRatio=2;decodingSpeed=16;fps=0;firstVideoChunkTimestamp;secondVideoChunkTimestamp;frameStartTime;lastRenderTime;nextRenderTime;on={audio:{},video:{}};constructor(){}init=e=>{this.destroy(),this.pattern=e,this.baseTime=new Date().getTime()-performance.now(),this.initDecodeInterval()};initAudio=async e=>{if(this.audio.destroy(),!(await AudioDecoder.isConfigSupported(e).catch(()=>({supported:!1}))).supported){console.warn(`[Decoder] audio config not supported:`,e.codec,`audio will be skipped`),this.audioDecoderConfig=void 0,this.audioDecoder=void 0;return}this.audioDecoderConfig={...e},this.audioDecoder=new AudioDecoder({output:e=>{let t=this.decodingSpeedRatio;this.on.audio.decode&&this.on.audio.decode({audioData:e,playbackRate:t})},error:e=>{this.on.audio.error&&this.on.audio.error(e)}}),this.audioDecoder.configure(this.audioDecoderConfig)};initVideo=e=>{this.video.destroy(),this.videoDecoderConfig={...e},this.videoDecoder=new VideoDecoder({output:e=>{this.frameStartTime||=e.timestamp;try{let t=e.timestamp-this.frameStartTime+this.baseTime*1e3,n=new VideoFrame(e,{timestamp:t});if(e.close(),!n.displayWidth||!n.displayHeight){n.close();return}this.on.video.decode?.({timestamp:t,frame:n}),this.currentChunk?.kind===`video`&&this.currentChunk.nalus&&this.on.nalus?.(this.currentChunk.nalus)}catch{e.close()}},error:e=>{this.on.video.error&&this.on.video.error(e)}}),this.videoDecoder.configure(this.videoDecoderConfig)};setFrameTrack=e=>{this.frameTrack=e,this.frameTrack===!1&&(this.decodingSpeedRatio=1)};push=e=>{this.pendingChunks.push(e)};destroy=()=>{this.audio.destroy(),this.video.destroy(),this.pendingChunks=[],this.firstVideoChunkTimestamp=void 0,this.secondVideoChunkTimestamp=void 0,this.frameStartTime=void 0,this.lastRenderTime=void 0,this.nextRenderTime=void 0,clearInterval(this.decodeTimer)};initDecodeInterval=()=>{let e=this.decodingSpeed/this.decodingSpeedRatio,t=this.baseTime+performance.now();if(this.lastRenderTime||=t,this.fps=Math.round(1e3/(t-this.lastRenderTime)),this.lastRenderTime=t,this.nextRenderTime){let t=this.lastRenderTime-this.nextRenderTime;e-=t}this.nextRenderTime=this.lastRenderTime+e,this.decodeTimer=setTimeout(()=>{try{this.decode()}catch(e){console.error(`[Decoder] decode error:`,e)}this.initDecodeInterval()},e)};decode=()=>{if(this.isProcessing!==!0){for(this.isProcessing=!0;this.currentChunk=this.pendingChunks.shift(),this.currentChunk;){let e=this.pendingChunks.length;if(this.frameTrack){let[t,n]=this.fameTrackOption[this.pattern];if(e<=t&&(this.isFrameTrack=!1),e>=n&&(this.isFrameTrack=!0),this.isFrameTrack){let n=Math.min(1+(e-t)/100,this.maxDecodingSpeedRatio);this.decodingSpeedRatio=Number(n.toFixed(1))}else this.decodingSpeedRatio=1}if(this.on.analysis){let{decodingSpeed:t,decodingSpeedRatio:n,fps:r}=this;this.on.analysis({decodingSpeed:t,decodingSpeedRatio:n,fps:r,cacheLength:e})}let{kind:t,init:n}=this.currentChunk;switch(t){case`audio`:this.decodeAudio(n);break;case`video`:this.decodeVideo(n);break}if(t===`video`)break}this.isProcessing=!1}};decodeAudio=e=>{if(this.audioDecoder)try{let t=new EncodedAudioChunk(e);this.audioDecoder.decode(t)}catch(e){console.warn(`[Decoder] audio decode error (AudioDecoder may be unusable):`,e)}};decodeVideo=e=>{if(this.videoDecoder&&(e.type===`key`&&(this.hasKeyFrame=!0),this.firstVideoChunkTimestamp?this.secondVideoChunkTimestamp||(this.secondVideoChunkTimestamp=e.timestamp,this.decodingSpeed=(this.secondVideoChunkTimestamp-this.firstVideoChunkTimestamp)/1e3):this.firstVideoChunkTimestamp=e.timestamp,this.hasKeyFrame)){let t=new EncodedVideoChunk(e);this.videoDecoder.decode(t)}};audio={flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}};e.on.audio.decode=e=>postMessage({action:`on.audio.decode`,data:e},[e.audioData]),e.on.audio.error=e=>postMessage({action:`on.audio.error`,data:e}),e.on.video.decode=e=>postMessage({action:`on.video.decode`,data:e},[e.frame]),e.on.video.error=e=>postMessage({action:`on.video.error`,data:e}),e.on.nalus=e=>postMessage({action:`on.nalus`,data:e}),e.on.analysis=e=>postMessage({action:`on.analysis`,data:e}),onmessage=t=>{let{action:n,data:r}=t.data,i=e[n];i&&i(r)}})();", Dn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", En], { type: "text/javascript;charset=utf-8" });
3905
+ function On(e) {
3909
3906
  let t;
3910
3907
  try {
3911
- if (t = En && (self.URL || self.webkitURL).createObjectURL(En), !t) throw "";
3908
+ if (t = Dn && (self.URL || self.webkitURL).createObjectURL(Dn), !t) throw "";
3912
3909
  let n = new Worker(t, { name: e?.name });
3913
3910
  return n.addEventListener("error", () => {
3914
3911
  (self.URL || self.webkitURL).revokeObjectURL(t);
3915
3912
  }), n;
3916
3913
  } catch {
3917
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Tn), { name: e?.name });
3914
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(En), { name: e?.name });
3918
3915
  }
3919
3916
  }
3920
- var On = "pr-player-decoder", kn = class {
3921
- worker = new Dn({ name: On });
3917
+ var kn = "pr-player-decoder", An = class {
3918
+ worker = new On({ name: kn });
3922
3919
  on = {
3923
3920
  audio: {},
3924
3921
  video: {}
@@ -3971,26 +3968,26 @@ var On = "pr-player-decoder", kn = class {
3971
3968
  destroy = () => {
3972
3969
  this.worker.postMessage({ action: "destroy" }), this.worker.terminate();
3973
3970
  };
3974
- }, An = "(function(){let e=new class{renderMap=new Map;constructor(){}push=async e=>{let{timestamp:t}=e,{bitmap:n}=e;try{let e=[...this.renderMap.keys()];for(let r of e){let e=this.renderMap.get(r);if(!e)continue;let{pause:i=!1,writer:a,offscreen:o,option:s}=e;if(i===!0)continue;let c=async e=>{if(a){let n=new VideoFrame(e,{timestamp:t});try{await a.write(n)}catch{}n.close()}else o&&(o.width=e.width,o.height=e.height,o?.getContext(`2d`)?.drawImage(e,0,0))};if(r===`default`)await c(n);else if(s){let{sx:e=0,sy:t=0,sw:r=n.width,sh:i=n.height}=s;await c(await createImageBitmap(n,e,t,r,i))}}}catch{}n.close()};addCut=e=>{let{key:t,writable:n,offscreen:r,option:i}={key:`default`,...e};if(n){let e=n.getWriter();this.renderMap.set(t,{writer:e,option:i,pause:!1})}else this.renderMap.set(t,{offscreen:r,option:i,pause:!1})};delCut=e=>{this.renderMap.delete(e)};setCut=e=>{let{key:t,cutOption:n}={key:`default`,...e},r=this.renderMap.get(t);r&&this.renderMap.set(t,{...r,option:n})};setPause=e=>{let{key:t,pause:n}={key:`default`,...e},r=this.renderMap.get(t);r&&this.renderMap.set(t,{...r,pause:n})};destroy=()=>{this.renderMap=new Map}};onmessage=t=>{let{action:n,data:r}=t.data,i=e[n];i&&i(r)}})();", jn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", An], { type: "text/javascript;charset=utf-8" });
3975
- function Mn(e) {
3971
+ }, jn = "(function(){let e=new class{renderMap=new Map;constructor(){}push=async e=>{let t=e.frame,n=t.timestamp;try{let e=[...this.renderMap.entries()].filter(([,e])=>e&&!e.pause);if(e.length===1&&e[0][0]===\"default\"&&e[0][1].writer){e[0][1].writer.write(t).catch(()=>{}),t.close();return}for(let[r,i]of e){let{writer:e,offscreen:a,option:o}=i;if(e){let i;if(r===\"default\"||!o)i=new VideoFrame(t,{timestamp:n});else{let{sx:e=0,sy:r=0,sw:a=t.displayWidth,sh:s=t.displayHeight}=o;i=new VideoFrame(t,{visibleRect:{x:e,y:r,width:a,height:s},displayWidth:a,displayHeight:s,timestamp:n})}e.write(i).catch(()=>{}),i.close()}else if(a)if(r===\"default\"||!o)a.width=t.displayWidth,a.height=t.displayHeight,a.getContext(`2d`)?.drawImage(t,0,0);else{let{sx:e=0,sy:n=0,sw:r=t.displayWidth,sh:i=t.displayHeight}=o;a.width=r,a.height=i,a.getContext(`2d`)?.drawImage(t,e,n,r,i,0,0,r,i)}}}catch{}t.close()};addCut=e=>{let{key:t,writable:n,offscreen:r,cutOption:i}={key:`default`,...e},a=this._getSafeSize(i);if(n){let e=n.getWriter();this.renderMap.set(t,{writer:e,option:a,pause:!1})}else this.renderMap.set(t,{offscreen:r,option:a,pause:!1})};delCut=e=>{this.renderMap.delete(e)};setCut=e=>{let{key:t,cutOption:n}={key:`default`,...e},r=this.renderMap.get(t);if(r){let e=this._getSafeSize(n);this.renderMap.set(t,{...r,option:e})}};setPause=e=>{let{key:t,pause:n}={key:`default`,...e},r=this.renderMap.get(t);r&&this.renderMap.set(t,{...r,pause:n})};_getSafeSize=e=>{let t={...e};return t.sx%2!=0&&(t.sx+=1),t.sy%2!=0&&(t.sy+=1),t.sw%2!=0&&--t.sw,t.sh%2!=0&&--t.sh,t};destroy=()=>{this.renderMap=new Map}};onmessage=t=>{let{action:n,data:r}=t.data,i=e[n];i&&i(r)}})();", Mn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", jn], { type: "text/javascript;charset=utf-8" });
3972
+ function Nn(e) {
3976
3973
  let t;
3977
3974
  try {
3978
- if (t = jn && (self.URL || self.webkitURL).createObjectURL(jn), !t) throw "";
3975
+ if (t = Mn && (self.URL || self.webkitURL).createObjectURL(Mn), !t) throw "";
3979
3976
  let n = new Worker(t, { name: e?.name });
3980
3977
  return n.addEventListener("error", () => {
3981
3978
  (self.URL || self.webkitURL).revokeObjectURL(t);
3982
3979
  }), n;
3983
3980
  } catch {
3984
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(An), { name: e?.name });
3981
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(jn), { name: e?.name });
3985
3982
  }
3986
3983
  }
3987
- var Nn = "pr-player-render", Pn = class {
3988
- worker = new Mn({ name: Nn });
3984
+ var Pn = "pr-player-render", Fn = class {
3985
+ worker = new Nn({ name: Pn });
3989
3986
  constructor() {}
3990
3987
  push = (e) => this.worker.postMessage({
3991
3988
  action: "push",
3992
3989
  data: e
3993
- }, [e.bitmap]);
3990
+ }, [e.frame]);
3994
3991
  addCut = (e) => {
3995
3992
  let t = [];
3996
3993
  e.writable && t.push(e.writable), e.offscreen && t.push(e.offscreen), this.worker.postMessage({
@@ -4016,15 +4013,15 @@ var Nn = "pr-player-render", Pn = class {
4016
4013
  data: {}
4017
4014
  }), this.worker.terminate();
4018
4015
  };
4019
- }, Fn = "data:text/javascript;base64,LyoqDQogKiDpnZnpn7Pml7bvvJrlnKjpopHln5/ku4Xkv53nlZkgYmluIDDvvZ4077yI6ZqP5py677yJ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dGhpcy5fc2lsZW50T2ZmKytdDQogICAgICBmb3IgKGxldCBubyA9IDA7IG5vIDwgb3V0cHV0cy5sZW5ndGg7IG5vKyspIHsNCiAgICAgICAgY29uc3Qgb3V0UG9ydHMgPSBvdXRwdXRzW25vXQ0KICAgICAgICBpZiAoIW91dFBvcnRzKSBjb250aW51ZQ0KICAgICAgICBmb3IgKGxldCBjaCA9IDA7IGNoIDwgb3V0UG9ydHMubGVuZ3RoOyBjaCsrKSB7DQogICAgICAgICAgY29uc3QgY2hhbm5lbCA9IG91dFBvcnRzW2NoXQ0KICAgICAgICAgIGlmIChjaGFubmVsKSBjaGFubmVsW2ldID0gdg0KICAgICAgICB9DQogICAgICB9DQogICAgfQ0KICB9DQoNCiAgc3RhdGljIGNvcHlJbnB1dHNUb091dHB1dHMoaW5wdXRzLCBvdXRwdXRzKSB7DQogICAgZm9yIChsZXQgbm8gPSAwOyBubyA8IG91dHB1dHMubGVuZ3RoOyBubysrKSB7DQogICAgICBjb25zdCBvdXRQb3J0cyA9IG91dHB1dHNbbm9dDQogICAgICBjb25zdCBpblBvcnRzID0gaW5wdXRzW25vXQ0KICAgICAgaWYgKCFvdXRQb3J0cykgY29udGludWUNCiAgICAgIGZvciAobGV0IGNoID0gMDsgY2ggPCBvdXRQb3J0cy5sZW5ndGg7IGNoKyspIHsNCiAgICAgICAgY29uc3Qgb3V0Q2ggPSBvdXRQb3J0c1tjaF0NCiAgICAgICAgaWYgKCFvdXRDaCkgY29udGludWUNCiAgICAgICAgY29uc3QgaW5DaCA9IGluUG9ydHMgJiYgaW5Qb3J0c1tjaF0NCiAgICAgICAgaWYgKGluQ2ggJiYgaW5DaC5sZW5ndGggPT09IG91dENoLmxlbmd0aCkgew0KICAgICAgICAgIG91dENoLnNldChpbkNoKQ0KICAgICAgICB9IGVsc2UgaWYgKGluQ2gpIHsNCiAgICAgICAgICBjb25zdCBuID0gTWF0aC5taW4oaW5DaC5sZW5ndGgsIG91dENoLmxlbmd0aCkNCiAgIC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ICAgdGhpcy5pc0Rlc3Ryb3kgPSB0cnVlDQogIH0NCn0NCg0KcmVnaXN0ZXJQcm9jZXNzb3IoJ25vdC1lbXB0eS1maWx0ZXItcHJvY2Vzc29yJywgTm90RW1wdHlGaWx0ZXJXb3JrbGV0UHJvY2Vzc29yKQ0K", Ln = class {
4020
4017
  audioContext = new AudioContext();
4021
4018
  notEmptyFilterWorkletNode;
4022
4019
  constructor() {}
4023
- createNotEmptyFilterWorkletNode = async (e) => (this.destroy(), this.audioContext = e, await this.audioContext.audioWorklet.addModule(Fn), this.notEmptyFilterWorkletNode = new AudioWorkletNode(this.audioContext, "not-empty-filter-processor"), this.notEmptyFilterWorkletNode);
4020
+ createNotEmptyFilterWorkletNode = async (e) => (this.destroy(), this.audioContext = e, await this.audioContext.audioWorklet.addModule(In), this.notEmptyFilterWorkletNode = new AudioWorkletNode(this.audioContext, "not-empty-filter-processor"), this.notEmptyFilterWorkletNode);
4024
4021
  destroy = () => {
4025
4022
  this.notEmptyFilterWorkletNode?.disconnect(), this.notEmptyFilterWorkletNode?.port.postMessage({ type: "destroy" }), this.notEmptyFilterWorkletNode = void 0;
4026
4023
  };
4027
- }, Ln = class {
4024
+ }, Rn = class {
4028
4025
  inputStream = new MediaStream();
4029
4026
  outputStream = new MediaStream();
4030
4027
  inputGain = 1;
@@ -4050,7 +4047,7 @@ var Nn = "pr-player-render", Pn = class {
4050
4047
  notEmpty = !1;
4051
4048
  rnnoiseWorklet;
4052
4049
  rnnoiseWorkletNode;
4053
- notEmptyFilterWorklet = new In();
4050
+ notEmptyFilterWorklet = new Ln();
4054
4051
  notEmptyFilterWorkletNode;
4055
4052
  filterStream = (e) => e;
4056
4053
  constructor(e, t) {
@@ -4142,7 +4139,7 @@ var Nn = "pr-player-render", Pn = class {
4142
4139
  for (let e of this.outputStream.getTracks()) e.stop(), this.outputStream.removeTrack(e);
4143
4140
  this.notEmpty = !1, this.denoise = !1, this.mute = !0, !this.isExternalAudioContext && this.audioContext.state !== "closed" && await this.audioContext.close();
4144
4141
  };
4145
- }, Rn = async (e, t) => {
4142
+ }, zn = async (e, t) => {
4146
4143
  try {
4147
4144
  let { format: n, numberOfChannels: r, numberOfFrames: i, sampleRate: a } = t, o = e.createBuffer(r, i, a);
4148
4145
  for (let e = 0; e < r; e++) {
@@ -4173,7 +4170,7 @@ var Nn = "pr-player-render", Pn = class {
4173
4170
  } catch (e) {
4174
4171
  throw console.error("Failed to convert AudioData to AudioBuffer:", e), e;
4175
4172
  }
4176
- }, zn = class {
4173
+ }, Bn = class {
4177
4174
  prAudioStream;
4178
4175
  audioContext;
4179
4176
  destination;
@@ -4182,19 +4179,19 @@ var Nn = "pr-player-render", Pn = class {
4182
4179
  pendingSources = [];
4183
4180
  constructor() {}
4184
4181
  init = (e) => {
4185
- e ||= new (window.AudioContext || window.webkitAudioContext)(), this.audioContext = e, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new Ln(this.stream, this.audioContext), this.nextStartTime = 0, this.pendingSources = [];
4182
+ e ||= new (window.AudioContext || window.webkitAudioContext)(), this.audioContext = e, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new Rn(this.stream, this.audioContext), this.nextStartTime = 0, this.pendingSources = [];
4186
4183
  };
4187
4184
  async push(e) {
4188
4185
  let { audioData: t, playbackRate: n = 1 } = e;
4189
4186
  if (!this.audioContext || !this.destination) return;
4190
- let r = await Rn(this.audioContext, t);
4187
+ let r = await zn(this.audioContext, t);
4191
4188
  if (t.close(), !r) return;
4192
4189
  let i = this.audioContext.createBufferSource();
4193
4190
  i.buffer = r, i.playbackRate.value = n;
4194
4191
  let a = -1200 * Math.log2(n);
4195
4192
  i.detune.value = a, i.connect(this.destination);
4196
- let o = Math.max(this.nextStartTime, this.audioContext.currentTime);
4197
- this.nextStartTime = o + r.duration / n, i.start(o), this.pendingSources.push(i), i.onended = () => {
4193
+ let o = Math.max(this.nextStartTime, this.audioContext.currentTime), s = r.duration / n;
4194
+ this.nextStartTime = o + s, i.start(o), this.pendingSources.push(i), i.onended = () => {
4198
4195
  this.pendingSources = this.pendingSources.filter((e) => e !== i);
4199
4196
  }, this.audioContext.state === "suspended" && await this.audioContext.resume();
4200
4197
  }
@@ -4202,13 +4199,13 @@ var Nn = "pr-player-render", Pn = class {
4202
4199
  destroy() {
4203
4200
  this.audioContext?.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, this.prAudioStream?.stop(), this.prAudioStream?.destroy(), this.pendingSources.forEach((e) => e.stop()), this.pendingSources = [];
4204
4201
  }
4205
- }, Bn = (e) => {
4206
- let t = e.toLowerCase();
4207
- return t.includes(".m3u8") || t.includes("hls") || t.includes("master.m3u8") || t.match(/index\d*\.m3u8/) ? "hls" : t.includes(".mpd") || t.includes("dash") ? "dash" : t.startsWith("rtmp://") || t.startsWith("rtmps://") ? "rtmp" : t.includes(".flv") || t.includes("flv") && !t.includes("flash") ? "flv" : "unknown";
4208
4202
  }, Vn = (e) => {
4203
+ let t = e.toLowerCase();
4204
+ return t.includes(".m3u8") || t.includes("hls") || t.includes("master.m3u8") || t.match(/index\d*\.m3u8/) ? "hls" : t.includes(".mpd") || t.includes("dash") ? "dash" : t.includes(".mp4") || t.includes(".m4s") ? "mp4" : t.startsWith("rtmp://") || t.startsWith("rtmps://") ? "rtmp" : t.includes(".flv") || t.includes("flv") && !t.includes("flash") ? "flv" : "unknown";
4205
+ }, Hn = (e) => {
4209
4206
  let t = e?.getTracks() || [];
4210
4207
  for (let e of t) e.stop();
4211
- }, Hn = class {
4208
+ }, Un = class {
4212
4209
  resolvesMap = /* @__PURE__ */ new Map();
4213
4210
  index = 0;
4214
4211
  constructor() {}
@@ -4240,27 +4237,102 @@ var Nn = "pr-player-render", Pn = class {
4240
4237
  n && (clearTimeout(n.timer), n.resolve(), t.delete(e));
4241
4238
  }
4242
4239
  };
4243
- }, Un = (e) => {
4244
- let t = new DataView(e.buffer), n = 0, r, i, a;
4245
- r = t.getUint32(n, !1), n += 4;
4246
- {
4247
- let e = t.getUint8(n);
4248
- i = {
4249
- forbidden_zero_bit: e >> 7 & 1,
4250
- nal_ref_idc: e >> 5 & 3,
4251
- nal_unit_type: e & 31
4252
- }, n += 1;
4253
- }
4254
- {
4255
- let e = r - 1;
4256
- a = new Uint8Array(t.buffer.slice(n, n + e));
4240
+ }, Wn = (e) => {
4241
+ let t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = 0, r = t.getUint32(n, !1);
4242
+ n += 4;
4243
+ let i = t.getUint8(n), a = {
4244
+ forbidden_zero_bit: i >> 7 & 1,
4245
+ nal_ref_idc: i >> 5 & 3,
4246
+ nal_unit_type: i & 31
4247
+ };
4248
+ return n += 1, {
4249
+ size: r,
4250
+ header: a,
4251
+ data: new Uint8Array(e.buffer, e.byteOffset + n, r - 1)
4252
+ };
4253
+ }, $ = (e, t) => e.match(RegExp(`${t}="([^"]*)"`, "i"))?.[1], Gn = (e) => {
4254
+ let [t, n] = e.split("-").map((e) => parseInt(e, 10));
4255
+ return {
4256
+ start: t,
4257
+ end: n
4258
+ };
4259
+ }, Kn = (e) => {
4260
+ if (!e) return;
4261
+ let t = e.match(/PT(?:(\d+)H)?(?:(\d+)M)?(?:([\d.]+)S)?/i);
4262
+ if (!t) return;
4263
+ let n = parseInt(t[1] || "0", 10), r = parseInt(t[2] || "0", 10), i = parseFloat(t[3] || "0");
4264
+ return n * 3600 + r * 60 + i;
4265
+ }, qn = (e, t) => {
4266
+ if (!t) return e;
4267
+ if (/^https?:\/\//i.test(t)) return t;
4268
+ if (t.startsWith("/")) {
4269
+ let n = e.match(/^(https?:\/\/[^/]+)/i)?.[1];
4270
+ return n ? `${n}${t}` : t;
4271
+ }
4272
+ return e + t;
4273
+ }, Jn = (e, t) => e.replace(/\$(RepresentationID|\w+)(?:%0(\d+)d)?\$/g, (e, n, r) => {
4274
+ let i = t[n] ?? t[n.toLowerCase()] ?? "";
4275
+ return r ? String(i).padStart(Number(r), "0") : String(i);
4276
+ }), Yn = (e, t, n) => qn(e, Jn(t, n)), Xn = (e, t) => {
4277
+ let n = e.match(/<SegmentList([^>]*)>([\s\S]*?)<\/SegmentList>/i) || t.match(/<SegmentList([^>]*)>([\s\S]*?)<\/SegmentList>/i);
4278
+ if (!n) return;
4279
+ let r = n[1], i = n[2], a = i.match(/<Initialization[^>]*range="([^"]+)"/i), o = [], s = /<SegmentURL[^>]*mediaRange="([^"]+)"/gi, c;
4280
+ for (; c = s.exec(i);) o.push(Gn(c[1]));
4281
+ if (!(o.length === 0 && !a)) return {
4282
+ timescale: parseInt($(r, "timescale") || "1000", 10),
4283
+ duration: parseInt($(r, "duration") || "0", 10),
4284
+ initRange: a ? Gn(a[1]) : void 0,
4285
+ segments: o
4286
+ };
4287
+ }, Zn = (e, t) => {
4288
+ let n = e.match(/<SegmentTemplate([^>]*)\/>/i)?.[1] || e.match(/<SegmentTemplate([^>]*)>/i)?.[1] || t.match(/<SegmentTemplate([^>]*)\/>/i)?.[1] || t.match(/<SegmentTemplate([^>]*)>/i)?.[1] || "";
4289
+ if (!n) {
4290
+ let t = e.match(/<SegmentURL[^>]*initialization="([^"]*)"[^>]*media="([^"]*)"/i);
4291
+ return t ? {
4292
+ initialization: t[1],
4293
+ media: t[2],
4294
+ timescale: 1e3,
4295
+ duration: 0,
4296
+ startNumber: 1
4297
+ } : void 0;
4257
4298
  }
4258
4299
  return {
4259
- size: r,
4260
- header: i,
4261
- data: a
4300
+ initialization: $(n, "initialization"),
4301
+ media: $(n, "media"),
4302
+ timescale: parseInt($(n, "timescale") || "1000", 10),
4303
+ duration: parseInt($(n, "duration") || "0", 10),
4304
+ startNumber: parseInt($(n, "startNumber") || "1", 10)
4305
+ };
4306
+ }, Qn = (e, t) => {
4307
+ let n = t.substring(0, t.lastIndexOf("/") + 1), r = e.match(/<MPD[^>]*>/i)?.[0] || "", i = ($(r, "type") || "static") === "dynamic", a = Kn($(r, "mediaPresentationDuration")), o = [], s = /<AdaptationSet([^>]*)>([\s\S]*?)<\/AdaptationSet>/gi, c;
4308
+ for (; c = s.exec(e);) {
4309
+ let e = c[1], t = c[2], n = $(e, "mimeType") || "", r = $(e, "contentType") || "", i = n.includes("video") || r === "video" || /<ContentComponent[^>]*contentType="video"/i.test(t), a = n.includes("audio") || r === "audio" || /<ContentComponent[^>]*contentType="audio"/i.test(t), s;
4310
+ if (i && a ? s = "mux" : i ? s = "video" : a && (s = "audio"), !s) continue;
4311
+ let l = t.match(/<Representation([^>]*)(?:\/>|>([\s\S]*?)<\/Representation>)/i);
4312
+ if (!l) continue;
4313
+ let u = l[1], d = l[2] || "", ee = $(u, "id") || "0", f = $(u, "codecs") || "", te = parseInt($(u, "bandwidth") || "0", 10), ne = parseInt($(u, "width") || "0", 10) || void 0, re = parseInt($(u, "height") || "0", 10) || void 0, p = d.match(/<BaseURL>([^<]+)<\/BaseURL>/i)?.[1]?.trim(), m = Xn(d, t), h = m ? void 0 : Zn(d, t);
4314
+ !m && (!h || !h.media && !h.initialization) || o.push({
4315
+ kind: s,
4316
+ mimeType: n || (i ? "video/mp4" : "audio/mp4"),
4317
+ representation: {
4318
+ id: ee,
4319
+ codecs: f,
4320
+ bandwidth: te,
4321
+ width: ne,
4322
+ height: re,
4323
+ baseUrl: p,
4324
+ template: h,
4325
+ segmentList: m
4326
+ }
4327
+ });
4328
+ }
4329
+ return {
4330
+ isLive: i,
4331
+ duration: a,
4332
+ baseUrl: n,
4333
+ adaptations: o
4262
4334
  };
4263
- }, Wn = class {
4335
+ }, $n = class {
4264
4336
  #e = {
4265
4337
  timeout: 5 * 1e3,
4266
4338
  check: !1
@@ -4319,15 +4391,12 @@ var Nn = "pr-player-render", Pn = class {
4319
4391
  e.name = "AbortError", this.#t.abort(e);
4320
4392
  }
4321
4393
  };
4322
- }, Gn = class {
4323
- option = {
4324
- debug: !1,
4325
- frameTrack: !1
4326
- };
4394
+ }, er = class {
4395
+ option = { frameTrack: !1 };
4327
4396
  converter = "MediaStreamTrackGenerator" in window ? "generator" : "canvas";
4328
- prFetch = new Wn();
4329
- getSegmentsFetch = new Wn();
4330
- prResolves = new Hn();
4397
+ prFetch = new $n();
4398
+ getSegmentsFetch = new $n();
4399
+ prResolves = new Un();
4331
4400
  url = "";
4332
4401
  start_resolve;
4333
4402
  demuxerWorker;
@@ -4342,12 +4411,11 @@ var Nn = "pr-player-render", Pn = class {
4342
4411
  cutRenders = /* @__PURE__ */ new Map();
4343
4412
  trackGenerator;
4344
4413
  constructor(e = {}) {
4345
- let { debug: t = !1 } = e;
4346
- this.option.debug = t;
4414
+ this.option.frameTrack = e.frameTrack ?? !1;
4347
4415
  }
4348
4416
  start = async (e) => {
4349
4417
  await this.stop(), this.url = e;
4350
- let t = Bn(e);
4418
+ let t = Vn(e);
4351
4419
  if (t === "unknown") throw Error("This address cannot be parsed.");
4352
4420
  switch (this.init(t), t) {
4353
4421
  case "flv":
@@ -4356,11 +4424,18 @@ var Nn = "pr-player-render", Pn = class {
4356
4424
  case "hls":
4357
4425
  this.hls.start();
4358
4426
  break;
4427
+ case "dash":
4428
+ this.dash.start();
4429
+ break;
4430
+ case "mp4":
4431
+ this.mp4.start();
4432
+ break;
4433
+ case "rtmp": throw Error("RTMP is not supported in browser. Please use HTTP-FLV or HLS.");
4359
4434
  }
4360
4435
  };
4361
4436
  stop = async () => {
4362
4437
  try {
4363
- this.url = "", clearInterval(this.hls.getSegmentsTimer), this.prFetch.stop(), this.getSegmentsFetch.stop(), this.demuxerWorker?.destroy(), this.decoderWorker?.destroy(), this.renderWorker?.destroy(), this.cutRenders = /* @__PURE__ */ new Map(), Vn(this.stream), this.audioPlayer?.destroy();
4438
+ this.url = "", clearInterval(this.hls.getSegmentsTimer), clearInterval(this.dash.getSegmentsTimer), this.prFetch.stop(), this.getSegmentsFetch.stop(), this.demuxerWorker?.destroy(), this.decoderWorker?.destroy(), this.renderWorker?.destroy(), this.cutRenders = /* @__PURE__ */ new Map(), Hn(this.stream), this.audioPlayer?.destroy();
4364
4439
  } catch (e) {
4365
4440
  console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: error", e);
4366
4441
  }
@@ -4384,14 +4459,14 @@ var Nn = "pr-player-render", Pn = class {
4384
4459
  return this.renderWorker?.addCut({
4385
4460
  key: e,
4386
4461
  writable: n.writable,
4387
- option: t
4462
+ cutOption: t
4388
4463
  }), this.cutRenders.set(e, { stream: r }), r;
4389
4464
  }
4390
4465
  let n = document.createElement("canvas"), r = n.captureStream(), i = n.transferControlToOffscreen();
4391
4466
  return this.renderWorker?.addCut({
4392
4467
  key: e,
4393
4468
  offscreen: i,
4394
- option: t
4469
+ cutOption: t
4395
4470
  }), this.cutRenders.set(e, { stream: r }), r;
4396
4471
  },
4397
4472
  setCut: (e, t) => {
@@ -4412,24 +4487,23 @@ var Nn = "pr-player-render", Pn = class {
4412
4487
  }
4413
4488
  };
4414
4489
  init = (e) => {
4415
- this.initRender(), this.initDecoder(e), this.initDemuxer(e), this.audioPlayer = new zn(), this.audioPlayer.init();
4490
+ this.initRender(), this.initDecoder(e), this.initDemuxer(e), this.audioPlayer = new Bn(), this.audioPlayer.init();
4416
4491
  };
4417
4492
  initDemuxer = (e) => {
4418
- this.demuxerWorker = new wn(), this.demuxerWorker.init(e), this.demuxerWorker.on.debug = (e) => {
4419
- this.option.debug && this.on.debug && this.on.debug(e);
4420
- }, this.demuxerWorker.on.info = (e) => {
4421
- this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: info", e), this.on.demuxer.info && this.on.demuxer.info(e);
4493
+ this.demuxerWorker = new Tn(), this.demuxerWorker.init(e), this.demuxerWorker.on.info = (e) => {
4494
+ this.on.demuxer.info && this.on.demuxer.info(e);
4422
4495
  }, this.demuxerWorker.on.config = (e) => {
4423
- this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: config", e), this.on.demuxer.config && this.on.demuxer.config(e);
4496
+ this.on.demuxer.config && this.on.demuxer.config(e);
4424
4497
  let { kind: t } = e;
4425
4498
  switch (t) {
4426
4499
  case "audio":
4427
4500
  {
4428
- let { codec: t, sampleRate: n, numberOfChannels: r } = e;
4501
+ let { codec: t, sampleRate: n, numberOfChannels: r, description: i } = e;
4429
4502
  this.decoderWorker?.initAudio({
4430
4503
  codec: t,
4431
4504
  sampleRate: n,
4432
- numberOfChannels: r
4505
+ numberOfChannels: r,
4506
+ ...i ? { description: i } : {}
4433
4507
  });
4434
4508
  }
4435
4509
  break;
@@ -4478,20 +4552,20 @@ var Nn = "pr-player-render", Pn = class {
4478
4552
  };
4479
4553
  };
4480
4554
  initDecoder = (e) => {
4481
- this.decoderWorker = new kn(), this.decoderWorker.init(e);
4555
+ this.decoderWorker = new An(), this.decoderWorker.init(e);
4482
4556
  let { frameTrack: t = !1 } = this.option;
4483
- this.decoderWorker.setFrameTrack(t), this.decoderWorker.on.audio.decode = (e) => {
4557
+ this.decoderWorker.setFrameTrack(t), this.decoderWorker.on.audio.error = (e) => {
4558
+ this.on.error && this.on.error(e);
4559
+ }, this.decoderWorker.on.audio.decode = (e) => {
4484
4560
  this.audioPlayer?.push(e), this.on.decoder.audio && this.on.decoder.audio(e);
4485
- }, this.decoderWorker.on.audio.error = (e) => {
4486
- this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: audio.error ", e), this.on.error && this.on.error(e);
4487
- }, this.decoderWorker.on.video.decode = async (e) => {
4561
+ }, this.decoderWorker.on.video.decode = (e) => {
4488
4562
  this.start_resolve &&= (this.start_resolve(!0), void 0), this.renderWorker?.push(e), this.on.decoder.video && this.on.decoder.video(e);
4489
4563
  }, this.decoderWorker.on.video.error = (e) => {
4490
4564
  this.on.error && this.on.error(e);
4491
4565
  }, this.decoderWorker.on.nalus = async (e) => {
4492
4566
  for (let t of e) {
4493
4567
  if (t.byteLength <= 4) continue;
4494
- let { header: e, data: n } = Un(t), { nal_unit_type: r } = e;
4568
+ let { header: e, data: n } = Wn(t), { nal_unit_type: r } = e;
4495
4569
  r === 6 && this.on.decoder.sei && this.on.decoder.sei(n);
4496
4570
  }
4497
4571
  }, this.decoderWorker.on.analysis = (e) => {
@@ -4499,7 +4573,7 @@ var Nn = "pr-player-render", Pn = class {
4499
4573
  };
4500
4574
  };
4501
4575
  initRender = () => {
4502
- if (this.renderWorker = new Pn(), this.converter === "generator") {
4576
+ if (this.renderWorker = new Fn(), this.converter === "generator") {
4503
4577
  let e = new MediaStreamTrackGenerator({ kind: "video" }), t = new MediaStream([e]);
4504
4578
  this.renderWorker?.addCut({ writable: e.writable }), this.stream = t;
4505
4579
  } else {
@@ -4601,13 +4675,201 @@ var Nn = "pr-player-render", Pn = class {
4601
4675
  }
4602
4676
  })
4603
4677
  };
4604
- }, Kn = /* @__PURE__ */ yn("Cg1DZG5EYXRhLnByb3RvEhVjb20ucXVpY2sudm9pY2UucHJvdG8iawoHU2VpRGF0YRIvCgVldmVudBgBIAEoDjIgLmNvbS5xdWljay52b2ljZS5wcm90by5FdmVudFR5cGUSDAoEZGF0YRgCIAEoDBIQCghjb21wcmVzcxgDIAEoCBIPCgd2ZXJzaW9uGAQgASgFIq4CCgpMYXlvdXREYXRhEg4KBnJvb21JZBgBIAEoCRIvCgR0eXBlGAIgASgOMiEuY29tLnF1aWNrLnZvaWNlLnByb3RvLkxheW91dFR5cGUSPwoHdXNlck1hcBgDIAMoCzIuLmNvbS5xdWljay52b2ljZS5wcm90by5MYXlvdXREYXRhLlVzZXJNYXBFbnRyeRI8CgxnbG9iYWxDdXN0b20YBCABKAsyIS5jb20ucXVpY2sudm9pY2UucHJvdG8uQ3VzdG9tSW5mb0gAiAEBGk8KDFVzZXJNYXBFbnRyeRILCgNrZXkYASABKAkSLgoFdmFsdWUYAiABKAsyHy5jb20ucXVpY2sudm9pY2UucHJvdG8uVXNlckluZm86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oNQXVkaW9BbmRWaWRlbxAAEg0KCU9ubHlBdWRpbxABEg0KCU9ubHlWaWRlbxACKiwKCUF1ZGlvVHlwZRIOCgpNaWNyb3Bob25lEAASDwoLU3lzdGVtVm9pY2UQASojCglWaWRlb1R5cGUSCgoGQ2FtZXJhEAASCgoGU2NyZWVuEAFCPwoWY29tLnF1aWNrLnBsYXllci5wcm90b0IHQ2RuRGF0YVoWY29tLnF1aWNrLnBsYXllci5wcm90b7oCA0NkbmIGcHJvdG8z"), qn = /* @__PURE__ */ Z(Kn, 0), Jn = /* @__PURE__ */ Z(Kn, 1), Yn = /* @__PURE__ */ Z(Kn, 5), Xn = () => ({
4678
+ mp4 = { start: () => new Promise(async (e, t) => {
4679
+ try {
4680
+ this.start_resolve = e;
4681
+ let n, r = 0;
4682
+ for (;;) {
4683
+ r += 1;
4684
+ try {
4685
+ n = await this.prFetch.request(this.url);
4686
+ } catch (e) {
4687
+ console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", e);
4688
+ }
4689
+ if (n?.status === 200 || r === 3) break;
4690
+ await new Promise((e) => setTimeout(() => e(!0), 500));
4691
+ }
4692
+ if (!n || n.status !== 200) return t("request is error.");
4693
+ let i = n.body?.getReader();
4694
+ if (!i) return t("reader is error.");
4695
+ for (this.decoderWorker?.setFrameTrack(!1);;) {
4696
+ let { done: e, value: t } = await i.read();
4697
+ if (t && this.demuxerWorker?.push(t), e || this.url === "") break;
4698
+ }
4699
+ } catch (e) {
4700
+ e.name !== "AbortError" && t(e);
4701
+ }
4702
+ }) };
4703
+ dash = {
4704
+ isLive: !1,
4705
+ segmentNumber: 1,
4706
+ mpdInfo: null,
4707
+ getSegmentsTimer: 0,
4708
+ fetchSegment: async (e) => {
4709
+ let t = await this.prFetch.request(e);
4710
+ if (!t || t.status !== 200) return !1;
4711
+ let n = t.body?.getReader();
4712
+ if (!n) return !1;
4713
+ for (;;) {
4714
+ let { done: e, value: t } = await n.read();
4715
+ if (t && this.demuxerWorker?.push(t), e || this.url === "") break;
4716
+ }
4717
+ return !0;
4718
+ },
4719
+ fetchByteRange: async (e, t, n) => {
4720
+ let r, i = 0;
4721
+ for (;;) {
4722
+ i += 1;
4723
+ try {
4724
+ r = await fetch(e, { headers: { Range: `bytes=${t}-${n}` } });
4725
+ } catch (e) {
4726
+ console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", e);
4727
+ }
4728
+ if (r?.ok && (r.status === 200 || r.status === 206) || i === 3) break;
4729
+ await new Promise((e) => setTimeout(() => e(!0), 500));
4730
+ }
4731
+ if (!r?.ok || r.status !== 200 && r.status !== 206) return !1;
4732
+ let a = new Uint8Array(await r.arrayBuffer());
4733
+ return a.byteLength > 0 && this.demuxerWorker?.push(a), a.byteLength > 0;
4734
+ },
4735
+ getMpd: async () => {
4736
+ try {
4737
+ let e, t = 0;
4738
+ for (;;) {
4739
+ t += 1;
4740
+ try {
4741
+ e = await this.getSegmentsFetch.request(this.url);
4742
+ } catch (e) {
4743
+ console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", e);
4744
+ }
4745
+ if (e?.status === 200 || t === 3) break;
4746
+ await new Promise((e) => setTimeout(() => e(!0), 500));
4747
+ }
4748
+ if (!e || e.status !== 200) throw Error("request is error.");
4749
+ let n = e.body?.getReader();
4750
+ if (!n) throw Error("reader is error.");
4751
+ let r = [];
4752
+ for (;;) {
4753
+ let { done: e, value: t } = await n.read();
4754
+ if (t && r.push(t), e || this.url === "") break;
4755
+ }
4756
+ let i = r.reduce((e, t) => e + t.byteLength, 0), a = new Uint8Array(i), o = 0;
4757
+ for (let e of r) a.set(e, o), o += e.byteLength;
4758
+ let s = Qn(new TextDecoder("utf-8").decode(a), this.url);
4759
+ return this.dash.mpdInfo = s, this.dash.isLive = s.isLive, this.dash.isLive || (this.option.frameTrack = !1), s;
4760
+ } catch (e) {
4761
+ return e.name !== "AbortError" && this.on.error && this.on.error(e), null;
4762
+ }
4763
+ },
4764
+ start: () => new Promise(async (e, t) => {
4765
+ try {
4766
+ this.start_resolve = e, this.dash.segmentNumber = 1, this.dash.mpdInfo = null;
4767
+ let n = await this.dash.getMpd();
4768
+ if (!n) return t("mpd parse is error.");
4769
+ let r = n.adaptations.find((e) => e.kind === "video" || e.kind === "mux")?.representation;
4770
+ if (r?.width && r?.height) {
4771
+ let e = {
4772
+ width: r.width,
4773
+ height: r.height,
4774
+ duration: n.duration
4775
+ };
4776
+ this.on.demuxer.info && this.on.demuxer.info(e);
4777
+ }
4778
+ let i = n.adaptations.find((e) => e.representation.segmentList);
4779
+ if (i?.representation.segmentList) {
4780
+ let { segmentList: e, baseUrl: r } = i.representation, a = qn(n.baseUrl, r || "");
4781
+ if (e.initRange) {
4782
+ let { start: n, end: r } = e.initRange;
4783
+ if (!await this.dash.fetchByteRange(a, n, r)) return t("dash init segment fetch failed.");
4784
+ }
4785
+ this.decoderWorker?.setFrameTrack(!1);
4786
+ for (let t of e.segments) {
4787
+ if (this.url === "") break;
4788
+ await this.dash.fetchByteRange(a, t.start, t.end);
4789
+ }
4790
+ return;
4791
+ }
4792
+ let a = [
4793
+ n.adaptations.find((e) => e.kind === "video"),
4794
+ n.adaptations.find((e) => e.kind === "audio"),
4795
+ n.adaptations.find((e) => e.kind === "mux")
4796
+ ].filter((e) => !!e);
4797
+ if (a.length === 0) return t("no adaptation in mpd.");
4798
+ for (let e of a) {
4799
+ let { id: t, bandwidth: r, template: i } = e.representation;
4800
+ if (!i?.initialization) continue;
4801
+ let a = Yn(n.baseUrl, i.initialization, {
4802
+ RepresentationID: t,
4803
+ Bandwidth: r,
4804
+ Number: this.dash.segmentNumber
4805
+ });
4806
+ await this.dash.fetchSegment(a);
4807
+ }
4808
+ for (this.dash.isLive ? this.dash.getSegmentsTimer = window.setInterval(this.dash.getMpd, 3e3) : this.decoderWorker?.setFrameTrack(!1);;) {
4809
+ let e = this.dash.mpdInfo;
4810
+ if (!e || this.url === "") break;
4811
+ let { baseUrl: t } = e, n = !1;
4812
+ for (let e of a) {
4813
+ let { id: r, bandwidth: i, template: a } = e.representation;
4814
+ if (!a?.media) continue;
4815
+ let o = Yn(t, a.media, {
4816
+ RepresentationID: r,
4817
+ Bandwidth: i,
4818
+ Number: this.dash.segmentNumber
4819
+ });
4820
+ await this.dash.fetchSegment(o) && (n = !0);
4821
+ }
4822
+ if (!n) {
4823
+ if (this.dash.isLive) {
4824
+ await new Promise((e) => setTimeout(() => e(!0), 300));
4825
+ continue;
4826
+ }
4827
+ break;
4828
+ }
4829
+ this.dash.segmentNumber += 1;
4830
+ }
4831
+ } catch (e) {
4832
+ e.name !== "AbortError" && t(e);
4833
+ }
4834
+ })
4835
+ };
4836
+ }, tr = (e, t) => String.fromCharCode(e.getUint8(t), e.getUint8(t + 1), e.getUint8(t + 2), e.getUint8(t + 3)), nr = (e, t, n) => {
4837
+ if (t + 8 > n) return null;
4838
+ let r = e.getUint32(t, !1), i = tr(e, t + 4), a = 8;
4839
+ if (r === 1) {
4840
+ if (t + 16 > n) return null;
4841
+ r = Number(e.getBigUint64(t + 8, !1)), a = 16;
4842
+ } else r === 0 && (r = n - t);
4843
+ return r < a || t + r > n ? null : {
4844
+ offset: t,
4845
+ size: r,
4846
+ type: i,
4847
+ headerSize: a,
4848
+ contentStart: t + a
4849
+ };
4850
+ }, rr = (e, t, n, r) => {
4851
+ let i = t;
4852
+ for (; i < n;) {
4853
+ let t = nr(e, i, n);
4854
+ if (!t) break;
4855
+ r(t), i += t.size;
4856
+ }
4857
+ }, ir = (e, t, n, r) => {
4858
+ let i = null;
4859
+ return rr(e, t, n, (t) => {
4860
+ if (t.type === r) i = t;
4861
+ else if (t.type !== "mdat") {
4862
+ let n = ir(e, t.contentStart, t.offset + t.size, r);
4863
+ n && (i = n);
4864
+ }
4865
+ }), i;
4866
+ }, ar = /*@__PURE__*/ bn("Cg1DZG5EYXRhLnByb3RvEhVjb20ucXVpY2sudm9pY2UucHJvdG8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EhAKCGlzRW5hYmxlGAIgASgIEg4KBmlzTXV0ZRgDIAEoCBINCgV3aWR0aBgEIAEoBRIOCgZoZWlnaHQYBSABKAUSCQoBeBgGIAEoBRIJCgF5GAcgASgFEhcKCnVwZGF0ZVRpbWUYCCABKANIAIgBAUINCgtfdXBkYXRlVGltZSLEAQoKQ3VzdG9tSW5mbxIOCgZyb29tSWQYASABKAkSSQoMY3VzdG9tS2V5TWFwGAIgAygLMjMuY29tLnF1aWNrLnZvaWNlLnByb3RvLkN1c3RvbUluZm8uQ3VzdG9tS2V5TWFwRW50cnkSFwoKdXBkYXRlVGltZRgDIAEoA0gAiAEBGjMKEUN1c3RvbUtleU1hcEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAFCDQoLX3VwZGF0ZVRpbWUqIwoJRXZlbnRUeXBlEgoKBkxheW91dBAAEgoKBkN1c3RvbRABKj0KCkxheW91dFR5cGUSEQoNQXVkaW9BbmRWaWRlbxAAEg0KCU9ubHlBdWRpbxABEg0KCU9ubHlWaWRlbxACKiwKCUF1ZGlvVHlwZRIOCgpNaWNyb3Bob25lEAASDwoLU3lzdGVtVm9pY2UQASojCglWaWRlb1R5cGUSCgoGQ2FtZXJhEAASCgoGU2NyZWVuEAFCPwoWY29tLnF1aWNrLnBsYXllci5wcm90b0IHQ2RuRGF0YVoWY29tLnF1aWNrLnBsYXllci5wcm90b7oCA0NkbmIGcHJvdG8z"), or = /*@__PURE__*/ X(ar, 0), sr = /*@__PURE__*/ X(ar, 1), cr = /*@__PURE__*/ X(ar, 5), lr = () => ({
4605
4867
  remove: !1,
4606
4868
  isEnable: !1,
4607
4869
  updateTime: 0,
4608
4870
  isMute: !1,
4609
4871
  volume: 0
4610
- }), Zn = () => ({
4872
+ }), ur = () => ({
4611
4873
  remove: !1,
4612
4874
  isEnable: !1,
4613
4875
  updateTime: 0,
@@ -4616,7 +4878,7 @@ var Nn = "pr-player-render", Pn = class {
4616
4878
  sy: 0,
4617
4879
  sw: 0,
4618
4880
  sh: 0
4619
- }), Qn = class {
4881
+ }), dr = class {
4620
4882
  userId = "";
4621
4883
  mc_audio;
4622
4884
  mc_video;
@@ -4637,11 +4899,11 @@ var Nn = "pr-player-render", Pn = class {
4637
4899
  let { type: t = 0, isEnable: n = !1, isMute: r = !1, updateTime: i, volume: a = 0 } = e;
4638
4900
  switch (t) {
4639
4901
  case 0:
4640
- if (this.mc_audio ||= Xn(), this.mc_audio.remove = !1, this.mc_audio.updateTime === Number(i)) break;
4902
+ if (this.mc_audio ||= lr(), this.mc_audio.remove = !1, this.mc_audio.updateTime === Number(i)) break;
4641
4903
  this.mc_audio.isEnable = !!n, this.mc_audio.isMute = !!r, this.mc_audio.updateTime = Number(i), this.mc_audio.volume = Number(a);
4642
4904
  break;
4643
4905
  case 1:
4644
- if (this.ss_audio ||= Xn(), this.ss_audio.remove = !1, this.ss_audio.updateTime === Number(i)) break;
4906
+ if (this.ss_audio ||= lr(), this.ss_audio.remove = !1, this.ss_audio.updateTime === Number(i)) break;
4645
4907
  this.ss_audio.isEnable = !!n, this.ss_audio.isMute = !!r, this.ss_audio.updateTime = Number(i), this.ss_audio.volume = Number(a);
4646
4908
  break;
4647
4909
  }
@@ -4650,11 +4912,11 @@ var Nn = "pr-player-render", Pn = class {
4650
4912
  let { type: t = 0, isEnable: n, isMute: r, updateTime: i, width: a, height: o, x: s, y: c } = e;
4651
4913
  switch (t) {
4652
4914
  case 0:
4653
- if (this.mc_video ||= Zn(), this.mc_video.remove = !1, this.mc_video.updateTime === Number(i)) break;
4915
+ if (this.mc_video ||= ur(), this.mc_video.remove = !1, this.mc_video.updateTime === Number(i)) break;
4654
4916
  this.mc_video.isEnable = !!n, this.mc_video.isMute = !!r, this.mc_video.updateTime = Number(i) || 0, this.mc_video.sx = s || 0, this.mc_video.sy = c || 0, this.mc_video.sw = a || 0, this.mc_video.sh = o || 0;
4655
4917
  break;
4656
4918
  case 1:
4657
- if (this.ss_video ||= Zn(), this.ss_video.remove = !1, this.ss_video.updateTime === Number(i)) break;
4919
+ if (this.ss_video ||= ur(), this.ss_video.remove = !1, this.ss_video.updateTime === Number(i)) break;
4658
4920
  this.ss_video.isEnable = !!n, this.ss_video.isMute = !!r, this.ss_video.updateTime = Number(i) || 0, this.ss_video.sx = s || 0, this.ss_video.sy = c || 0, this.ss_video.sw = a || 0, this.ss_video.sh = o || 0;
4659
4921
  break;
4660
4922
  }
@@ -4664,7 +4926,7 @@ var Nn = "pr-player-render", Pn = class {
4664
4926
  destroy = () => {
4665
4927
  this.mc_audio = void 0, this.mc_video = void 0, this.ss_audio = void 0, this.ss_video = void 0;
4666
4928
  };
4667
- }, $n = (e) => {
4929
+ }, fr = (e) => {
4668
4930
  let t = 0, n = 0;
4669
4931
  for (;;) {
4670
4932
  let r = e[t];
@@ -4678,13 +4940,13 @@ var Nn = "pr-player-render", Pn = class {
4678
4940
  if (n === 5) {
4679
4941
  let n = e.slice(t, t + 16), i = Array.from(n, (e) => e.toString(16).padStart(2, "0")).join("");
4680
4942
  t += 16;
4681
- let a = r - 16, o = Q(qn, e.slice(t, t + a)), { event: s = 0 } = o, c = o.data, l;
4943
+ let a = r - 16, o = Z(or, e.slice(t, t + a)), { event: s = 0 } = o, c = o.data, l;
4682
4944
  switch (s) {
4683
4945
  case 0:
4684
- l = Q(Jn, o.data);
4946
+ l = Z(sr, o.data);
4685
4947
  break;
4686
4948
  case 1:
4687
- l = Q(Yn, o.data);
4949
+ l = Z(cr, o.data);
4688
4950
  break;
4689
4951
  }
4690
4952
  return {
@@ -4695,7 +4957,7 @@ var Nn = "pr-player-render", Pn = class {
4695
4957
  data: l
4696
4958
  };
4697
4959
  }
4698
- }, er = class {
4960
+ }, pr = class {
4699
4961
  option = {
4700
4962
  debug: !1,
4701
4963
  ws: "wss://livep2p.devplay.cc/websocket"
@@ -4716,9 +4978,9 @@ var Nn = "pr-player-render", Pn = class {
4716
4978
  };
4717
4979
  constructor(e = {}) {
4718
4980
  let { debug: t = !1 } = e;
4719
- this.option.debug = t, this.prPlayer = new Gn({ debug: t }), this.prPlayer.on.demuxer.chunk = (e) => {}, this.prPlayer.on.decoder.sei = this.onSEI, this.prPlayer.on.decoder.analysis = this.onAnalysis;
4981
+ this.option.debug = t, this.prPlayer = new er(), this.prPlayer.on.demuxer.chunk = (e) => {}, this.prPlayer.on.decoder.sei = this.onSEI, this.prPlayer.on.decoder.analysis = this.onAnalysis;
4720
4982
  }
4721
- start = async (e) => (this.stop(), this.prPlayer.start(e));
4983
+ start = (e) => (this.stop(), this.prPlayer.start(e));
4722
4984
  stop = () => {
4723
4985
  this.prPlayer.stop(), this.usersMap = /* @__PURE__ */ new Map(), this.room.roomId = "", this.room.author = "", this.room.updateTime = "", this.room.version = "";
4724
4986
  };
@@ -4734,26 +4996,26 @@ var Nn = "pr-player-render", Pn = class {
4734
4996
  return Array.from(e, (e) => e.updateTime).join("_");
4735
4997
  };
4736
4998
  checkAndCreateUser = (e, t) => {
4737
- !this.usersMap.has(e) && this.usersMap.set(e, new Qn());
4999
+ !this.usersMap.has(e) && this.usersMap.set(e, new dr());
4738
5000
  let n = this.usersMap.get(e);
4739
5001
  if (n) {
4740
5002
  if (n.init(t), n.mc_video && n.mc_video.stream === void 0) {
4741
- let { sx: e, sy: t, sw: r, sh: i } = n.mc_video, a = `${n.userId}_mc_video`, o = this.prPlayer.cut.create(a, {
4742
- sx: e,
4743
- sy: t,
4744
- sw: r,
4745
- sh: i
5003
+ let e = `${n.userId}_mc_video`, { sx: t, sy: r, sw: i, sh: a } = n.mc_video, o = this.prPlayer.cut.create(e, {
5004
+ sx: t,
5005
+ sy: r,
5006
+ sw: i,
5007
+ sh: a
4746
5008
  });
4747
- this.displayMode === "original" && this.prPlayer.cut.setPause(a, !0), n.mc_video.stream = o;
5009
+ this.displayMode === "original" && this.prPlayer.cut.setPause(e, !0), n.mc_video.stream = o;
4748
5010
  }
4749
5011
  if (n.ss_video && n.ss_video.stream === void 0) {
4750
- let { sx: e, sy: t, sw: r, sh: i } = n.ss_video, a = `${n.userId}_ss_video`, o = this.prPlayer.cut.create(a, {
4751
- sx: e,
4752
- sy: t,
4753
- sw: r,
4754
- sh: i
5012
+ let e = `${n.userId}_ss_video`, { sx: t, sy: r, sw: i, sh: a } = n.ss_video, o = this.prPlayer.cut.create(e, {
5013
+ sx: t,
5014
+ sy: r,
5015
+ sw: i,
5016
+ sh: a
4755
5017
  });
4756
- this.displayMode === "original" && this.prPlayer.cut.setPause(a, !0), n.ss_video.stream = o;
5018
+ this.displayMode === "original" && this.prPlayer.cut.setPause(e, !0), n.ss_video.stream = o;
4757
5019
  }
4758
5020
  if (n?.mc_video) {
4759
5021
  let e = `${n.userId}_mc_video`, { sx: t, sy: r, sw: i, sh: a } = n.mc_video;
@@ -4795,7 +5057,7 @@ var Nn = "pr-player-render", Pn = class {
4795
5057
  };
4796
5058
  onSEI = (e) => {
4797
5059
  try {
4798
- let t = $n(e);
5060
+ let t = fr(e);
4799
5061
  if (!t) return;
4800
5062
  let { event: n, data: r } = t;
4801
5063
  switch (n) {
@@ -4841,4 +5103,4 @@ var Nn = "pr-player-render", Pn = class {
4841
5103
  };
4842
5104
  };
4843
5105
  //#endregion
4844
- export { er as QuickVoPlayer };
5106
+ export { pr as QuickVoPlayer };