@ikonai/sdk-ui 0.0.42 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{ui-worker-CBwhM0DU.js → ui-worker-CcCXE6uz.js} +820 -642
- package/ikon-ui-core.d.ts +5 -0
- package/index.d.ts +1 -1
- package/index.js +1483 -1279
- package/package.json +1 -1
- package/ui-store.d.ts +2 -2
- package/ui-types.d.ts +33 -3
package/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { createLogger as zt, readOpcode as Jt, readProtocolMessageHeaders as
|
|
1
|
+
import { createLogger as zt, readOpcode as Jt, readProtocolMessageHeaders as nt } from "@ikonai/sdk";
|
|
2
2
|
const P = 27;
|
|
3
3
|
function qt(e) {
|
|
4
|
-
const t = G(e),
|
|
4
|
+
const t = G(e), s = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
5
5
|
if (t.length < P)
|
|
6
6
|
throw new Error("Protocol payload too short");
|
|
7
|
-
const
|
|
7
|
+
const r = s.getUint32(0, !0), i = s.getUint32(4, !0), n = s.getUint32(8, !0), o = s.getUint32(12, !0), a = s.getUint32(16, !0), l = s.getUint32(20, !0), u = s.getUint8(24), I = s.getUint8(25), c = s.getUint8(26);
|
|
8
8
|
if (P + l * 4 > t.length)
|
|
9
9
|
throw new Error("Protocol header exceeds payload length");
|
|
10
10
|
const E = [];
|
|
11
|
-
let
|
|
12
|
-
for (let
|
|
13
|
-
E.push(
|
|
11
|
+
let _ = P;
|
|
12
|
+
for (let y = 0; y < l; y++)
|
|
13
|
+
E.push(s.getUint32(_, !0)), _ += 4;
|
|
14
14
|
return {
|
|
15
|
-
length:
|
|
15
|
+
length: r,
|
|
16
16
|
opcode: i,
|
|
17
17
|
senderId: n,
|
|
18
18
|
trackId: o,
|
|
@@ -23,104 +23,104 @@ function qt(e) {
|
|
|
23
23
|
flags: c
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
26
|
+
function M(e, t, s) {
|
|
27
|
+
const r = G(e), i = qt(r);
|
|
28
28
|
if (t !== void 0 && i.opcode !== t)
|
|
29
29
|
throw new Error(`Unexpected opcode ${i.opcode}`);
|
|
30
|
-
if (
|
|
30
|
+
if (s !== void 0 && i.payloadVersion !== s)
|
|
31
31
|
throw new Error(`Unexpected payload version ${i.payloadVersion}`);
|
|
32
32
|
if (i.payloadType !== 8)
|
|
33
33
|
throw new Error(`Unexpected payload type ${i.payloadType}`);
|
|
34
34
|
const n = P + i.targetIds.length * 4;
|
|
35
|
-
return
|
|
35
|
+
return r.subarray(n, i.length);
|
|
36
36
|
}
|
|
37
|
-
function Qt(e, t,
|
|
37
|
+
function Qt(e, t, s, r, i) {
|
|
38
38
|
const n = i?.trackId ?? 0, o = i?.sequenceId ?? 0, a = i?.flags ?? 0, l = i?.targetIds ?? [], u = i?.payloadType ?? 8, I = P + l.length * 4, c = I + t.length, h = new Uint8Array(c), E = new DataView(h.buffer);
|
|
39
|
-
E.setUint32(0, c, !0), E.setUint32(4, e >>> 0, !0), E.setUint32(8,
|
|
40
|
-
let
|
|
41
|
-
for (let
|
|
42
|
-
E.setUint32(
|
|
39
|
+
E.setUint32(0, c, !0), E.setUint32(4, e >>> 0, !0), E.setUint32(8, r >>> 0, !0), E.setUint32(12, n >>> 0, !0), E.setUint32(16, o >>> 0, !0), E.setUint32(20, l.length >>> 0, !0), E.setUint8(24, s & 255), E.setUint8(25, u & 255), E.setUint8(26, a & 255);
|
|
40
|
+
let _ = P;
|
|
41
|
+
for (let y = 0; y < l.length; y++)
|
|
42
|
+
E.setUint32(_, l[y] >>> 0, !0), _ += 4;
|
|
43
43
|
return h.set(t, I), h;
|
|
44
44
|
}
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
class
|
|
45
|
+
var C = /* @__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))(C || {});
|
|
46
|
+
const lt = 161, It = 162, Y = new TextEncoder(), Zt = new TextDecoder("utf-8", { fatal: !0 });
|
|
47
|
+
class B {
|
|
48
48
|
constructor(t = 1) {
|
|
49
|
-
this.version = t, this.buffer.writeByte(
|
|
49
|
+
this.version = t, this.buffer.writeByte(lt), this.buffer.writeVarUInt(t >>> 0);
|
|
50
50
|
}
|
|
51
|
-
buffer = new
|
|
51
|
+
buffer = new O();
|
|
52
52
|
closed = !1;
|
|
53
53
|
cached;
|
|
54
|
-
writeInt32Field(t,
|
|
55
|
-
this.writeFixedField(t, 3, () => this.buffer.writeInt32(
|
|
54
|
+
writeInt32Field(t, s) {
|
|
55
|
+
this.writeFixedField(t, 3, () => this.buffer.writeInt32(s | 0));
|
|
56
56
|
}
|
|
57
|
-
writeUInt32Field(t,
|
|
58
|
-
this.writeFixedField(t, 5, () => this.buffer.writeUInt32(
|
|
57
|
+
writeUInt32Field(t, s) {
|
|
58
|
+
this.writeFixedField(t, 5, () => this.buffer.writeUInt32(s >>> 0));
|
|
59
59
|
}
|
|
60
|
-
writeInt64Field(t,
|
|
61
|
-
this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(
|
|
60
|
+
writeInt64Field(t, s) {
|
|
61
|
+
this.writeFixedField(t, 4, () => this.buffer.writeBigInt64(s));
|
|
62
62
|
}
|
|
63
|
-
writeUInt64Field(t,
|
|
64
|
-
this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(
|
|
63
|
+
writeUInt64Field(t, s) {
|
|
64
|
+
this.writeFixedField(t, 6, () => this.buffer.writeBigUInt64(s));
|
|
65
65
|
}
|
|
66
|
-
writeFloat32Field(t,
|
|
67
|
-
this.writeFixedField(t, 7, () => this.buffer.writeFloat32(
|
|
66
|
+
writeFloat32Field(t, s) {
|
|
67
|
+
this.writeFixedField(t, 7, () => this.buffer.writeFloat32(s));
|
|
68
68
|
}
|
|
69
|
-
writeFloat64Field(t,
|
|
70
|
-
this.writeFixedField(t, 8, () => this.buffer.writeFloat64(
|
|
69
|
+
writeFloat64Field(t, s) {
|
|
70
|
+
this.writeFixedField(t, 8, () => this.buffer.writeFloat64(s));
|
|
71
71
|
}
|
|
72
|
-
writeBoolField(t,
|
|
73
|
-
this.writeFixedField(t, 2, () => this.buffer.writeByte(
|
|
72
|
+
writeBoolField(t, s) {
|
|
73
|
+
this.writeFixedField(t, 2, () => this.buffer.writeByte(s ? 1 : 0));
|
|
74
74
|
}
|
|
75
|
-
writeGuidField(t,
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
75
|
+
writeGuidField(t, s) {
|
|
76
|
+
const r = s instanceof d ? s.asBytes() : s;
|
|
77
|
+
if (r.length !== 16)
|
|
78
78
|
throw new Error("Guid payload must be 16 bytes");
|
|
79
|
-
this.writeFixedField(t, 14, () => this.buffer.writeBytes(
|
|
79
|
+
this.writeFixedField(t, 14, () => this.buffer.writeBytes(r));
|
|
80
80
|
}
|
|
81
|
-
writeStringField(t,
|
|
82
|
-
const
|
|
83
|
-
this.writeVariableField(t, 12,
|
|
81
|
+
writeStringField(t, s) {
|
|
82
|
+
const r = Y.encode(s ?? "");
|
|
83
|
+
this.writeVariableField(t, 12, r);
|
|
84
84
|
}
|
|
85
|
-
writeBinaryField(t,
|
|
86
|
-
this.writeVariableField(t, 13,
|
|
85
|
+
writeBinaryField(t, s) {
|
|
86
|
+
this.writeVariableField(t, 13, s);
|
|
87
87
|
}
|
|
88
|
-
writeObjectField(t,
|
|
89
|
-
const i = new
|
|
90
|
-
|
|
88
|
+
writeObjectField(t, s, r) {
|
|
89
|
+
const i = new B(s);
|
|
90
|
+
r(i);
|
|
91
91
|
const n = i.finish();
|
|
92
92
|
this.writeVariableField(t, 11, n);
|
|
93
93
|
}
|
|
94
|
-
writeArrayField(t,
|
|
95
|
-
const i = new
|
|
96
|
-
|
|
94
|
+
writeArrayField(t, s, r) {
|
|
95
|
+
const i = new K(s);
|
|
96
|
+
r(i);
|
|
97
97
|
const n = i.finish();
|
|
98
98
|
this.writeVariableField(t, 9, n);
|
|
99
99
|
}
|
|
100
|
-
writeDictionaryField(t,
|
|
101
|
-
const n = new Q(
|
|
100
|
+
writeDictionaryField(t, s, r, i) {
|
|
101
|
+
const n = new Q(s, r);
|
|
102
102
|
i(n);
|
|
103
103
|
const o = n.finish();
|
|
104
104
|
this.writeVariableField(t, 10, o);
|
|
105
105
|
}
|
|
106
106
|
finish() {
|
|
107
|
-
return this.closed || (this.buffer.writeByte(
|
|
107
|
+
return this.closed || (this.buffer.writeByte(It), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
|
|
108
108
|
}
|
|
109
|
-
writeFixedField(t,
|
|
110
|
-
this.writeFieldHeader(t,
|
|
109
|
+
writeFixedField(t, s, r) {
|
|
110
|
+
this.writeFieldHeader(t, s, 0), r();
|
|
111
111
|
}
|
|
112
|
-
writeVariableField(t,
|
|
113
|
-
this.writeFieldHeader(t,
|
|
112
|
+
writeVariableField(t, s, r) {
|
|
113
|
+
this.writeFieldHeader(t, s, r.length), this.buffer.writeBytes(r);
|
|
114
114
|
}
|
|
115
|
-
writeFieldHeader(t,
|
|
116
|
-
this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(
|
|
115
|
+
writeFieldHeader(t, s, r) {
|
|
116
|
+
this.buffer.writeUInt32(t >>> 0), this.buffer.writeByte(W(s)), ie(s) && this.buffer.writeVarUInt(r >>> 0);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
class
|
|
119
|
+
class K {
|
|
120
120
|
constructor(t) {
|
|
121
121
|
this.elementType = t;
|
|
122
122
|
}
|
|
123
|
-
payload = new
|
|
123
|
+
payload = new O();
|
|
124
124
|
count = 0;
|
|
125
125
|
writeInt32(t) {
|
|
126
126
|
this.ensureElementType(
|
|
@@ -169,18 +169,18 @@ class j {
|
|
|
169
169
|
14
|
|
170
170
|
/* Guid */
|
|
171
171
|
), this.count++;
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
172
|
+
const s = t instanceof d ? t.asBytes() : t;
|
|
173
|
+
if (s.length !== 16)
|
|
174
174
|
throw new Error("Guid payload must be 16 bytes");
|
|
175
|
-
this.payload.writeBytes(
|
|
175
|
+
this.payload.writeBytes(s);
|
|
176
176
|
}
|
|
177
177
|
writeString(t) {
|
|
178
178
|
this.ensureElementType(
|
|
179
179
|
12
|
|
180
180
|
/* String */
|
|
181
181
|
), this.count++;
|
|
182
|
-
const
|
|
183
|
-
this.payload.writeVarUInt(
|
|
182
|
+
const s = Y.encode(t ?? "");
|
|
183
|
+
this.payload.writeVarUInt(s.length), this.payload.writeBytes(s);
|
|
184
184
|
}
|
|
185
185
|
writeBinary(t) {
|
|
186
186
|
this.ensureElementType(
|
|
@@ -188,50 +188,50 @@ class j {
|
|
|
188
188
|
/* Binary */
|
|
189
189
|
), this.count++, this.payload.writeVarUInt(t.length), this.payload.writeBytes(t);
|
|
190
190
|
}
|
|
191
|
-
writeObject(t,
|
|
191
|
+
writeObject(t, s) {
|
|
192
192
|
this.ensureElementType(
|
|
193
193
|
11
|
|
194
194
|
/* Object */
|
|
195
195
|
), this.count++;
|
|
196
|
-
const
|
|
197
|
-
r
|
|
198
|
-
const i =
|
|
196
|
+
const r = new B(t);
|
|
197
|
+
s(r);
|
|
198
|
+
const i = r.finish();
|
|
199
199
|
this.payload.writeVarUInt(i.length), this.payload.writeBytes(i);
|
|
200
200
|
}
|
|
201
|
-
writeArray(t,
|
|
201
|
+
writeArray(t, s) {
|
|
202
202
|
this.ensureElementType(
|
|
203
203
|
9
|
|
204
204
|
/* Array */
|
|
205
205
|
), this.count++;
|
|
206
|
-
const
|
|
207
|
-
r
|
|
208
|
-
const i =
|
|
206
|
+
const r = new K(t);
|
|
207
|
+
s(r);
|
|
208
|
+
const i = r.finish();
|
|
209
209
|
this.payload.writeBytes(i);
|
|
210
210
|
}
|
|
211
|
-
writeDictionary(t,
|
|
211
|
+
writeDictionary(t, s, r) {
|
|
212
212
|
this.ensureElementType(
|
|
213
213
|
10
|
|
214
214
|
/* Dict */
|
|
215
215
|
), this.count++;
|
|
216
|
-
const i = new Q(t,
|
|
217
|
-
|
|
216
|
+
const i = new Q(t, s);
|
|
217
|
+
r(i);
|
|
218
218
|
const n = i.finish();
|
|
219
219
|
this.payload.writeBytes(n);
|
|
220
220
|
}
|
|
221
221
|
finish() {
|
|
222
|
-
const t = new
|
|
223
|
-
return t.writeByte(
|
|
222
|
+
const t = new O();
|
|
223
|
+
return t.writeByte(W(this.elementType)), t.writeVarUInt(this.count), t.writeBytes(this.payload.toUint8Array()), t.toUint8Array();
|
|
224
224
|
}
|
|
225
225
|
ensureElementType(t) {
|
|
226
226
|
if (this.elementType !== t)
|
|
227
|
-
throw new Error(`Array element type is ${
|
|
227
|
+
throw new Error(`Array element type is ${C[this.elementType]}, expected ${C[t]}`);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
class Q {
|
|
231
|
-
constructor(t,
|
|
232
|
-
this.keyType = t, this.valueType =
|
|
231
|
+
constructor(t, s) {
|
|
232
|
+
this.keyType = t, this.valueType = s, et(t);
|
|
233
233
|
}
|
|
234
|
-
payload = new
|
|
234
|
+
payload = new O();
|
|
235
235
|
count = 0;
|
|
236
236
|
entryOpen = !1;
|
|
237
237
|
beginEntry() {
|
|
@@ -244,13 +244,13 @@ class Q {
|
|
|
244
244
|
finish() {
|
|
245
245
|
if (this.entryOpen)
|
|
246
246
|
throw new Error("Dictionary entry not completed");
|
|
247
|
-
const t = new
|
|
248
|
-
return t.writeByte(
|
|
247
|
+
const t = new O();
|
|
248
|
+
return t.writeByte(W(this.keyType)), t.writeByte(W(this.valueType)), t.writeVarUInt(this.count), t.writeBytes(this.payload.toUint8Array()), t.toUint8Array();
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
class te {
|
|
252
|
-
constructor(t,
|
|
253
|
-
this.keyType = t, this.valueType =
|
|
252
|
+
constructor(t, s, r, i) {
|
|
253
|
+
this.keyType = t, this.valueType = s, this.payload = r, this.onComplete = i;
|
|
254
254
|
}
|
|
255
255
|
keyWritten = !1;
|
|
256
256
|
valueWritten = !1;
|
|
@@ -302,18 +302,18 @@ class te {
|
|
|
302
302
|
14
|
|
303
303
|
/* Guid */
|
|
304
304
|
);
|
|
305
|
-
const
|
|
306
|
-
if (
|
|
305
|
+
const s = t instanceof d ? t.asBytes() : t;
|
|
306
|
+
if (s.length !== 16)
|
|
307
307
|
throw new Error("Guid payload must be 16 bytes");
|
|
308
|
-
this.payload.writeBytes(
|
|
308
|
+
this.payload.writeBytes(s), this.keyWritten = !0;
|
|
309
309
|
}
|
|
310
310
|
writeKeyString(t) {
|
|
311
311
|
this.ensureKeyType(
|
|
312
312
|
12
|
|
313
313
|
/* String */
|
|
314
314
|
);
|
|
315
|
-
const
|
|
316
|
-
this.payload.writeVarUInt(
|
|
315
|
+
const s = Y.encode(t ?? "");
|
|
316
|
+
this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.keyWritten = !0;
|
|
317
317
|
}
|
|
318
318
|
writeKeyBinary(t) {
|
|
319
319
|
this.ensureKeyType(
|
|
@@ -368,10 +368,10 @@ class te {
|
|
|
368
368
|
14
|
|
369
369
|
/* Guid */
|
|
370
370
|
);
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
371
|
+
const s = t instanceof d ? t.asBytes() : t;
|
|
372
|
+
if (s.length !== 16)
|
|
373
373
|
throw new Error("Guid payload must be 16 bytes");
|
|
374
|
-
this.payload.writeBytes(
|
|
374
|
+
this.payload.writeBytes(s), this.valueWritten = !0;
|
|
375
375
|
}
|
|
376
376
|
writeNullValue() {
|
|
377
377
|
this.ensureValueType(
|
|
@@ -390,36 +390,36 @@ class te {
|
|
|
390
390
|
12
|
|
391
391
|
/* String */
|
|
392
392
|
);
|
|
393
|
-
const
|
|
394
|
-
this.payload.writeVarUInt(
|
|
393
|
+
const s = Y.encode(t ?? "");
|
|
394
|
+
this.payload.writeVarUInt(s.length), this.payload.writeBytes(s), this.valueWritten = !0;
|
|
395
395
|
}
|
|
396
|
-
writeValueObject(t,
|
|
396
|
+
writeValueObject(t, s) {
|
|
397
397
|
this.ensureValueType(
|
|
398
398
|
11
|
|
399
399
|
/* Object */
|
|
400
400
|
);
|
|
401
|
-
const
|
|
402
|
-
r
|
|
403
|
-
const i =
|
|
401
|
+
const r = new B(t);
|
|
402
|
+
s(r);
|
|
403
|
+
const i = r.finish();
|
|
404
404
|
this.payload.writeVarUInt(i.length), this.payload.writeBytes(i), this.valueWritten = !0;
|
|
405
405
|
}
|
|
406
|
-
writeValueArray(t,
|
|
406
|
+
writeValueArray(t, s) {
|
|
407
407
|
this.ensureValueType(
|
|
408
408
|
9
|
|
409
409
|
/* Array */
|
|
410
410
|
);
|
|
411
|
-
const
|
|
412
|
-
r
|
|
413
|
-
const i =
|
|
411
|
+
const r = new K(t);
|
|
412
|
+
s(r);
|
|
413
|
+
const i = r.finish();
|
|
414
414
|
this.payload.writeBytes(i), this.valueWritten = !0;
|
|
415
415
|
}
|
|
416
|
-
writeValueDictionary(t,
|
|
416
|
+
writeValueDictionary(t, s, r) {
|
|
417
417
|
this.ensureValueType(
|
|
418
418
|
10
|
|
419
419
|
/* Dict */
|
|
420
420
|
);
|
|
421
|
-
const i = new Q(t,
|
|
422
|
-
|
|
421
|
+
const i = new Q(t, s);
|
|
422
|
+
r(i);
|
|
423
423
|
const n = i.finish();
|
|
424
424
|
this.payload.writeBytes(n), this.valueWritten = !0;
|
|
425
425
|
}
|
|
@@ -432,27 +432,27 @@ class te {
|
|
|
432
432
|
}
|
|
433
433
|
ensureKeyType(t) {
|
|
434
434
|
if (this.keyType !== t)
|
|
435
|
-
throw new Error(`Dictionary key type is ${
|
|
435
|
+
throw new Error(`Dictionary key type is ${C[this.keyType]}, expected ${C[t]}`);
|
|
436
436
|
}
|
|
437
437
|
ensureValueType(t) {
|
|
438
438
|
if (this.valueType !== t)
|
|
439
|
-
throw new Error(`Dictionary value type is ${
|
|
439
|
+
throw new Error(`Dictionary value type is ${C[this.valueType]}, expected ${C[t]}`);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
class
|
|
443
|
-
constructor(t,
|
|
444
|
-
this.buffer = t, this.version =
|
|
442
|
+
class p {
|
|
443
|
+
constructor(t, s, r) {
|
|
444
|
+
this.buffer = t, this.version = s, this.offset = r, this.end = t.length - 1;
|
|
445
445
|
}
|
|
446
446
|
offset;
|
|
447
447
|
end;
|
|
448
448
|
static create(t) {
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
449
|
+
const s = G(t);
|
|
450
|
+
if (s.length < 2)
|
|
451
451
|
throw new Error("Teleport payload too short");
|
|
452
|
-
if (
|
|
452
|
+
if (s[0] !== lt || s[s.length - 1] !== It)
|
|
453
453
|
throw new Error("Teleport object missing markers");
|
|
454
|
-
const
|
|
455
|
-
return new
|
|
454
|
+
const r = { offset: 1 }, i = U(s, r, "InvalidLength");
|
|
455
|
+
return new p(s, i, r.offset);
|
|
456
456
|
}
|
|
457
457
|
next() {
|
|
458
458
|
if (this.offset >= this.end)
|
|
@@ -461,23 +461,23 @@ class g {
|
|
|
461
461
|
throw new Error("Teleport object truncated");
|
|
462
462
|
const t = ne(this.buffer, this.offset);
|
|
463
463
|
this.offset += 4;
|
|
464
|
-
const
|
|
465
|
-
if ((
|
|
464
|
+
const s = this.buffer[this.offset++], r = s >> 4 & 15;
|
|
465
|
+
if ((s & 15) !== 0)
|
|
466
466
|
throw new Error("Teleport field flags must be zero");
|
|
467
|
-
const i = F(
|
|
467
|
+
const i = F(r);
|
|
468
468
|
let n;
|
|
469
469
|
if (i >= 0)
|
|
470
|
-
|
|
470
|
+
N(this.buffer, this.offset, i), n = this.buffer.subarray(this.offset, this.offset + i), this.offset += i;
|
|
471
471
|
else {
|
|
472
|
-
const o = { offset: this.offset }, a =
|
|
473
|
-
|
|
472
|
+
const o = { offset: this.offset }, a = U(this.buffer, o, "InvalidLength");
|
|
473
|
+
N(this.buffer, o.offset, a), n = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
|
|
474
474
|
}
|
|
475
|
-
return new ee(t,
|
|
475
|
+
return new ee(t, r, n);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
class
|
|
479
|
-
constructor(t,
|
|
480
|
-
this.type = t, this.payload =
|
|
478
|
+
class L {
|
|
479
|
+
constructor(t, s) {
|
|
480
|
+
this.type = t, this.payload = s;
|
|
481
481
|
}
|
|
482
482
|
asInt32() {
|
|
483
483
|
return this.ensureType(
|
|
@@ -543,13 +543,13 @@ class m {
|
|
|
543
543
|
return this.ensureType(
|
|
544
544
|
14
|
|
545
545
|
/* Guid */
|
|
546
|
-
),
|
|
546
|
+
), d.fromBytes(this.payload);
|
|
547
547
|
}
|
|
548
548
|
asObject() {
|
|
549
549
|
return this.ensureType(
|
|
550
550
|
11
|
|
551
551
|
/* Object */
|
|
552
|
-
),
|
|
552
|
+
), p.create(this.payload);
|
|
553
553
|
}
|
|
554
554
|
asArray() {
|
|
555
555
|
return this.ensureType(
|
|
@@ -565,12 +565,12 @@ class m {
|
|
|
565
565
|
}
|
|
566
566
|
ensureType(t) {
|
|
567
567
|
if (this.type !== t)
|
|
568
|
-
throw new Error(`Teleport value has type ${
|
|
568
|
+
throw new Error(`Teleport value has type ${C[this.type]}, expected ${C[t]}`);
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
class ee extends
|
|
572
|
-
constructor(t,
|
|
573
|
-
super(
|
|
571
|
+
class ee extends L {
|
|
572
|
+
constructor(t, s, r) {
|
|
573
|
+
super(s, r), this.fieldId = t;
|
|
574
574
|
}
|
|
575
575
|
get isNull() {
|
|
576
576
|
return this.type === 1;
|
|
@@ -585,11 +585,11 @@ class Z {
|
|
|
585
585
|
constructor(t) {
|
|
586
586
|
if (this.payload = t, t.length === 0)
|
|
587
587
|
throw new Error("Array payload too short");
|
|
588
|
-
const
|
|
589
|
-
if (this.elementType =
|
|
588
|
+
const s = t[0];
|
|
589
|
+
if (this.elementType = s >> 4 & 15, (s & 15) !== 0)
|
|
590
590
|
throw new Error("Array flags must be zero");
|
|
591
|
-
const
|
|
592
|
-
this.count =
|
|
591
|
+
const r = { offset: 1 };
|
|
592
|
+
this.count = U(t, r, "ArrayMalformed"), this.offset = r.offset;
|
|
593
593
|
}
|
|
594
594
|
static create(t) {
|
|
595
595
|
return new Z(G(t));
|
|
@@ -614,39 +614,39 @@ class Z {
|
|
|
614
614
|
case 6:
|
|
615
615
|
case 14: {
|
|
616
616
|
const t = F(this.elementType);
|
|
617
|
-
|
|
618
|
-
const
|
|
619
|
-
return this.offset += t, new
|
|
617
|
+
N(this.payload, this.offset, t);
|
|
618
|
+
const s = this.payload.subarray(this.offset, this.offset + t);
|
|
619
|
+
return this.offset += t, new v(this.elementType, s);
|
|
620
620
|
}
|
|
621
621
|
case 12:
|
|
622
622
|
case 13: {
|
|
623
|
-
const t = { offset: this.offset },
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
-
return this.offset = t.offset +
|
|
623
|
+
const t = { offset: this.offset }, s = U(this.payload, t, "ArrayMalformed");
|
|
624
|
+
N(this.payload, t.offset, s);
|
|
625
|
+
const r = this.payload.subarray(t.offset, t.offset + s);
|
|
626
|
+
return this.offset = t.offset + s, new v(this.elementType, r);
|
|
627
627
|
}
|
|
628
628
|
case 11: {
|
|
629
|
-
const t = { offset: this.offset },
|
|
630
|
-
|
|
631
|
-
const
|
|
632
|
-
return this.offset = t.offset +
|
|
629
|
+
const t = { offset: this.offset }, s = U(this.payload, t, "ArrayMalformed");
|
|
630
|
+
N(this.payload, t.offset, s);
|
|
631
|
+
const r = this.payload.subarray(t.offset, t.offset + s);
|
|
632
|
+
return this.offset = t.offset + s, new v(11, r);
|
|
633
633
|
}
|
|
634
634
|
case 9: {
|
|
635
|
-
const t =
|
|
636
|
-
return this.offset += t, new
|
|
635
|
+
const t = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
|
|
636
|
+
return this.offset += t, new v(9, s);
|
|
637
637
|
}
|
|
638
638
|
case 10: {
|
|
639
|
-
const t =
|
|
640
|
-
return this.offset += t, new
|
|
639
|
+
const t = rt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
|
|
640
|
+
return this.offset += t, new v(10, s);
|
|
641
641
|
}
|
|
642
642
|
default:
|
|
643
|
-
throw new Error(`Unsupported array element type ${
|
|
643
|
+
throw new Error(`Unsupported array element type ${C[this.elementType]}`);
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
class
|
|
648
|
-
constructor(t,
|
|
649
|
-
super(t,
|
|
647
|
+
class v extends L {
|
|
648
|
+
constructor(t, s) {
|
|
649
|
+
super(t, s);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
class tt {
|
|
@@ -662,8 +662,8 @@ class tt {
|
|
|
662
662
|
if (this.keyType = t[0] >> 4 & 15, this.valueType = t[1] >> 4 & 15, (t[0] & 15) !== 0 || (t[1] & 15) !== 0)
|
|
663
663
|
throw new Error("Dictionary key/value flags must be zero");
|
|
664
664
|
et(this.keyType);
|
|
665
|
-
const
|
|
666
|
-
this.count =
|
|
665
|
+
const s = { offset: 2 };
|
|
666
|
+
this.count = U(t, s, "DictMalformed"), this.offset = s.offset;
|
|
667
667
|
}
|
|
668
668
|
static create(t) {
|
|
669
669
|
return new tt(G(t));
|
|
@@ -674,21 +674,21 @@ class tt {
|
|
|
674
674
|
throw new Error("Dictionary payload contains trailing data");
|
|
675
675
|
return null;
|
|
676
676
|
}
|
|
677
|
-
const t = this.readKey(),
|
|
678
|
-
return this.index++, new
|
|
677
|
+
const t = this.readKey(), s = this.readValue();
|
|
678
|
+
return this.index++, new se(t, s);
|
|
679
679
|
}
|
|
680
680
|
readKey() {
|
|
681
681
|
const t = F(this.keyType);
|
|
682
682
|
if (t >= 0) {
|
|
683
|
-
|
|
684
|
-
const
|
|
685
|
-
return this.offset += t, new
|
|
683
|
+
N(this.payload, this.offset, t);
|
|
684
|
+
const s = this.payload.subarray(this.offset, this.offset + t);
|
|
685
|
+
return this.offset += t, new L(this.keyType, s);
|
|
686
686
|
}
|
|
687
687
|
if (this.keyType === 12 || this.keyType === 13) {
|
|
688
|
-
const
|
|
689
|
-
|
|
690
|
-
const i = this.payload.subarray(
|
|
691
|
-
return this.offset =
|
|
688
|
+
const s = { offset: this.offset }, r = U(this.payload, s, "DictMalformed");
|
|
689
|
+
N(this.payload, s.offset, r);
|
|
690
|
+
const i = this.payload.subarray(s.offset, s.offset + r);
|
|
691
|
+
return this.offset = s.offset + r, new L(this.keyType, i);
|
|
692
692
|
}
|
|
693
693
|
throw new Error("Unsupported dictionary key type");
|
|
694
694
|
}
|
|
@@ -696,24 +696,24 @@ class tt {
|
|
|
696
696
|
switch (this.valueType) {
|
|
697
697
|
case 12:
|
|
698
698
|
case 13: {
|
|
699
|
-
const t = { offset: this.offset },
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
return this.offset = t.offset +
|
|
699
|
+
const t = { offset: this.offset }, s = U(this.payload, t, "DictMalformed");
|
|
700
|
+
N(this.payload, t.offset, s);
|
|
701
|
+
const r = this.payload.subarray(t.offset, t.offset + s);
|
|
702
|
+
return this.offset = t.offset + s, new L(this.valueType, r);
|
|
703
703
|
}
|
|
704
704
|
case 11: {
|
|
705
|
-
const t = { offset: this.offset },
|
|
706
|
-
|
|
707
|
-
const
|
|
708
|
-
return this.offset = t.offset +
|
|
705
|
+
const t = { offset: this.offset }, s = U(this.payload, t, "DictMalformed");
|
|
706
|
+
N(this.payload, t.offset, s);
|
|
707
|
+
const r = this.payload.subarray(t.offset, t.offset + s);
|
|
708
|
+
return this.offset = t.offset + s, new L(11, r);
|
|
709
709
|
}
|
|
710
710
|
case 9: {
|
|
711
|
-
const t =
|
|
712
|
-
return this.offset += t, new
|
|
711
|
+
const t = st(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
|
|
712
|
+
return this.offset += t, new L(9, s);
|
|
713
713
|
}
|
|
714
714
|
case 10: {
|
|
715
|
-
const t =
|
|
716
|
-
return this.offset += t, new
|
|
715
|
+
const t = rt(this.payload, this.offset), s = this.payload.subarray(this.offset, this.offset + t);
|
|
716
|
+
return this.offset += t, new L(10, s);
|
|
717
717
|
}
|
|
718
718
|
case 3:
|
|
719
719
|
case 5:
|
|
@@ -725,151 +725,162 @@ class tt {
|
|
|
725
725
|
case 14:
|
|
726
726
|
case 1: {
|
|
727
727
|
const t = F(this.valueType);
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
return this.offset += t, new
|
|
728
|
+
N(this.payload, this.offset, t);
|
|
729
|
+
const s = this.payload.subarray(this.offset, this.offset + t);
|
|
730
|
+
return this.offset += t, new L(this.valueType, s);
|
|
731
731
|
}
|
|
732
732
|
default:
|
|
733
|
-
throw new Error(`Unsupported dictionary value type ${
|
|
733
|
+
throw new Error(`Unsupported dictionary value type ${C[this.valueType]}`);
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
class
|
|
738
|
-
constructor(t,
|
|
739
|
-
this.key = t, this.value =
|
|
737
|
+
class se {
|
|
738
|
+
constructor(t, s) {
|
|
739
|
+
this.key = t, this.value = s;
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
class
|
|
742
|
+
class d {
|
|
743
743
|
constructor(t) {
|
|
744
744
|
this.bytes = t;
|
|
745
745
|
}
|
|
746
746
|
static fromString(t) {
|
|
747
747
|
if (!t)
|
|
748
748
|
throw new Error("Guid string is empty");
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
749
|
+
const s = t.replace(/-/g, "");
|
|
750
|
+
if (s.length !== 32)
|
|
751
751
|
throw new Error("Guid string must be 32 hex characters");
|
|
752
|
-
const
|
|
753
|
-
|
|
752
|
+
const r = new Uint8Array(16), i = d.parseHexSlice(s, 0, 8), n = d.parseHexSlice(s, 8, 4), o = d.parseHexSlice(s, 12, 4);
|
|
753
|
+
d.writeUInt32LE(r, 0, i), d.writeUInt16LE(r, 4, n), d.writeUInt16LE(r, 6, o);
|
|
754
754
|
for (let a = 0; a < 8; a++)
|
|
755
|
-
|
|
756
|
-
return new
|
|
755
|
+
r[8 + a] = d.parseHexSlice(s, 16 + a * 2, 2);
|
|
756
|
+
return new d(r);
|
|
757
757
|
}
|
|
758
758
|
static fromBytes(t) {
|
|
759
759
|
if (t.length !== 16)
|
|
760
760
|
throw new Error("Guid byte array must be 16 bytes");
|
|
761
|
-
return new
|
|
761
|
+
return new d(Uint8Array.from(t));
|
|
762
762
|
}
|
|
763
763
|
static createZero() {
|
|
764
|
-
return new
|
|
764
|
+
return new d(new Uint8Array(16));
|
|
765
765
|
}
|
|
766
766
|
static createRandom() {
|
|
767
|
-
const t = new Uint8Array(16),
|
|
768
|
-
if (
|
|
769
|
-
|
|
767
|
+
const t = new Uint8Array(16), s = globalThis.crypto;
|
|
768
|
+
if (s?.getRandomValues)
|
|
769
|
+
s.getRandomValues(t);
|
|
770
770
|
else
|
|
771
|
-
for (let
|
|
772
|
-
t[
|
|
773
|
-
return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, new
|
|
771
|
+
for (let r = 0; r < t.length; r++)
|
|
772
|
+
t[r] = Math.floor(Math.random() * 256);
|
|
773
|
+
return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, new d(t);
|
|
774
774
|
}
|
|
775
775
|
toString() {
|
|
776
776
|
const t = this.bytes;
|
|
777
777
|
return [
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
778
|
+
d.toHex(d.readUInt32LE(t, 0), 8),
|
|
779
|
+
d.toHex(d.readUInt16LE(t, 4), 4),
|
|
780
|
+
d.toHex(d.readUInt16LE(t, 6), 4),
|
|
781
|
+
ot(t.subarray(8, 10)),
|
|
782
|
+
ot(t.subarray(10, 16))
|
|
783
783
|
].join("-");
|
|
784
784
|
}
|
|
785
785
|
asBytes() {
|
|
786
786
|
return this.bytes.slice();
|
|
787
787
|
}
|
|
788
|
-
static parseHexSlice(t,
|
|
789
|
-
const i = t.substr(
|
|
788
|
+
static parseHexSlice(t, s, r) {
|
|
789
|
+
const i = t.substr(s, r), n = Number.parseInt(i, 16);
|
|
790
790
|
if (Number.isNaN(n))
|
|
791
791
|
throw new Error("Guid string contains invalid characters");
|
|
792
792
|
return n >>> 0;
|
|
793
793
|
}
|
|
794
|
-
static writeUInt32LE(t,
|
|
795
|
-
const i =
|
|
796
|
-
t[
|
|
794
|
+
static writeUInt32LE(t, s, r) {
|
|
795
|
+
const i = r >>> 0;
|
|
796
|
+
t[s] = i & 255, t[s + 1] = i >>> 8 & 255, t[s + 2] = i >>> 16 & 255, t[s + 3] = i >>> 24 & 255;
|
|
797
797
|
}
|
|
798
|
-
static writeUInt16LE(t,
|
|
799
|
-
const i =
|
|
800
|
-
t[
|
|
798
|
+
static writeUInt16LE(t, s, r) {
|
|
799
|
+
const i = r & 65535;
|
|
800
|
+
t[s] = i & 255, t[s + 1] = i >>> 8 & 255;
|
|
801
801
|
}
|
|
802
|
-
static readUInt32LE(t,
|
|
803
|
-
return (t[
|
|
802
|
+
static readUInt32LE(t, s) {
|
|
803
|
+
return (t[s] | t[s + 1] << 8 | t[s + 2] << 16 | t[s + 3] << 24) >>> 0;
|
|
804
804
|
}
|
|
805
|
-
static readUInt16LE(t,
|
|
806
|
-
return (t[
|
|
805
|
+
static readUInt16LE(t, s) {
|
|
806
|
+
return (t[s] | t[s + 1] << 8) & 65535;
|
|
807
807
|
}
|
|
808
|
-
static toHex(t,
|
|
809
|
-
return (t >>> 0).toString(16).padStart(
|
|
808
|
+
static toHex(t, s) {
|
|
809
|
+
return (t >>> 0).toString(16).padStart(s, "0");
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
class
|
|
813
|
-
|
|
812
|
+
class O {
|
|
813
|
+
static INITIAL_CAPACITY = 256;
|
|
814
|
+
buffer;
|
|
815
|
+
dataView;
|
|
816
|
+
length = 0;
|
|
817
|
+
constructor() {
|
|
818
|
+
this.buffer = new Uint8Array(O.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
|
|
819
|
+
}
|
|
820
|
+
ensureCapacity(t) {
|
|
821
|
+
const s = this.length + t;
|
|
822
|
+
if (s <= this.buffer.length)
|
|
823
|
+
return;
|
|
824
|
+
let r = this.buffer.length;
|
|
825
|
+
for (; r < s; )
|
|
826
|
+
r *= 2;
|
|
827
|
+
const i = new Uint8Array(r);
|
|
828
|
+
i.set(this.buffer.subarray(0, this.length)), this.buffer = i, this.dataView = new DataView(this.buffer.buffer);
|
|
829
|
+
}
|
|
814
830
|
writeByte(t) {
|
|
815
|
-
this.
|
|
831
|
+
this.ensureCapacity(1), this.buffer[this.length++] = t & 255;
|
|
816
832
|
}
|
|
817
833
|
writeBytes(t) {
|
|
818
|
-
|
|
819
|
-
this.bytes.push(t[r]);
|
|
834
|
+
this.ensureCapacity(t.length), this.buffer.set(t, this.length), this.length += t.length;
|
|
820
835
|
}
|
|
821
836
|
writeUInt32(t) {
|
|
822
|
-
this.
|
|
837
|
+
this.ensureCapacity(4), this.dataView.setUint32(this.length, t >>> 0, !0), this.length += 4;
|
|
823
838
|
}
|
|
824
839
|
writeInt32(t) {
|
|
825
|
-
this.
|
|
840
|
+
this.ensureCapacity(4), this.dataView.setInt32(this.length, t | 0, !0), this.length += 4;
|
|
826
841
|
}
|
|
827
842
|
writeFloat32(t) {
|
|
828
|
-
|
|
829
|
-
r.setFloat32(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
|
|
843
|
+
this.ensureCapacity(4), this.dataView.setFloat32(this.length, t, !0), this.length += 4;
|
|
830
844
|
}
|
|
831
845
|
writeFloat64(t) {
|
|
832
|
-
|
|
833
|
-
r.setFloat64(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
|
|
846
|
+
this.ensureCapacity(8), this.dataView.setFloat64(this.length, t, !0), this.length += 8;
|
|
834
847
|
}
|
|
835
848
|
writeBigInt64(t) {
|
|
836
|
-
|
|
837
|
-
r.setBigInt64(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
|
|
849
|
+
this.ensureCapacity(8), this.dataView.setBigInt64(this.length, t, !0), this.length += 8;
|
|
838
850
|
}
|
|
839
851
|
writeBigUInt64(t) {
|
|
840
|
-
|
|
841
|
-
r.setBigUint64(0, t, !0), this.writeBytes(new Uint8Array(r.buffer));
|
|
852
|
+
this.ensureCapacity(8), this.dataView.setBigUint64(this.length, t, !0), this.length += 8;
|
|
842
853
|
}
|
|
843
854
|
writeVarUInt(t) {
|
|
844
|
-
let
|
|
845
|
-
for (;
|
|
846
|
-
this.
|
|
847
|
-
this.
|
|
855
|
+
let s = t >>> 0;
|
|
856
|
+
for (; s >= 128; )
|
|
857
|
+
this.ensureCapacity(1), this.buffer[this.length++] = s & 127 | 128, s >>>= 7;
|
|
858
|
+
this.ensureCapacity(1), this.buffer[this.length++] = s & 127;
|
|
848
859
|
}
|
|
849
860
|
toUint8Array() {
|
|
850
|
-
return
|
|
861
|
+
return this.buffer.slice(0, this.length);
|
|
851
862
|
}
|
|
852
863
|
}
|
|
853
|
-
function
|
|
864
|
+
function U(e, t, s) {
|
|
854
865
|
if (t.offset >= e.length)
|
|
855
|
-
throw new Error(
|
|
856
|
-
let
|
|
866
|
+
throw new Error(s);
|
|
867
|
+
let r = 0, i = 0, n = 0;
|
|
857
868
|
for (; t.offset < e.length; ) {
|
|
858
869
|
const o = e[t.offset++];
|
|
859
|
-
if (n++,
|
|
860
|
-
if (n !==
|
|
870
|
+
if (n++, r |= (o & 127) << i, (o & 128) === 0) {
|
|
871
|
+
if (n !== re(r))
|
|
861
872
|
throw new Error("Teleport VarUInt is not canonical");
|
|
862
|
-
return
|
|
873
|
+
return r >>> 0;
|
|
863
874
|
}
|
|
864
875
|
if (i += 7, i >= 35)
|
|
865
876
|
throw new Error("Teleport VarUInt exceeds 32-bit range");
|
|
866
877
|
}
|
|
867
|
-
throw new Error(
|
|
878
|
+
throw new Error(s);
|
|
868
879
|
}
|
|
869
|
-
function
|
|
880
|
+
function re(e) {
|
|
870
881
|
return e < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5;
|
|
871
882
|
}
|
|
872
|
-
function
|
|
883
|
+
function W(e, t = 0) {
|
|
873
884
|
if ((t & 240) !== 0)
|
|
874
885
|
throw new Error("Teleport flags must fit into 4 bits");
|
|
875
886
|
return (e & 15) << 4 | t & 15;
|
|
@@ -901,1092 +912,1205 @@ function et(e) {
|
|
|
901
912
|
if (e === 9 || e === 11 || e === 10 || e === 1)
|
|
902
913
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
903
914
|
}
|
|
904
|
-
function
|
|
905
|
-
if (t < 0 ||
|
|
915
|
+
function N(e, t, s) {
|
|
916
|
+
if (t < 0 || s < 0 || t + s > e.length)
|
|
906
917
|
throw new Error("Teleport payload exceeds bounds");
|
|
907
918
|
}
|
|
908
919
|
function ne(e, t) {
|
|
909
920
|
return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
|
|
910
921
|
}
|
|
911
|
-
function
|
|
922
|
+
function st(e, t) {
|
|
912
923
|
if (t >= e.length)
|
|
913
924
|
throw new Error("Array payload exceeds bounds");
|
|
914
|
-
const
|
|
915
|
-
if ((
|
|
925
|
+
const s = e[t], r = s >> 4 & 15;
|
|
926
|
+
if ((s & 15) !== 0)
|
|
916
927
|
throw new Error("Array flags must be zero");
|
|
917
|
-
const i = { offset: t + 1 }, n =
|
|
928
|
+
const i = { offset: t + 1 }, n = U(e, i, "ArrayMalformed"), o = F(r);
|
|
918
929
|
if (o >= 0) {
|
|
919
930
|
const l = o * n;
|
|
920
|
-
return
|
|
931
|
+
return N(e, i.offset, l), i.offset + l - t;
|
|
921
932
|
}
|
|
922
933
|
let a = i.offset;
|
|
923
934
|
for (let l = 0; l < n; l++)
|
|
924
|
-
a = X(
|
|
935
|
+
a = X(r, e, a, "ArrayMalformed");
|
|
925
936
|
return a - t;
|
|
926
937
|
}
|
|
927
|
-
function
|
|
938
|
+
function rt(e, t) {
|
|
928
939
|
if (t + 2 > e.length)
|
|
929
940
|
throw new Error("Dictionary payload too short");
|
|
930
|
-
const
|
|
941
|
+
const s = e[t] >> 4 & 15, r = e[t + 1] >> 4 & 15;
|
|
931
942
|
if ((e[t] & 15) !== 0 || (e[t + 1] & 15) !== 0)
|
|
932
943
|
throw new Error("Dictionary key/value flags must be zero");
|
|
933
|
-
et(
|
|
934
|
-
const i = { offset: t + 2 }, n =
|
|
944
|
+
et(s);
|
|
945
|
+
const i = { offset: t + 2 }, n = U(e, i, "DictMalformed");
|
|
935
946
|
let o = i.offset;
|
|
936
947
|
for (let a = 0; a < n; a++)
|
|
937
|
-
o = X(
|
|
948
|
+
o = X(s, e, o, "DictMalformed"), o = X(r, e, o, "DictMalformed");
|
|
938
949
|
return o - t;
|
|
939
950
|
}
|
|
940
|
-
function X(e, t,
|
|
951
|
+
function X(e, t, s, r) {
|
|
941
952
|
const i = F(e);
|
|
942
953
|
if (i >= 0)
|
|
943
|
-
return
|
|
954
|
+
return N(t, s, i), s + i;
|
|
944
955
|
switch (e) {
|
|
945
956
|
case 12:
|
|
946
957
|
case 13: {
|
|
947
|
-
const n = { offset:
|
|
948
|
-
return
|
|
958
|
+
const n = { offset: s }, o = U(t, n, r);
|
|
959
|
+
return N(t, n.offset, o), n.offset + o;
|
|
949
960
|
}
|
|
950
961
|
case 11: {
|
|
951
|
-
const n = { offset:
|
|
952
|
-
return
|
|
962
|
+
const n = { offset: s }, o = U(t, n, r);
|
|
963
|
+
return N(t, n.offset, o), n.offset + o;
|
|
953
964
|
}
|
|
954
965
|
case 9:
|
|
955
|
-
return
|
|
966
|
+
return s + st(t, s);
|
|
956
967
|
case 10:
|
|
957
|
-
return
|
|
968
|
+
return s + rt(t, s);
|
|
958
969
|
default:
|
|
959
|
-
throw new Error(`Unsupported Teleport type ${
|
|
970
|
+
throw new Error(`Unsupported Teleport type ${C[e]}`);
|
|
960
971
|
}
|
|
961
972
|
}
|
|
962
|
-
function
|
|
973
|
+
function ot(e) {
|
|
963
974
|
return Array.from(e).map((t) => t.toString(16).padStart(2, "0")).join("");
|
|
964
975
|
}
|
|
965
976
|
function G(e) {
|
|
966
977
|
return e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
967
978
|
}
|
|
968
|
-
var ut = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Opus = 1] = "Opus", e[e.Mp3 = 2] = "Mp3", e[e.RawPcm16 = 3] = "RawPcm16", e))(ut || {}), Et = /* @__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))(Et || {}), _t = /* @__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))(_t || {}), ft = /* @__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))(ft || {}), dt = /* @__PURE__ */ ((e) => (e[e.Face = 0] = "Face", e[e.Hands = 1] = "Hands", e[e.Pose = 2] = "Pose", e[e.All = 3] = "All", e))(dt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Machine = 1] = "Machine", e[e.Human = 2] = "Human", e))(Tt || {}), yt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.H264 = 1] = "H264", e[e.Hevc = 2] = "Hevc", e[e.Vp8 = 3] = "Vp8", e))(yt || {}), Nt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.DotNet = 1] = "DotNet", e[e.TypeScript = 2] = "TypeScript", e[e.Cpp = 3] = "Cpp", e))(Nt || {}), R = /* @__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.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.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_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", 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.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.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.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.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", e))(R || {});
|
|
969
|
-
const oe =
|
|
970
|
-
function
|
|
979
|
+
var ht = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Opus = 1] = "Opus", e[e.Mp3 = 2] = "Mp3", e[e.RawPcm16 = 3] = "RawPcm16", e))(ht || {}), ct = /* @__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))(ct || {}), ut = /* @__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))(ut || {}), Et = /* @__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))(Et || {}), _t = /* @__PURE__ */ ((e) => (e[e.Face = 0] = "Face", e[e.Hands = 1] = "Hands", e[e.Pose = 2] = "Pose", e[e.All = 3] = "All", e))(_t || {}), ft = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Machine = 1] = "Machine", e[e.Human = 2] = "Human", e))(ft || {}), dt = /* @__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))(dt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.DotNet = 1] = "DotNet", e[e.TypeScript = 2] = "TypeScript", e[e.Cpp = 3] = "Cpp", e))(Tt || {}), m = /* @__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.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.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_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", 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.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.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.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", e))(m || {});
|
|
980
|
+
const oe = 265814330, ae = 1368629611, le = 2431514951, Ie = 2914494629, he = 3284746250, ce = 4101844078;
|
|
981
|
+
function yt(e) {
|
|
971
982
|
const t = {};
|
|
972
983
|
return St(t), t;
|
|
973
984
|
}
|
|
974
985
|
function St(e) {
|
|
975
|
-
return e.Description = "", e.Codec =
|
|
976
|
-
}
|
|
977
|
-
function he(e, t) {
|
|
978
|
-
const r = t ?? At();
|
|
979
|
-
return St(r), ue(e, r), r;
|
|
986
|
+
return e.Description = "", e.Codec = ht.Unknown, e.SampleRate = 0, e.Channels = 0, e.BitDepth = 0, e.ShapeSets = void 0, e;
|
|
980
987
|
}
|
|
981
988
|
function ue(e, t) {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
989
|
+
const s = t ?? yt();
|
|
990
|
+
return St(s), Ee(e, s), s;
|
|
991
|
+
}
|
|
992
|
+
function Ee(e, t) {
|
|
993
|
+
let s;
|
|
994
|
+
for (; (s = e.next()) !== null; )
|
|
995
|
+
switch (s.fieldId) {
|
|
985
996
|
case oe: {
|
|
986
|
-
if (
|
|
987
|
-
|
|
997
|
+
if (s.isNull) {
|
|
998
|
+
t.ShapeSets = void 0;
|
|
999
|
+
break;
|
|
1000
|
+
}
|
|
1001
|
+
t.ShapeSets = _e(s.asArray());
|
|
988
1002
|
break;
|
|
989
1003
|
}
|
|
990
1004
|
case ae: {
|
|
991
|
-
if (
|
|
992
|
-
t.
|
|
1005
|
+
if (s.isNull) throw new Error();
|
|
1006
|
+
t.Description = s.asString();
|
|
993
1007
|
break;
|
|
994
1008
|
}
|
|
995
1009
|
case le: {
|
|
996
|
-
if (
|
|
997
|
-
t.
|
|
1010
|
+
if (s.isNull) throw new Error();
|
|
1011
|
+
t.Channels = s.asInt32();
|
|
998
1012
|
break;
|
|
999
1013
|
}
|
|
1000
1014
|
case Ie: {
|
|
1001
|
-
if (
|
|
1002
|
-
t.
|
|
1015
|
+
if (s.isNull) throw new Error();
|
|
1016
|
+
t.BitDepth = s.asInt32();
|
|
1017
|
+
break;
|
|
1018
|
+
}
|
|
1019
|
+
case he: {
|
|
1020
|
+
if (s.isNull) throw new Error();
|
|
1021
|
+
t.Codec = s.asInt32();
|
|
1003
1022
|
break;
|
|
1004
1023
|
}
|
|
1005
1024
|
case ce: {
|
|
1006
|
-
if (
|
|
1007
|
-
t.SampleRate =
|
|
1025
|
+
if (s.isNull) throw new Error();
|
|
1026
|
+
t.SampleRate = s.asInt32();
|
|
1008
1027
|
break;
|
|
1009
1028
|
}
|
|
1010
1029
|
}
|
|
1011
1030
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1031
|
+
function _e(e) {
|
|
1032
|
+
const t = [];
|
|
1033
|
+
let s;
|
|
1034
|
+
for (; (s = e.next()) !== null; )
|
|
1035
|
+
t.push(Se(s.asObject()));
|
|
1036
|
+
return t;
|
|
1037
|
+
}
|
|
1038
|
+
const fe = 1107713536, de = 1154362099, Te = 1185721362;
|
|
1039
|
+
function ye(e) {
|
|
1014
1040
|
const t = {};
|
|
1015
|
-
return
|
|
1041
|
+
return At(t), t;
|
|
1016
1042
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return e.
|
|
1043
|
+
function At(e) {
|
|
1044
|
+
return e.SetId = 0, e.Name = "", e.ShapeNames = [], e;
|
|
1019
1045
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const
|
|
1022
|
-
return
|
|
1046
|
+
function Se(e, t) {
|
|
1047
|
+
const s = t ?? ye();
|
|
1048
|
+
return At(s), Ae(e, s), s;
|
|
1023
1049
|
}
|
|
1024
|
-
function
|
|
1025
|
-
let
|
|
1026
|
-
for (; (
|
|
1027
|
-
switch (
|
|
1028
|
-
case Ee: {
|
|
1029
|
-
if (r.isNull) throw new Error();
|
|
1030
|
-
t.DeviceId = r.asString();
|
|
1031
|
-
break;
|
|
1032
|
-
}
|
|
1033
|
-
case _e: {
|
|
1034
|
-
if (r.isNull) throw new Error();
|
|
1035
|
-
t.InstallId = r.asString();
|
|
1036
|
-
break;
|
|
1037
|
-
}
|
|
1050
|
+
function Ae(e, t) {
|
|
1051
|
+
let s;
|
|
1052
|
+
for (; (s = e.next()) !== null; )
|
|
1053
|
+
switch (s.fieldId) {
|
|
1038
1054
|
case fe: {
|
|
1039
|
-
if (
|
|
1040
|
-
t.
|
|
1055
|
+
if (s.isNull) throw new Error();
|
|
1056
|
+
t.Name = s.asString();
|
|
1041
1057
|
break;
|
|
1042
1058
|
}
|
|
1043
1059
|
case de: {
|
|
1044
|
-
if (
|
|
1045
|
-
t.
|
|
1060
|
+
if (s.isNull) throw new Error();
|
|
1061
|
+
t.SetId = s.asUInt32();
|
|
1046
1062
|
break;
|
|
1047
1063
|
}
|
|
1048
1064
|
case Te: {
|
|
1049
|
-
if (
|
|
1050
|
-
t.
|
|
1051
|
-
break;
|
|
1052
|
-
}
|
|
1053
|
-
case ye: {
|
|
1054
|
-
if (r.isNull) throw new Error();
|
|
1055
|
-
t.UserType = r.asInt32();
|
|
1056
|
-
break;
|
|
1057
|
-
}
|
|
1058
|
-
case Ne: {
|
|
1059
|
-
if (r.isNull) throw new Error();
|
|
1060
|
-
t.UserId = r.asString();
|
|
1061
|
-
break;
|
|
1062
|
-
}
|
|
1063
|
-
case Ae: {
|
|
1064
|
-
if (r.isNull) throw new Error();
|
|
1065
|
-
t.ProductId = r.asString();
|
|
1066
|
-
break;
|
|
1067
|
-
}
|
|
1068
|
-
case Se: {
|
|
1069
|
-
if (r.isNull) throw new Error();
|
|
1070
|
-
t.AuthSessionId = r.asString();
|
|
1065
|
+
if (s.isNull) throw new Error();
|
|
1066
|
+
t.ShapeNames = Ne(s.asArray());
|
|
1071
1067
|
break;
|
|
1072
1068
|
}
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
function Ne(e) {
|
|
1072
|
+
const t = [];
|
|
1073
|
+
let s;
|
|
1074
|
+
for (; (s = e.next()) !== null; )
|
|
1075
|
+
t.push(s.asString());
|
|
1076
|
+
return t;
|
|
1077
|
+
}
|
|
1078
|
+
const we = 76337612, Ue = 185396121, Ce = 388632637, De = 417197284, Re = 469070965, me = 470595159, Le = 781727218, ge = 834078886, pe = 1043273762, Oe = 1236999138, be = 1368629611, Pe = 1715899485, Fe = 1942830531, ke = 1999510636, ve = 2079864626, Ve = 2142346422, Me = 2598291686, Be = 2719718823, Ge = 2810953526, xe = 2840065720, He = 2885165957, Ye = 3586157513, We = 3717933110, Ke = 4062655306;
|
|
1079
|
+
function $e(e) {
|
|
1080
|
+
const t = {};
|
|
1081
|
+
return Nt(t), t;
|
|
1082
|
+
}
|
|
1083
|
+
function Nt(e) {
|
|
1084
|
+
return e.ContextType = ut.Unknown, e.UserType = ft.Unknown, e.PayloadType = Et.Unknown, e.Description = "", e.UserId = "", e.DeviceId = "", e.ProductId = "", e.VersionId = "", e.InstallId = "", e.Locale = "", e.SessionId = -1, e.IsInternal = !1, e.IsReady = !1, e.HasInput = !1, e.ChannelLocale = "", e.EmbeddedSpaceId = "", e.AuthSessionId = "", e.ReceiveAllMessages = !1, e.PreciseJoinedAt = 0n, e.UserAgent = "", e.ClientType = ct.Unknown, e.UniqueSessionId = "", e.Parameters = /* @__PURE__ */ Object.create(null), e.SdkType = Tt.Unknown, e;
|
|
1085
|
+
}
|
|
1086
|
+
function je(e, t) {
|
|
1087
|
+
const s = t ?? $e();
|
|
1088
|
+
return Nt(s), Xe(e, s), s;
|
|
1089
|
+
}
|
|
1090
|
+
function Xe(e, t) {
|
|
1091
|
+
let s;
|
|
1092
|
+
for (; (s = e.next()) !== null; )
|
|
1093
|
+
switch (s.fieldId) {
|
|
1073
1094
|
case we: {
|
|
1074
|
-
if (
|
|
1075
|
-
t.
|
|
1095
|
+
if (s.isNull) throw new Error();
|
|
1096
|
+
t.DeviceId = s.asString();
|
|
1076
1097
|
break;
|
|
1077
1098
|
}
|
|
1078
1099
|
case Ue: {
|
|
1079
|
-
if (
|
|
1080
|
-
t.
|
|
1100
|
+
if (s.isNull) throw new Error();
|
|
1101
|
+
t.InstallId = s.asString();
|
|
1081
1102
|
break;
|
|
1082
1103
|
}
|
|
1083
1104
|
case Ce: {
|
|
1084
|
-
if (
|
|
1085
|
-
t.
|
|
1105
|
+
if (s.isNull) throw new Error();
|
|
1106
|
+
t.UserAgent = s.asString();
|
|
1086
1107
|
break;
|
|
1087
1108
|
}
|
|
1088
1109
|
case De: {
|
|
1089
|
-
if (
|
|
1090
|
-
t.
|
|
1110
|
+
if (s.isNull) throw new Error();
|
|
1111
|
+
t.ContextType = s.asInt32();
|
|
1091
1112
|
break;
|
|
1092
1113
|
}
|
|
1093
1114
|
case Re: {
|
|
1094
|
-
if (
|
|
1095
|
-
t.
|
|
1115
|
+
if (s.isNull) throw new Error();
|
|
1116
|
+
t.HasInput = s.asBool();
|
|
1096
1117
|
break;
|
|
1097
1118
|
}
|
|
1098
1119
|
case me: {
|
|
1099
|
-
if (
|
|
1100
|
-
t.
|
|
1120
|
+
if (s.isNull) throw new Error();
|
|
1121
|
+
t.UserType = s.asInt32();
|
|
1101
1122
|
break;
|
|
1102
1123
|
}
|
|
1103
1124
|
case Le: {
|
|
1104
|
-
if (
|
|
1105
|
-
t.
|
|
1125
|
+
if (s.isNull) throw new Error();
|
|
1126
|
+
t.UserId = s.asString();
|
|
1106
1127
|
break;
|
|
1107
1128
|
}
|
|
1108
|
-
case
|
|
1109
|
-
if (
|
|
1110
|
-
t.
|
|
1129
|
+
case ge: {
|
|
1130
|
+
if (s.isNull) throw new Error();
|
|
1131
|
+
t.ProductId = s.asString();
|
|
1111
1132
|
break;
|
|
1112
1133
|
}
|
|
1113
|
-
case
|
|
1114
|
-
if (
|
|
1115
|
-
t.
|
|
1134
|
+
case pe: {
|
|
1135
|
+
if (s.isNull) throw new Error();
|
|
1136
|
+
t.AuthSessionId = s.asString();
|
|
1116
1137
|
break;
|
|
1117
1138
|
}
|
|
1118
1139
|
case Oe: {
|
|
1119
|
-
if (
|
|
1120
|
-
t.
|
|
1140
|
+
if (s.isNull) throw new Error();
|
|
1141
|
+
t.ReceiveAllMessages = s.asBool();
|
|
1121
1142
|
break;
|
|
1122
1143
|
}
|
|
1123
1144
|
case be: {
|
|
1124
|
-
if (
|
|
1125
|
-
t.
|
|
1145
|
+
if (s.isNull) throw new Error();
|
|
1146
|
+
t.Description = s.asString();
|
|
1126
1147
|
break;
|
|
1127
1148
|
}
|
|
1128
1149
|
case Pe: {
|
|
1129
|
-
if (
|
|
1130
|
-
t.
|
|
1150
|
+
if (s.isNull) throw new Error();
|
|
1151
|
+
t.Locale = s.asString();
|
|
1131
1152
|
break;
|
|
1132
1153
|
}
|
|
1133
1154
|
case Fe: {
|
|
1134
|
-
if (
|
|
1135
|
-
t.
|
|
1155
|
+
if (s.isNull) throw new Error();
|
|
1156
|
+
t.SdkType = s.asInt32();
|
|
1136
1157
|
break;
|
|
1137
1158
|
}
|
|
1138
1159
|
case ke: {
|
|
1139
|
-
if (
|
|
1140
|
-
t.
|
|
1160
|
+
if (s.isNull) throw new Error();
|
|
1161
|
+
t.SessionId = s.asInt32();
|
|
1162
|
+
break;
|
|
1163
|
+
}
|
|
1164
|
+
case ve: {
|
|
1165
|
+
if (s.isNull) throw new Error();
|
|
1166
|
+
t.PreciseJoinedAt = s.asUInt64();
|
|
1141
1167
|
break;
|
|
1142
1168
|
}
|
|
1143
1169
|
case Ve: {
|
|
1144
|
-
if (
|
|
1145
|
-
t.
|
|
1170
|
+
if (s.isNull) throw new Error();
|
|
1171
|
+
t.PayloadType = s.asInt32();
|
|
1172
|
+
break;
|
|
1173
|
+
}
|
|
1174
|
+
case Me: {
|
|
1175
|
+
if (s.isNull) throw new Error();
|
|
1176
|
+
t.VersionId = s.asString();
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
case Be: {
|
|
1180
|
+
if (s.isNull) throw new Error();
|
|
1181
|
+
t.UniqueSessionId = s.asString();
|
|
1182
|
+
break;
|
|
1183
|
+
}
|
|
1184
|
+
case Ge: {
|
|
1185
|
+
if (s.isNull) throw new Error();
|
|
1186
|
+
t.ClientType = s.asInt32();
|
|
1187
|
+
break;
|
|
1188
|
+
}
|
|
1189
|
+
case xe: {
|
|
1190
|
+
if (s.isNull) throw new Error();
|
|
1191
|
+
t.IsReady = s.asBool();
|
|
1192
|
+
break;
|
|
1193
|
+
}
|
|
1194
|
+
case He: {
|
|
1195
|
+
if (s.isNull) throw new Error();
|
|
1196
|
+
t.Parameters = ze(s.asDictionary());
|
|
1197
|
+
break;
|
|
1198
|
+
}
|
|
1199
|
+
case Ye: {
|
|
1200
|
+
if (s.isNull) throw new Error();
|
|
1201
|
+
t.IsInternal = s.asBool();
|
|
1202
|
+
break;
|
|
1203
|
+
}
|
|
1204
|
+
case We: {
|
|
1205
|
+
if (s.isNull) throw new Error();
|
|
1206
|
+
t.ChannelLocale = s.asString();
|
|
1207
|
+
break;
|
|
1208
|
+
}
|
|
1209
|
+
case Ke: {
|
|
1210
|
+
if (s.isNull) throw new Error();
|
|
1211
|
+
t.EmbeddedSpaceId = s.asString();
|
|
1146
1212
|
break;
|
|
1147
1213
|
}
|
|
1148
1214
|
}
|
|
1149
1215
|
}
|
|
1150
|
-
function
|
|
1216
|
+
function ze(e) {
|
|
1151
1217
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1152
|
-
let
|
|
1153
|
-
for (; (
|
|
1154
|
-
const
|
|
1155
|
-
t[
|
|
1218
|
+
let s;
|
|
1219
|
+
for (; (s = e.next()) !== null; ) {
|
|
1220
|
+
const r = s.key.asString();
|
|
1221
|
+
t[r] = s.value.asString();
|
|
1156
1222
|
}
|
|
1157
1223
|
return t;
|
|
1158
1224
|
}
|
|
1159
|
-
const
|
|
1160
|
-
function
|
|
1225
|
+
const Je = 703025676, qe = 814454131, Qe = 972460562, Ze = 976255570, ts = 1368629611, es = 1479280922, ss = 1533537016, rs = 2274386296, is = 2603556958, ns = 2885165957, os = 3568439632;
|
|
1226
|
+
function as(e) {
|
|
1161
1227
|
const t = {};
|
|
1162
|
-
return
|
|
1228
|
+
return wt(t), t;
|
|
1163
1229
|
}
|
|
1164
|
-
function
|
|
1165
|
-
return e.FunctionId =
|
|
1230
|
+
function wt(e) {
|
|
1231
|
+
return e.FunctionId = d.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;
|
|
1166
1232
|
}
|
|
1167
|
-
function
|
|
1168
|
-
const
|
|
1169
|
-
return
|
|
1233
|
+
function ls(e, t) {
|
|
1234
|
+
const s = t ?? as();
|
|
1235
|
+
return wt(s), Is(e, s), s;
|
|
1170
1236
|
}
|
|
1171
|
-
function
|
|
1172
|
-
let
|
|
1173
|
-
for (; (
|
|
1174
|
-
switch (
|
|
1175
|
-
case
|
|
1176
|
-
if (
|
|
1177
|
-
t.ResultTypeName =
|
|
1237
|
+
function Is(e, t) {
|
|
1238
|
+
let s;
|
|
1239
|
+
for (; (s = e.next()) !== null; )
|
|
1240
|
+
switch (s.fieldId) {
|
|
1241
|
+
case Je: {
|
|
1242
|
+
if (s.isNull) throw new Error();
|
|
1243
|
+
t.ResultTypeName = s.asString();
|
|
1178
1244
|
break;
|
|
1179
1245
|
}
|
|
1180
|
-
case
|
|
1181
|
-
if (
|
|
1182
|
-
t.FunctionName =
|
|
1246
|
+
case qe: {
|
|
1247
|
+
if (s.isNull) throw new Error();
|
|
1248
|
+
t.FunctionName = s.asString();
|
|
1183
1249
|
break;
|
|
1184
1250
|
}
|
|
1185
|
-
case
|
|
1186
|
-
if (
|
|
1187
|
-
t.EnumerableItemTypeName =
|
|
1251
|
+
case Qe: {
|
|
1252
|
+
if (s.isNull) throw new Error();
|
|
1253
|
+
t.EnumerableItemTypeName = s.asString();
|
|
1188
1254
|
break;
|
|
1189
1255
|
}
|
|
1190
|
-
case
|
|
1191
|
-
if (
|
|
1192
|
-
t.FunctionId =
|
|
1256
|
+
case Ze: {
|
|
1257
|
+
if (s.isNull) throw new Error();
|
|
1258
|
+
t.FunctionId = s.asGuid();
|
|
1193
1259
|
break;
|
|
1194
1260
|
}
|
|
1195
|
-
case
|
|
1196
|
-
if (
|
|
1197
|
-
t.Description =
|
|
1261
|
+
case ts: {
|
|
1262
|
+
if (s.isNull) throw new Error();
|
|
1263
|
+
t.Description = s.asString();
|
|
1198
1264
|
break;
|
|
1199
1265
|
}
|
|
1200
|
-
case
|
|
1201
|
-
if (
|
|
1202
|
-
t.IsCancellable =
|
|
1266
|
+
case es: {
|
|
1267
|
+
if (s.isNull) throw new Error();
|
|
1268
|
+
t.IsCancellable = s.asBool();
|
|
1203
1269
|
break;
|
|
1204
1270
|
}
|
|
1205
|
-
case
|
|
1206
|
-
if (
|
|
1207
|
-
t.RequiresInstance =
|
|
1271
|
+
case ss: {
|
|
1272
|
+
if (s.isNull) throw new Error();
|
|
1273
|
+
t.RequiresInstance = s.asBool();
|
|
1208
1274
|
break;
|
|
1209
1275
|
}
|
|
1210
|
-
case
|
|
1211
|
-
if (
|
|
1212
|
-
t.LlmInlineResult =
|
|
1276
|
+
case rs: {
|
|
1277
|
+
if (s.isNull) throw new Error();
|
|
1278
|
+
t.LlmInlineResult = s.asBool();
|
|
1213
1279
|
break;
|
|
1214
1280
|
}
|
|
1215
|
-
case
|
|
1216
|
-
if (
|
|
1217
|
-
t.IsEnumerable =
|
|
1281
|
+
case is: {
|
|
1282
|
+
if (s.isNull) throw new Error();
|
|
1283
|
+
t.IsEnumerable = s.asBool();
|
|
1218
1284
|
break;
|
|
1219
1285
|
}
|
|
1220
|
-
case
|
|
1221
|
-
if (
|
|
1222
|
-
t.Parameters =
|
|
1286
|
+
case ns: {
|
|
1287
|
+
if (s.isNull) throw new Error();
|
|
1288
|
+
t.Parameters = hs(s.asArray());
|
|
1223
1289
|
break;
|
|
1224
1290
|
}
|
|
1225
|
-
case
|
|
1226
|
-
if (
|
|
1227
|
-
t.LlmCallOnlyOnce =
|
|
1291
|
+
case os: {
|
|
1292
|
+
if (s.isNull) throw new Error();
|
|
1293
|
+
t.LlmCallOnlyOnce = s.asBool();
|
|
1228
1294
|
break;
|
|
1229
1295
|
}
|
|
1230
1296
|
}
|
|
1231
1297
|
}
|
|
1232
|
-
function
|
|
1298
|
+
function hs(e) {
|
|
1233
1299
|
const t = [];
|
|
1234
|
-
let
|
|
1235
|
-
for (; (
|
|
1236
|
-
t.push(
|
|
1300
|
+
let s;
|
|
1301
|
+
for (; (s = e.next()) !== null; )
|
|
1302
|
+
t.push(Ns(s.asObject()));
|
|
1237
1303
|
return t;
|
|
1238
1304
|
}
|
|
1239
|
-
const
|
|
1240
|
-
function
|
|
1305
|
+
const cs = 607861992, us = 894485888, Es = 972460562, _s = 1368629611, fs = 1883521406, ds = 2603556958, Ts = 3609695522, ys = 4075263697, Ss = 4257460908;
|
|
1306
|
+
function As(e) {
|
|
1241
1307
|
const t = {};
|
|
1242
|
-
return
|
|
1308
|
+
return Ut(t), t;
|
|
1243
1309
|
}
|
|
1244
|
-
function
|
|
1310
|
+
function Ut(e) {
|
|
1245
1311
|
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;
|
|
1246
1312
|
}
|
|
1247
|
-
function
|
|
1248
|
-
const
|
|
1249
|
-
return
|
|
1313
|
+
function Ns(e, t) {
|
|
1314
|
+
const s = t ?? As();
|
|
1315
|
+
return Ut(s), ws(e, s), s;
|
|
1250
1316
|
}
|
|
1251
|
-
function
|
|
1252
|
-
let
|
|
1253
|
-
for (; (
|
|
1254
|
-
switch (
|
|
1255
|
-
case
|
|
1256
|
-
if (
|
|
1257
|
-
t.HasDefaultValue =
|
|
1317
|
+
function ws(e, t) {
|
|
1318
|
+
let s;
|
|
1319
|
+
for (; (s = e.next()) !== null; )
|
|
1320
|
+
switch (s.fieldId) {
|
|
1321
|
+
case cs: {
|
|
1322
|
+
if (s.isNull) throw new Error();
|
|
1323
|
+
t.HasDefaultValue = s.asBool();
|
|
1258
1324
|
break;
|
|
1259
1325
|
}
|
|
1260
|
-
case
|
|
1261
|
-
if (
|
|
1262
|
-
t.DefaultValueJson =
|
|
1326
|
+
case us: {
|
|
1327
|
+
if (s.isNull) throw new Error();
|
|
1328
|
+
t.DefaultValueJson = s.asString();
|
|
1263
1329
|
break;
|
|
1264
1330
|
}
|
|
1265
|
-
case
|
|
1266
|
-
if (
|
|
1267
|
-
t.EnumerableItemTypeName =
|
|
1331
|
+
case Es: {
|
|
1332
|
+
if (s.isNull) throw new Error();
|
|
1333
|
+
t.EnumerableItemTypeName = s.asString();
|
|
1268
1334
|
break;
|
|
1269
1335
|
}
|
|
1270
|
-
case
|
|
1271
|
-
if (
|
|
1272
|
-
t.Description =
|
|
1336
|
+
case _s: {
|
|
1337
|
+
if (s.isNull) throw new Error();
|
|
1338
|
+
t.Description = s.asString();
|
|
1273
1339
|
break;
|
|
1274
1340
|
}
|
|
1275
|
-
case
|
|
1276
|
-
if (
|
|
1277
|
-
t.DefaultValueData =
|
|
1341
|
+
case fs: {
|
|
1342
|
+
if (s.isNull) throw new Error();
|
|
1343
|
+
t.DefaultValueData = s.asBinary();
|
|
1278
1344
|
break;
|
|
1279
1345
|
}
|
|
1280
|
-
case
|
|
1281
|
-
if (
|
|
1282
|
-
t.IsEnumerable =
|
|
1346
|
+
case ds: {
|
|
1347
|
+
if (s.isNull) throw new Error();
|
|
1348
|
+
t.IsEnumerable = s.asBool();
|
|
1283
1349
|
break;
|
|
1284
1350
|
}
|
|
1285
|
-
case
|
|
1286
|
-
if (
|
|
1287
|
-
t.TypeName =
|
|
1351
|
+
case Ts: {
|
|
1352
|
+
if (s.isNull) throw new Error();
|
|
1353
|
+
t.TypeName = s.asString();
|
|
1288
1354
|
break;
|
|
1289
1355
|
}
|
|
1290
|
-
case
|
|
1291
|
-
if (
|
|
1292
|
-
t.ParameterName =
|
|
1356
|
+
case ys: {
|
|
1357
|
+
if (s.isNull) throw new Error();
|
|
1358
|
+
t.ParameterName = s.asString();
|
|
1293
1359
|
break;
|
|
1294
1360
|
}
|
|
1295
|
-
case
|
|
1296
|
-
if (
|
|
1297
|
-
t.ParameterIndex =
|
|
1361
|
+
case Ss: {
|
|
1362
|
+
if (s.isNull) throw new Error();
|
|
1363
|
+
t.ParameterIndex = s.asInt32();
|
|
1298
1364
|
break;
|
|
1299
1365
|
}
|
|
1300
1366
|
}
|
|
1301
1367
|
}
|
|
1302
|
-
const
|
|
1303
|
-
function
|
|
1368
|
+
const Us = 3167053791, Cs = 3342364356, Ds = 3612929027;
|
|
1369
|
+
function Ct(e) {
|
|
1304
1370
|
const t = {};
|
|
1305
|
-
return
|
|
1371
|
+
return Dt(t), t;
|
|
1306
1372
|
}
|
|
1307
|
-
function
|
|
1308
|
-
return e.Category = "", e.Type =
|
|
1373
|
+
function Dt(e) {
|
|
1374
|
+
return e.Category = "", e.Type = _t.Face, e.FaceBlendshapes = [], e;
|
|
1309
1375
|
}
|
|
1310
|
-
function
|
|
1311
|
-
const
|
|
1312
|
-
return
|
|
1376
|
+
function Rs(e, t) {
|
|
1377
|
+
const s = t ?? Ct();
|
|
1378
|
+
return Dt(s), ms(e, s), s;
|
|
1313
1379
|
}
|
|
1314
|
-
function
|
|
1315
|
-
let
|
|
1316
|
-
for (; (
|
|
1317
|
-
switch (
|
|
1318
|
-
case
|
|
1319
|
-
if (
|
|
1320
|
-
t.Type =
|
|
1380
|
+
function ms(e, t) {
|
|
1381
|
+
let s;
|
|
1382
|
+
for (; (s = e.next()) !== null; )
|
|
1383
|
+
switch (s.fieldId) {
|
|
1384
|
+
case Us: {
|
|
1385
|
+
if (s.isNull) throw new Error();
|
|
1386
|
+
t.Type = s.asInt32();
|
|
1321
1387
|
break;
|
|
1322
1388
|
}
|
|
1323
|
-
case
|
|
1324
|
-
if (
|
|
1325
|
-
t.FaceBlendshapes =
|
|
1389
|
+
case Cs: {
|
|
1390
|
+
if (s.isNull) throw new Error();
|
|
1391
|
+
t.FaceBlendshapes = Ls(s.asArray());
|
|
1326
1392
|
break;
|
|
1327
1393
|
}
|
|
1328
|
-
case
|
|
1329
|
-
if (
|
|
1330
|
-
t.Category =
|
|
1394
|
+
case Ds: {
|
|
1395
|
+
if (s.isNull) throw new Error();
|
|
1396
|
+
t.Category = s.asString();
|
|
1331
1397
|
break;
|
|
1332
1398
|
}
|
|
1333
1399
|
}
|
|
1334
1400
|
}
|
|
1335
|
-
function
|
|
1401
|
+
function Ls(e) {
|
|
1336
1402
|
const t = [];
|
|
1337
|
-
let
|
|
1338
|
-
for (; (
|
|
1339
|
-
t.push(
|
|
1403
|
+
let s;
|
|
1404
|
+
for (; (s = e.next()) !== null; )
|
|
1405
|
+
t.push(s.asString());
|
|
1340
1406
|
return t;
|
|
1341
1407
|
}
|
|
1342
|
-
const
|
|
1343
|
-
function
|
|
1408
|
+
const gs = 3612929027;
|
|
1409
|
+
function Rt(e) {
|
|
1344
1410
|
const t = {};
|
|
1345
|
-
return
|
|
1411
|
+
return mt(t), t;
|
|
1346
1412
|
}
|
|
1347
|
-
function
|
|
1413
|
+
function mt(e) {
|
|
1348
1414
|
return e.Category = "", e;
|
|
1349
1415
|
}
|
|
1350
|
-
function
|
|
1351
|
-
const
|
|
1352
|
-
return
|
|
1416
|
+
function ps(e, t) {
|
|
1417
|
+
const s = t ?? Rt();
|
|
1418
|
+
return mt(s), Os(e, s), s;
|
|
1353
1419
|
}
|
|
1354
|
-
function
|
|
1355
|
-
let
|
|
1356
|
-
for (; (
|
|
1357
|
-
switch (
|
|
1358
|
-
case
|
|
1359
|
-
if (
|
|
1360
|
-
t.Category =
|
|
1420
|
+
function Os(e, t) {
|
|
1421
|
+
let s;
|
|
1422
|
+
for (; (s = e.next()) !== null; )
|
|
1423
|
+
switch (s.fieldId) {
|
|
1424
|
+
case gs: {
|
|
1425
|
+
if (s.isNull) throw new Error();
|
|
1426
|
+
t.Category = s.asString();
|
|
1361
1427
|
break;
|
|
1362
1428
|
}
|
|
1363
1429
|
}
|
|
1364
1430
|
}
|
|
1365
|
-
const
|
|
1366
|
-
function
|
|
1431
|
+
const bs = 164808083, Ps = 1368629611, Fs = 2739413426, ks = 2768375929, vs = 2950031986, Vs = 3284746250, Ms = 4065070594;
|
|
1432
|
+
function Lt(e) {
|
|
1367
1433
|
const t = {};
|
|
1368
1434
|
return gt(t), t;
|
|
1369
1435
|
}
|
|
1370
1436
|
function gt(e) {
|
|
1371
|
-
return e.Description = "", e.Codec =
|
|
1437
|
+
return e.Description = "", e.Codec = dt.H264, e.Width = 0, e.Height = 0, e.Framerate = 30, e.Bitrate = 0, e.IsHardwareAccelerated = !1, e;
|
|
1372
1438
|
}
|
|
1373
|
-
function
|
|
1374
|
-
const
|
|
1375
|
-
return gt(
|
|
1439
|
+
function Bs(e, t) {
|
|
1440
|
+
const s = t ?? Lt();
|
|
1441
|
+
return gt(s), Gs(e, s), s;
|
|
1376
1442
|
}
|
|
1377
|
-
function
|
|
1378
|
-
let
|
|
1379
|
-
for (; (
|
|
1380
|
-
switch (
|
|
1381
|
-
case
|
|
1382
|
-
if (
|
|
1383
|
-
t.
|
|
1443
|
+
function Gs(e, t) {
|
|
1444
|
+
let s;
|
|
1445
|
+
for (; (s = e.next()) !== null; )
|
|
1446
|
+
switch (s.fieldId) {
|
|
1447
|
+
case bs: {
|
|
1448
|
+
if (s.isNull) throw new Error();
|
|
1449
|
+
t.Framerate = s.asInt32();
|
|
1450
|
+
break;
|
|
1451
|
+
}
|
|
1452
|
+
case Ps: {
|
|
1453
|
+
if (s.isNull) throw new Error();
|
|
1454
|
+
t.Description = s.asString();
|
|
1384
1455
|
break;
|
|
1385
1456
|
}
|
|
1386
|
-
case
|
|
1387
|
-
if (
|
|
1388
|
-
t.
|
|
1457
|
+
case Fs: {
|
|
1458
|
+
if (s.isNull) throw new Error();
|
|
1459
|
+
t.IsHardwareAccelerated = s.asBool();
|
|
1389
1460
|
break;
|
|
1390
1461
|
}
|
|
1391
|
-
case
|
|
1392
|
-
if (
|
|
1393
|
-
t.
|
|
1462
|
+
case ks: {
|
|
1463
|
+
if (s.isNull) throw new Error();
|
|
1464
|
+
t.Bitrate = s.asInt32();
|
|
1394
1465
|
break;
|
|
1395
1466
|
}
|
|
1396
|
-
case
|
|
1397
|
-
if (
|
|
1398
|
-
t.
|
|
1467
|
+
case vs: {
|
|
1468
|
+
if (s.isNull) throw new Error();
|
|
1469
|
+
t.Height = s.asInt32();
|
|
1470
|
+
break;
|
|
1471
|
+
}
|
|
1472
|
+
case Vs: {
|
|
1473
|
+
if (s.isNull) throw new Error();
|
|
1474
|
+
t.Codec = s.asInt32();
|
|
1475
|
+
break;
|
|
1476
|
+
}
|
|
1477
|
+
case Ms: {
|
|
1478
|
+
if (s.isNull) throw new Error();
|
|
1479
|
+
t.Width = s.asInt32();
|
|
1399
1480
|
break;
|
|
1400
1481
|
}
|
|
1401
1482
|
}
|
|
1402
1483
|
}
|
|
1403
|
-
const
|
|
1404
|
-
function
|
|
1484
|
+
const xs = 3, Hs = 65539, Ys = 693643444, Ws = 1144553441, Ks = 1497620243, $s = 1559330978, js = 1999510636, Xs = 2277643855, zs = 2469008121, Js = 2589786682, qs = 3219210453, Qs = 3678477544, Zs = 3696445035, tr = 3707543140, er = 3712281496, sr = 3823842552, rr = 3895362455, ir = 3897397815, nr = 4225107827;
|
|
1485
|
+
function or(e) {
|
|
1405
1486
|
const t = {};
|
|
1406
|
-
return
|
|
1487
|
+
return pt(t), t;
|
|
1407
1488
|
}
|
|
1408
|
-
function
|
|
1409
|
-
return e.Clients = /* @__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.ChannelInstanceId = "", e.FirstUserId = "", e.ChannelUrl = "", e.ChannelId = "", e.PrimaryUserId = "", e.OrganisationName = "", e.SpaceName = "", e.ChannelName = "", e.SessionId = "", e.Functions = /* @__PURE__ */ Object.create(null), e;
|
|
1489
|
+
function pt(e) {
|
|
1490
|
+
return e.Clients = /* @__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.ChannelInstanceId = "", e.FirstUserId = "", e.ChannelUrl = "", e.ChannelId = "", e.PrimaryUserId = "", e.OrganisationName = "", e.SpaceName = "", e.ChannelName = "", e.SessionId = "", e.IsGitSourceMode = !1, e.Functions = /* @__PURE__ */ Object.create(null), e;
|
|
1410
1491
|
}
|
|
1411
|
-
function
|
|
1412
|
-
const
|
|
1413
|
-
return
|
|
1492
|
+
function ar(e, t) {
|
|
1493
|
+
const s = p.create(e);
|
|
1494
|
+
return lr(s, t);
|
|
1414
1495
|
}
|
|
1415
|
-
function
|
|
1416
|
-
const
|
|
1417
|
-
return
|
|
1496
|
+
function lr(e, t) {
|
|
1497
|
+
const s = t ?? or();
|
|
1498
|
+
return pt(s), Ir(e, s), s;
|
|
1418
1499
|
}
|
|
1419
|
-
function
|
|
1420
|
-
let
|
|
1421
|
-
for (; (
|
|
1422
|
-
switch (
|
|
1423
|
-
case
|
|
1424
|
-
if (
|
|
1425
|
-
t.FirstUserId =
|
|
1500
|
+
function Ir(e, t) {
|
|
1501
|
+
let s;
|
|
1502
|
+
for (; (s = e.next()) !== null; )
|
|
1503
|
+
switch (s.fieldId) {
|
|
1504
|
+
case Ys: {
|
|
1505
|
+
if (s.isNull) throw new Error();
|
|
1506
|
+
t.FirstUserId = s.asString();
|
|
1426
1507
|
break;
|
|
1427
1508
|
}
|
|
1428
|
-
case
|
|
1429
|
-
if (
|
|
1430
|
-
t.Clients =
|
|
1509
|
+
case Ws: {
|
|
1510
|
+
if (s.isNull) throw new Error();
|
|
1511
|
+
t.Clients = cr(s.asDictionary());
|
|
1431
1512
|
break;
|
|
1432
1513
|
}
|
|
1433
|
-
case
|
|
1434
|
-
if (
|
|
1435
|
-
t.TrackingStreams =
|
|
1514
|
+
case Ks: {
|
|
1515
|
+
if (s.isNull) throw new Error();
|
|
1516
|
+
t.TrackingStreams = ur(s.asDictionary());
|
|
1436
1517
|
break;
|
|
1437
1518
|
}
|
|
1438
|
-
case
|
|
1439
|
-
if (
|
|
1440
|
-
t.ChannelId =
|
|
1519
|
+
case $s: {
|
|
1520
|
+
if (s.isNull) throw new Error();
|
|
1521
|
+
t.ChannelId = s.asString();
|
|
1441
1522
|
break;
|
|
1442
1523
|
}
|
|
1443
|
-
case
|
|
1444
|
-
if (
|
|
1445
|
-
t.SessionId =
|
|
1524
|
+
case js: {
|
|
1525
|
+
if (s.isNull) throw new Error();
|
|
1526
|
+
t.SessionId = s.asString();
|
|
1446
1527
|
break;
|
|
1447
1528
|
}
|
|
1448
|
-
case
|
|
1449
|
-
if (
|
|
1450
|
-
t.ChannelUrl =
|
|
1529
|
+
case Xs: {
|
|
1530
|
+
if (s.isNull) throw new Error();
|
|
1531
|
+
t.ChannelUrl = s.asString();
|
|
1451
1532
|
break;
|
|
1452
1533
|
}
|
|
1453
|
-
case
|
|
1454
|
-
if (
|
|
1455
|
-
t.ChannelName =
|
|
1534
|
+
case zs: {
|
|
1535
|
+
if (s.isNull) throw new Error();
|
|
1536
|
+
t.ChannelName = s.asString();
|
|
1456
1537
|
break;
|
|
1457
1538
|
}
|
|
1458
|
-
case
|
|
1459
|
-
if (
|
|
1460
|
-
t.
|
|
1539
|
+
case Js: {
|
|
1540
|
+
if (s.isNull) throw new Error();
|
|
1541
|
+
t.IsGitSourceMode = s.asBool();
|
|
1461
1542
|
break;
|
|
1462
1543
|
}
|
|
1463
|
-
case
|
|
1464
|
-
if (
|
|
1465
|
-
t.
|
|
1544
|
+
case qs: {
|
|
1545
|
+
if (s.isNull) throw new Error();
|
|
1546
|
+
t.OrganisationName = s.asString();
|
|
1466
1547
|
break;
|
|
1467
1548
|
}
|
|
1468
|
-
case
|
|
1469
|
-
if (
|
|
1470
|
-
t.
|
|
1549
|
+
case Qs: {
|
|
1550
|
+
if (s.isNull) throw new Error();
|
|
1551
|
+
t.Functions = Er(s.asDictionary());
|
|
1471
1552
|
break;
|
|
1472
1553
|
}
|
|
1473
|
-
case
|
|
1474
|
-
if (
|
|
1475
|
-
t.
|
|
1554
|
+
case Zs: {
|
|
1555
|
+
if (s.isNull) throw new Error();
|
|
1556
|
+
t.UIStreams = _r(s.asDictionary());
|
|
1476
1557
|
break;
|
|
1477
1558
|
}
|
|
1478
|
-
case
|
|
1479
|
-
if (
|
|
1480
|
-
t.
|
|
1559
|
+
case tr: {
|
|
1560
|
+
if (s.isNull) throw new Error();
|
|
1561
|
+
t.SpaceId = s.asString();
|
|
1481
1562
|
break;
|
|
1482
1563
|
}
|
|
1483
|
-
case
|
|
1484
|
-
if (
|
|
1485
|
-
t.
|
|
1564
|
+
case er: {
|
|
1565
|
+
if (s.isNull) throw new Error();
|
|
1566
|
+
t.PrimaryUserId = s.asString();
|
|
1486
1567
|
break;
|
|
1487
1568
|
}
|
|
1488
|
-
case
|
|
1489
|
-
if (
|
|
1490
|
-
t.
|
|
1569
|
+
case sr: {
|
|
1570
|
+
if (s.isNull) throw new Error();
|
|
1571
|
+
t.ChannelInstanceId = s.asString();
|
|
1491
1572
|
break;
|
|
1492
1573
|
}
|
|
1493
|
-
case
|
|
1494
|
-
if (
|
|
1495
|
-
t.
|
|
1574
|
+
case rr: {
|
|
1575
|
+
if (s.isNull) throw new Error();
|
|
1576
|
+
t.AudioStreams = fr(s.asDictionary());
|
|
1496
1577
|
break;
|
|
1497
1578
|
}
|
|
1498
|
-
case
|
|
1499
|
-
if (
|
|
1500
|
-
t.
|
|
1579
|
+
case ir: {
|
|
1580
|
+
if (s.isNull) throw new Error();
|
|
1581
|
+
t.VideoStreams = dr(s.asDictionary());
|
|
1582
|
+
break;
|
|
1583
|
+
}
|
|
1584
|
+
case nr: {
|
|
1585
|
+
if (s.isNull) throw new Error();
|
|
1586
|
+
t.SpaceName = s.asString();
|
|
1501
1587
|
break;
|
|
1502
1588
|
}
|
|
1503
1589
|
}
|
|
1504
1590
|
}
|
|
1505
|
-
function
|
|
1506
|
-
const
|
|
1507
|
-
return
|
|
1591
|
+
function hr(e, t) {
|
|
1592
|
+
const s = M(e, Hs, xs);
|
|
1593
|
+
return ar(s, t);
|
|
1508
1594
|
}
|
|
1509
|
-
function
|
|
1595
|
+
function cr(e) {
|
|
1510
1596
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1511
|
-
let
|
|
1512
|
-
for (; (
|
|
1513
|
-
const
|
|
1514
|
-
t[
|
|
1597
|
+
let s;
|
|
1598
|
+
for (; (s = e.next()) !== null; ) {
|
|
1599
|
+
const r = s.key.asInt32();
|
|
1600
|
+
t[r] = je(s.value.asObject());
|
|
1515
1601
|
}
|
|
1516
1602
|
return t;
|
|
1517
1603
|
}
|
|
1518
|
-
function
|
|
1604
|
+
function ur(e) {
|
|
1519
1605
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1520
|
-
let
|
|
1521
|
-
for (; (
|
|
1522
|
-
const
|
|
1523
|
-
t[
|
|
1606
|
+
let s;
|
|
1607
|
+
for (; (s = e.next()) !== null; ) {
|
|
1608
|
+
const r = s.key.asString();
|
|
1609
|
+
t[r] = Wr(s.value.asObject());
|
|
1524
1610
|
}
|
|
1525
1611
|
return t;
|
|
1526
1612
|
}
|
|
1527
|
-
function
|
|
1613
|
+
function Er(e) {
|
|
1528
1614
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1529
|
-
let
|
|
1530
|
-
for (; (
|
|
1531
|
-
const
|
|
1532
|
-
t[
|
|
1615
|
+
let s;
|
|
1616
|
+
for (; (s = e.next()) !== null; ) {
|
|
1617
|
+
const r = s.key.asInt32();
|
|
1618
|
+
t[r] = Tr(s.value.asArray());
|
|
1533
1619
|
}
|
|
1534
1620
|
return t;
|
|
1535
1621
|
}
|
|
1536
|
-
function
|
|
1622
|
+
function _r(e) {
|
|
1537
1623
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1538
|
-
let
|
|
1539
|
-
for (; (
|
|
1540
|
-
const
|
|
1541
|
-
t[
|
|
1624
|
+
let s;
|
|
1625
|
+
for (; (s = e.next()) !== null; ) {
|
|
1626
|
+
const r = s.key.asString();
|
|
1627
|
+
t[r] = Ur(s.value.asObject());
|
|
1542
1628
|
}
|
|
1543
1629
|
return t;
|
|
1544
1630
|
}
|
|
1545
|
-
function
|
|
1631
|
+
function fr(e) {
|
|
1546
1632
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1547
|
-
let
|
|
1548
|
-
for (; (
|
|
1549
|
-
const
|
|
1550
|
-
t[
|
|
1633
|
+
let s;
|
|
1634
|
+
for (; (s = e.next()) !== null; ) {
|
|
1635
|
+
const r = s.key.asString();
|
|
1636
|
+
t[r] = pr(s.value.asObject());
|
|
1551
1637
|
}
|
|
1552
1638
|
return t;
|
|
1553
1639
|
}
|
|
1554
|
-
function
|
|
1640
|
+
function dr(e) {
|
|
1555
1641
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1556
|
-
let
|
|
1557
|
-
for (; (
|
|
1558
|
-
const
|
|
1559
|
-
t[
|
|
1642
|
+
let s;
|
|
1643
|
+
for (; (s = e.next()) !== null; ) {
|
|
1644
|
+
const r = s.key.asString();
|
|
1645
|
+
t[r] = Vr(s.value.asObject());
|
|
1560
1646
|
}
|
|
1561
1647
|
return t;
|
|
1562
1648
|
}
|
|
1563
|
-
function
|
|
1649
|
+
function Tr(e) {
|
|
1564
1650
|
const t = [];
|
|
1565
|
-
let
|
|
1566
|
-
for (; (
|
|
1567
|
-
t.push(
|
|
1651
|
+
let s;
|
|
1652
|
+
for (; (s = e.next()) !== null; )
|
|
1653
|
+
t.push(ls(s.asObject()));
|
|
1568
1654
|
return t;
|
|
1569
1655
|
}
|
|
1570
|
-
const
|
|
1571
|
-
function
|
|
1656
|
+
const yr = 161083277, Sr = 325678206, Ar = 3469892363, Nr = 3645544153;
|
|
1657
|
+
function wr(e) {
|
|
1572
1658
|
const t = {};
|
|
1573
|
-
return
|
|
1659
|
+
return Ot(t), t;
|
|
1574
1660
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info =
|
|
1661
|
+
function Ot(e) {
|
|
1662
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Rt(), e;
|
|
1577
1663
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const
|
|
1580
|
-
return
|
|
1664
|
+
function Ur(e, t) {
|
|
1665
|
+
const s = t ?? wr();
|
|
1666
|
+
return Ot(s), Cr(e, s), s;
|
|
1581
1667
|
}
|
|
1582
|
-
function
|
|
1583
|
-
let
|
|
1584
|
-
for (; (
|
|
1585
|
-
switch (
|
|
1586
|
-
case
|
|
1587
|
-
if (
|
|
1588
|
-
t.StreamId =
|
|
1668
|
+
function Cr(e, t) {
|
|
1669
|
+
let s;
|
|
1670
|
+
for (; (s = e.next()) !== null; )
|
|
1671
|
+
switch (s.fieldId) {
|
|
1672
|
+
case yr: {
|
|
1673
|
+
if (s.isNull) throw new Error();
|
|
1674
|
+
t.StreamId = s.asString();
|
|
1589
1675
|
break;
|
|
1590
1676
|
}
|
|
1591
|
-
case
|
|
1592
|
-
if (
|
|
1593
|
-
t.ClientSessionId =
|
|
1677
|
+
case Sr: {
|
|
1678
|
+
if (s.isNull) throw new Error();
|
|
1679
|
+
t.ClientSessionId = s.asInt32();
|
|
1594
1680
|
break;
|
|
1595
1681
|
}
|
|
1596
|
-
case
|
|
1597
|
-
if (
|
|
1598
|
-
t.TrackId =
|
|
1682
|
+
case Ar: {
|
|
1683
|
+
if (s.isNull) throw new Error();
|
|
1684
|
+
t.TrackId = s.asInt32();
|
|
1599
1685
|
break;
|
|
1600
1686
|
}
|
|
1601
|
-
case
|
|
1602
|
-
if (
|
|
1603
|
-
t.Info =
|
|
1687
|
+
case Nr: {
|
|
1688
|
+
if (s.isNull) throw new Error();
|
|
1689
|
+
t.Info = ps(s.asObject());
|
|
1604
1690
|
break;
|
|
1605
1691
|
}
|
|
1606
1692
|
}
|
|
1607
1693
|
}
|
|
1608
|
-
const
|
|
1609
|
-
function
|
|
1694
|
+
const Dr = 161083277, Rr = 325678206, mr = 3469892363, Lr = 3645544153;
|
|
1695
|
+
function gr(e) {
|
|
1610
1696
|
const t = {};
|
|
1611
|
-
return
|
|
1697
|
+
return bt(t), t;
|
|
1612
1698
|
}
|
|
1613
|
-
function
|
|
1614
|
-
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info =
|
|
1699
|
+
function bt(e) {
|
|
1700
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = yt(), e;
|
|
1615
1701
|
}
|
|
1616
|
-
function
|
|
1617
|
-
const
|
|
1618
|
-
return
|
|
1702
|
+
function pr(e, t) {
|
|
1703
|
+
const s = t ?? gr();
|
|
1704
|
+
return bt(s), Or(e, s), s;
|
|
1619
1705
|
}
|
|
1620
|
-
function
|
|
1621
|
-
let
|
|
1622
|
-
for (; (
|
|
1623
|
-
switch (
|
|
1624
|
-
case
|
|
1625
|
-
if (
|
|
1626
|
-
t.StreamId =
|
|
1706
|
+
function Or(e, t) {
|
|
1707
|
+
let s;
|
|
1708
|
+
for (; (s = e.next()) !== null; )
|
|
1709
|
+
switch (s.fieldId) {
|
|
1710
|
+
case Dr: {
|
|
1711
|
+
if (s.isNull) throw new Error();
|
|
1712
|
+
t.StreamId = s.asString();
|
|
1627
1713
|
break;
|
|
1628
1714
|
}
|
|
1629
|
-
case
|
|
1630
|
-
if (
|
|
1631
|
-
t.ClientSessionId =
|
|
1715
|
+
case Rr: {
|
|
1716
|
+
if (s.isNull) throw new Error();
|
|
1717
|
+
t.ClientSessionId = s.asInt32();
|
|
1632
1718
|
break;
|
|
1633
1719
|
}
|
|
1634
|
-
case
|
|
1635
|
-
if (
|
|
1636
|
-
t.TrackId =
|
|
1720
|
+
case mr: {
|
|
1721
|
+
if (s.isNull) throw new Error();
|
|
1722
|
+
t.TrackId = s.asInt32();
|
|
1637
1723
|
break;
|
|
1638
1724
|
}
|
|
1639
|
-
case
|
|
1640
|
-
if (
|
|
1641
|
-
t.Info =
|
|
1725
|
+
case Lr: {
|
|
1726
|
+
if (s.isNull) throw new Error();
|
|
1727
|
+
t.Info = ue(s.asObject());
|
|
1642
1728
|
break;
|
|
1643
1729
|
}
|
|
1644
1730
|
}
|
|
1645
1731
|
}
|
|
1646
|
-
const
|
|
1647
|
-
function
|
|
1732
|
+
const br = 161083277, Pr = 325678206, Fr = 3469892363, kr = 3645544153;
|
|
1733
|
+
function vr(e) {
|
|
1648
1734
|
const t = {};
|
|
1649
|
-
return
|
|
1735
|
+
return Pt(t), t;
|
|
1650
1736
|
}
|
|
1651
|
-
function
|
|
1652
|
-
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info =
|
|
1737
|
+
function Pt(e) {
|
|
1738
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Lt(), e;
|
|
1653
1739
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const
|
|
1656
|
-
return
|
|
1740
|
+
function Vr(e, t) {
|
|
1741
|
+
const s = t ?? vr();
|
|
1742
|
+
return Pt(s), Mr(e, s), s;
|
|
1657
1743
|
}
|
|
1658
|
-
function
|
|
1659
|
-
let
|
|
1660
|
-
for (; (
|
|
1661
|
-
switch (
|
|
1662
|
-
case
|
|
1663
|
-
if (
|
|
1664
|
-
t.StreamId =
|
|
1744
|
+
function Mr(e, t) {
|
|
1745
|
+
let s;
|
|
1746
|
+
for (; (s = e.next()) !== null; )
|
|
1747
|
+
switch (s.fieldId) {
|
|
1748
|
+
case br: {
|
|
1749
|
+
if (s.isNull) throw new Error();
|
|
1750
|
+
t.StreamId = s.asString();
|
|
1665
1751
|
break;
|
|
1666
1752
|
}
|
|
1667
|
-
case
|
|
1668
|
-
if (
|
|
1669
|
-
t.ClientSessionId =
|
|
1753
|
+
case Pr: {
|
|
1754
|
+
if (s.isNull) throw new Error();
|
|
1755
|
+
t.ClientSessionId = s.asInt32();
|
|
1670
1756
|
break;
|
|
1671
1757
|
}
|
|
1672
|
-
case
|
|
1673
|
-
if (
|
|
1674
|
-
t.TrackId =
|
|
1758
|
+
case Fr: {
|
|
1759
|
+
if (s.isNull) throw new Error();
|
|
1760
|
+
t.TrackId = s.asInt32();
|
|
1675
1761
|
break;
|
|
1676
1762
|
}
|
|
1677
|
-
case
|
|
1678
|
-
if (
|
|
1679
|
-
t.Info =
|
|
1763
|
+
case kr: {
|
|
1764
|
+
if (s.isNull) throw new Error();
|
|
1765
|
+
t.Info = Bs(s.asObject());
|
|
1680
1766
|
break;
|
|
1681
1767
|
}
|
|
1682
1768
|
}
|
|
1683
1769
|
}
|
|
1684
|
-
const
|
|
1685
|
-
function
|
|
1770
|
+
const Br = 161083277, Gr = 325678206, xr = 3469892363, Hr = 3645544153;
|
|
1771
|
+
function Yr(e) {
|
|
1686
1772
|
const t = {};
|
|
1687
|
-
return
|
|
1773
|
+
return Ft(t), t;
|
|
1688
1774
|
}
|
|
1689
|
-
function
|
|
1690
|
-
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info =
|
|
1775
|
+
function Ft(e) {
|
|
1776
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Ct(), e;
|
|
1691
1777
|
}
|
|
1692
|
-
function
|
|
1693
|
-
const
|
|
1694
|
-
return
|
|
1778
|
+
function Wr(e, t) {
|
|
1779
|
+
const s = t ?? Yr();
|
|
1780
|
+
return Ft(s), Kr(e, s), s;
|
|
1695
1781
|
}
|
|
1696
|
-
function
|
|
1697
|
-
let
|
|
1698
|
-
for (; (
|
|
1699
|
-
switch (
|
|
1700
|
-
case
|
|
1701
|
-
if (
|
|
1702
|
-
t.StreamId =
|
|
1782
|
+
function Kr(e, t) {
|
|
1783
|
+
let s;
|
|
1784
|
+
for (; (s = e.next()) !== null; )
|
|
1785
|
+
switch (s.fieldId) {
|
|
1786
|
+
case Br: {
|
|
1787
|
+
if (s.isNull) throw new Error();
|
|
1788
|
+
t.StreamId = s.asString();
|
|
1703
1789
|
break;
|
|
1704
1790
|
}
|
|
1705
|
-
case
|
|
1706
|
-
if (
|
|
1707
|
-
t.ClientSessionId =
|
|
1791
|
+
case Gr: {
|
|
1792
|
+
if (s.isNull) throw new Error();
|
|
1793
|
+
t.ClientSessionId = s.asInt32();
|
|
1708
1794
|
break;
|
|
1709
1795
|
}
|
|
1710
|
-
case
|
|
1711
|
-
if (
|
|
1712
|
-
t.TrackId =
|
|
1796
|
+
case xr: {
|
|
1797
|
+
if (s.isNull) throw new Error();
|
|
1798
|
+
t.TrackId = s.asInt32();
|
|
1713
1799
|
break;
|
|
1714
1800
|
}
|
|
1715
|
-
case
|
|
1716
|
-
if (
|
|
1717
|
-
t.Info =
|
|
1801
|
+
case Hr: {
|
|
1802
|
+
if (s.isNull) throw new Error();
|
|
1803
|
+
t.Info = Rs(s.asObject());
|
|
1718
1804
|
break;
|
|
1719
1805
|
}
|
|
1720
1806
|
}
|
|
1721
1807
|
}
|
|
1722
|
-
const
|
|
1723
|
-
function
|
|
1808
|
+
const $r = 1405462580, jr = 2968276160;
|
|
1809
|
+
function Xr(e) {
|
|
1724
1810
|
const t = {};
|
|
1725
|
-
return
|
|
1811
|
+
return kt(t), t;
|
|
1726
1812
|
}
|
|
1727
|
-
function
|
|
1813
|
+
function kt(e) {
|
|
1728
1814
|
return e.MimeType = "", e.Value = new Uint8Array(0), e;
|
|
1729
1815
|
}
|
|
1730
|
-
function
|
|
1731
|
-
const
|
|
1732
|
-
return
|
|
1816
|
+
function zr(e, t) {
|
|
1817
|
+
const s = t ?? Xr();
|
|
1818
|
+
return kt(s), Jr(e, s), s;
|
|
1733
1819
|
}
|
|
1734
|
-
function
|
|
1735
|
-
let
|
|
1736
|
-
for (; (
|
|
1737
|
-
switch (
|
|
1738
|
-
case
|
|
1739
|
-
if (
|
|
1740
|
-
t.Value =
|
|
1820
|
+
function Jr(e, t) {
|
|
1821
|
+
let s;
|
|
1822
|
+
for (; (s = e.next()) !== null; )
|
|
1823
|
+
switch (s.fieldId) {
|
|
1824
|
+
case $r: {
|
|
1825
|
+
if (s.isNull) throw new Error();
|
|
1826
|
+
t.Value = s.asBinary();
|
|
1741
1827
|
break;
|
|
1742
1828
|
}
|
|
1743
|
-
case
|
|
1744
|
-
if (
|
|
1745
|
-
t.MimeType =
|
|
1829
|
+
case jr: {
|
|
1830
|
+
if (s.isNull) throw new Error();
|
|
1831
|
+
t.MimeType = s.asString();
|
|
1746
1832
|
break;
|
|
1747
1833
|
}
|
|
1748
1834
|
}
|
|
1749
1835
|
}
|
|
1750
|
-
const
|
|
1751
|
-
function
|
|
1836
|
+
const qr = 1, Qr = 2097188, Zr = 979822885, ti = 2374537704;
|
|
1837
|
+
function ei(e) {
|
|
1752
1838
|
const t = {};
|
|
1753
|
-
return
|
|
1839
|
+
return vt(t), t;
|
|
1754
1840
|
}
|
|
1755
|
-
function
|
|
1841
|
+
function vt(e) {
|
|
1756
1842
|
return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
|
|
1757
1843
|
}
|
|
1758
|
-
function
|
|
1759
|
-
const
|
|
1760
|
-
return
|
|
1844
|
+
function si(e, t) {
|
|
1845
|
+
const s = p.create(e);
|
|
1846
|
+
return ri(s, t);
|
|
1761
1847
|
}
|
|
1762
|
-
function
|
|
1763
|
-
const
|
|
1764
|
-
return
|
|
1848
|
+
function ri(e, t) {
|
|
1849
|
+
const s = t ?? ei();
|
|
1850
|
+
return vt(s), ii(e, s), s;
|
|
1765
1851
|
}
|
|
1766
|
-
function
|
|
1767
|
-
let
|
|
1768
|
-
for (; (
|
|
1769
|
-
switch (
|
|
1770
|
-
case
|
|
1771
|
-
if (
|
|
1772
|
-
t.StyleId =
|
|
1852
|
+
function ii(e, t) {
|
|
1853
|
+
let s;
|
|
1854
|
+
for (; (s = e.next()) !== null; )
|
|
1855
|
+
switch (s.fieldId) {
|
|
1856
|
+
case Zr: {
|
|
1857
|
+
if (s.isNull) throw new Error();
|
|
1858
|
+
t.StyleId = s.asString();
|
|
1773
1859
|
break;
|
|
1774
1860
|
}
|
|
1775
|
-
case
|
|
1776
|
-
if (
|
|
1777
|
-
t.Style =
|
|
1861
|
+
case ti: {
|
|
1862
|
+
if (s.isNull) throw new Error();
|
|
1863
|
+
t.Style = oi(s.asDictionary());
|
|
1778
1864
|
break;
|
|
1779
1865
|
}
|
|
1780
1866
|
}
|
|
1781
1867
|
}
|
|
1782
|
-
function
|
|
1783
|
-
const
|
|
1784
|
-
return
|
|
1868
|
+
function ni(e, t) {
|
|
1869
|
+
const s = M(e, Qr, qr);
|
|
1870
|
+
return si(s, t);
|
|
1785
1871
|
}
|
|
1786
|
-
function
|
|
1872
|
+
function oi(e) {
|
|
1787
1873
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1788
|
-
let
|
|
1789
|
-
for (; (
|
|
1790
|
-
const
|
|
1791
|
-
t[
|
|
1874
|
+
let s;
|
|
1875
|
+
for (; (s = e.next()) !== null; ) {
|
|
1876
|
+
const r = s.key.asString();
|
|
1877
|
+
t[r] = s.value.asString();
|
|
1792
1878
|
}
|
|
1793
1879
|
return t;
|
|
1794
1880
|
}
|
|
1795
|
-
const
|
|
1796
|
-
function
|
|
1881
|
+
const ai = 1, li = 2097192, Ii = 2136687806;
|
|
1882
|
+
function hi(e) {
|
|
1797
1883
|
const t = {};
|
|
1798
|
-
return
|
|
1884
|
+
return Vt(t), t;
|
|
1799
1885
|
}
|
|
1800
|
-
function
|
|
1886
|
+
function Vt(e) {
|
|
1801
1887
|
return e.Styles = [], e;
|
|
1802
1888
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const
|
|
1805
|
-
return
|
|
1889
|
+
function ci(e, t) {
|
|
1890
|
+
const s = p.create(e);
|
|
1891
|
+
return ui(s, t);
|
|
1806
1892
|
}
|
|
1807
|
-
function
|
|
1808
|
-
const
|
|
1809
|
-
return
|
|
1893
|
+
function ui(e, t) {
|
|
1894
|
+
const s = t ?? hi();
|
|
1895
|
+
return Vt(s), Ei(e, s), s;
|
|
1810
1896
|
}
|
|
1811
|
-
function
|
|
1812
|
-
let
|
|
1813
|
-
for (; (
|
|
1814
|
-
switch (
|
|
1815
|
-
case
|
|
1816
|
-
if (
|
|
1817
|
-
t.Styles =
|
|
1897
|
+
function Ei(e, t) {
|
|
1898
|
+
let s;
|
|
1899
|
+
for (; (s = e.next()) !== null; )
|
|
1900
|
+
switch (s.fieldId) {
|
|
1901
|
+
case Ii: {
|
|
1902
|
+
if (s.isNull) throw new Error();
|
|
1903
|
+
t.Styles = fi(s.asArray());
|
|
1818
1904
|
break;
|
|
1819
1905
|
}
|
|
1820
1906
|
}
|
|
1821
1907
|
}
|
|
1822
|
-
function
|
|
1823
|
-
const
|
|
1824
|
-
return
|
|
1908
|
+
function _i(e, t) {
|
|
1909
|
+
const s = M(e, li, ai);
|
|
1910
|
+
return ci(s, t);
|
|
1825
1911
|
}
|
|
1826
|
-
function
|
|
1912
|
+
function fi(e) {
|
|
1827
1913
|
const t = [];
|
|
1828
|
-
let
|
|
1829
|
-
for (; (
|
|
1830
|
-
t.push(
|
|
1914
|
+
let s;
|
|
1915
|
+
for (; (s = e.next()) !== null; )
|
|
1916
|
+
t.push(Si(s.asObject()));
|
|
1831
1917
|
return t;
|
|
1832
1918
|
}
|
|
1833
|
-
const
|
|
1834
|
-
function
|
|
1919
|
+
const di = 979822885, Ti = 2374537704;
|
|
1920
|
+
function yi(e) {
|
|
1835
1921
|
const t = {};
|
|
1836
|
-
return
|
|
1922
|
+
return Mt(t), t;
|
|
1837
1923
|
}
|
|
1838
|
-
function
|
|
1924
|
+
function Mt(e) {
|
|
1839
1925
|
return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
|
|
1840
1926
|
}
|
|
1841
|
-
function
|
|
1842
|
-
const
|
|
1843
|
-
return
|
|
1927
|
+
function Si(e, t) {
|
|
1928
|
+
const s = t ?? yi();
|
|
1929
|
+
return Mt(s), Ai(e, s), s;
|
|
1844
1930
|
}
|
|
1845
|
-
function
|
|
1846
|
-
let
|
|
1847
|
-
for (; (
|
|
1848
|
-
switch (
|
|
1849
|
-
case
|
|
1850
|
-
if (
|
|
1851
|
-
t.StyleId =
|
|
1931
|
+
function Ai(e, t) {
|
|
1932
|
+
let s;
|
|
1933
|
+
for (; (s = e.next()) !== null; )
|
|
1934
|
+
switch (s.fieldId) {
|
|
1935
|
+
case di: {
|
|
1936
|
+
if (s.isNull) throw new Error();
|
|
1937
|
+
t.StyleId = s.asString();
|
|
1852
1938
|
break;
|
|
1853
1939
|
}
|
|
1854
|
-
case
|
|
1855
|
-
if (
|
|
1856
|
-
t.Style =
|
|
1940
|
+
case Ti: {
|
|
1941
|
+
if (s.isNull) throw new Error();
|
|
1942
|
+
t.Style = Ni(s.asDictionary());
|
|
1857
1943
|
break;
|
|
1858
1944
|
}
|
|
1859
1945
|
}
|
|
1860
1946
|
}
|
|
1861
|
-
function
|
|
1947
|
+
function Ni(e) {
|
|
1862
1948
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1863
|
-
let
|
|
1864
|
-
for (; (
|
|
1865
|
-
const
|
|
1866
|
-
t[
|
|
1949
|
+
let s;
|
|
1950
|
+
for (; (s = e.next()) !== null; ) {
|
|
1951
|
+
const r = s.key.asString();
|
|
1952
|
+
t[r] = s.value.asString();
|
|
1867
1953
|
}
|
|
1868
1954
|
return t;
|
|
1869
1955
|
}
|
|
1870
|
-
const
|
|
1871
|
-
function
|
|
1956
|
+
const wi = 1, Ui = 2097193, Ci = 1415642792;
|
|
1957
|
+
function Di(e) {
|
|
1958
|
+
const t = {};
|
|
1959
|
+
return Bt(t), t;
|
|
1960
|
+
}
|
|
1961
|
+
function Bt(e) {
|
|
1962
|
+
return e.StyleIds = [], e;
|
|
1963
|
+
}
|
|
1964
|
+
function Ri(e, t) {
|
|
1965
|
+
const s = p.create(e);
|
|
1966
|
+
return mi(s, t);
|
|
1967
|
+
}
|
|
1968
|
+
function mi(e, t) {
|
|
1969
|
+
const s = t ?? Di();
|
|
1970
|
+
return Bt(s), Li(e, s), s;
|
|
1971
|
+
}
|
|
1972
|
+
function Li(e, t) {
|
|
1973
|
+
let s;
|
|
1974
|
+
for (; (s = e.next()) !== null; )
|
|
1975
|
+
switch (s.fieldId) {
|
|
1976
|
+
case Ci: {
|
|
1977
|
+
if (s.isNull) throw new Error();
|
|
1978
|
+
t.StyleIds = pi(s.asArray());
|
|
1979
|
+
break;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
function gi(e, t) {
|
|
1984
|
+
const s = M(e, Ui, wi);
|
|
1985
|
+
return Ri(s, t);
|
|
1986
|
+
}
|
|
1987
|
+
function pi(e) {
|
|
1988
|
+
const t = [];
|
|
1989
|
+
let s;
|
|
1990
|
+
for (; (s = e.next()) !== null; )
|
|
1991
|
+
t.push(s.asString());
|
|
1992
|
+
return t;
|
|
1993
|
+
}
|
|
1994
|
+
const Oi = 1, bi = 2097190, Pi = 425183262, Fi = 653781469;
|
|
1995
|
+
function ki(e) {
|
|
1872
1996
|
const t = {};
|
|
1873
1997
|
return Gt(t), t;
|
|
1874
1998
|
}
|
|
1875
1999
|
function Gt(e) {
|
|
1876
2000
|
return e.Json = "", e.Payloads = /* @__PURE__ */ Object.create(null), e;
|
|
1877
2001
|
}
|
|
1878
|
-
function
|
|
1879
|
-
const
|
|
1880
|
-
return
|
|
2002
|
+
function vi(e, t) {
|
|
2003
|
+
const s = p.create(e);
|
|
2004
|
+
return Vi(s, t);
|
|
1881
2005
|
}
|
|
1882
|
-
function
|
|
1883
|
-
const
|
|
1884
|
-
return Gt(
|
|
2006
|
+
function Vi(e, t) {
|
|
2007
|
+
const s = t ?? ki();
|
|
2008
|
+
return Gt(s), Mi(e, s), s;
|
|
1885
2009
|
}
|
|
1886
|
-
function
|
|
1887
|
-
let
|
|
1888
|
-
for (; (
|
|
1889
|
-
switch (
|
|
1890
|
-
case
|
|
1891
|
-
if (
|
|
1892
|
-
t.Json =
|
|
2010
|
+
function Mi(e, t) {
|
|
2011
|
+
let s;
|
|
2012
|
+
for (; (s = e.next()) !== null; )
|
|
2013
|
+
switch (s.fieldId) {
|
|
2014
|
+
case Pi: {
|
|
2015
|
+
if (s.isNull) throw new Error();
|
|
2016
|
+
t.Json = s.asString();
|
|
1893
2017
|
break;
|
|
1894
2018
|
}
|
|
1895
|
-
case
|
|
1896
|
-
if (
|
|
1897
|
-
t.Payloads =
|
|
2019
|
+
case Fi: {
|
|
2020
|
+
if (s.isNull) throw new Error();
|
|
2021
|
+
t.Payloads = Gi(s.asDictionary());
|
|
1898
2022
|
break;
|
|
1899
2023
|
}
|
|
1900
2024
|
}
|
|
1901
2025
|
}
|
|
1902
|
-
function
|
|
1903
|
-
const
|
|
1904
|
-
return
|
|
2026
|
+
function Bi(e, t) {
|
|
2027
|
+
const s = M(e, bi, Oi);
|
|
2028
|
+
return vi(s, t);
|
|
1905
2029
|
}
|
|
1906
|
-
function
|
|
2030
|
+
function Gi(e) {
|
|
1907
2031
|
const t = /* @__PURE__ */ Object.create(null);
|
|
1908
|
-
let
|
|
1909
|
-
for (; (
|
|
1910
|
-
const
|
|
1911
|
-
t[
|
|
2032
|
+
let s;
|
|
2033
|
+
for (; (s = e.next()) !== null; ) {
|
|
2034
|
+
const r = s.key.asString();
|
|
2035
|
+
t[r] = zr(s.value.asObject());
|
|
1912
2036
|
}
|
|
1913
2037
|
return t;
|
|
1914
2038
|
}
|
|
1915
|
-
const xt = 1,
|
|
1916
|
-
function
|
|
1917
|
-
const t = new
|
|
1918
|
-
return
|
|
2039
|
+
const xt = 1, xi = 1048636, Hi = 2610786289;
|
|
2040
|
+
function Yi(e) {
|
|
2041
|
+
const t = new B(xt);
|
|
2042
|
+
return Wi(e, t), t.finish();
|
|
1919
2043
|
}
|
|
1920
|
-
function
|
|
1921
|
-
t.writeUInt32Field(
|
|
2044
|
+
function Wi(e, t) {
|
|
2045
|
+
t.writeUInt32Field(Hi, e.Version >>> 0);
|
|
1922
2046
|
}
|
|
1923
|
-
function
|
|
1924
|
-
const
|
|
1925
|
-
return Qt(
|
|
2047
|
+
function Ki(e, t, s) {
|
|
2048
|
+
const r = Yi(e);
|
|
2049
|
+
return Qt(xi, r, xt, t, s);
|
|
1926
2050
|
}
|
|
1927
|
-
function
|
|
2051
|
+
function w(e) {
|
|
1928
2052
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1929
2053
|
}
|
|
1930
2054
|
function Ht(e) {
|
|
1931
|
-
const t = {},
|
|
1932
|
-
for (let
|
|
1933
|
-
const i = r
|
|
2055
|
+
const t = {}, s = Object.keys(e);
|
|
2056
|
+
for (let r = 0; r < s.length; r++) {
|
|
2057
|
+
const i = s[r];
|
|
1934
2058
|
t[i] = e[i];
|
|
1935
2059
|
}
|
|
1936
2060
|
return t;
|
|
1937
2061
|
}
|
|
1938
|
-
function
|
|
1939
|
-
if (!(e === void 0 &&
|
|
2062
|
+
function Yt(e, t, s, r) {
|
|
2063
|
+
if (!(e === void 0 && r)) {
|
|
1940
2064
|
if (Array.isArray(e)) {
|
|
1941
2065
|
const i = [];
|
|
1942
2066
|
for (let n = 0; n < e.length; n++) {
|
|
1943
2067
|
const o = e[n];
|
|
1944
2068
|
if (typeof o != "string")
|
|
1945
|
-
throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${
|
|
2069
|
+
throw new Error(`Invalid styleIds entry at ${t}.styleIds[${n}] for element ${s}`);
|
|
1946
2070
|
const a = o.trim();
|
|
1947
2071
|
a.length !== 0 && i.push(a);
|
|
1948
2072
|
}
|
|
1949
2073
|
return i;
|
|
1950
2074
|
}
|
|
1951
2075
|
if (e != null)
|
|
1952
|
-
throw new Error(`Invalid styleIds for element ${
|
|
2076
|
+
throw new Error(`Invalid styleIds for element ${s}`);
|
|
1953
2077
|
return [];
|
|
1954
2078
|
}
|
|
1955
2079
|
}
|
|
1956
2080
|
function it(e, t) {
|
|
1957
2081
|
if (!e || typeof e != "object")
|
|
1958
2082
|
throw new Error(`Invalid UI node at ${t}`);
|
|
1959
|
-
const
|
|
1960
|
-
if (typeof r != "string")
|
|
1961
|
-
throw new Error(`Invalid or missing node id at ${t}`);
|
|
2083
|
+
const s = e.Id, r = e.Type, i = e.Props, n = e.Children, o = e.StyleIds;
|
|
1962
2084
|
if (typeof s != "string")
|
|
1963
|
-
throw new Error(`Invalid or missing node
|
|
2085
|
+
throw new Error(`Invalid or missing node id at ${t}`);
|
|
2086
|
+
if (typeof r != "string")
|
|
2087
|
+
throw new Error(`Invalid or missing node type for ${s}`);
|
|
1964
2088
|
let a = {};
|
|
1965
2089
|
if (i != null) {
|
|
1966
|
-
if (!
|
|
1967
|
-
throw new Error(`Invalid props for node ${
|
|
2090
|
+
if (!w(i))
|
|
2091
|
+
throw new Error(`Invalid props for node ${s}`);
|
|
1968
2092
|
a = Ht(i);
|
|
1969
2093
|
}
|
|
1970
2094
|
let l = [];
|
|
1971
2095
|
Array.isArray(n) && (l = n.map(
|
|
1972
2096
|
(I, c) => it(I ?? {}, `${t}.children[${c}]`)
|
|
1973
2097
|
));
|
|
1974
|
-
const u =
|
|
2098
|
+
const u = Yt(o, t, s, !1);
|
|
1975
2099
|
return {
|
|
1976
|
-
id:
|
|
1977
|
-
type:
|
|
2100
|
+
id: s,
|
|
2101
|
+
type: r,
|
|
1978
2102
|
props: a,
|
|
1979
2103
|
children: l,
|
|
1980
2104
|
styleIds: u ?? []
|
|
1981
2105
|
};
|
|
1982
2106
|
}
|
|
1983
|
-
function
|
|
1984
|
-
if (!
|
|
2107
|
+
function $i(e, t) {
|
|
2108
|
+
if (!w(e))
|
|
1985
2109
|
throw new Error(`Invalid text delta at ${t}`);
|
|
1986
|
-
const
|
|
1987
|
-
if (typeof r != "string" || r.length === 0)
|
|
1988
|
-
throw new Error(`Invalid text delta node id at ${t}`);
|
|
2110
|
+
const s = e.NodeId, r = e.PropertyName, i = e.Start, n = e.End, o = e.InsertedText;
|
|
1989
2111
|
if (typeof s != "string" || s.length === 0)
|
|
2112
|
+
throw new Error(`Invalid text delta node id at ${t}`);
|
|
2113
|
+
if (typeof r != "string" || r.length === 0)
|
|
1990
2114
|
throw new Error(`Invalid text delta property name at ${t}`);
|
|
1991
2115
|
if (typeof i != "number" || !Number.isFinite(i))
|
|
1992
2116
|
throw new Error(`Invalid text delta start at ${t}`);
|
|
@@ -2000,89 +2124,123 @@ function Ci(e, t) {
|
|
|
2000
2124
|
} else if (n != null)
|
|
2001
2125
|
throw new Error(`Invalid text delta end at ${t}`);
|
|
2002
2126
|
return {
|
|
2003
|
-
nodeId:
|
|
2004
|
-
propertyName:
|
|
2127
|
+
nodeId: s,
|
|
2128
|
+
propertyName: r,
|
|
2005
2129
|
start: i,
|
|
2006
2130
|
end: a,
|
|
2007
2131
|
insertedText: o
|
|
2008
2132
|
};
|
|
2009
2133
|
}
|
|
2010
|
-
function
|
|
2011
|
-
if (!
|
|
2012
|
-
throw new Error(`Invalid
|
|
2013
|
-
const
|
|
2014
|
-
if (typeof
|
|
2015
|
-
throw new Error(`Invalid
|
|
2134
|
+
function ji(e, t) {
|
|
2135
|
+
if (!w(e))
|
|
2136
|
+
throw new Error(`Invalid child insert at ${t}`);
|
|
2137
|
+
const s = e.Index, r = e.Node;
|
|
2138
|
+
if (typeof s != "number" || !Number.isFinite(s))
|
|
2139
|
+
throw new Error(`Invalid child insert index at ${t}`);
|
|
2140
|
+
if (!w(r))
|
|
2141
|
+
throw new Error(`Invalid child insert node at ${t}`);
|
|
2142
|
+
return {
|
|
2143
|
+
index: s,
|
|
2144
|
+
node: it(r, `${t}.node`)
|
|
2145
|
+
};
|
|
2146
|
+
}
|
|
2147
|
+
function Xi(e, t) {
|
|
2148
|
+
if (!w(e))
|
|
2149
|
+
throw new Error(`Invalid child move at ${t}`);
|
|
2150
|
+
const s = e.NodeId, r = e.FromIndex, i = e.ToIndex;
|
|
2016
2151
|
if (typeof s != "string" || s.length === 0)
|
|
2017
|
-
throw new Error(`Invalid
|
|
2018
|
-
|
|
2019
|
-
(
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
throw new Error(`Invalid
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
(
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2152
|
+
throw new Error(`Invalid child move nodeId at ${t}`);
|
|
2153
|
+
if (typeof r != "number" || !Number.isFinite(r))
|
|
2154
|
+
throw new Error(`Invalid child move fromIndex at ${t}`);
|
|
2155
|
+
if (typeof i != "number" || !Number.isFinite(i))
|
|
2156
|
+
throw new Error(`Invalid child move toIndex at ${t}`);
|
|
2157
|
+
return {
|
|
2158
|
+
nodeId: s,
|
|
2159
|
+
fromIndex: r,
|
|
2160
|
+
toIndex: i
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
function zi(e, t) {
|
|
2164
|
+
if (!w(e))
|
|
2165
|
+
throw new Error(`Invalid child remove at ${t}`);
|
|
2166
|
+
const s = e.NodeId, r = e.Index;
|
|
2167
|
+
if (typeof s != "string" || s.length === 0)
|
|
2168
|
+
throw new Error(`Invalid child remove nodeId at ${t}`);
|
|
2169
|
+
if (typeof r != "number" || !Number.isFinite(r))
|
|
2170
|
+
throw new Error(`Invalid child remove index at ${t}`);
|
|
2171
|
+
return {
|
|
2172
|
+
nodeId: s,
|
|
2173
|
+
index: r
|
|
2174
|
+
};
|
|
2175
|
+
}
|
|
2176
|
+
function Ji(e, t) {
|
|
2177
|
+
if (!w(e))
|
|
2178
|
+
throw new Error(`Invalid node change at ${t}`);
|
|
2179
|
+
const s = e.nodeId;
|
|
2180
|
+
if (typeof s != "string" || s.length === 0)
|
|
2181
|
+
throw new Error(`Invalid node change nodeId at ${t}`);
|
|
2182
|
+
const r = Array.isArray(e.inserts) ? e.inserts.map(
|
|
2183
|
+
(I, c) => ji(I ?? {}, `${t}.inserts[${c}]`)
|
|
2184
|
+
) : void 0, i = Array.isArray(e.moves) ? e.moves.map(
|
|
2185
|
+
(I, c) => Xi(I ?? {}, `${t}.moves[${c}]`)
|
|
2186
|
+
) : void 0, n = Array.isArray(e.removals) ? e.removals.map(
|
|
2187
|
+
(I, c) => zi(I ?? {}, `${t}.removals[${c}]`)
|
|
2188
|
+
) : void 0;
|
|
2189
|
+
let o;
|
|
2190
|
+
if (w(e.changedProps)) {
|
|
2191
|
+
o = /* @__PURE__ */ new Map();
|
|
2192
|
+
for (const [I, c] of Object.entries(e.changedProps)) {
|
|
2193
|
+
if (!w(c))
|
|
2038
2194
|
continue;
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2195
|
+
const h = c.New;
|
|
2196
|
+
h === void 0 ? o.set(I, void 0) : w(h) ? o.set(I, Ht(h)) : o.set(I, h);
|
|
2041
2197
|
}
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2198
|
+
}
|
|
2199
|
+
const a = Array.isArray(e.textUpdates) ? e.textUpdates.map(
|
|
2200
|
+
(I, c) => $i(I ?? {}, `${t}.textUpdates[${c}]`)
|
|
2201
|
+
) : void 0, l = e.styleIds, u = l !== void 0 ? Yt(l, t, s, !0) : void 0;
|
|
2045
2202
|
return {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
...I !== void 0 ? { styleIds: I } : {}
|
|
2203
|
+
nodeId: s,
|
|
2204
|
+
...r && r.length > 0 ? { inserts: r } : {},
|
|
2205
|
+
...i && i.length > 0 ? { moves: i } : {},
|
|
2206
|
+
...n && n.length > 0 ? { removals: n } : {},
|
|
2207
|
+
...o && o.size > 0 ? { changedProps: o } : {},
|
|
2208
|
+
...a && a.length > 0 ? { textUpdates: a } : {},
|
|
2209
|
+
...u !== void 0 ? { styleIds: u } : {}
|
|
2054
2210
|
};
|
|
2055
2211
|
}
|
|
2056
|
-
function
|
|
2212
|
+
function qi(e) {
|
|
2057
2213
|
const t = /* @__PURE__ */ new Map();
|
|
2058
|
-
for (const [
|
|
2059
|
-
t.set(
|
|
2214
|
+
for (const [s, r] of Object.entries(e))
|
|
2215
|
+
t.set(s, r);
|
|
2060
2216
|
return t;
|
|
2061
2217
|
}
|
|
2062
|
-
function
|
|
2218
|
+
function Qi(e, t, s) {
|
|
2063
2219
|
if (!e || typeof e != "object")
|
|
2064
|
-
throw new
|
|
2065
|
-
const
|
|
2066
|
-
if (
|
|
2067
|
-
throw new
|
|
2068
|
-
const i =
|
|
2220
|
+
throw new D("UI update graph is missing");
|
|
2221
|
+
const r = it(e, "graph");
|
|
2222
|
+
if (r.type !== "root")
|
|
2223
|
+
throw new D('UI update root element must have type "root"');
|
|
2224
|
+
const i = tn(r.props, t);
|
|
2069
2225
|
return {
|
|
2070
2226
|
type: "full",
|
|
2071
|
-
version:
|
|
2072
|
-
root:
|
|
2227
|
+
version: s,
|
|
2228
|
+
root: r,
|
|
2073
2229
|
metadata: i
|
|
2074
2230
|
};
|
|
2075
2231
|
}
|
|
2076
|
-
function
|
|
2077
|
-
if (!e
|
|
2078
|
-
throw new
|
|
2079
|
-
if (!
|
|
2080
|
-
throw new
|
|
2081
|
-
const
|
|
2082
|
-
if (typeof
|
|
2083
|
-
throw new
|
|
2084
|
-
const i =
|
|
2085
|
-
|
|
2232
|
+
function Zi(e, t, s) {
|
|
2233
|
+
if (!Array.isArray(e))
|
|
2234
|
+
throw new D("UI diff changes must be an array");
|
|
2235
|
+
if (!w(t))
|
|
2236
|
+
throw new D("UI diff metadata must be an object");
|
|
2237
|
+
const r = t.viewId;
|
|
2238
|
+
if (typeof r != "string" || r.length === 0)
|
|
2239
|
+
throw new D("UI diff metadata is missing viewId");
|
|
2240
|
+
const i = e.map(
|
|
2241
|
+
(c, h) => Ji(c ?? {}, `changes[${h}]`)
|
|
2242
|
+
), n = t.optimisticActionId === null || typeof t.optimisticActionId == "string" ? t.optimisticActionId : void 0, o = typeof t.isOptimistic == "boolean" ? t.isOptimistic : void 0, a = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0, l = z(t.optimisticPatch), u = J(t.optimisticReconcile), I = {
|
|
2243
|
+
viewId: r,
|
|
2086
2244
|
...n !== void 0 ? { optimisticActionId: n } : {},
|
|
2087
2245
|
...o !== void 0 ? { isOptimistic: o } : {},
|
|
2088
2246
|
...a !== void 0 ? { isUpdate: a } : {},
|
|
@@ -2091,18 +2249,18 @@ function mi(e, t, r) {
|
|
|
2091
2249
|
};
|
|
2092
2250
|
return {
|
|
2093
2251
|
type: "diff",
|
|
2094
|
-
version:
|
|
2095
|
-
|
|
2252
|
+
version: s,
|
|
2253
|
+
changes: i,
|
|
2096
2254
|
metadata: I
|
|
2097
2255
|
};
|
|
2098
2256
|
}
|
|
2099
|
-
function
|
|
2100
|
-
const
|
|
2101
|
-
if (typeof
|
|
2102
|
-
throw new
|
|
2103
|
-
let
|
|
2104
|
-
return
|
|
2105
|
-
viewId:
|
|
2257
|
+
function tn(e, t) {
|
|
2258
|
+
const s = e.viewId;
|
|
2259
|
+
if (typeof s != "string" || s.length === 0)
|
|
2260
|
+
throw new D("UI update root is missing viewId");
|
|
2261
|
+
let r = s, i = e.optimisticActionId === null || typeof e.optimisticActionId == "string" ? e.optimisticActionId : void 0, n = typeof e.isOptimistic == "boolean" ? e.isOptimistic : void 0, o = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0, a = z(e.optimisticPatch), l = J(e.optimisticReconcile);
|
|
2262
|
+
return w(t) && (typeof t.viewId == "string" && t.viewId.length > 0 && (r = t.viewId), (t.optimisticActionId === null || typeof t.optimisticActionId == "string") && (i = t.optimisticActionId), typeof t.isOptimistic == "boolean" && (n = t.isOptimistic), typeof t.isUpdate == "boolean" && (o = t.isUpdate), t.optimisticPatch !== void 0 && (a = z(t.optimisticPatch)), t.optimisticReconcile !== void 0 && (l = J(t.optimisticReconcile))), {
|
|
2263
|
+
viewId: r,
|
|
2106
2264
|
...i !== void 0 ? { optimisticActionId: i } : {},
|
|
2107
2265
|
...n !== void 0 ? { isOptimistic: n } : {},
|
|
2108
2266
|
...o !== void 0 ? { isUpdate: o } : {},
|
|
@@ -2111,10 +2269,10 @@ function Li(e, t) {
|
|
|
2111
2269
|
};
|
|
2112
2270
|
}
|
|
2113
2271
|
function z(e) {
|
|
2114
|
-
if (!
|
|
2272
|
+
if (!w(e))
|
|
2115
2273
|
return;
|
|
2116
|
-
const t = e,
|
|
2117
|
-
if (typeof
|
|
2274
|
+
const t = e, s = t.id, r = t.actionId, i = t.ordinal, n = t.baseVersion, o = t.supersedes;
|
|
2275
|
+
if (typeof s != "string" || s.length === 0 || typeof r != "string" || r.length === 0 || typeof i != "number" || !Number.isFinite(i) || typeof n != "number" || !Number.isFinite(n))
|
|
2118
2276
|
return;
|
|
2119
2277
|
let a;
|
|
2120
2278
|
if (Array.isArray(o)) {
|
|
@@ -2124,123 +2282,123 @@ function z(e) {
|
|
|
2124
2282
|
a = l;
|
|
2125
2283
|
}
|
|
2126
2284
|
return {
|
|
2127
|
-
id:
|
|
2128
|
-
actionId:
|
|
2285
|
+
id: s,
|
|
2286
|
+
actionId: r,
|
|
2129
2287
|
ordinal: i,
|
|
2130
2288
|
baseVersion: n,
|
|
2131
2289
|
...a && a.length > 0 ? { supersedes: a } : {}
|
|
2132
2290
|
};
|
|
2133
2291
|
}
|
|
2134
2292
|
function J(e) {
|
|
2135
|
-
if (!
|
|
2293
|
+
if (!w(e))
|
|
2136
2294
|
return;
|
|
2137
|
-
const t = e,
|
|
2138
|
-
if (typeof
|
|
2295
|
+
const t = e, s = t.baseVersion, r = t.drop;
|
|
2296
|
+
if (typeof s != "number" || !Number.isFinite(s))
|
|
2139
2297
|
return;
|
|
2140
2298
|
let i;
|
|
2141
|
-
if (Array.isArray(
|
|
2299
|
+
if (Array.isArray(r)) {
|
|
2142
2300
|
const n = [];
|
|
2143
|
-
for (const o of
|
|
2301
|
+
for (const o of r)
|
|
2144
2302
|
typeof o == "string" && o.length > 0 && n.push(o);
|
|
2145
2303
|
i = n;
|
|
2146
2304
|
}
|
|
2147
2305
|
return {
|
|
2148
|
-
baseVersion:
|
|
2306
|
+
baseVersion: s,
|
|
2149
2307
|
...i && i.length > 0 ? { drop: i } : {}
|
|
2150
2308
|
};
|
|
2151
2309
|
}
|
|
2152
|
-
class
|
|
2153
|
-
constructor(t,
|
|
2154
|
-
super(t), this.causeError =
|
|
2310
|
+
class D extends Error {
|
|
2311
|
+
constructor(t, s) {
|
|
2312
|
+
super(t), this.causeError = s, this.name = "UiUpdateParseError", s instanceof Error && (this.stack = s.stack);
|
|
2155
2313
|
}
|
|
2156
2314
|
}
|
|
2157
|
-
function
|
|
2315
|
+
function en(e) {
|
|
2158
2316
|
let t;
|
|
2159
2317
|
try {
|
|
2160
2318
|
t = JSON.parse(e.Json);
|
|
2161
2319
|
} catch (o) {
|
|
2162
|
-
throw new
|
|
2320
|
+
throw new D("Failed to parse UIUpdate.Json payload", o);
|
|
2163
2321
|
}
|
|
2164
2322
|
if (!t || typeof t != "object")
|
|
2165
|
-
throw new
|
|
2166
|
-
const { type:
|
|
2167
|
-
if (
|
|
2168
|
-
throw new
|
|
2169
|
-
if (typeof
|
|
2170
|
-
throw new
|
|
2171
|
-
const i =
|
|
2323
|
+
throw new D("UI update snapshot must be an object");
|
|
2324
|
+
const { type: s, version: r } = t;
|
|
2325
|
+
if (s !== "full" && s !== "diff")
|
|
2326
|
+
throw new D(`Unknown UI update type: ${String(s)}`);
|
|
2327
|
+
if (typeof r != "number")
|
|
2328
|
+
throw new D("UI update version must be a number");
|
|
2329
|
+
const i = s === "full" ? Qi(t.graph, t.metadata, r) : Zi(t.changes, t.metadata, r), n = e.Payloads ? qi(e.Payloads) : /* @__PURE__ */ new Map();
|
|
2172
2330
|
return {
|
|
2173
2331
|
snapshot: i,
|
|
2174
2332
|
payloads: n
|
|
2175
2333
|
};
|
|
2176
2334
|
}
|
|
2177
|
-
class
|
|
2335
|
+
class sn {
|
|
2178
2336
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2179
2337
|
cache = /* @__PURE__ */ new Map();
|
|
2180
2338
|
/**
|
|
2181
2339
|
* Get a cached void handler (no payload) for a node/action combination.
|
|
2182
2340
|
* Creates and caches the handler if it doesn't exist.
|
|
2183
2341
|
*/
|
|
2184
|
-
getHandler(t,
|
|
2185
|
-
const i = `${t}:${
|
|
2342
|
+
getHandler(t, s, r) {
|
|
2343
|
+
const i = `${t}:${s}`;
|
|
2186
2344
|
let n = this.cache.get(i);
|
|
2187
|
-
return n || (n = () => s
|
|
2345
|
+
return n || (n = () => r(s), this.cache.set(i, n)), n;
|
|
2188
2346
|
}
|
|
2189
2347
|
/**
|
|
2190
2348
|
* Get a cached handler that accepts a payload.
|
|
2191
2349
|
* Creates and caches the handler if it doesn't exist.
|
|
2192
2350
|
*/
|
|
2193
|
-
getHandlerWithPayload(t,
|
|
2194
|
-
const i = `${t}:${
|
|
2351
|
+
getHandlerWithPayload(t, s, r) {
|
|
2352
|
+
const i = `${t}:${s}:payload`;
|
|
2195
2353
|
let n = this.cache.get(i);
|
|
2196
|
-
return n || (n = (o) => s
|
|
2354
|
+
return n || (n = (o) => r(s, o), this.cache.set(i, n)), n;
|
|
2197
2355
|
}
|
|
2198
2356
|
/**
|
|
2199
2357
|
* Get a cached handler for boolean payloads.
|
|
2200
2358
|
*/
|
|
2201
|
-
getBooleanHandler(t,
|
|
2202
|
-
return this.getHandlerWithPayload(t,
|
|
2359
|
+
getBooleanHandler(t, s, r) {
|
|
2360
|
+
return this.getHandlerWithPayload(t, s, r);
|
|
2203
2361
|
}
|
|
2204
2362
|
/**
|
|
2205
2363
|
* Get a cached handler for string payloads.
|
|
2206
2364
|
*/
|
|
2207
|
-
getStringHandler(t,
|
|
2208
|
-
return this.getHandlerWithPayload(t,
|
|
2365
|
+
getStringHandler(t, s, r) {
|
|
2366
|
+
return this.getHandlerWithPayload(t, s, r);
|
|
2209
2367
|
}
|
|
2210
2368
|
/**
|
|
2211
2369
|
* Get a cached handler for number payloads.
|
|
2212
2370
|
*/
|
|
2213
|
-
getNumberHandler(t,
|
|
2214
|
-
return this.getHandlerWithPayload(t,
|
|
2371
|
+
getNumberHandler(t, s, r) {
|
|
2372
|
+
return this.getHandlerWithPayload(t, s, r);
|
|
2215
2373
|
}
|
|
2216
2374
|
/**
|
|
2217
2375
|
* Get a cached handler for number array payloads.
|
|
2218
2376
|
*/
|
|
2219
|
-
getNumberArrayHandler(t,
|
|
2220
|
-
return this.getHandlerWithPayload(t,
|
|
2377
|
+
getNumberArrayHandler(t, s, r) {
|
|
2378
|
+
return this.getHandlerWithPayload(t, s, r);
|
|
2221
2379
|
}
|
|
2222
2380
|
/**
|
|
2223
2381
|
* Get a cached handler for nullable boolean payloads.
|
|
2224
2382
|
*/
|
|
2225
|
-
getNullableBooleanHandler(t,
|
|
2226
|
-
const i = `${t}:${
|
|
2383
|
+
getNullableBooleanHandler(t, s, r) {
|
|
2384
|
+
const i = `${t}:${s}:nullable-bool`;
|
|
2227
2385
|
let n = this.cache.get(i);
|
|
2228
|
-
return n || (n = (o) => s
|
|
2386
|
+
return n || (n = (o) => r(s, o ?? null), this.cache.set(i, n)), n;
|
|
2229
2387
|
}
|
|
2230
2388
|
/**
|
|
2231
2389
|
* Invalidate all cached handlers for a specific node.
|
|
2232
2390
|
* Call this when a node is removed from the tree.
|
|
2233
2391
|
*/
|
|
2234
2392
|
invalidateNode(t) {
|
|
2235
|
-
const
|
|
2236
|
-
for (const
|
|
2237
|
-
|
|
2393
|
+
const s = `${t}:`;
|
|
2394
|
+
for (const r of this.cache.keys())
|
|
2395
|
+
r.startsWith(s) && this.cache.delete(r);
|
|
2238
2396
|
}
|
|
2239
2397
|
/**
|
|
2240
2398
|
* Invalidate a specific handler.
|
|
2241
2399
|
*/
|
|
2242
|
-
invalidateHandler(t,
|
|
2243
|
-
this.cache.delete(`${t}:${
|
|
2400
|
+
invalidateHandler(t, s) {
|
|
2401
|
+
this.cache.delete(`${t}:${s}`), this.cache.delete(`${t}:${s}:payload`), this.cache.delete(`${t}:${s}:nullable-bool`);
|
|
2244
2402
|
}
|
|
2245
2403
|
/**
|
|
2246
2404
|
* Clear all cached handlers.
|
|
@@ -2255,7 +2413,7 @@ class gi {
|
|
|
2255
2413
|
return this.cache.size;
|
|
2256
2414
|
}
|
|
2257
2415
|
}
|
|
2258
|
-
class
|
|
2416
|
+
class rn {
|
|
2259
2417
|
views = /* @__PURE__ */ new Map();
|
|
2260
2418
|
listeners = /* @__PURE__ */ new Set();
|
|
2261
2419
|
payloads = /* @__PURE__ */ new Map();
|
|
@@ -2277,20 +2435,20 @@ class Oi {
|
|
|
2277
2435
|
patchesDirty = !0;
|
|
2278
2436
|
payloadsDirty = !0;
|
|
2279
2437
|
// Handler cache for stable event handlers
|
|
2280
|
-
handlerCache = new
|
|
2438
|
+
handlerCache = new sn();
|
|
2281
2439
|
getSortedPatches(t) {
|
|
2282
|
-
const
|
|
2283
|
-
if (t.sortedPatchesCacheKey ===
|
|
2440
|
+
const s = this.buildPatchCacheKey(t.patches);
|
|
2441
|
+
if (t.sortedPatchesCacheKey === s && t.sortedPatchesCache)
|
|
2284
2442
|
return t.sortedPatchesCache;
|
|
2285
|
-
const
|
|
2286
|
-
return t.sortedPatchesCache =
|
|
2443
|
+
const r = [...t.patches.values()].sort((i, n) => i.ordinal - n.ordinal);
|
|
2444
|
+
return t.sortedPatchesCache = r, t.sortedPatchesCacheKey = s, r;
|
|
2287
2445
|
}
|
|
2288
2446
|
buildPatchCacheKey(t) {
|
|
2289
2447
|
if (t.size === 0) return "";
|
|
2290
|
-
let
|
|
2291
|
-
for (const [
|
|
2292
|
-
|
|
2293
|
-
return
|
|
2448
|
+
let s = "";
|
|
2449
|
+
for (const [r, i] of t)
|
|
2450
|
+
s += s ? `,${r}:${i.ordinal}` : `${r}:${i.ordinal}`;
|
|
2451
|
+
return s;
|
|
2294
2452
|
}
|
|
2295
2453
|
invalidatePatchCache(t) {
|
|
2296
2454
|
t.sortedPatchesCache = void 0, t.sortedPatchesCacheKey = void 0;
|
|
@@ -2306,15 +2464,15 @@ class Oi {
|
|
|
2306
2464
|
version: -1
|
|
2307
2465
|
};
|
|
2308
2466
|
}
|
|
2309
|
-
const { snapshot:
|
|
2467
|
+
const { snapshot: s, payloads: r } = t, { metadata: i } = s, { viewId: n } = i;
|
|
2310
2468
|
let o = this.views.get(n);
|
|
2311
2469
|
o || (o = {
|
|
2312
2470
|
version: 0,
|
|
2313
2471
|
baselineVersion: 0,
|
|
2314
2472
|
patches: /* @__PURE__ */ new Map()
|
|
2315
2473
|
}, this.views.set(n, o));
|
|
2316
|
-
const a =
|
|
2317
|
-
if (
|
|
2474
|
+
const a = s.type === "diff" && i.isUpdate === !0;
|
|
2475
|
+
if (s.version < o.version || s.version === o.version && !a)
|
|
2318
2476
|
return !1;
|
|
2319
2477
|
let l = !1;
|
|
2320
2478
|
if (this.rootViewId || (this.rootViewId = n, l = !0, this.structureChanged = !0), i.optimisticReconcile?.drop)
|
|
@@ -2324,84 +2482,84 @@ class Oi {
|
|
|
2324
2482
|
for (const I of i.optimisticPatch.supersedes)
|
|
2325
2483
|
o.patches.delete(I) && (l = !0, this.patchesDirty = !0, this.invalidatePatchCache(o));
|
|
2326
2484
|
const u = o.composite ?? o.baseline;
|
|
2327
|
-
if (
|
|
2328
|
-
o.baseline =
|
|
2485
|
+
if (s.type === "full")
|
|
2486
|
+
o.baseline = s.root, o.composite = s.root, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? s.version, o.patches.clear(), this.invalidatePatchCache(o), o.version = s.version, l = !0, this.viewsDirty = !0, this.patchesDirty = !0, this.structureChanged = !0, s.root && b(s.root, this.changedNodeIds);
|
|
2329
2487
|
else if (i.optimisticPatch) {
|
|
2330
2488
|
if (!u)
|
|
2331
2489
|
return !1;
|
|
2332
|
-
const I =
|
|
2490
|
+
const I = j(u, s.changes);
|
|
2333
2491
|
I !== u && (o.composite = I, l = !0, this.viewsDirty = !0, H(u, I, this.changedNodeIds));
|
|
2334
2492
|
const c = i.optimisticPatch, h = {
|
|
2335
2493
|
id: c.id,
|
|
2336
2494
|
actionId: c.actionId,
|
|
2337
2495
|
ordinal: c.ordinal,
|
|
2338
2496
|
baseVersion: c.baseVersion,
|
|
2339
|
-
|
|
2497
|
+
changes: s.changes
|
|
2340
2498
|
};
|
|
2341
|
-
o.patches.set(h.id, h), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version =
|
|
2499
|
+
o.patches.set(h.id, h), this.invalidatePatchCache(o), l = !0, this.patchesDirty = !0, o.version = s.version;
|
|
2342
2500
|
} else {
|
|
2343
2501
|
const I = o.baseline ?? u;
|
|
2344
2502
|
if (!I)
|
|
2345
2503
|
return !1;
|
|
2346
|
-
const c =
|
|
2347
|
-
c !== I ? (o.baseline = c, l = !0, this.viewsDirty = !0) : o.baseline = c, o.baselineVersion = i.optimisticReconcile?.baseVersion ??
|
|
2504
|
+
const c = j(I, s.changes);
|
|
2505
|
+
c !== I ? (o.baseline = c, l = !0, this.viewsDirty = !0) : o.baseline = c, o.baselineVersion = i.optimisticReconcile?.baseVersion ?? s.version;
|
|
2348
2506
|
let h = o.baseline ?? c;
|
|
2349
2507
|
const E = this.getSortedPatches(o);
|
|
2350
|
-
for (const
|
|
2351
|
-
const
|
|
2352
|
-
|
|
2508
|
+
for (const _ of E) {
|
|
2509
|
+
const y = j(h, _.changes);
|
|
2510
|
+
y !== h && (l = !0, this.viewsDirty = !0), h = y, _.baseVersion = o.baselineVersion;
|
|
2353
2511
|
}
|
|
2354
|
-
o.composite !== h && (o.composite = h, l = !0, this.viewsDirty = !0), u && h ? H(u, h, this.changedNodeIds) : h && b(h, this.changedNodeIds), o.version =
|
|
2512
|
+
o.composite !== h && (o.composite = h, l = !0, this.viewsDirty = !0), u && h ? H(u, h, this.changedNodeIds) : h && b(h, this.changedNodeIds), o.version = s.version;
|
|
2355
2513
|
}
|
|
2356
|
-
for (const [I, c] of
|
|
2514
|
+
for (const [I, c] of r)
|
|
2357
2515
|
this.payloads.get(I) !== c && (this.payloads.set(I, c), l = !0, this.payloadsDirty = !0);
|
|
2358
|
-
return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version =
|
|
2516
|
+
return l ? (this.commitSnapshot(), this.notify(), !0) : (o.version = s.version, !1);
|
|
2359
2517
|
}
|
|
2360
2518
|
replaceFromWire(t) {
|
|
2361
|
-
const
|
|
2519
|
+
const s = {
|
|
2362
2520
|
rootViewId: t.rootViewId,
|
|
2363
2521
|
views: new Map(t.views),
|
|
2364
2522
|
payloads: new Map(t.payloads),
|
|
2365
2523
|
optimisticPatches: new Map(t.optimisticPatches),
|
|
2366
2524
|
version: t.version
|
|
2367
2525
|
};
|
|
2368
|
-
return this.replaceSnapshot(
|
|
2526
|
+
return this.replaceSnapshot(s);
|
|
2369
2527
|
}
|
|
2370
2528
|
patchFromOp(t) {
|
|
2371
2529
|
this.snapshotMode = !0;
|
|
2372
|
-
const
|
|
2373
|
-
if (
|
|
2530
|
+
const s = t.expectedBaseVersion;
|
|
2531
|
+
if (s !== void 0 && this.snapshot.version !== s)
|
|
2374
2532
|
return !1;
|
|
2375
|
-
let
|
|
2533
|
+
let r = !1, i = null, n = null, o = null;
|
|
2376
2534
|
const a = () => (i || (i = new Map(this.snapshot.views)), i), l = () => (n || (n = new Map(this.snapshot.payloads)), n), u = () => (o || (o = new Map(this.snapshot.optimisticPatches)), o);
|
|
2377
2535
|
if (t.deleteViews && t.deleteViews.length > 0)
|
|
2378
2536
|
for (const h of t.deleteViews)
|
|
2379
|
-
a().delete(h) && (
|
|
2537
|
+
a().delete(h) && (r = !0, this.structureChanged = !0);
|
|
2380
2538
|
if (t.upsertViews && t.upsertViews.length > 0)
|
|
2381
2539
|
for (const [h, E] of t.upsertViews) {
|
|
2382
|
-
const
|
|
2383
|
-
|
|
2540
|
+
const _ = a(), y = _.get(h);
|
|
2541
|
+
y !== E && (_.set(h, E), r = !0, y ? H(y, E, this.changedNodeIds) : (b(E, this.changedNodeIds), this.structureChanged = !0));
|
|
2384
2542
|
}
|
|
2385
2543
|
if (t.deletePayloads && t.deletePayloads.length > 0)
|
|
2386
2544
|
for (const h of t.deletePayloads)
|
|
2387
|
-
l().delete(h) && (
|
|
2545
|
+
l().delete(h) && (r = !0);
|
|
2388
2546
|
if (t.upsertPayloads && t.upsertPayloads.length > 0)
|
|
2389
2547
|
for (const [h, E] of t.upsertPayloads) {
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2548
|
+
const _ = l();
|
|
2549
|
+
_.get(h) !== E && (_.set(h, E), r = !0);
|
|
2392
2550
|
}
|
|
2393
2551
|
if (t.deleteOptimisticPatchesForViews && t.deleteOptimisticPatchesForViews.length > 0)
|
|
2394
2552
|
for (const h of t.deleteOptimisticPatchesForViews)
|
|
2395
|
-
u().delete(h) && (
|
|
2553
|
+
u().delete(h) && (r = !0);
|
|
2396
2554
|
if (t.upsertOptimisticPatches && t.upsertOptimisticPatches.length > 0)
|
|
2397
2555
|
for (const [h, E] of t.upsertOptimisticPatches) {
|
|
2398
|
-
const
|
|
2399
|
-
|
|
2556
|
+
const _ = u(), y = _.get(h);
|
|
2557
|
+
ln(y, E) || (_.set(h, E), r = !0);
|
|
2400
2558
|
}
|
|
2401
2559
|
const I = t.rootViewId ?? this.snapshot.rootViewId;
|
|
2402
|
-
I !== this.snapshot.rootViewId && (
|
|
2560
|
+
I !== this.snapshot.rootViewId && (r = !0, this.structureChanged = !0);
|
|
2403
2561
|
const c = t.nextVersion;
|
|
2404
|
-
if (c !== this.snapshot.version && (
|
|
2562
|
+
if (c !== this.snapshot.version && (r = !0), !r)
|
|
2405
2563
|
return this.snapshot = { ...this.snapshot, version: c }, !1;
|
|
2406
2564
|
for (const h of this.changedNodeIds)
|
|
2407
2565
|
this.nodeVersions.set(h, (this.nodeVersions.get(h) ?? 0) + 1);
|
|
@@ -2415,15 +2573,15 @@ class Oi {
|
|
|
2415
2573
|
}
|
|
2416
2574
|
replaceSnapshot(t) {
|
|
2417
2575
|
this.snapshotMode = !0;
|
|
2418
|
-
const
|
|
2419
|
-
(
|
|
2576
|
+
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 || s.optimisticPatches.size !== t.optimisticPatches.size;
|
|
2577
|
+
(s.rootViewId !== t.rootViewId || s.views.size !== t.views.size) && (this.structureChanged = !0);
|
|
2420
2578
|
for (const [i, n] of t.views) {
|
|
2421
|
-
const o =
|
|
2579
|
+
const o = s.views.get(i);
|
|
2422
2580
|
o ? H(o, n, this.changedNodeIds) : (b(n, this.changedNodeIds), this.structureChanged = !0);
|
|
2423
2581
|
}
|
|
2424
2582
|
for (const i of this.changedNodeIds)
|
|
2425
2583
|
this.nodeVersions.set(i, (this.nodeVersions.get(i) ?? 0) + 1);
|
|
2426
|
-
return this.snapshot = t,
|
|
2584
|
+
return this.snapshot = t, r && this.notify(), r;
|
|
2427
2585
|
}
|
|
2428
2586
|
clear() {
|
|
2429
2587
|
(this.snapshot.rootViewId === void 0 || this.snapshot.rootViewId.length === 0) && this.snapshot.views.size === 0 && this.snapshot.payloads.size === 0 && this.snapshot.optimisticPatches.size === 0 || (this.snapshotMode = !0, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.patchesDirty = !0, this.payloadsDirty = !0, this.snapshot = {
|
|
@@ -2441,18 +2599,18 @@ class Oi {
|
|
|
2441
2599
|
this.listeners.delete(t);
|
|
2442
2600
|
};
|
|
2443
2601
|
}
|
|
2444
|
-
subscribeNode(t,
|
|
2445
|
-
let
|
|
2446
|
-
return
|
|
2447
|
-
|
|
2602
|
+
subscribeNode(t, s) {
|
|
2603
|
+
let r = this.nodeListeners.get(t);
|
|
2604
|
+
return r || (r = /* @__PURE__ */ new Set(), this.nodeListeners.set(t, r)), r.add(s), () => {
|
|
2605
|
+
r && (r.delete(s), r.size === 0 && this.nodeListeners.delete(t));
|
|
2448
2606
|
};
|
|
2449
2607
|
}
|
|
2450
2608
|
getNode(t) {
|
|
2451
|
-
const
|
|
2452
|
-
if (
|
|
2453
|
-
return
|
|
2454
|
-
for (const
|
|
2455
|
-
const i = $t(
|
|
2609
|
+
const s = this.snapshot.views.get(t);
|
|
2610
|
+
if (s)
|
|
2611
|
+
return s;
|
|
2612
|
+
for (const r of this.snapshot.views.values()) {
|
|
2613
|
+
const i = $t(r, t);
|
|
2456
2614
|
if (i)
|
|
2457
2615
|
return i;
|
|
2458
2616
|
}
|
|
@@ -2466,15 +2624,15 @@ class Oi {
|
|
|
2466
2624
|
return;
|
|
2467
2625
|
}
|
|
2468
2626
|
for (const t of this.changedNodeIds) {
|
|
2469
|
-
const
|
|
2470
|
-
if (
|
|
2471
|
-
for (const
|
|
2472
|
-
|
|
2627
|
+
const s = this.nodeListeners.get(t);
|
|
2628
|
+
if (s)
|
|
2629
|
+
for (const r of s)
|
|
2630
|
+
r();
|
|
2473
2631
|
}
|
|
2474
2632
|
this.changedNodeIds.clear();
|
|
2475
2633
|
}
|
|
2476
2634
|
commitSnapshot() {
|
|
2477
|
-
let t,
|
|
2635
|
+
let t, s, r;
|
|
2478
2636
|
if (this.viewsDirty) {
|
|
2479
2637
|
const n = /* @__PURE__ */ new Map();
|
|
2480
2638
|
for (const [o, a] of this.views)
|
|
@@ -2497,10 +2655,10 @@ class Oi {
|
|
|
2497
2655
|
}))
|
|
2498
2656
|
);
|
|
2499
2657
|
}
|
|
2500
|
-
|
|
2658
|
+
s = n, this.patchesDirty = !1;
|
|
2501
2659
|
} else
|
|
2502
|
-
|
|
2503
|
-
this.payloadsDirty ? (
|
|
2660
|
+
s = this.snapshot.optimisticPatches;
|
|
2661
|
+
this.payloadsDirty ? (r = new Map(this.payloads), this.payloadsDirty = !1) : r = this.snapshot.payloads;
|
|
2504
2662
|
let i = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
|
|
2505
2663
|
if (i === void 0)
|
|
2506
2664
|
for (const n of this.views.values())
|
|
@@ -2508,8 +2666,8 @@ class Oi {
|
|
|
2508
2666
|
this.snapshot = {
|
|
2509
2667
|
rootViewId: this.rootViewId,
|
|
2510
2668
|
views: t,
|
|
2511
|
-
payloads:
|
|
2512
|
-
optimisticPatches:
|
|
2669
|
+
payloads: r,
|
|
2670
|
+
optimisticPatches: s,
|
|
2513
2671
|
version: i
|
|
2514
2672
|
};
|
|
2515
2673
|
for (const n of this.changedNodeIds)
|
|
@@ -2523,59 +2681,59 @@ class Oi {
|
|
|
2523
2681
|
}
|
|
2524
2682
|
}
|
|
2525
2683
|
}
|
|
2526
|
-
class
|
|
2684
|
+
class nn {
|
|
2527
2685
|
streams = /* @__PURE__ */ new Map();
|
|
2528
2686
|
listeners = /* @__PURE__ */ new Set();
|
|
2529
|
-
apply(t,
|
|
2530
|
-
const i = this.getOrCreateStreamEntry(t).store.apply(
|
|
2687
|
+
apply(t, s) {
|
|
2688
|
+
const i = this.getOrCreateStreamEntry(t).store.apply(s);
|
|
2531
2689
|
return i && this.notify(t), i;
|
|
2532
2690
|
}
|
|
2533
2691
|
applyStoreOp(t) {
|
|
2534
2692
|
if (t.type === "ReplaceStreamSnapshot") {
|
|
2535
|
-
const
|
|
2536
|
-
return
|
|
2693
|
+
const s = this.getOrCreateStreamEntry(t.snapshot.streamId), r = s.category !== t.snapshot.category;
|
|
2694
|
+
return s.category = t.snapshot.category, s.store.replaceFromWire(t.snapshot) || r ? (this.notify(t.snapshot.streamId), !0) : !1;
|
|
2537
2695
|
}
|
|
2538
2696
|
if (t.type === "PatchStreamSnapshot") {
|
|
2539
|
-
const
|
|
2540
|
-
return t.category !== void 0 && (
|
|
2697
|
+
const s = this.getOrCreateStreamEntry(t.streamId), r = t.category !== void 0 && s.category !== t.category;
|
|
2698
|
+
return t.category !== void 0 && (s.category = t.category), s.store.patchFromOp(t) || r ? (this.notify(t.streamId), !0) : !1;
|
|
2541
2699
|
}
|
|
2542
2700
|
if (t.type === "ClearStream") {
|
|
2543
|
-
const
|
|
2544
|
-
return
|
|
2701
|
+
const s = this.streams.get(t.streamId);
|
|
2702
|
+
return s ? (s.store.clear(), this.notify(t.streamId), !0) : !1;
|
|
2545
2703
|
}
|
|
2546
2704
|
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;
|
|
2547
2705
|
}
|
|
2548
2706
|
applyStoreOps(t) {
|
|
2549
|
-
for (const
|
|
2550
|
-
this.applyStoreOp(
|
|
2707
|
+
for (const s of t)
|
|
2708
|
+
this.applyStoreOp(s);
|
|
2551
2709
|
}
|
|
2552
2710
|
clear(t) {
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2711
|
+
const s = this.streams.get(t);
|
|
2712
|
+
s && (s.store.clear(), this.notify(t));
|
|
2555
2713
|
}
|
|
2556
2714
|
remove(t) {
|
|
2557
2715
|
this.streams.delete(t) && this.notify(t);
|
|
2558
2716
|
}
|
|
2559
|
-
setCategory(t,
|
|
2560
|
-
const
|
|
2561
|
-
|
|
2717
|
+
setCategory(t, s) {
|
|
2718
|
+
const r = this.getOrCreateStreamEntry(t);
|
|
2719
|
+
r.category !== s && (r.category = s, this.notify(t));
|
|
2562
2720
|
}
|
|
2563
2721
|
getSnapshot(t) {
|
|
2564
|
-
const
|
|
2565
|
-
return
|
|
2566
|
-
...
|
|
2722
|
+
const s = this.streams.get(t);
|
|
2723
|
+
return s ? {
|
|
2724
|
+
...s.store.getSnapshot(),
|
|
2567
2725
|
streamId: t,
|
|
2568
|
-
category:
|
|
2726
|
+
category: s.category
|
|
2569
2727
|
} : void 0;
|
|
2570
2728
|
}
|
|
2571
2729
|
getSnapshots() {
|
|
2572
2730
|
const t = [];
|
|
2573
|
-
for (const [
|
|
2574
|
-
const i =
|
|
2731
|
+
for (const [s, r] of this.streams) {
|
|
2732
|
+
const i = r.store.getSnapshot();
|
|
2575
2733
|
t.push({
|
|
2576
2734
|
...i,
|
|
2577
|
-
streamId:
|
|
2578
|
-
category:
|
|
2735
|
+
streamId: s,
|
|
2736
|
+
category: r.category
|
|
2579
2737
|
});
|
|
2580
2738
|
}
|
|
2581
2739
|
return t;
|
|
@@ -2586,164 +2744,186 @@ class bi {
|
|
|
2586
2744
|
};
|
|
2587
2745
|
}
|
|
2588
2746
|
getOrCreateStreamEntry(t) {
|
|
2589
|
-
let
|
|
2590
|
-
return
|
|
2747
|
+
let s = this.streams.get(t);
|
|
2748
|
+
return s || (s = { store: new rn() }, this.streams.set(t, s)), s;
|
|
2591
2749
|
}
|
|
2592
2750
|
notify(t) {
|
|
2593
|
-
for (const
|
|
2594
|
-
|
|
2751
|
+
for (const s of this.listeners)
|
|
2752
|
+
s(t);
|
|
2595
2753
|
}
|
|
2596
2754
|
}
|
|
2597
|
-
function
|
|
2598
|
-
if (
|
|
2755
|
+
function j(e, t, s) {
|
|
2756
|
+
if (t.length === 0)
|
|
2599
2757
|
return e;
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2758
|
+
const r = /* @__PURE__ */ new Map();
|
|
2759
|
+
for (const i of t)
|
|
2760
|
+
r.set(i.nodeId, i);
|
|
2761
|
+
return Wt(e, r);
|
|
2762
|
+
}
|
|
2763
|
+
function Wt(e, t, s) {
|
|
2764
|
+
const r = t.get(e.id);
|
|
2765
|
+
let i = e, n = !1;
|
|
2766
|
+
if (r?.textUpdates && r.textUpdates.length > 0) {
|
|
2767
|
+
const f = hn(e, r.textUpdates);
|
|
2768
|
+
i = f.node, n = f.changed;
|
|
2769
|
+
}
|
|
2770
|
+
let o = !1, a = i.props;
|
|
2771
|
+
if (r?.changedProps && r.changedProps.size > 0)
|
|
2772
|
+
for (const [f, A] of r.changedProps.entries()) {
|
|
2773
|
+
const T = a[f];
|
|
2774
|
+
if (A === void 0)
|
|
2775
|
+
(T !== void 0 || f in a) && (o || (a = V(a), o = !0), delete a[f]);
|
|
2776
|
+
else if (q(A)) {
|
|
2777
|
+
const S = V(A);
|
|
2778
|
+
k(S, T) || (o || (a = V(a), o = !0), a[f] = S);
|
|
2614
2779
|
} else
|
|
2615
|
-
k(
|
|
2616
|
-
}
|
|
2617
|
-
let
|
|
2618
|
-
|
|
2619
|
-
const
|
|
2620
|
-
let
|
|
2621
|
-
if (
|
|
2622
|
-
const
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
const
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2780
|
+
k(A, T) || (o || (a = V(a), o = !0), a[f] = A);
|
|
2781
|
+
}
|
|
2782
|
+
let l = !1, u = i.styleIds;
|
|
2783
|
+
r?.styleIds !== void 0 && (jt(i.styleIds, r.styleIds) || (u = r.styleIds, l = !0));
|
|
2784
|
+
const I = i.children ?? [];
|
|
2785
|
+
let c = I, h = !1;
|
|
2786
|
+
if (r?.removals && r.removals.length > 0 || r?.moves && r.moves.length > 0 || r?.inserts && r.inserts.length > 0) {
|
|
2787
|
+
const f = c.slice();
|
|
2788
|
+
if (r?.removals && r.removals.length > 0) {
|
|
2789
|
+
const A = [...r.removals].sort((T, S) => S.index - T.index);
|
|
2790
|
+
for (const T of A)
|
|
2791
|
+
T.index >= 0 && T.index < f.length && f.splice(T.index, 1);
|
|
2792
|
+
h = !0;
|
|
2793
|
+
}
|
|
2794
|
+
if (r?.moves && r.moves.length > 0) {
|
|
2795
|
+
const A = [...r.moves].sort((S, g) => S.toIndex - g.toIndex), T = /* @__PURE__ */ new Map();
|
|
2796
|
+
for (const S of A) {
|
|
2797
|
+
const g = f.findIndex(($) => $.id === S.nodeId);
|
|
2798
|
+
g >= 0 && (T.set(S.nodeId, f[g]), f.splice(g, 1));
|
|
2799
|
+
}
|
|
2800
|
+
for (const S of A) {
|
|
2801
|
+
const g = T.get(S.nodeId);
|
|
2802
|
+
if (g) {
|
|
2803
|
+
const $ = Math.min(S.toIndex, f.length);
|
|
2804
|
+
f.splice($, 0, g);
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
h = !0;
|
|
2808
|
+
}
|
|
2809
|
+
if (r?.inserts && r.inserts.length > 0) {
|
|
2810
|
+
const A = [...r.inserts].sort((T, S) => T.index - S.index);
|
|
2811
|
+
for (const T of A) {
|
|
2812
|
+
const S = Math.min(T.index, f.length);
|
|
2813
|
+
f.splice(S, 0, T.node);
|
|
2814
|
+
}
|
|
2815
|
+
h = !0;
|
|
2816
|
+
}
|
|
2817
|
+
c = f;
|
|
2818
|
+
}
|
|
2819
|
+
let _;
|
|
2820
|
+
for (let f = 0; f < c.length; f++) {
|
|
2821
|
+
const A = c[f], T = Wt(A, t);
|
|
2822
|
+
T !== A && (_ || (_ = c.slice()), _[f] = T);
|
|
2823
|
+
}
|
|
2824
|
+
return _ && (c = _, h = !0), n || o || l || h ? !o && !h && !l ? i : {
|
|
2825
|
+
id: e.id,
|
|
2826
|
+
type: e.type,
|
|
2827
|
+
props: o ? a : i.props,
|
|
2828
|
+
children: h ? c : I,
|
|
2829
|
+
styleIds: l ? u : i.styleIds
|
|
2650
2830
|
} : e;
|
|
2651
2831
|
}
|
|
2652
2832
|
function b(e, t) {
|
|
2653
2833
|
if (t.add(e.id), e.children)
|
|
2654
|
-
for (const
|
|
2655
|
-
b(
|
|
2834
|
+
for (const s of e.children)
|
|
2835
|
+
b(s, t);
|
|
2656
2836
|
}
|
|
2657
2837
|
const x = [];
|
|
2658
|
-
function
|
|
2838
|
+
function on(e) {
|
|
2659
2839
|
for (; x.length <= e; )
|
|
2660
2840
|
x.push(/* @__PURE__ */ new Map());
|
|
2661
2841
|
return x[e].clear(), x[e];
|
|
2662
2842
|
}
|
|
2663
|
-
function H(e, t,
|
|
2664
|
-
|
|
2843
|
+
function H(e, t, s) {
|
|
2844
|
+
Kt(e, t, s, 0);
|
|
2665
2845
|
}
|
|
2666
|
-
function
|
|
2846
|
+
function Kt(e, t, s, r) {
|
|
2667
2847
|
if (e === t)
|
|
2668
2848
|
return;
|
|
2669
|
-
(e.type !== t.type || !
|
|
2849
|
+
(e.type !== t.type || !an(e.props, t.props) || !jt(e.styleIds, t.styleIds)) && s.add(t.id);
|
|
2670
2850
|
const n = e.children ?? [], o = t.children ?? [];
|
|
2671
2851
|
if (n !== o) {
|
|
2672
|
-
const a =
|
|
2852
|
+
const a = on(r);
|
|
2673
2853
|
for (const l of n)
|
|
2674
2854
|
a.set(l.id, l);
|
|
2675
2855
|
for (const l of o) {
|
|
2676
2856
|
const u = a.get(l.id);
|
|
2677
|
-
u ?
|
|
2857
|
+
u ? Kt(u, l, s, r + 1) : b(l, s);
|
|
2678
2858
|
}
|
|
2679
|
-
n.length !== o.length &&
|
|
2859
|
+
n.length !== o.length && s.add(t.id);
|
|
2680
2860
|
}
|
|
2681
2861
|
}
|
|
2682
|
-
function
|
|
2862
|
+
function an(e, t) {
|
|
2683
2863
|
return k(e, t);
|
|
2684
2864
|
}
|
|
2685
2865
|
function $t(e, t) {
|
|
2686
2866
|
if (e.id === t)
|
|
2687
2867
|
return e;
|
|
2688
2868
|
if (e.children)
|
|
2689
|
-
for (const
|
|
2690
|
-
const
|
|
2691
|
-
if (
|
|
2692
|
-
return
|
|
2869
|
+
for (const s of e.children) {
|
|
2870
|
+
const r = $t(s, t);
|
|
2871
|
+
if (r)
|
|
2872
|
+
return r;
|
|
2693
2873
|
}
|
|
2694
2874
|
}
|
|
2695
2875
|
function jt(e, t) {
|
|
2696
2876
|
return k(e, t);
|
|
2697
2877
|
}
|
|
2698
|
-
function
|
|
2878
|
+
function ln(e, t) {
|
|
2699
2879
|
if (e === t) return !0;
|
|
2700
2880
|
if (!e || !t || e.length !== t.length) return !1;
|
|
2701
|
-
for (let
|
|
2702
|
-
const
|
|
2703
|
-
if (
|
|
2881
|
+
for (let s = 0; s < e.length; s++) {
|
|
2882
|
+
const r = e[s], i = t[s];
|
|
2883
|
+
if (r.id !== i.id || r.actionId !== i.actionId || r.ordinal !== i.ordinal || r.baseVersion !== i.baseVersion)
|
|
2704
2884
|
return !1;
|
|
2705
2885
|
}
|
|
2706
2886
|
return !0;
|
|
2707
2887
|
}
|
|
2708
|
-
function
|
|
2888
|
+
function In(e, t) {
|
|
2709
2889
|
if (t.length === 0)
|
|
2710
2890
|
return e;
|
|
2711
|
-
const
|
|
2712
|
-
let
|
|
2713
|
-
for (const n of
|
|
2714
|
-
const o =
|
|
2891
|
+
const s = [...t].sort((n, o) => n.start - o.start);
|
|
2892
|
+
let r = e, i = 0;
|
|
2893
|
+
for (const n of s) {
|
|
2894
|
+
const o = at(n.start + i, 0, r.length);
|
|
2715
2895
|
if (n.end == null) {
|
|
2716
|
-
const I =
|
|
2717
|
-
|
|
2896
|
+
const I = r.slice(o), c = cn(I, n.insertedText);
|
|
2897
|
+
r = r.slice(0, o) + n.insertedText + I.slice(c), i += n.insertedText.length - c;
|
|
2718
2898
|
continue;
|
|
2719
2899
|
}
|
|
2720
|
-
const a = n.end + i, l =
|
|
2721
|
-
|
|
2900
|
+
const a = n.end + i, l = at(a, o, r.length), u = l - o;
|
|
2901
|
+
r = r.slice(0, o) + n.insertedText + r.slice(l), i += n.insertedText.length - u;
|
|
2722
2902
|
}
|
|
2723
|
-
return
|
|
2903
|
+
return r;
|
|
2724
2904
|
}
|
|
2725
|
-
function
|
|
2905
|
+
function hn(e, t, s) {
|
|
2726
2906
|
if (t.length === 0)
|
|
2727
2907
|
return { node: e, changed: !1 };
|
|
2728
|
-
const
|
|
2908
|
+
const r = /* @__PURE__ */ new Map();
|
|
2729
2909
|
for (const i of t) {
|
|
2730
|
-
const n =
|
|
2731
|
-
n ? n.push(i) :
|
|
2910
|
+
const n = r.get(i.nodeId);
|
|
2911
|
+
n ? n.push(i) : r.set(i.nodeId, [i]);
|
|
2732
2912
|
}
|
|
2733
|
-
return Xt(e,
|
|
2913
|
+
return Xt(e, r);
|
|
2734
2914
|
}
|
|
2735
|
-
function Xt(e, t,
|
|
2736
|
-
const
|
|
2915
|
+
function Xt(e, t, s) {
|
|
2916
|
+
const r = t.get(e.id) ?? [];
|
|
2737
2917
|
let i = !1, n = e.props;
|
|
2738
|
-
if (
|
|
2918
|
+
if (r.length > 0) {
|
|
2739
2919
|
const u = /* @__PURE__ */ new Map();
|
|
2740
|
-
for (const I of
|
|
2920
|
+
for (const I of r) {
|
|
2741
2921
|
const c = u.get(I.propertyName);
|
|
2742
2922
|
c ? c.push(I) : u.set(I.propertyName, [I]);
|
|
2743
2923
|
}
|
|
2744
2924
|
for (const [I, c] of u.entries()) {
|
|
2745
|
-
const h = n[I],
|
|
2746
|
-
i || (n =
|
|
2925
|
+
const h = n[I], _ = In(typeof h == "string" ? h : "", c);
|
|
2926
|
+
i || (n = V(n), i = !0), n[I] = _;
|
|
2747
2927
|
}
|
|
2748
2928
|
}
|
|
2749
2929
|
let o = !1;
|
|
@@ -2768,20 +2948,20 @@ function Xt(e, t, r) {
|
|
|
2768
2948
|
changed: !0
|
|
2769
2949
|
};
|
|
2770
2950
|
}
|
|
2771
|
-
function
|
|
2772
|
-
return Math.max(t, Math.min(
|
|
2951
|
+
function at(e, t, s) {
|
|
2952
|
+
return Math.max(t, Math.min(s, e));
|
|
2773
2953
|
}
|
|
2774
|
-
function
|
|
2775
|
-
const
|
|
2776
|
-
let
|
|
2777
|
-
for (;
|
|
2778
|
-
|
|
2779
|
-
return
|
|
2780
|
-
}
|
|
2781
|
-
function
|
|
2782
|
-
const t = {},
|
|
2783
|
-
for (let
|
|
2784
|
-
const i = r
|
|
2954
|
+
function cn(e, t) {
|
|
2955
|
+
const s = Math.min(e.length, t.length);
|
|
2956
|
+
let r = 0;
|
|
2957
|
+
for (; r < s && e.charCodeAt(r) === t.charCodeAt(r); )
|
|
2958
|
+
r++;
|
|
2959
|
+
return r;
|
|
2960
|
+
}
|
|
2961
|
+
function V(e) {
|
|
2962
|
+
const t = {}, s = Object.keys(e);
|
|
2963
|
+
for (let r = 0; r < s.length; r++) {
|
|
2964
|
+
const i = s[r];
|
|
2785
2965
|
t[i] = e[i];
|
|
2786
2966
|
}
|
|
2787
2967
|
return t;
|
|
@@ -2795,48 +2975,49 @@ function k(e, t) {
|
|
|
2795
2975
|
if (Array.isArray(e) && Array.isArray(t)) {
|
|
2796
2976
|
if (e.length !== t.length)
|
|
2797
2977
|
return !1;
|
|
2798
|
-
for (let
|
|
2799
|
-
if (!k(e[
|
|
2978
|
+
for (let s = 0; s < e.length; s++)
|
|
2979
|
+
if (!k(e[s], t[s]))
|
|
2800
2980
|
return !1;
|
|
2801
2981
|
return !0;
|
|
2802
2982
|
}
|
|
2803
2983
|
if (q(e) && q(t)) {
|
|
2804
|
-
const
|
|
2805
|
-
if (
|
|
2984
|
+
const s = Object.keys(e), r = Object.keys(t);
|
|
2985
|
+
if (s.length !== r.length)
|
|
2806
2986
|
return !1;
|
|
2807
|
-
for (const i of
|
|
2987
|
+
for (const i of s)
|
|
2808
2988
|
if (!k(e[i], t[i]))
|
|
2809
2989
|
return !1;
|
|
2810
2990
|
return !0;
|
|
2811
2991
|
}
|
|
2812
2992
|
return !1;
|
|
2813
2993
|
}
|
|
2814
|
-
function
|
|
2994
|
+
function un(e) {
|
|
2815
2995
|
return new Worker(
|
|
2816
|
-
"" + new URL("assets/ui-worker-
|
|
2996
|
+
"" + new URL("assets/ui-worker-CcCXE6uz.js", import.meta.url).href,
|
|
2817
2997
|
{
|
|
2818
2998
|
type: "module",
|
|
2819
2999
|
name: e?.name
|
|
2820
3000
|
}
|
|
2821
3001
|
);
|
|
2822
3002
|
}
|
|
2823
|
-
const
|
|
2824
|
-
class
|
|
3003
|
+
const R = zt("IkonUICore");
|
|
3004
|
+
class fn {
|
|
2825
3005
|
unsubscribeProtocolMessages;
|
|
2826
3006
|
client = null;
|
|
2827
|
-
uiStore = new
|
|
3007
|
+
uiStore = new nn();
|
|
2828
3008
|
uiWorker = null;
|
|
2829
3009
|
uiStyles = /* @__PURE__ */ new Map();
|
|
2830
3010
|
uiUpdateListeners = /* @__PURE__ */ new Set();
|
|
2831
3011
|
uiStyleListeners = /* @__PURE__ */ new Set();
|
|
3012
|
+
uiStyleDeleteListeners = /* @__PURE__ */ new Set();
|
|
2832
3013
|
uiStreamClearedListeners = /* @__PURE__ */ new Set();
|
|
2833
3014
|
useUiWorker;
|
|
2834
3015
|
constructor(t) {
|
|
2835
|
-
const
|
|
2836
|
-
this.useUiWorker =
|
|
3016
|
+
const s = t?.threading?.uiWorker ?? "auto";
|
|
3017
|
+
this.useUiWorker = s !== "disabled" && typeof Worker < "u", t?.client && this.initialize(t.client, t);
|
|
2837
3018
|
}
|
|
2838
3019
|
dispose() {
|
|
2839
|
-
this.unsubscribeProtocolMessages?.(), this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyles.clear();
|
|
3020
|
+
this.unsubscribeProtocolMessages?.(), this.uiWorker?.terminate(), this.uiWorker = null, this.client = null, this.uiStyleListeners.clear(), this.uiStyleDeleteListeners.clear(), this.uiStyles.clear();
|
|
2840
3021
|
}
|
|
2841
3022
|
subscribeToUiUpdates(t) {
|
|
2842
3023
|
return this.uiUpdateListeners.add(t), () => {
|
|
@@ -2853,13 +3034,18 @@ class xi {
|
|
|
2853
3034
|
this.uiStyleListeners.delete(t);
|
|
2854
3035
|
};
|
|
2855
3036
|
}
|
|
3037
|
+
subscribeToUiStyleDeletes(t) {
|
|
3038
|
+
return this.uiStyleDeleteListeners.add(t), () => {
|
|
3039
|
+
this.uiStyleDeleteListeners.delete(t);
|
|
3040
|
+
};
|
|
3041
|
+
}
|
|
2856
3042
|
getUiStyles() {
|
|
2857
3043
|
return Array.from(this.uiStyles.values());
|
|
2858
3044
|
}
|
|
2859
|
-
initialize(t,
|
|
2860
|
-
this.client = t, this.useUiWorker && this.startUiWorker(
|
|
2861
|
-
const
|
|
2862
|
-
opcodeGroupsMask:
|
|
3045
|
+
initialize(t, s) {
|
|
3046
|
+
this.client = t, this.useUiWorker && this.startUiWorker(s);
|
|
3047
|
+
const r = {
|
|
3048
|
+
opcodeGroupsMask: m.GROUP_CORE | m.GROUP_UI | m.GROUP_ACTIONS
|
|
2863
3049
|
};
|
|
2864
3050
|
this.unsubscribeProtocolMessages = t.subscribeToProtocolMessages((i) => {
|
|
2865
3051
|
if (this.uiWorker) {
|
|
@@ -2867,57 +3053,57 @@ class xi {
|
|
|
2867
3053
|
return;
|
|
2868
3054
|
}
|
|
2869
3055
|
this.handleProtocolMessage(i);
|
|
2870
|
-
},
|
|
3056
|
+
}, r);
|
|
2871
3057
|
}
|
|
2872
3058
|
startUiWorker(t) {
|
|
2873
3059
|
try {
|
|
2874
|
-
this.uiWorker = new
|
|
3060
|
+
this.uiWorker = new un();
|
|
2875
3061
|
} catch (i) {
|
|
2876
|
-
|
|
3062
|
+
R.warn("Failed to create UI worker, falling back to main thread", i), this.uiWorker = null;
|
|
2877
3063
|
return;
|
|
2878
3064
|
}
|
|
2879
|
-
const
|
|
2880
|
-
this.uiWorker.postMessage({ type: "configure", flushIntervalMs:
|
|
3065
|
+
const s = t?.threading?.flushIntervalMs, r = t?.threading?.maxLatencyMs;
|
|
3066
|
+
this.uiWorker.postMessage({ type: "configure", flushIntervalMs: s, maxLatencyMs: r }), this.uiWorker.addEventListener("message", (i) => {
|
|
2881
3067
|
this.handleUiStoreOpBatch(i.data);
|
|
2882
3068
|
}), this.uiWorker.addEventListener("error", (i) => {
|
|
2883
3069
|
const n = [i.message, i.filename, i.lineno, i.colno].filter((o) => o != null && String(o).length > 0);
|
|
2884
|
-
|
|
3070
|
+
R.warn(`UI worker failed, falling back to main thread: ${n.join(" ")}`.trim()), this.uiWorker?.terminate(), this.uiWorker = null, this.rehydrateStoresForMainThread();
|
|
2885
3071
|
});
|
|
2886
3072
|
}
|
|
2887
3073
|
rehydrateStoresForMainThread() {
|
|
2888
3074
|
for (const t of this.uiStore.getSnapshots()) {
|
|
2889
3075
|
if (!t.rootViewId)
|
|
2890
3076
|
continue;
|
|
2891
|
-
const
|
|
2892
|
-
if (!
|
|
3077
|
+
const s = t.views.get(t.rootViewId);
|
|
3078
|
+
if (!s)
|
|
2893
3079
|
continue;
|
|
2894
|
-
const
|
|
3080
|
+
const r = {
|
|
2895
3081
|
snapshot: {
|
|
2896
3082
|
type: "full",
|
|
2897
3083
|
version: t.version ?? 0,
|
|
2898
3084
|
metadata: { viewId: t.rootViewId },
|
|
2899
|
-
root:
|
|
3085
|
+
root: s
|
|
2900
3086
|
},
|
|
2901
3087
|
payloads: t.payloads
|
|
2902
3088
|
};
|
|
2903
|
-
this.uiStore.apply(t.streamId,
|
|
3089
|
+
this.uiStore.apply(t.streamId, r);
|
|
2904
3090
|
}
|
|
2905
3091
|
}
|
|
2906
3092
|
forwardMessageToWorker(t) {
|
|
2907
3093
|
if (this.uiWorker)
|
|
2908
3094
|
try {
|
|
2909
|
-
const
|
|
2910
|
-
this.uiWorker.postMessage({ type: "protocol", message:
|
|
2911
|
-
} catch (
|
|
2912
|
-
|
|
3095
|
+
const s = t.slice().buffer;
|
|
3096
|
+
this.uiWorker.postMessage({ type: "protocol", message: s }, [s]);
|
|
3097
|
+
} catch (s) {
|
|
3098
|
+
R.warn("Failed to forward message to UI worker", s);
|
|
2913
3099
|
}
|
|
2914
3100
|
}
|
|
2915
3101
|
handleUiStoreOpBatch(t) {
|
|
2916
|
-
for (const
|
|
2917
|
-
this.applyUiStoreOp(
|
|
3102
|
+
for (const s of t.ops)
|
|
3103
|
+
this.applyUiStoreOp(s);
|
|
2918
3104
|
if (t.acks && t.acks.length > 0)
|
|
2919
|
-
for (const
|
|
2920
|
-
this.sendUiUpdateAck(
|
|
3105
|
+
for (const s of t.acks)
|
|
3106
|
+
this.sendUiUpdateAck(s.trackId, s.version);
|
|
2921
3107
|
}
|
|
2922
3108
|
applyUiStoreOp(t) {
|
|
2923
3109
|
if (t.type === "UpsertUiStyle") {
|
|
@@ -2925,7 +3111,7 @@ class xi {
|
|
|
2925
3111
|
return;
|
|
2926
3112
|
}
|
|
2927
3113
|
if (t.type === "RemoveUiStyle") {
|
|
2928
|
-
this.uiStyles.delete(t.styleId);
|
|
3114
|
+
this.uiStyles.delete(t.styleId) && this.notifyUiStyleDelete([t.styleId]);
|
|
2929
3115
|
return;
|
|
2930
3116
|
}
|
|
2931
3117
|
if (t.type === "ClearStream") {
|
|
@@ -2943,7 +3129,7 @@ class xi {
|
|
|
2943
3129
|
if (t.type === "ReplaceStreamSnapshot" || t.type === "PatchStreamSnapshot") {
|
|
2944
3130
|
if (!this.uiStore.applyStoreOp(t))
|
|
2945
3131
|
return;
|
|
2946
|
-
const
|
|
3132
|
+
const r = t.type === "ReplaceStreamSnapshot" ? t.snapshot.streamId : t.streamId, i = this.uiStore.getSnapshot(r);
|
|
2947
3133
|
if (!i?.rootViewId)
|
|
2948
3134
|
return;
|
|
2949
3135
|
const n = i.views.get(i.rootViewId);
|
|
@@ -2958,25 +3144,28 @@ class xi {
|
|
|
2958
3144
|
},
|
|
2959
3145
|
payloads: i.payloads
|
|
2960
3146
|
};
|
|
2961
|
-
this.notifyUiUpdate(
|
|
3147
|
+
this.notifyUiUpdate(r, o);
|
|
2962
3148
|
return;
|
|
2963
3149
|
}
|
|
2964
3150
|
}
|
|
2965
3151
|
handleProtocolMessage(t) {
|
|
2966
3152
|
switch (Jt(t)) {
|
|
2967
|
-
case
|
|
3153
|
+
case m.CORE_GLOBAL_STATE:
|
|
2968
3154
|
this.handleGlobalState(t);
|
|
2969
3155
|
return;
|
|
2970
|
-
case
|
|
3156
|
+
case m.UI_UPDATE:
|
|
2971
3157
|
this.handleUiUpdate(t);
|
|
2972
3158
|
return;
|
|
2973
|
-
case
|
|
3159
|
+
case m.UI_STYLES:
|
|
2974
3160
|
this.handleUiStyles(t);
|
|
2975
3161
|
return;
|
|
2976
|
-
case
|
|
3162
|
+
case m.UI_STYLES_BATCH:
|
|
2977
3163
|
this.handleUiStylesBatch(t);
|
|
2978
3164
|
return;
|
|
2979
|
-
case
|
|
3165
|
+
case m.UI_STYLES_DELETE:
|
|
3166
|
+
this.handleUiStylesDelete(t);
|
|
3167
|
+
return;
|
|
3168
|
+
case m.ACTION_UI_CLEAR_STREAM:
|
|
2980
3169
|
this.handleClearStream(t);
|
|
2981
3170
|
return;
|
|
2982
3171
|
default:
|
|
@@ -2985,86 +3174,101 @@ class xi {
|
|
|
2985
3174
|
}
|
|
2986
3175
|
handleGlobalState(t) {
|
|
2987
3176
|
try {
|
|
2988
|
-
const
|
|
2989
|
-
for (const i of Object.values(
|
|
2990
|
-
|
|
3177
|
+
const s = hr(t), r = /* @__PURE__ */ new Set();
|
|
3178
|
+
for (const i of Object.values(s.UIStreams ?? {}))
|
|
3179
|
+
r.add(i.StreamId), this.uiStore.setCategory(i.StreamId, i.Info?.Category);
|
|
2991
3180
|
for (const i of this.uiStore.getSnapshots())
|
|
2992
|
-
|
|
2993
|
-
} catch (
|
|
2994
|
-
|
|
3181
|
+
r.has(i.streamId) || (this.uiStore.remove(i.streamId), this.notifyUiStreamCleared(i.streamId));
|
|
3182
|
+
} catch (s) {
|
|
3183
|
+
R.error("Failed to handle global state", s);
|
|
2995
3184
|
}
|
|
2996
3185
|
}
|
|
2997
3186
|
handleUiUpdate(t) {
|
|
2998
|
-
const
|
|
3187
|
+
const s = nt(t), r = `${s.senderId}_${s.trackId}`;
|
|
2999
3188
|
try {
|
|
3000
|
-
const i =
|
|
3001
|
-
this.notifyUiUpdate(
|
|
3189
|
+
const i = Bi(t), n = en(i);
|
|
3190
|
+
this.notifyUiUpdate(r, n), this.uiStore.apply(r, n), this.sendUiUpdateAck(s.trackId, n.snapshot.version);
|
|
3002
3191
|
} catch (i) {
|
|
3003
|
-
i instanceof
|
|
3192
|
+
i instanceof D ? R.warn("Failed to parse UI update", i.causeError ?? i) : R.error("Failed to apply UI update", i);
|
|
3004
3193
|
}
|
|
3005
3194
|
}
|
|
3006
3195
|
handleUiStyles(t) {
|
|
3007
3196
|
try {
|
|
3008
|
-
const
|
|
3009
|
-
if (!
|
|
3010
|
-
const
|
|
3011
|
-
styleId:
|
|
3012
|
-
css:
|
|
3013
|
-
common:
|
|
3197
|
+
const s = ni(t);
|
|
3198
|
+
if (!s.StyleId) return;
|
|
3199
|
+
const r = {
|
|
3200
|
+
styleId: s.StyleId,
|
|
3201
|
+
css: s.Style?.css,
|
|
3202
|
+
common: s.Style?.common
|
|
3014
3203
|
};
|
|
3015
|
-
this.uiStyles.set(
|
|
3016
|
-
} catch (
|
|
3017
|
-
|
|
3204
|
+
this.uiStyles.set(r.styleId, r), this.notifyUiStyle(r);
|
|
3205
|
+
} catch (s) {
|
|
3206
|
+
R.error("Failed to handle UI styles", s);
|
|
3018
3207
|
}
|
|
3019
3208
|
}
|
|
3020
3209
|
handleUiStylesBatch(t) {
|
|
3021
3210
|
try {
|
|
3022
|
-
const
|
|
3023
|
-
if (!
|
|
3024
|
-
for (const
|
|
3025
|
-
if (!
|
|
3211
|
+
const s = _i(t);
|
|
3212
|
+
if (!s.Styles) return;
|
|
3213
|
+
for (const r of s.Styles) {
|
|
3214
|
+
if (!r.StyleId) continue;
|
|
3026
3215
|
const i = {
|
|
3027
|
-
styleId:
|
|
3028
|
-
css:
|
|
3029
|
-
common:
|
|
3216
|
+
styleId: r.StyleId,
|
|
3217
|
+
css: r.Style?.css,
|
|
3218
|
+
common: r.Style?.common
|
|
3030
3219
|
};
|
|
3031
3220
|
this.uiStyles.set(i.styleId, i), this.notifyUiStyle(i);
|
|
3032
3221
|
}
|
|
3033
|
-
} catch (
|
|
3034
|
-
|
|
3222
|
+
} catch (s) {
|
|
3223
|
+
R.error("Failed to handle UI styles batch", s);
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
handleUiStylesDelete(t) {
|
|
3227
|
+
try {
|
|
3228
|
+
const s = gi(t);
|
|
3229
|
+
if (!s.StyleIds || s.StyleIds.length === 0) return;
|
|
3230
|
+
for (const r of s.StyleIds)
|
|
3231
|
+
this.uiStyles.delete(r);
|
|
3232
|
+
this.notifyUiStyleDelete(s.StyleIds);
|
|
3233
|
+
} catch (s) {
|
|
3234
|
+
R.error("Failed to handle UI styles delete", s);
|
|
3035
3235
|
}
|
|
3036
3236
|
}
|
|
3037
3237
|
handleClearStream(t) {
|
|
3038
|
-
const
|
|
3039
|
-
this.uiStore.clear(
|
|
3238
|
+
const s = nt(t), r = `${s.senderId}_${s.trackId}`;
|
|
3239
|
+
this.uiStore.clear(r), this.notifyUiStreamCleared(r);
|
|
3040
3240
|
}
|
|
3041
|
-
notifyUiUpdate(t,
|
|
3042
|
-
for (const
|
|
3043
|
-
|
|
3241
|
+
notifyUiUpdate(t, s) {
|
|
3242
|
+
for (const r of this.uiUpdateListeners)
|
|
3243
|
+
r(t, s);
|
|
3044
3244
|
}
|
|
3045
3245
|
notifyUiStyle(t) {
|
|
3046
|
-
for (const
|
|
3047
|
-
|
|
3246
|
+
for (const s of this.uiStyleListeners)
|
|
3247
|
+
s(t);
|
|
3248
|
+
}
|
|
3249
|
+
notifyUiStyleDelete(t) {
|
|
3250
|
+
for (const s of this.uiStyleDeleteListeners)
|
|
3251
|
+
s(t);
|
|
3048
3252
|
}
|
|
3049
3253
|
notifyUiStreamCleared(t) {
|
|
3050
|
-
for (const
|
|
3051
|
-
|
|
3254
|
+
for (const s of this.uiStreamClearedListeners)
|
|
3255
|
+
s(t);
|
|
3052
3256
|
}
|
|
3053
|
-
sendUiUpdateAck(t,
|
|
3054
|
-
if (this.client && !(!Number.isFinite(
|
|
3257
|
+
sendUiUpdateAck(t, s) {
|
|
3258
|
+
if (this.client && !(!Number.isFinite(s) || s < 0))
|
|
3055
3259
|
try {
|
|
3056
|
-
const
|
|
3057
|
-
this.client.sendProtocolMessage(
|
|
3058
|
-
} catch (
|
|
3059
|
-
|
|
3260
|
+
const r = Ki({ Version: s }, this.client.sessionId ?? 0, { trackId: t });
|
|
3261
|
+
this.client.sendProtocolMessage(r);
|
|
3262
|
+
} catch (r) {
|
|
3263
|
+
R.warn("Failed to send UI update ack", r);
|
|
3060
3264
|
}
|
|
3061
3265
|
}
|
|
3062
3266
|
}
|
|
3063
3267
|
export {
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3268
|
+
sn as HandlerCache,
|
|
3269
|
+
fn as IkonUICore,
|
|
3270
|
+
nn as UiStore,
|
|
3271
|
+
rn as UiStreamStore,
|
|
3272
|
+
D as UiUpdateParseError,
|
|
3273
|
+
en as parseUiUpdate
|
|
3070
3274
|
};
|