@vindral/web-sdk 4.0.0-190-g016e452d → 4.0.0-192-g3adea82c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,44 +1,45 @@
1
- var Io = Object.create;
2
- var ir = Object.defineProperty, So = Object.defineProperties, Uo = Object.getOwnPropertyDescriptor, To = Object.getOwnPropertyDescriptors;
1
+ var ko = Object.create;
2
+ var ir = Object.defineProperty, Io = Object.defineProperties, So = Object.getOwnPropertyDescriptor, Uo = Object.getOwnPropertyDescriptors;
3
3
  var qi = Object.getOwnPropertySymbols;
4
- var Jr = Object.prototype.hasOwnProperty, Kr = Object.prototype.propertyIsEnumerable;
4
+ var Yr = Object.prototype.hasOwnProperty, Jr = Object.prototype.propertyIsEnumerable;
5
5
  var pt = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i), Et = (i) => {
6
6
  throw TypeError(i);
7
- }, nr = Math.pow, _i = (i, t, e) => t in i ? ir(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Yt = (i, t) => {
7
+ };
8
+ var _i = (i, t, e) => t in i ? ir(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Yt = (i, t) => {
8
9
  for (var e in t || (t = {}))
9
- Jr.call(t, e) && _i(i, e, t[e]);
10
+ Yr.call(t, e) && _i(i, e, t[e]);
10
11
  if (qi)
11
12
  for (var e of qi(t))
12
- Kr.call(t, e) && _i(i, e, t[e]);
13
+ Jr.call(t, e) && _i(i, e, t[e]);
13
14
  return i;
14
- }, rr = (i, t) => So(i, To(t)), Yr = (i, t) => ir(i, "name", { value: t, configurable: !0 });
15
- var Qr = (i, t) => {
15
+ }, nr = (i, t) => Io(i, Uo(t)), Zr = (i, t) => ir(i, "name", { value: t, configurable: !0 });
16
+ var Kr = (i, t) => {
16
17
  var e = {};
17
18
  for (var n in i)
18
- Jr.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
19
+ Yr.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
19
20
  if (i != null && qi)
20
21
  for (var n of qi(i))
21
- t.indexOf(n) < 0 && Kr.call(i, n) && (e[n] = i[n]);
22
+ t.indexOf(n) < 0 && Jr.call(i, n) && (e[n] = i[n]);
22
23
  return e;
23
24
  };
24
25
  var Ve = (i) => {
25
26
  var t;
26
- return [, , , Io((t = i == null ? void 0 : i[pt("metadata")]) != null ? t : null)];
27
- }, qr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ds = (i) => i !== void 0 && typeof i != "function" ? Et("Function expected") : i, Eo = (i, t, e, n, r) => ({ kind: qr[i], name: t, metadata: n, addInitializer: (a) => e._ ? Et("Already initialized") : r.push(Ds(a || null)) }), Jt = (i, t) => _i(t, pt("metadata"), i[3]), Ce = (i, t, e, n) => {
27
+ return [, , , ko((t = i == null ? void 0 : i[pt("metadata")]) != null ? t : null)];
28
+ }, Qr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ds = (i) => i !== void 0 && typeof i != "function" ? Et("Function expected") : i, To = (i, t, e, n, r) => ({ kind: Qr[i], name: t, metadata: n, addInitializer: (a) => e._ ? Et("Already initialized") : r.push(Ds(a || null)) }), Jt = (i, t) => _i(t, pt("metadata"), i[3]), Ce = (i, t, e, n) => {
28
29
  for (var r = 0, a = i[t >> 1], c = a && a.length; r < c; r++) t & 1 ? a[r].call(e) : n = a[r].call(e, n);
29
30
  return n;
30
31
  }, X = (i, t, e, n, r, a) => {
31
- var c, d, f, p, b, m = t & 7, I = !!(t & 8), y = !!(t & 16), E = m > 3 ? i.length + 1 : m ? I ? 1 : 2 : 0, P = qr[m + 5], H = m > 3 && (i[E - 1] = []), T = i[E] || (i[E] = []), g = m && (!y && !I && (r = r.prototype), m < 5 && (m > 3 || !y) && Uo(m < 4 ? r : { get [e]() {
32
+ var c, d, f, p, b, m = t & 7, I = !!(t & 8), y = !!(t & 16), E = m > 3 ? i.length + 1 : m ? I ? 1 : 2 : 0, P = Qr[m + 5], H = m > 3 && (i[E - 1] = []), T = i[E] || (i[E] = []), g = m && (!y && !I && (r = r.prototype), m < 5 && (m > 3 || !y) && So(m < 4 ? r : { get [e]() {
32
33
  return s(this, a);
33
34
  }, set [e](S) {
34
35
  return u(this, a, S);
35
36
  } }, e));
36
- m ? y && m < 4 && Yr(a, (m > 2 ? "set " : m > 1 ? "get " : "") + e) : Yr(r, e);
37
+ m ? y && m < 4 && Zr(a, (m > 2 ? "set " : m > 1 ? "get " : "") + e) : Zr(r, e);
37
38
  for (var Y = n.length - 1; Y >= 0; Y--)
38
- p = Eo(m, e, f = {}, i[3], T), m && (p.static = I, p.private = y, b = p.access = { has: y ? (S) => Do(r, S) : (S) => e in S }, m ^ 3 && (b.get = y ? (S) => (m ^ 1 ? s : w)(S, r, m ^ 4 ? a : g.get) : (S) => S[e]), m > 2 && (b.set = y ? (S, Tt) => u(S, r, Tt, m ^ 4 ? a : g.set) : (S, Tt) => S[e] = Tt)), d = (0, n[Y])(m ? m < 4 ? y ? a : g[P] : m > 4 ? void 0 : { get: g.get, set: g.set } : r, p), f._ = 1, m ^ 4 || d === void 0 ? Ds(d) && (m > 4 ? H.unshift(d) : m ? y ? a = d : g[P] = d : r = d) : typeof d != "object" || d === null ? Et("Object expected") : (Ds(c = d.get) && (g.get = c), Ds(c = d.set) && (g.set = c), Ds(c = d.init) && H.unshift(c));
39
+ p = To(m, e, f = {}, i[3], T), m && (p.static = I, p.private = y, b = p.access = { has: y ? (S) => Eo(r, S) : (S) => e in S }, m ^ 3 && (b.get = y ? (S) => (m ^ 1 ? s : w)(S, r, m ^ 4 ? a : g.get) : (S) => S[e]), m > 2 && (b.set = y ? (S, Tt) => u(S, r, Tt, m ^ 4 ? a : g.set) : (S, Tt) => S[e] = Tt)), d = (0, n[Y])(m ? m < 4 ? y ? a : g[P] : m > 4 ? void 0 : { get: g.get, set: g.set } : r, p), f._ = 1, m ^ 4 || d === void 0 ? Ds(d) && (m > 4 ? H.unshift(d) : m ? y ? a = d : g[P] = d : r = d) : typeof d != "object" || d === null ? Et("Object expected") : (Ds(c = d.get) && (g.get = c), Ds(c = d.set) && (g.set = c), Ds(c = d.init) && H.unshift(c));
39
40
  return m || Jt(i, r), g && ir(r, e, g), y ? m ^ 4 ? a : g : r;
40
- }, l = (i, t, e) => _i(i, typeof t != "symbol" ? t + "" : t, e), ar = (i, t, e) => t.has(i) || Et("Cannot " + e), Do = (i, t) => Object(t) !== t ? Et('Cannot use the "in" operator on this value') : i.has(t), s = (i, t, e) => (ar(i, t, "read from private field"), e ? e.call(i) : t.get(i)), o = (i, t, e) => t.has(i) ? Et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), u = (i, t, e, n) => (ar(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), w = (i, t, e) => (ar(i, t, "access private method"), e);
41
- var _r = (i, t, e, n) => ({
41
+ }, l = (i, t, e) => _i(i, typeof t != "symbol" ? t + "" : t, e), rr = (i, t, e) => t.has(i) || Et("Cannot " + e), Eo = (i, t) => Object(t) !== t ? Et('Cannot use the "in" operator on this value') : i.has(t), s = (i, t, e) => (rr(i, t, "read from private field"), e ? e.call(i) : t.get(i)), o = (i, t, e) => t.has(i) ? Et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), u = (i, t, e, n) => (rr(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), w = (i, t, e) => (rr(i, t, "access private method"), e);
42
+ var qr = (i, t, e, n) => ({
42
43
  set _(r) {
43
44
  u(i, t, r, e);
44
45
  },
@@ -73,7 +74,7 @@ var h = (i, t, e) => new Promise((n, r) => {
73
74
  }
74
75
  }, r = (c) => a[c] = (d) => new Promise((f, p) => n(c, d, f, p)), a = {};
75
76
  return e = e.apply(i, t), a[pt("asyncIterator")] = () => a, r("next"), r("throw"), r("return"), a;
76
- }, or = (i) => {
77
+ }, ar = (i) => {
77
78
  var t = i[pt("asyncIterator")], e = !1, n, r = {};
78
79
  return t == null ? (t = i[pt("iterator")](), n = (a) => r[a] = (c) => t[a](c)) : (t = t.call(i), n = (a) => r[a] = (c) => {
79
80
  if (e) {
@@ -113,14 +114,14 @@ var mt = (i, t, e) => {
113
114
  };
114
115
  return a();
115
116
  };
116
- import { D as x, F as Pr, n as B, B as tr, b as Ao, w as er, i as _, L as Xt, a as Oo, W as Vo, t as Co, m as Bo, c as xo, e as Po } from "./fJLVXBMw.js";
117
- import { a as Sa, p as Ro, c as Lo } from "./F-U5JXpv.js";
118
- function Rr(i) {
119
- const t = new Lr(i);
117
+ import { D as x, F as xr, n as B, B as tr, b as Do, w as er, i as _, L as Xt, a as Ao, W as Oo, t as Vo, m as Co, c as Bo, e as xo } from "./Bjw91YDL.js";
118
+ import { a as Ia, p as Po, c as Ro } from "./F-U5JXpv.js";
119
+ function Pr(i) {
120
+ const t = new Rr(i);
120
121
  return [t, t];
121
122
  }
122
123
  var jt, Fe, rt, ti;
123
- class Lr {
124
+ class Rr {
124
125
  constructor(t) {
125
126
  /// The internal queue
126
127
  o(this, jt);
@@ -130,7 +131,7 @@ class Lr {
130
131
  o(this, rt);
131
132
  /// The channel is closed
132
133
  o(this, ti, !1);
133
- u(this, jt, new Pr(t));
134
+ u(this, jt, new xr(t));
134
135
  }
135
136
  close() {
136
137
  var t;
@@ -189,11 +190,11 @@ function k(i) {
189
190
  function Oe() {
190
191
  return typeof Symbol.asyncDispose != "symbol" && Object.defineProperty(Symbol, "asyncDispose", { value: Symbol.for("asyncDispose") }), Symbol.asyncDispose;
191
192
  }
192
- function Ua() {
193
+ function Sa() {
193
194
  return typeof Symbol.dispose != "symbol" && Object.defineProperty(Symbol, "dispose", { value: Symbol.for("dispose") }), Symbol.dispose;
194
195
  }
195
- var ei, dr;
196
- class jo {
196
+ var ei, lr;
197
+ class Lo {
197
198
  constructor(t, e) {
198
199
  o(this, ei);
199
200
  l(this, "value");
@@ -204,18 +205,18 @@ class jo {
204
205
  var t;
205
206
  return (t = this.unlocker) == null ? void 0 : t.promise;
206
207
  }
207
- [Ua()]() {
208
- w(this, ei, dr).call(this);
208
+ [Sa()]() {
209
+ w(this, ei, lr).call(this);
209
210
  }
210
211
  [Symbol.dispose]() {
211
- w(this, ei, dr).call(this);
212
+ w(this, ei, lr).call(this);
212
213
  }
213
214
  }
214
- ei = new WeakSet(), dr = function() {
215
+ ei = new WeakSet(), lr = function() {
215
216
  this.unlocker.resolve(this.value);
216
217
  };
217
218
  var _t, te;
218
- class Go {
219
+ class jo {
219
220
  constructor(t) {
220
221
  o(this, _t);
221
222
  o(this, te, new x());
@@ -234,7 +235,7 @@ class Go {
234
235
  u(this, _t, n);
235
236
  }).catch(B);
236
237
  const e = s(this, te).promise.then(() => t);
237
- return u(this, te, t), yield e, new jo(s(this, _t), t);
238
+ return u(this, te, t), yield e, new Lo(s(this, _t), t);
238
239
  });
239
240
  }
240
241
  }
@@ -299,14 +300,14 @@ class ft {
299
300
  }
300
301
  }
301
302
  et = new WeakMap(), at = new WeakMap();
302
- function Ta(i) {
303
+ function Ua(i) {
303
304
  try {
304
305
  return i();
305
306
  } catch (t) {
306
307
  return t;
307
308
  }
308
309
  }
309
- function Ea(i) {
310
+ function Ta(i) {
310
311
  let t = i.readUint32();
311
312
  const e = [i.readUint8(), i.readUint8(), i.readUint8(), i.readUint8()], n = String.fromCharCode.apply(null, e);
312
313
  return t === 1 && (t = i.readUint64() - 8), {
@@ -315,8 +316,8 @@ function Ea(i) {
315
316
  type: n
316
317
  };
317
318
  }
318
- function No(i, t) {
319
- const e = Ea(t), n = new tr(t.readBytes(e.size));
319
+ function Go(i, t) {
320
+ const e = Ta(t), n = new tr(t.readBytes(e.size));
320
321
  if (e.type !== i.type)
321
322
  throw new Error(`invalid error type: ${e.type}, expected ${i.type}`);
322
323
  const r = i.decodeData(n);
@@ -755,7 +756,7 @@ const Ys = class Ys {
755
756
  }
756
757
  };
757
758
  l(Ys, "type", "avcC");
758
- let fr = Ys;
759
+ let dr = Ys;
759
760
  const Js = class Js {
760
761
  constructor(t, e, n, r, a) {
761
762
  l(this, "type", Js.type);
@@ -785,7 +786,7 @@ const Js = class Js {
785
786
  }
786
787
  };
787
788
  l(Js, "type", "avc1");
788
- let wr = Js;
789
+ let fr = Js;
789
790
  const Ks = class Ks {
790
791
  constructor() {
791
792
  l(this, "type", Ks.type);
@@ -795,7 +796,7 @@ const Ks = class Ks {
795
796
  }
796
797
  };
797
798
  l(Ks, "type", "dOps");
798
- let pr = Ks;
799
+ let wr = Ks;
799
800
  const Qs = class Qs {
800
801
  constructor(t, e, n) {
801
802
  l(this, "type", Qs.type);
@@ -812,12 +813,12 @@ const Qs = class Qs {
812
813
  t.readUint16(), t.readUint32();
813
814
  const r = t.readUint16();
814
815
  t.readUint16(), e === 1 && (t.readUint64(), t.readUint64());
815
- const a = No(pr, t);
816
+ const a = Go(wr, t);
816
817
  return new Qs(a, n, r);
817
818
  }
818
819
  };
819
820
  l(Qs, "type", "Opus");
820
- let mr = Qs;
821
+ let pr = Qs;
821
822
  const Re = class Re {
822
823
  constructor(t, e) {
823
824
  l(this, "type", Re.type);
@@ -840,7 +841,7 @@ const Re = class Re {
840
841
  l(Re, "type", "prft");
841
842
  let Tn = Re;
842
843
  var si, ii;
843
- class Fo {
844
+ class No {
844
845
  constructor(t, e) {
845
846
  o(this, si);
846
847
  o(this, ii);
@@ -854,7 +855,7 @@ class Fo {
854
855
  }
855
856
  }
856
857
  si = new WeakMap(), ii = new WeakMap();
857
- const Wo = {
858
+ const Fo = {
858
859
  moov: Un,
859
860
  trak: Sn,
860
861
  tkhd: In,
@@ -871,21 +872,21 @@ const Wo = {
871
872
  mdhd: bn,
872
873
  stsd: yn,
873
874
  prft: Tn,
874
- avc1: wr,
875
- avcC: fr,
876
- Opus: mr,
875
+ avc1: fr,
876
+ avcC: dr,
877
+ Opus: pr,
877
878
  emsg: hn
878
879
  };
879
880
  function wt(i) {
880
- const t = Ea(i), e = Wo[t.type], n = new tr(i.readBytes(t.size));
881
+ const t = Ta(i), e = Fo[t.type], n = new tr(i.readBytes(t.size));
881
882
  if (!e) {
882
- const a = new Fo(t, n);
883
+ const a = new No(t, n);
883
884
  return n.readRemaining(), a;
884
885
  }
885
886
  const r = e.decodeData(n);
886
887
  return n.readRemaining(), r;
887
888
  }
888
- function $o(i) {
889
+ function Wo(i) {
889
890
  if (i.byteLength < 8)
890
891
  throw new Error("Buffer too small");
891
892
  const t = new tr(i), e = /* @__PURE__ */ new Map();
@@ -903,7 +904,7 @@ function $o(i) {
903
904
  moov: r
904
905
  };
905
906
  }
906
- function zo(i) {
907
+ function $o(i) {
907
908
  if (i.byteLength < 8)
908
909
  throw new Error("Buffer too small");
909
910
  const t = new tr(i), e = /* @__PURE__ */ new Map(), n = [];
@@ -926,11 +927,11 @@ function zo(i) {
926
927
  };
927
928
  }
928
929
  var ni, ri;
929
- class Mo {
930
+ class zo {
930
931
  constructor(t) {
931
932
  o(this, ni);
932
933
  o(this, ri);
933
- u(this, ni, t), u(this, ri, $o(t));
934
+ u(this, ni, t), u(this, ri, Wo(t));
934
935
  }
935
936
  rawBytes() {
936
937
  return s(this, ni);
@@ -941,12 +942,12 @@ class Mo {
941
942
  }
942
943
  ni = new WeakMap(), ri = new WeakMap();
943
944
  var ot, J, D;
944
- class Ho {
945
+ class Mo {
945
946
  constructor(t, e) {
946
947
  o(this, ot);
947
948
  o(this, J);
948
949
  o(this, D);
949
- u(this, ot, e), u(this, J, t), u(this, D, zo(e));
950
+ u(this, ot, e), u(this, J, t), u(this, D, $o(e));
950
951
  }
951
952
  /**
952
953
  * Update the raw bytes of the fragment with the new baseMediaDecodeTime
@@ -964,7 +965,7 @@ class Ho {
964
965
  producerReferenceTime() {
965
966
  if (!s(this, D).prft)
966
967
  return;
967
- const [t, e] = s(this, D).prft.ntpTimestamp, n = t * 1e3 + e / nr(2, 32) * 1e3, r = new Date(Date.UTC(1900, 0, 1, 0, 0, 0));
968
+ const [t, e] = s(this, D).prft.ntpTimestamp, n = t * 1e3 + e / 2 ** 32 * 1e3, r = new Date(Date.UTC(1900, 0, 1, 0, 0, 0));
968
969
  return new Date(r.getTime() + n);
969
970
  }
970
971
  duration() {
@@ -1006,7 +1007,7 @@ class Ho {
1006
1007
  return ((t = s(this, D).moof.traf.trun) == null ? void 0 : t.samplesCount) || 0;
1007
1008
  }
1008
1009
  sample(t) {
1009
- var y, E, P, H, T, g, Y, S, Tt, Us, Ki, Qi, Hr, Xr, Zr;
1010
+ var y, E, P, H, T, g, Y, S, Tt, Us, Ki, Qi, Mr, Hr, Xr;
1010
1011
  const e = (y = s(this, J).init().moov.traks[0]) == null ? void 0 : y.mdia.minf.stbl.stsd.codec, n = ((E = s(this, D).moof.traf.trun) == null ? void 0 : E.samplesCount) || 0, r = (P = s(this, D).moof.traf.tfdt) == null ? void 0 : P.baseMediaDecodeTime;
1011
1012
  if (t >= n || typeof r == "undefined" || !e)
1012
1013
  return;
@@ -1028,8 +1029,8 @@ class Ho {
1028
1029
  return {
1029
1030
  type: "audio",
1030
1031
  codec: e,
1031
- channels: ((Hr = (Qi = s(this, J).init().moov.traks[0]) == null ? void 0 : Qi.mdia.minf.stbl.stsd.opus) == null ? void 0 : Hr.channelCount) || 0,
1032
- sampleRate: ((Zr = (Xr = s(this, J).init().moov.traks[0]) == null ? void 0 : Xr.mdia.minf.stbl.stsd.opus) == null ? void 0 : Zr.sampleRate) || 0,
1032
+ channels: ((Mr = (Qi = s(this, J).init().moov.traks[0]) == null ? void 0 : Qi.mdia.minf.stbl.stsd.opus) == null ? void 0 : Mr.channelCount) || 0,
1033
+ sampleRate: ((Xr = (Hr = s(this, J).init().moov.traks[0]) == null ? void 0 : Hr.mdia.minf.stbl.stsd.opus) == null ? void 0 : Xr.sampleRate) || 0,
1033
1034
  duration: a,
1034
1035
  isSync: I,
1035
1036
  timestamp: d,
@@ -1046,21 +1047,21 @@ class Ho {
1046
1047
  }
1047
1048
  ot = new WeakMap(), J = new WeakMap(), D = new WeakMap();
1048
1049
  var We;
1049
- class ta {
1050
+ class _r {
1050
1051
  constructor(t) {
1051
1052
  o(this, We);
1052
- u(this, We, new Mo(t));
1053
+ u(this, We, new zo(t));
1053
1054
  }
1054
1055
  header() {
1055
1056
  return s(this, We);
1056
1057
  }
1057
1058
  createFragment(t) {
1058
- return new Ho(s(this, We), t);
1059
+ return new Mo(s(this, We), t);
1059
1060
  }
1060
1061
  }
1061
1062
  We = new WeakMap();
1062
1063
  var Gt, ai;
1063
- class Xo {
1064
+ class Ho {
1064
1065
  constructor(t, e) {
1065
1066
  o(this, Gt);
1066
1067
  o(this, ai);
@@ -1072,7 +1073,7 @@ class Xo {
1072
1073
  const n = new Uint8Array(e.data);
1073
1074
  n[0] == s(this, ai) && t.enqueue(n.subarray(1));
1074
1075
  }
1075
- }), s(this, Gt).addEventListener("error", (e) => t.error(e)), s(this, Gt).addEventListener("close", () => Ta(() => t.close()));
1076
+ }), s(this, Gt).addEventListener("error", (e) => t.error(e)), s(this, Gt).addEventListener("close", () => Ua(() => t.close()));
1076
1077
  }
1077
1078
  cancel(t) {
1078
1079
  s(this, Gt).close(void 0, t);
@@ -1080,7 +1081,7 @@ class Xo {
1080
1081
  }
1081
1082
  Gt = new WeakMap(), ai = new WeakMap();
1082
1083
  var yt, ee, se, ie;
1083
- class Zo {
1084
+ class Xo {
1084
1085
  constructor(t) {
1085
1086
  o(this, yt);
1086
1087
  o(this, ee, null);
@@ -1097,7 +1098,7 @@ class Zo {
1097
1098
  t.enqueue([c, a, d]);
1098
1099
  }
1099
1100
  }
1100
- }), u(this, se, () => Ta(() => t.close())), u(this, ie, (e) => t.error(e)), s(this, yt).addEventListener("message", s(this, ee)), s(this, yt).addEventListener("error", s(this, ie)), s(this, yt).addEventListener("close", s(this, se));
1101
+ }), u(this, se, () => Ua(() => t.close())), u(this, ie, (e) => t.error(e)), s(this, yt).addEventListener("message", s(this, ee)), s(this, yt).addEventListener("error", s(this, ie)), s(this, yt).addEventListener("close", s(this, se));
1101
1102
  }
1102
1103
  cancel(t) {
1103
1104
  s(this, ee) && s(this, yt).removeEventListener("message", s(this, ee)), s(this, ie) && s(this, yt).removeEventListener("error", s(this, ie)), s(this, se) && s(this, yt).removeEventListener("close", s(this, se));
@@ -1156,7 +1157,7 @@ class En {
1156
1157
  const e = w(this, U, Lt).call(this, 8), n = new DataView(e.buffer, e.byteOffset, e.byteLength);
1157
1158
  if (typeof n.getBigUint64 != "undefined")
1158
1159
  return k(n.getBigUint64(0));
1159
- const r = Ao(e, 0, 7);
1160
+ const r = Do(e, 0, 7);
1160
1161
  return k(r);
1161
1162
  }
1162
1163
  default:
@@ -1215,7 +1216,7 @@ gt = new WeakMap(), oi = new WeakMap(), $e = new WeakMap(), vt = new WeakMap(),
1215
1216
  return u(this, vt, s(this, vt) + e.length), e;
1216
1217
  };
1217
1218
  var ze, Me, At, Pn;
1218
- class Yo {
1219
+ class Zo {
1219
1220
  constructor(t) {
1220
1221
  o(this, ze, new Uint8Array(8));
1221
1222
  o(this, Me);
@@ -1236,10 +1237,10 @@ class Yo {
1236
1237
  return s(this, At).write(sr(t, s(this, ze)));
1237
1238
  }
1238
1239
  writeVarInt(t) {
1239
- return s(this, At).write(Pa(t, s(this, ze)));
1240
+ return s(this, At).write(xa(t, s(this, ze)));
1240
1241
  }
1241
1242
  writeBigVarInt(t) {
1242
- return s(this, At).write(Ra(t, s(this, ze)));
1243
+ return s(this, At).write(Pa(t, s(this, ze)));
1243
1244
  }
1244
1245
  flush() {
1245
1246
  return h(this, null, function* () {
@@ -1282,12 +1283,12 @@ const qs = class qs {
1282
1283
  writeVarInt(t) {
1283
1284
  if (t < 0)
1284
1285
  throw new Error(`VarInt can not be negative: ${t}`);
1285
- return this.ensureBufferSpace(8), u(this, Z, s(this, Z) + Pa(t, s(this, K).subarray(s(this, Z))).byteLength), Promise.resolve();
1286
+ return this.ensureBufferSpace(8), u(this, Z, s(this, Z) + xa(t, s(this, K).subarray(s(this, Z))).byteLength), Promise.resolve();
1286
1287
  }
1287
1288
  writeBigVarInt(t) {
1288
1289
  if (t < 0)
1289
1290
  throw new Error(`VarInt can not be negative: ${t}`);
1290
- return this.ensureBufferSpace(8), u(this, Z, s(this, Z) + Ra(t, s(this, K).subarray(s(this, Z))).byteLength), Promise.resolve();
1291
+ return this.ensureBufferSpace(8), u(this, Z, s(this, Z) + Pa(t, s(this, K).subarray(s(this, Z))).byteLength), Promise.resolve();
1291
1292
  }
1292
1293
  flush() {
1293
1294
  return s(this, He).send(s(this, K).subarray(0, s(this, Z))), u(this, Z, 0), u(this, K, new Uint8Array(qs.DEFAULT_BUFFER_SIZE)), Promise.resolve();
@@ -1298,50 +1299,50 @@ const qs = class qs {
1298
1299
  };
1299
1300
  Z = new WeakMap(), K = new WeakMap(), He = new WeakMap(), Rn = new WeakMap(), l(qs, "DEFAULT_BUFFER_SIZE", 1024);
1300
1301
  let Dn = qs;
1301
- const Da = Math.pow(2, 6) - 1, Aa = Math.pow(2, 14) - 1, Oa = Math.pow(2, 30) - 1, Jo = Number.MAX_SAFE_INTEGER, Ko = typeof BigInt == "function" ? nr(k(2), k(62)) - k(1) : k(Number.MAX_SAFE_INTEGER);
1302
+ const Ea = Math.pow(2, 6) - 1, Da = Math.pow(2, 14) - 1, Aa = Math.pow(2, 30) - 1, Yo = Number.MAX_SAFE_INTEGER, Jo = typeof BigInt == "function" ? k(2) ** k(62) - k(1) : k(Number.MAX_SAFE_INTEGER);
1302
1303
  function sr(i, t) {
1303
1304
  return t[0] = i, t.subarray(0, 1);
1304
1305
  }
1305
- function Va(i, t) {
1306
+ function Oa(i, t) {
1306
1307
  const e = new DataView(t.buffer, t.byteOffset, 2);
1307
1308
  return e.setUint16(0, i), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
1308
1309
  }
1309
- function Ca(i, t) {
1310
+ function Va(i, t) {
1310
1311
  const e = new DataView(t.buffer, t.byteOffset, 4);
1311
1312
  return e.setUint32(0, i), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
1312
1313
  }
1313
- function Ba(i, t) {
1314
+ function Ca(i, t) {
1314
1315
  const e = new DataView(t.buffer, t.byteOffset, 8);
1315
1316
  return e.setBigUint64(0, i), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
1316
1317
  }
1317
- function xa(i, t) {
1318
+ function Ba(i, t) {
1318
1319
  const e = new DataView(t.buffer, t.byteOffset, 8);
1319
1320
  return e.setUint32(0, i / 4294967296), e.setUint32(4, i & 4294967295), t.set([192], 0), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
1320
1321
  }
1321
- function Pa(i, t) {
1322
- if (i <= Da)
1322
+ function xa(i, t) {
1323
+ if (i <= Ea)
1323
1324
  return sr(i, t);
1325
+ if (i <= Da)
1326
+ return Oa(i | 16384, t);
1324
1327
  if (i <= Aa)
1325
- return Va(i | 16384, t);
1326
- if (i <= Oa)
1327
- return Ca(i | 2147483648, t);
1328
- if (i <= Jo)
1329
- return typeof BigInt == "function" ? Ba(BigInt(i) | BigInt(3221225472) << BigInt(32), t) : xa(Number(i), t);
1328
+ return Va(i | 2147483648, t);
1329
+ if (i <= Yo)
1330
+ return typeof BigInt == "function" ? Ca(BigInt(i) | BigInt(3221225472) << BigInt(32), t) : Ba(Number(i), t);
1330
1331
  throw new Error(`overflow, value larger than 53-bits: ${i}`);
1331
1332
  }
1332
- function Ra(i, t) {
1333
- if (i < Da)
1333
+ function Pa(i, t) {
1334
+ if (i < Ea)
1334
1335
  return sr(Number(i), t);
1335
- if (i < Aa)
1336
- return Va(Number(i) | 16384, t);
1337
- if (i <= Oa)
1338
- return Ca(Number(i) | 2147483648, t);
1339
- if (i <= Ko)
1340
- return typeof BigInt == "function" ? Ba(BigInt(i) | BigInt(3221225472) << BigInt(32), t) : xa(Number(i), t);
1336
+ if (i < Da)
1337
+ return Oa(Number(i) | 16384, t);
1338
+ if (i <= Aa)
1339
+ return Va(Number(i) | 2147483648, t);
1340
+ if (i <= Jo)
1341
+ return typeof BigInt == "function" ? Ca(BigInt(i) | BigInt(3221225472) << BigInt(32), t) : Ba(Number(i), t);
1341
1342
  throw new Error(`overflow, value larger than 62-bits: ${i}`);
1342
1343
  }
1343
1344
  var v = /* @__PURE__ */ ((i) => (i[i.SubscribeUpdate = 2] = "SubscribeUpdate", i[i.Subscribe = 3] = "Subscribe", i[i.SubscribeOk = 4] = "SubscribeOk", i[i.SubscribeError = 5] = "SubscribeError", i[i.Announce = 6] = "Announce", i[i.AnnounceOk = 7] = "AnnounceOk", i[i.AnnounceError = 8] = "AnnounceError", i[i.Unannounce = 9] = "Unannounce", i[i.Unsubscribe = 10] = "Unsubscribe", i[i.SubscribeDone = 11] = "SubscribeDone", i[i.AnnounceCancel = 12] = "AnnounceCancel", i[i.TrackStatusRequest = 13] = "TrackStatusRequest", i[i.TrackStatus = 14] = "TrackStatus", i[i.Goaway = 16] = "Goaway", i[i.ClientSetup = 64] = "ClientSetup", i[i.ServerSetup = 65] = "ServerSetup", i[i.Unknown = 255] = "Unknown", i))(v || {});
1344
- function La(i) {
1345
+ function Ra(i) {
1345
1346
  return h(this, null, function* () {
1346
1347
  const t = yield i.readVarInt();
1347
1348
  if (t < 1 || t > 32)
@@ -1352,19 +1353,19 @@ function La(i) {
1352
1353
  return e;
1353
1354
  });
1354
1355
  }
1355
- function ja(i, t) {
1356
+ function La(i, t) {
1356
1357
  return h(this, null, function* () {
1357
1358
  yield i.writeVarInt(t.length);
1358
1359
  for (const e of t)
1359
1360
  yield i.writeString(e);
1360
1361
  });
1361
1362
  }
1362
- function Qo(i, t) {
1363
+ function Ko(i, t) {
1363
1364
  return h(this, null, function* () {
1364
- yield ja(i, t.namespace);
1365
+ yield La(i, t.namespace);
1365
1366
  });
1366
1367
  }
1367
- const ea = k(2);
1368
+ const ta = k(2);
1368
1369
  function Yi(i) {
1369
1370
  return h(this, null, function* () {
1370
1371
  const t = yield i.readVarInt(), e = /* @__PURE__ */ new Map();
@@ -1382,27 +1383,27 @@ function Ji(i, t) {
1382
1383
  yield i.writeBigVarInt(e), yield i.writeVarInt(n.payload.length), yield i.write(n.payload);
1383
1384
  });
1384
1385
  }
1385
- const Ga = {
1386
+ const ja = {
1386
1387
  Publisher: 0,
1387
1388
  Subscriber: 1,
1388
1389
  Both: 2
1389
1390
  }, An = {
1390
1391
  Role: k(0)
1391
- }, Na = {
1392
+ }, Ga = {
1392
1393
  Draft07: 4278190087
1393
1394
  };
1394
- function Fa(i) {
1395
+ function Na(i) {
1395
1396
  return h(this, null, function* () {
1396
1397
  const t = yield i.readVarInt();
1397
1398
  switch (t) {
1398
- case Na.Draft07:
1399
+ case Ga.Draft07:
1399
1400
  return { type: "known", value: t };
1400
1401
  default:
1401
1402
  return { type: "unknown", value: t };
1402
1403
  }
1403
1404
  });
1404
1405
  }
1405
- function qo(i, t) {
1406
+ function Qo(i, t) {
1406
1407
  return h(this, null, function* () {
1407
1408
  yield i.writeVarInt(t.supportedVersions.length);
1408
1409
  for (const e of t.supportedVersions)
@@ -1410,11 +1411,11 @@ function qo(i, t) {
1410
1411
  yield Ji(i, t.parameters);
1411
1412
  });
1412
1413
  }
1413
- function _o(i) {
1414
+ function qo(i) {
1414
1415
  return h(this, null, function* () {
1415
1416
  const t = [], e = yield i.readVarInt();
1416
1417
  for (let r = 0; r < e; r++)
1417
- t.push(yield Fa(i));
1418
+ t.push(yield Na(i));
1418
1419
  const n = yield Yi(i);
1419
1420
  if (!n.has(An.Role))
1420
1421
  throw new Error("Role parameter is required");
@@ -1425,14 +1426,14 @@ function _o(i) {
1425
1426
  };
1426
1427
  });
1427
1428
  }
1428
- function tc(i, t) {
1429
+ function _o(i, t) {
1429
1430
  return h(this, null, function* () {
1430
1431
  yield i.writeVarInt(t.selectedVersion.value), yield Ji(i, t.parameters);
1431
1432
  });
1432
1433
  }
1433
- function ec(i) {
1434
+ function tc(i) {
1434
1435
  return h(this, null, function* () {
1435
- const t = yield Fa(i);
1436
+ const t = yield Na(i);
1436
1437
  if (t.type !== "known")
1437
1438
  throw new Error("Expected known version");
1438
1439
  const e = yield Yi(i);
@@ -1445,13 +1446,13 @@ function ec(i) {
1445
1446
  };
1446
1447
  });
1447
1448
  }
1448
- const sc = {
1449
+ const ec = {
1449
1450
  "latest-group": 1,
1450
1451
  "latest-object": 2,
1451
1452
  "absolute-start": 3,
1452
1453
  "absolute-range": 4
1453
1454
  };
1454
- function ic(i) {
1455
+ function sc(i) {
1455
1456
  return h(this, null, function* () {
1456
1457
  const t = yield i.readVarInt();
1457
1458
  switch (t) {
@@ -1484,9 +1485,9 @@ function ic(i) {
1484
1485
  }
1485
1486
  });
1486
1487
  }
1487
- function nc(i, t) {
1488
+ function ic(i, t) {
1488
1489
  return h(this, null, function* () {
1489
- const e = sc[t.type];
1490
+ const e = ec[t.type];
1490
1491
  switch (yield i.writeVarInt(e), t.type) {
1491
1492
  case "absolute-range":
1492
1493
  yield i.writeBigVarInt(t.start.group), yield i.writeBigVarInt(t.start.object), yield i.writeBigVarInt(t.end.group), yield i.writeBigVarInt(t.end.object);
@@ -1502,7 +1503,7 @@ function nc(i, t) {
1502
1503
  }
1503
1504
  });
1504
1505
  }
1505
- function Wa(i) {
1506
+ function Fa(i) {
1506
1507
  return h(this, null, function* () {
1507
1508
  const t = yield i.readUnsigned8();
1508
1509
  switch (t) {
@@ -1517,7 +1518,7 @@ function Wa(i) {
1517
1518
  }
1518
1519
  });
1519
1520
  }
1520
- function $a(i, t) {
1521
+ function Wa(i, t) {
1521
1522
  return h(this, null, function* () {
1522
1523
  switch (t) {
1523
1524
  case "inherit-publisher":
@@ -1532,9 +1533,9 @@ function $a(i, t) {
1532
1533
  }
1533
1534
  });
1534
1535
  }
1535
- function rc(i) {
1536
+ function nc(i) {
1536
1537
  return h(this, null, function* () {
1537
- const t = yield i.readBigVarInt(), e = yield i.readBigVarInt(), n = yield La(i), r = yield i.readString(), a = yield i.readUnsigned8(), c = yield Wa(i), d = yield ic(i), f = yield Yi(i);
1538
+ const t = yield i.readBigVarInt(), e = yield i.readBigVarInt(), n = yield Ra(i), r = yield i.readString(), a = yield i.readUnsigned8(), c = yield Fa(i), d = yield sc(i), f = yield Yi(i);
1538
1539
  if (d.type === "absolute-range") {
1539
1540
  const p = d.start.group > d.end.group, b = d.start.group === d.end.group && d.start.object > d.end.object;
1540
1541
  if (p || b)
@@ -1553,12 +1554,12 @@ function rc(i) {
1553
1554
  };
1554
1555
  });
1555
1556
  }
1556
- function ac(i, t) {
1557
+ function rc(i, t) {
1557
1558
  return h(this, null, function* () {
1558
- yield i.writeBigVarInt(t.id), yield i.writeBigVarInt(t.trackAlias), yield ja(i, t.namespace), yield i.writeString(t.name), yield i.writeUnsigned8(t.subscriberPriority), yield $a(i, t.groupOrder), yield nc(i, t.filterType), yield Ji(i, t.params);
1559
+ yield i.writeBigVarInt(t.id), yield i.writeBigVarInt(t.trackAlias), yield La(i, t.namespace), yield i.writeString(t.name), yield i.writeUnsigned8(t.subscriberPriority), yield Wa(i, t.groupOrder), yield ic(i, t.filterType), yield Ji(i, t.params);
1559
1560
  });
1560
1561
  }
1561
- const oc = {
1562
+ const ac = {
1562
1563
  Unsubscribed: 0,
1563
1564
  InternalError: 1,
1564
1565
  Unauthorized: 2,
@@ -1567,7 +1568,7 @@ const oc = {
1567
1568
  GoingAway: 5,
1568
1569
  Expired: 6
1569
1570
  };
1570
- function cc(i) {
1571
+ function oc(i) {
1571
1572
  return h(this, null, function* () {
1572
1573
  const t = yield i.readBigVarInt(), e = yield i.readVarInt(), n = yield i.readString(), r = (yield i.readUnsigned8()) == 1;
1573
1574
  let a;
@@ -1583,14 +1584,14 @@ function cc(i) {
1583
1584
  };
1584
1585
  });
1585
1586
  }
1586
- function uc(i, t) {
1587
+ function cc(i, t) {
1587
1588
  return h(this, null, function* () {
1588
1589
  yield i.writeBigVarInt(t.id), yield i.writeVarInt(t.errorCode), yield i.writeString(t.reason), yield i.writeUnsigned8(t.finalInfo ? 1 : 0), t.finalInfo && (yield i.writeBigVarInt(t.finalInfo.group), yield i.writeBigVarInt(t.finalInfo.object));
1589
1590
  });
1590
1591
  }
1591
- function hc(i) {
1592
+ function uc(i) {
1592
1593
  return h(this, null, function* () {
1593
- const t = yield i.readBigVarInt(), e = yield i.readBigVarInt(), n = yield Wa(i), r = (yield i.readUnsigned8()) == 1;
1594
+ const t = yield i.readBigVarInt(), e = yield i.readBigVarInt(), n = yield Fa(i), r = (yield i.readUnsigned8()) == 1;
1594
1595
  let a;
1595
1596
  if (n == "inherit-publisher")
1596
1597
  throw new Error("SusbcribeOk cannot have inherit publisher group order");
@@ -1609,17 +1610,17 @@ function hc(i) {
1609
1610
  };
1610
1611
  });
1611
1612
  }
1612
- function lc(i, t) {
1613
+ function hc(i, t) {
1613
1614
  return h(this, null, function* () {
1614
- yield i.writeBigVarInt(t.id), yield i.writeBigVarInt(t.expires), yield $a(i, t.groupOrder), yield i.writeUnsigned8(t.largestInfo ? 1 : 0), t.largestInfo && (yield i.writeBigVarInt(t.largestInfo.group), yield i.writeBigVarInt(t.largestInfo.object)), yield Ji(i, t.params);
1615
+ yield i.writeBigVarInt(t.id), yield i.writeBigVarInt(t.expires), yield Wa(i, t.groupOrder), yield i.writeUnsigned8(t.largestInfo ? 1 : 0), t.largestInfo && (yield i.writeBigVarInt(t.largestInfo.group), yield i.writeBigVarInt(t.largestInfo.object)), yield Ji(i, t.params);
1615
1616
  });
1616
1617
  }
1617
- function dc(i, t) {
1618
+ function lc(i, t) {
1618
1619
  return h(this, null, function* () {
1619
1620
  yield i.writeBigVarInt(t.id), yield i.writeBigVarInt(t.start.group), yield i.writeBigVarInt(t.start.object), yield i.writeBigVarInt(t.end.group), yield i.writeBigVarInt(t.end.object), yield i.writeUnsigned8(t.subscriberPriority), yield Ji(i, t.params);
1620
1621
  });
1621
1622
  }
1622
- function fc(i) {
1623
+ function dc(i) {
1623
1624
  return h(this, null, function* () {
1624
1625
  return {
1625
1626
  type: v.Unsubscribe,
@@ -1627,13 +1628,13 @@ function fc(i) {
1627
1628
  };
1628
1629
  });
1629
1630
  }
1630
- function wc(i, t) {
1631
+ function fc(i, t) {
1631
1632
  return h(this, null, function* () {
1632
1633
  yield i.writeBigVarInt(t.id);
1633
1634
  });
1634
1635
  }
1635
- var Ot, Xe, L, Ma, Ha, Xa, Za, Ya, Ja, Ka, Qa;
1636
- class za {
1636
+ var Ot, Xe, L, za, Ma, Ha, Xa, Za, Ya, Ja, Ka;
1637
+ class $a {
1637
1638
  constructor(t) {
1638
1639
  o(this, L);
1639
1640
  o(this, Ot);
@@ -1654,28 +1655,28 @@ class za {
1654
1655
  });
1655
1656
  switch (t.type) {
1656
1657
  case v.Subscribe:
1657
- yield w(this, L, Xa).call(this, e, t);
1658
+ yield w(this, L, Ha).call(this, e, t);
1658
1659
  break;
1659
1660
  case v.SubscribeOk:
1660
- yield w(this, L, Za).call(this, e, t);
1661
+ yield w(this, L, Xa).call(this, e, t);
1661
1662
  break;
1662
1663
  case v.SubscribeUpdate:
1663
- yield w(this, L, Ya).call(this, e, t);
1664
+ yield w(this, L, Za).call(this, e, t);
1664
1665
  break;
1665
1666
  case v.SubscribeDone:
1666
- yield w(this, L, Ja).call(this, e, t);
1667
+ yield w(this, L, Ya).call(this, e, t);
1667
1668
  break;
1668
1669
  case v.Unsubscribe:
1669
- yield w(this, L, Ka).call(this, e, t);
1670
+ yield w(this, L, Ja).call(this, e, t);
1670
1671
  break;
1671
1672
  case v.ClientSetup:
1672
- yield w(this, L, Ma).call(this, e, t);
1673
+ yield w(this, L, za).call(this, e, t);
1673
1674
  break;
1674
1675
  case v.ServerSetup:
1675
- yield w(this, L, Ha).call(this, e, t);
1676
+ yield w(this, L, Ma).call(this, e, t);
1676
1677
  break;
1677
1678
  case v.AnnounceOk:
1678
- yield w(this, L, Qa).call(this, e, t);
1679
+ yield w(this, L, Ka).call(this, e, t);
1679
1680
  break;
1680
1681
  default:
1681
1682
  throw new Error(`Unknown message type: ${t.type}`);
@@ -1689,17 +1690,21 @@ class za {
1689
1690
  });
1690
1691
  }
1691
1692
  }
1692
- Ot = new WeakMap(), Xe = new WeakMap(), L = new WeakSet(), Ma = function(t, e) {
1693
+ Ot = new WeakMap(), Xe = new WeakMap(), L = new WeakSet(), za = function(t, e) {
1694
+ return h(this, null, function* () {
1695
+ yield Qo(t, e);
1696
+ });
1697
+ }, Ma = function(t, e) {
1693
1698
  return h(this, null, function* () {
1694
- yield qo(t, e);
1699
+ yield _o(t, e);
1695
1700
  });
1696
1701
  }, Ha = function(t, e) {
1697
1702
  return h(this, null, function* () {
1698
- yield tc(t, e);
1703
+ yield rc(t, e);
1699
1704
  });
1700
1705
  }, Xa = function(t, e) {
1701
1706
  return h(this, null, function* () {
1702
- yield ac(t, e);
1707
+ yield hc(t, e);
1703
1708
  });
1704
1709
  }, Za = function(t, e) {
1705
1710
  return h(this, null, function* () {
@@ -1707,28 +1712,24 @@ Ot = new WeakMap(), Xe = new WeakMap(), L = new WeakSet(), Ma = function(t, e) {
1707
1712
  });
1708
1713
  }, Ya = function(t, e) {
1709
1714
  return h(this, null, function* () {
1710
- yield dc(t, e);
1715
+ yield cc(t, e);
1711
1716
  });
1712
1717
  }, Ja = function(t, e) {
1713
1718
  return h(this, null, function* () {
1714
- yield uc(t, e);
1719
+ yield fc(t, e);
1715
1720
  });
1716
1721
  }, Ka = function(t, e) {
1717
1722
  return h(this, null, function* () {
1718
- yield wc(t, e);
1719
- });
1720
- }, Qa = function(t, e) {
1721
- return h(this, null, function* () {
1722
- yield Qo(t, e);
1723
+ yield Ko(t, e);
1723
1724
  });
1724
1725
  };
1725
1726
  var Ze, ci, ui;
1726
- class pc {
1727
+ class wc {
1727
1728
  constructor(t, e) {
1728
1729
  o(this, Ze);
1729
1730
  o(this, ci);
1730
1731
  o(this, ui);
1731
- u(this, Ze, t), u(this, ci, new za(t)), u(this, ui, e);
1732
+ u(this, Ze, t), u(this, ci, new $a(t)), u(this, ui, e);
1732
1733
  }
1733
1734
  write(t) {
1734
1735
  return h(this, null, function* () {
@@ -1740,16 +1741,16 @@ class pc {
1740
1741
  }
1741
1742
  }
1742
1743
  Ze = new WeakMap(), ci = new WeakMap(), ui = new WeakMap();
1743
- function mc(i) {
1744
+ function pc(i) {
1744
1745
  return h(this, null, function* () {
1745
1746
  return {
1746
1747
  type: v.Announce,
1747
- namespace: yield La(i),
1748
+ namespace: yield Ra(i),
1748
1749
  params: yield Yi(i)
1749
1750
  };
1750
1751
  });
1751
1752
  }
1752
- function bc(i) {
1753
+ function mc(i) {
1753
1754
  return h(this, null, function* () {
1754
1755
  return {
1755
1756
  type: v.SubscribeError,
@@ -1760,7 +1761,7 @@ function bc(i) {
1760
1761
  };
1761
1762
  });
1762
1763
  }
1763
- function yc(i, t, e) {
1764
+ function bc(i, t, e) {
1764
1765
  return h(this, null, function* () {
1765
1766
  return {
1766
1767
  type: v.Unknown,
@@ -1770,7 +1771,7 @@ function yc(i, t, e) {
1770
1771
  });
1771
1772
  }
1772
1773
  var W;
1773
- class sa {
1774
+ class ea {
1774
1775
  constructor(t) {
1775
1776
  o(this, W);
1776
1777
  u(this, W, t);
@@ -1783,28 +1784,28 @@ class sa {
1783
1784
  const t = yield s(this, W).readVarInt(), e = yield s(this, W).readVarInt();
1784
1785
  switch (t) {
1785
1786
  case v.ServerSetup:
1786
- return ec(s(this, W));
1787
+ return tc(s(this, W));
1787
1788
  case v.ClientSetup:
1788
- return _o(s(this, W));
1789
+ return qo(s(this, W));
1789
1790
  case v.Subscribe:
1790
- return rc(s(this, W));
1791
+ return nc(s(this, W));
1791
1792
  case v.SubscribeOk:
1792
- return hc(s(this, W));
1793
+ return uc(s(this, W));
1793
1794
  case v.SubscribeDone:
1794
- return cc(s(this, W));
1795
+ return oc(s(this, W));
1795
1796
  case v.SubscribeError:
1796
- return bc(s(this, W));
1797
+ return mc(s(this, W));
1797
1798
  case v.Unsubscribe:
1798
- return fc(s(this, W));
1799
+ return dc(s(this, W));
1799
1800
  case v.Announce:
1800
- return mc(s(this, W));
1801
+ return pc(s(this, W));
1801
1802
  }
1802
- return yc(s(this, W), k(t), e);
1803
+ return bc(s(this, W), k(t), e);
1803
1804
  });
1804
1805
  }
1805
1806
  }
1806
1807
  W = new WeakMap();
1807
- var hi, Ye, Je, li, Ln, qa, jn;
1808
+ var hi, Ye, Je, li, Ln, Qa, jn;
1808
1809
  const Le = class Le {
1809
1810
  constructor(t, e) {
1810
1811
  o(this, Ln);
@@ -1816,7 +1817,7 @@ const Le = class Le {
1816
1817
  }
1817
1818
  write(t) {
1818
1819
  return h(this, null, function* () {
1819
- const e = yield w(this, Ln, qa).call(this);
1820
+ const e = yield w(this, Ln, Qa).call(this);
1820
1821
  try {
1821
1822
  yield s(this, hi).write(t);
1822
1823
  } finally {
@@ -1840,27 +1841,27 @@ const Le = class Le {
1840
1841
  return s(this, Ye).cancel();
1841
1842
  }
1842
1843
  static wrapWebsocket(t) {
1843
- const e = new ReadableStream(new Xo(t, s(Le, jn))), n = new sa(new En(new Uint8Array([]), e)), r = new pc(new Dn(t), new Uint8Array([0]));
1844
+ const e = new ReadableStream(new Ho(t, s(Le, jn))), n = new ea(new En(new Uint8Array([]), e)), r = new wc(new Dn(t), new Uint8Array([0]));
1844
1845
  return new Le(r, n);
1845
1846
  }
1846
1847
  static wrapWebTransport(t) {
1847
1848
  const e = t.writable, n = t.readable;
1848
1849
  return new Le(
1849
- new za(new Yo(e)),
1850
- new sa(new En(new Uint8Array(), n))
1850
+ new $a(new Zo(e)),
1851
+ new ea(new En(new Uint8Array(), n))
1851
1852
  );
1852
1853
  }
1853
1854
  };
1854
- hi = new WeakMap(), Ye = new WeakMap(), Je = new WeakMap(), li = new WeakMap(), Ln = new WeakSet(), qa = function() {
1855
+ hi = new WeakMap(), Ye = new WeakMap(), Je = new WeakMap(), li = new WeakMap(), Ln = new WeakSet(), Qa = function() {
1855
1856
  const t = new x(), e = s(this, Je).promise.then(() => t);
1856
1857
  return u(this, Je, t), e;
1857
1858
  }, jn = new WeakMap(), o(Le, jn, 0);
1858
1859
  let On = Le;
1859
- function _a(i, t) {
1860
+ function qa(i, t) {
1860
1861
  return h(this, null, function* () {
1861
1862
  yield i.write({
1862
1863
  type: v.ClientSetup,
1863
- supportedVersions: [{ type: "known", value: Na.Draft07 }],
1864
+ supportedVersions: [{ type: "known", value: Ga.Draft07 }],
1864
1865
  parameters: /* @__PURE__ */ new Map([[An.Role, { type: An.Role, payload: new Uint8Array([t]) }]])
1865
1866
  });
1866
1867
  const e = yield i.read();
@@ -1924,7 +1925,7 @@ const Nn = class Nn {
1924
1925
  }
1925
1926
  // Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
1926
1927
  expiryState() {
1927
- return s(this, Nt).resolved && s(this, Nt).resolved.errorCode !== oc.Expired ? "done" : s(this, di).pending ? "active" : "unsubscribed";
1928
+ return s(this, Nt).resolved && s(this, Nt).resolved.errorCode !== ac.Expired ? "done" : s(this, di).pending ? "active" : "unsubscribed";
1928
1929
  }
1929
1930
  /**
1930
1931
  * Returns a promise that resolves when the subscription is about to expire (15 seconds before expiry).
@@ -1935,13 +1936,13 @@ const Nn = class Nn {
1935
1936
  }
1936
1937
  };
1937
1938
  Ke = new WeakMap(), Nt = new WeakMap(), di = new WeakMap(), Gn = new WeakMap(), ne = new WeakMap(), ct = new WeakMap(), l(Nn, "maxGraceTime", 15e3);
1938
- let br = Nn;
1939
- function gc(i, t) {
1940
- const e = new br(t), [n, r] = Rr(100), a = new vc(e, n), c = new to(i, e, r);
1939
+ let mr = Nn;
1940
+ function yc(i, t) {
1941
+ const e = new mr(t), [n, r] = Pr(100), a = new gc(e, n), c = new _a(i, e, r);
1941
1942
  return [a, c];
1942
1943
  }
1943
1944
  var re;
1944
- class vc {
1945
+ class gc {
1945
1946
  constructor(t, e) {
1946
1947
  l(this, "state");
1947
1948
  o(this, re);
@@ -1965,10 +1966,10 @@ class vc {
1965
1966
  }
1966
1967
  }
1967
1968
  re = new WeakMap();
1968
- var ua, Qe, j, qe, _e, hr, ts, Cs;
1969
- class to {
1969
+ var ca, Qe, j, qe, _e, ur, ts, Cs;
1970
+ class _a {
1970
1971
  constructor(t, e, n) {
1971
- Ce(hr, 5, this);
1972
+ Ce(ur, 5, this);
1972
1973
  o(this, ts);
1973
1974
  o(this, Qe);
1974
1975
  o(this, j);
@@ -2125,21 +2126,21 @@ class to {
2125
2126
  }
2126
2127
  });
2127
2128
  }
2128
- [(ua = [_({ context: "SubscriptionConsumer", enter: "info" })], Oe())]() {
2129
+ [(ca = [_({ context: "SubscriptionConsumer", enter: "info" })], Oe())]() {
2129
2130
  return w(this, ts, Cs).call(this);
2130
2131
  }
2131
2132
  [Symbol.asyncDispose]() {
2132
2133
  return w(this, ts, Cs).call(this);
2133
2134
  }
2134
2135
  }
2135
- hr = Ve(null), Qe = new WeakMap(), j = new WeakMap(), qe = new WeakMap(), _e = new WeakMap(), ts = new WeakSet(), Cs = function() {
2136
+ ur = Ve(null), Qe = new WeakMap(), j = new WeakMap(), qe = new WeakMap(), _e = new WeakMap(), ts = new WeakSet(), Cs = function() {
2136
2137
  return h(this, null, function* () {
2137
2138
  return yield this.close(), this.unsubscribe();
2138
2139
  });
2139
- }, Cs = X(hr, 17, "#dispose", ua, ts, Cs), Jt(hr, to);
2140
- const kc = 2e3;
2141
- var ha, la, da, fa, wa, pa, st, Q, ae, oe, Qt, R, nn, Bs, xs, Be;
2142
- class yr {
2140
+ }, Cs = X(ur, 17, "#dispose", ca, ts, Cs), Jt(ur, _a);
2141
+ const vc = 2e3;
2142
+ var ua, ha, la, da, fa, wa, st, Q, ae, oe, Qt, R, nn, Bs, xs, Be;
2143
+ class br {
2143
2144
  constructor(t, e) {
2144
2145
  Ce(Qt, 5, this);
2145
2146
  o(this, R);
@@ -2153,16 +2154,16 @@ class yr {
2153
2154
  o(this, oe, Xt.get().createContext("Subscriber"));
2154
2155
  u(this, st, t), u(this, ae, e), w(this, R, nn).call(this).catch(B), s(this, st).closed().then(() => w(this, R, xs).call(this)).catch(B);
2155
2156
  }
2156
- [(pa = [_({ context: "Session", return: "debug" })], wa = [_({ context: "Session", enter: "debug" })], Ua())]() {
2157
+ [(wa = [_({ context: "Session", return: "debug" })], fa = [_({ context: "Session", enter: "debug" })], Sa())]() {
2157
2158
  w(this, R, Bs).call(this);
2158
2159
  }
2159
- [(fa = Symbol.dispose, da = [_({ context: "Session", enter: "info", error: "error" })], la = [_({ context: "Session", enter: "debug" })], ha = [_({ context: "Session", enter: "debug" })], fa)]() {
2160
+ [(da = Symbol.dispose, la = [_({ context: "Session", enter: "info", error: "error" })], ha = [_({ context: "Session", enter: "debug" })], ua = [_({ context: "Session", enter: "debug" })], da)]() {
2160
2161
  w(this, R, Bs).call(this);
2161
2162
  }
2162
2163
  subscribe(t, e) {
2163
2164
  return h(this, null, function* () {
2164
2165
  const n = this.nextSubscribeId++, r = /* @__PURE__ */ new Map(), a = s(this, st).authToken.current();
2165
- a && r.set(ea, { type: ea, payload: new TextEncoder().encode(a) });
2166
+ a && r.set(ta, { type: ta, payload: new TextEncoder().encode(a) });
2166
2167
  const c = {
2167
2168
  type: v.Subscribe,
2168
2169
  namespace: t,
@@ -2173,10 +2174,10 @@ class yr {
2173
2174
  subscriberPriority: e.priority,
2174
2175
  filterType: e.filterType,
2175
2176
  params: r
2176
- }, [d, f] = gc(s(this, ae), c);
2177
+ }, [d, f] = yc(s(this, ae), c);
2177
2178
  if (s(this, Q).update((b) => b.set(n, d)), yield s(this, ae).push(c), !(yield Promise.race([d.state.ok(), s(this, st).closed()])))
2178
2179
  throw new Error("Session closed");
2179
- return f.closed().then(() => Promise.race([er(kc), this.closed()])).then(() => w(this, R, Be).call(this, f.id)).catch(() => w(this, R, Be).call(this, f.id)), f;
2180
+ return f.closed().then(() => Promise.race([er(vc), this.closed()])).then(() => w(this, R, Be).call(this, f.id)).catch(() => w(this, R, Be).call(this, f.id)), f;
2180
2181
  });
2181
2182
  }
2182
2183
  closed() {
@@ -2260,9 +2261,9 @@ Qt = Ve(null), st = new WeakMap(), Q = new WeakMap(), ae = new WeakMap(), oe = n
2260
2261
  s(this, Q).current().forEach((t) => t.close()), s(this, Q).close();
2261
2262
  }, Be = function(t) {
2262
2263
  s(this, Q).isClosed() || s(this, Q).update((e) => (e.delete(t), e));
2263
- }, nn = X(Qt, 17, "#observeChanges", pa, R, nn), Bs = X(Qt, 17, "#dispose", wa, R, Bs), X(Qt, 1, "subscribe", da, yr), xs = X(Qt, 17, "#close", la, R, xs), Be = X(Qt, 17, "#deleteSubscription", ha, R, Be), Jt(Qt, yr);
2264
- var ma, ba, ya, ut, fi, ce, es, ss, M, eo, so, As, rn, an, on;
2265
- ya = [_({ context: "Session", return: "info", error: "error" })], ba = [_({ context: "Session", return: "info", error: "error" })], ma = [_({ context: "Session", return: "info", error: "error" })];
2264
+ }, nn = X(Qt, 17, "#observeChanges", wa, R, nn), Bs = X(Qt, 17, "#dispose", fa, R, Bs), X(Qt, 1, "subscribe", la, br), xs = X(Qt, 17, "#close", ha, R, xs), Be = X(Qt, 17, "#deleteSubscription", ua, R, Be), Jt(Qt, br);
2265
+ var pa, ma, ba, ut, fi, ce, es, ss, M, to, eo, As, rn, an, on;
2266
+ ba = [_({ context: "Session", return: "info", error: "error" })], ma = [_({ context: "Session", return: "info", error: "error" })], pa = [_({ context: "Session", return: "info", error: "error" })];
2266
2267
  const Fn = class Fn {
2267
2268
  constructor(t, e, n) {
2268
2269
  Ce(As, 5, this);
@@ -2277,10 +2278,10 @@ const Fn = class Fn {
2277
2278
  o(this, es);
2278
2279
  o(this, ss, Xt.get().createContext("Subscriber"));
2279
2280
  l(this, "authToken");
2280
- u(this, ut, t), u(this, ce, e), u(this, fi, w(this, M, so).call(this)), this.authToken = new ft(n);
2281
+ u(this, ut, t), u(this, ce, e), u(this, fi, w(this, M, eo).call(this)), this.authToken = new ft(n);
2281
2282
  }
2282
2283
  static subscriber(t, e) {
2283
- const [n, r] = Rr(100), a = new Fn(t, r, e), c = new yr(a, n);
2284
+ const [n, r] = Pr(100), a = new Fn(t, r, e), c = new br(a, n);
2284
2285
  return u(a, es, c), c;
2285
2286
  }
2286
2287
  transportType() {
@@ -2300,7 +2301,7 @@ const Fn = class Fn {
2300
2301
  }
2301
2302
  }
2302
2303
  };
2303
- As = Ve(null), ut = new WeakMap(), fi = new WeakMap(), ce = new WeakMap(), es = new WeakMap(), ss = new WeakMap(), M = new WeakSet(), eo = function(t) {
2304
+ As = Ve(null), ut = new WeakMap(), fi = new WeakMap(), ce = new WeakMap(), es = new WeakMap(), ss = new WeakMap(), M = new WeakSet(), to = function(t) {
2304
2305
  return h(this, null, function* () {
2305
2306
  var e;
2306
2307
  switch (s(this, ss).debug("received message", t), yield (e = s(this, es)) == null ? void 0 : e.onMessage(t), t.type) {
@@ -2308,7 +2309,7 @@ As = Ve(null), ut = new WeakMap(), fi = new WeakMap(), ce = new WeakMap(), es =
2308
2309
  break;
2309
2310
  }
2310
2311
  });
2311
- }, so = function() {
2312
+ }, eo = function() {
2312
2313
  return h(this, null, function* () {
2313
2314
  return (yield Promise.all([w(this, M, an).call(this), w(this, M, on).call(this), w(this, M, rn).call(this)])).find((e) => e instanceof Error);
2314
2315
  });
@@ -2343,7 +2344,7 @@ As = Ve(null), ut = new WeakMap(), fi = new WeakMap(), ce = new WeakMap(), es =
2343
2344
  });
2344
2345
  if (!t)
2345
2346
  break;
2346
- yield w(this, M, eo).call(this, t);
2347
+ yield w(this, M, to).call(this, t);
2347
2348
  }
2348
2349
  } catch (t) {
2349
2350
  return t;
@@ -2365,9 +2366,9 @@ As = Ve(null), ut = new WeakMap(), fi = new WeakMap(), ce = new WeakMap(), es =
2365
2366
  return e;
2366
2367
  }
2367
2368
  });
2368
- }, rn = X(As, 17, "#runOutgoingMessages", ya, M, rn), an = X(As, 17, "#runControl", ba, M, an), on = X(As, 17, "#runObjects", ma, M, on), Jt(As, Fn);
2369
+ }, rn = X(As, 17, "#runOutgoingMessages", ba, M, rn), an = X(As, 17, "#runControl", ma, M, an), on = X(As, 17, "#runObjects", pa, M, on), Jt(As, Fn);
2369
2370
  let Vn = Fn;
2370
- var gr = /* @__PURE__ */ ((i) => (i[i.StreamHeaderGroup = 4] = "StreamHeaderGroup", i[i.FetchHeader = 5] = "FetchHeader", i[i.StreamHeaderTrack = 60] = "StreamHeaderTrack", i))(gr || {});
2371
+ var yr = /* @__PURE__ */ ((i) => (i[i.StreamHeaderGroup = 4] = "StreamHeaderGroup", i[i.FetchHeader = 5] = "FetchHeader", i[i.StreamHeaderTrack = 60] = "StreamHeaderTrack", i))(yr || {});
2371
2372
  const $ = {
2372
2373
  Normal: 0,
2373
2374
  ObjectDoesNotExist: 1,
@@ -2375,7 +2376,7 @@ const $ = {
2375
2376
  EndOfGroup: 3,
2376
2377
  EndOfTrackAndGroup: 4
2377
2378
  };
2378
- function io(i) {
2379
+ function so(i) {
2379
2380
  switch (i) {
2380
2381
  case $.Normal:
2381
2382
  case $.ObjectDoesNotExist:
@@ -2387,7 +2388,7 @@ function io(i) {
2387
2388
  throw new Error("Unknown object status " + i);
2388
2389
  }
2389
2390
  var kt, is, ns, wi, pi, rs, mi;
2390
- class Ic {
2391
+ class kc {
2391
2392
  constructor(t, e, n, r, a) {
2392
2393
  o(this, kt);
2393
2394
  o(this, is);
@@ -2415,7 +2416,7 @@ class Ic {
2415
2416
  return { done: !0, value: void 0 };
2416
2417
  const t = s(this, mi) === 0 ? s(this, is) : yield s(this, kt).readBigVarInt(), e = yield s(this, kt).readBigVarInt(), n = yield s(this, kt).readVarInt();
2417
2418
  let r = 0, a = new Uint8Array();
2418
- return n > 0 ? a = yield s(this, kt).read(n) : r = yield s(this, kt).readVarInt(), io(r), (r === $.EndOfTrackAndGroup || r === $.EndOfGroup) && s(this, rs).resolve(r), _r(this, mi)._++, {
2419
+ return n > 0 ? a = yield s(this, kt).read(n) : r = yield s(this, kt).readVarInt(), so(r), (r === $.EndOfTrackAndGroup || r === $.EndOfGroup) && s(this, rs).resolve(r), qr(this, mi)._++, {
2419
2420
  done: !1,
2420
2421
  value: {
2421
2422
  subscribeId: s(this, ns),
@@ -2448,8 +2449,8 @@ class Ic {
2448
2449
  }
2449
2450
  }
2450
2451
  kt = new WeakMap(), is = new WeakMap(), ns = new WeakMap(), wi = new WeakMap(), pi = new WeakMap(), rs = new WeakMap(), mi = new WeakMap();
2451
- var Vt, as, bi, yi, Ee, no, vr;
2452
- class Sc {
2452
+ var Vt, as, bi, yi, Ee, io, gr;
2453
+ class Ic {
2453
2454
  constructor(t, e, n, r) {
2454
2455
  o(this, Ee);
2455
2456
  o(this, Vt);
@@ -2459,7 +2460,7 @@ class Sc {
2459
2460
  u(this, Vt, t), u(this, as, e), u(this, bi, n), u(this, yi, r);
2460
2461
  }
2461
2462
  groups() {
2462
- return w(this, Ee, no).call(this);
2463
+ return w(this, Ee, io).call(this);
2463
2464
  }
2464
2465
  subscribeId() {
2465
2466
  return s(this, as);
@@ -2473,16 +2474,16 @@ class Sc {
2473
2474
  return this;
2474
2475
  }
2475
2476
  [Oe()]() {
2476
- return w(this, Ee, vr).call(this);
2477
+ return w(this, Ee, gr).call(this);
2477
2478
  }
2478
2479
  [Symbol.asyncDispose]() {
2479
- return w(this, Ee, vr).call(this);
2480
+ return w(this, Ee, gr).call(this);
2480
2481
  }
2481
2482
  }
2482
- Vt = new WeakMap(), as = new WeakMap(), bi = new WeakMap(), yi = new WeakMap(), Ee = new WeakSet(), no = function() {
2483
+ Vt = new WeakMap(), as = new WeakMap(), bi = new WeakMap(), yi = new WeakMap(), Ee = new WeakSet(), io = function() {
2483
2484
  return Dt(this, null, function* () {
2484
2485
  for (; !(yield new A(s(this, Vt).isDone())); ) {
2485
- const t = yield new A(s(this, Vt).readBigVarInt()), e = new Ic(
2486
+ const t = yield new A(s(this, Vt).readBigVarInt()), e = new kc(
2486
2487
  s(this, Vt),
2487
2488
  t,
2488
2489
  s(this, as),
@@ -2493,12 +2494,12 @@ Vt = new WeakMap(), as = new WeakMap(), bi = new WeakMap(), yi = new WeakMap(),
2493
2494
  return;
2494
2495
  }
2495
2496
  });
2496
- }, vr = function() {
2497
+ }, gr = function() {
2497
2498
  return s(this, Vt).close().catch(() => {
2498
2499
  });
2499
2500
  };
2500
- var ht, os, gi, cs, vi, ki, Ii, Wn, De, ro, kr;
2501
- class Uc {
2501
+ var ht, os, gi, cs, vi, ki, Ii, Wn, De, no, vr;
2502
+ class Sc {
2502
2503
  constructor(t, e, n, r, a, c) {
2503
2504
  o(this, De);
2504
2505
  o(this, ht);
@@ -2524,7 +2525,7 @@ class Uc {
2524
2525
  return { done: !0, value: void 0 };
2525
2526
  const t = yield s(this, ht).readBigVarInt(), e = yield s(this, ht).readVarInt();
2526
2527
  let n = 0, r = new Uint8Array();
2527
- return e > 0 ? r = yield s(this, ht).read(e) : n = yield s(this, ht).readVarInt(), io(n), n === $.EndOfGroup && u(this, Ii, !0), {
2528
+ return e > 0 ? r = yield s(this, ht).read(e) : n = yield s(this, ht).readVarInt(), so(n), n === $.EndOfGroup && u(this, Ii, !0), {
2528
2529
  done: !1,
2529
2530
  value: {
2530
2531
  subscribeId: s(this, os),
@@ -2549,37 +2550,37 @@ class Uc {
2549
2550
  });
2550
2551
  }
2551
2552
  groups() {
2552
- return w(this, De, ro).call(this);
2553
+ return w(this, De, no).call(this);
2553
2554
  }
2554
2555
  [Symbol.asyncIterator]() {
2555
2556
  return this;
2556
2557
  }
2557
2558
  [Oe()]() {
2558
- return w(this, De, kr).call(this);
2559
+ return w(this, De, vr).call(this);
2559
2560
  }
2560
2561
  [Symbol.asyncDispose]() {
2561
- return w(this, De, kr).call(this);
2562
+ return w(this, De, vr).call(this);
2562
2563
  }
2563
2564
  }
2564
- ht = new WeakMap(), os = new WeakMap(), gi = new WeakMap(), cs = new WeakMap(), vi = new WeakMap(), ki = new WeakMap(), Ii = new WeakMap(), Wn = new WeakMap(), De = new WeakSet(), ro = function() {
2565
+ ht = new WeakMap(), os = new WeakMap(), gi = new WeakMap(), cs = new WeakMap(), vi = new WeakMap(), ki = new WeakMap(), Ii = new WeakMap(), Wn = new WeakMap(), De = new WeakSet(), no = function() {
2565
2566
  return Dt(this, null, function* () {
2566
2567
  yield this;
2567
2568
  });
2568
- }, kr = function() {
2569
+ }, vr = function() {
2569
2570
  return s(this, ht).close().catch(() => {
2570
2571
  });
2571
2572
  };
2572
- function ao(i) {
2573
+ function ro(i) {
2573
2574
  return h(this, null, function* () {
2574
2575
  const t = yield i.readVarInt();
2575
2576
  switch (t) {
2576
- case gr.StreamHeaderGroup: {
2577
+ case yr.StreamHeaderGroup: {
2577
2578
  const e = yield i.readBigVarInt(), n = yield i.readBigVarInt(), r = yield i.readBigVarInt(), a = yield i.readBigVarInt(), c = yield i.readUnsigned8();
2578
- return new Uc(i, e, n, r, a, c);
2579
+ return new Sc(i, e, n, r, a, c);
2579
2580
  }
2580
- case gr.StreamHeaderTrack: {
2581
+ case yr.StreamHeaderTrack: {
2581
2582
  const e = yield i.readBigVarInt(), n = yield i.readBigVarInt(), r = yield i.readUnsigned8();
2582
- return new Sc(i, e, n, r);
2583
+ return new Ic(i, e, n, r);
2583
2584
  }
2584
2585
  default:
2585
2586
  throw new Error("Unexpected message type " + t);
@@ -2587,14 +2588,14 @@ function ao(i) {
2587
2588
  });
2588
2589
  }
2589
2590
  var ue, Ft, us, he, Ct;
2590
- class Tc {
2591
+ class Uc {
2591
2592
  constructor(t, e) {
2592
2593
  o(this, ue);
2593
2594
  o(this, Ft);
2594
2595
  o(this, us);
2595
2596
  o(this, he);
2596
2597
  o(this, Ct, /* @__PURE__ */ new Map());
2597
- u(this, ue, t), u(this, Ft, e), u(this, us, new ReadableStream(new Zo(t))), s(this, ue).addEventListener("close", () => {
2598
+ u(this, ue, t), u(this, Ft, e), u(this, us, new ReadableStream(new Xo(t))), s(this, ue).addEventListener("close", () => {
2598
2599
  s(this, Ct).forEach((n) => n.close());
2599
2600
  });
2600
2601
  }
@@ -2624,7 +2625,7 @@ class Tc {
2624
2625
  c.length > 0 && (yield d.push(c)), r || (d.close(), s(this, Ct).delete(k(a)));
2625
2626
  } else {
2626
2627
  let b;
2627
- const [d, f] = Rr(100), p = new ReadableStream({
2628
+ const [d, f] = Pr(100), p = new ReadableStream({
2628
2629
  pull(m) {
2629
2630
  return h(this, null, function* () {
2630
2631
  const I = yield f.pop();
@@ -2633,7 +2634,7 @@ class Tc {
2633
2634
  }
2634
2635
  });
2635
2636
  if (s(this, Ct).set(k(a), d), r || (yield p.cancel(), s(this, Ct).delete(k(a))), c.length > 0)
2636
- return yield ao(new En(c, p));
2637
+ return yield ro(new En(c, p));
2637
2638
  }
2638
2639
  } finally {
2639
2640
  (t = s(this, he)) == null || t.releaseLock();
@@ -2660,16 +2661,16 @@ class Tc {
2660
2661
  }
2661
2662
  }
2662
2663
  ue = new WeakMap(), Ft = new WeakMap(), us = new WeakMap(), he = new WeakMap(), Ct = new WeakMap();
2663
- var le, de, fe, Si, $n, zn, oo;
2664
- class Ec {
2664
+ var le, de, fe, Si, $n, zn, ao;
2665
+ class Tc {
2665
2666
  constructor(t, e, n) {
2666
2667
  o(this, zn);
2667
2668
  o(this, le);
2668
2669
  o(this, de);
2669
- o(this, fe, new Lr(100));
2670
+ o(this, fe, new Rr(100));
2670
2671
  o(this, Si);
2671
2672
  o(this, $n, Xt.get().createContext("WebTransportConnection"));
2672
- u(this, Si, n), u(this, le, t), u(this, de, e), w(this, zn, oo).call(this).catch((r) => {
2673
+ u(this, Si, n), u(this, le, t), u(this, de, e), w(this, zn, ao).call(this).catch((r) => {
2673
2674
  s(this, $n).debug("Incoming streams handling ended with error", r), s(this, fe).close();
2674
2675
  });
2675
2676
  }
@@ -2706,7 +2707,7 @@ class Ec {
2706
2707
  });
2707
2708
  }
2708
2709
  }
2709
- le = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), Si = new WeakMap(), $n = new WeakMap(), zn = new WeakSet(), oo = function() {
2710
+ le = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), Si = new WeakMap(), $n = new WeakMap(), zn = new WeakSet(), ao = function() {
2710
2711
  return h(this, null, function* () {
2711
2712
  const t = s(this, le).incomingUnidirectionalStreams.getReader();
2712
2713
  for (; ; ) {
@@ -2716,25 +2717,25 @@ le = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), Si = new WeakMap(),
2716
2717
  return;
2717
2718
  }
2718
2719
  const r = new En(new Uint8Array(), e);
2719
- yield s(this, fe).push(ao(r));
2720
+ yield s(this, fe).push(ro(r));
2720
2721
  }
2721
2722
  });
2722
2723
  };
2723
- function cr(i) {
2724
+ function or(i) {
2724
2725
  return h(this, null, function* () {
2725
2726
  const t = new WebSocket(i.url);
2726
2727
  t.binaryType = "arraybuffer", yield new Promise((a, c) => {
2727
2728
  t.addEventListener("error", c, { once: !0 }), t.addEventListener("open", a, { once: !0 });
2728
2729
  });
2729
2730
  const e = On.wrapWebsocket(t);
2730
- _a(e, Ga.Subscriber).catch(() => {
2731
+ qa(e, ja.Subscriber).catch(() => {
2731
2732
  t.close();
2732
2733
  });
2733
- const n = new Tc(t, e);
2734
+ const n = new Uc(t, e);
2734
2735
  return Vn.subscriber(n, i.authToken);
2735
2736
  });
2736
2737
  }
2737
- function ia(i) {
2738
+ function sa(i) {
2738
2739
  return h(this, null, function* () {
2739
2740
  const t = "60b82e8021689e163c1041b4475ef9c86e7565bc45d1a0aa43f5148769f461c7", e = new Uint8Array(t.length / 2);
2740
2741
  for (let f = 0; f < e.length; f += 1)
@@ -2745,22 +2746,22 @@ function ia(i) {
2745
2746
  });
2746
2747
  yield Promise.race([n.ready, n.closed.then(() => Promise.reject(new Error("WebTransport closed")))]);
2747
2748
  const r = yield n.createBidirectionalStream(), a = On.wrapWebTransport(r);
2748
- _a(a, Ga.Subscriber).catch(() => {
2749
+ qa(a, ja.Subscriber).catch(() => {
2749
2750
  n.close();
2750
2751
  });
2751
- const c = new Ec(n, a, i.url.toString());
2752
+ const c = new Tc(n, a, i.url.toString());
2752
2753
  return Vn.subscriber(c, i.authToken);
2753
2754
  });
2754
2755
  }
2755
- function Dc(i) {
2756
+ function Ec(i) {
2756
2757
  return h(this, null, function* () {
2757
2758
  if (self.WebTransport && (i == null ? void 0 : i.preferredTransport) !== "websocket" && i.url.protocol.startsWith("https")) {
2758
2759
  if (!i.websocketFallbackTimeoutMs)
2759
- return ia(i);
2760
- const t = ia(i).catch(() => cr(i)), e = yield Promise.race([t, er(i.websocketFallbackTimeoutMs)]);
2761
- return e || cr(i);
2760
+ return sa(i);
2761
+ const t = sa(i).catch(() => or(i)), e = yield Promise.race([t, er(i.websocketFallbackTimeoutMs)]);
2762
+ return e || or(i);
2762
2763
  }
2763
- return cr(i);
2764
+ return or(i);
2764
2765
  });
2765
2766
  }
2766
2767
  var Bt;
@@ -2805,7 +2806,7 @@ class Rt {
2805
2806
  }
2806
2807
  Bt = new WeakMap();
2807
2808
  var hs, Ui;
2808
- class co {
2809
+ class oo {
2809
2810
  constructor(t, e) {
2810
2811
  o(this, hs);
2811
2812
  o(this, Ui);
@@ -2828,22 +2829,22 @@ function Kt(i) {
2828
2829
  throw new Error("namespace must contain a channel ID");
2829
2830
  return t;
2830
2831
  }
2831
- function Ac(i) {
2832
+ function Dc(i) {
2832
2833
  return "tracks" in i;
2833
2834
  }
2834
- function Oc(i) {
2835
+ function Ac(i) {
2835
2836
  const t = new TextDecoder().decode(i);
2836
2837
  return JSON.parse(t);
2837
2838
  }
2838
- var q, It, we, it, Ti, Mn, Ei, Ir;
2839
- const Gr = class Gr {
2839
+ var q, It, we, it, Ti, Mn, Ei, kr;
2840
+ const jr = class jr {
2840
2841
  constructor(t, e) {
2841
2842
  o(this, Ei);
2842
2843
  o(this, q);
2843
2844
  // The largest group id seen so far - used to switch seamlessly between tracks
2844
2845
  o(this, It);
2845
2846
  // We keep track of the most recent groups to ensure we haven't missed any due to re-ordering before we close subscriptions
2846
- o(this, we, new Pr(100));
2847
+ o(this, we, new xr(100));
2847
2848
  // This contains the unconsumed groups if this track has an absolute range
2848
2849
  o(this, it);
2849
2850
  o(this, Ti);
@@ -2853,7 +2854,7 @@ const Gr = class Gr {
2853
2854
  if (s(this, it))
2854
2855
  return;
2855
2856
  const e = s(this, we).items().reduce((n, r) => n < r ? n : r, t);
2856
- u(this, it, w(this, Ei, Ir).call(this, e, t)), s(this, it).size === 0 && (yield s(this, q).close());
2857
+ u(this, it, w(this, Ei, kr).call(this, e, t)), s(this, it).size === 0 && (yield s(this, q).close());
2857
2858
  }));
2858
2859
  u(this, q, t), u(this, It, e), t.done().then((n) => h(this, null, function* () {
2859
2860
  var r;
@@ -2863,7 +2864,7 @@ const Gr = class Gr {
2863
2864
  static subscribe(t, e) {
2864
2865
  return h(this, null, function* () {
2865
2866
  const n = yield t.subscribe(e);
2866
- return new Gr(n, void 0);
2867
+ return new jr(n, void 0);
2867
2868
  });
2868
2869
  }
2869
2870
  subscribeId() {
@@ -2889,7 +2890,7 @@ const Gr = class Gr {
2889
2890
  }
2890
2891
  update(t, e) {
2891
2892
  return h(this, null, function* () {
2892
- return u(this, it, w(this, Ei, Ir).call(this, t, e)), s(this, it).size === 0 && (yield s(this, q).close()), s(this, q).update(t, e);
2893
+ return u(this, it, w(this, Ei, kr).call(this, t, e)), s(this, it).size === 0 && (yield s(this, q).close()), s(this, q).update(t, e);
2893
2894
  });
2894
2895
  }
2895
2896
  unsubscribe() {
@@ -2914,7 +2915,7 @@ const Gr = class Gr {
2914
2915
  return this;
2915
2916
  }
2916
2917
  };
2917
- q = new WeakMap(), It = new WeakMap(), we = new WeakMap(), it = new WeakMap(), Ti = new WeakMap(), Mn = new WeakMap(), Ei = new WeakSet(), Ir = function(t, e) {
2918
+ q = new WeakMap(), It = new WeakMap(), we = new WeakMap(), it = new WeakMap(), Ti = new WeakMap(), Mn = new WeakMap(), Ei = new WeakSet(), kr = function(t, e) {
2918
2919
  const n = /* @__PURE__ */ new Set();
2919
2920
  for (let r = t; r <= e; r++)
2920
2921
  n == null || n.add(r);
@@ -2922,16 +2923,16 @@ q = new WeakMap(), It = new WeakMap(), we = new WeakMap(), it = new WeakMap(), T
2922
2923
  n == null || n.delete(r);
2923
2924
  }), n;
2924
2925
  };
2925
- let Cn = Gr;
2926
+ let Cn = jr;
2926
2927
  var St, pe, xt, Wt, Di;
2927
- const Nr = class Nr {
2928
+ const Gr = class Gr {
2928
2929
  constructor(t) {
2929
2930
  // The current active subscription
2930
2931
  o(this, St);
2931
2932
  // The current group iterator - gets replaced by the next in #groups when it runs out
2932
2933
  o(this, pe);
2933
2934
  // The next group iterators to switch to when the current one runs out
2934
- o(this, xt, new Lr(10));
2935
+ o(this, xt, new Rr(10));
2935
2936
  o(this, Wt);
2936
2937
  o(this, Di, (t, e) => h(this, null, function* () {
2937
2938
  var m = [];
@@ -2974,11 +2975,11 @@ const Nr = class Nr {
2974
2975
  bt(m, y, E);
2975
2976
  }
2976
2977
  }));
2977
- u(this, St, new Go(t)), u(this, pe, t), u(this, Wt, Xt.get().createContext(`Renewable '${t.name()}'`));
2978
+ u(this, St, new jo(t)), u(this, pe, t), u(this, Wt, Xt.get().createContext(`Renewable '${t.name()}'`));
2978
2979
  }
2979
2980
  static subscribe(t, e, n) {
2980
2981
  return h(this, null, function* () {
2981
- const r = yield t.subscribe(e), a = new Nr(new Cn(r, n));
2982
+ const r = yield t.subscribe(e), a = new Gr(new Cn(r, n));
2982
2983
  return r.expiryNotification().then(() => {
2983
2984
  var c;
2984
2985
  return s(c = a, Di).call(c, t, e);
@@ -3068,7 +3069,7 @@ const Nr = class Nr {
3068
3069
  var e = [];
3069
3070
  try {
3070
3071
  const m = mt(e, t, !0);
3071
- yield* or(m);
3072
+ yield* ar(m);
3072
3073
  } catch (n) {
3073
3074
  var r = n, a = !0;
3074
3075
  } finally {
@@ -3090,15 +3091,15 @@ const Nr = class Nr {
3090
3091
  }
3091
3092
  };
3092
3093
  St = new WeakMap(), pe = new WeakMap(), xt = new WeakMap(), Wt = new WeakMap(), Di = new WeakMap();
3093
- let Ht = Nr;
3094
- const Vc = "catalog";
3095
- function na(i) {
3096
- const t = Oc(i.payload);
3097
- if (!Ac(t))
3094
+ let Ht = Gr;
3095
+ const Oc = "catalog";
3096
+ function ia(i) {
3097
+ const t = Ac(i.payload);
3098
+ if (!Dc(t))
3098
3099
  throw new Error("unexpected catalog type");
3099
3100
  return t;
3100
3101
  }
3101
- var me, Ai, Oi, Vi, Hn, uo;
3102
+ var me, Ai, Oi, Vi, Hn, co;
3102
3103
  const Xn = class Xn {
3103
3104
  constructor(t, e, n) {
3104
3105
  o(this, Hn);
@@ -3106,7 +3107,7 @@ const Xn = class Xn {
3106
3107
  o(this, Ai);
3107
3108
  o(this, Oi);
3108
3109
  o(this, Vi);
3109
- u(this, Ai, t), u(this, me, e), u(this, Oi, n), u(this, Vi, w(this, Hn, uo).call(this));
3110
+ u(this, Ai, t), u(this, me, e), u(this, Oi, n), u(this, Vi, w(this, Hn, co).call(this));
3110
3111
  }
3111
3112
  catalog() {
3112
3113
  return s(this, me);
@@ -3124,7 +3125,7 @@ const Xn = class Xn {
3124
3125
  const n = x.fromPromise(
3125
3126
  Ht.subscribe(
3126
3127
  t,
3127
- new Rt().name(e.catalogName || Vc).groupOrder("ascending").build()
3128
+ new Rt().name(e.catalogName || Oc).groupOrder("ascending").build()
3128
3129
  )
3129
3130
  ), r = x.fromPromise(n.promise.then((f) => f.objects()));
3130
3131
  if (e.catalog)
@@ -3132,12 +3133,12 @@ const Xn = class Xn {
3132
3133
  const c = yield (yield r.promise).next();
3133
3134
  if (!c.value)
3134
3135
  throw new Error("No catalog found");
3135
- const d = na(c.value);
3136
+ const d = ia(c.value);
3136
3137
  return new Xn(n, new ft(d), r);
3137
3138
  });
3138
3139
  }
3139
3140
  };
3140
- me = new WeakMap(), Ai = new WeakMap(), Oi = new WeakMap(), Vi = new WeakMap(), Hn = new WeakSet(), uo = function() {
3141
+ me = new WeakMap(), Ai = new WeakMap(), Oi = new WeakMap(), Vi = new WeakMap(), Hn = new WeakSet(), co = function() {
3141
3142
  return h(this, null, function* () {
3142
3143
  const t = yield s(this, Oi).promise;
3143
3144
  try {
@@ -3145,7 +3146,7 @@ me = new WeakMap(), Ai = new WeakMap(), Oi = new WeakMap(), Vi = new WeakMap(),
3145
3146
  const c = r.value;
3146
3147
  if (c.objectStatus !== $.Normal)
3147
3148
  continue;
3148
- const d = na(c);
3149
+ const d = ia(c);
3149
3150
  s(this, me).update(d);
3150
3151
  }
3151
3152
  } catch (r) {
@@ -3160,15 +3161,15 @@ me = new WeakMap(), Ai = new WeakMap(), Oi = new WeakMap(), Vi = new WeakMap(),
3160
3161
  }
3161
3162
  });
3162
3163
  };
3163
- let Sr = Xn;
3164
- function ho(i) {
3164
+ let Ir = Xn;
3165
+ function uo(i) {
3165
3166
  const t = atob(i), e = new Uint8Array(t.length);
3166
3167
  for (let n = 0; n < t.length; n++)
3167
3168
  e[n] = t.charCodeAt(n);
3168
3169
  return e.buffer;
3169
3170
  }
3170
- var Ci, ls, Bi, ds, xi, Ur;
3171
- class Cc {
3171
+ var Ci, ls, Bi, ds, xi, Sr;
3172
+ class Vc {
3172
3173
  constructor(t, e, n, r) {
3173
3174
  o(this, xi);
3174
3175
  o(this, Ci);
@@ -3192,7 +3193,7 @@ class Cc {
3192
3193
  const y = this.track.timestampRange();
3193
3194
  if (y && p >= y[1])
3194
3195
  break;
3195
- s(this, ds).debug("fragment", rr(Yt({}, t), {
3196
+ s(this, ds).debug("fragment", nr(Yt({}, t), {
3196
3197
  startTime: p,
3197
3198
  endTime: m,
3198
3199
  subscribeId: c.subscribeId,
@@ -3214,19 +3215,19 @@ class Cc {
3214
3215
  });
3215
3216
  }
3216
3217
  [Oe()]() {
3217
- return w(this, xi, Ur).call(this);
3218
+ return w(this, xi, Sr).call(this);
3218
3219
  }
3219
3220
  [Symbol.asyncDispose]() {
3220
- return w(this, xi, Ur).call(this);
3221
+ return w(this, xi, Sr).call(this);
3221
3222
  }
3222
3223
  }
3223
- Ci = new WeakMap(), ls = new WeakMap(), Bi = new WeakMap(), ds = new WeakMap(), xi = new WeakSet(), Ur = function() {
3224
+ Ci = new WeakMap(), ls = new WeakMap(), Bi = new WeakMap(), ds = new WeakMap(), xi = new WeakSet(), Sr = function() {
3224
3225
  return h(this, null, function* () {
3225
3226
  var t, e;
3226
3227
  return yield (e = (t = s(this, ls)).return) == null ? void 0 : e.call(t), Promise.resolve();
3227
3228
  });
3228
3229
  };
3229
- var Pi, Ut, Ri, Li, Zn, lo;
3230
+ var Pi, Ut, Ri, Li, Zn, ho;
3230
3231
  const je = class je {
3231
3232
  constructor(t, e, n, r, a) {
3232
3233
  o(this, Pi);
@@ -3249,13 +3250,13 @@ const je = class je {
3249
3250
  const c = a.build();
3250
3251
  if (e.initTrack) {
3251
3252
  const m = new Rt().name(e.initTrack).build(), [I, y] = yield Promise.all([
3252
- w(b = je, Zn, lo).call(b, t, m),
3253
+ w(b = je, Zn, ho).call(b, t, m),
3253
3254
  Ht.subscribe(t, c, r ? r - k(1) : void 0)
3254
- ]), E = new ta(I);
3255
+ ]), E = new _r(I);
3255
3256
  return new je(e, t.namespace(), y, E, n);
3256
3257
  }
3257
- Sa(e.initData, "no init data found on track");
3258
- const d = ho(e.initData), f = new ta(new Uint8Array(d)), p = yield Ht.subscribe(t, c, r ? r - k(1) : void 0);
3258
+ Ia(e.initData, "no init data found on track");
3259
+ const d = uo(e.initData), f = new _r(new Uint8Array(d)), p = yield Ht.subscribe(t, c, r ? r - k(1) : void 0);
3259
3260
  return new je(e, t.namespace(), p, f, n);
3260
3261
  });
3261
3262
  }
@@ -3284,7 +3285,7 @@ const je = class je {
3284
3285
  const t = yield s(this, Ut).next();
3285
3286
  return t.done ? t : {
3286
3287
  done: !1,
3287
- value: new Cc(t.value, s(this, Pi), s(this, Ri), this)
3288
+ value: new Vc(t.value, s(this, Pi), s(this, Ri), this)
3288
3289
  };
3289
3290
  });
3290
3291
  }
@@ -3305,7 +3306,7 @@ const je = class je {
3305
3306
  });
3306
3307
  }
3307
3308
  };
3308
- Pi = new WeakMap(), Ut = new WeakMap(), Ri = new WeakMap(), Li = new WeakMap(), Zn = new WeakSet(), lo = function(t, e) {
3309
+ Pi = new WeakMap(), Ut = new WeakMap(), Ri = new WeakMap(), Li = new WeakMap(), Zn = new WeakSet(), ho = function(t, e) {
3309
3310
  return h(this, null, function* () {
3310
3311
  const n = yield t.subscribe(e), r = yield n.objects().next();
3311
3312
  if (r.done)
@@ -3313,10 +3314,10 @@ Pi = new WeakMap(), Ut = new WeakMap(), Ri = new WeakMap(), Li = new WeakMap(),
3313
3314
  return yield n.close(), r.value.payload;
3314
3315
  });
3315
3316
  }, o(je, Zn);
3316
- let Tr = je;
3317
- const ra = 1e4, Bc = 3e4;
3318
- var Yn, be, ye, ji, Gi, Ni, Ae, Dr, fo;
3319
- const Fr = class Fr {
3317
+ let Ur = je;
3318
+ const na = 1e4, Cc = 3e4;
3319
+ var Yn, be, ye, ji, Gi, Ni, Ae, Er, lo;
3320
+ const Nr = class Nr {
3320
3321
  constructor(t, e, n) {
3321
3322
  o(this, Ae);
3322
3323
  o(this, Yn, Xt.get().createContext("Timeline"));
@@ -3325,7 +3326,7 @@ const Fr = class Fr {
3325
3326
  o(this, ji);
3326
3327
  o(this, Gi);
3327
3328
  o(this, Ni);
3328
- u(this, ji, t), u(this, Gi, n), u(this, ye, e), u(this, Ni, w(this, Ae, Dr).call(this, s(this, ye)));
3329
+ u(this, ji, t), u(this, Gi, n), u(this, ye, e), u(this, Ni, w(this, Ae, Er).call(this, s(this, ye)));
3329
3330
  }
3330
3331
  closed() {
3331
3332
  return s(this, Ni);
@@ -3344,13 +3345,13 @@ const Fr = class Fr {
3344
3345
  * This is useful for time aligning two streams based on the common wallclock time
3345
3346
  */
3346
3347
  timestampWallclockOffset() {
3347
- return Oo(this.timeline().map((t) => t.mediaPts - t.wallclock));
3348
+ return Ao(this.timeline().map((t) => t.mediaPts - t.wallclock));
3348
3349
  }
3349
3350
  static start(t, e) {
3350
3351
  const n = x.fromPromise(
3351
3352
  Ht.subscribe(t, new Rt().name(e).groupOrder("ascending").build())
3352
3353
  );
3353
- return new Fr(t, n, e);
3354
+ return new Nr(t, n, e);
3354
3355
  }
3355
3356
  waitForWallclockTime(t) {
3356
3357
  return h(this, null, function* () {
@@ -3361,12 +3362,12 @@ const Fr = class Fr {
3361
3362
  return h(this, null, function* () {
3362
3363
  return yield s(this, be).waitFor((t) => {
3363
3364
  const e = t[0], n = t[t.length - 1];
3364
- return !e || !n ? !1 : n.wallclock - e.wallclock > ra;
3365
+ return !e || !n ? !1 : n.wallclock - e.wallclock > na;
3365
3366
  }), this.timeline();
3366
3367
  });
3367
3368
  }
3368
3369
  };
3369
- Yn = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), ji = new WeakMap(), Gi = new WeakMap(), Ni = new WeakMap(), Ae = new WeakSet(), Dr = function(t) {
3370
+ Yn = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), ji = new WeakMap(), Gi = new WeakMap(), Ni = new WeakMap(), Ae = new WeakSet(), Er = function(t) {
3370
3371
  return h(this, null, function* () {
3371
3372
  const e = yield t.promise;
3372
3373
  try {
@@ -3380,13 +3381,13 @@ Yn = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), ji = new WeakMap(),
3380
3381
  const g = a.value;
3381
3382
  if (g.objectStatus !== $.Normal)
3382
3383
  continue;
3383
- const Y = xc(g.payload);
3384
+ const Y = Bc(g.payload);
3384
3385
  s(this, be).update((S) => {
3385
3386
  var Tt, Us;
3386
- for (S.push(...Y), S.sort((Ki, Qi) => Ki.wallclock - Qi.wallclock); S[0] && ((Us = (Tt = S[S.length - 1]) == null ? void 0 : Tt.wallclock) != null ? Us : 0) - S[0].wallclock > Bc; )
3387
+ for (S.push(...Y), S.sort((Ki, Qi) => Ki.wallclock - Qi.wallclock); S[0] && ((Us = (Tt = S[S.length - 1]) == null ? void 0 : Tt.wallclock) != null ? Us : 0) - S[0].wallclock > Cc; )
3387
3388
  S.shift();
3388
3389
  return S;
3389
- }), e === s(this, ye).resolved && g.groupId > k(0) && g.objectId == k(0) && w(this, Ae, fo).call(this, g.groupId).catch((S) => {
3390
+ }), e === s(this, ye).resolved && g.groupId > k(0) && g.objectId == k(0) && w(this, Ae, lo).call(this, g.groupId).catch((S) => {
3390
3391
  s(this, Yn).warn("backfill failed", S);
3391
3392
  });
3392
3393
  }
@@ -3418,10 +3419,10 @@ Yn = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), ji = new WeakMap(),
3418
3419
  }
3419
3420
  }
3420
3421
  });
3421
- }, fo = function(t) {
3422
+ }, lo = function(t) {
3422
3423
  return h(this, null, function* () {
3423
3424
  const e = t - k(1), n = this.timeline(), r = n[0], a = n[n.length - 1];
3424
- if (!r || !a || a.wallclock - r.wallclock > ra)
3425
+ if (!r || !a || a.wallclock - r.wallclock > na)
3425
3426
  return;
3426
3427
  const c = x.fromPromise(
3427
3428
  Ht.subscribe(
@@ -3429,11 +3430,11 @@ Yn = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), ji = new WeakMap(),
3429
3430
  new Rt().name(s(this, Gi)).groupOrder("ascending").range(e, e).build()
3430
3431
  )
3431
3432
  );
3432
- return w(this, Ae, Dr).call(this, c);
3433
+ return w(this, Ae, Er).call(this, c);
3433
3434
  });
3434
3435
  };
3435
- let Er = Fr;
3436
- function xc(i) {
3436
+ let Tr = Nr;
3437
+ function Bc(i) {
3437
3438
  var e;
3438
3439
  const t = new TextDecoder("utf-8").decode(i).split(`
3439
3440
  `);
@@ -3450,13 +3451,13 @@ function xc(i) {
3450
3451
  };
3451
3452
  });
3452
3453
  }
3453
- function Pc(i) {
3454
+ function xc(i) {
3454
3455
  return typeof i.language == "string";
3455
3456
  }
3456
3457
  var Jn, Fi, $t, fs;
3457
- const Wr = class Wr {
3458
+ const Fr = class Fr {
3458
3459
  constructor(t, e, n, r, a) {
3459
- o(this, Jn, new Vo());
3460
+ o(this, Jn, new Oo());
3460
3461
  o(this, Fi);
3461
3462
  o(this, $t);
3462
3463
  o(this, fs, 0);
@@ -3466,10 +3467,10 @@ const Wr = class Wr {
3466
3467
  }
3467
3468
  static subscribe(t, e, n) {
3468
3469
  return h(this, null, function* () {
3469
- if (!Pc(e))
3470
+ if (!xc(e))
3470
3471
  throw new Error("track object language is required");
3471
3472
  const r = new Rt().name(e.name).build(), a = yield Ht.subscribe(t, r), c = a.objects();
3472
- return new Wr(a, c, e, t.namespace(), n);
3473
+ return new Fr(a, c, e, t.namespace(), n);
3473
3474
  });
3474
3475
  }
3475
3476
  largestGroupId() {
@@ -3513,9 +3514,9 @@ const Wr = class Wr {
3513
3514
  }
3514
3515
  };
3515
3516
  Jn = new WeakMap(), Fi = new WeakMap(), $t = new WeakMap(), fs = new WeakMap();
3516
- let Ar = Wr;
3517
- var ga, ge, ve, ws, zt, lr, ps, cn;
3518
- ga = [_({ context: "Channel", enter: "info" })];
3517
+ let Dr = Fr;
3518
+ var ya, ge, ve, ws, zt, hr, ps, cn;
3519
+ ya = [_({ context: "Channel", enter: "info" })];
3519
3520
  const Ge = class Ge {
3520
3521
  constructor(t, e, n, r, a) {
3521
3522
  o(this, ps);
@@ -3528,9 +3529,9 @@ const Ge = class Ge {
3528
3529
  }
3529
3530
  static start(t, e) {
3530
3531
  return h(this, null, function* () {
3531
- const n = new co(t, { namespace: e.namespace }), [r, a] = yield Promise.all([
3532
- Er.start(n, "timeline"),
3533
- Sr.start(n, { catalog: e.catalog, namespace: e.namespace })
3532
+ const n = new oo(t, { namespace: e.namespace }), [r, a] = yield Promise.all([
3533
+ Tr.start(n, "timeline"),
3534
+ Ir.start(n, { catalog: e.catalog, namespace: e.namespace })
3534
3535
  ]);
3535
3536
  return new Ge(n, r, a, e.namespace, 0);
3536
3537
  });
@@ -3554,10 +3555,10 @@ const Ge = class Ge {
3554
3555
  const r = this.catalog().current().tracks.find(
3555
3556
  (a) => a["com.vindral.variant_uid"] === t["com.vindral.variant_uid"]
3556
3557
  );
3557
- return w(this, ps, cn).call(this, () => Tr.subscribe(s(this, ge), r != null ? r : t, s(this, zt), e));
3558
+ return w(this, ps, cn).call(this, () => Ur.subscribe(s(this, ge), r != null ? r : t, s(this, zt), e));
3558
3559
  }
3559
3560
  subscribeWebVttTrack(t) {
3560
- return w(this, ps, cn).call(this, () => Ar.subscribe(s(this, ge), t, s(this, zt)));
3561
+ return w(this, ps, cn).call(this, () => Dr.subscribe(s(this, ge), t, s(this, zt)));
3561
3562
  }
3562
3563
  subscribeTrack(t) {
3563
3564
  return w(this, ps, cn).call(this, () => s(this, ge).subscribe(t));
@@ -3569,7 +3570,7 @@ const Ge = class Ge {
3569
3570
  return Promise.all([s(this, ws).close(), s(this, ve).close()]);
3570
3571
  }
3571
3572
  };
3572
- lr = Ve(null), ge = new WeakMap(), ve = new WeakMap(), ws = new WeakMap(), zt = new WeakMap(), ps = new WeakSet(), cn = function(t) {
3573
+ hr = Ve(null), ge = new WeakMap(), ve = new WeakMap(), ws = new WeakMap(), zt = new WeakMap(), ps = new WeakSet(), cn = function(t) {
3573
3574
  return h(this, null, function* () {
3574
3575
  const [e, n] = this.catalog().value();
3575
3576
  try {
@@ -3580,10 +3581,10 @@ lr = Ve(null), ge = new WeakMap(), ve = new WeakMap(), ws = new WeakMap(), zt =
3580
3581
  throw r;
3581
3582
  }
3582
3583
  });
3583
- }, X(lr, 9, "start", ga, Ge), Jt(lr, Ge), Ce(lr, 3, Ge);
3584
+ }, X(hr, 9, "start", ya, Ge), Jt(hr, Ge), Ce(hr, 3, Ge);
3584
3585
  let Bn = Ge;
3585
- var ke, Wi, Kn, wo;
3586
- const $r = class $r {
3586
+ var ke, Wi, Kn, fo;
3587
+ const Wr = class Wr {
3587
3588
  constructor(t) {
3588
3589
  o(this, Kn);
3589
3590
  o(this, ke);
@@ -3593,7 +3594,7 @@ const $r = class $r {
3593
3594
  createdAt: /* @__PURE__ */ new Date(),
3594
3595
  wallclock: new Date(e.ntpTimestamp),
3595
3596
  rtt: e.rtt
3596
- }), u(this, Wi, w(this, Kn, wo).call(this, t));
3597
+ }), u(this, Wi, w(this, Kn, fo).call(this, t));
3597
3598
  }
3598
3599
  /**
3599
3600
  * @returns returns the current wallclock time in milliseconds based on the ntp timestamp of the stats track + the elapsed time since the last stats track.
@@ -3606,10 +3607,10 @@ const $r = class $r {
3606
3607
  return s(this, Wi);
3607
3608
  }
3608
3609
  static start(t) {
3609
- return new $r(t);
3610
+ return new Wr(t);
3610
3611
  }
3611
3612
  };
3612
- ke = new WeakMap(), Wi = new WeakMap(), Kn = new WeakSet(), wo = function(t) {
3613
+ ke = new WeakMap(), Wi = new WeakMap(), Kn = new WeakSet(), fo = function(t) {
3613
3614
  return h(this, null, function* () {
3614
3615
  try {
3615
3616
  for (var e = C(t.value), n, r, a; n = !(r = yield e.next()).done; n = !1) {
@@ -3632,30 +3633,30 @@ ke = new WeakMap(), Wi = new WeakMap(), Kn = new WeakSet(), wo = function(t) {
3632
3633
  }
3633
3634
  });
3634
3635
  };
3635
- let Or = $r;
3636
+ let Ar = Wr;
3636
3637
  function tn(i) {
3637
3638
  return typeof i == "string" || i === null || i === void 0;
3638
3639
  }
3639
- function Rc(i) {
3640
+ function Pc(i) {
3640
3641
  return "provider" in i && typeof i.provider == "string" && (!("widevineLicenseUrl" in i) || tn(i.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in i) || tn(i.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in i) || tn(i.fairplayLicenseUrl)) && (!("fairplayCertificate" in i) || tn(i.fairplayCertificate));
3641
3642
  }
3642
- function Lc(i) {
3643
+ function Rc(i) {
3643
3644
  try {
3644
- return ho(i);
3645
+ return uo(i);
3645
3646
  } catch (t) {
3646
3647
  throw new Error("Failed to convert fairplayCertificate");
3647
3648
  }
3648
3649
  }
3649
- function jc(i) {
3650
+ function Lc(i) {
3650
3651
  const t = new TextDecoder().decode(i), e = JSON.parse(t);
3651
- if (!Rc(e))
3652
+ if (!Pc(e))
3652
3653
  throw new Error("Invalid drm object");
3653
- const a = e, { fairplayCertificate: n } = a, r = Qr(a, ["fairplayCertificate"]);
3654
- return rr(Yt({}, r), {
3655
- fairplayCertificate: n ? Lc(n) : void 0
3654
+ const a = e, { fairplayCertificate: n } = a, r = Kr(a, ["fairplayCertificate"]);
3655
+ return nr(Yt({}, r), {
3656
+ fairplayCertificate: n ? Rc(n) : void 0
3656
3657
  });
3657
3658
  }
3658
- class jr {
3659
+ class Lr {
3659
3660
  constructor(t) {
3660
3661
  l(this, "value");
3661
3662
  this.value = t;
@@ -3669,8 +3670,8 @@ class jr {
3669
3670
  const r = yield n.next();
3670
3671
  if (r.done)
3671
3672
  throw new Error("No drm object received");
3672
- const a = jc(r.value.payload);
3673
- return new jr(a);
3673
+ const a = Lc(r.value.payload);
3674
+ return new Lr(a);
3674
3675
  } catch (d) {
3675
3676
  var f = d, p = !0;
3676
3677
  } finally {
@@ -3680,24 +3681,24 @@ class jr {
3680
3681
  });
3681
3682
  }
3682
3683
  }
3683
- function Gc(i) {
3684
+ function jc(i) {
3684
3685
  return "rtt" in i && typeof i.rtt == "number" && "ntpTimestamp" in i && typeof i.ntpTimestamp == "number" && "estimatedBandwidth" in i && typeof i.estimatedBandwidth == "number";
3685
3686
  }
3686
- function aa(i) {
3687
+ function ra(i) {
3687
3688
  const t = new TextDecoder().decode(i), e = JSON.parse(t);
3688
- if (!Gc(e))
3689
+ if (!jc(e))
3689
3690
  throw new Error("Invalid stats object");
3690
3691
  return e;
3691
3692
  }
3692
- const Nc = 1e4;
3693
- var $i, Qn, po;
3694
- const zr = class zr {
3693
+ const Gc = 1e4;
3694
+ var $i, Qn, wo;
3695
+ const $r = class $r {
3695
3696
  constructor(t, e, n) {
3696
3697
  o(this, Qn);
3697
3698
  l(this, "ip");
3698
3699
  l(this, "value");
3699
3700
  o(this, $i);
3700
- this.ip = n, this.value = new ft(e), u(this, $i, w(this, Qn, po).call(this, t));
3701
+ this.ip = n, this.value = new ft(e), u(this, $i, w(this, Qn, wo).call(this, t));
3701
3702
  }
3702
3703
  closed() {
3703
3704
  return s(this, $i);
@@ -3707,7 +3708,7 @@ const zr = class zr {
3707
3708
  for (; ; ) {
3708
3709
  const [t, e] = this.value.value();
3709
3710
  try {
3710
- yield Promise.race([Co(Nc, new Error("Idle timeout")), e]);
3711
+ yield Promise.race([Vo(Gc, new Error("Idle timeout")), e]);
3711
3712
  } catch (n) {
3712
3713
  return n;
3713
3714
  }
@@ -3719,21 +3720,21 @@ const zr = class zr {
3719
3720
  const n = (yield t.subscribe(new Rt().name("stats").groupOrder("ascending").build())).objects(), r = yield n.next();
3720
3721
  if (r.done)
3721
3722
  throw new Error("No stats object received");
3722
- const a = aa(r.value.payload);
3723
+ const a = ra(r.value.payload);
3723
3724
  if (!a.ip)
3724
3725
  throw new Error("Expected IP in initial stats object");
3725
- return new zr(n, a, a.ip);
3726
+ return new $r(n, a, a.ip);
3726
3727
  });
3727
3728
  }
3728
3729
  };
3729
- $i = new WeakMap(), Qn = new WeakSet(), po = function(t) {
3730
+ $i = new WeakMap(), Qn = new WeakSet(), wo = function(t) {
3730
3731
  return h(this, null, function* () {
3731
3732
  try {
3732
3733
  for (var e = C(t), n, r, a; n = !(r = yield e.next()).done; n = !1) {
3733
3734
  const c = r.value;
3734
3735
  if (c.objectStatus !== $.Normal)
3735
3736
  continue;
3736
- const d = aa(c.payload);
3737
+ const d = ra(c.payload);
3737
3738
  this.value.update(d);
3738
3739
  }
3739
3740
  } catch (r) {
@@ -3748,9 +3749,9 @@ $i = new WeakMap(), Qn = new WeakSet(), po = function(t) {
3748
3749
  }
3749
3750
  });
3750
3751
  };
3751
- let Vr = zr;
3752
+ let Or = $r;
3752
3753
  var ms, zi, Mi;
3753
- class ur {
3754
+ class cr {
3754
3755
  constructor(t, e) {
3755
3756
  o(this, ms, Xt.get().createContext("TracksIterator"));
3756
3757
  o(this, zi);
@@ -3769,7 +3770,7 @@ class ur {
3769
3770
  name: c.trackObject.name,
3770
3771
  namespace: c.namespace
3771
3772
  };
3772
- s(this, ms).debug("track start", Yt({ mediaType: t }, d)), yield* or(c), s(this, ms).debug("track end", Yt({ mediaType: t }, d));
3773
+ s(this, ms).debug("track start", Yt({ mediaType: t }, d)), yield* ar(c), s(this, ms).debug("track end", Yt({ mediaType: t }, d));
3773
3774
  }
3774
3775
  } catch (r) {
3775
3776
  a = [r];
@@ -3786,8 +3787,8 @@ class ur {
3786
3787
  }
3787
3788
  }
3788
3789
  ms = new WeakMap(), zi = new WeakMap(), Mi = new WeakMap();
3789
- var va, ka, Ia, bs, ys, Ie, G, lt, dt, Mt, Hi, Os, z, un, Ps, mo, Br;
3790
- Ia = [_({ context: "Player", enter: "info" })], ka = [_({ context: "Player", enter: "info", return: "info" })], va = [_({ context: "Player", enter: "info" })];
3790
+ var ga, va, ka, bs, ys, Ie, G, lt, dt, Mt, Hi, Os, z, un, Ps, po, Cr;
3791
+ ka = [_({ context: "Player", enter: "info" })], va = [_({ context: "Player", enter: "info", return: "info" })], ga = [_({ context: "Player", enter: "info" })];
3791
3792
  const Ne = class Ne {
3792
3793
  constructor(t, e, n) {
3793
3794
  Ce(Os, 5, this);
@@ -3800,23 +3801,23 @@ const Ne = class Ne {
3800
3801
  o(this, dt, new ft(void 0));
3801
3802
  o(this, Mt, new ft(void 0));
3802
3803
  o(this, Hi);
3803
- l(this, "subtitles", new ur(s(this, Mt), "subtitles"));
3804
- l(this, "video", new ur(s(this, dt), "video"));
3805
- l(this, "audio", new ur(s(this, lt), "audio"));
3806
- u(this, bs, t), u(this, ys, Or.start(n)), u(this, Ie, n), u(this, G, new ft(e)), u(this, Hi, Promise.race([n.idleTimeout(), w(this, z, mo).call(this)])), s(this, bs).closed().then(() => this.close()).catch(B);
3804
+ l(this, "subtitles", new cr(s(this, Mt), "subtitles"));
3805
+ l(this, "video", new cr(s(this, dt), "video"));
3806
+ l(this, "audio", new cr(s(this, lt), "audio"));
3807
+ u(this, bs, t), u(this, ys, Ar.start(n)), u(this, Ie, n), u(this, G, new ft(e)), u(this, Hi, Promise.race([n.idleTimeout(), w(this, z, po).call(this)])), s(this, bs).closed().then(() => this.close()).catch(B);
3807
3808
  }
3808
3809
  closed() {
3809
3810
  return s(this, Hi);
3810
3811
  }
3811
3812
  static start(t, e) {
3812
3813
  return h(this, null, function* () {
3813
- const n = e.namespace, r = new co(t, { namespace: n }), [[a, c, d], f] = yield Promise.all([
3814
+ const n = e.namespace, r = new oo(t, { namespace: n }), [[a, c, d], f] = yield Promise.all([
3814
3815
  Bn.start(t, e).then((b) => Promise.all([
3815
3816
  Promise.resolve(b),
3816
3817
  e.videoTrack ? b.subscribeCmafTrack(e.videoTrack) : void 0,
3817
3818
  e.audioTrack ? b.subscribeCmafTrack(e.audioTrack) : void 0
3818
3819
  ])),
3819
- Vr.start(r)
3820
+ Or.start(r)
3820
3821
  ]), p = new Ne(t, a, f);
3821
3822
  return d && s(p, lt).update(d), c && s(p, dt).update(c), p;
3822
3823
  });
@@ -3851,7 +3852,7 @@ const Ne = class Ne {
3851
3852
  }
3852
3853
  drm() {
3853
3854
  return h(this, null, function* () {
3854
- return jr.create(s(this, G).current()).catch(B);
3855
+ return Lr.create(s(this, G).current()).catch(B);
3855
3856
  });
3856
3857
  }
3857
3858
  close() {
@@ -3922,7 +3923,7 @@ Os = Ve(null), bs = new WeakMap(), ys = new WeakMap(), Ie = new WeakMap(), G = n
3922
3923
  ]);
3923
3924
  return c;
3924
3925
  });
3925
- }, mo = function() {
3926
+ }, po = function() {
3926
3927
  return h(this, null, function* () {
3927
3928
  try {
3928
3929
  for (var a = C(s(this, G)), c, d, f; c = !(d = yield a.next()).done; c = !1) {
@@ -3931,8 +3932,8 @@ Os = Ve(null), bs = new WeakMap(), ys = new WeakMap(), Ie = new WeakMap(), G = n
3931
3932
  for (var t = C(p.catalog()), e, n, r; e = !(n = yield t.next()).done; e = !1) {
3932
3933
  const b = n.value;
3933
3934
  yield Promise.all([
3934
- w(this, z, Br).call(this, b, s(this, dt)),
3935
- w(this, z, Br).call(this, b, s(this, lt))
3935
+ w(this, z, Cr).call(this, b, s(this, dt)),
3936
+ w(this, z, Cr).call(this, b, s(this, lt))
3936
3937
  ]);
3937
3938
  }
3938
3939
  } catch (n) {
@@ -3957,7 +3958,7 @@ Os = Ve(null), bs = new WeakMap(), ys = new WeakMap(), Ie = new WeakMap(), G = n
3957
3958
  }
3958
3959
  }
3959
3960
  });
3960
- }, Br = function(t, e) {
3961
+ }, Cr = function(t, e) {
3961
3962
  return h(this, null, function* () {
3962
3963
  const n = e.current();
3963
3964
  if (!n)
@@ -3971,14 +3972,14 @@ Os = Ve(null), bs = new WeakMap(), ys = new WeakMap(), Ie = new WeakMap(), G = n
3971
3972
  e.update(yield s(this, G).current().subscribeCmafTrack(d));
3972
3973
  }
3973
3974
  });
3974
- }, X(Os, 1, "close", Ia, Ne), X(Os, 1, "zap", ka, Ne), Ps = X(Os, 17, "#replaceTrack", va, z, Ps), Jt(Os, Ne);
3975
- let Cr = Ne;
3976
- function Fc(i, t, e) {
3975
+ }, X(Os, 1, "close", ka, Ne), X(Os, 1, "zap", va, Ne), Ps = X(Os, 17, "#replaceTrack", ga, z, Ps), Jt(Os, Ne);
3976
+ let Vr = Ne;
3977
+ function Nc(i, t, e) {
3977
3978
  const n = new URL("/voq/subscribe", typeof i == "string" ? i : i.moqUrl || i.moqWsUrl);
3978
3979
  return n.searchParams.set("sessionId", t.sessionId), n.searchParams.set("clientId", t.clientId), n.searchParams.set("channelId", t.channelId), e && n.searchParams.set("authToken", e), n;
3979
3980
  }
3980
- var N, F, nt, Se, gs, vs, V, Ue, Xi, qn, ks, tt, bo, Is, Zi, Ss, yo, go, vo, xr;
3981
- const Mr = class Mr {
3981
+ var N, F, nt, Se, gs, vs, V, Ue, Xi, qn, ks, tt, mo, Is, Zi, Ss, bo, yo, go, Br;
3982
+ const zr = class zr {
3982
3983
  constructor(t, e, n, r, a) {
3983
3984
  o(this, tt);
3984
3985
  o(this, N);
@@ -3989,7 +3990,7 @@ const Mr = class Mr {
3989
3990
  o(this, vs);
3990
3991
  o(this, V);
3991
3992
  o(this, Ue, /* @__PURE__ */ new Map());
3992
- o(this, Xi, new Pr(10));
3993
+ o(this, Xi, new xr(10));
3993
3994
  o(this, qn, Number.MAX_SAFE_INTEGER);
3994
3995
  o(this, ks, /* @__PURE__ */ new Map());
3995
3996
  o(this, Is, (t) => {
@@ -4008,11 +4009,11 @@ const Mr = class Mr {
4008
4009
  s(this, F).info("Ignoring - we are already switching");
4009
4010
  return;
4010
4011
  }
4011
- u(this, Ss, !0), w(this, tt, yo).call(this, t.subscription).catch((e) => s(this, F).error("error handling subscription", e)).finally(() => u(this, Ss, !1));
4012
+ u(this, Ss, !0), w(this, tt, bo).call(this, t.subscription).catch((e) => s(this, F).error("error handling subscription", e)).finally(() => u(this, Ss, !1));
4012
4013
  }
4013
4014
  break;
4014
4015
  case "telemetry":
4015
- Ro(new URL("/api/telemetry", s(this, nt).url().replace("wss://", "https://")), {
4016
+ Po(new URL("/api/telemetry", s(this, nt).url().replace("wss://", "https://")), {
4016
4017
  body: t.body,
4017
4018
  headers: { "Content-Type": "text/plain" }
4018
4019
  }).catch(B);
@@ -4026,7 +4027,7 @@ const Mr = class Mr {
4026
4027
  l(this, "disconnect", (t = "Disconnect Requested") => {
4027
4028
  s(this, F).info("Disconnecting", t), s(this, nt).close(), s(this, V).close().catch(B), u(this, ks, /* @__PURE__ */ new Map()), u(this, Se, "disconnected");
4028
4029
  });
4029
- u(this, N, t), u(this, F, e), u(this, nt, n), u(this, V, r), u(this, Ue, a), s(this, N).on("send signal", s(this, Zi)), s(this, N).on("disconnect", this.disconnect), s(this, N).on("text track", s(this, Is)), w(this, tt, bo).call(this).catch(B), w(this, tt, go).call(this).catch(B);
4030
+ u(this, N, t), u(this, F, e), u(this, nt, n), u(this, V, r), u(this, Ue, a), s(this, N).on("send signal", s(this, Zi)), s(this, N).on("disconnect", this.disconnect), s(this, N).on("text track", s(this, Is)), w(this, tt, mo).call(this).catch(B), w(this, tt, yo).call(this).catch(B);
4030
4031
  }
4031
4032
  get estimatedBandwidth() {
4032
4033
  return s(this, qn);
@@ -4047,7 +4048,7 @@ const Mr = class Mr {
4047
4048
  getStatistics() {
4048
4049
  const e = s(this, V).connectionInfo().estimatedBandwidth;
4049
4050
  return {
4050
- rtt: Bo(s(this, Xi).items()),
4051
+ rtt: Co(s(this, Xi).items()),
4051
4052
  estimatedBandwidth: e,
4052
4053
  connectCount: 0,
4053
4054
  connectionAttemptCount: 0,
@@ -4061,27 +4062,27 @@ const Mr = class Mr {
4061
4062
  const r = new Map(
4062
4063
  n.connectInfo.channels.map((g) => [
4063
4064
  Kt(g.catalog.namespace),
4064
- new ca(new ft(g.catalog))
4065
+ new oa(new ft(g.catalog))
4065
4066
  ])
4066
- ), a = yield n.onConnectInfo(n.connectInfo), c = Fc(n.edgeUrl, a, n.options.options.authenticationToken), d = (E = n.connectInfo.channels.find((g) => g.channelId === a.channelId)) == null ? void 0 : E.catalog;
4067
- e.debug("Resolved edge url", { edgeUrl: c }), Sa(d, "no catalog found");
4068
- const f = (P = r.get(Kt(d.namespace))) == null ? void 0 : P.getVideoTrack(a.video), p = (H = r.get(Kt(d.namespace))) == null ? void 0 : H.getAudioTrack(a.audio), b = yield Dc({
4067
+ ), a = yield n.onConnectInfo(n.connectInfo), c = Nc(n.edgeUrl, a, n.options.options.authenticationToken), d = (E = n.connectInfo.channels.find((g) => g.channelId === a.channelId)) == null ? void 0 : E.catalog;
4068
+ e.debug("Resolved edge url", { edgeUrl: c }), Ia(d, "no catalog found");
4069
+ const f = (P = r.get(Kt(d.namespace))) == null ? void 0 : P.getVideoTrack(a.video), p = (H = r.get(Kt(d.namespace))) == null ? void 0 : H.getAudioTrack(a.audio), b = yield Ec({
4069
4070
  url: new URL(c),
4070
4071
  handshakePipelining: !0,
4071
4072
  authToken: n.options.get("authenticationToken")
4072
- }), m = yield Cr.start(b, {
4073
+ }), m = yield Vr.start(b, {
4073
4074
  namespace: d.namespace,
4074
4075
  catalog: d,
4075
4076
  videoTrack: f == null ? void 0 : f.track,
4076
4077
  audioTrack: p == null ? void 0 : p.track
4077
- }), I = new ca(m.catalog());
4078
+ }), I = new oa(m.catalog());
4078
4079
  r.set(Kt(d.namespace), I), t.emit("received signal", {
4079
4080
  type: "client ip",
4080
4081
  ip: m.connectionInfo().ip
4081
4082
  }), m.drm().then((g) => {
4082
4083
  g && t.emit("received drm data", g.value);
4083
4084
  });
4084
- const y = new Mr(t, e, b, m, r);
4085
+ const y = new zr(t, e, b, m, r);
4085
4086
  return a.textTrack && s(T = y, Is).call(T, a.textTrack), y;
4086
4087
  });
4087
4088
  }
@@ -4101,7 +4102,7 @@ const Mr = class Mr {
4101
4102
  return (t = s(this, nt)) == null ? void 0 : t.closed();
4102
4103
  }
4103
4104
  };
4104
- N = new WeakMap(), F = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), gs = new WeakMap(), vs = new WeakMap(), V = new WeakMap(), Ue = new WeakMap(), Xi = new WeakMap(), qn = new WeakMap(), ks = new WeakMap(), tt = new WeakSet(), bo = function() {
4105
+ N = new WeakMap(), F = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), gs = new WeakMap(), vs = new WeakMap(), V = new WeakMap(), Ue = new WeakMap(), Xi = new WeakMap(), qn = new WeakMap(), ks = new WeakMap(), tt = new WeakSet(), mo = function() {
4105
4106
  return h(this, null, function* () {
4106
4107
  try {
4107
4108
  for (var t = C(s(this, V).stats()), e, n, r; e = !(n = yield t.next()).done; e = !1) {
@@ -4119,7 +4120,7 @@ N = new WeakMap(), F = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), gs
4119
4120
  }
4120
4121
  }
4121
4122
  });
4122
- }, Is = new WeakMap(), Zi = new WeakMap(), Ss = new WeakMap(), yo = function(t) {
4123
+ }, Is = new WeakMap(), Zi = new WeakMap(), Ss = new WeakMap(), bo = function(t) {
4123
4124
  return h(this, null, function* () {
4124
4125
  var d, f, p, b, m, I, y;
4125
4126
  s(this, F).info("handle subscription", t);
@@ -4163,19 +4164,19 @@ N = new WeakMap(), F = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), gs
4163
4164
  subscription: t
4164
4165
  });
4165
4166
  });
4166
- }, go = function() {
4167
+ }, yo = function() {
4167
4168
  return h(this, null, function* () {
4168
4169
  try {
4169
4170
  u(this, Se, "connecting"), s(this, F).info("Connecting..."), u(this, vs, Date.now()), s(this, gs) || u(this, gs, s(this, vs)), u(this, Se, "connected"), yield Promise.all([
4170
- w(this, tt, xr).call(this, s(this, V).referenceClock(), s(this, V).audio),
4171
- w(this, tt, xr).call(this, s(this, V).referenceClock(), s(this, V).video),
4172
- w(this, tt, vo).call(this, s(this, V).subtitles)
4171
+ w(this, tt, Br).call(this, s(this, V).referenceClock(), s(this, V).audio),
4172
+ w(this, tt, Br).call(this, s(this, V).referenceClock(), s(this, V).video),
4173
+ w(this, tt, go).call(this, s(this, V).subtitles)
4173
4174
  ]), yield s(this, V).closed(), s(this, nt).close(), s(this, F).info("Session closed");
4174
4175
  } catch (t) {
4175
4176
  s(this, F).warn("Session error", t);
4176
4177
  }
4177
4178
  });
4178
- }, vo = function(t) {
4179
+ }, go = function(t) {
4179
4180
  return h(this, null, function* () {
4180
4181
  try {
4181
4182
  for (var e = C(t), n, r, a; n = !(r = yield e.next()).done; n = !1) {
@@ -4193,7 +4194,7 @@ N = new WeakMap(), F = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), gs
4193
4194
  }
4194
4195
  }
4195
4196
  });
4196
- }, xr = function(t, e) {
4197
+ }, Br = function(t, e) {
4197
4198
  return h(this, null, function* () {
4198
4199
  let n = "", r = "";
4199
4200
  try {
@@ -4237,7 +4238,7 @@ N = new WeakMap(), F = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), gs
4237
4238
  channelId: E,
4238
4239
  groupId: H,
4239
4240
  // FIXME: We should replace this with something better than hashing the track name
4240
- renditionId: Wc(y.track.trackObject.name)
4241
+ renditionId: Fc(y.track.trackObject.name)
4241
4242
  });
4242
4243
  }
4243
4244
  } catch (d) {
@@ -4263,20 +4264,20 @@ N = new WeakMap(), F = new WeakMap(), nt = new WeakMap(), Se = new WeakMap(), gs
4263
4264
  }
4264
4265
  });
4265
4266
  };
4266
- let oa = Mr;
4267
- function Wc(i) {
4267
+ let aa = zr;
4268
+ function Fc(i) {
4268
4269
  return i.split("").reduce(
4269
4270
  (e, n) => e = n.charCodeAt(0) + (e << 6) + (e << 16) - e,
4270
4271
  0
4271
4272
  );
4272
4273
  }
4273
- var Pt, Te, _n, ko;
4274
- class ca {
4274
+ var Pt, Te, _n, vo;
4275
+ class oa {
4275
4276
  constructor(t) {
4276
4277
  o(this, _n);
4277
4278
  o(this, Pt);
4278
4279
  o(this, Te);
4279
- u(this, Pt, t), u(this, Te, w(this, _n, ko).call(this));
4280
+ u(this, Pt, t), u(this, Te, w(this, _n, vo).call(this));
4280
4281
  }
4281
4282
  catalog() {
4282
4283
  return s(this, Pt).current();
@@ -4291,20 +4292,20 @@ class ca {
4291
4292
  return s(this, Pt).current().tracks.find((e) => e.label === t);
4292
4293
  }
4293
4294
  getAudioTrack(t) {
4294
- return t.codec ? s(this, Te).filter((n) => !(!xo(n) || n.bitRate > t.bitRate || t.codec && n.codec !== t.codec || t.language && n.language !== t.language)).at(-1) : void 0;
4295
+ return t.codec ? s(this, Te).filter((n) => !(!Bo(n) || n.bitRate > t.bitRate || t.codec && n.codec !== t.codec || t.language && n.language !== t.language)).at(-1) : void 0;
4295
4296
  }
4296
4297
  getVideoTrack(t) {
4297
- return t.codec ? s(this, Te).filter((n) => !(!Po(n) || n.bitRate > t.bitRate || t.codec && n.codec !== t.codec)).at(-1) : void 0;
4298
+ return t.codec ? s(this, Te).filter((n) => !(!xo(n) || n.bitRate > t.bitRate || t.codec && n.codec !== t.codec)).at(-1) : void 0;
4298
4299
  }
4299
4300
  renditions() {
4300
4301
  return s(this, Te);
4301
4302
  }
4302
4303
  }
4303
- Pt = new WeakMap(), Te = new WeakMap(), _n = new WeakSet(), ko = function() {
4304
+ Pt = new WeakMap(), Te = new WeakMap(), _n = new WeakSet(), vo = function() {
4304
4305
  const [t, e] = s(this, Pt).value();
4305
- return Lo(t);
4306
+ return Ro(t);
4306
4307
  };
4307
4308
  export {
4308
- ca as CatalogObserver,
4309
- oa as MoqConnectionAdapter
4309
+ oa as CatalogObserver,
4310
+ aa as MoqConnectionAdapter
4310
4311
  };