@ikonai/sdk-ui 1.0.74 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,20 +1,20 @@
1
- import { createLogger as Z, readOpcode as st, readProtocolMessageHeaders as ae } from "@ikonai/sdk";
2
- const F = 27, nt = {
1
+ import { createLogger as Z, readOpcode as it, readProtocolMessageHeaders as ae } from "@ikonai/sdk";
2
+ const F = 27, ot = {
3
3
  Compressed: 8
4
4
  };
5
- function it(e) {
6
- const t = x(e), r = new DataView(t.buffer, t.byteOffset, t.byteLength);
5
+ function at(e) {
6
+ const t = x(e), s = new DataView(t.buffer, t.byteOffset, t.byteLength);
7
7
  if (t.length < F)
8
8
  throw new Error("Protocol payload too short");
9
- const s = r.getUint32(0, !0), n = r.getUint32(4, !0), i = r.getUint32(8, !0), o = r.getUint32(12, !0), a = r.getUint32(16, !0), I = r.getUint32(20, !0), _ = r.getUint8(24), l = r.getUint8(25), E = r.getUint8(26);
9
+ const r = s.getUint32(0, !0), n = s.getUint32(4, !0), i = s.getUint32(8, !0), o = s.getUint32(12, !0), a = s.getUint32(16, !0), I = s.getUint32(20, !0), _ = s.getUint8(24), l = s.getUint8(25), E = s.getUint8(26);
10
10
  if (F + I * 4 > t.length)
11
11
  throw new Error("Protocol header exceeds payload length");
12
12
  const T = [];
13
13
  let N = F;
14
14
  for (let g = 0; g < I; g++)
15
- T.push(r.getUint32(N, !0)), N += 4;
15
+ T.push(s.getUint32(N, !0)), N += 4;
16
16
  return {
17
- length: s,
17
+ length: r,
18
18
  opcode: n,
19
19
  senderId: i,
20
20
  trackId: o,
@@ -25,29 +25,29 @@ function it(e) {
25
25
  flags: E
26
26
  };
27
27
  }
28
- async function V(e, t, r) {
29
- const s = x(e), n = it(s);
28
+ async function G(e, t, s) {
29
+ const r = x(e), n = at(r);
30
30
  if (t !== void 0 && n.opcode !== t)
31
31
  throw new Error(`Unexpected opcode ${n.opcode}`);
32
32
  if (n.payloadType !== 8)
33
33
  throw new Error(`Unexpected payload type ${n.payloadType}`);
34
34
  const i = F + n.targetIds.length * 4;
35
- let o = s.subarray(i, n.length);
36
- return (n.flags & nt.Compressed) !== 0 && (o = await at(o)), o;
35
+ let o = r.subarray(i, n.length);
36
+ return (n.flags & ot.Compressed) !== 0 && (o = await lt(o)), o;
37
37
  }
38
- function ot(e, t, r, s, n) {
38
+ function he(e, t, s, r, n) {
39
39
  const i = n?.trackId ?? 0, o = n?.sequenceId ?? 0, a = n?.flags ?? 0, I = n?.targetIds ?? [], _ = n?.payloadType ?? 8, l = F + I.length * 4, E = l + t.length, h = new Uint8Array(E), T = new DataView(h.buffer);
40
- T.setUint32(0, E, !0), T.setUint32(4, e >>> 0, !0), T.setUint32(8, s >>> 0, !0), T.setUint32(12, i >>> 0, !0), T.setUint32(16, o >>> 0, !0), T.setUint32(20, I.length >>> 0, !0), T.setUint8(24, r & 255), T.setUint8(25, _ & 255), T.setUint8(26, a & 255);
40
+ T.setUint32(0, E, !0), T.setUint32(4, e >>> 0, !0), T.setUint32(8, r >>> 0, !0), T.setUint32(12, i >>> 0, !0), T.setUint32(16, o >>> 0, !0), T.setUint32(20, I.length >>> 0, !0), T.setUint8(24, s & 255), T.setUint8(25, _ & 255), T.setUint8(26, a & 255);
41
41
  let N = F;
42
42
  for (let g = 0; g < I.length; g++)
43
43
  T.setUint32(N, I[g] >>> 0, !0), N += 4;
44
44
  return h.set(t, l), h;
45
45
  }
46
- async function at(e) {
46
+ async function lt(e) {
47
47
  if (typeof DecompressionStream > "u")
48
48
  throw new Error("DecompressionStream not supported");
49
- const t = new DecompressionStream("gzip"), r = t.writable.getWriter(), s = new Uint8Array(e);
50
- r.write(s), r.close();
49
+ const t = new DecompressionStream("gzip"), s = t.writable.getWriter(), r = new Uint8Array(e);
50
+ s.write(r), s.close();
51
51
  const n = t.readable.getReader(), i = [];
52
52
  let o = 0;
53
53
  for (; ; ) {
@@ -62,77 +62,77 @@ async function at(e) {
62
62
  return a;
63
63
  }
64
64
  var U = /* @__PURE__ */ ((e) => (e[e.Null = 1] = "Null", e[e.Bool = 2] = "Bool", e[e.Int32 = 3] = "Int32", e[e.Int64 = 4] = "Int64", e[e.UInt32 = 5] = "UInt32", e[e.UInt64 = 6] = "UInt64", e[e.Float32 = 7] = "Float32", e[e.Float64 = 8] = "Float64", e[e.Array = 9] = "Array", e[e.Dict = 10] = "Dict", e[e.Object = 11] = "Object", e[e.String = 12] = "String", e[e.Binary = 13] = "Binary", e[e.Guid = 14] = "Guid", e))(U || {});
65
- const he = 161, ue = 162, Y = new TextEncoder(), lt = new TextDecoder("utf-8", { fatal: !0 });
66
- class G {
65
+ const ue = 161, ce = 162, Y = new TextEncoder(), It = new TextDecoder("utf-8", { fatal: !0 });
66
+ class k {
67
67
  constructor(t = 1) {
68
- this.version = t, this.buffer.writeByte(he), this.buffer.writeVarUInt(t >>> 0);
68
+ this.version = t, this.buffer.writeByte(ue), this.buffer.writeVarUInt(t >>> 0);
69
69
  }
70
70
  buffer = new b();
71
71
  closed = !1;
72
72
  cached;
73
- writeInt32Field(t, r) {
74
- this.writeFixedField(t, 3, () => this.buffer.writeInt32(r | 0));
73
+ writeInt32Field(t, s) {
74
+ this.writeFixedField(t, 3, () => this.buffer.writeInt32(s | 0));
75
75
  }
76
- writeUInt32Field(t, r) {
77
- this.writeFixedField(t, 5, () => this.buffer.writeUInt32(r >>> 0));
76
+ writeUInt32Field(t, s) {
77
+ this.writeFixedField(t, 5, () => this.buffer.writeUInt32(s >>> 0));
78
78
  }
79
- writeInt64Field(t, r) {
80
- this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(r));
79
+ writeInt64Field(t, s) {
80
+ this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(s));
81
81
  }
82
- writeUInt64Field(t, r) {
83
- this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(r));
82
+ writeUInt64Field(t, s) {
83
+ this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(s));
84
84
  }
85
- writeFloat32Field(t, r) {
86
- this.writeFixedField(t, 7, () => this.buffer.writeFloat32(r));
85
+ writeFloat32Field(t, s) {
86
+ this.writeFixedField(t, 7, () => this.buffer.writeFloat32(s));
87
87
  }
88
- writeFloat64Field(t, r) {
89
- this.writeFixedField(t, 8, () => this.buffer.writeFloat64(r));
88
+ writeFloat64Field(t, s) {
89
+ this.writeFixedField(t, 8, () => this.buffer.writeFloat64(s));
90
90
  }
91
- writeBoolField(t, r) {
92
- this.writeFixedField(t, 2, () => this.buffer.writeByte(r ? 1 : 0));
91
+ writeBoolField(t, s) {
92
+ this.writeFixedField(t, 2, () => this.buffer.writeByte(s ? 1 : 0));
93
93
  }
94
- writeGuidField(t, r) {
95
- const s = r instanceof f ? r.asBytes() : r;
96
- if (s.length !== 16)
94
+ writeGuidField(t, s) {
95
+ const r = s instanceof f ? s.asBytes() : s;
96
+ if (r.length !== 16)
97
97
  throw new Error("Guid payload must be 16 bytes");
98
- this.writeFixedField(t, 14, () => this.buffer.writeBytes(s));
98
+ this.writeFixedField(t, 14, () => this.buffer.writeBytes(r));
99
99
  }
100
- writeStringField(t, r) {
101
- const s = Y.encode(r ?? "");
102
- this.writeVariableField(t, 12, s);
100
+ writeStringField(t, s) {
101
+ const r = Y.encode(s ?? "");
102
+ this.writeVariableField(t, 12, r);
103
103
  }
104
- writeBinaryField(t, r) {
105
- this.writeVariableField(t, 13, r);
104
+ writeBinaryField(t, s) {
105
+ this.writeVariableField(t, 13, s);
106
106
  }
107
- writeObjectField(t, r, s) {
108
- const n = new G(r);
109
- s(n);
107
+ writeObjectField(t, s, r) {
108
+ const n = new k(s);
109
+ r(n);
110
110
  const i = n.finish();
111
111
  this.writeVariableField(t, 11, i);
112
112
  }
113
- writeArrayField(t, r, s) {
114
- const n = new $(r);
115
- s(n);
113
+ writeArrayField(t, s, r) {
114
+ const n = new $(s);
115
+ r(n);
116
116
  const i = n.finish();
117
117
  this.writeVariableField(t, 9, i);
118
118
  }
119
- writeDictionaryField(t, r, s, n) {
120
- const i = new ee(r, s);
119
+ writeDictionaryField(t, s, r, n) {
120
+ const i = new ee(s, r);
121
121
  n(i);
122
122
  const o = i.finish();
123
123
  this.writeVariableField(t, 10, o);
124
124
  }
125
125
  finish() {
126
- return this.closed || (this.buffer.writeByte(ue), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
126
+ return this.closed || (this.buffer.writeByte(ce), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
127
127
  }
128
- writeFixedField(t, r, s) {
129
- this.writeFieldHeader(t, r, 0), s();
128
+ writeFixedField(t, s, r) {
129
+ this.writeFieldHeader(t, s, 0), r();
130
130
  }
131
- writeVariableField(t, r, s) {
132
- this.writeFieldHeader(t, r, s.length), this.buffer.writeBytes(s);
131
+ writeVariableField(t, s, r) {
132
+ this.writeFieldHeader(t, s, r.length), this.buffer.writeBytes(r);
133
133
  }
134
- writeFieldHeader(t, r, s) {
135
- this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(W(r)), ut(r) && this.buffer.writeVarUInt(s >>> 0);
134
+ writeFieldHeader(t, s, r) {
135
+ this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(W(s)), ct(s) && this.buffer.writeVarUInt(r >>> 0);
136
136
  }
137
137
  }
138
138
  class $ {
@@ -188,18 +188,18 @@ class $ {
188
188
  14
189
189
  /* Guid */
190
190
  ), this.count++;
191
- const r = t instanceof f ? t.asBytes() : t;
192
- if (r.length !== 16)
191
+ const s = t instanceof f ? t.asBytes() : t;
192
+ if (s.length !== 16)
193
193
  throw new Error("Guid payload must be 16 bytes");
194
- this.payload.writeBytes(r);
194
+ this.payload.writeBytes(s);
195
195
  }
196
196
  writeString(t) {
197
197
  this.ensureElementType(
198
198
  12
199
199
  /* String */
200
200
  ), this.count++;
201
- const r = Y.encode(t ?? "");
202
- this.payload.writeVarUInt(r.length), this.payload.writeBytes(r);
201
+ const s = Y.encode(t ?? "");
202
+ this.payload.writeVarUInt(s.length), this.payload.writeBytes(s);
203
203
  }
204
204
  writeBinary(t) {
205
205
  this.ensureElementType(
@@ -207,33 +207,33 @@ class $ {
207
207
  /* Binary */
208
208
  ), this.count++, this.payload.writeVarUInt(t.length), this.payload.writeBytes(t);
209
209
  }
210
- writeObject(t, r) {
210
+ writeObject(t, s) {
211
211
  this.ensureElementType(
212
212
  11
213
213
  /* Object */
214
214
  ), this.count++;
215
- const s = new G(t);
216
- r(s);
217
- const n = s.finish();
215
+ const r = new k(t);
216
+ s(r);
217
+ const n = r.finish();
218
218
  this.payload.writeVarUInt(n.length), this.payload.writeBytes(n);
219
219
  }
220
- writeArray(t, r) {
220
+ writeArray(t, s) {
221
221
  this.ensureElementType(
222
222
  9
223
223
  /* Array */
224
224
  ), this.count++;
225
- const s = new $(t);
226
- r(s);
227
- const n = s.finish();
225
+ const r = new $(t);
226
+ s(r);
227
+ const n = r.finish();
228
228
  this.payload.writeBytes(n);
229
229
  }
230
- writeDictionary(t, r, s) {
230
+ writeDictionary(t, s, r) {
231
231
  this.ensureElementType(
232
232
  10
233
233
  /* Dict */
234
234
  ), this.count++;
235
- const n = new ee(t, r);
236
- s(n);
235
+ const n = new ee(t, s);
236
+ r(n);
237
237
  const i = n.finish();
238
238
  this.payload.writeBytes(i);
239
239
  }
@@ -247,8 +247,8 @@ class $ {
247
247
  }
248
248
  }
249
249
  class ee {
250
- constructor(t, r) {
251
- this.keyType = t, this.valueType = r, se(t);
250
+ constructor(t, s) {
251
+ this.keyType = t, this.valueType = s, re(t);
252
252
  }
253
253
  payload = new b();
254
254
  count = 0;
@@ -256,7 +256,7 @@ class ee {
256
256
  beginEntry() {
257
257
  if (this.entryOpen)
258
258
  throw new Error("Previous dictionary entry not completed");
259
- return this.count++, this.entryOpen = !0, new It(this.keyType, this.valueType, this.payload, () => {
259
+ return this.count++, this.entryOpen = !0, new Et(this.keyType, this.valueType, this.payload, () => {
260
260
  this.entryOpen = !1;
261
261
  });
262
262
  }
@@ -267,9 +267,9 @@ class ee {
267
267
  return t.writeByte(W(this.keyType)), t.writeByte(W(this.valueType)), t.writeVarUInt(this.count), t.writeBytes(this.payload.toUint8Array()), t.toUint8Array();
268
268
  }
269
269
  }
270
- class It {
271
- constructor(t, r, s, n) {
272
- this.keyType = t, this.valueType = r, this.payload = s, this.onComplete = n;
270
+ class Et {
271
+ constructor(t, s, r, n) {
272
+ this.keyType = t, this.valueType = s, this.payload = r, this.onComplete = n;
273
273
  }
274
274
  keyWritten = !1;
275
275
  valueWritten = !1;
@@ -321,18 +321,18 @@ class It {
321
321
  14
322
322
  /* Guid */
323
323
  );
324
- const r = t instanceof f ? t.asBytes() : t;
325
- if (r.length !== 16)
324
+ const s = t instanceof f ? t.asBytes() : t;
325
+ if (s.length !== 16)
326
326
  throw new Error("Guid payload must be 16 bytes");
327
- this.payload.writeBytes(r), this.keyWritten = !0;
327
+ this.payload.writeBytes(s), this.keyWritten = !0;
328
328
  }
329
329
  writeKeyString(t) {
330
330
  this.ensureKeyType(
331
331
  12
332
332
  /* String */
333
333
  );
334
- const r = Y.encode(t ?? "");
335
- this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.keyWritten = !0;
334
+ const s = Y.encode(t ?? "");
335
+ this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.keyWritten = !0;
336
336
  }
337
337
  writeKeyBinary(t) {
338
338
  this.ensureKeyType(
@@ -387,10 +387,10 @@ class It {
387
387
  14
388
388
  /* Guid */
389
389
  );
390
- const r = t instanceof f ? t.asBytes() : t;
391
- if (r.length !== 16)
390
+ const s = t instanceof f ? t.asBytes() : t;
391
+ if (s.length !== 16)
392
392
  throw new Error("Guid payload must be 16 bytes");
393
- this.payload.writeBytes(r), this.valueWritten = !0;
393
+ this.payload.writeBytes(s), this.valueWritten = !0;
394
394
  }
395
395
  writeNullValue() {
396
396
  this.ensureValueType(
@@ -409,36 +409,36 @@ class It {
409
409
  12
410
410
  /* String */
411
411
  );
412
- const r = Y.encode(t ?? "");
413
- this.payload.writeVarUInt(r.length), this.payload.writeBytes(r), this.valueWritten = !0;
412
+ const s = Y.encode(t ?? "");
413
+ this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.valueWritten = !0;
414
414
  }
415
- writeValueObject(t, r) {
415
+ writeValueObject(t, s) {
416
416
  this.ensureValueType(
417
417
  11
418
418
  /* Object */
419
419
  );
420
- const s = new G(t);
421
- r(s);
422
- const n = s.finish();
420
+ const r = new k(t);
421
+ s(r);
422
+ const n = r.finish();
423
423
  this.payload.writeVarUInt(n.length), this.payload.writeBytes(n), this.valueWritten = !0;
424
424
  }
425
- writeValueArray(t, r) {
425
+ writeValueArray(t, s) {
426
426
  this.ensureValueType(
427
427
  9
428
428
  /* Array */
429
429
  );
430
- const s = new $(t);
431
- r(s);
432
- const n = s.finish();
430
+ const r = new $(t);
431
+ s(r);
432
+ const n = r.finish();
433
433
  this.payload.writeBytes(n), this.valueWritten = !0;
434
434
  }
435
- writeValueDictionary(t, r, s) {
435
+ writeValueDictionary(t, s, r) {
436
436
  this.ensureValueType(
437
437
  10
438
438
  /* Dict */
439
439
  );
440
- const n = new ee(t, r);
441
- s(n);
440
+ const n = new ee(t, s);
441
+ r(n);
442
442
  const i = n.finish();
443
443
  this.payload.writeBytes(i), this.valueWritten = !0;
444
444
  }
@@ -459,44 +459,44 @@ class It {
459
459
  }
460
460
  }
461
461
  class O {
462
- constructor(t, r, s) {
463
- this.buffer = t, this.version = r, this.offset = s, this.end = t.length - 1;
462
+ constructor(t, s, r) {
463
+ this.buffer = t, this.version = s, this.offset = r, this.end = t.length - 1;
464
464
  }
465
465
  offset;
466
466
  end;
467
467
  static create(t) {
468
- const r = x(t);
469
- if (r.length < 2)
468
+ const s = x(t);
469
+ if (s.length < 2)
470
470
  throw new Error("Teleport payload too short");
471
- if (r[0] !== he || r[r.length - 1] !== ue)
471
+ if (s[0] !== ue || s[s.length - 1] !== ce)
472
472
  throw new Error("Teleport object missing markers");
473
- const s = { offset: 1 }, n = y(r, s, "InvalidLength");
474
- return new O(r, n, s.offset);
473
+ const r = { offset: 1 }, n = w(s, r, "InvalidLength");
474
+ return new O(s, n, r.offset);
475
475
  }
476
476
  next() {
477
477
  if (this.offset >= this.end)
478
478
  return null;
479
479
  if (this.offset + 5 > this.buffer.length)
480
480
  throw new Error("Teleport object truncated");
481
- const t = ct(this.buffer, this.offset);
481
+ const t = ft(this.buffer, this.offset);
482
482
  this.offset += 4;
483
- const r = this.buffer[this.offset++], s = r >> 4 & 15;
484
- if ((r & 15) !== 0)
483
+ const s = this.buffer[this.offset++], r = s >> 4 & 15;
484
+ if ((s & 15) !== 0)
485
485
  throw new Error("Teleport field flags must be zero");
486
- const n = P(s);
486
+ const n = P(r);
487
487
  let i;
488
488
  if (n >= 0)
489
489
  A(this.buffer, this.offset, n), i = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
490
490
  else {
491
- const o = { offset: this.offset }, a = y(this.buffer, o, "InvalidLength");
491
+ const o = { offset: this.offset }, a = w(this.buffer, o, "InvalidLength");
492
492
  A(this.buffer, o.offset, a), i = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
493
493
  }
494
- return new Et(t, s, i);
494
+ return new _t(t, r, i);
495
495
  }
496
496
  }
497
497
  class m {
498
- constructor(t, r) {
499
- this.type = t, this.payload = r;
498
+ constructor(t, s) {
499
+ this.type = t, this.payload = s;
500
500
  }
501
501
  asInt32() {
502
502
  return this.ensureType(
@@ -556,7 +556,7 @@ class m {
556
556
  return this.ensureType(
557
557
  12
558
558
  /* String */
559
- ), lt.decode(this.payload);
559
+ ), It.decode(this.payload);
560
560
  }
561
561
  asGuid() {
562
562
  return this.ensureType(
@@ -580,16 +580,16 @@ class m {
580
580
  return this.ensureType(
581
581
  10
582
582
  /* Dict */
583
- ), re.create(this.payload);
583
+ ), se.create(this.payload);
584
584
  }
585
585
  ensureType(t) {
586
586
  if (this.type !== t)
587
587
  throw new Error(`Teleport value has type ${U[this.type]}, expected ${U[t]}`);
588
588
  }
589
589
  }
590
- class Et extends m {
591
- constructor(t, r, s) {
592
- super(r, s), this.fieldId = t;
590
+ class _t extends m {
591
+ constructor(t, s, r) {
592
+ super(s, r), this.fieldId = t;
593
593
  }
594
594
  get isNull() {
595
595
  return this.type === 1;
@@ -604,11 +604,11 @@ class te {
604
604
  constructor(t) {
605
605
  if (this.payload = t, t.length === 0)
606
606
  throw new Error("Array payload too short");
607
- const r = t[0];
608
- if (this.elementType = r >> 4 & 15, (r & 15) !== 0)
607
+ const s = t[0];
608
+ if (this.elementType = s >> 4 & 15, (s & 15) !== 0)
609
609
  throw new Error("Array flags must be zero");
610
- const s = { offset: 1 };
611
- this.count = y(t, s, "ArrayMalformed"), this.offset = s.offset;
610
+ const r = { offset: 1 };
611
+ this.count = w(t, r, "ArrayMalformed"), this.offset = r.offset;
612
612
  }
613
613
  static create(t) {
614
614
  return new te(x(t));
@@ -634,41 +634,41 @@ class te {
634
634
  case 14: {
635
635
  const t = P(this.elementType);
636
636
  A(this.payload, this.offset, t);
637
- const r = this.payload.subarray(this.offset, this.offset + t);
638
- return this.offset += t, new k(this.elementType, r);
637
+ const s = this.payload.subarray(this.offset, this.offset + t);
638
+ return this.offset += t, new M(this.elementType, s);
639
639
  }
640
640
  case 12:
641
641
  case 13: {
642
- const t = { offset: this.offset }, r = y(this.payload, t, "ArrayMalformed");
643
- A(this.payload, t.offset, r);
644
- const s = this.payload.subarray(t.offset, t.offset + r);
645
- return this.offset = t.offset + r, new k(this.elementType, s);
642
+ const t = { offset: this.offset }, s = w(this.payload, t, "ArrayMalformed");
643
+ A(this.payload, t.offset, s);
644
+ const r = this.payload.subarray(t.offset, t.offset + s);
645
+ return this.offset = t.offset + s, new M(this.elementType, r);
646
646
  }
647
647
  case 11: {
648
- const t = { offset: this.offset }, r = y(this.payload, t, "ArrayMalformed");
649
- A(this.payload, t.offset, r);
650
- const s = this.payload.subarray(t.offset, t.offset + r);
651
- return this.offset = t.offset + r, new k(11, s);
648
+ const t = { offset: this.offset }, s = w(this.payload, t, "ArrayMalformed");
649
+ A(this.payload, t.offset, s);
650
+ const r = this.payload.subarray(t.offset, t.offset + s);
651
+ return this.offset = t.offset + s, new M(11, r);
652
652
  }
653
653
  case 9: {
654
- const t = ne(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
655
- return this.offset += t, new k(9, r);
654
+ const t = ne(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
655
+ return this.offset += t, new M(9, s);
656
656
  }
657
657
  case 10: {
658
- const t = ie(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
659
- return this.offset += t, new k(10, r);
658
+ const t = ie(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
659
+ return this.offset += t, new M(10, s);
660
660
  }
661
661
  default:
662
662
  throw new Error(`Unsupported array element type ${U[this.elementType]}`);
663
663
  }
664
664
  }
665
665
  }
666
- class k extends m {
667
- constructor(t, r) {
668
- super(t, r);
666
+ class M extends m {
667
+ constructor(t, s) {
668
+ super(t, s);
669
669
  }
670
670
  }
671
- class re {
671
+ class se {
672
672
  payload;
673
673
  keyType;
674
674
  valueType;
@@ -680,12 +680,12 @@ class re {
680
680
  throw new Error("Dictionary payload too short");
681
681
  if (this.keyType = t[0] >> 4 & 15, this.valueType = t[1] >> 4 & 15, (t[0] & 15) !== 0 || (t[1] & 15) !== 0)
682
682
  throw new Error("Dictionary key/value flags must be zero");
683
- se(this.keyType);
684
- const r = { offset: 2 };
685
- this.count = y(t, r, "DictMalformed"), this.offset = r.offset;
683
+ re(this.keyType);
684
+ const s = { offset: 2 };
685
+ this.count = w(t, s, "DictMalformed"), this.offset = s.offset;
686
686
  }
687
687
  static create(t) {
688
- return new re(x(t));
688
+ return new se(x(t));
689
689
  }
690
690
  next() {
691
691
  if (this.index >= this.count) {
@@ -693,21 +693,21 @@ class re {
693
693
  throw new Error("Dictionary payload contains trailing data");
694
694
  return null;
695
695
  }
696
- const t = this.readKey(), r = this.readValue();
697
- return this.index++, new _t(t, r);
696
+ const t = this.readKey(), s = this.readValue();
697
+ return this.index++, new ht(t, s);
698
698
  }
699
699
  readKey() {
700
700
  const t = P(this.keyType);
701
701
  if (t >= 0) {
702
702
  A(this.payload, this.offset, t);
703
- const r = this.payload.subarray(this.offset, this.offset + t);
704
- return this.offset += t, new m(this.keyType, r);
703
+ const s = this.payload.subarray(this.offset, this.offset + t);
704
+ return this.offset += t, new m(this.keyType, s);
705
705
  }
706
706
  if (this.keyType === 12 || this.keyType === 13) {
707
- const r = { offset: this.offset }, s = y(this.payload, r, "DictMalformed");
708
- A(this.payload, r.offset, s);
709
- const n = this.payload.subarray(r.offset, r.offset + s);
710
- return this.offset = r.offset + s, new m(this.keyType, n);
707
+ const s = { offset: this.offset }, r = w(this.payload, s, "DictMalformed");
708
+ A(this.payload, s.offset, r);
709
+ const n = this.payload.subarray(s.offset, s.offset + r);
710
+ return this.offset = s.offset + r, new m(this.keyType, n);
711
711
  }
712
712
  throw new Error("Unsupported dictionary key type");
713
713
  }
@@ -715,24 +715,24 @@ class re {
715
715
  switch (this.valueType) {
716
716
  case 12:
717
717
  case 13: {
718
- const t = { offset: this.offset }, r = y(this.payload, t, "DictMalformed");
719
- A(this.payload, t.offset, r);
720
- const s = this.payload.subarray(t.offset, t.offset + r);
721
- return this.offset = t.offset + r, new m(this.valueType, s);
718
+ const t = { offset: this.offset }, s = w(this.payload, t, "DictMalformed");
719
+ A(this.payload, t.offset, s);
720
+ const r = this.payload.subarray(t.offset, t.offset + s);
721
+ return this.offset = t.offset + s, new m(this.valueType, r);
722
722
  }
723
723
  case 11: {
724
- const t = { offset: this.offset }, r = y(this.payload, t, "DictMalformed");
725
- A(this.payload, t.offset, r);
726
- const s = this.payload.subarray(t.offset, t.offset + r);
727
- return this.offset = t.offset + r, new m(11, s);
724
+ const t = { offset: this.offset }, s = w(this.payload, t, "DictMalformed");
725
+ A(this.payload, t.offset, s);
726
+ const r = this.payload.subarray(t.offset, t.offset + s);
727
+ return this.offset = t.offset + s, new m(11, r);
728
728
  }
729
729
  case 9: {
730
- const t = ne(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
731
- return this.offset += t, new m(9, r);
730
+ const t = ne(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
731
+ return this.offset += t, new m(9, s);
732
732
  }
733
733
  case 10: {
734
- const t = ie(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + t);
735
- return this.offset += t, new m(10, r);
734
+ const t = ie(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
735
+ return this.offset += t, new m(10, s);
736
736
  }
737
737
  case 3:
738
738
  case 5:
@@ -745,17 +745,17 @@ class re {
745
745
  case 1: {
746
746
  const t = P(this.valueType);
747
747
  A(this.payload, this.offset, t);
748
- const r = this.payload.subarray(this.offset, this.offset + t);
749
- return this.offset += t, new m(this.valueType, r);
748
+ const s = this.payload.subarray(this.offset, this.offset + t);
749
+ return this.offset += t, new m(this.valueType, s);
750
750
  }
751
751
  default:
752
752
  throw new Error(`Unsupported dictionary value type ${U[this.valueType]}`);
753
753
  }
754
754
  }
755
755
  }
756
- class _t {
757
- constructor(t, r) {
758
- this.key = t, this.value = r;
756
+ class ht {
757
+ constructor(t, s) {
758
+ this.key = t, this.value = s;
759
759
  }
760
760
  }
761
761
  class f {
@@ -765,14 +765,14 @@ class f {
765
765
  static fromString(t) {
766
766
  if (!t)
767
767
  throw new Error("Guid string is empty");
768
- const r = t.replace(/-/g, "");
769
- if (r.length !== 32)
768
+ const s = t.replace(/-/g, "");
769
+ if (s.length !== 32)
770
770
  throw new Error("Guid string must be 32 hex characters");
771
- const s = new Uint8Array(16), n = f.parseHexSlice(r, 0, 8), i = f.parseHexSlice(r, 8, 4), o = f.parseHexSlice(r, 12, 4);
772
- f.writeUInt32LE(s, 0, n), f.writeUInt16LE(s, 4, i), f.writeUInt16LE(s, 6, o);
771
+ const r = new Uint8Array(16), n = f.parseHexSlice(s, 0, 8), i = f.parseHexSlice(s, 8, 4), o = f.parseHexSlice(s, 12, 4);
772
+ f.writeUInt32LE(r, 0, n), f.writeUInt16LE(r, 4, i), f.writeUInt16LE(r, 6, o);
773
773
  for (let a = 0; a < 8; a++)
774
- s[8 + a] = f.parseHexSlice(r, 16 + a * 2, 2);
775
- return new f(s);
774
+ r[8 + a] = f.parseHexSlice(s, 16 + a * 2, 2);
775
+ return new f(r);
776
776
  }
777
777
  static fromBytes(t) {
778
778
  if (t.length !== 16)
@@ -783,12 +783,12 @@ class f {
783
783
  return new f(new Uint8Array(16));
784
784
  }
785
785
  static createRandom() {
786
- const t = new Uint8Array(16), r = globalThis.crypto;
787
- if (r?.getRandomValues)
788
- r.getRandomValues(t);
786
+ const t = new Uint8Array(16), s = globalThis.crypto;
787
+ if (s?.getRandomValues)
788
+ s.getRandomValues(t);
789
789
  else
790
- for (let s = 0; s < t.length; s++)
791
- t[s] = Math.floor(Math.random() * 256);
790
+ for (let r = 0; r < t.length; r++)
791
+ t[r] = Math.floor(Math.random() * 256);
792
792
  return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, new f(t);
793
793
  }
794
794
  toString() {
@@ -804,28 +804,28 @@ class f {
804
804
  asBytes() {
805
805
  return this.bytes.slice();
806
806
  }
807
- static parseHexSlice(t, r, s) {
808
- const n = t.substr(r, s), i = Number.parseInt(n, 16);
807
+ static parseHexSlice(t, s, r) {
808
+ const n = t.substr(s, r), i = Number.parseInt(n, 16);
809
809
  if (Number.isNaN(i))
810
810
  throw new Error("Guid string contains invalid characters");
811
811
  return i >>> 0;
812
812
  }
813
- static writeUInt32LE(t, r, s) {
814
- const n = s >>> 0;
815
- t[r] = n & 255, t[r + 1] = n >>> 8 & 255, t[r + 2] = n >>> 16 & 255, t[r + 3] = n >>> 24 & 255;
813
+ static writeUInt32LE(t, s, r) {
814
+ const n = r >>> 0;
815
+ t[s] = n & 255, t[s + 1] = n >>> 8 & 255, t[s + 2] = n >>> 16 & 255, t[s + 3] = n >>> 24 & 255;
816
816
  }
817
- static writeUInt16LE(t, r, s) {
818
- const n = s & 65535;
819
- t[r] = n & 255, t[r + 1] = n >>> 8 & 255;
817
+ static writeUInt16LE(t, s, r) {
818
+ const n = r & 65535;
819
+ t[s] = n & 255, t[s + 1] = n >>> 8 & 255;
820
820
  }
821
- static readUInt32LE(t, r) {
822
- return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
821
+ static readUInt32LE(t, s) {
822
+ return (t[s] | t[s + 1] << 8 | t[s + 2] << 16 | t[s + 3] << 24) >>> 0;
823
823
  }
824
- static readUInt16LE(t, r) {
825
- return (t[r] | t[r + 1] << 8) & 65535;
824
+ static readUInt16LE(t, s) {
825
+ return (t[s] | t[s + 1] << 8) & 65535;
826
826
  }
827
- static toHex(t, r) {
828
- return (t >>> 0).toString(16).padStart(r, "0");
827
+ static toHex(t, s) {
828
+ return (t >>> 0).toString(16).padStart(s, "0");
829
829
  }
830
830
  }
831
831
  class b {
@@ -837,13 +837,13 @@ class b {
837
837
  this.buffer = new Uint8Array(b.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
838
838
  }
839
839
  ensureCapacity(t) {
840
- const r = this.length + t;
841
- if (r <= this.buffer.length)
840
+ const s = this.length + t;
841
+ if (s <= this.buffer.length)
842
842
  return;
843
- let s = this.buffer.length;
844
- for (; s < r; )
845
- s *= 2;
846
- const n = new Uint8Array(s);
843
+ let r = this.buffer.length;
844
+ for (; r < s; )
845
+ r *= 2;
846
+ const n = new Uint8Array(r);
847
847
  n.set(this.buffer.subarray(0, this.length)), this.buffer = n, this.dataView = new DataView(this.buffer.buffer);
848
848
  }
849
849
  writeByte(t) {
@@ -871,32 +871,32 @@ class b {
871
871
  this.ensureCapacity(8), this.dataView.setBigUint64(this.length, t, !0), this.length += 8;
872
872
  }
873
873
  writeVarUInt(t) {
874
- let r = t >>> 0;
875
- for (; r >= 128; )
876
- this.ensureCapacity(1), this.buffer[this.length++] = r & 127 | 128, r >>>= 7;
877
- this.ensureCapacity(1), this.buffer[this.length++] = r & 127;
874
+ let s = t >>> 0;
875
+ for (; s >= 128; )
876
+ this.ensureCapacity(1), this.buffer[this.length++] = s & 127 | 128, s >>>= 7;
877
+ this.ensureCapacity(1), this.buffer[this.length++] = s & 127;
878
878
  }
879
879
  toUint8Array() {
880
880
  return this.buffer.slice(0, this.length);
881
881
  }
882
882
  }
883
- function y(e, t, r) {
883
+ function w(e, t, s) {
884
884
  if (t.offset >= e.length)
885
- throw new Error(r);
886
- let s = 0, n = 0, i = 0;
885
+ throw new Error(s);
886
+ let r = 0, n = 0, i = 0;
887
887
  for (; t.offset < e.length; ) {
888
888
  const o = e[t.offset++];
889
- if (i++, s |= (o & 127) << n, (o & 128) === 0) {
890
- if (i !== ht(s))
889
+ if (i++, r |= (o & 127) << n, (o & 128) === 0) {
890
+ if (i !== ut(r))
891
891
  throw new Error("Teleport VarUInt is not canonical");
892
- return s >>> 0;
892
+ return r >>> 0;
893
893
  }
894
894
  if (n += 7, n >= 35)
895
895
  throw new Error("Teleport VarUInt exceeds 32-bit range");
896
896
  }
897
- throw new Error(r);
897
+ throw new Error(s);
898
898
  }
899
- function ht(e) {
899
+ function ut(e) {
900
900
  return e < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5;
901
901
  }
902
902
  function W(e, t = 0) {
@@ -904,7 +904,7 @@ function W(e, t = 0) {
904
904
  throw new Error("Teleport flags must fit into 4 bits");
905
905
  return (e & 15) << 4 | t & 15;
906
906
  }
907
- function ut(e) {
907
+ function ct(e) {
908
908
  return e === 12 || e === 13 || e === 9 || e === 11 || e === 10;
909
909
  }
910
910
  function P(e) {
@@ -927,64 +927,64 @@ function P(e) {
927
927
  return -1;
928
928
  }
929
929
  }
930
- function se(e) {
930
+ function re(e) {
931
931
  if (e === 9 || e === 11 || e === 10 || e === 1)
932
932
  throw new Error("Dictionary keys must be primitive Teleport types");
933
933
  }
934
- function A(e, t, r) {
935
- if (t < 0 || r < 0 || t + r > e.length)
934
+ function A(e, t, s) {
935
+ if (t < 0 || s < 0 || t + s > e.length)
936
936
  throw new Error("Teleport payload exceeds bounds");
937
937
  }
938
- function ct(e, t) {
938
+ function ft(e, t) {
939
939
  return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
940
940
  }
941
941
  function ne(e, t) {
942
942
  if (t >= e.length)
943
943
  throw new Error("Array payload exceeds bounds");
944
- const r = e[t], s = r >> 4 & 15;
945
- if ((r & 15) !== 0)
944
+ const s = e[t], r = s >> 4 & 15;
945
+ if ((s & 15) !== 0)
946
946
  throw new Error("Array flags must be zero");
947
- const n = { offset: t + 1 }, i = y(e, n, "ArrayMalformed"), o = P(s);
947
+ const n = { offset: t + 1 }, i = w(e, n, "ArrayMalformed"), o = P(r);
948
948
  if (o >= 0) {
949
949
  const I = o * i;
950
950
  return A(e, n.offset, I), n.offset + I - t;
951
951
  }
952
952
  let a = n.offset;
953
953
  for (let I = 0; I < i; I++)
954
- a = q(s, e, a, "ArrayMalformed");
954
+ a = q(r, e, a, "ArrayMalformed");
955
955
  return a - t;
956
956
  }
957
957
  function ie(e, t) {
958
958
  if (t + 2 > e.length)
959
959
  throw new Error("Dictionary payload too short");
960
- const r = e[t] >> 4 & 15, s = e[t + 1] >> 4 & 15;
960
+ const s = e[t] >> 4 & 15, r = e[t + 1] >> 4 & 15;
961
961
  if ((e[t] & 15) !== 0 || (e[t + 1] & 15) !== 0)
962
962
  throw new Error("Dictionary key/value flags must be zero");
963
- se(r);
964
- const n = { offset: t + 2 }, i = y(e, n, "DictMalformed");
963
+ re(s);
964
+ const n = { offset: t + 2 }, i = w(e, n, "DictMalformed");
965
965
  let o = n.offset;
966
966
  for (let a = 0; a < i; a++)
967
- o = q(r, e, o, "DictMalformed"), o = q(s, e, o, "DictMalformed");
967
+ o = q(s, e, o, "DictMalformed"), o = q(r, e, o, "DictMalformed");
968
968
  return o - t;
969
969
  }
970
- function q(e, t, r, s) {
970
+ function q(e, t, s, r) {
971
971
  const n = P(e);
972
972
  if (n >= 0)
973
- return A(t, r, n), r + n;
973
+ return A(t, s, n), s + n;
974
974
  switch (e) {
975
975
  case 12:
976
976
  case 13: {
977
- const i = { offset: r }, o = y(t, i, s);
977
+ const i = { offset: s }, o = w(t, i, r);
978
978
  return A(t, i.offset, o), i.offset + o;
979
979
  }
980
980
  case 11: {
981
- const i = { offset: r }, o = y(t, i, s);
981
+ const i = { offset: s }, o = w(t, i, r);
982
982
  return A(t, i.offset, o), i.offset + o;
983
983
  }
984
984
  case 9:
985
- return r + ne(t, r);
985
+ return s + ne(t, s);
986
986
  case 10:
987
- return r + ie(t, r);
987
+ return s + ie(t, s);
988
988
  default:
989
989
  throw new Error(`Unsupported Teleport type ${U[e]}`);
990
990
  }
@@ -995,1197 +995,1209 @@ function le(e) {
995
995
  function x(e) {
996
996
  return e instanceof Uint8Array ? e : new Uint8Array(e);
997
997
  }
998
- var ce = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Opus = 1] = "Opus", e[e.Mp3 = 2] = "Mp3", e[e.RawPcm16 = 3] = "RawPcm16", e))(ce || {}), fe = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MobileWeb = 1] = "MobileWeb", e[e.MobileApp = 2] = "MobileApp", e[e.DesktopWeb = 3] = "DesktopWeb", e[e.DesktopApp = 4] = "DesktopApp", e))(fe || {}), Te = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Backend = 2] = "Backend", e[e.Server = 4] = "Server", e[e.Plugin = 8] = "Plugin", e[e.Browser = 16] = "Browser", e[e.Native = 32] = "Native", e))(Te || {}), Se = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MessagePack = 1] = "MessagePack", e[e.MemoryPack = 2] = "MemoryPack", e[e.Json = 4] = "Json", e[e.Teleport = 8] = "Teleport", e[e.All = 15] = "All", e))(Se || {}), de = /* @__PURE__ */ ((e) => (e[e.Face = 0] = "Face", e[e.Hands = 1] = "Hands", e[e.Pose = 2] = "Pose", e[e.All = 3] = "All", e))(de || {}), Ae = /* @__PURE__ */ ((e) => (e[e.Css = 0] = "Css", e[e.Flutter = 1] = "Flutter", e))(Ae || {}), Ne = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Machine = 1] = "Machine", e[e.Human = 2] = "Human", e))(Ne || {}), ye = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.H264 = 1] = "H264", e[e.Vp8 = 2] = "Vp8", e[e.Vp9 = 3] = "Vp9", e[e.Av1 = 4] = "Av1", e))(ye || {}), we = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.DotNet = 1] = "DotNet", e[e.TypeScript = 2] = "TypeScript", e[e.Cpp = 3] = "Cpp", e[e.Dart = 4] = "Dart", e[e.Rust = 5] = "Rust", e))(we || {}), Ce = /* @__PURE__ */ ((e) => (e[e.Local = 0] = "Local", e[e.Cloud = 1] = "Cloud", e))(Ce || {}), Ue = /* @__PURE__ */ ((e) => (e[e.Bundle = 0] = "Bundle", e[e.GitSource = 1] = "GitSource", e))(Ue || {}), L = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", e[e.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", e[e.GROUP_CORE = 65536] = "GROUP_CORE", e[e.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", e[e.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", e[e.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", e[e.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", e[e.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", e[e.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", e[e.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", e[e.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", e[e.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", e[e.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", e[e.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", e[e.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", e[e.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", e[e.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", e[e.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", e[e.CORE_SERVER_START = 65552] = "CORE_SERVER_START", e[e.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", e[e.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", e[e.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", e[e.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", e[e.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", e[e.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", e[e.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", e[e.CORE_RESET_IDLE = 65560] = "CORE_RESET_IDLE", e[e.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", e[e.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", e[e.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", e[e.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", e[e.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", e[e.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", e[e.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", e[e.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", e[e.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", e[e.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", e[e.CORE_WEBRTC_ICE_SERVERS_REQUEST = 65573] = "CORE_WEBRTC_ICE_SERVERS_REQUEST", e[e.CORE_WEBRTC_ICE_SERVERS_RESPONSE = 65574] = "CORE_WEBRTC_ICE_SERVERS_RESPONSE", e[e.CORE_WEBRTC_CLOSE = 65575] = "CORE_WEBRTC_CLOSE", e[e.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", e[e.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", e[e.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", e[e.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", e[e.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", e[e.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", e[e.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", e[e.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", e[e.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", e[e.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", e[e.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", e[e.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", e[e.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", e[e.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", e[e.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", e[e.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", e[e.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", e[e.GROUP_EVENTS = 262144] = "GROUP_EVENTS", e[e.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", e[e.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", e[e.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", e[e.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", e[e.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", e[e.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", e[e.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", e[e.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", e[e.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", e[e.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", e[e.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", e[e.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", e[e.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", e[e.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", e[e.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", e[e.ACTION_CALL = 1048577] = "ACTION_CALL", e[e.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", e[e.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", e[e.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", e[e.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", e[e.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", e[e.ACTION_TAP = 1048583] = "ACTION_TAP", e[e.ACTION_PAN = 1048584] = "ACTION_PAN", e[e.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", e[e.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", e[e.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", e[e.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", e[e.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", e[e.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", e[e.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", e[e.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", e[e.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", e[e.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", e[e.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", e[e.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", e[e.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", e[e.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", e[e.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", e[e.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", e[e.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", e[e.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", e[e.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", e[e.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", e[e.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", e[e.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", e[e.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", e[e.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", e[e.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", e[e.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", e[e.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", e[e.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", e[e.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", e[e.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", e[e.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", e[e.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", e[e.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", e[e.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", e[e.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", e[e.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", e[e.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", e[e.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", e[e.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", e[e.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", e[e.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", e[e.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", e[e.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", e[e.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", e[e.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", e[e.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", e[e.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", e[e.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", e[e.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", e[e.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", e[e.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", e[e.ACTION_CALL2 = 1048637] = "ACTION_CALL2", e[e.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", e[e.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", e[e.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", e[e.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", e[e.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", e[e.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", e[e.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", e[e.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", e[e.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", e[e.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", e[e.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", e[e.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", e[e.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", e[e.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", e[e.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", e[e.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", e[e.GROUP_UI = 2097152] = "GROUP_UI", e[e.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", e[e.UI_STREAM_END = 2097154] = "UI_STREAM_END", e[e.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", e[e.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", e[e.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", e[e.UI_SECTION_END = 2097158] = "UI_SECTION_END", e[e.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", e[e.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", e[e.UI_LIST_END = 2097161] = "UI_LIST_END", e[e.UI_TEXT = 2097162] = "UI_TEXT", e[e.UI_HEADER = 2097163] = "UI_HEADER", e[e.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", e[e.UI_BUTTON = 2097165] = "UI_BUTTON", e[e.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", e[e.UI_IMAGE = 2097167] = "UI_IMAGE", e[e.UI_FILE = 2097168] = "UI_FILE", e[e.UI_BADGE = 2097169] = "UI_BADGE", e[e.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", e[e.UI_MAP = 2097171] = "UI_MAP", e[e.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", e[e.UI_ICON = 2097173] = "UI_ICON", e[e.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", e[e.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", e[e.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", e[e.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", e[e.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", e[e.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", e[e.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", e[e.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", e[e.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", e[e.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", e[e.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", e[e.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", e[e.UI_QS = 2097186] = "UI_QS", e[e.UI_ELEMENT = 2097187] = "UI_ELEMENT", e[e.UI_STYLES = 2097188] = "UI_STYLES", e[e.UI_SVG = 2097189] = "UI_SVG", e[e.UI_UPDATE = 2097190] = "UI_UPDATE", e[e.UI_INIT = 2097191] = "UI_INIT", e[e.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", e[e.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", e[e.GROUP_COMMON = 4128768] = "GROUP_COMMON", e[e.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", e[e.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", e[e.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", e[e.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", e[e.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", e[e.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", e[e.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", e[e.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", e[e.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", e[e.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", e[e.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", e[e.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", e[e.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", e[e.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", e[e.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", e[e.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", e[e.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", e[e.GROUP_SCENE = 33554432] = "GROUP_SCENE", e[e.SCENE_MESH = 33554433] = "SCENE_MESH", e[e.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", e[e.GROUP_ALL = 67043328] = "GROUP_ALL", e[e.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", e[e.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", e))(L || {});
999
- const ft = 161083277, Tt = 265814330, St = 1368629611, dt = 2431514951, At = 2514959030, Nt = 2745379226, yt = 3282782683, wt = 3284746250, Ct = 4101844078;
1000
- function Re(e) {
1001
- const t = {};
1002
- return De(t), t;
1003
- }
998
+ var fe = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Opus = 1] = "Opus", e[e.Mp3 = 2] = "Mp3", e[e.RawPcm16 = 3] = "RawPcm16", e))(fe || {}), Te = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MobileWeb = 1] = "MobileWeb", e[e.MobileApp = 2] = "MobileApp", e[e.DesktopWeb = 3] = "DesktopWeb", e[e.DesktopApp = 4] = "DesktopApp", e))(Te || {}), Se = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Backend = 2] = "Backend", e[e.Server = 4] = "Server", e[e.Plugin = 8] = "Plugin", e[e.Browser = 16] = "Browser", e[e.Native = 32] = "Native", e))(Se || {}), de = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.MessagePack = 1] = "MessagePack", e[e.MemoryPack = 2] = "MemoryPack", e[e.Json = 4] = "Json", e[e.Teleport = 8] = "Teleport", e[e.All = 15] = "All", e))(de || {}), Ae = /* @__PURE__ */ ((e) => (e[e.Face = 0] = "Face", e[e.Hands = 1] = "Hands", e[e.Pose = 2] = "Pose", e[e.All = 3] = "All", e))(Ae || {}), Ne = /* @__PURE__ */ ((e) => (e[e.Css = 0] = "Css", e[e.Flutter = 1] = "Flutter", e))(Ne || {}), ye = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Machine = 1] = "Machine", e[e.Human = 2] = "Human", e))(ye || {}), we = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.H264 = 1] = "H264", e[e.Vp8 = 2] = "Vp8", e[e.Vp9 = 3] = "Vp9", e[e.Av1 = 4] = "Av1", e))(we || {}), Ce = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.DotNet = 1] = "DotNet", e[e.TypeScript = 2] = "TypeScript", e[e.Cpp = 3] = "Cpp", e[e.Dart = 4] = "Dart", e[e.Rust = 5] = "Rust", e))(Ce || {}), Ue = /* @__PURE__ */ ((e) => (e[e.Local = 0] = "Local", e[e.Cloud = 1] = "Cloud", e))(Ue || {}), Re = /* @__PURE__ */ ((e) => (e[e.Bundle = 0] = "Bundle", e[e.GitSource = 1] = "GitSource", e))(Re || {}), L = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", e[e.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", e[e.GROUP_CORE = 65536] = "GROUP_CORE", e[e.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", e[e.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", e[e.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", e[e.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", e[e.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", e[e.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", e[e.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", e[e.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", e[e.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", e[e.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", e[e.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", e[e.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", e[e.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", e[e.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", e[e.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", e[e.CORE_SERVER_START = 65552] = "CORE_SERVER_START", e[e.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", e[e.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", e[e.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", e[e.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", e[e.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", e[e.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", e[e.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", e[e.CORE_RESET_IDLE = 65560] = "CORE_RESET_IDLE", e[e.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", e[e.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", e[e.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", e[e.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", e[e.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", e[e.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", e[e.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", e[e.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", e[e.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", e[e.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", e[e.CORE_WEBRTC_ICE_SERVERS_REQUEST = 65573] = "CORE_WEBRTC_ICE_SERVERS_REQUEST", e[e.CORE_WEBRTC_ICE_SERVERS_RESPONSE = 65574] = "CORE_WEBRTC_ICE_SERVERS_RESPONSE", e[e.CORE_WEBRTC_CLOSE = 65575] = "CORE_WEBRTC_CLOSE", e[e.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", e[e.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", e[e.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", e[e.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", e[e.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", e[e.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", e[e.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", e[e.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", e[e.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", e[e.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", e[e.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", e[e.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", e[e.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", e[e.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", e[e.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", e[e.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", e[e.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", e[e.GROUP_EVENTS = 262144] = "GROUP_EVENTS", e[e.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", e[e.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", e[e.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", e[e.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", e[e.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", e[e.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", e[e.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", e[e.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", e[e.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", e[e.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", e[e.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", e[e.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", e[e.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", e[e.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", e[e.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", e[e.ACTION_CALL = 1048577] = "ACTION_CALL", e[e.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", e[e.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", e[e.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", e[e.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", e[e.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", e[e.ACTION_TAP = 1048583] = "ACTION_TAP", e[e.ACTION_PAN = 1048584] = "ACTION_PAN", e[e.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", e[e.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", e[e.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", e[e.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", e[e.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", e[e.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", e[e.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", e[e.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", e[e.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", e[e.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", e[e.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", e[e.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", e[e.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", e[e.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", e[e.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", e[e.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", e[e.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", e[e.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", e[e.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", e[e.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", e[e.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", e[e.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", e[e.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", e[e.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", e[e.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", e[e.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", e[e.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", e[e.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", e[e.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", e[e.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", e[e.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", e[e.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", e[e.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", e[e.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", e[e.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", e[e.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", e[e.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", e[e.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", e[e.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", e[e.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", e[e.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", e[e.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", e[e.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", e[e.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", e[e.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", e[e.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", e[e.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", e[e.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", e[e.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", e[e.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", e[e.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", e[e.ACTION_CALL2 = 1048637] = "ACTION_CALL2", e[e.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", e[e.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", e[e.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", e[e.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", e[e.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", e[e.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", e[e.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", e[e.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", e[e.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", e[e.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", e[e.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", e[e.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", e[e.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", e[e.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", e[e.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", e[e.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", e[e.ACTION_RESULT = 1048654] = "ACTION_RESULT", e[e.UI_RESYNC_REQUEST = 1048655] = "UI_RESYNC_REQUEST", e[e.GROUP_UI = 2097152] = "GROUP_UI", e[e.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", e[e.UI_STREAM_END = 2097154] = "UI_STREAM_END", e[e.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", e[e.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", e[e.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", e[e.UI_SECTION_END = 2097158] = "UI_SECTION_END", e[e.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", e[e.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", e[e.UI_LIST_END = 2097161] = "UI_LIST_END", e[e.UI_TEXT = 2097162] = "UI_TEXT", e[e.UI_HEADER = 2097163] = "UI_HEADER", e[e.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", e[e.UI_BUTTON = 2097165] = "UI_BUTTON", e[e.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", e[e.UI_IMAGE = 2097167] = "UI_IMAGE", e[e.UI_FILE = 2097168] = "UI_FILE", e[e.UI_BADGE = 2097169] = "UI_BADGE", e[e.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", e[e.UI_MAP = 2097171] = "UI_MAP", e[e.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", e[e.UI_ICON = 2097173] = "UI_ICON", e[e.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", e[e.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", e[e.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", e[e.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", e[e.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", e[e.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", e[e.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", e[e.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", e[e.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", e[e.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", e[e.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", e[e.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", e[e.UI_QS = 2097186] = "UI_QS", e[e.UI_ELEMENT = 2097187] = "UI_ELEMENT", e[e.UI_STYLES = 2097188] = "UI_STYLES", e[e.UI_SVG = 2097189] = "UI_SVG", e[e.UI_UPDATE = 2097190] = "UI_UPDATE", e[e.UI_INIT = 2097191] = "UI_INIT", e[e.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", e[e.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", e[e.GROUP_COMMON = 4128768] = "GROUP_COMMON", e[e.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", e[e.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", e[e.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", e[e.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", e[e.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", e[e.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", e[e.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", e[e.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", e[e.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", e[e.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", e[e.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", e[e.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", e[e.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", e[e.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", e[e.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", e[e.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", e[e.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", e[e.GROUP_SCENE = 33554432] = "GROUP_SCENE", e[e.SCENE_MESH = 33554433] = "SCENE_MESH", e[e.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", e[e.GROUP_ALL = 67043328] = "GROUP_ALL", e[e.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", e[e.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", e))(L || {});
999
+ const Tt = 161083277, St = 265814330, dt = 1368629611, At = 2431514951, Nt = 2514959030, yt = 2745379226, wt = 3282782683, Ct = 3284746250, Ut = 4101844078;
1004
1000
  function De(e) {
1005
- return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = ce.Unknown, e.CodecDetails = "", e.SampleRate = 0, e.Channels = 0, e.ShapeSets = void 0, e.CorrelationId = void 0, e;
1001
+ const t = {};
1002
+ return Le(t), t;
1006
1003
  }
1007
- function Ut(e, t) {
1008
- const r = t ?? Re();
1009
- return De(r), Rt(e, r), r;
1004
+ function Le(e) {
1005
+ return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = fe.Unknown, e.CodecDetails = "", e.SampleRate = 0, e.Channels = 0, e.ShapeSets = void 0, e.CorrelationId = void 0, e;
1010
1006
  }
1011
1007
  function Rt(e, t) {
1012
- let r;
1013
- for (; (r = e.next()) !== null; )
1014
- switch (r.fieldId) {
1015
- case ft: {
1016
- if (r.isNull) throw new Error();
1017
- t.StreamId = r.asString();
1008
+ const s = t ?? De();
1009
+ return Le(s), Dt(e, s), s;
1010
+ }
1011
+ function Dt(e, t) {
1012
+ let s;
1013
+ for (; (s = e.next()) !== null; )
1014
+ switch (s.fieldId) {
1015
+ case Tt: {
1016
+ if (s.isNull) throw new Error();
1017
+ t.StreamId = s.asString();
1018
1018
  break;
1019
1019
  }
1020
- case Tt: {
1021
- if (r.isNull) {
1020
+ case St: {
1021
+ if (s.isNull) {
1022
1022
  t.ShapeSets = void 0;
1023
1023
  break;
1024
1024
  }
1025
- t.ShapeSets = Dt(r.asArray());
1026
- break;
1027
- }
1028
- case St: {
1029
- if (r.isNull) throw new Error();
1030
- t.Description = r.asString();
1025
+ t.ShapeSets = Lt(s.asArray());
1031
1026
  break;
1032
1027
  }
1033
1028
  case dt: {
1034
- if (r.isNull) throw new Error();
1035
- t.Channels = r.asInt32();
1029
+ if (s.isNull) throw new Error();
1030
+ t.Description = s.asString();
1036
1031
  break;
1037
1032
  }
1038
1033
  case At: {
1039
- if (r.isNull) {
1040
- t.CorrelationId = void 0;
1041
- break;
1042
- }
1043
- t.CorrelationId = r.asString();
1034
+ if (s.isNull) throw new Error();
1035
+ t.Channels = s.asInt32();
1044
1036
  break;
1045
1037
  }
1046
1038
  case Nt: {
1047
- if (r.isNull) throw new Error();
1048
- t.CodecDetails = r.asString();
1039
+ if (s.isNull) {
1040
+ t.CorrelationId = void 0;
1041
+ break;
1042
+ }
1043
+ t.CorrelationId = s.asString();
1049
1044
  break;
1050
1045
  }
1051
1046
  case yt: {
1052
- if (r.isNull) throw new Error();
1053
- t.SourceType = r.asString();
1047
+ if (s.isNull) throw new Error();
1048
+ t.CodecDetails = s.asString();
1054
1049
  break;
1055
1050
  }
1056
1051
  case wt: {
1057
- if (r.isNull) throw new Error();
1058
- t.Codec = r.asInt32();
1052
+ if (s.isNull) throw new Error();
1053
+ t.SourceType = s.asString();
1059
1054
  break;
1060
1055
  }
1061
1056
  case Ct: {
1062
- if (r.isNull) throw new Error();
1063
- t.SampleRate = r.asInt32();
1057
+ if (s.isNull) throw new Error();
1058
+ t.Codec = s.asInt32();
1059
+ break;
1060
+ }
1061
+ case Ut: {
1062
+ if (s.isNull) throw new Error();
1063
+ t.SampleRate = s.asInt32();
1064
1064
  break;
1065
1065
  }
1066
1066
  }
1067
1067
  }
1068
- function Dt(e) {
1068
+ function Lt(e) {
1069
1069
  const t = [];
1070
- let r;
1071
- for (; (r = e.next()) !== null; )
1072
- t.push(bt(r.asObject()));
1070
+ let s;
1071
+ for (; (s = e.next()) !== null; )
1072
+ t.push(Ft(s.asObject()));
1073
1073
  return t;
1074
1074
  }
1075
- const Lt = 1107713536, mt = 1154362099, Ot = 1185721362;
1076
- function gt(e) {
1075
+ const mt = 1107713536, Ot = 1154362099, gt = 1185721362;
1076
+ function bt(e) {
1077
1077
  const t = {};
1078
- return Le(t), t;
1078
+ return me(t), t;
1079
1079
  }
1080
- function Le(e) {
1080
+ function me(e) {
1081
1081
  return e.SetId = 0, e.Name = "", e.ShapeNames = [], e;
1082
1082
  }
1083
- function bt(e, t) {
1084
- const r = t ?? gt();
1085
- return Le(r), Ft(e, r), r;
1086
- }
1087
1083
  function Ft(e, t) {
1088
- let r;
1089
- for (; (r = e.next()) !== null; )
1090
- switch (r.fieldId) {
1091
- case Lt: {
1092
- if (r.isNull) throw new Error();
1093
- t.Name = r.asString();
1094
- break;
1095
- }
1084
+ const s = t ?? bt();
1085
+ return me(s), Pt(e, s), s;
1086
+ }
1087
+ function Pt(e, t) {
1088
+ let s;
1089
+ for (; (s = e.next()) !== null; )
1090
+ switch (s.fieldId) {
1096
1091
  case mt: {
1097
- if (r.isNull) throw new Error();
1098
- t.SetId = r.asUInt32();
1092
+ if (s.isNull) throw new Error();
1093
+ t.Name = s.asString();
1099
1094
  break;
1100
1095
  }
1101
1096
  case Ot: {
1102
- if (r.isNull) throw new Error();
1103
- t.ShapeNames = Pt(r.asArray());
1097
+ if (s.isNull) throw new Error();
1098
+ t.SetId = s.asUInt32();
1099
+ break;
1100
+ }
1101
+ case gt: {
1102
+ if (s.isNull) throw new Error();
1103
+ t.ShapeNames = pt(s.asArray());
1104
1104
  break;
1105
1105
  }
1106
1106
  }
1107
1107
  }
1108
- function Pt(e) {
1108
+ function pt(e) {
1109
1109
  const t = [];
1110
- let r;
1111
- for (; (r = e.next()) !== null; )
1112
- t.push(r.asString());
1110
+ let s;
1111
+ for (; (s = e.next()) !== null; )
1112
+ t.push(s.asString());
1113
1113
  return t;
1114
1114
  }
1115
- const pt = 76337612, kt = 185396121, vt = 250031587, Mt = 388632637, Bt = 417197284, Vt = 425972532, Gt = 469070965, xt = 470595159, Ht = 594855258, Yt = 617065367, Wt = 661691032, Kt = 781727218, $t = 834078886, Xt = 1043273762, jt = 1236999138, zt = 1286979607, Jt = 1368629611, qt = 1437068682, Qt = 1668375353, Zt = 1715899485, er = 1942830531, tr = 1999510636, rr = 2033288346, sr = 2079864626, nr = 2142346422, ir = 2228539873, or = 2232517119, ar = 2598291686, lr = 2719718823, Ir = 2810953526, Er = 2840065720, _r = 2885165957, hr = 3542818975, ur = 3586157513, cr = 3717933110, fr = 4062655306;
1116
- function Tr(e) {
1115
+ const kt = 76337612, Mt = 185396121, vt = 250031587, Bt = 388632637, Vt = 417197284, Gt = 425972532, xt = 469070965, Ht = 470595159, Yt = 594855258, Wt = 617065367, Kt = 661691032, $t = 781727218, Xt = 834078886, jt = 1043273762, zt = 1236999138, Jt = 1286979607, qt = 1368629611, Qt = 1437068682, Zt = 1668375353, es = 1715899485, ts = 1942830531, ss = 1999510636, rs = 2033288346, ns = 2079864626, is = 2142346422, os = 2228539873, as = 2232517119, ls = 2598291686, Is = 2719718823, Es = 2810953526, _s = 2840065720, hs = 2885165957, us = 3542818975, cs = 3586157513, fs = 3717933110, Ts = 4062655306;
1116
+ function Ss(e) {
1117
1117
  const t = {};
1118
- return me(t), t;
1118
+ return Oe(t), t;
1119
1119
  }
1120
- function me(e) {
1121
- return e.ContextType = Te.Unknown, e.UserType = Ne.Unknown, e.PayloadType = Se.Unknown, e.Description = "", e.UserId = "", e.DeviceId = "", e.ProductId = "", e.VersionId = "", e.InstallId = "", e.Locale = "", e.SessionId = -1, e.IsInternal = !1, e.IsSnapshot = !1, e.IsReady = !1, e.HasInput = !1, e.ChannelLocale = "", e.EmbeddedSpaceId = "", e.AuthSessionId = "", e.ReceiveAllMessages = !1, e.PreciseJoinedAt = 0n, e.UserAgent = "", e.ClientType = fe.Unknown, e.UniqueSessionId = "", e.Parameters = /* @__PURE__ */ Object.create(null), e.SdkType = we.Unknown, e.SdkCapability = 0, e.ViewportWidth = 0, e.ViewportHeight = 0, e.Theme = "", e.Timezone = "", e.IsTouchDevice = !1, e.InitialPath = "", e.StyleFormat = Ae.Css, e.SupportsCompression = !0, e.IsSoftDisconnected = !1, e.SoftDisconnectAt = 0n, e;
1120
+ function Oe(e) {
1121
+ return e.ContextType = Se.Unknown, e.UserType = ye.Unknown, e.PayloadType = de.Unknown, e.Description = "", e.UserId = "", e.DeviceId = "", e.ProductId = "", e.VersionId = "", e.InstallId = "", e.Locale = "", e.SessionId = -1, e.IsInternal = !1, e.IsSnapshot = !1, e.IsReady = !1, e.HasInput = !1, e.ChannelLocale = "", e.EmbeddedSpaceId = "", e.AuthSessionId = "", e.ReceiveAllMessages = !1, e.PreciseJoinedAt = 0n, e.UserAgent = "", e.ClientType = Te.Unknown, e.UniqueSessionId = "", e.Parameters = /* @__PURE__ */ Object.create(null), e.SdkType = Ce.Unknown, e.SdkCapability = 0, e.ViewportWidth = 0, e.ViewportHeight = 0, e.Theme = "", e.Timezone = "", e.IsTouchDevice = !1, e.InitialPath = "", e.StyleFormat = Ne.Css, e.SupportsCompression = !0, e.IsSoftDisconnected = !1, e.SoftDisconnectAt = 0n, e;
1122
1122
  }
1123
- function Sr(e, t) {
1124
- const r = t ?? Tr();
1125
- return me(r), dr(e, r), r;
1123
+ function ds(e, t) {
1124
+ const s = t ?? Ss();
1125
+ return Oe(s), As(e, s), s;
1126
1126
  }
1127
- function dr(e, t) {
1128
- let r;
1129
- for (; (r = e.next()) !== null; )
1130
- switch (r.fieldId) {
1131
- case pt: {
1132
- if (r.isNull) throw new Error();
1133
- t.DeviceId = r.asString();
1134
- break;
1135
- }
1127
+ function As(e, t) {
1128
+ let s;
1129
+ for (; (s = e.next()) !== null; )
1130
+ switch (s.fieldId) {
1136
1131
  case kt: {
1137
- if (r.isNull) throw new Error();
1138
- t.InstallId = r.asString();
1132
+ if (s.isNull) throw new Error();
1133
+ t.DeviceId = s.asString();
1139
1134
  break;
1140
1135
  }
1141
- case vt: {
1142
- if (r.isNull) throw new Error();
1143
- t.Theme = r.asString();
1136
+ case Mt: {
1137
+ if (s.isNull) throw new Error();
1138
+ t.InstallId = s.asString();
1144
1139
  break;
1145
1140
  }
1146
- case Mt: {
1147
- if (r.isNull) throw new Error();
1148
- t.UserAgent = r.asString();
1141
+ case vt: {
1142
+ if (s.isNull) throw new Error();
1143
+ t.Theme = s.asString();
1149
1144
  break;
1150
1145
  }
1151
1146
  case Bt: {
1152
- if (r.isNull) throw new Error();
1153
- t.ContextType = r.asInt32();
1147
+ if (s.isNull) throw new Error();
1148
+ t.UserAgent = s.asString();
1154
1149
  break;
1155
1150
  }
1156
1151
  case Vt: {
1157
- if (r.isNull) throw new Error();
1158
- t.SoftDisconnectAt = r.asUInt64();
1152
+ if (s.isNull) throw new Error();
1153
+ t.ContextType = s.asInt32();
1159
1154
  break;
1160
1155
  }
1161
1156
  case Gt: {
1162
- if (r.isNull) throw new Error();
1163
- t.HasInput = r.asBool();
1157
+ if (s.isNull) throw new Error();
1158
+ t.SoftDisconnectAt = s.asUInt64();
1164
1159
  break;
1165
1160
  }
1166
1161
  case xt: {
1167
- if (r.isNull) throw new Error();
1168
- t.UserType = r.asInt32();
1162
+ if (s.isNull) throw new Error();
1163
+ t.HasInput = s.asBool();
1169
1164
  break;
1170
1165
  }
1171
1166
  case Ht: {
1172
- if (r.isNull) throw new Error();
1173
- t.InitialPath = r.asString();
1167
+ if (s.isNull) throw new Error();
1168
+ t.UserType = s.asInt32();
1174
1169
  break;
1175
1170
  }
1176
1171
  case Yt: {
1177
- if (r.isNull) throw new Error();
1178
- t.IsSoftDisconnected = r.asBool();
1172
+ if (s.isNull) throw new Error();
1173
+ t.InitialPath = s.asString();
1179
1174
  break;
1180
1175
  }
1181
1176
  case Wt: {
1182
- if (r.isNull) throw new Error();
1183
- t.SupportsCompression = r.asBool();
1177
+ if (s.isNull) throw new Error();
1178
+ t.IsSoftDisconnected = s.asBool();
1184
1179
  break;
1185
1180
  }
1186
1181
  case Kt: {
1187
- if (r.isNull) throw new Error();
1188
- t.UserId = r.asString();
1182
+ if (s.isNull) throw new Error();
1183
+ t.SupportsCompression = s.asBool();
1189
1184
  break;
1190
1185
  }
1191
1186
  case $t: {
1192
- if (r.isNull) throw new Error();
1193
- t.ProductId = r.asString();
1187
+ if (s.isNull) throw new Error();
1188
+ t.UserId = s.asString();
1194
1189
  break;
1195
1190
  }
1196
1191
  case Xt: {
1197
- if (r.isNull) throw new Error();
1198
- t.AuthSessionId = r.asString();
1192
+ if (s.isNull) throw new Error();
1193
+ t.ProductId = s.asString();
1199
1194
  break;
1200
1195
  }
1201
1196
  case jt: {
1202
- if (r.isNull) throw new Error();
1203
- t.ReceiveAllMessages = r.asBool();
1197
+ if (s.isNull) throw new Error();
1198
+ t.AuthSessionId = s.asString();
1204
1199
  break;
1205
1200
  }
1206
1201
  case zt: {
1207
- if (r.isNull) throw new Error();
1208
- t.ViewportHeight = r.asInt32();
1202
+ if (s.isNull) throw new Error();
1203
+ t.ReceiveAllMessages = s.asBool();
1209
1204
  break;
1210
1205
  }
1211
1206
  case Jt: {
1212
- if (r.isNull) throw new Error();
1213
- t.Description = r.asString();
1207
+ if (s.isNull) throw new Error();
1208
+ t.ViewportHeight = s.asInt32();
1214
1209
  break;
1215
1210
  }
1216
1211
  case qt: {
1217
- if (r.isNull) throw new Error();
1218
- t.SdkCapability = r.asInt32();
1212
+ if (s.isNull) throw new Error();
1213
+ t.Description = s.asString();
1219
1214
  break;
1220
1215
  }
1221
1216
  case Qt: {
1222
- if (r.isNull) throw new Error();
1223
- t.IsSnapshot = r.asBool();
1217
+ if (s.isNull) throw new Error();
1218
+ t.SdkCapability = s.asInt32();
1224
1219
  break;
1225
1220
  }
1226
1221
  case Zt: {
1227
- if (r.isNull) throw new Error();
1228
- t.Locale = r.asString();
1222
+ if (s.isNull) throw new Error();
1223
+ t.IsSnapshot = s.asBool();
1224
+ break;
1225
+ }
1226
+ case es: {
1227
+ if (s.isNull) throw new Error();
1228
+ t.Locale = s.asString();
1229
1229
  break;
1230
1230
  }
1231
- case er: {
1232
- if (r.isNull) throw new Error();
1233
- t.SdkType = r.asInt32();
1231
+ case ts: {
1232
+ if (s.isNull) throw new Error();
1233
+ t.SdkType = s.asInt32();
1234
1234
  break;
1235
1235
  }
1236
- case tr: {
1237
- if (r.isNull) throw new Error();
1238
- t.SessionId = r.asInt32();
1236
+ case ss: {
1237
+ if (s.isNull) throw new Error();
1238
+ t.SessionId = s.asInt32();
1239
1239
  break;
1240
1240
  }
1241
- case rr: {
1242
- if (r.isNull) throw new Error();
1243
- t.ViewportWidth = r.asInt32();
1241
+ case rs: {
1242
+ if (s.isNull) throw new Error();
1243
+ t.ViewportWidth = s.asInt32();
1244
1244
  break;
1245
1245
  }
1246
- case sr: {
1247
- if (r.isNull) throw new Error();
1248
- t.PreciseJoinedAt = r.asUInt64();
1246
+ case ns: {
1247
+ if (s.isNull) throw new Error();
1248
+ t.PreciseJoinedAt = s.asUInt64();
1249
1249
  break;
1250
1250
  }
1251
- case nr: {
1252
- if (r.isNull) throw new Error();
1253
- t.PayloadType = r.asInt32();
1251
+ case is: {
1252
+ if (s.isNull) throw new Error();
1253
+ t.PayloadType = s.asInt32();
1254
1254
  break;
1255
1255
  }
1256
- case ir: {
1257
- if (r.isNull) throw new Error();
1258
- t.StyleFormat = r.asInt32();
1256
+ case os: {
1257
+ if (s.isNull) throw new Error();
1258
+ t.StyleFormat = s.asInt32();
1259
1259
  break;
1260
1260
  }
1261
- case or: {
1262
- if (r.isNull) throw new Error();
1263
- t.IsTouchDevice = r.asBool();
1261
+ case as: {
1262
+ if (s.isNull) throw new Error();
1263
+ t.IsTouchDevice = s.asBool();
1264
1264
  break;
1265
1265
  }
1266
- case ar: {
1267
- if (r.isNull) throw new Error();
1268
- t.VersionId = r.asString();
1266
+ case ls: {
1267
+ if (s.isNull) throw new Error();
1268
+ t.VersionId = s.asString();
1269
1269
  break;
1270
1270
  }
1271
- case lr: {
1272
- if (r.isNull) throw new Error();
1273
- t.UniqueSessionId = r.asString();
1271
+ case Is: {
1272
+ if (s.isNull) throw new Error();
1273
+ t.UniqueSessionId = s.asString();
1274
1274
  break;
1275
1275
  }
1276
- case Ir: {
1277
- if (r.isNull) throw new Error();
1278
- t.ClientType = r.asInt32();
1276
+ case Es: {
1277
+ if (s.isNull) throw new Error();
1278
+ t.ClientType = s.asInt32();
1279
1279
  break;
1280
1280
  }
1281
- case Er: {
1282
- if (r.isNull) throw new Error();
1283
- t.IsReady = r.asBool();
1281
+ case _s: {
1282
+ if (s.isNull) throw new Error();
1283
+ t.IsReady = s.asBool();
1284
1284
  break;
1285
1285
  }
1286
- case _r: {
1287
- if (r.isNull) throw new Error();
1288
- t.Parameters = Ar(r.asDictionary());
1286
+ case hs: {
1287
+ if (s.isNull) throw new Error();
1288
+ t.Parameters = Ns(s.asDictionary());
1289
1289
  break;
1290
1290
  }
1291
- case hr: {
1292
- if (r.isNull) throw new Error();
1293
- t.Timezone = r.asString();
1291
+ case us: {
1292
+ if (s.isNull) throw new Error();
1293
+ t.Timezone = s.asString();
1294
1294
  break;
1295
1295
  }
1296
- case ur: {
1297
- if (r.isNull) throw new Error();
1298
- t.IsInternal = r.asBool();
1296
+ case cs: {
1297
+ if (s.isNull) throw new Error();
1298
+ t.IsInternal = s.asBool();
1299
1299
  break;
1300
1300
  }
1301
- case cr: {
1302
- if (r.isNull) throw new Error();
1303
- t.ChannelLocale = r.asString();
1301
+ case fs: {
1302
+ if (s.isNull) throw new Error();
1303
+ t.ChannelLocale = s.asString();
1304
1304
  break;
1305
1305
  }
1306
- case fr: {
1307
- if (r.isNull) throw new Error();
1308
- t.EmbeddedSpaceId = r.asString();
1306
+ case Ts: {
1307
+ if (s.isNull) throw new Error();
1308
+ t.EmbeddedSpaceId = s.asString();
1309
1309
  break;
1310
1310
  }
1311
1311
  }
1312
1312
  }
1313
- function Ar(e) {
1313
+ function Ns(e) {
1314
1314
  const t = /* @__PURE__ */ Object.create(null);
1315
- let r;
1316
- for (; (r = e.next()) !== null; ) {
1317
- const s = r.key.asString();
1318
- t[s] = r.value.asString();
1315
+ let s;
1316
+ for (; (s = e.next()) !== null; ) {
1317
+ const r = s.key.asString();
1318
+ t[r] = s.value.asString();
1319
1319
  }
1320
1320
  return t;
1321
1321
  }
1322
- const Nr = 703025676, yr = 814454131, wr = 972460562, Cr = 976255570, Ur = 1368629611, Rr = 1479280922, Dr = 1533537016, Lr = 1909301063, mr = 2274386296, Or = 2603556958, gr = 2885165957, br = 3568439632;
1323
- function Fr(e) {
1322
+ const ys = 703025676, ws = 814454131, Cs = 972460562, Us = 976255570, Rs = 1368629611, Ds = 1479280922, Ls = 1533537016, ms = 1909301063, Os = 2274386296, gs = 2603556958, bs = 2885165957, Fs = 3568439632;
1323
+ function Ps(e) {
1324
1324
  const t = {};
1325
- return Oe(t), t;
1325
+ return ge(t), t;
1326
1326
  }
1327
- function Oe(e) {
1327
+ function ge(e) {
1328
1328
  return e.FunctionId = f.fromBytes(new Uint8Array(16)), e.FunctionName = "", e.Parameters = [], e.ResultTypeName = "", e.IsEnumerable = !1, e.EnumerableItemTypeName = "", e.IsCancellable = !1, e.Description = "", e.LlmInlineResult = !1, e.LlmCallOnlyOnce = !1, e.RequiresInstance = !1, e.Versions = [], e;
1329
1329
  }
1330
- function Pr(e, t) {
1331
- const r = t ?? Fr();
1332
- return Oe(r), pr(e, r), r;
1330
+ function ps(e, t) {
1331
+ const s = t ?? Ps();
1332
+ return ge(s), ks(e, s), s;
1333
1333
  }
1334
- function pr(e, t) {
1335
- let r;
1336
- for (; (r = e.next()) !== null; )
1337
- switch (r.fieldId) {
1338
- case Nr: {
1339
- if (r.isNull) throw new Error();
1340
- t.ResultTypeName = r.asString();
1334
+ function ks(e, t) {
1335
+ let s;
1336
+ for (; (s = e.next()) !== null; )
1337
+ switch (s.fieldId) {
1338
+ case ys: {
1339
+ if (s.isNull) throw new Error();
1340
+ t.ResultTypeName = s.asString();
1341
1341
  break;
1342
1342
  }
1343
- case yr: {
1344
- if (r.isNull) throw new Error();
1345
- t.FunctionName = r.asString();
1343
+ case ws: {
1344
+ if (s.isNull) throw new Error();
1345
+ t.FunctionName = s.asString();
1346
1346
  break;
1347
1347
  }
1348
- case wr: {
1349
- if (r.isNull) throw new Error();
1350
- t.EnumerableItemTypeName = r.asString();
1348
+ case Cs: {
1349
+ if (s.isNull) throw new Error();
1350
+ t.EnumerableItemTypeName = s.asString();
1351
1351
  break;
1352
1352
  }
1353
- case Cr: {
1354
- if (r.isNull) throw new Error();
1355
- t.FunctionId = r.asGuid();
1353
+ case Us: {
1354
+ if (s.isNull) throw new Error();
1355
+ t.FunctionId = s.asGuid();
1356
1356
  break;
1357
1357
  }
1358
- case Ur: {
1359
- if (r.isNull) throw new Error();
1360
- t.Description = r.asString();
1358
+ case Rs: {
1359
+ if (s.isNull) throw new Error();
1360
+ t.Description = s.asString();
1361
1361
  break;
1362
1362
  }
1363
- case Rr: {
1364
- if (r.isNull) throw new Error();
1365
- t.IsCancellable = r.asBool();
1363
+ case Ds: {
1364
+ if (s.isNull) throw new Error();
1365
+ t.IsCancellable = s.asBool();
1366
1366
  break;
1367
1367
  }
1368
- case Dr: {
1369
- if (r.isNull) throw new Error();
1370
- t.RequiresInstance = r.asBool();
1368
+ case Ls: {
1369
+ if (s.isNull) throw new Error();
1370
+ t.RequiresInstance = s.asBool();
1371
1371
  break;
1372
1372
  }
1373
- case Lr: {
1374
- if (r.isNull) throw new Error();
1375
- t.Versions = kr(r.asArray());
1373
+ case ms: {
1374
+ if (s.isNull) throw new Error();
1375
+ t.Versions = Ms(s.asArray());
1376
1376
  break;
1377
1377
  }
1378
- case mr: {
1379
- if (r.isNull) throw new Error();
1380
- t.LlmInlineResult = r.asBool();
1378
+ case Os: {
1379
+ if (s.isNull) throw new Error();
1380
+ t.LlmInlineResult = s.asBool();
1381
1381
  break;
1382
1382
  }
1383
- case Or: {
1384
- if (r.isNull) throw new Error();
1385
- t.IsEnumerable = r.asBool();
1383
+ case gs: {
1384
+ if (s.isNull) throw new Error();
1385
+ t.IsEnumerable = s.asBool();
1386
1386
  break;
1387
1387
  }
1388
- case gr: {
1389
- if (r.isNull) throw new Error();
1390
- t.Parameters = vr(r.asArray());
1388
+ case bs: {
1389
+ if (s.isNull) throw new Error();
1390
+ t.Parameters = vs(s.asArray());
1391
1391
  break;
1392
1392
  }
1393
- case br: {
1394
- if (r.isNull) throw new Error();
1395
- t.LlmCallOnlyOnce = r.asBool();
1393
+ case Fs: {
1394
+ if (s.isNull) throw new Error();
1395
+ t.LlmCallOnlyOnce = s.asBool();
1396
1396
  break;
1397
1397
  }
1398
1398
  }
1399
1399
  }
1400
- function kr(e) {
1400
+ function Ms(e) {
1401
1401
  const t = [];
1402
- let r;
1403
- for (; (r = e.next()) !== null; )
1404
- t.push(r.asString());
1402
+ let s;
1403
+ for (; (s = e.next()) !== null; )
1404
+ t.push(s.asString());
1405
1405
  return t;
1406
1406
  }
1407
- function vr(e) {
1407
+ function vs(e) {
1408
1408
  const t = [];
1409
- let r;
1410
- for (; (r = e.next()) !== null; )
1411
- t.push(Xr(r.asObject()));
1409
+ let s;
1410
+ for (; (s = e.next()) !== null; )
1411
+ t.push(js(s.asObject()));
1412
1412
  return t;
1413
1413
  }
1414
- const Mr = 607861992, Br = 894485888, Vr = 972460562, Gr = 1368629611, xr = 1883521406, Hr = 2603556958, Yr = 3609695522, Wr = 4075263697, Kr = 4257460908;
1415
- function $r(e) {
1414
+ const Bs = 607861992, Vs = 894485888, Gs = 972460562, xs = 1368629611, Hs = 1883521406, Ys = 2603556958, Ws = 3609695522, Ks = 4075263697, $s = 4257460908;
1415
+ function Xs(e) {
1416
1416
  const t = {};
1417
- return ge(t), t;
1417
+ return be(t), t;
1418
1418
  }
1419
- function ge(e) {
1419
+ function be(e) {
1420
1420
  return e.ParameterIndex = 0, e.ParameterName = "", e.TypeName = "", e.HasDefaultValue = !1, e.DefaultValueJson = "", e.DefaultValueData = new Uint8Array(0), e.IsEnumerable = !1, e.EnumerableItemTypeName = "", e.Description = "", e;
1421
1421
  }
1422
- function Xr(e, t) {
1423
- const r = t ?? $r();
1424
- return ge(r), jr(e, r), r;
1422
+ function js(e, t) {
1423
+ const s = t ?? Xs();
1424
+ return be(s), zs(e, s), s;
1425
1425
  }
1426
- function jr(e, t) {
1427
- let r;
1428
- for (; (r = e.next()) !== null; )
1429
- switch (r.fieldId) {
1430
- case Mr: {
1431
- if (r.isNull) throw new Error();
1432
- t.HasDefaultValue = r.asBool();
1426
+ function zs(e, t) {
1427
+ let s;
1428
+ for (; (s = e.next()) !== null; )
1429
+ switch (s.fieldId) {
1430
+ case Bs: {
1431
+ if (s.isNull) throw new Error();
1432
+ t.HasDefaultValue = s.asBool();
1433
1433
  break;
1434
1434
  }
1435
- case Br: {
1436
- if (r.isNull) throw new Error();
1437
- t.DefaultValueJson = r.asString();
1435
+ case Vs: {
1436
+ if (s.isNull) throw new Error();
1437
+ t.DefaultValueJson = s.asString();
1438
1438
  break;
1439
1439
  }
1440
- case Vr: {
1441
- if (r.isNull) throw new Error();
1442
- t.EnumerableItemTypeName = r.asString();
1440
+ case Gs: {
1441
+ if (s.isNull) throw new Error();
1442
+ t.EnumerableItemTypeName = s.asString();
1443
1443
  break;
1444
1444
  }
1445
- case Gr: {
1446
- if (r.isNull) throw new Error();
1447
- t.Description = r.asString();
1445
+ case xs: {
1446
+ if (s.isNull) throw new Error();
1447
+ t.Description = s.asString();
1448
1448
  break;
1449
1449
  }
1450
- case xr: {
1451
- if (r.isNull) throw new Error();
1452
- t.DefaultValueData = r.asBinary();
1450
+ case Hs: {
1451
+ if (s.isNull) throw new Error();
1452
+ t.DefaultValueData = s.asBinary();
1453
1453
  break;
1454
1454
  }
1455
- case Hr: {
1456
- if (r.isNull) throw new Error();
1457
- t.IsEnumerable = r.asBool();
1455
+ case Ys: {
1456
+ if (s.isNull) throw new Error();
1457
+ t.IsEnumerable = s.asBool();
1458
1458
  break;
1459
1459
  }
1460
- case Yr: {
1461
- if (r.isNull) throw new Error();
1462
- t.TypeName = r.asString();
1460
+ case Ws: {
1461
+ if (s.isNull) throw new Error();
1462
+ t.TypeName = s.asString();
1463
1463
  break;
1464
1464
  }
1465
- case Wr: {
1466
- if (r.isNull) throw new Error();
1467
- t.ParameterName = r.asString();
1465
+ case Ks: {
1466
+ if (s.isNull) throw new Error();
1467
+ t.ParameterName = s.asString();
1468
1468
  break;
1469
1469
  }
1470
- case Kr: {
1471
- if (r.isNull) throw new Error();
1472
- t.ParameterIndex = r.asInt32();
1470
+ case $s: {
1471
+ if (s.isNull) throw new Error();
1472
+ t.ParameterIndex = s.asInt32();
1473
1473
  break;
1474
1474
  }
1475
1475
  }
1476
1476
  }
1477
- const zr = 3167053791, Jr = 3342364356, qr = 3612929027;
1478
- function be(e) {
1477
+ const Js = 3167053791, qs = 3342364356, Qs = 3612929027;
1478
+ function Fe(e) {
1479
1479
  const t = {};
1480
- return Fe(t), t;
1480
+ return Pe(t), t;
1481
1481
  }
1482
- function Fe(e) {
1483
- return e.Category = "", e.Type = de.Face, e.FaceBlendshapes = [], e;
1482
+ function Pe(e) {
1483
+ return e.Category = "", e.Type = Ae.Face, e.FaceBlendshapes = [], e;
1484
1484
  }
1485
- function Qr(e, t) {
1486
- const r = t ?? be();
1487
- return Fe(r), Zr(e, r), r;
1485
+ function Zs(e, t) {
1486
+ const s = t ?? Fe();
1487
+ return Pe(s), er(e, s), s;
1488
1488
  }
1489
- function Zr(e, t) {
1490
- let r;
1491
- for (; (r = e.next()) !== null; )
1492
- switch (r.fieldId) {
1493
- case zr: {
1494
- if (r.isNull) throw new Error();
1495
- t.Type = r.asInt32();
1489
+ function er(e, t) {
1490
+ let s;
1491
+ for (; (s = e.next()) !== null; )
1492
+ switch (s.fieldId) {
1493
+ case Js: {
1494
+ if (s.isNull) throw new Error();
1495
+ t.Type = s.asInt32();
1496
1496
  break;
1497
1497
  }
1498
- case Jr: {
1499
- if (r.isNull) throw new Error();
1500
- t.FaceBlendshapes = es(r.asArray());
1498
+ case qs: {
1499
+ if (s.isNull) throw new Error();
1500
+ t.FaceBlendshapes = tr(s.asArray());
1501
1501
  break;
1502
1502
  }
1503
- case qr: {
1504
- if (r.isNull) throw new Error();
1505
- t.Category = r.asString();
1503
+ case Qs: {
1504
+ if (s.isNull) throw new Error();
1505
+ t.Category = s.asString();
1506
1506
  break;
1507
1507
  }
1508
1508
  }
1509
1509
  }
1510
- function es(e) {
1510
+ function tr(e) {
1511
1511
  const t = [];
1512
- let r;
1513
- for (; (r = e.next()) !== null; )
1514
- t.push(r.asString());
1512
+ let s;
1513
+ for (; (s = e.next()) !== null; )
1514
+ t.push(s.asString());
1515
1515
  return t;
1516
1516
  }
1517
- const ts = 1405462580, rs = 2968276160;
1518
- function ss(e) {
1517
+ const sr = 1405462580, rr = 2968276160;
1518
+ function nr(e) {
1519
1519
  const t = {};
1520
- return Pe(t), t;
1520
+ return pe(t), t;
1521
1521
  }
1522
- function Pe(e) {
1522
+ function pe(e) {
1523
1523
  return e.MimeType = "", e.Value = new Uint8Array(0), e;
1524
1524
  }
1525
- function ns(e, t) {
1526
- const r = t ?? ss();
1527
- return Pe(r), is(e, r), r;
1525
+ function ir(e, t) {
1526
+ const s = t ?? nr();
1527
+ return pe(s), or(e, s), s;
1528
1528
  }
1529
- function is(e, t) {
1530
- let r;
1531
- for (; (r = e.next()) !== null; )
1532
- switch (r.fieldId) {
1533
- case ts: {
1534
- if (r.isNull) throw new Error();
1535
- t.Value = r.asBinary();
1529
+ function or(e, t) {
1530
+ let s;
1531
+ for (; (s = e.next()) !== null; )
1532
+ switch (s.fieldId) {
1533
+ case sr: {
1534
+ if (s.isNull) throw new Error();
1535
+ t.Value = s.asBinary();
1536
1536
  break;
1537
1537
  }
1538
- case rs: {
1539
- if (r.isNull) throw new Error();
1540
- t.MimeType = r.asString();
1538
+ case rr: {
1539
+ if (s.isNull) throw new Error();
1540
+ t.MimeType = s.asString();
1541
1541
  break;
1542
1542
  }
1543
1543
  }
1544
1544
  }
1545
- const os = 3612929027;
1546
- function pe(e) {
1545
+ const ke = 1, ar = 1048655, lr = 3469892363;
1546
+ function Ir(e) {
1547
+ const t = new k(ke);
1548
+ return Er(e, t), t.finish();
1549
+ }
1550
+ function Er(e, t) {
1551
+ t.writeInt32Field(lr, e.TrackId | 0);
1552
+ }
1553
+ function _r(e, t, s) {
1554
+ const r = Ir(e);
1555
+ return he(ar, r, ke, t, s);
1556
+ }
1557
+ const hr = 3612929027;
1558
+ function Me(e) {
1547
1559
  const t = {};
1548
- return ke(t), t;
1560
+ return ve(t), t;
1549
1561
  }
1550
- function ke(e) {
1562
+ function ve(e) {
1551
1563
  return e.Category = "", e;
1552
1564
  }
1553
- function as(e, t) {
1554
- const r = t ?? pe();
1555
- return ke(r), ls(e, r), r;
1565
+ function ur(e, t) {
1566
+ const s = t ?? Me();
1567
+ return ve(s), cr(e, s), s;
1556
1568
  }
1557
- function ls(e, t) {
1558
- let r;
1559
- for (; (r = e.next()) !== null; )
1560
- switch (r.fieldId) {
1561
- case os: {
1562
- if (r.isNull) throw new Error();
1563
- t.Category = r.asString();
1569
+ function cr(e, t) {
1570
+ let s;
1571
+ for (; (s = e.next()) !== null; )
1572
+ switch (s.fieldId) {
1573
+ case hr: {
1574
+ if (s.isNull) throw new Error();
1575
+ t.Category = s.asString();
1564
1576
  break;
1565
1577
  }
1566
1578
  }
1567
1579
  }
1568
- const Is = 2097188, Es = 979822885, _s = 2374537704;
1569
- function hs(e) {
1580
+ const fr = 2097188, Tr = 979822885, Sr = 2374537704;
1581
+ function dr(e) {
1570
1582
  const t = {};
1571
- return ve(t), t;
1583
+ return Be(t), t;
1572
1584
  }
1573
- function ve(e) {
1585
+ function Be(e) {
1574
1586
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
1575
1587
  }
1576
- function us(e, t) {
1577
- const r = O.create(e);
1578
- return cs(r, t);
1588
+ function Ar(e, t) {
1589
+ const s = O.create(e);
1590
+ return Nr(s, t);
1579
1591
  }
1580
- function cs(e, t) {
1581
- const r = t ?? hs();
1582
- return ve(r), fs(e, r), r;
1592
+ function Nr(e, t) {
1593
+ const s = t ?? dr();
1594
+ return Be(s), yr(e, s), s;
1583
1595
  }
1584
- function fs(e, t) {
1585
- let r;
1586
- for (; (r = e.next()) !== null; )
1587
- switch (r.fieldId) {
1588
- case Es: {
1589
- if (r.isNull) throw new Error();
1590
- t.StyleId = r.asString();
1596
+ function yr(e, t) {
1597
+ let s;
1598
+ for (; (s = e.next()) !== null; )
1599
+ switch (s.fieldId) {
1600
+ case Tr: {
1601
+ if (s.isNull) throw new Error();
1602
+ t.StyleId = s.asString();
1591
1603
  break;
1592
1604
  }
1593
- case _s: {
1594
- if (r.isNull) throw new Error();
1595
- t.Style = Ss(r.asDictionary());
1605
+ case Sr: {
1606
+ if (s.isNull) throw new Error();
1607
+ t.Style = Cr(s.asDictionary());
1596
1608
  break;
1597
1609
  }
1598
1610
  }
1599
1611
  }
1600
- async function Ts(e, t) {
1601
- const r = await V(e, Is);
1602
- return us(r, t);
1612
+ async function wr(e, t) {
1613
+ const s = await G(e, fr);
1614
+ return Ar(s, t);
1603
1615
  }
1604
- function Ss(e) {
1616
+ function Cr(e) {
1605
1617
  const t = /* @__PURE__ */ Object.create(null);
1606
- let r;
1607
- for (; (r = e.next()) !== null; ) {
1608
- const s = r.key.asString();
1609
- t[s] = r.value.asString();
1618
+ let s;
1619
+ for (; (s = e.next()) !== null; ) {
1620
+ const r = s.key.asString();
1621
+ t[r] = s.value.asString();
1610
1622
  }
1611
1623
  return t;
1612
1624
  }
1613
- const ds = 2097192, As = 2136687806;
1614
- function Ns(e) {
1625
+ const Ur = 2097192, Rr = 2136687806;
1626
+ function Dr(e) {
1615
1627
  const t = {};
1616
- return Me(t), t;
1628
+ return Ve(t), t;
1617
1629
  }
1618
- function Me(e) {
1630
+ function Ve(e) {
1619
1631
  return e.Styles = [], e;
1620
1632
  }
1621
- function ys(e, t) {
1622
- const r = O.create(e);
1623
- return ws(r, t);
1633
+ function Lr(e, t) {
1634
+ const s = O.create(e);
1635
+ return mr(s, t);
1624
1636
  }
1625
- function ws(e, t) {
1626
- const r = t ?? Ns();
1627
- return Me(r), Cs(e, r), r;
1637
+ function mr(e, t) {
1638
+ const s = t ?? Dr();
1639
+ return Ve(s), Or(e, s), s;
1628
1640
  }
1629
- function Cs(e, t) {
1630
- let r;
1631
- for (; (r = e.next()) !== null; )
1632
- switch (r.fieldId) {
1633
- case As: {
1634
- if (r.isNull) throw new Error();
1635
- t.Styles = Rs(r.asArray());
1641
+ function Or(e, t) {
1642
+ let s;
1643
+ for (; (s = e.next()) !== null; )
1644
+ switch (s.fieldId) {
1645
+ case Rr: {
1646
+ if (s.isNull) throw new Error();
1647
+ t.Styles = br(s.asArray());
1636
1648
  break;
1637
1649
  }
1638
1650
  }
1639
1651
  }
1640
- async function Us(e, t) {
1641
- const r = await V(e, ds);
1642
- return ys(r, t);
1652
+ async function gr(e, t) {
1653
+ const s = await G(e, Ur);
1654
+ return Lr(s, t);
1643
1655
  }
1644
- function Rs(e) {
1656
+ function br(e) {
1645
1657
  const t = [];
1646
- let r;
1647
- for (; (r = e.next()) !== null; )
1648
- t.push(Os(r.asObject()));
1658
+ let s;
1659
+ for (; (s = e.next()) !== null; )
1660
+ t.push(kr(s.asObject()));
1649
1661
  return t;
1650
1662
  }
1651
- const Ds = 979822885, Ls = 2374537704;
1652
- function ms(e) {
1663
+ const Fr = 979822885, Pr = 2374537704;
1664
+ function pr(e) {
1653
1665
  const t = {};
1654
- return Be(t), t;
1666
+ return Ge(t), t;
1655
1667
  }
1656
- function Be(e) {
1668
+ function Ge(e) {
1657
1669
  return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
1658
1670
  }
1659
- function Os(e, t) {
1660
- const r = t ?? ms();
1661
- return Be(r), gs(e, r), r;
1671
+ function kr(e, t) {
1672
+ const s = t ?? pr();
1673
+ return Ge(s), Mr(e, s), s;
1662
1674
  }
1663
- function gs(e, t) {
1664
- let r;
1665
- for (; (r = e.next()) !== null; )
1666
- switch (r.fieldId) {
1667
- case Ds: {
1668
- if (r.isNull) throw new Error();
1669
- t.StyleId = r.asString();
1675
+ function Mr(e, t) {
1676
+ let s;
1677
+ for (; (s = e.next()) !== null; )
1678
+ switch (s.fieldId) {
1679
+ case Fr: {
1680
+ if (s.isNull) throw new Error();
1681
+ t.StyleId = s.asString();
1670
1682
  break;
1671
1683
  }
1672
- case Ls: {
1673
- if (r.isNull) throw new Error();
1674
- t.Style = bs(r.asDictionary());
1684
+ case Pr: {
1685
+ if (s.isNull) throw new Error();
1686
+ t.Style = vr(s.asDictionary());
1675
1687
  break;
1676
1688
  }
1677
1689
  }
1678
1690
  }
1679
- function bs(e) {
1691
+ function vr(e) {
1680
1692
  const t = /* @__PURE__ */ Object.create(null);
1681
- let r;
1682
- for (; (r = e.next()) !== null; ) {
1683
- const s = r.key.asString();
1684
- t[s] = r.value.asString();
1693
+ let s;
1694
+ for (; (s = e.next()) !== null; ) {
1695
+ const r = s.key.asString();
1696
+ t[r] = s.value.asString();
1685
1697
  }
1686
1698
  return t;
1687
1699
  }
1688
- const Fs = 2097193, Ps = 1415642792;
1689
- function ps(e) {
1700
+ const Br = 2097193, Vr = 1415642792;
1701
+ function Gr(e) {
1690
1702
  const t = {};
1691
- return Ve(t), t;
1703
+ return xe(t), t;
1692
1704
  }
1693
- function Ve(e) {
1705
+ function xe(e) {
1694
1706
  return e.StyleIds = [], e;
1695
1707
  }
1696
- function ks(e, t) {
1697
- const r = O.create(e);
1698
- return vs(r, t);
1708
+ function xr(e, t) {
1709
+ const s = O.create(e);
1710
+ return Hr(s, t);
1699
1711
  }
1700
- function vs(e, t) {
1701
- const r = t ?? ps();
1702
- return Ve(r), Ms(e, r), r;
1712
+ function Hr(e, t) {
1713
+ const s = t ?? Gr();
1714
+ return xe(s), Yr(e, s), s;
1703
1715
  }
1704
- function Ms(e, t) {
1705
- let r;
1706
- for (; (r = e.next()) !== null; )
1707
- switch (r.fieldId) {
1708
- case Ps: {
1709
- if (r.isNull) throw new Error();
1710
- t.StyleIds = Vs(r.asArray());
1716
+ function Yr(e, t) {
1717
+ let s;
1718
+ for (; (s = e.next()) !== null; )
1719
+ switch (s.fieldId) {
1720
+ case Vr: {
1721
+ if (s.isNull) throw new Error();
1722
+ t.StyleIds = Kr(s.asArray());
1711
1723
  break;
1712
1724
  }
1713
1725
  }
1714
1726
  }
1715
- async function Bs(e, t) {
1716
- const r = await V(e, Fs);
1717
- return ks(r, t);
1727
+ async function Wr(e, t) {
1728
+ const s = await G(e, Br);
1729
+ return xr(s, t);
1718
1730
  }
1719
- function Vs(e) {
1731
+ function Kr(e) {
1720
1732
  const t = [];
1721
- let r;
1722
- for (; (r = e.next()) !== null; )
1723
- t.push(r.asString());
1733
+ let s;
1734
+ for (; (s = e.next()) !== null; )
1735
+ t.push(s.asString());
1724
1736
  return t;
1725
1737
  }
1726
- const Gs = 2097190, xs = 425183262, Hs = 653781469;
1727
- function Ys(e) {
1738
+ const $r = 2097190, Xr = 425183262, jr = 653781469;
1739
+ function zr(e) {
1728
1740
  const t = {};
1729
- return Ge(t), t;
1741
+ return He(t), t;
1730
1742
  }
1731
- function Ge(e) {
1743
+ function He(e) {
1732
1744
  return e.Json = "", e.Payloads = /* @__PURE__ */ Object.create(null), e;
1733
1745
  }
1734
- function Ws(e, t) {
1735
- const r = O.create(e);
1736
- return Ks(r, t);
1746
+ function Jr(e, t) {
1747
+ const s = O.create(e);
1748
+ return qr(s, t);
1737
1749
  }
1738
- function Ks(e, t) {
1739
- const r = t ?? Ys();
1740
- return Ge(r), $s(e, r), r;
1750
+ function qr(e, t) {
1751
+ const s = t ?? zr();
1752
+ return He(s), Qr(e, s), s;
1741
1753
  }
1742
- function $s(e, t) {
1743
- let r;
1744
- for (; (r = e.next()) !== null; )
1745
- switch (r.fieldId) {
1746
- case xs: {
1747
- if (r.isNull) throw new Error();
1748
- t.Json = r.asString();
1754
+ function Qr(e, t) {
1755
+ let s;
1756
+ for (; (s = e.next()) !== null; )
1757
+ switch (s.fieldId) {
1758
+ case Xr: {
1759
+ if (s.isNull) throw new Error();
1760
+ t.Json = s.asString();
1749
1761
  break;
1750
1762
  }
1751
- case Hs: {
1752
- if (r.isNull) throw new Error();
1753
- t.Payloads = js(r.asDictionary());
1763
+ case jr: {
1764
+ if (s.isNull) throw new Error();
1765
+ t.Payloads = en(s.asDictionary());
1754
1766
  break;
1755
1767
  }
1756
1768
  }
1757
1769
  }
1758
- async function Xs(e, t) {
1759
- const r = await V(e, Gs);
1760
- return Ws(r, t);
1770
+ async function Zr(e, t) {
1771
+ const s = await G(e, $r);
1772
+ return Jr(s, t);
1761
1773
  }
1762
- function js(e) {
1774
+ function en(e) {
1763
1775
  const t = /* @__PURE__ */ Object.create(null);
1764
- let r;
1765
- for (; (r = e.next()) !== null; ) {
1766
- const s = r.key.asString();
1767
- t[s] = ns(r.value.asObject());
1776
+ let s;
1777
+ for (; (s = e.next()) !== null; ) {
1778
+ const r = s.key.asString();
1779
+ t[r] = ir(s.value.asObject());
1768
1780
  }
1769
1781
  return t;
1770
1782
  }
1771
- const xe = 1, zs = 1048636, Js = 2610786289;
1772
- function qs(e) {
1773
- const t = new G(xe);
1774
- return Qs(e, t), t.finish();
1783
+ const Ye = 1, tn = 1048636, sn = 2610786289;
1784
+ function rn(e) {
1785
+ const t = new k(Ye);
1786
+ return nn(e, t), t.finish();
1775
1787
  }
1776
- function Qs(e, t) {
1777
- t.writeUInt32Field(Js, e.Version >>> 0);
1788
+ function nn(e, t) {
1789
+ t.writeUInt32Field(sn, e.Version >>> 0);
1778
1790
  }
1779
- function Zs(e, t, r) {
1780
- const s = qs(e);
1781
- return ot(zs, s, xe, t, r);
1791
+ function on(e, t, s) {
1792
+ const r = rn(e);
1793
+ return he(tn, r, Ye, t, s);
1782
1794
  }
1783
- const en = 161083277, tn = 164808083, rn = 1368629611, sn = 2514959030, nn = 2745379226, on = 2950031986, an = 3282782683, ln = 3284746250, In = 4065070594;
1784
- function He(e) {
1795
+ const an = 161083277, ln = 164808083, In = 1368629611, En = 2514959030, _n = 2745379226, hn = 2950031986, un = 3282782683, cn = 3284746250, fn = 4065070594;
1796
+ function We(e) {
1785
1797
  const t = {};
1786
- return Ye(t), t;
1798
+ return Ke(t), t;
1787
1799
  }
1788
- function Ye(e) {
1789
- return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = ye.H264, e.CodecDetails = "", e.Width = 0, e.Height = 0, e.Framerate = 30, e.CorrelationId = void 0, e;
1800
+ function Ke(e) {
1801
+ return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = we.H264, e.CodecDetails = "", e.Width = 0, e.Height = 0, e.Framerate = 30, e.CorrelationId = void 0, e;
1790
1802
  }
1791
- function En(e, t) {
1792
- const r = t ?? He();
1793
- return Ye(r), _n(e, r), r;
1803
+ function Tn(e, t) {
1804
+ const s = t ?? We();
1805
+ return Ke(s), Sn(e, s), s;
1794
1806
  }
1795
- function _n(e, t) {
1796
- let r;
1797
- for (; (r = e.next()) !== null; )
1798
- switch (r.fieldId) {
1799
- case en: {
1800
- if (r.isNull) throw new Error();
1801
- t.StreamId = r.asString();
1807
+ function Sn(e, t) {
1808
+ let s;
1809
+ for (; (s = e.next()) !== null; )
1810
+ switch (s.fieldId) {
1811
+ case an: {
1812
+ if (s.isNull) throw new Error();
1813
+ t.StreamId = s.asString();
1802
1814
  break;
1803
1815
  }
1804
- case tn: {
1805
- if (r.isNull) throw new Error();
1806
- t.Framerate = r.asFloat64();
1816
+ case ln: {
1817
+ if (s.isNull) throw new Error();
1818
+ t.Framerate = s.asFloat64();
1807
1819
  break;
1808
1820
  }
1809
- case rn: {
1810
- if (r.isNull) throw new Error();
1811
- t.Description = r.asString();
1821
+ case In: {
1822
+ if (s.isNull) throw new Error();
1823
+ t.Description = s.asString();
1812
1824
  break;
1813
1825
  }
1814
- case sn: {
1815
- if (r.isNull) {
1826
+ case En: {
1827
+ if (s.isNull) {
1816
1828
  t.CorrelationId = void 0;
1817
1829
  break;
1818
1830
  }
1819
- t.CorrelationId = r.asString();
1831
+ t.CorrelationId = s.asString();
1820
1832
  break;
1821
1833
  }
1822
- case nn: {
1823
- if (r.isNull) throw new Error();
1824
- t.CodecDetails = r.asString();
1834
+ case _n: {
1835
+ if (s.isNull) throw new Error();
1836
+ t.CodecDetails = s.asString();
1825
1837
  break;
1826
1838
  }
1827
- case on: {
1828
- if (r.isNull) throw new Error();
1829
- t.Height = r.asInt32();
1839
+ case hn: {
1840
+ if (s.isNull) throw new Error();
1841
+ t.Height = s.asInt32();
1830
1842
  break;
1831
1843
  }
1832
- case an: {
1833
- if (r.isNull) throw new Error();
1834
- t.SourceType = r.asString();
1844
+ case un: {
1845
+ if (s.isNull) throw new Error();
1846
+ t.SourceType = s.asString();
1835
1847
  break;
1836
1848
  }
1837
- case ln: {
1838
- if (r.isNull) throw new Error();
1839
- t.Codec = r.asInt32();
1849
+ case cn: {
1850
+ if (s.isNull) throw new Error();
1851
+ t.Codec = s.asInt32();
1840
1852
  break;
1841
1853
  }
1842
- case In: {
1843
- if (r.isNull) throw new Error();
1844
- t.Width = r.asInt32();
1854
+ case fn: {
1855
+ if (s.isNull) throw new Error();
1856
+ t.Width = s.asInt32();
1845
1857
  break;
1846
1858
  }
1847
1859
  }
1848
1860
  }
1849
- const hn = 65539, un = 693643444, cn = 976837618, fn = 1144553441, Tn = 1497620243, Sn = 1559330978, dn = 1976546434, An = 2271236852, Nn = 2277643855, yn = 2469008121, wn = 3042922213, Cn = 3064612128, Un = 3219210453, Rn = 3504054055, Dn = 3678477544, Ln = 3696445035, mn = 3707543140, On = 3712281496, gn = 3895362455, bn = 3897397815, Fn = 3914217035, Pn = 4225107827;
1850
- function pn(e) {
1861
+ const dn = 65539, An = 693643444, Nn = 976837618, yn = 1144553441, wn = 1497620243, Cn = 1559330978, Un = 1976546434, Rn = 2271236852, Dn = 2277643855, Ln = 2469008121, mn = 3042922213, On = 3064612128, gn = 3219210453, bn = 3504054055, Fn = 3678477544, Pn = 3696445035, pn = 3707543140, kn = 3712281496, Mn = 3895362455, vn = 3897397815, Bn = 3914217035, Vn = 4225107827;
1862
+ function Gn(e) {
1851
1863
  const t = {};
1852
- return We(t), t;
1864
+ return $e(t), t;
1853
1865
  }
1854
- function We(e) {
1855
- return e.Clients = /* @__PURE__ */ Object.create(null), e.Functions = /* @__PURE__ */ Object.create(null), e.UIStreams = /* @__PURE__ */ Object.create(null), e.AudioStreams = /* @__PURE__ */ Object.create(null), e.VideoStreams = /* @__PURE__ */ Object.create(null), e.TrackingStreams = /* @__PURE__ */ Object.create(null), e.SpaceId = "", e.ChannelId = "", e.ServerSessionId = "", e.SessionHash = "", e.ChannelUrl = "", e.SessionChannelUrl = "", e.FirstUserId = "", e.PrimaryUserId = "", e.OrganisationName = "", e.SpaceName = "", e.ChannelName = "", e.ServerRunType = Ce.Local, e.AppSourceType = Ue.Bundle, e.PublicAccess = !1, e.DebugMode = !1, e;
1866
+ function $e(e) {
1867
+ return e.Clients = /* @__PURE__ */ Object.create(null), e.Functions = /* @__PURE__ */ Object.create(null), e.UIStreams = /* @__PURE__ */ Object.create(null), e.AudioStreams = /* @__PURE__ */ Object.create(null), e.VideoStreams = /* @__PURE__ */ Object.create(null), e.TrackingStreams = /* @__PURE__ */ Object.create(null), e.SpaceId = "", e.ChannelId = "", e.ServerSessionId = "", e.SessionHash = "", e.ChannelUrl = "", e.SessionChannelUrl = "", e.FirstUserId = "", e.PrimaryUserId = "", e.OrganisationName = "", e.SpaceName = "", e.ChannelName = "", e.ServerRunType = Ue.Local, e.AppSourceType = Re.Bundle, e.PublicAccess = !1, e.DebugMode = !1, e;
1856
1868
  }
1857
- function kn(e, t) {
1858
- const r = O.create(e);
1859
- return vn(r, t);
1869
+ function xn(e, t) {
1870
+ const s = O.create(e);
1871
+ return Hn(s, t);
1860
1872
  }
1861
- function vn(e, t) {
1862
- const r = t ?? pn();
1863
- return We(r), Mn(e, r), r;
1873
+ function Hn(e, t) {
1874
+ const s = t ?? Gn();
1875
+ return $e(s), Yn(e, s), s;
1864
1876
  }
1865
- function Mn(e, t) {
1866
- let r;
1867
- for (; (r = e.next()) !== null; )
1868
- switch (r.fieldId) {
1869
- case un: {
1870
- if (r.isNull) throw new Error();
1871
- t.FirstUserId = r.asString();
1872
- break;
1873
- }
1874
- case cn: {
1875
- if (r.isNull) throw new Error();
1876
- t.SessionHash = r.asString();
1877
- break;
1878
- }
1879
- case fn: {
1880
- if (r.isNull) throw new Error();
1881
- t.Clients = Vn(r.asDictionary());
1882
- break;
1883
- }
1884
- case Tn: {
1885
- if (r.isNull) throw new Error();
1886
- t.TrackingStreams = Gn(r.asDictionary());
1887
- break;
1888
- }
1889
- case Sn: {
1890
- if (r.isNull) throw new Error();
1891
- t.ChannelId = r.asString();
1892
- break;
1893
- }
1894
- case dn: {
1895
- if (r.isNull) throw new Error();
1896
- t.AppSourceType = r.asInt32();
1897
- break;
1898
- }
1877
+ function Yn(e, t) {
1878
+ let s;
1879
+ for (; (s = e.next()) !== null; )
1880
+ switch (s.fieldId) {
1899
1881
  case An: {
1900
- if (r.isNull) throw new Error();
1901
- t.SessionChannelUrl = r.asString();
1882
+ if (s.isNull) throw new Error();
1883
+ t.FirstUserId = s.asString();
1902
1884
  break;
1903
1885
  }
1904
1886
  case Nn: {
1905
- if (r.isNull) throw new Error();
1906
- t.ChannelUrl = r.asString();
1887
+ if (s.isNull) throw new Error();
1888
+ t.SessionHash = s.asString();
1907
1889
  break;
1908
1890
  }
1909
1891
  case yn: {
1910
- if (r.isNull) throw new Error();
1911
- t.ChannelName = r.asString();
1892
+ if (s.isNull) throw new Error();
1893
+ t.Clients = Kn(s.asDictionary());
1912
1894
  break;
1913
1895
  }
1914
1896
  case wn: {
1915
- if (r.isNull) throw new Error();
1916
- t.PublicAccess = r.asBool();
1897
+ if (s.isNull) throw new Error();
1898
+ t.TrackingStreams = $n(s.asDictionary());
1917
1899
  break;
1918
1900
  }
1919
1901
  case Cn: {
1920
- if (r.isNull) throw new Error();
1921
- t.ServerRunType = r.asInt32();
1902
+ if (s.isNull) throw new Error();
1903
+ t.ChannelId = s.asString();
1922
1904
  break;
1923
1905
  }
1924
1906
  case Un: {
1925
- if (r.isNull) throw new Error();
1926
- t.OrganisationName = r.asString();
1907
+ if (s.isNull) throw new Error();
1908
+ t.AppSourceType = s.asInt32();
1927
1909
  break;
1928
1910
  }
1929
1911
  case Rn: {
1930
- if (r.isNull) throw new Error();
1931
- t.DebugMode = r.asBool();
1912
+ if (s.isNull) throw new Error();
1913
+ t.SessionChannelUrl = s.asString();
1932
1914
  break;
1933
1915
  }
1934
1916
  case Dn: {
1935
- if (r.isNull) throw new Error();
1936
- t.Functions = xn(r.asDictionary());
1917
+ if (s.isNull) throw new Error();
1918
+ t.ChannelUrl = s.asString();
1937
1919
  break;
1938
1920
  }
1939
1921
  case Ln: {
1940
- if (r.isNull) throw new Error();
1941
- t.UIStreams = Hn(r.asDictionary());
1922
+ if (s.isNull) throw new Error();
1923
+ t.ChannelName = s.asString();
1942
1924
  break;
1943
1925
  }
1944
1926
  case mn: {
1945
- if (r.isNull) throw new Error();
1946
- t.SpaceId = r.asString();
1927
+ if (s.isNull) throw new Error();
1928
+ t.PublicAccess = s.asBool();
1947
1929
  break;
1948
1930
  }
1949
1931
  case On: {
1950
- if (r.isNull) throw new Error();
1951
- t.PrimaryUserId = r.asString();
1932
+ if (s.isNull) throw new Error();
1933
+ t.ServerRunType = s.asInt32();
1952
1934
  break;
1953
1935
  }
1954
1936
  case gn: {
1955
- if (r.isNull) throw new Error();
1956
- t.AudioStreams = Yn(r.asDictionary());
1937
+ if (s.isNull) throw new Error();
1938
+ t.OrganisationName = s.asString();
1957
1939
  break;
1958
1940
  }
1959
1941
  case bn: {
1960
- if (r.isNull) throw new Error();
1961
- t.VideoStreams = Wn(r.asDictionary());
1942
+ if (s.isNull) throw new Error();
1943
+ t.DebugMode = s.asBool();
1962
1944
  break;
1963
1945
  }
1964
1946
  case Fn: {
1965
- if (r.isNull) throw new Error();
1966
- t.ServerSessionId = r.asString();
1947
+ if (s.isNull) throw new Error();
1948
+ t.Functions = Xn(s.asDictionary());
1967
1949
  break;
1968
1950
  }
1969
1951
  case Pn: {
1970
- if (r.isNull) throw new Error();
1971
- t.SpaceName = r.asString();
1952
+ if (s.isNull) throw new Error();
1953
+ t.UIStreams = jn(s.asDictionary());
1954
+ break;
1955
+ }
1956
+ case pn: {
1957
+ if (s.isNull) throw new Error();
1958
+ t.SpaceId = s.asString();
1959
+ break;
1960
+ }
1961
+ case kn: {
1962
+ if (s.isNull) throw new Error();
1963
+ t.PrimaryUserId = s.asString();
1964
+ break;
1965
+ }
1966
+ case Mn: {
1967
+ if (s.isNull) throw new Error();
1968
+ t.AudioStreams = zn(s.asDictionary());
1969
+ break;
1970
+ }
1971
+ case vn: {
1972
+ if (s.isNull) throw new Error();
1973
+ t.VideoStreams = Jn(s.asDictionary());
1974
+ break;
1975
+ }
1976
+ case Bn: {
1977
+ if (s.isNull) throw new Error();
1978
+ t.ServerSessionId = s.asString();
1979
+ break;
1980
+ }
1981
+ case Vn: {
1982
+ if (s.isNull) throw new Error();
1983
+ t.SpaceName = s.asString();
1972
1984
  break;
1973
1985
  }
1974
1986
  }
1975
1987
  }
1976
- async function Bn(e, t) {
1977
- const r = await V(e, hn);
1978
- return kn(r, t);
1988
+ async function Wn(e, t) {
1989
+ const s = await G(e, dn);
1990
+ return xn(s, t);
1979
1991
  }
1980
- function Vn(e) {
1992
+ function Kn(e) {
1981
1993
  const t = /* @__PURE__ */ Object.create(null);
1982
- let r;
1983
- for (; (r = e.next()) !== null; ) {
1984
- const s = r.key.asInt32();
1985
- t[s] = Sr(r.value.asObject());
1994
+ let s;
1995
+ for (; (s = e.next()) !== null; ) {
1996
+ const r = s.key.asInt32();
1997
+ t[r] = ds(s.value.asObject());
1986
1998
  }
1987
1999
  return t;
1988
2000
  }
1989
- function Gn(e) {
2001
+ function $n(e) {
1990
2002
  const t = /* @__PURE__ */ Object.create(null);
1991
- let r;
1992
- for (; (r = e.next()) !== null; ) {
1993
- const s = r.key.asString();
1994
- t[s] = di(r.value.asObject());
2003
+ let s;
2004
+ for (; (s = e.next()) !== null; ) {
2005
+ const r = s.key.asString();
2006
+ t[r] = Ui(s.value.asObject());
1995
2007
  }
1996
2008
  return t;
1997
2009
  }
1998
- function xn(e) {
2010
+ function Xn(e) {
1999
2011
  const t = /* @__PURE__ */ Object.create(null);
2000
- let r;
2001
- for (; (r = e.next()) !== null; ) {
2002
- const s = r.key.asInt32();
2003
- t[s] = Kn(r.value.asArray());
2012
+ let s;
2013
+ for (; (s = e.next()) !== null; ) {
2014
+ const r = s.key.asInt32();
2015
+ t[r] = qn(s.value.asArray());
2004
2016
  }
2005
2017
  return t;
2006
2018
  }
2007
- function Hn(e) {
2019
+ function jn(e) {
2008
2020
  const t = /* @__PURE__ */ Object.create(null);
2009
- let r;
2010
- for (; (r = e.next()) !== null; ) {
2011
- const s = r.key.asString();
2012
- t[s] = qn(r.value.asObject());
2021
+ let s;
2022
+ for (; (s = e.next()) !== null; ) {
2023
+ const r = s.key.asString();
2024
+ t[r] = ri(s.value.asObject());
2013
2025
  }
2014
2026
  return t;
2015
2027
  }
2016
- function Yn(e) {
2028
+ function zn(e) {
2017
2029
  const t = /* @__PURE__ */ Object.create(null);
2018
- let r;
2019
- for (; (r = e.next()) !== null; ) {
2020
- const s = r.key.asString();
2021
- t[s] = ni(r.value.asObject());
2030
+ let s;
2031
+ for (; (s = e.next()) !== null; ) {
2032
+ const r = s.key.asString();
2033
+ t[r] = Ei(s.value.asObject());
2022
2034
  }
2023
2035
  return t;
2024
2036
  }
2025
- function Wn(e) {
2037
+ function Jn(e) {
2026
2038
  const t = /* @__PURE__ */ Object.create(null);
2027
- let r;
2028
- for (; (r = e.next()) !== null; ) {
2029
- const s = r.key.asString();
2030
- t[s] = _i(r.value.asObject());
2039
+ let s;
2040
+ for (; (s = e.next()) !== null; ) {
2041
+ const r = s.key.asString();
2042
+ t[r] = Si(s.value.asObject());
2031
2043
  }
2032
2044
  return t;
2033
2045
  }
2034
- function Kn(e) {
2046
+ function qn(e) {
2035
2047
  const t = [];
2036
- let r;
2037
- for (; (r = e.next()) !== null; )
2038
- t.push(Pr(r.asObject()));
2048
+ let s;
2049
+ for (; (s = e.next()) !== null; )
2050
+ t.push(ps(s.asObject()));
2039
2051
  return t;
2040
2052
  }
2041
- const $n = 161083277, Xn = 325678206, jn = 3469892363, zn = 3645544153;
2042
- function Jn(e) {
2053
+ const Qn = 161083277, Zn = 325678206, ei = 3469892363, ti = 3645544153;
2054
+ function si(e) {
2043
2055
  const t = {};
2044
- return Ke(t), t;
2056
+ return Xe(t), t;
2045
2057
  }
2046
- function Ke(e) {
2047
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = pe(), e;
2058
+ function Xe(e) {
2059
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Me(), e;
2048
2060
  }
2049
- function qn(e, t) {
2050
- const r = t ?? Jn();
2051
- return Ke(r), Qn(e, r), r;
2061
+ function ri(e, t) {
2062
+ const s = t ?? si();
2063
+ return Xe(s), ni(e, s), s;
2052
2064
  }
2053
- function Qn(e, t) {
2054
- let r;
2055
- for (; (r = e.next()) !== null; )
2056
- switch (r.fieldId) {
2057
- case $n: {
2058
- if (r.isNull) throw new Error();
2059
- t.StreamId = r.asString();
2065
+ function ni(e, t) {
2066
+ let s;
2067
+ for (; (s = e.next()) !== null; )
2068
+ switch (s.fieldId) {
2069
+ case Qn: {
2070
+ if (s.isNull) throw new Error();
2071
+ t.StreamId = s.asString();
2060
2072
  break;
2061
2073
  }
2062
- case Xn: {
2063
- if (r.isNull) throw new Error();
2064
- t.ClientSessionId = r.asInt32();
2074
+ case Zn: {
2075
+ if (s.isNull) throw new Error();
2076
+ t.ClientSessionId = s.asInt32();
2065
2077
  break;
2066
2078
  }
2067
- case jn: {
2068
- if (r.isNull) throw new Error();
2069
- t.TrackId = r.asInt32();
2079
+ case ei: {
2080
+ if (s.isNull) throw new Error();
2081
+ t.TrackId = s.asInt32();
2070
2082
  break;
2071
2083
  }
2072
- case zn: {
2073
- if (r.isNull) throw new Error();
2074
- t.Info = as(r.asObject());
2084
+ case ti: {
2085
+ if (s.isNull) throw new Error();
2086
+ t.Info = ur(s.asObject());
2075
2087
  break;
2076
2088
  }
2077
2089
  }
2078
2090
  }
2079
- const Zn = 161083277, ei = 325678206, ti = 3469892363, ri = 3645544153;
2080
- function si(e) {
2091
+ const ii = 161083277, oi = 325678206, ai = 3469892363, li = 3645544153;
2092
+ function Ii(e) {
2081
2093
  const t = {};
2082
- return $e(t), t;
2094
+ return je(t), t;
2083
2095
  }
2084
- function $e(e) {
2085
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Re(), e;
2096
+ function je(e) {
2097
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = De(), e;
2086
2098
  }
2087
- function ni(e, t) {
2088
- const r = t ?? si();
2089
- return $e(r), ii(e, r), r;
2099
+ function Ei(e, t) {
2100
+ const s = t ?? Ii();
2101
+ return je(s), _i(e, s), s;
2090
2102
  }
2091
- function ii(e, t) {
2092
- let r;
2093
- for (; (r = e.next()) !== null; )
2094
- switch (r.fieldId) {
2095
- case Zn: {
2096
- if (r.isNull) throw new Error();
2097
- t.StreamId = r.asString();
2103
+ function _i(e, t) {
2104
+ let s;
2105
+ for (; (s = e.next()) !== null; )
2106
+ switch (s.fieldId) {
2107
+ case ii: {
2108
+ if (s.isNull) throw new Error();
2109
+ t.StreamId = s.asString();
2098
2110
  break;
2099
2111
  }
2100
- case ei: {
2101
- if (r.isNull) throw new Error();
2102
- t.ClientSessionId = r.asInt32();
2112
+ case oi: {
2113
+ if (s.isNull) throw new Error();
2114
+ t.ClientSessionId = s.asInt32();
2103
2115
  break;
2104
2116
  }
2105
- case ti: {
2106
- if (r.isNull) throw new Error();
2107
- t.TrackId = r.asInt32();
2117
+ case ai: {
2118
+ if (s.isNull) throw new Error();
2119
+ t.TrackId = s.asInt32();
2108
2120
  break;
2109
2121
  }
2110
- case ri: {
2111
- if (r.isNull) throw new Error();
2112
- t.Info = Ut(r.asObject());
2122
+ case li: {
2123
+ if (s.isNull) throw new Error();
2124
+ t.Info = Rt(s.asObject());
2113
2125
  break;
2114
2126
  }
2115
2127
  }
2116
2128
  }
2117
- const oi = 161083277, ai = 325678206, li = 3469892363, Ii = 3645544153;
2118
- function Ei(e) {
2129
+ const hi = 161083277, ui = 325678206, ci = 3469892363, fi = 3645544153;
2130
+ function Ti(e) {
2119
2131
  const t = {};
2120
- return Xe(t), t;
2132
+ return ze(t), t;
2121
2133
  }
2122
- function Xe(e) {
2123
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = He(), e;
2134
+ function ze(e) {
2135
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = We(), e;
2124
2136
  }
2125
- function _i(e, t) {
2126
- const r = t ?? Ei();
2127
- return Xe(r), hi(e, r), r;
2137
+ function Si(e, t) {
2138
+ const s = t ?? Ti();
2139
+ return ze(s), di(e, s), s;
2128
2140
  }
2129
- function hi(e, t) {
2130
- let r;
2131
- for (; (r = e.next()) !== null; )
2132
- switch (r.fieldId) {
2133
- case oi: {
2134
- if (r.isNull) throw new Error();
2135
- t.StreamId = r.asString();
2141
+ function di(e, t) {
2142
+ let s;
2143
+ for (; (s = e.next()) !== null; )
2144
+ switch (s.fieldId) {
2145
+ case hi: {
2146
+ if (s.isNull) throw new Error();
2147
+ t.StreamId = s.asString();
2136
2148
  break;
2137
2149
  }
2138
- case ai: {
2139
- if (r.isNull) throw new Error();
2140
- t.ClientSessionId = r.asInt32();
2150
+ case ui: {
2151
+ if (s.isNull) throw new Error();
2152
+ t.ClientSessionId = s.asInt32();
2141
2153
  break;
2142
2154
  }
2143
- case li: {
2144
- if (r.isNull) throw new Error();
2145
- t.TrackId = r.asInt32();
2155
+ case ci: {
2156
+ if (s.isNull) throw new Error();
2157
+ t.TrackId = s.asInt32();
2146
2158
  break;
2147
2159
  }
2148
- case Ii: {
2149
- if (r.isNull) throw new Error();
2150
- t.Info = En(r.asObject());
2160
+ case fi: {
2161
+ if (s.isNull) throw new Error();
2162
+ t.Info = Tn(s.asObject());
2151
2163
  break;
2152
2164
  }
2153
2165
  }
2154
2166
  }
2155
- const ui = 161083277, ci = 325678206, fi = 3469892363, Ti = 3645544153;
2156
- function Si(e) {
2167
+ const Ai = 161083277, Ni = 325678206, yi = 3469892363, wi = 3645544153;
2168
+ function Ci(e) {
2157
2169
  const t = {};
2158
- return je(t), t;
2170
+ return Je(t), t;
2159
2171
  }
2160
- function je(e) {
2161
- return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = be(), e;
2172
+ function Je(e) {
2173
+ return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Fe(), e;
2162
2174
  }
2163
- function di(e, t) {
2164
- const r = t ?? Si();
2165
- return je(r), Ai(e, r), r;
2175
+ function Ui(e, t) {
2176
+ const s = t ?? Ci();
2177
+ return Je(s), Ri(e, s), s;
2166
2178
  }
2167
- function Ai(e, t) {
2168
- let r;
2169
- for (; (r = e.next()) !== null; )
2170
- switch (r.fieldId) {
2171
- case ui: {
2172
- if (r.isNull) throw new Error();
2173
- t.StreamId = r.asString();
2179
+ function Ri(e, t) {
2180
+ let s;
2181
+ for (; (s = e.next()) !== null; )
2182
+ switch (s.fieldId) {
2183
+ case Ai: {
2184
+ if (s.isNull) throw new Error();
2185
+ t.StreamId = s.asString();
2174
2186
  break;
2175
2187
  }
2176
- case ci: {
2177
- if (r.isNull) throw new Error();
2178
- t.ClientSessionId = r.asInt32();
2188
+ case Ni: {
2189
+ if (s.isNull) throw new Error();
2190
+ t.ClientSessionId = s.asInt32();
2179
2191
  break;
2180
2192
  }
2181
- case fi: {
2182
- if (r.isNull) throw new Error();
2183
- t.TrackId = r.asInt32();
2193
+ case yi: {
2194
+ if (s.isNull) throw new Error();
2195
+ t.TrackId = s.asInt32();
2184
2196
  break;
2185
2197
  }
2186
- case Ti: {
2187
- if (r.isNull) throw new Error();
2188
- t.Info = Qr(r.asObject());
2198
+ case wi: {
2199
+ if (s.isNull) throw new Error();
2200
+ t.Info = Zs(s.asObject());
2189
2201
  break;
2190
2202
  }
2191
2203
  }
@@ -2193,67 +2205,67 @@ function Ai(e, t) {
2193
2205
  function R(e) {
2194
2206
  return typeof e == "object" && e !== null && !Array.isArray(e);
2195
2207
  }
2196
- function ze(e) {
2197
- const t = {}, r = Object.keys(e);
2198
- for (let s = 0; s < r.length; s++) {
2199
- const n = r[s];
2208
+ function qe(e) {
2209
+ const t = {}, s = Object.keys(e);
2210
+ for (let r = 0; r < s.length; r++) {
2211
+ const n = s[r];
2200
2212
  t[n] = e[n];
2201
2213
  }
2202
2214
  return t;
2203
2215
  }
2204
- function Je(e, t, r, s) {
2205
- if (!(e === void 0 && s)) {
2216
+ function Qe(e, t, s, r) {
2217
+ if (!(e === void 0 && r)) {
2206
2218
  if (Array.isArray(e)) {
2207
2219
  const n = [];
2208
2220
  for (let i = 0; i < e.length; i++) {
2209
2221
  const o = e[i];
2210
2222
  if (typeof o != "string")
2211
- throw new Error(`Invalid styleIds entry at ${t}.styleIds[${i}] for element ${r}`);
2223
+ throw new Error(`Invalid styleIds entry at ${t}.styleIds[${i}] for element ${s}`);
2212
2224
  const a = o.trim();
2213
2225
  a.length !== 0 && n.push(a);
2214
2226
  }
2215
2227
  return n;
2216
2228
  }
2217
2229
  if (e != null)
2218
- throw new Error(`Invalid styleIds for element ${r}`);
2230
+ throw new Error(`Invalid styleIds for element ${s}`);
2219
2231
  return [];
2220
2232
  }
2221
2233
  }
2222
2234
  function oe(e, t) {
2223
2235
  if (!e || typeof e != "object")
2224
2236
  throw new Error(`Invalid UI node at ${t}`);
2225
- const r = e.Id, s = e.Type, n = e.Props, i = e.Children, o = e.StyleIds;
2226
- if (typeof r != "string")
2227
- throw new Error(`Invalid or missing node id at ${t}`);
2237
+ const s = e.Id, r = e.Type, n = e.Props, i = e.Children, o = e.StyleIds;
2228
2238
  if (typeof s != "string")
2229
- throw new Error(`Invalid or missing node type for ${r}`);
2239
+ throw new Error(`Invalid or missing node id at ${t}`);
2240
+ if (typeof r != "string")
2241
+ throw new Error(`Invalid or missing node type for ${s}`);
2230
2242
  let a = {};
2231
2243
  if (n != null) {
2232
2244
  if (!R(n))
2233
- throw new Error(`Invalid props for node ${r}`);
2234
- a = ze(n);
2245
+ throw new Error(`Invalid props for node ${s}`);
2246
+ a = qe(n);
2235
2247
  }
2236
2248
  let I = [];
2237
2249
  Array.isArray(i) && (I = i.map(
2238
2250
  (E, h) => oe(E ?? {}, `${t}.children[${h}]`)
2239
2251
  ));
2240
- const _ = Je(o, t, r, !1), l = typeof e.SourceMarker == "string" ? e.SourceMarker : void 0;
2252
+ const _ = Qe(o, t, s, !1), l = typeof e.SourceMarker == "string" ? e.SourceMarker : void 0;
2241
2253
  return {
2242
- id: r,
2243
- type: s,
2254
+ id: s,
2255
+ type: r,
2244
2256
  props: a,
2245
2257
  children: I,
2246
2258
  styleIds: _ ?? [],
2247
2259
  ...l ? { sourceMarker: l } : {}
2248
2260
  };
2249
2261
  }
2250
- function Ni(e, t) {
2262
+ function Di(e, t) {
2251
2263
  if (!R(e))
2252
2264
  throw new Error(`Invalid text delta at ${t}`);
2253
- const r = e.NodeId, s = e.PropertyName, n = e.Start, i = e.End, o = e.InsertedText;
2254
- if (typeof r != "string" || r.length === 0)
2255
- throw new Error(`Invalid text delta node id at ${t}`);
2265
+ const s = e.NodeId, r = e.PropertyName, n = e.Start, i = e.End, o = e.InsertedText;
2256
2266
  if (typeof s != "string" || s.length === 0)
2267
+ throw new Error(`Invalid text delta node id at ${t}`);
2268
+ if (typeof r != "string" || r.length === 0)
2257
2269
  throw new Error(`Invalid text delta property name at ${t}`);
2258
2270
  if (typeof n != "number" || !Number.isFinite(n))
2259
2271
  throw new Error(`Invalid text delta start at ${t}`);
@@ -2267,67 +2279,67 @@ function Ni(e, t) {
2267
2279
  } else if (i != null)
2268
2280
  throw new Error(`Invalid text delta end at ${t}`);
2269
2281
  return {
2270
- nodeId: r,
2271
- propertyName: s,
2282
+ nodeId: s,
2283
+ propertyName: r,
2272
2284
  start: n,
2273
2285
  end: a,
2274
2286
  insertedText: o
2275
2287
  };
2276
2288
  }
2277
- function yi(e, t) {
2289
+ function Li(e, t) {
2278
2290
  if (!R(e))
2279
2291
  throw new Error(`Invalid child insert at ${t}`);
2280
- const r = e.Index, s = e.Node;
2281
- if (typeof r != "number" || !Number.isFinite(r))
2292
+ const s = e.Index, r = e.Node;
2293
+ if (typeof s != "number" || !Number.isFinite(s))
2282
2294
  throw new Error(`Invalid child insert index at ${t}`);
2283
- if (!R(s))
2295
+ if (!R(r))
2284
2296
  throw new Error(`Invalid child insert node at ${t}`);
2285
2297
  return {
2286
- index: r,
2287
- node: oe(s, `${t}.node`)
2298
+ index: s,
2299
+ node: oe(r, `${t}.node`)
2288
2300
  };
2289
2301
  }
2290
- function wi(e, t) {
2302
+ function mi(e, t) {
2291
2303
  if (!R(e))
2292
2304
  throw new Error(`Invalid child move at ${t}`);
2293
- const r = e.NodeId, s = e.FromIndex, n = e.ToIndex;
2294
- if (typeof r != "string" || r.length === 0)
2305
+ const s = e.NodeId, r = e.FromIndex, n = e.ToIndex;
2306
+ if (typeof s != "string" || s.length === 0)
2295
2307
  throw new Error(`Invalid child move nodeId at ${t}`);
2296
- if (typeof s != "number" || !Number.isFinite(s))
2308
+ if (typeof r != "number" || !Number.isFinite(r))
2297
2309
  throw new Error(`Invalid child move fromIndex at ${t}`);
2298
2310
  if (typeof n != "number" || !Number.isFinite(n))
2299
2311
  throw new Error(`Invalid child move toIndex at ${t}`);
2300
2312
  return {
2301
- nodeId: r,
2302
- fromIndex: s,
2313
+ nodeId: s,
2314
+ fromIndex: r,
2303
2315
  toIndex: n
2304
2316
  };
2305
2317
  }
2306
- function Ci(e, t) {
2318
+ function Oi(e, t) {
2307
2319
  if (!R(e))
2308
2320
  throw new Error(`Invalid child remove at ${t}`);
2309
- const r = e.NodeId, s = e.Index;
2310
- if (typeof r != "string" || r.length === 0)
2321
+ const s = e.NodeId, r = e.Index;
2322
+ if (typeof s != "string" || s.length === 0)
2311
2323
  throw new Error(`Invalid child remove nodeId at ${t}`);
2312
- if (typeof s != "number" || !Number.isFinite(s))
2324
+ if (typeof r != "number" || !Number.isFinite(r))
2313
2325
  throw new Error(`Invalid child remove index at ${t}`);
2314
2326
  return {
2315
- nodeId: r,
2316
- index: s
2327
+ nodeId: s,
2328
+ index: r
2317
2329
  };
2318
2330
  }
2319
- function Ui(e, t) {
2331
+ function gi(e, t) {
2320
2332
  if (!R(e))
2321
2333
  throw new Error(`Invalid node change at ${t}`);
2322
- const r = e.nodeId;
2323
- if (typeof r != "string" || r.length === 0)
2334
+ const s = e.nodeId;
2335
+ if (typeof s != "string" || s.length === 0)
2324
2336
  throw new Error(`Invalid node change nodeId at ${t}`);
2325
- const s = Array.isArray(e.inserts) ? e.inserts.map(
2326
- (l, E) => yi(l ?? {}, `${t}.inserts[${E}]`)
2337
+ const r = Array.isArray(e.inserts) ? e.inserts.map(
2338
+ (l, E) => Li(l ?? {}, `${t}.inserts[${E}]`)
2327
2339
  ) : void 0, n = Array.isArray(e.moves) ? e.moves.map(
2328
- (l, E) => wi(l ?? {}, `${t}.moves[${E}]`)
2340
+ (l, E) => mi(l ?? {}, `${t}.moves[${E}]`)
2329
2341
  ) : void 0, i = Array.isArray(e.removals) ? e.removals.map(
2330
- (l, E) => Ci(l ?? {}, `${t}.removals[${E}]`)
2342
+ (l, E) => Oi(l ?? {}, `${t}.removals[${E}]`)
2331
2343
  ) : void 0;
2332
2344
  let o;
2333
2345
  if (R(e.changedProps)) {
@@ -2336,15 +2348,15 @@ function Ui(e, t) {
2336
2348
  if (!R(E))
2337
2349
  continue;
2338
2350
  const h = E.New;
2339
- h === void 0 ? o.set(l, void 0) : R(h) ? o.set(l, ze(h)) : o.set(l, h);
2351
+ h === void 0 ? o.set(l, void 0) : R(h) ? o.set(l, qe(h)) : o.set(l, h);
2340
2352
  }
2341
2353
  }
2342
2354
  const a = Array.isArray(e.textUpdates) ? e.textUpdates.map(
2343
- (l, E) => Ni(l ?? {}, `${t}.textUpdates[${E}]`)
2344
- ) : void 0, I = e.styleIds, _ = I !== void 0 ? Je(I, t, r, !0) : void 0;
2355
+ (l, E) => Di(l ?? {}, `${t}.textUpdates[${E}]`)
2356
+ ) : void 0, I = e.styleIds, _ = I !== void 0 ? Qe(I, t, s, !0) : void 0;
2345
2357
  return {
2346
- nodeId: r,
2347
- ...s && s.length > 0 ? { inserts: s } : {},
2358
+ nodeId: s,
2359
+ ...r && r.length > 0 ? { inserts: r } : {},
2348
2360
  ...n && n.length > 0 ? { moves: n } : {},
2349
2361
  ...i && i.length > 0 ? { removals: i } : {},
2350
2362
  ...o && o.size > 0 ? { changedProps: o } : {},
@@ -2352,60 +2364,60 @@ function Ui(e, t) {
2352
2364
  ..._ !== void 0 ? { styleIds: _ } : {}
2353
2365
  };
2354
2366
  }
2355
- function Ri(e) {
2367
+ function bi(e) {
2356
2368
  const t = /* @__PURE__ */ new Map();
2357
- for (const [r, s] of Object.entries(e))
2358
- t.set(r, s);
2369
+ for (const [s, r] of Object.entries(e))
2370
+ t.set(s, r);
2359
2371
  return t;
2360
2372
  }
2361
- function Di(e, t, r) {
2373
+ function Fi(e, t, s) {
2362
2374
  if (!e || typeof e != "object")
2363
2375
  throw new D("UI update graph is missing");
2364
- const s = oe(e, "graph");
2365
- if (s.type !== "root")
2376
+ const r = oe(e, "graph");
2377
+ if (r.type !== "root")
2366
2378
  throw new D('UI update root element must have type "root"');
2367
- const n = mi(s.props, t);
2379
+ const n = pi(r.props, t);
2368
2380
  return {
2369
2381
  type: "full",
2370
- version: r,
2371
- root: s,
2382
+ version: s,
2383
+ root: r,
2372
2384
  metadata: n
2373
2385
  };
2374
2386
  }
2375
- function Li(e, t, r) {
2387
+ function Pi(e, t, s) {
2376
2388
  if (!Array.isArray(e))
2377
2389
  throw new D("UI diff changes must be an array");
2378
2390
  if (!R(t))
2379
2391
  throw new D("UI diff metadata must be an object");
2380
- const s = t.viewId;
2381
- if (typeof s != "string" || s.length === 0)
2392
+ const r = t.viewId;
2393
+ if (typeof r != "string" || r.length === 0)
2382
2394
  throw new D("UI diff metadata is missing viewId");
2383
2395
  const n = e.map(
2384
- (a, I) => Ui(a ?? {}, `changes[${I}]`)
2396
+ (a, I) => gi(a ?? {}, `changes[${I}]`)
2385
2397
  ), i = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0, o = {
2386
- viewId: s,
2398
+ viewId: r,
2387
2399
  ...i !== void 0 ? { isUpdate: i } : {}
2388
2400
  };
2389
2401
  return {
2390
2402
  type: "diff",
2391
- version: r,
2403
+ version: s,
2392
2404
  changes: n,
2393
2405
  metadata: o
2394
2406
  };
2395
2407
  }
2396
- function mi(e, t) {
2397
- const r = e.viewId;
2398
- if (typeof r != "string" || r.length === 0)
2408
+ function pi(e, t) {
2409
+ const s = e.viewId;
2410
+ if (typeof s != "string" || s.length === 0)
2399
2411
  throw new D("UI update root is missing viewId");
2400
- let s = r, n = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0;
2401
- return R(t) && (typeof t.viewId == "string" && t.viewId.length > 0 && (s = t.viewId), typeof t.isUpdate == "boolean" && (n = t.isUpdate)), {
2402
- viewId: s,
2412
+ let r = s, n = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0;
2413
+ return R(t) && (typeof t.viewId == "string" && t.viewId.length > 0 && (r = t.viewId), typeof t.isUpdate == "boolean" && (n = t.isUpdate)), {
2414
+ viewId: r,
2403
2415
  ...n !== void 0 ? { isUpdate: n } : {}
2404
2416
  };
2405
2417
  }
2406
2418
  class D extends Error {
2407
- constructor(t, r) {
2408
- super(t), this.causeError = r, this.name = "UiUpdateParseError", r instanceof Error && (this.stack = r.stack);
2419
+ constructor(t, s) {
2420
+ super(t), this.causeError = s, this.name = "UiUpdateParseError", s instanceof Error && (this.stack = s.stack);
2409
2421
  }
2410
2422
  }
2411
2423
  function Ie(e) {
@@ -2417,84 +2429,84 @@ function Ie(e) {
2417
2429
  }
2418
2430
  if (!t || typeof t != "object")
2419
2431
  throw new D("UI update snapshot must be an object");
2420
- const { type: r, version: s } = t;
2421
- if (r !== "full" && r !== "diff")
2422
- throw new D(`Unknown UI update type: ${String(r)}`);
2423
- if (typeof s != "number")
2432
+ const { type: s, version: r } = t;
2433
+ if (s !== "full" && s !== "diff")
2434
+ throw new D(`Unknown UI update type: ${String(s)}`);
2435
+ if (typeof r != "number")
2424
2436
  throw new D("UI update version must be a number");
2425
- const n = r === "full" ? Di(t.graph, t.metadata, s) : Li(t.changes, t.metadata, s), i = e.Payloads ? Ri(e.Payloads) : /* @__PURE__ */ new Map();
2437
+ const n = s === "full" ? Fi(t.graph, t.metadata, r) : Pi(t.changes, t.metadata, r), i = e.Payloads ? bi(e.Payloads) : /* @__PURE__ */ new Map();
2426
2438
  return {
2427
2439
  snapshot: n,
2428
2440
  payloads: i
2429
2441
  };
2430
2442
  }
2431
- class Oi {
2443
+ class ki {
2432
2444
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2433
2445
  cache = /* @__PURE__ */ new Map();
2434
2446
  /**
2435
2447
  * Get a cached void handler (no payload) for a node/action combination.
2436
2448
  * Creates and caches the handler if it doesn't exist.
2437
2449
  */
2438
- getHandler(t, r, s) {
2439
- const n = `${t}:${r}`;
2450
+ getHandler(t, s, r) {
2451
+ const n = `${t}:${s}`;
2440
2452
  let i = this.cache.get(n);
2441
- return i || (i = () => s(r), this.cache.set(n, i)), i;
2453
+ return i || (i = () => r(s), this.cache.set(n, i)), i;
2442
2454
  }
2443
2455
  /**
2444
2456
  * Get a cached handler that accepts a payload.
2445
2457
  * Creates and caches the handler if it doesn't exist.
2446
2458
  */
2447
- getHandlerWithPayload(t, r, s) {
2448
- const n = `${t}:${r}:payload`;
2459
+ getHandlerWithPayload(t, s, r) {
2460
+ const n = `${t}:${s}:payload`;
2449
2461
  let i = this.cache.get(n);
2450
- return i || (i = (o) => s(r, o), this.cache.set(n, i)), i;
2462
+ return i || (i = (o) => r(s, o), this.cache.set(n, i)), i;
2451
2463
  }
2452
2464
  /**
2453
2465
  * Get a cached handler for boolean payloads.
2454
2466
  */
2455
- getBooleanHandler(t, r, s) {
2456
- return this.getHandlerWithPayload(t, r, s);
2467
+ getBooleanHandler(t, s, r) {
2468
+ return this.getHandlerWithPayload(t, s, r);
2457
2469
  }
2458
2470
  /**
2459
2471
  * Get a cached handler for string payloads.
2460
2472
  */
2461
- getStringHandler(t, r, s) {
2462
- return this.getHandlerWithPayload(t, r, s);
2473
+ getStringHandler(t, s, r) {
2474
+ return this.getHandlerWithPayload(t, s, r);
2463
2475
  }
2464
2476
  /**
2465
2477
  * Get a cached handler for number payloads.
2466
2478
  */
2467
- getNumberHandler(t, r, s) {
2468
- return this.getHandlerWithPayload(t, r, s);
2479
+ getNumberHandler(t, s, r) {
2480
+ return this.getHandlerWithPayload(t, s, r);
2469
2481
  }
2470
2482
  /**
2471
2483
  * Get a cached handler for number array payloads.
2472
2484
  */
2473
- getNumberArrayHandler(t, r, s) {
2474
- return this.getHandlerWithPayload(t, r, s);
2485
+ getNumberArrayHandler(t, s, r) {
2486
+ return this.getHandlerWithPayload(t, s, r);
2475
2487
  }
2476
2488
  /**
2477
2489
  * Get a cached handler for nullable boolean payloads.
2478
2490
  */
2479
- getNullableBooleanHandler(t, r, s) {
2480
- const n = `${t}:${r}:nullable-bool`;
2491
+ getNullableBooleanHandler(t, s, r) {
2492
+ const n = `${t}:${s}:nullable-bool`;
2481
2493
  let i = this.cache.get(n);
2482
- return i || (i = (o) => s(r, o ?? null), this.cache.set(n, i)), i;
2494
+ return i || (i = (o) => r(s, o ?? null), this.cache.set(n, i)), i;
2483
2495
  }
2484
2496
  /**
2485
2497
  * Invalidate all cached handlers for a specific node.
2486
2498
  * Call this when a node is removed from the tree.
2487
2499
  */
2488
2500
  invalidateNode(t) {
2489
- const r = `${t}:`;
2490
- for (const s of this.cache.keys())
2491
- s.startsWith(r) && this.cache.delete(s);
2501
+ const s = `${t}:`;
2502
+ for (const r of this.cache.keys())
2503
+ r.startsWith(s) && this.cache.delete(r);
2492
2504
  }
2493
2505
  /**
2494
2506
  * Invalidate a specific handler.
2495
2507
  */
2496
- invalidateHandler(t, r) {
2497
- this.cache.delete(`${t}:${r}`), this.cache.delete(`${t}:${r}:payload`), this.cache.delete(`${t}:${r}:nullable-bool`);
2508
+ invalidateHandler(t, s) {
2509
+ this.cache.delete(`${t}:${s}`), this.cache.delete(`${t}:${s}:payload`), this.cache.delete(`${t}:${s}:nullable-bool`);
2498
2510
  }
2499
2511
  /**
2500
2512
  * Clear all cached handlers.
@@ -2509,8 +2521,8 @@ class Oi {
2509
2521
  return this.cache.size;
2510
2522
  }
2511
2523
  }
2512
- const gi = Z("UiStreamStore");
2513
- class bi {
2524
+ const Mi = Z("UiStreamStore");
2525
+ class vi {
2514
2526
  views = /* @__PURE__ */ new Map();
2515
2527
  listeners = /* @__PURE__ */ new Set();
2516
2528
  payloads = /* @__PURE__ */ new Map();
@@ -2526,11 +2538,23 @@ class bi {
2526
2538
  changedNodeIds = /* @__PURE__ */ new Set();
2527
2539
  nodeVersions = /* @__PURE__ */ new Map();
2528
2540
  structureChanged = !1;
2541
+ // Set when a diff is dropped because it can no longer be reconciled against the local tree:
2542
+ // its version regressed, it jumped ahead of the local version (a missing intermediate diff),
2543
+ // or there is no base tree to apply it to. Consumed by the transport layer, which then asks the
2544
+ // server to resync this stream with a full snapshot.
2545
+ resyncNeeded = !1;
2529
2546
  // Dirty flags for lazy snapshot rebuilding - start true to ensure first snapshot builds correctly
2530
2547
  viewsDirty = !0;
2531
2548
  payloadsDirty = !0;
2532
2549
  // Handler cache for stable event handlers
2533
- handlerCache = new Oi();
2550
+ handlerCache = new ki();
2551
+ // id -> node lookup index for O(1) getNode. Rebuilt lazily from the committed snapshot's view
2552
+ // trees. Node trees are immutable (a change replaces every node on the changed path with a new
2553
+ // object and yields a new views Map), so the index is valid exactly while it points at the same
2554
+ // views Map instance: comparing that reference is a correct, allocation-free dirty check that
2555
+ // covers every mutation path (apply, replaceSnapshot, patchFromOp, clear) without touching them.
2556
+ nodeIndex = /* @__PURE__ */ new Map();
2557
+ indexedViews;
2534
2558
  apply(t) {
2535
2559
  if (this.snapshotMode) {
2536
2560
  if (t.snapshot.type !== "full")
@@ -2541,28 +2565,32 @@ class bi {
2541
2565
  version: -1
2542
2566
  };
2543
2567
  }
2544
- const { snapshot: r, payloads: s } = t, { metadata: n } = r, { viewId: i } = n;
2568
+ const { snapshot: s, payloads: r } = t, { metadata: n } = s, { viewId: i } = n;
2545
2569
  let o = this.views.get(i);
2546
2570
  o || (o = {
2547
2571
  version: 0
2548
2572
  }, this.views.set(i, o));
2549
- const a = r.type === "diff" && n.isUpdate === !0;
2550
- if (r.version < o.version || r.version === o.version && !a)
2573
+ const a = s.type === "diff" && n.isUpdate === !0;
2574
+ if (s.version < o.version)
2575
+ return this.resyncNeeded = !0, !1;
2576
+ if (s.type === "diff" && s.version > o.version + 1)
2577
+ return this.resyncNeeded = !0, !1;
2578
+ if (s.version === o.version && !a)
2551
2579
  return !1;
2552
2580
  let I = !1;
2553
2581
  this.rootViewId || (this.rootViewId = i, I = !0, this.structureChanged = !0);
2554
2582
  const _ = o.root;
2555
- if (r.type === "full")
2556
- o.root = r.root, o.version = r.version, I = !0, this.viewsDirty = !0, this.structureChanged = !0, r.root && B(r.root, this.changedNodeIds);
2583
+ if (s.type === "full")
2584
+ o.root = s.root, o.version = s.version, I = !0, this.viewsDirty = !0, this.structureChanged = !0, s.root && V(s.root, this.changedNodeIds);
2557
2585
  else {
2558
2586
  if (!_)
2559
- return !1;
2560
- const l = Pi(_, r.changes);
2561
- l !== _ ? (o.root = l, I = !0, this.viewsDirty = !0, j(_, l, this.changedNodeIds)) : o.root = l, o.version = r.version;
2587
+ return this.resyncNeeded = !0, !1;
2588
+ const l = Vi(_, s.changes);
2589
+ l !== _ ? (o.root = l, I = !0, this.viewsDirty = !0, j(_, l, this.changedNodeIds)) : o.root = l, o.version = s.version;
2562
2590
  }
2563
- for (const [l, E] of s)
2591
+ for (const [l, E] of r)
2564
2592
  this.payloads.get(l) !== E && (this.payloads.set(l, E), I = !0, this.payloadsDirty = !0);
2565
- return I ? (this.commitSnapshot(), this.notify(), !0) : (o.version = r.version, !1);
2593
+ return I ? (this.commitSnapshot(), this.notify(), !0) : (o.version = s.version, !1);
2566
2594
  }
2567
2595
  // Ignore further diffs (keeping the current tree visible) until the next full snapshot arrives,
2568
2596
  // which then replaces the tree wholesale. Used on soft reconnect: the cached tree may be missing
@@ -2571,42 +2599,47 @@ class bi {
2571
2599
  enterSnapshotMode() {
2572
2600
  this.snapshotMode = !0;
2573
2601
  }
2602
+ // Returns whether a diff was dropped as unrecoverable since the last call, clearing the flag.
2603
+ consumeResyncNeeded() {
2604
+ const t = this.resyncNeeded;
2605
+ return this.resyncNeeded = !1, t;
2606
+ }
2574
2607
  replaceFromWire(t) {
2575
- const r = {
2608
+ const s = {
2576
2609
  rootViewId: t.rootViewId,
2577
2610
  views: new Map(t.views),
2578
2611
  payloads: new Map(t.payloads),
2579
2612
  version: t.version
2580
2613
  };
2581
- return this.replaceSnapshot(r);
2614
+ return this.replaceSnapshot(s);
2582
2615
  }
2583
2616
  patchFromOp(t) {
2584
2617
  this.snapshotMode = !0;
2585
- const r = t.expectedBaseVersion;
2586
- if (r !== void 0 && this.snapshot.version !== r)
2618
+ const s = t.expectedBaseVersion;
2619
+ if (s !== void 0 && this.snapshot.version !== s)
2587
2620
  return !1;
2588
- let s = !1, n = null, i = null;
2621
+ let r = !1, n = null, i = null;
2589
2622
  const o = () => (n || (n = new Map(this.snapshot.views)), n), a = () => (i || (i = new Map(this.snapshot.payloads)), i);
2590
2623
  if (t.deleteViews && t.deleteViews.length > 0)
2591
2624
  for (const l of t.deleteViews)
2592
- o().delete(l) && (s = !0, this.structureChanged = !0);
2625
+ o().delete(l) && (r = !0, this.structureChanged = !0);
2593
2626
  if (t.upsertViews && t.upsertViews.length > 0)
2594
2627
  for (const [l, E] of t.upsertViews) {
2595
2628
  const h = o(), T = h.get(l);
2596
- T !== E && (h.set(l, E), s = !0, T ? j(T, E, this.changedNodeIds) : (B(E, this.changedNodeIds), this.structureChanged = !0));
2629
+ T !== E && (h.set(l, E), r = !0, T ? j(T, E, this.changedNodeIds) : (V(E, this.changedNodeIds), this.structureChanged = !0));
2597
2630
  }
2598
2631
  if (t.deletePayloads && t.deletePayloads.length > 0)
2599
2632
  for (const l of t.deletePayloads)
2600
- a().delete(l) && (s = !0);
2633
+ a().delete(l) && (r = !0);
2601
2634
  if (t.upsertPayloads && t.upsertPayloads.length > 0)
2602
2635
  for (const [l, E] of t.upsertPayloads) {
2603
2636
  const h = a();
2604
- h.get(l) !== E && (h.set(l, E), s = !0);
2637
+ h.get(l) !== E && (h.set(l, E), r = !0);
2605
2638
  }
2606
2639
  const I = t.rootViewId ?? this.snapshot.rootViewId;
2607
- I !== this.snapshot.rootViewId && (s = !0, this.structureChanged = !0);
2640
+ I !== this.snapshot.rootViewId && (r = !0, this.structureChanged = !0);
2608
2641
  const _ = t.nextVersion;
2609
- if (_ !== this.snapshot.version && (s = !0), !s)
2642
+ if (_ !== this.snapshot.version && (r = !0), !r)
2610
2643
  return this.snapshot = { ...this.snapshot, version: _ }, !1;
2611
2644
  for (const l of this.changedNodeIds)
2612
2645
  this.nodeVersions.set(l, (this.nodeVersions.get(l) ?? 0) + 1);
@@ -2619,15 +2652,15 @@ class bi {
2619
2652
  }
2620
2653
  replaceSnapshot(t) {
2621
2654
  this.snapshotMode = !0;
2622
- const r = this.snapshot, s = r.version !== t.version || r.rootViewId !== t.rootViewId || r.views.size !== t.views.size || r.payloads.size !== t.payloads.size;
2623
- (r.rootViewId !== t.rootViewId || r.views.size !== t.views.size) && (this.structureChanged = !0);
2655
+ const s = this.snapshot, r = s.version !== t.version || s.rootViewId !== t.rootViewId || s.views.size !== t.views.size || s.payloads.size !== t.payloads.size;
2656
+ (s.rootViewId !== t.rootViewId || s.views.size !== t.views.size) && (this.structureChanged = !0);
2624
2657
  for (const [n, i] of t.views) {
2625
- const o = r.views.get(n);
2626
- o ? j(o, i, this.changedNodeIds) : (B(i, this.changedNodeIds), this.structureChanged = !0);
2658
+ const o = s.views.get(n);
2659
+ o ? j(o, i, this.changedNodeIds) : (V(i, this.changedNodeIds), this.structureChanged = !0);
2627
2660
  }
2628
2661
  for (const n of this.changedNodeIds)
2629
2662
  this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
2630
- return this.snapshot = t, s && this.notify(), s;
2663
+ return this.snapshot = t, r && this.notify(), r;
2631
2664
  }
2632
2665
  clear() {
2633
2666
  (this.snapshot.rootViewId === void 0 || this.snapshot.rootViewId.length === 0) && this.snapshot.views.size === 0 && this.snapshot.payloads.size === 0 || (this.snapshotMode = !0, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.payloadsDirty = !0, this.snapshot = {
@@ -2644,21 +2677,23 @@ class bi {
2644
2677
  this.listeners.delete(t);
2645
2678
  };
2646
2679
  }
2647
- subscribeNode(t, r) {
2648
- let s = this.nodeListeners.get(t);
2649
- return s || (s = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, s)), s.add(r), () => {
2650
- s && (s.delete(r), s.size === 0 && this.nodeListeners.delete(t));
2680
+ subscribeNode(t, s) {
2681
+ let r = this.nodeListeners.get(t);
2682
+ return r || (r = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, r)), r.add(s), () => {
2683
+ r && (r.delete(s), r.size === 0 && this.nodeListeners.delete(t));
2651
2684
  };
2652
2685
  }
2653
2686
  getNode(t) {
2654
- const r = this.snapshot.views.get(t);
2655
- if (r)
2656
- return r;
2657
- for (const s of this.snapshot.views.values()) {
2658
- const n = Ze(s, t);
2659
- if (n)
2660
- return n;
2661
- }
2687
+ const s = this.snapshot.views;
2688
+ return this.indexedViews !== s && this.rebuildNodeIndex(s), this.nodeIndex.get(t);
2689
+ }
2690
+ rebuildNodeIndex(t) {
2691
+ this.nodeIndex.clear();
2692
+ for (const s of t.values())
2693
+ et(s, this.nodeIndex);
2694
+ for (const [s, r] of t)
2695
+ this.nodeIndex.set(s, r);
2696
+ this.indexedViews = t;
2662
2697
  }
2663
2698
  getNodeVersion(t) {
2664
2699
  return this.nodeVersions.get(t) ?? 0;
@@ -2669,15 +2704,15 @@ class bi {
2669
2704
  return;
2670
2705
  }
2671
2706
  for (const t of this.changedNodeIds) {
2672
- const r = this.nodeListeners.get(t);
2673
- if (r)
2674
- for (const s of r)
2675
- s();
2707
+ const s = this.nodeListeners.get(t);
2708
+ if (s)
2709
+ for (const r of s)
2710
+ r();
2676
2711
  }
2677
2712
  this.changedNodeIds.clear();
2678
2713
  }
2679
2714
  commitSnapshot() {
2680
- let t, r;
2715
+ let t, s;
2681
2716
  if (this.viewsDirty) {
2682
2717
  const n = /* @__PURE__ */ new Map();
2683
2718
  for (const [i, o] of this.views)
@@ -2685,16 +2720,16 @@ class bi {
2685
2720
  t = n, this.viewsDirty = !1;
2686
2721
  } else
2687
2722
  t = this.snapshot.views;
2688
- this.payloadsDirty ? (r = new Map(this.payloads), this.payloadsDirty = !1) : r = this.snapshot.payloads;
2689
- let s = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2690
- if (s === void 0)
2723
+ this.payloadsDirty ? (s = new Map(this.payloads), this.payloadsDirty = !1) : s = this.snapshot.payloads;
2724
+ let r = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2725
+ if (r === void 0)
2691
2726
  for (const n of this.views.values())
2692
- s = s === void 0 ? n.version : Math.max(s, n.version);
2727
+ r = r === void 0 ? n.version : Math.max(r, n.version);
2693
2728
  this.snapshot = {
2694
2729
  rootViewId: this.rootViewId,
2695
2730
  views: t,
2696
- payloads: r,
2697
- version: s
2731
+ payloads: s,
2732
+ version: r
2698
2733
  };
2699
2734
  for (const n of this.changedNodeIds)
2700
2735
  this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
@@ -2707,35 +2742,40 @@ class bi {
2707
2742
  }
2708
2743
  }
2709
2744
  }
2710
- class Fi {
2745
+ class Bi {
2711
2746
  streams = /* @__PURE__ */ new Map();
2712
2747
  listeners = /* @__PURE__ */ new Set();
2713
- apply(t, r) {
2714
- const n = this.getOrCreateStreamEntry(t).store.apply(r);
2748
+ apply(t, s) {
2749
+ const n = this.getOrCreateStreamEntry(t).store.apply(s);
2715
2750
  return n && this.notify(t), n;
2716
2751
  }
2752
+ // Whether the given stream dropped an unrecoverable diff since the last check (clears the flag).
2753
+ needsResync(t) {
2754
+ const s = this.streams.get(t);
2755
+ return s ? s.store.consumeResyncNeeded() : !1;
2756
+ }
2717
2757
  applyStoreOp(t) {
2718
2758
  if (t.type === "ReplaceStreamSnapshot") {
2719
- const r = this.getOrCreateStreamEntry(t.snapshot.streamId), s = r.category !== t.snapshot.category;
2720
- return r.category = t.snapshot.category, r.store.replaceFromWire(t.snapshot) || s ? (this.notify(t.snapshot.streamId), !0) : !1;
2759
+ const s = this.getOrCreateStreamEntry(t.snapshot.streamId), r = s.category !== t.snapshot.category;
2760
+ return s.category = t.snapshot.category, s.store.replaceFromWire(t.snapshot) || r ? (this.notify(t.snapshot.streamId), !0) : !1;
2721
2761
  }
2722
2762
  if (t.type === "PatchStreamSnapshot") {
2723
- const r = this.getOrCreateStreamEntry(t.streamId), s = t.category !== void 0 && r.category !== t.category;
2724
- return t.category !== void 0 && (r.category = t.category), r.store.patchFromOp(t) || s ? (this.notify(t.streamId), !0) : !1;
2763
+ const s = this.getOrCreateStreamEntry(t.streamId), r = t.category !== void 0 && s.category !== t.category;
2764
+ return t.category !== void 0 && (s.category = t.category), s.store.patchFromOp(t) || r ? (this.notify(t.streamId), !0) : !1;
2725
2765
  }
2726
2766
  if (t.type === "ClearStream") {
2727
- const r = this.streams.get(t.streamId);
2728
- return r ? (r.store.clear(), this.notify(t.streamId), !0) : !1;
2767
+ const s = this.streams.get(t.streamId);
2768
+ return s ? (s.store.clear(), this.notify(t.streamId), !0) : !1;
2729
2769
  }
2730
2770
  return t.type === "RemoveStream" ? this.streams.delete(t.streamId) ? (this.notify(t.streamId), !0) : !1 : t.type === "SetStreamCategory" ? (this.setCategory(t.streamId, t.category), !0) : !1;
2731
2771
  }
2732
2772
  applyStoreOps(t) {
2733
- for (const r of t)
2734
- this.applyStoreOp(r);
2773
+ for (const s of t)
2774
+ this.applyStoreOp(s);
2735
2775
  }
2736
2776
  clear(t) {
2737
- const r = this.streams.get(t);
2738
- r && (r.store.clear(), this.notify(t));
2777
+ const s = this.streams.get(t);
2778
+ s && (s.store.clear(), this.notify(t));
2739
2779
  }
2740
2780
  remove(t) {
2741
2781
  this.streams.delete(t) && this.notify(t);
@@ -2746,26 +2786,26 @@ class Fi {
2746
2786
  for (const t of this.streams.values())
2747
2787
  t.store.enterSnapshotMode();
2748
2788
  }
2749
- setCategory(t, r) {
2750
- const s = this.getOrCreateStreamEntry(t);
2751
- s.category !== r && (s.category = r, this.notify(t));
2789
+ setCategory(t, s) {
2790
+ const r = this.getOrCreateStreamEntry(t);
2791
+ r.category !== s && (r.category = s, this.notify(t));
2752
2792
  }
2753
2793
  getSnapshot(t) {
2754
- const r = this.streams.get(t);
2755
- return r ? {
2756
- ...r.store.getSnapshot(),
2794
+ const s = this.streams.get(t);
2795
+ return s ? {
2796
+ ...s.store.getSnapshot(),
2757
2797
  streamId: t,
2758
- category: r.category
2798
+ category: s.category
2759
2799
  } : void 0;
2760
2800
  }
2761
2801
  getSnapshots() {
2762
2802
  const t = [];
2763
- for (const [r, s] of this.streams) {
2764
- const n = s.store.getSnapshot();
2803
+ for (const [s, r] of this.streams) {
2804
+ const n = r.store.getSnapshot();
2765
2805
  t.push({
2766
2806
  ...n,
2767
- streamId: r,
2768
- category: s.category
2807
+ streamId: s,
2808
+ category: r.category
2769
2809
  });
2770
2810
  }
2771
2811
  return t;
@@ -2776,77 +2816,77 @@ class Fi {
2776
2816
  };
2777
2817
  }
2778
2818
  getOrCreateStreamEntry(t) {
2779
- let r = this.streams.get(t);
2780
- return r || (r = { store: new bi() }, this.streams.set(t, r)), r;
2819
+ let s = this.streams.get(t);
2820
+ return s || (s = { store: new vi() }, this.streams.set(t, s)), s;
2781
2821
  }
2782
2822
  notify(t) {
2783
- for (const r of this.listeners)
2784
- r(t);
2823
+ for (const s of this.listeners)
2824
+ s(t);
2785
2825
  }
2786
2826
  }
2787
- function Pi(e, t, r) {
2827
+ function Vi(e, t, s) {
2788
2828
  if (t.length === 0)
2789
2829
  return e;
2790
- const s = /* @__PURE__ */ new Map();
2830
+ const r = /* @__PURE__ */ new Map();
2791
2831
  for (const n of t)
2792
- s.set(n.nodeId, n);
2793
- return qe(e, s);
2832
+ r.set(n.nodeId, n);
2833
+ return Ze(e, r);
2794
2834
  }
2795
- function qe(e, t, r) {
2796
- const s = t.get(e.id);
2835
+ function Ze(e, t, s) {
2836
+ const r = t.get(e.id);
2797
2837
  let n = e, i = !1;
2798
- if (s?.textUpdates && s.textUpdates.length > 0) {
2799
- const u = Mi(e, s.textUpdates);
2838
+ if (r?.textUpdates && r.textUpdates.length > 0) {
2839
+ const u = Yi(e, r.textUpdates);
2800
2840
  n = u.node, i = u.changed;
2801
2841
  }
2802
2842
  let o = !1, a = n.props;
2803
- if (s?.changedProps && s.changedProps.size > 0)
2804
- for (const [u, d] of s.changedProps.entries()) {
2843
+ if (r?.changedProps && r.changedProps.size > 0)
2844
+ for (const [u, d] of r.changedProps.entries()) {
2805
2845
  const c = a[u];
2806
2846
  if (d === void 0)
2807
- (c !== void 0 || u in a) && (o || (a = M(a), o = !0), delete a[u]);
2847
+ (c !== void 0 || u in a) && (o || (a = B(a), o = !0), delete a[u]);
2808
2848
  else if (Q(d)) {
2809
- const S = M(d);
2810
- p(S, c) || (o || (a = M(a), o = !0), a[u] = S);
2849
+ const S = B(d);
2850
+ p(S, c) || (o || (a = B(a), o = !0), a[u] = S);
2811
2851
  } else
2812
- p(d, c) || (o || (a = M(a), o = !0), a[u] = d);
2852
+ p(d, c) || (o || (a = B(a), o = !0), a[u] = d);
2813
2853
  }
2814
2854
  let I = !1, _ = n.styleIds;
2815
- s?.styleIds !== void 0 && (et(n.styleIds, s.styleIds) || (_ = s.styleIds, I = !0));
2855
+ r?.styleIds !== void 0 && (st(n.styleIds, r.styleIds) || (_ = r.styleIds, I = !0));
2816
2856
  const l = n.children ?? [];
2817
2857
  let E = l, h = !1;
2818
- if (s?.removals && s.removals.length > 0 || s?.moves && s.moves.length > 0 || s?.inserts && s.inserts.length > 0) {
2858
+ if (r?.removals && r.removals.length > 0 || r?.moves && r.moves.length > 0 || r?.inserts && r.inserts.length > 0) {
2819
2859
  const u = E.slice();
2820
- if (s?.removals && s.removals.length > 0) {
2821
- const d = [...s.removals].sort((c, S) => S.index - c.index);
2860
+ if (r?.removals && r.removals.length > 0) {
2861
+ const d = [...r.removals].sort((c, S) => S.index - c.index);
2822
2862
  for (const c of d)
2823
2863
  if (c.index >= 0 && c.index < u.length && u[c.index].id === c.nodeId)
2824
2864
  u.splice(c.index, 1);
2825
2865
  else {
2826
- const S = u.findIndex((w) => w.id === c.nodeId);
2866
+ const S = u.findIndex((C) => C.id === c.nodeId);
2827
2867
  S >= 0 && u.splice(S, 1);
2828
2868
  }
2829
2869
  h = !0;
2830
2870
  }
2831
- if (s?.moves && s.moves.length > 0) {
2832
- const d = [...s.moves].sort((S, w) => S.toIndex - w.toIndex), c = /* @__PURE__ */ new Map();
2871
+ if (r?.moves && r.moves.length > 0) {
2872
+ const d = [...r.moves].sort((S, C) => S.toIndex - C.toIndex), c = /* @__PURE__ */ new Map();
2833
2873
  for (const S of d) {
2834
- const w = u.findIndex((X) => X.id === S.nodeId);
2835
- w >= 0 && (c.set(S.nodeId, u[w]), u.splice(w, 1));
2874
+ const C = u.findIndex((X) => X.id === S.nodeId);
2875
+ C >= 0 && (c.set(S.nodeId, u[C]), u.splice(C, 1));
2836
2876
  }
2837
2877
  for (const S of d) {
2838
- const w = c.get(S.nodeId);
2839
- if (w) {
2878
+ const C = c.get(S.nodeId);
2879
+ if (C) {
2840
2880
  const X = Math.min(S.toIndex, u.length);
2841
- u.splice(X, 0, w);
2881
+ u.splice(X, 0, C);
2842
2882
  }
2843
2883
  }
2844
2884
  h = !0;
2845
2885
  }
2846
- if (s?.inserts && s.inserts.length > 0) {
2847
- const d = [...s.inserts].sort((c, S) => c.index - S.index);
2886
+ if (r?.inserts && r.inserts.length > 0) {
2887
+ const d = [...r.inserts].sort((c, S) => c.index - S.index);
2848
2888
  for (const c of d) {
2849
- u.some((w) => w.id === c.node.id) && gi.warn(`Duplicate node id '${c.node.id}' (type '${c.node.type}') inserted next to an existing sibling — UI tree diverged from the server`);
2889
+ u.some((C) => C.id === c.node.id) && Mi.warn(`Duplicate node id '${c.node.id}' (type '${c.node.type}') inserted next to an existing sibling — UI tree diverged from the server`);
2850
2890
  const S = Math.min(c.index, u.length);
2851
2891
  u.splice(S, 0, c.node);
2852
2892
  }
@@ -2856,7 +2896,7 @@ function qe(e, t, r) {
2856
2896
  }
2857
2897
  let N;
2858
2898
  for (let u = 0; u < E.length; u++) {
2859
- const d = E[u], c = qe(d, t);
2899
+ const d = E[u], c = Ze(d, t);
2860
2900
  c !== d && (N || (N = E.slice()), N[u] = c);
2861
2901
  }
2862
2902
  return N && (E = N, h = !0), i || o || I || h ? !o && !h && !I ? n : {
@@ -2868,92 +2908,87 @@ function qe(e, t, r) {
2868
2908
  ...e.sourceMarker ? { sourceMarker: e.sourceMarker } : {}
2869
2909
  } : e;
2870
2910
  }
2871
- function B(e, t) {
2911
+ function V(e, t) {
2872
2912
  if (t.add(e.id), e.children)
2873
- for (const r of e.children)
2874
- B(r, t);
2913
+ for (const s of e.children)
2914
+ V(s, t);
2915
+ }
2916
+ function et(e, t) {
2917
+ if (t.set(e.id, e), e.children)
2918
+ for (const s of e.children)
2919
+ et(s, t);
2875
2920
  }
2876
2921
  const H = [];
2877
- function pi(e) {
2922
+ function Gi(e) {
2878
2923
  for (; H.length <= e; )
2879
2924
  H.push(/* @__PURE__ */ new Map());
2880
2925
  return H[e].clear(), H[e];
2881
2926
  }
2882
- function j(e, t, r) {
2883
- Qe(e, t, r, 0);
2927
+ function j(e, t, s) {
2928
+ tt(e, t, s, 0);
2884
2929
  }
2885
- function Qe(e, t, r, s) {
2930
+ function tt(e, t, s, r) {
2886
2931
  if (e === t)
2887
2932
  return;
2888
- (e.type !== t.type || !ki(e.props, t.props) || !et(e.styleIds, t.styleIds)) && r.add(t.id);
2933
+ (e.type !== t.type || !xi(e.props, t.props) || !st(e.styleIds, t.styleIds)) && s.add(t.id);
2889
2934
  const i = e.children ?? [], o = t.children ?? [];
2890
2935
  if (i !== o) {
2891
- const a = pi(s);
2936
+ const a = Gi(r);
2892
2937
  for (const _ of i)
2893
2938
  a.set(_.id, _);
2894
2939
  let I = !1;
2895
2940
  for (let _ = 0; _ < o.length; _++) {
2896
2941
  const l = o[_], E = a.get(l.id);
2897
- E ? (Qe(E, l, r, s + 1), !I && _ < i.length && i[_].id !== l.id && (I = !0)) : (B(l, r), I = !0);
2942
+ E ? (tt(E, l, s, r + 1), !I && _ < i.length && i[_].id !== l.id && (I = !0)) : (V(l, s), I = !0);
2898
2943
  }
2899
- (i.length !== o.length || I) && r.add(t.id);
2944
+ (i.length !== o.length || I) && s.add(t.id);
2900
2945
  }
2901
2946
  }
2902
- function ki(e, t) {
2947
+ function xi(e, t) {
2903
2948
  return p(e, t);
2904
2949
  }
2905
- function Ze(e, t) {
2906
- if (e.id === t)
2907
- return e;
2908
- if (e.children)
2909
- for (const r of e.children) {
2910
- const s = Ze(r, t);
2911
- if (s)
2912
- return s;
2913
- }
2914
- }
2915
- function et(e, t) {
2950
+ function st(e, t) {
2916
2951
  return p(e, t);
2917
2952
  }
2918
- function vi(e, t) {
2953
+ function Hi(e, t) {
2919
2954
  if (t.length === 0)
2920
2955
  return e;
2921
- const r = [...t].sort((i, o) => i.start - o.start);
2922
- let s = e, n = 0;
2923
- for (const i of r) {
2924
- const o = Ee(i.start + n, 0, s.length);
2956
+ const s = [...t].sort((i, o) => i.start - o.start);
2957
+ let r = e, n = 0;
2958
+ for (const i of s) {
2959
+ const o = Ee(i.start + n, 0, r.length);
2925
2960
  if (i.end == null) {
2926
- const l = s.slice(o), E = Bi(l, i.insertedText);
2927
- s = s.slice(0, o) + i.insertedText + l.slice(E), n += i.insertedText.length - E;
2961
+ const l = r.slice(o), E = Wi(l, i.insertedText);
2962
+ r = r.slice(0, o) + i.insertedText + l.slice(E), n += i.insertedText.length - E;
2928
2963
  continue;
2929
2964
  }
2930
- const a = i.end + n, I = Ee(a, o, s.length), _ = I - o;
2931
- s = s.slice(0, o) + i.insertedText + s.slice(I), n += i.insertedText.length - _;
2965
+ const a = i.end + n, I = Ee(a, o, r.length), _ = I - o;
2966
+ r = r.slice(0, o) + i.insertedText + r.slice(I), n += i.insertedText.length - _;
2932
2967
  }
2933
- return s;
2968
+ return r;
2934
2969
  }
2935
- function Mi(e, t, r) {
2970
+ function Yi(e, t, s) {
2936
2971
  if (t.length === 0)
2937
2972
  return { node: e, changed: !1 };
2938
- const s = /* @__PURE__ */ new Map();
2973
+ const r = /* @__PURE__ */ new Map();
2939
2974
  for (const n of t) {
2940
- const i = s.get(n.nodeId);
2941
- i ? i.push(n) : s.set(n.nodeId, [n]);
2975
+ const i = r.get(n.nodeId);
2976
+ i ? i.push(n) : r.set(n.nodeId, [n]);
2942
2977
  }
2943
- return tt(e, s);
2978
+ return rt(e, r);
2944
2979
  }
2945
- function tt(e, t, r) {
2946
- const s = t.get(e.id) ?? [];
2980
+ function rt(e, t, s) {
2981
+ const r = t.get(e.id) ?? [];
2947
2982
  let n = !1, i = e.props;
2948
- if (s.length > 0) {
2983
+ if (r.length > 0) {
2949
2984
  const _ = /* @__PURE__ */ new Map();
2950
- for (const l of s) {
2985
+ for (const l of r) {
2951
2986
  const E = _.get(l.propertyName);
2952
2987
  E ? E.push(l) : _.set(l.propertyName, [l]);
2953
2988
  }
2954
2989
  for (const [l, E] of _.entries()) {
2955
- const h = i[l], N = vi(typeof h == "string" ? h : "", E);
2956
- n || (i = M(i), n = !0), i[l] = N;
2990
+ const h = i[l], N = Hi(typeof h == "string" ? h : "", E);
2991
+ n || (i = B(i), n = !0), i[l] = N;
2957
2992
  }
2958
2993
  }
2959
2994
  let o = !1;
@@ -2962,7 +2997,7 @@ function tt(e, t, r) {
2962
2997
  if (a.length > 0) {
2963
2998
  let _;
2964
2999
  for (let l = 0; l < a.length; l++) {
2965
- const E = a[l], h = tt(E, t);
3000
+ const E = a[l], h = rt(E, t);
2966
3001
  h.changed && (_ || (_ = [...a]), _[l] = h.node);
2967
3002
  }
2968
3003
  _ && (I = _, o = !0);
@@ -2979,20 +3014,20 @@ function tt(e, t, r) {
2979
3014
  changed: !0
2980
3015
  };
2981
3016
  }
2982
- function Ee(e, t, r) {
2983
- return Math.max(t, Math.min(r, e));
3017
+ function Ee(e, t, s) {
3018
+ return Math.max(t, Math.min(s, e));
2984
3019
  }
2985
- function Bi(e, t) {
2986
- const r = Math.min(e.length, t.length);
2987
- let s = 0;
2988
- for (; s < r && e.charCodeAt(s) === t.charCodeAt(s); )
2989
- s++;
2990
- return s;
3020
+ function Wi(e, t) {
3021
+ const s = Math.min(e.length, t.length);
3022
+ let r = 0;
3023
+ for (; r < s && e.charCodeAt(r) === t.charCodeAt(r); )
3024
+ r++;
3025
+ return r;
2991
3026
  }
2992
- function M(e) {
2993
- const t = {}, r = Object.keys(e);
2994
- for (let s = 0; s < r.length; s++) {
2995
- const n = r[s];
3027
+ function B(e) {
3028
+ const t = {}, s = Object.keys(e);
3029
+ for (let r = 0; r < s.length; r++) {
3030
+ const n = s[r];
2996
3031
  t[n] = e[n];
2997
3032
  }
2998
3033
  return t;
@@ -3006,23 +3041,23 @@ function p(e, t) {
3006
3041
  if (Array.isArray(e) && Array.isArray(t)) {
3007
3042
  if (e.length !== t.length)
3008
3043
  return !1;
3009
- for (let r = 0; r < e.length; r++)
3010
- if (!p(e[r], t[r]))
3044
+ for (let s = 0; s < e.length; s++)
3045
+ if (!p(e[s], t[s]))
3011
3046
  return !1;
3012
3047
  return !0;
3013
3048
  }
3014
3049
  if (Q(e) && Q(t)) {
3015
- const r = Object.keys(e), s = Object.keys(t);
3016
- if (r.length !== s.length)
3050
+ const s = Object.keys(e), r = Object.keys(t);
3051
+ if (s.length !== r.length)
3017
3052
  return !1;
3018
- for (const n of r)
3053
+ for (const n of s)
3019
3054
  if (!p(e[n], t[n]))
3020
3055
  return !1;
3021
3056
  return !0;
3022
3057
  }
3023
3058
  return !1;
3024
3059
  }
3025
- const z = Z("LiveSnapshot"), _e = 1, J = "ikon-live-snapshot", Vi = 300 * 1e3, Gi = 5e6, xi = 1e3;
3060
+ const z = Z("LiveSnapshot"), _e = 1, J = "ikon-live-snapshot", Ki = 300 * 1e3, $i = 5e6, Xi = 1e3;
3026
3061
  function v() {
3027
3062
  try {
3028
3063
  return typeof localStorage > "u" ? null : localStorage;
@@ -3030,11 +3065,11 @@ function v() {
3030
3065
  return null;
3031
3066
  }
3032
3067
  }
3033
- function Hi(e) {
3068
+ function ji(e) {
3034
3069
  const t = typeof requestIdleCallback < "u" ? requestIdleCallback : null;
3035
3070
  t ? t(() => e(), { timeout: 2e3 }) : setTimeout(e, 0);
3036
3071
  }
3037
- class Yi {
3072
+ class zi {
3038
3073
  key;
3039
3074
  appId;
3040
3075
  userId;
@@ -3048,43 +3083,43 @@ class Yi {
3048
3083
  static clearAll() {
3049
3084
  const t = v();
3050
3085
  if (!t) return;
3051
- const r = `${J}:`, s = [];
3086
+ const s = `${J}:`, r = [];
3052
3087
  try {
3053
3088
  for (let n = 0; n < t.length; n++) {
3054
3089
  const i = t.key(n);
3055
- i && i.startsWith(r) && s.push(i);
3090
+ i && i.startsWith(s) && r.push(i);
3056
3091
  }
3057
- for (const n of s)
3092
+ for (const n of r)
3058
3093
  t.removeItem(n);
3059
3094
  } catch {
3060
3095
  }
3061
3096
  }
3062
3097
  constructor(t) {
3063
- this.appId = t.appId, this.userId = t.userId, this.disabled = !this.userId, this.maxAgeMs = t.maxAgeMs ?? Vi, this.maxBytes = t.maxBytes ?? Gi, this.debounceMs = t.debounceMs ?? xi, this.key = `${J}:${this.appId}:${this.userId}`, this.disabled || this.pruneOtherUsers();
3098
+ this.appId = t.appId, this.userId = t.userId, this.disabled = !this.userId, this.maxAgeMs = t.maxAgeMs ?? Ki, this.maxBytes = t.maxBytes ?? $i, this.debounceMs = t.debounceMs ?? Xi, this.key = `${J}:${this.appId}:${this.userId}`, this.disabled || this.pruneOtherUsers();
3064
3099
  }
3065
3100
  load() {
3066
3101
  if (this.disabled) return null;
3067
3102
  const t = v();
3068
3103
  if (!t) return null;
3069
- let r;
3104
+ let s;
3070
3105
  try {
3071
- r = t.getItem(this.key);
3106
+ s = t.getItem(this.key);
3072
3107
  } catch {
3073
3108
  return null;
3074
3109
  }
3075
- if (!r) return null;
3076
- let s;
3110
+ if (!s) return null;
3111
+ let r;
3077
3112
  try {
3078
- s = JSON.parse(r);
3113
+ r = JSON.parse(s);
3079
3114
  } catch {
3080
3115
  return this.remove(), null;
3081
3116
  }
3082
- if (s.schemaVersion !== _e || s.appId !== this.appId || s.userId !== this.userId)
3117
+ if (r.schemaVersion !== _e || r.appId !== this.appId || r.userId !== this.userId)
3083
3118
  return this.remove(), null;
3084
- if (!Number.isFinite(s.savedAtMs) || Date.now() - s.savedAtMs > this.maxAgeMs)
3119
+ if (!Number.isFinite(r.savedAtMs) || Date.now() - r.savedAtMs > this.maxAgeMs)
3085
3120
  return this.remove(), null;
3086
3121
  try {
3087
- return { streams: s.streams.map(Ki), styles: s.styles ?? [] };
3122
+ return { streams: r.streams.map(qi), styles: r.styles ?? [] };
3088
3123
  } catch (n) {
3089
3124
  return z.warn("Failed to deserialize stored live snapshot, dropping it", n), this.remove(), null;
3090
3125
  }
@@ -3093,9 +3128,9 @@ class Yi {
3093
3128
  * Schedule a throttled write of the current UI state (at most one write per window, captured at
3094
3129
  * the trailing edge). Streams with no root are skipped. The actual write runs at idle time.
3095
3130
  */
3096
- save(t, r) {
3097
- this.disabled || (this.pending = { streams: t, styles: r }, this.writeTimer === null && (this.writeTimer = setTimeout(() => {
3098
- this.writeTimer = null, Hi(() => this.writePending());
3131
+ save(t, s) {
3132
+ this.disabled || (this.pending = { streams: t, styles: s }, this.writeTimer === null && (this.writeTimer = setTimeout(() => {
3133
+ this.writeTimer = null, ji(() => this.writePending());
3099
3134
  }, this.debounceMs)));
3100
3135
  }
3101
3136
  /** Write any pending state immediately and synchronously (used on dispose / unmount). */
@@ -3109,12 +3144,12 @@ class Yi {
3109
3144
  const t = this.pending;
3110
3145
  this.pending = null, t && this.writeNow(t.streams, t.styles);
3111
3146
  }
3112
- writeNow(t, r) {
3113
- const s = v();
3114
- if (!s) return;
3147
+ writeNow(t, s) {
3148
+ const r = v();
3149
+ if (!r) return;
3115
3150
  const n = [];
3116
3151
  for (const a of t)
3117
- !a.rootViewId || !a.views.has(a.rootViewId) || n.push(Wi(a));
3152
+ !a.rootViewId || !a.views.has(a.rootViewId) || n.push(Ji(a));
3118
3153
  if (n.length === 0) return;
3119
3154
  const i = {
3120
3155
  schemaVersion: _e,
@@ -3122,7 +3157,7 @@ class Yi {
3122
3157
  appId: this.appId,
3123
3158
  userId: this.userId,
3124
3159
  streams: n,
3125
- styles: [...r]
3160
+ styles: [...s]
3126
3161
  };
3127
3162
  let o;
3128
3163
  try {
@@ -3136,7 +3171,7 @@ class Yi {
3136
3171
  return;
3137
3172
  }
3138
3173
  try {
3139
- s.setItem(this.key, o);
3174
+ r.setItem(this.key, o);
3140
3175
  } catch {
3141
3176
  }
3142
3177
  }
@@ -3151,19 +3186,19 @@ class Yi {
3151
3186
  pruneOtherUsers() {
3152
3187
  const t = v();
3153
3188
  if (!t) return;
3154
- const r = `${J}:${this.appId}:`, s = [];
3189
+ const s = `${J}:${this.appId}:`, r = [];
3155
3190
  try {
3156
3191
  for (let n = 0; n < t.length; n++) {
3157
3192
  const i = t.key(n);
3158
- i && i.startsWith(r) && i !== this.key && s.push(i);
3193
+ i && i.startsWith(s) && i !== this.key && r.push(i);
3159
3194
  }
3160
- for (const n of s)
3195
+ for (const n of r)
3161
3196
  t.removeItem(n);
3162
3197
  } catch {
3163
3198
  }
3164
3199
  }
3165
3200
  }
3166
- function Wi(e) {
3201
+ function Ji(e) {
3167
3202
  return {
3168
3203
  streamId: e.streamId,
3169
3204
  category: e.category,
@@ -3172,7 +3207,7 @@ function Wi(e) {
3172
3207
  views: [...e.views.entries()]
3173
3208
  };
3174
3209
  }
3175
- function Ki(e) {
3210
+ function qi(e) {
3176
3211
  return {
3177
3212
  streamId: e.streamId,
3178
3213
  category: e.category,
@@ -3183,32 +3218,32 @@ function Ki(e) {
3183
3218
  payloads: []
3184
3219
  };
3185
3220
  }
3186
- function $i(e) {
3221
+ function Qi(e) {
3187
3222
  return new Worker(
3188
- "" + new URL("assets/ui-worker-D4YPac0e.js", import.meta.url).href,
3223
+ "" + new URL("assets/ui-worker-Di0peIgz.js", import.meta.url).href,
3189
3224
  {
3190
3225
  type: "module",
3191
3226
  name: e?.name
3192
3227
  }
3193
3228
  );
3194
3229
  }
3195
- const C = Z("IkonUiCore");
3196
- function rt() {
3230
+ const y = Z("IkonUiCore"), Zi = 250;
3231
+ function nt() {
3197
3232
  if (!(typeof window > "u"))
3198
3233
  return window.__IKON_BOOT_SNAPSHOT_FILE__ || void 0;
3199
3234
  }
3200
3235
  let K = null;
3201
- function zi() {
3236
+ function so() {
3202
3237
  if (K) return;
3203
- const e = rt();
3238
+ const e = nt();
3204
3239
  e && (K = fetch(`/${e}`).then((t) => t, () => null));
3205
3240
  }
3206
- class Ji {
3241
+ class ro {
3207
3242
  unsubscribeProtocolMessages;
3208
3243
  unsubscribeState;
3209
3244
  client = null;
3210
3245
  lastConnectedSessionId = void 0;
3211
- uiStore = new Fi();
3246
+ uiStore = new Bi();
3212
3247
  uiWorker = null;
3213
3248
  uiStyles = /* @__PURE__ */ new Map();
3214
3249
  uiUpdateListeners = /* @__PURE__ */ new Set();
@@ -3225,12 +3260,18 @@ class Ji {
3225
3260
  // modes. The React layer reads this to render the first live update into the seed's existing surface
3226
3261
  // (in-place skeleton→live reconcile) instead of unmounting the seed and mounting the live (white flash).
3227
3262
  seededStreamIds = /* @__PURE__ */ new Set();
3263
+ // Debounce timers keyed by stream (senderId_trackId): a burst of unrecoverable diffs collapses
3264
+ // into a single resync request per stream instead of one per dropped diff.
3265
+ resyncDebounceTimers = /* @__PURE__ */ new Map();
3228
3266
  constructor(t) {
3229
- const r = t?.threading?.uiWorker ?? "auto";
3230
- this.useUiWorker = r !== "disabled" && typeof Worker < "u", t?.liveSnapshot?.enabled && (this.liveSnapshot = new Yi(t.liveSnapshot)), t?.client && this.initialize(t.client, t);
3267
+ const s = t?.threading?.uiWorker ?? "auto";
3268
+ this.useUiWorker = s !== "disabled" && typeof Worker < "u", t?.liveSnapshot?.enabled && (this.liveSnapshot = new zi(t.liveSnapshot)), t?.client && this.initialize(t.client, t);
3231
3269
  }
3232
3270
  dispose() {
3233
- this.unsubscribeProtocolMessages?.(), this.unsubscribeState?.(), this.unsubscribeLiveSnapshotCapture?.(), this.liveSnapshot?.dispose(), this.liveSnapshot = null, this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyleDeleteListeners.clear(), this.uiStyles.clear();
3271
+ this.unsubscribeProtocolMessages?.(), this.unsubscribeState?.(), this.unsubscribeLiveSnapshotCapture?.(), this.liveSnapshot?.dispose(), this.liveSnapshot = null, this.uiWorker?.terminate(), this.uiWorker = null;
3272
+ for (const t of this.resyncDebounceTimers.values())
3273
+ clearTimeout(t);
3274
+ this.resyncDebounceTimers.clear(), this.client = null, this.uiStyleListeners.clear(), this.uiStyleDeleteListeners.clear(), this.uiStyles.clear();
3234
3275
  }
3235
3276
  clearAllState() {
3236
3277
  this.uiWorker && this.uiWorker.postMessage({ type: "clear" });
@@ -3270,8 +3311,8 @@ class Ji {
3270
3311
  isSeedStream(t) {
3271
3312
  return this.seededStreamIds.has(t);
3272
3313
  }
3273
- initialize(t, r) {
3274
- this.client = t, this.useUiWorker && this.startUiWorker(r), !this.seedFromLiveSnapshot() && r?.bootSnapshot !== !1 && this.seedFromBootSnapshot(), this.subscribeLiveSnapshotCapture();
3314
+ initialize(t, s) {
3315
+ this.client = t, this.useUiWorker && this.startUiWorker(s), !this.seedFromLiveSnapshot() && s?.bootSnapshot !== !1 && this.seedFromBootSnapshot(), this.subscribeLiveSnapshotCapture();
3275
3316
  const n = {
3276
3317
  opcodeGroupsMask: L.GROUP_CORE | L.GROUP_UI | L.GROUP_ACTIONS
3277
3318
  };
@@ -3288,7 +3329,7 @@ class Ji {
3288
3329
  }
3289
3330
  if (i === "connected") {
3290
3331
  const o = this.client?.sessionId;
3291
- this.lastConnectedSessionId !== void 0 && (o !== this.lastConnectedSessionId ? (C.info(`SessionId changed (${this.lastConnectedSessionId} → ${o}), clearing UI cache so the server can resend a fresh snapshot under the new SessionId`), this.clearAllState()) : (C.info("Soft reconnect (same SessionId), gating UI store on the server resync snapshot"), this.enterSnapshotMode())), this.lastConnectedSessionId = o;
3332
+ this.lastConnectedSessionId !== void 0 && (o !== this.lastConnectedSessionId ? (y.info(`SessionId changed (${this.lastConnectedSessionId} → ${o}), clearing UI cache so the server can resend a fresh snapshot under the new SessionId`), this.clearAllState()) : (y.info("Soft reconnect (same SessionId), gating UI store on the server resync snapshot"), this.enterSnapshotMode())), this.lastConnectedSessionId = o;
3292
3333
  }
3293
3334
  });
3294
3335
  }
@@ -3298,10 +3339,10 @@ class Ji {
3298
3339
  if (!t || t.streams.length === 0) return !1;
3299
3340
  if (this.uiWorker)
3300
3341
  return this.uiWorker.postMessage({ type: "seed", liveStreams: t.streams, styles: t.styles }), !0;
3301
- for (const r of t.styles)
3302
- this.uiStyles.set(r.styleId, r), this.notifyUiStyle(r);
3303
- for (const r of t.streams)
3304
- this.uiStore.applyStoreOp({ type: "ReplaceStreamSnapshot", snapshot: r });
3342
+ for (const s of t.styles)
3343
+ this.uiStyles.set(s.styleId, s), this.notifyUiStyle(s);
3344
+ for (const s of t.streams)
3345
+ this.uiStore.applyStoreOp({ type: "ReplaceStreamSnapshot", snapshot: s });
3305
3346
  return !0;
3306
3347
  }
3307
3348
  // Build-time FTU boot snapshot: when this build was bundled with `--snapshot`, the app's env wiring
@@ -3310,25 +3351,25 @@ class Ji {
3310
3351
  // a live update, gated into snapshot mode so the first live full snapshot atomically replaces it. The
3311
3352
  // hashed filename is the cache-buster — a redeploy with a different UI fetches a different URL.
3312
3353
  seedFromBootSnapshot() {
3313
- const t = rt();
3354
+ const t = nt();
3314
3355
  t && this.loadBootSnapshotAsync(t);
3315
3356
  }
3316
3357
  async loadBootSnapshotAsync(t) {
3317
3358
  try {
3318
- const r = (K ? await K : null) ?? await fetch(`/${t}`);
3319
- if (!r.ok) return;
3320
- const s = await r.json();
3321
- if (!s?.json) return;
3359
+ const s = (K ? await K : null) ?? await fetch(`/${t}`);
3360
+ if (!s.ok) return;
3361
+ const r = await s.json();
3362
+ if (!r?.json) return;
3322
3363
  if (this.uiWorker) {
3323
- this.uiWorker.postMessage({ type: "seed", bootStreamId: s.streamId ?? "boot", bootJson: s.json, styles: s.styles ?? [] });
3364
+ this.uiWorker.postMessage({ type: "seed", bootStreamId: r.streamId ?? "boot", bootJson: r.json, styles: r.styles ?? [] });
3324
3365
  return;
3325
3366
  }
3326
3367
  if (this.uiStore.getSnapshots().some((o) => o.rootViewId)) return;
3327
- for (const o of s.styles ?? []) {
3368
+ for (const o of r.styles ?? []) {
3328
3369
  const a = { styleId: o.styleId, css: o.css, common: o.common };
3329
3370
  this.uiStyles.set(a.styleId, a), this.notifyUiStyle(a);
3330
3371
  }
3331
- const n = Ie({ Json: s.json }), i = s.streamId ?? "boot";
3372
+ const n = Ie({ Json: r.json }), i = r.streamId ?? "boot";
3332
3373
  this.uiStore.apply(i, n), this.seedStreamIds.add(i), this.seededStreamIds.add(i), this.uiStore.enterSnapshotModeAll();
3333
3374
  } catch {
3334
3375
  }
@@ -3341,53 +3382,56 @@ class Ji {
3341
3382
  }
3342
3383
  startUiWorker(t) {
3343
3384
  try {
3344
- this.uiWorker = new $i();
3385
+ this.uiWorker = new Qi();
3345
3386
  } catch (n) {
3346
- C.warn("Failed to create UI worker, falling back to main thread", n), this.uiWorker = null;
3387
+ y.warn("Failed to create UI worker, falling back to main thread", n), this.uiWorker = null;
3347
3388
  return;
3348
3389
  }
3349
- const r = t?.threading?.flushIntervalMs, s = t?.threading?.maxLatencyMs;
3350
- this.uiWorker.postMessage({ type: "configure", flushIntervalMs: r, maxLatencyMs: s }), this.uiWorker.addEventListener("message", (n) => {
3390
+ const s = t?.threading?.flushIntervalMs, r = t?.threading?.maxLatencyMs;
3391
+ this.uiWorker.postMessage({ type: "configure", flushIntervalMs: s, maxLatencyMs: r }), this.uiWorker.addEventListener("message", (n) => {
3351
3392
  this.handleUiStoreOpBatch(n.data);
3352
3393
  }), this.uiWorker.addEventListener("error", (n) => {
3353
3394
  const i = [n.message, n.filename, n.lineno, n.colno].filter((o) => o != null && String(o).length > 0);
3354
- C.warn(`UI worker failed, falling back to main thread: ${i.join(" ")}`.trim()), this.uiWorker?.terminate(), this.uiWorker = null, this.rehydrateStoresForMainThread();
3395
+ y.warn(`UI worker failed, falling back to main thread: ${i.join(" ")}`.trim()), this.uiWorker?.terminate(), this.uiWorker = null, this.rehydrateStoresForMainThread();
3355
3396
  });
3356
3397
  }
3357
3398
  rehydrateStoresForMainThread() {
3358
3399
  for (const t of this.uiStore.getSnapshots()) {
3359
3400
  if (!t.rootViewId)
3360
3401
  continue;
3361
- const r = t.views.get(t.rootViewId);
3362
- if (!r)
3402
+ const s = t.views.get(t.rootViewId);
3403
+ if (!s)
3363
3404
  continue;
3364
- const s = {
3405
+ const r = {
3365
3406
  snapshot: {
3366
3407
  type: "full",
3367
3408
  version: t.version ?? 0,
3368
3409
  metadata: { viewId: t.rootViewId },
3369
- root: r
3410
+ root: s
3370
3411
  },
3371
3412
  payloads: t.payloads
3372
3413
  };
3373
- this.uiStore.apply(t.streamId, s);
3414
+ this.uiStore.apply(t.streamId, r);
3374
3415
  }
3375
3416
  }
3376
3417
  forwardMessageToWorker(t) {
3377
3418
  if (this.uiWorker)
3378
3419
  try {
3379
- const r = t.slice().buffer;
3380
- this.uiWorker.postMessage({ type: "protocol", message: r }, [r]);
3381
- } catch (r) {
3382
- C.warn("Failed to forward message to UI worker", r);
3420
+ const s = t.slice().buffer;
3421
+ this.uiWorker.postMessage({ type: "protocol", message: s }, [s]);
3422
+ } catch (s) {
3423
+ y.warn("Failed to forward message to UI worker", s);
3383
3424
  }
3384
3425
  }
3385
3426
  handleUiStoreOpBatch(t) {
3386
- for (const r of t.ops)
3387
- this.applyUiStoreOp(r);
3427
+ for (const s of t.ops)
3428
+ this.applyUiStoreOp(s);
3388
3429
  if (t.acks && t.acks.length > 0)
3389
- for (const r of t.acks)
3390
- this.sendUiUpdateAck(r.trackId, r.version, r.senderId);
3430
+ for (const s of t.acks)
3431
+ this.sendUiUpdateAck(s.trackId, s.version, s.senderId);
3432
+ if (t.resyncs && t.resyncs.length > 0)
3433
+ for (const s of t.resyncs)
3434
+ this.requestResync(s.trackId, s.senderId);
3391
3435
  }
3392
3436
  applyUiStoreOp(t) {
3393
3437
  if (t.type === "UpsertUiStyle") {
@@ -3417,9 +3461,9 @@ class Ji {
3417
3461
  this.seededStreamIds.add(t.snapshot.streamId);
3418
3462
  return;
3419
3463
  }
3420
- const s = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId;
3421
- this.seededStreamIds.delete(s);
3422
- const n = this.uiStore.getSnapshot(s);
3464
+ const r = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId;
3465
+ this.seededStreamIds.delete(r);
3466
+ const n = this.uiStore.getSnapshot(r);
3423
3467
  if (!n?.rootViewId)
3424
3468
  return;
3425
3469
  const i = n.views.get(n.rootViewId);
@@ -3434,12 +3478,12 @@ class Ji {
3434
3478
  },
3435
3479
  payloads: n.payloads
3436
3480
  };
3437
- this.notifyUiUpdate(s, o);
3481
+ this.notifyUiUpdate(r, o);
3438
3482
  return;
3439
3483
  }
3440
3484
  }
3441
3485
  handleProtocolMessage(t) {
3442
- switch (st(t)) {
3486
+ switch (it(t)) {
3443
3487
  case L.CORE_GLOBAL_STATE:
3444
3488
  this.handleGlobalState(t);
3445
3489
  return;
@@ -3463,111 +3507,129 @@ class Ji {
3463
3507
  }
3464
3508
  }
3465
3509
  handleGlobalState(t) {
3466
- Bn(t).then((r) => {
3467
- const s = /* @__PURE__ */ new Set();
3468
- for (const n of Object.values(r.UIStreams ?? {}))
3469
- s.add(n.StreamId), this.uiStore.setCategory(n.StreamId, n.Info?.Category);
3510
+ Wn(t).then((s) => {
3511
+ const r = /* @__PURE__ */ new Set();
3512
+ for (const n of Object.values(s.UIStreams ?? {}))
3513
+ r.add(n.StreamId), this.uiStore.setCategory(n.StreamId, n.Info?.Category);
3470
3514
  for (const n of this.uiStore.getSnapshots())
3471
- this.seedStreamIds.has(n.streamId) || s.has(n.streamId) || (this.uiStore.remove(n.streamId), this.notifyUiStreamCleared(n.streamId));
3472
- }).catch((r) => {
3473
- C.error("Failed to handle global state", r);
3515
+ this.seedStreamIds.has(n.streamId) || r.has(n.streamId) || (this.uiStore.remove(n.streamId), this.notifyUiStreamCleared(n.streamId));
3516
+ }).catch((s) => {
3517
+ y.error("Failed to handle global state", s);
3474
3518
  });
3475
3519
  }
3476
3520
  // Retire orphan boot seeds once a live update has rendered (main-thread twin of the worker's
3477
3521
  // evictSeedStreamsExcept). A seed sharing the live id is replaced in place, not removed.
3478
3522
  evictSeedStreams(t) {
3479
3523
  if (this.seedStreamIds.size !== 0) {
3480
- for (const r of this.seedStreamIds)
3481
- r !== t && (this.uiStore.remove(r), this.notifyUiStreamCleared(r));
3524
+ for (const s of this.seedStreamIds)
3525
+ s !== t && (this.uiStore.remove(s), this.notifyUiStreamCleared(s));
3482
3526
  this.seedStreamIds.clear();
3483
3527
  }
3484
3528
  }
3485
3529
  handleUiUpdate(t) {
3486
- const r = ae(t), s = `${r.senderId}_${r.trackId}`;
3487
- Xs(t).then((n) => {
3530
+ const s = ae(t), r = `${s.senderId}_${s.trackId}`;
3531
+ Zr(t).then((n) => {
3488
3532
  const i = Ie(n);
3489
- this.notifyUiUpdate(s, i), this.uiStore.apply(s, i) && this.evictSeedStreams(s), this.sendUiUpdateAck(r.trackId, i.snapshot.version, r.senderId);
3533
+ this.notifyUiUpdate(r, i), this.uiStore.apply(r, i) && this.evictSeedStreams(r), this.uiStore.needsResync(r) && this.requestResync(s.trackId, s.senderId), this.sendUiUpdateAck(s.trackId, i.snapshot.version, s.senderId);
3490
3534
  }).catch((n) => {
3491
- n instanceof D ? C.warn("Failed to parse UI update", n.causeError ?? n) : C.error("Failed to apply UI update", n);
3535
+ n instanceof D ? y.warn("Failed to parse UI update", n.causeError ?? n) : y.error("Failed to apply UI update", n);
3492
3536
  });
3493
3537
  }
3494
3538
  handleUiStyles(t) {
3495
- Ts(t).then((r) => {
3496
- if (!r.StyleId) return;
3497
- const s = {
3498
- styleId: r.StyleId,
3499
- css: r.Style?.css,
3500
- common: r.Style?.common
3539
+ wr(t).then((s) => {
3540
+ if (!s.StyleId) return;
3541
+ const r = {
3542
+ styleId: s.StyleId,
3543
+ css: s.Style?.css,
3544
+ common: s.Style?.common
3501
3545
  };
3502
- this.uiStyles.set(s.styleId, s), this.notifyUiStyle(s);
3503
- }).catch((r) => {
3504
- C.error("Failed to handle UI styles", r);
3546
+ this.uiStyles.set(r.styleId, r), this.notifyUiStyle(r);
3547
+ }).catch((s) => {
3548
+ y.error("Failed to handle UI styles", s);
3505
3549
  });
3506
3550
  }
3507
3551
  handleUiStylesBatch(t) {
3508
- Us(t).then((r) => {
3509
- if (r.Styles)
3510
- for (const s of r.Styles) {
3511
- if (!s.StyleId) continue;
3552
+ gr(t).then((s) => {
3553
+ if (s.Styles)
3554
+ for (const r of s.Styles) {
3555
+ if (!r.StyleId) continue;
3512
3556
  const n = {
3513
- styleId: s.StyleId,
3514
- css: s.Style?.css,
3515
- common: s.Style?.common
3557
+ styleId: r.StyleId,
3558
+ css: r.Style?.css,
3559
+ common: r.Style?.common
3516
3560
  };
3517
3561
  this.uiStyles.set(n.styleId, n), this.notifyUiStyle(n);
3518
3562
  }
3519
- }).catch((r) => {
3520
- C.error("Failed to handle UI styles batch", r);
3563
+ }).catch((s) => {
3564
+ y.error("Failed to handle UI styles batch", s);
3521
3565
  });
3522
3566
  }
3523
3567
  handleUiStylesDelete(t) {
3524
- Bs(t).then((r) => {
3525
- if (!(!r.StyleIds || r.StyleIds.length === 0)) {
3526
- for (const s of r.StyleIds)
3527
- this.uiStyles.delete(s);
3528
- this.notifyUiStyleDelete(r.StyleIds);
3529
- }
3530
- }).catch((r) => {
3531
- C.error("Failed to handle UI styles delete", r);
3568
+ Wr(t).then((s) => {
3569
+ if (!(!s.StyleIds || s.StyleIds.length === 0)) {
3570
+ for (const r of s.StyleIds)
3571
+ this.uiStyles.delete(r);
3572
+ this.notifyUiStyleDelete(s.StyleIds);
3573
+ }
3574
+ }).catch((s) => {
3575
+ y.error("Failed to handle UI styles delete", s);
3532
3576
  });
3533
3577
  }
3534
3578
  handleClearStream(t) {
3535
- const r = ae(t), s = `${r.senderId}_${r.trackId}`;
3536
- this.uiStore.clear(s), this.notifyUiStreamCleared(s);
3579
+ const s = ae(t), r = `${s.senderId}_${s.trackId}`;
3580
+ this.uiStore.clear(r), this.notifyUiStreamCleared(r);
3537
3581
  }
3538
- notifyUiUpdate(t, r) {
3539
- for (const s of this.uiUpdateListeners)
3540
- s(t, r);
3582
+ notifyUiUpdate(t, s) {
3583
+ for (const r of this.uiUpdateListeners)
3584
+ r(t, s);
3541
3585
  }
3542
3586
  notifyUiStyle(t) {
3543
- for (const r of this.uiStyleListeners)
3544
- r(t);
3587
+ for (const s of this.uiStyleListeners)
3588
+ s(t);
3545
3589
  }
3546
3590
  notifyUiStyleDelete(t) {
3547
- for (const r of this.uiStyleDeleteListeners)
3548
- r(t);
3591
+ for (const s of this.uiStyleDeleteListeners)
3592
+ s(t);
3549
3593
  }
3550
3594
  notifyUiStreamCleared(t) {
3551
- for (const r of this.uiStreamClearedListeners)
3552
- r(t);
3595
+ for (const s of this.uiStreamClearedListeners)
3596
+ s(t);
3553
3597
  }
3554
- sendUiUpdateAck(t, r, s) {
3555
- if (this.client && !(!Number.isFinite(r) || r < 0))
3598
+ sendUiUpdateAck(t, s, r) {
3599
+ if (this.client && !(!Number.isFinite(s) || s < 0))
3556
3600
  try {
3557
- const n = s !== void 0 ? { trackId: t, targetIds: [s] } : { trackId: t }, i = Zs({ Version: r }, this.client.sessionId ?? 0, n);
3601
+ const n = r !== void 0 ? { trackId: t, targetIds: [r] } : { trackId: t }, i = on({ Version: s }, this.client.sessionId ?? 0, n);
3558
3602
  this.client.sendProtocolMessage(i);
3559
3603
  } catch (n) {
3560
- C.warn("Failed to send UI update ack", n);
3604
+ y.warn("Failed to send UI update ack", n);
3605
+ }
3606
+ }
3607
+ requestResync(t, s) {
3608
+ const r = `${s}_${t}`;
3609
+ if (this.resyncDebounceTimers.has(r))
3610
+ return;
3611
+ const n = setTimeout(() => {
3612
+ this.resyncDebounceTimers.delete(r), this.sendResyncRequest(t, s);
3613
+ }, Zi);
3614
+ this.resyncDebounceTimers.set(r, n);
3615
+ }
3616
+ sendResyncRequest(t, s) {
3617
+ if (this.client)
3618
+ try {
3619
+ const r = _r({ TrackId: t }, this.client.sessionId ?? 0, { trackId: t, targetIds: [s] });
3620
+ this.client.sendProtocolMessage(r);
3621
+ } catch (r) {
3622
+ y.warn("Failed to send UI resync request", r);
3561
3623
  }
3562
3624
  }
3563
3625
  }
3564
3626
  export {
3565
- Oi as HandlerCache,
3566
- Ji as IkonUiCore,
3567
- Yi as LiveSnapshotCache,
3568
- Fi as UiStore,
3569
- bi as UiStreamStore,
3627
+ ki as HandlerCache,
3628
+ ro as IkonUiCore,
3629
+ zi as LiveSnapshotCache,
3630
+ Bi as UiStore,
3631
+ vi as UiStreamStore,
3570
3632
  D as UiUpdateParseError,
3571
3633
  Ie as parseUiUpdate,
3572
- zi as prefetchBootSnapshot
3634
+ so as prefetchBootSnapshot
3573
3635
  };