@ikonai/sdk-ui 1.0.41 → 1.0.43
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-DNTNCumg.js +2674 -0
- package/index.d.ts +1 -1
- package/index.js +1623 -1758
- package/package.json +1 -1
- package/ui-store-ops.d.ts +1 -4
- package/ui-store.d.ts +0 -4
- package/ui-types.d.ts +0 -22
- package/assets/ui-worker-RrFBjoKd.js +0 -2832
|
@@ -0,0 +1,2674 @@
|
|
|
1
|
+
const qe = {
|
|
2
|
+
Compressed: 8
|
|
3
|
+
};
|
|
4
|
+
function Ze(e) {
|
|
5
|
+
if (e.length < 8)
|
|
6
|
+
throw new Error("Protocol message too short");
|
|
7
|
+
return (e[4] | e[5] << 8 | e[6] << 16 | e[7] << 24) >>> 0;
|
|
8
|
+
}
|
|
9
|
+
function q(e) {
|
|
10
|
+
const r = K(e), t = new DataView(r.buffer, r.byteOffset, r.byteLength);
|
|
11
|
+
if (r.length < 27)
|
|
12
|
+
throw new Error("Protocol payload too short");
|
|
13
|
+
const s = t.getUint32(0, !0), n = t.getUint32(4, !0), i = t.getUint32(8, !0), o = t.getUint32(12, !0), a = t.getUint32(16, !0), I = t.getUint32(20, !0), E = t.getUint8(24), l = t.getUint8(25), _ = t.getUint8(26);
|
|
14
|
+
if (27 + I * 4 > r.length)
|
|
15
|
+
throw new Error("Protocol header exceeds payload length");
|
|
16
|
+
const R = [];
|
|
17
|
+
let D = 27;
|
|
18
|
+
for (let j = 0; j < I; j++)
|
|
19
|
+
R.push(t.getUint32(D, !0)), D += 4;
|
|
20
|
+
return {
|
|
21
|
+
length: s,
|
|
22
|
+
opcode: n,
|
|
23
|
+
senderId: i,
|
|
24
|
+
trackId: o,
|
|
25
|
+
sequenceId: a,
|
|
26
|
+
targetIds: R,
|
|
27
|
+
payloadVersion: E,
|
|
28
|
+
payloadType: l,
|
|
29
|
+
flags: _
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async function Y(e, r, t) {
|
|
33
|
+
const s = K(e), n = q(s);
|
|
34
|
+
if (r !== void 0 && n.opcode !== r)
|
|
35
|
+
throw new Error(`Unexpected opcode ${n.opcode}`);
|
|
36
|
+
if (n.payloadType !== 8)
|
|
37
|
+
throw new Error(`Unexpected payload type ${n.payloadType}`);
|
|
38
|
+
const i = 27 + n.targetIds.length * 4;
|
|
39
|
+
let o = s.subarray(i, n.length);
|
|
40
|
+
return (n.flags & qe.Compressed) !== 0 && (o = await et(o)), o;
|
|
41
|
+
}
|
|
42
|
+
async function et(e) {
|
|
43
|
+
if (typeof DecompressionStream > "u")
|
|
44
|
+
throw new Error("DecompressionStream not supported");
|
|
45
|
+
const r = new DecompressionStream("gzip"), t = r.writable.getWriter(), s = new Uint8Array(e);
|
|
46
|
+
t.write(s), t.close();
|
|
47
|
+
const n = r.readable.getReader(), i = [];
|
|
48
|
+
let o = 0;
|
|
49
|
+
for (; ; ) {
|
|
50
|
+
const { done: E, value: l } = await n.read();
|
|
51
|
+
if (E) break;
|
|
52
|
+
i.push(l), o += l.length;
|
|
53
|
+
}
|
|
54
|
+
const a = new Uint8Array(o);
|
|
55
|
+
let I = 0;
|
|
56
|
+
for (let E = 0; E < i.length; E++)
|
|
57
|
+
a.set(i[E], I), I += i[E].length;
|
|
58
|
+
return a;
|
|
59
|
+
}
|
|
60
|
+
var F = /* @__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))(F || {});
|
|
61
|
+
const tt = 161, rt = 162;
|
|
62
|
+
new TextEncoder();
|
|
63
|
+
const st = new TextDecoder("utf-8", { fatal: !0 });
|
|
64
|
+
class m {
|
|
65
|
+
constructor(r, t, s) {
|
|
66
|
+
this.buffer = r, this.version = t, this.offset = s, this.end = r.length - 1;
|
|
67
|
+
}
|
|
68
|
+
offset;
|
|
69
|
+
end;
|
|
70
|
+
static create(r) {
|
|
71
|
+
const t = K(r);
|
|
72
|
+
if (t.length < 2)
|
|
73
|
+
throw new Error("Teleport payload too short");
|
|
74
|
+
if (t[0] !== tt || t[t.length - 1] !== rt)
|
|
75
|
+
throw new Error("Teleport object missing markers");
|
|
76
|
+
const s = { offset: 1 }, n = S(t, s, "InvalidLength");
|
|
77
|
+
return new m(t, n, s.offset);
|
|
78
|
+
}
|
|
79
|
+
next() {
|
|
80
|
+
if (this.offset >= this.end)
|
|
81
|
+
return null;
|
|
82
|
+
if (this.offset + 5 > this.buffer.length)
|
|
83
|
+
throw new Error("Teleport object truncated");
|
|
84
|
+
const r = at(this.buffer, this.offset);
|
|
85
|
+
this.offset += 4;
|
|
86
|
+
const t = this.buffer[this.offset++], s = t >> 4 & 15;
|
|
87
|
+
if ((t & 15) !== 0)
|
|
88
|
+
throw new Error("Teleport field flags must be zero");
|
|
89
|
+
const n = b(s);
|
|
90
|
+
let i;
|
|
91
|
+
if (n >= 0)
|
|
92
|
+
N(this.buffer, this.offset, n), i = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
|
|
93
|
+
else {
|
|
94
|
+
const o = { offset: this.offset }, a = S(this.buffer, o, "InvalidLength");
|
|
95
|
+
N(this.buffer, o.offset, a), i = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
|
|
96
|
+
}
|
|
97
|
+
return new nt(r, s, i);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
class y {
|
|
101
|
+
constructor(r, t) {
|
|
102
|
+
this.type = r, this.payload = t;
|
|
103
|
+
}
|
|
104
|
+
asInt32() {
|
|
105
|
+
return this.ensureType(
|
|
106
|
+
3
|
|
107
|
+
/* Int32 */
|
|
108
|
+
), new DataView(this.payload.buffer, this.payload.byteOffset, 4).getInt32(0, !0);
|
|
109
|
+
}
|
|
110
|
+
asUInt32() {
|
|
111
|
+
return this.ensureType(
|
|
112
|
+
5
|
|
113
|
+
/* UInt32 */
|
|
114
|
+
), new DataView(this.payload.buffer, this.payload.byteOffset, 4).getUint32(0, !0);
|
|
115
|
+
}
|
|
116
|
+
asInt64() {
|
|
117
|
+
return this.ensureType(
|
|
118
|
+
4
|
|
119
|
+
/* Int64 */
|
|
120
|
+
), new DataView(this.payload.buffer, this.payload.byteOffset, 8).getBigInt64(0, !0);
|
|
121
|
+
}
|
|
122
|
+
asUInt64() {
|
|
123
|
+
return this.ensureType(
|
|
124
|
+
6
|
|
125
|
+
/* UInt64 */
|
|
126
|
+
), new DataView(this.payload.buffer, this.payload.byteOffset, 8).getBigUint64(0, !0);
|
|
127
|
+
}
|
|
128
|
+
asFloat32() {
|
|
129
|
+
return this.ensureType(
|
|
130
|
+
7
|
|
131
|
+
/* Float32 */
|
|
132
|
+
), new DataView(this.payload.buffer, this.payload.byteOffset, 4).getFloat32(0, !0);
|
|
133
|
+
}
|
|
134
|
+
asFloat64() {
|
|
135
|
+
return this.ensureType(
|
|
136
|
+
8
|
|
137
|
+
/* Float64 */
|
|
138
|
+
), new DataView(this.payload.buffer, this.payload.byteOffset, 8).getFloat64(0, !0);
|
|
139
|
+
}
|
|
140
|
+
asBool() {
|
|
141
|
+
return this.ensureType(
|
|
142
|
+
2
|
|
143
|
+
/* Bool */
|
|
144
|
+
), this.payload.length > 0 && this.payload[0] !== 0;
|
|
145
|
+
}
|
|
146
|
+
asBinary() {
|
|
147
|
+
return this.ensureType(
|
|
148
|
+
13
|
|
149
|
+
/* Binary */
|
|
150
|
+
), this.payload;
|
|
151
|
+
}
|
|
152
|
+
asUtf8() {
|
|
153
|
+
return this.ensureType(
|
|
154
|
+
12
|
|
155
|
+
/* String */
|
|
156
|
+
), this.payload;
|
|
157
|
+
}
|
|
158
|
+
asString() {
|
|
159
|
+
return this.ensureType(
|
|
160
|
+
12
|
|
161
|
+
/* String */
|
|
162
|
+
), st.decode(this.payload);
|
|
163
|
+
}
|
|
164
|
+
asGuid() {
|
|
165
|
+
return this.ensureType(
|
|
166
|
+
14
|
|
167
|
+
/* Guid */
|
|
168
|
+
), h.fromBytes(this.payload);
|
|
169
|
+
}
|
|
170
|
+
asObject() {
|
|
171
|
+
return this.ensureType(
|
|
172
|
+
11
|
|
173
|
+
/* Object */
|
|
174
|
+
), m.create(this.payload);
|
|
175
|
+
}
|
|
176
|
+
asArray() {
|
|
177
|
+
return this.ensureType(
|
|
178
|
+
9
|
|
179
|
+
/* Array */
|
|
180
|
+
), Z.create(this.payload);
|
|
181
|
+
}
|
|
182
|
+
asDictionary() {
|
|
183
|
+
return this.ensureType(
|
|
184
|
+
10
|
|
185
|
+
/* Dict */
|
|
186
|
+
), ee.create(this.payload);
|
|
187
|
+
}
|
|
188
|
+
ensureType(r) {
|
|
189
|
+
if (this.type !== r)
|
|
190
|
+
throw new Error(`Teleport value has type ${F[this.type]}, expected ${F[r]}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
class nt extends y {
|
|
194
|
+
constructor(r, t, s) {
|
|
195
|
+
super(t, s), this.fieldId = r;
|
|
196
|
+
}
|
|
197
|
+
get isNull() {
|
|
198
|
+
return this.type === 1;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
class Z {
|
|
202
|
+
payload;
|
|
203
|
+
elementType;
|
|
204
|
+
count;
|
|
205
|
+
offset;
|
|
206
|
+
index = 0;
|
|
207
|
+
constructor(r) {
|
|
208
|
+
if (this.payload = r, r.length === 0)
|
|
209
|
+
throw new Error("Array payload too short");
|
|
210
|
+
const t = r[0];
|
|
211
|
+
if (this.elementType = t >> 4 & 15, (t & 15) !== 0)
|
|
212
|
+
throw new Error("Array flags must be zero");
|
|
213
|
+
const s = { offset: 1 };
|
|
214
|
+
this.count = S(r, s, "ArrayMalformed"), this.offset = s.offset;
|
|
215
|
+
}
|
|
216
|
+
static create(r) {
|
|
217
|
+
return new Z(K(r));
|
|
218
|
+
}
|
|
219
|
+
next() {
|
|
220
|
+
if (this.index >= this.count) {
|
|
221
|
+
if (this.offset !== this.payload.length)
|
|
222
|
+
throw new Error("Array payload contains trailing data");
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
const r = this.readValue();
|
|
226
|
+
return this.index++, r;
|
|
227
|
+
}
|
|
228
|
+
readValue() {
|
|
229
|
+
switch (this.elementType) {
|
|
230
|
+
case 3:
|
|
231
|
+
case 5:
|
|
232
|
+
case 7:
|
|
233
|
+
case 8:
|
|
234
|
+
case 2:
|
|
235
|
+
case 4:
|
|
236
|
+
case 6:
|
|
237
|
+
case 14: {
|
|
238
|
+
const r = b(this.elementType);
|
|
239
|
+
N(this.payload, this.offset, r);
|
|
240
|
+
const t = this.payload.subarray(this.offset, this.offset + r);
|
|
241
|
+
return this.offset += r, new k(this.elementType, t);
|
|
242
|
+
}
|
|
243
|
+
case 12:
|
|
244
|
+
case 13: {
|
|
245
|
+
const r = { offset: this.offset }, t = S(this.payload, r, "ArrayMalformed");
|
|
246
|
+
N(this.payload, r.offset, t);
|
|
247
|
+
const s = this.payload.subarray(r.offset, r.offset + t);
|
|
248
|
+
return this.offset = r.offset + t, new k(this.elementType, s);
|
|
249
|
+
}
|
|
250
|
+
case 11: {
|
|
251
|
+
const r = { offset: this.offset }, t = S(this.payload, r, "ArrayMalformed");
|
|
252
|
+
N(this.payload, r.offset, t);
|
|
253
|
+
const s = this.payload.subarray(r.offset, r.offset + t);
|
|
254
|
+
return this.offset = r.offset + t, new k(11, s);
|
|
255
|
+
}
|
|
256
|
+
case 9: {
|
|
257
|
+
const r = te(this.payload, this.offset), t = this.payload.subarray(this.offset, this.offset + r);
|
|
258
|
+
return this.offset += r, new k(9, t);
|
|
259
|
+
}
|
|
260
|
+
case 10: {
|
|
261
|
+
const r = re(this.payload, this.offset), t = this.payload.subarray(this.offset, this.offset + r);
|
|
262
|
+
return this.offset += r, new k(10, t);
|
|
263
|
+
}
|
|
264
|
+
default:
|
|
265
|
+
throw new Error(`Unsupported array element type ${F[this.elementType]}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
class k extends y {
|
|
270
|
+
constructor(r, t) {
|
|
271
|
+
super(r, t);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
class ee {
|
|
275
|
+
payload;
|
|
276
|
+
keyType;
|
|
277
|
+
valueType;
|
|
278
|
+
count;
|
|
279
|
+
offset;
|
|
280
|
+
index = 0;
|
|
281
|
+
constructor(r) {
|
|
282
|
+
if (this.payload = r, r.length < 2)
|
|
283
|
+
throw new Error("Dictionary payload too short");
|
|
284
|
+
if (this.keyType = r[0] >> 4 & 15, this.valueType = r[1] >> 4 & 15, (r[0] & 15) !== 0 || (r[1] & 15) !== 0)
|
|
285
|
+
throw new Error("Dictionary key/value flags must be zero");
|
|
286
|
+
ae(this.keyType);
|
|
287
|
+
const t = { offset: 2 };
|
|
288
|
+
this.count = S(r, t, "DictMalformed"), this.offset = t.offset;
|
|
289
|
+
}
|
|
290
|
+
static create(r) {
|
|
291
|
+
return new ee(K(r));
|
|
292
|
+
}
|
|
293
|
+
next() {
|
|
294
|
+
if (this.index >= this.count) {
|
|
295
|
+
if (this.offset !== this.payload.length)
|
|
296
|
+
throw new Error("Dictionary payload contains trailing data");
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
const r = this.readKey(), t = this.readValue();
|
|
300
|
+
return this.index++, new it(r, t);
|
|
301
|
+
}
|
|
302
|
+
readKey() {
|
|
303
|
+
const r = b(this.keyType);
|
|
304
|
+
if (r >= 0) {
|
|
305
|
+
N(this.payload, this.offset, r);
|
|
306
|
+
const t = this.payload.subarray(this.offset, this.offset + r);
|
|
307
|
+
return this.offset += r, new y(this.keyType, t);
|
|
308
|
+
}
|
|
309
|
+
if (this.keyType === 12 || this.keyType === 13) {
|
|
310
|
+
const t = { offset: this.offset }, s = S(this.payload, t, "DictMalformed");
|
|
311
|
+
N(this.payload, t.offset, s);
|
|
312
|
+
const n = this.payload.subarray(t.offset, t.offset + s);
|
|
313
|
+
return this.offset = t.offset + s, new y(this.keyType, n);
|
|
314
|
+
}
|
|
315
|
+
throw new Error("Unsupported dictionary key type");
|
|
316
|
+
}
|
|
317
|
+
readValue() {
|
|
318
|
+
switch (this.valueType) {
|
|
319
|
+
case 12:
|
|
320
|
+
case 13: {
|
|
321
|
+
const r = { offset: this.offset }, t = S(this.payload, r, "DictMalformed");
|
|
322
|
+
N(this.payload, r.offset, t);
|
|
323
|
+
const s = this.payload.subarray(r.offset, r.offset + t);
|
|
324
|
+
return this.offset = r.offset + t, new y(this.valueType, s);
|
|
325
|
+
}
|
|
326
|
+
case 11: {
|
|
327
|
+
const r = { offset: this.offset }, t = S(this.payload, r, "DictMalformed");
|
|
328
|
+
N(this.payload, r.offset, t);
|
|
329
|
+
const s = this.payload.subarray(r.offset, r.offset + t);
|
|
330
|
+
return this.offset = r.offset + t, new y(11, s);
|
|
331
|
+
}
|
|
332
|
+
case 9: {
|
|
333
|
+
const r = te(this.payload, this.offset), t = this.payload.subarray(this.offset, this.offset + r);
|
|
334
|
+
return this.offset += r, new y(9, t);
|
|
335
|
+
}
|
|
336
|
+
case 10: {
|
|
337
|
+
const r = re(this.payload, this.offset), t = this.payload.subarray(this.offset, this.offset + r);
|
|
338
|
+
return this.offset += r, new y(10, t);
|
|
339
|
+
}
|
|
340
|
+
case 3:
|
|
341
|
+
case 5:
|
|
342
|
+
case 7:
|
|
343
|
+
case 8:
|
|
344
|
+
case 2:
|
|
345
|
+
case 4:
|
|
346
|
+
case 6:
|
|
347
|
+
case 14:
|
|
348
|
+
case 1: {
|
|
349
|
+
const r = b(this.valueType);
|
|
350
|
+
N(this.payload, this.offset, r);
|
|
351
|
+
const t = this.payload.subarray(this.offset, this.offset + r);
|
|
352
|
+
return this.offset += r, new y(this.valueType, t);
|
|
353
|
+
}
|
|
354
|
+
default:
|
|
355
|
+
throw new Error(`Unsupported dictionary value type ${F[this.valueType]}`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
class it {
|
|
360
|
+
constructor(r, t) {
|
|
361
|
+
this.key = r, this.value = t;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
class h {
|
|
365
|
+
constructor(r) {
|
|
366
|
+
this.bytes = r;
|
|
367
|
+
}
|
|
368
|
+
static fromString(r) {
|
|
369
|
+
if (!r)
|
|
370
|
+
throw new Error("Guid string is empty");
|
|
371
|
+
const t = r.replace(/-/g, "");
|
|
372
|
+
if (t.length !== 32)
|
|
373
|
+
throw new Error("Guid string must be 32 hex characters");
|
|
374
|
+
const s = new Uint8Array(16), n = h.parseHexSlice(t, 0, 8), i = h.parseHexSlice(t, 8, 4), o = h.parseHexSlice(t, 12, 4);
|
|
375
|
+
h.writeUInt32LE(s, 0, n), h.writeUInt16LE(s, 4, i), h.writeUInt16LE(s, 6, o);
|
|
376
|
+
for (let a = 0; a < 8; a++)
|
|
377
|
+
s[8 + a] = h.parseHexSlice(t, 16 + a * 2, 2);
|
|
378
|
+
return new h(s);
|
|
379
|
+
}
|
|
380
|
+
static fromBytes(r) {
|
|
381
|
+
if (r.length !== 16)
|
|
382
|
+
throw new Error("Guid byte array must be 16 bytes");
|
|
383
|
+
return new h(Uint8Array.from(r));
|
|
384
|
+
}
|
|
385
|
+
static createZero() {
|
|
386
|
+
return new h(new Uint8Array(16));
|
|
387
|
+
}
|
|
388
|
+
static createRandom() {
|
|
389
|
+
const r = new Uint8Array(16), t = globalThis.crypto;
|
|
390
|
+
if (t?.getRandomValues)
|
|
391
|
+
t.getRandomValues(r);
|
|
392
|
+
else
|
|
393
|
+
for (let s = 0; s < r.length; s++)
|
|
394
|
+
r[s] = Math.floor(Math.random() * 256);
|
|
395
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, new h(r);
|
|
396
|
+
}
|
|
397
|
+
toString() {
|
|
398
|
+
const r = this.bytes;
|
|
399
|
+
return [
|
|
400
|
+
h.toHex(h.readUInt32LE(r, 0), 8),
|
|
401
|
+
h.toHex(h.readUInt16LE(r, 4), 4),
|
|
402
|
+
h.toHex(h.readUInt16LE(r, 6), 4),
|
|
403
|
+
ne(r.subarray(8, 10)),
|
|
404
|
+
ne(r.subarray(10, 16))
|
|
405
|
+
].join("-");
|
|
406
|
+
}
|
|
407
|
+
asBytes() {
|
|
408
|
+
return this.bytes.slice();
|
|
409
|
+
}
|
|
410
|
+
static parseHexSlice(r, t, s) {
|
|
411
|
+
const n = r.substr(t, s), i = Number.parseInt(n, 16);
|
|
412
|
+
if (Number.isNaN(i))
|
|
413
|
+
throw new Error("Guid string contains invalid characters");
|
|
414
|
+
return i >>> 0;
|
|
415
|
+
}
|
|
416
|
+
static writeUInt32LE(r, t, s) {
|
|
417
|
+
const n = s >>> 0;
|
|
418
|
+
r[t] = n & 255, r[t + 1] = n >>> 8 & 255, r[t + 2] = n >>> 16 & 255, r[t + 3] = n >>> 24 & 255;
|
|
419
|
+
}
|
|
420
|
+
static writeUInt16LE(r, t, s) {
|
|
421
|
+
const n = s & 65535;
|
|
422
|
+
r[t] = n & 255, r[t + 1] = n >>> 8 & 255;
|
|
423
|
+
}
|
|
424
|
+
static readUInt32LE(r, t) {
|
|
425
|
+
return (r[t] | r[t + 1] << 8 | r[t + 2] << 16 | r[t + 3] << 24) >>> 0;
|
|
426
|
+
}
|
|
427
|
+
static readUInt16LE(r, t) {
|
|
428
|
+
return (r[t] | r[t + 1] << 8) & 65535;
|
|
429
|
+
}
|
|
430
|
+
static toHex(r, t) {
|
|
431
|
+
return (r >>> 0).toString(16).padStart(t, "0");
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function S(e, r, t) {
|
|
435
|
+
if (r.offset >= e.length)
|
|
436
|
+
throw new Error(t);
|
|
437
|
+
let s = 0, n = 0, i = 0;
|
|
438
|
+
for (; r.offset < e.length; ) {
|
|
439
|
+
const o = e[r.offset++];
|
|
440
|
+
if (i++, s |= (o & 127) << n, (o & 128) === 0) {
|
|
441
|
+
if (i !== ot(s))
|
|
442
|
+
throw new Error("Teleport VarUInt is not canonical");
|
|
443
|
+
return s >>> 0;
|
|
444
|
+
}
|
|
445
|
+
if (n += 7, n >= 35)
|
|
446
|
+
throw new Error("Teleport VarUInt exceeds 32-bit range");
|
|
447
|
+
}
|
|
448
|
+
throw new Error(t);
|
|
449
|
+
}
|
|
450
|
+
function ot(e) {
|
|
451
|
+
return e < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5;
|
|
452
|
+
}
|
|
453
|
+
function b(e) {
|
|
454
|
+
switch (e) {
|
|
455
|
+
case 3:
|
|
456
|
+
case 5:
|
|
457
|
+
case 7:
|
|
458
|
+
return 4;
|
|
459
|
+
case 4:
|
|
460
|
+
case 6:
|
|
461
|
+
case 8:
|
|
462
|
+
return 8;
|
|
463
|
+
case 14:
|
|
464
|
+
return 16;
|
|
465
|
+
case 2:
|
|
466
|
+
return 1;
|
|
467
|
+
case 1:
|
|
468
|
+
return 0;
|
|
469
|
+
default:
|
|
470
|
+
return -1;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
function ae(e) {
|
|
474
|
+
if (e === 9 || e === 11 || e === 10 || e === 1)
|
|
475
|
+
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
476
|
+
}
|
|
477
|
+
function N(e, r, t) {
|
|
478
|
+
if (r < 0 || t < 0 || r + t > e.length)
|
|
479
|
+
throw new Error("Teleport payload exceeds bounds");
|
|
480
|
+
}
|
|
481
|
+
function at(e, r) {
|
|
482
|
+
return (e[r] | e[r + 1] << 8 | e[r + 2] << 16 | e[r + 3] << 24) >>> 0;
|
|
483
|
+
}
|
|
484
|
+
function te(e, r) {
|
|
485
|
+
if (r >= e.length)
|
|
486
|
+
throw new Error("Array payload exceeds bounds");
|
|
487
|
+
const t = e[r], s = t >> 4 & 15;
|
|
488
|
+
if ((t & 15) !== 0)
|
|
489
|
+
throw new Error("Array flags must be zero");
|
|
490
|
+
const n = { offset: r + 1 }, i = S(e, n, "ArrayMalformed"), o = b(s);
|
|
491
|
+
if (o >= 0) {
|
|
492
|
+
const I = o * i;
|
|
493
|
+
return N(e, n.offset, I), n.offset + I - r;
|
|
494
|
+
}
|
|
495
|
+
let a = n.offset;
|
|
496
|
+
for (let I = 0; I < i; I++)
|
|
497
|
+
a = J(s, e, a, "ArrayMalformed");
|
|
498
|
+
return a - r;
|
|
499
|
+
}
|
|
500
|
+
function re(e, r) {
|
|
501
|
+
if (r + 2 > e.length)
|
|
502
|
+
throw new Error("Dictionary payload too short");
|
|
503
|
+
const t = e[r] >> 4 & 15, s = e[r + 1] >> 4 & 15;
|
|
504
|
+
if ((e[r] & 15) !== 0 || (e[r + 1] & 15) !== 0)
|
|
505
|
+
throw new Error("Dictionary key/value flags must be zero");
|
|
506
|
+
ae(t);
|
|
507
|
+
const n = { offset: r + 2 }, i = S(e, n, "DictMalformed");
|
|
508
|
+
let o = n.offset;
|
|
509
|
+
for (let a = 0; a < i; a++)
|
|
510
|
+
o = J(t, e, o, "DictMalformed"), o = J(s, e, o, "DictMalformed");
|
|
511
|
+
return o - r;
|
|
512
|
+
}
|
|
513
|
+
function J(e, r, t, s) {
|
|
514
|
+
const n = b(e);
|
|
515
|
+
if (n >= 0)
|
|
516
|
+
return N(r, t, n), t + n;
|
|
517
|
+
switch (e) {
|
|
518
|
+
case 12:
|
|
519
|
+
case 13: {
|
|
520
|
+
const i = { offset: t }, o = S(r, i, s);
|
|
521
|
+
return N(r, i.offset, o), i.offset + o;
|
|
522
|
+
}
|
|
523
|
+
case 11: {
|
|
524
|
+
const i = { offset: t }, o = S(r, i, s);
|
|
525
|
+
return N(r, i.offset, o), i.offset + o;
|
|
526
|
+
}
|
|
527
|
+
case 9:
|
|
528
|
+
return t + te(r, t);
|
|
529
|
+
case 10:
|
|
530
|
+
return t + re(r, t);
|
|
531
|
+
default:
|
|
532
|
+
throw new Error(`Unsupported Teleport type ${F[e]}`);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function ne(e) {
|
|
536
|
+
return Array.from(e).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
537
|
+
}
|
|
538
|
+
function K(e) {
|
|
539
|
+
return e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
540
|
+
}
|
|
541
|
+
var le = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Opus = 1] = "Opus", e[e.Mp3 = 2] = "Mp3", e[e.RawPcm16 = 3] = "RawPcm16", e))(le || {}), Ie = /* @__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))(Ie || {}), Ee = /* @__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))(Ee || {}), _e = /* @__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))(_e || {}), ce = /* @__PURE__ */ ((e) => (e[e.Face = 0] = "Face", e[e.Hands = 1] = "Hands", e[e.Pose = 2] = "Pose", e[e.All = 3] = "All", e))(ce || {}), fe = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Machine = 1] = "Machine", e[e.Human = 2] = "Human", e))(fe || {}), ue = /* @__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))(ue || {}), he = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.DotNet = 1] = "DotNet", e[e.TypeScript = 2] = "TypeScript", e[e.Cpp = 3] = "Cpp", e))(he || {}), Te = /* @__PURE__ */ ((e) => (e[e.Local = 0] = "Local", e[e.Cloud = 1] = "Cloud", e))(Te || {}), Ae = /* @__PURE__ */ ((e) => (e[e.Bundle = 0] = "Bundle", e[e.GitSource = 1] = "GitSource", e))(Ae || {}), O = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", e[e.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", e[e.GROUP_CORE = 65536] = "GROUP_CORE", e[e.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", e[e.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", e[e.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", e[e.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", e[e.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", e[e.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", e[e.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", e[e.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", e[e.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", e[e.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", e[e.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", e[e.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", e[e.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", e[e.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", e[e.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", e[e.CORE_SERVER_START = 65552] = "CORE_SERVER_START", e[e.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", e[e.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", e[e.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", e[e.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", e[e.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", e[e.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", e[e.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", e[e.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", e[e.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", e[e.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", e[e.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", e[e.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", e[e.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", e[e.CORE_RELAY_AGENT_HELLO = 65576] = "CORE_RELAY_AGENT_HELLO", e[e.CORE_RELAY_HELLO = 65577] = "CORE_RELAY_HELLO", e[e.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", e[e.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", e[e.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", e[e.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", e[e.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", e[e.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", e[e.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", e[e.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", e[e.GROUP_EVENTS = 262144] = "GROUP_EVENTS", e[e.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", e[e.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", e[e.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", e[e.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", e[e.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", e[e.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", e[e.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", e[e.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", e[e.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", e[e.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", e[e.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", e[e.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", e[e.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", e[e.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", e[e.ACTION_CALL = 1048577] = "ACTION_CALL", e[e.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", e[e.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", e[e.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", e[e.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", e[e.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", e[e.ACTION_TAP = 1048583] = "ACTION_TAP", e[e.ACTION_PAN = 1048584] = "ACTION_PAN", e[e.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", e[e.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", e[e.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", e[e.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", e[e.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", e[e.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", e[e.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", e[e.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", e[e.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", e[e.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", e[e.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", e[e.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", e[e.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", e[e.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", e[e.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", e[e.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", e[e.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", e[e.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", e[e.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", e[e.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", e[e.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", e[e.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", e[e.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", e[e.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", e[e.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", e[e.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", e[e.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", e[e.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", e[e.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", e[e.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", e[e.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", e[e.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", e[e.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", e[e.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", e[e.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", e[e.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", e[e.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", e[e.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", e[e.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", e[e.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", e[e.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", e[e.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", e[e.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", e[e.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", e[e.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", e[e.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", e[e.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", e[e.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", e[e.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", e[e.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", e[e.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", e[e.ACTION_CALL2 = 1048637] = "ACTION_CALL2", e[e.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", e[e.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", e[e.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", e[e.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", e[e.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", e[e.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", e[e.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", e[e.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", e[e.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", e[e.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", e[e.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", e[e.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", e[e.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", e[e.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", e[e.GROUP_UI = 2097152] = "GROUP_UI", e[e.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", e[e.UI_STREAM_END = 2097154] = "UI_STREAM_END", e[e.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", e[e.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", e[e.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", e[e.UI_SECTION_END = 2097158] = "UI_SECTION_END", e[e.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", e[e.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", e[e.UI_LIST_END = 2097161] = "UI_LIST_END", e[e.UI_TEXT = 2097162] = "UI_TEXT", e[e.UI_HEADER = 2097163] = "UI_HEADER", e[e.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", e[e.UI_BUTTON = 2097165] = "UI_BUTTON", e[e.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", e[e.UI_IMAGE = 2097167] = "UI_IMAGE", e[e.UI_FILE = 2097168] = "UI_FILE", e[e.UI_BADGE = 2097169] = "UI_BADGE", e[e.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", e[e.UI_MAP = 2097171] = "UI_MAP", e[e.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", e[e.UI_ICON = 2097173] = "UI_ICON", e[e.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", e[e.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", e[e.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", e[e.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", e[e.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", e[e.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", e[e.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", e[e.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", e[e.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", e[e.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", e[e.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", e[e.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", e[e.UI_QS = 2097186] = "UI_QS", e[e.UI_ELEMENT = 2097187] = "UI_ELEMENT", e[e.UI_STYLES = 2097188] = "UI_STYLES", e[e.UI_SVG = 2097189] = "UI_SVG", e[e.UI_UPDATE = 2097190] = "UI_UPDATE", e[e.UI_INIT = 2097191] = "UI_INIT", e[e.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", e[e.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", e[e.GROUP_COMMON = 4128768] = "GROUP_COMMON", e[e.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", e[e.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", e[e.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", e[e.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", e[e.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", e[e.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", e[e.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", e[e.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", e[e.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", e[e.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", e[e.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", e[e.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", e[e.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", e[e.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", e[e.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", e[e.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", e[e.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", e[e.GROUP_SCENE = 33554432] = "GROUP_SCENE", e[e.SCENE_MESH = 33554433] = "SCENE_MESH", e[e.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", e[e.GROUP_ALL = 67043328] = "GROUP_ALL", e[e.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", e))(O || {});
|
|
542
|
+
const lt = 161083277, It = 265814330, Et = 1368629611, _t = 2431514951, ct = 2745379226, ft = 3282782683, ut = 3284746250, ht = 4101844078;
|
|
543
|
+
function Ne(e) {
|
|
544
|
+
const r = {};
|
|
545
|
+
return Se(r), r;
|
|
546
|
+
}
|
|
547
|
+
function Se(e) {
|
|
548
|
+
return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = le.Unknown, e.CodecDetails = "", e.SampleRate = 0, e.Channels = 0, e.ShapeSets = void 0, e;
|
|
549
|
+
}
|
|
550
|
+
function Tt(e, r) {
|
|
551
|
+
const t = r ?? Ne();
|
|
552
|
+
return Se(t), At(e, t), t;
|
|
553
|
+
}
|
|
554
|
+
function At(e, r) {
|
|
555
|
+
let t;
|
|
556
|
+
for (; (t = e.next()) !== null; )
|
|
557
|
+
switch (t.fieldId) {
|
|
558
|
+
case lt: {
|
|
559
|
+
if (t.isNull) throw new Error();
|
|
560
|
+
r.StreamId = t.asString();
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
case It: {
|
|
564
|
+
if (t.isNull) {
|
|
565
|
+
r.ShapeSets = void 0;
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
r.ShapeSets = Nt(t.asArray());
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
case Et: {
|
|
572
|
+
if (t.isNull) throw new Error();
|
|
573
|
+
r.Description = t.asString();
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
case _t: {
|
|
577
|
+
if (t.isNull) throw new Error();
|
|
578
|
+
r.Channels = t.asInt32();
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
581
|
+
case ct: {
|
|
582
|
+
if (t.isNull) throw new Error();
|
|
583
|
+
r.CodecDetails = t.asString();
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
case ft: {
|
|
587
|
+
if (t.isNull) throw new Error();
|
|
588
|
+
r.SourceType = t.asString();
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
case ut: {
|
|
592
|
+
if (t.isNull) throw new Error();
|
|
593
|
+
r.Codec = t.asInt32();
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
case ht: {
|
|
597
|
+
if (t.isNull) throw new Error();
|
|
598
|
+
r.SampleRate = t.asInt32();
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function Nt(e) {
|
|
604
|
+
const r = [];
|
|
605
|
+
let t;
|
|
606
|
+
for (; (t = e.next()) !== null; )
|
|
607
|
+
r.push(wt(t.asObject()));
|
|
608
|
+
return r;
|
|
609
|
+
}
|
|
610
|
+
const St = 1107713536, Ct = 1154362099, dt = 1185721362;
|
|
611
|
+
function Dt(e) {
|
|
612
|
+
const r = {};
|
|
613
|
+
return Ce(r), r;
|
|
614
|
+
}
|
|
615
|
+
function Ce(e) {
|
|
616
|
+
return e.SetId = 0, e.Name = "", e.ShapeNames = [], e;
|
|
617
|
+
}
|
|
618
|
+
function wt(e, r) {
|
|
619
|
+
const t = r ?? Dt();
|
|
620
|
+
return Ce(t), Rt(e, t), t;
|
|
621
|
+
}
|
|
622
|
+
function Rt(e, r) {
|
|
623
|
+
let t;
|
|
624
|
+
for (; (t = e.next()) !== null; )
|
|
625
|
+
switch (t.fieldId) {
|
|
626
|
+
case St: {
|
|
627
|
+
if (t.isNull) throw new Error();
|
|
628
|
+
r.Name = t.asString();
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
case Ct: {
|
|
632
|
+
if (t.isNull) throw new Error();
|
|
633
|
+
r.SetId = t.asUInt32();
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
case dt: {
|
|
637
|
+
if (t.isNull) throw new Error();
|
|
638
|
+
r.ShapeNames = yt(t.asArray());
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function yt(e) {
|
|
644
|
+
const r = [];
|
|
645
|
+
let t;
|
|
646
|
+
for (; (t = e.next()) !== null; )
|
|
647
|
+
r.push(t.asString());
|
|
648
|
+
return r;
|
|
649
|
+
}
|
|
650
|
+
const Ut = 76337612, Lt = 185396121, mt = 250031587, Ot = 388632637, gt = 417197284, Pt = 469070965, Ft = 470595159, bt = 594855258, Mt = 781727218, vt = 834078886, kt = 1043273762, Gt = 1236999138, Bt = 1286979607, Vt = 1368629611, xt = 1715899485, pt = 1942830531, Ht = 1999510636, Yt = 2033288346, Kt = 2079864626, $t = 2142346422, Xt = 2232517119, jt = 2598291686, Wt = 2719718823, zt = 2810953526, Jt = 2840065720, Qt = 2885165957, qt = 3542818975, Zt = 3586157513, er = 3717933110, tr = 4062655306;
|
|
651
|
+
function rr(e) {
|
|
652
|
+
const r = {};
|
|
653
|
+
return de(r), r;
|
|
654
|
+
}
|
|
655
|
+
function de(e) {
|
|
656
|
+
return e.ContextType = Ee.Unknown, e.UserType = fe.Unknown, e.PayloadType = _e.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 = Ie.Unknown, e.UniqueSessionId = "", e.Parameters = /* @__PURE__ */ Object.create(null), e.SdkType = he.Unknown, e.ViewportWidth = 0, e.ViewportHeight = 0, e.Theme = "", e.Timezone = "", e.IsTouchDevice = !1, e.InitialPath = "", e;
|
|
657
|
+
}
|
|
658
|
+
function sr(e, r) {
|
|
659
|
+
const t = r ?? rr();
|
|
660
|
+
return de(t), nr(e, t), t;
|
|
661
|
+
}
|
|
662
|
+
function nr(e, r) {
|
|
663
|
+
let t;
|
|
664
|
+
for (; (t = e.next()) !== null; )
|
|
665
|
+
switch (t.fieldId) {
|
|
666
|
+
case Ut: {
|
|
667
|
+
if (t.isNull) throw new Error();
|
|
668
|
+
r.DeviceId = t.asString();
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
case Lt: {
|
|
672
|
+
if (t.isNull) throw new Error();
|
|
673
|
+
r.InstallId = t.asString();
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
case mt: {
|
|
677
|
+
if (t.isNull) throw new Error();
|
|
678
|
+
r.Theme = t.asString();
|
|
679
|
+
break;
|
|
680
|
+
}
|
|
681
|
+
case Ot: {
|
|
682
|
+
if (t.isNull) throw new Error();
|
|
683
|
+
r.UserAgent = t.asString();
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
case gt: {
|
|
687
|
+
if (t.isNull) throw new Error();
|
|
688
|
+
r.ContextType = t.asInt32();
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
691
|
+
case Pt: {
|
|
692
|
+
if (t.isNull) throw new Error();
|
|
693
|
+
r.HasInput = t.asBool();
|
|
694
|
+
break;
|
|
695
|
+
}
|
|
696
|
+
case Ft: {
|
|
697
|
+
if (t.isNull) throw new Error();
|
|
698
|
+
r.UserType = t.asInt32();
|
|
699
|
+
break;
|
|
700
|
+
}
|
|
701
|
+
case bt: {
|
|
702
|
+
if (t.isNull) throw new Error();
|
|
703
|
+
r.InitialPath = t.asString();
|
|
704
|
+
break;
|
|
705
|
+
}
|
|
706
|
+
case Mt: {
|
|
707
|
+
if (t.isNull) throw new Error();
|
|
708
|
+
r.UserId = t.asString();
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
case vt: {
|
|
712
|
+
if (t.isNull) throw new Error();
|
|
713
|
+
r.ProductId = t.asString();
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
716
|
+
case kt: {
|
|
717
|
+
if (t.isNull) throw new Error();
|
|
718
|
+
r.AuthSessionId = t.asString();
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
721
|
+
case Gt: {
|
|
722
|
+
if (t.isNull) throw new Error();
|
|
723
|
+
r.ReceiveAllMessages = t.asBool();
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
case Bt: {
|
|
727
|
+
if (t.isNull) throw new Error();
|
|
728
|
+
r.ViewportHeight = t.asInt32();
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
case Vt: {
|
|
732
|
+
if (t.isNull) throw new Error();
|
|
733
|
+
r.Description = t.asString();
|
|
734
|
+
break;
|
|
735
|
+
}
|
|
736
|
+
case xt: {
|
|
737
|
+
if (t.isNull) throw new Error();
|
|
738
|
+
r.Locale = t.asString();
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
case pt: {
|
|
742
|
+
if (t.isNull) throw new Error();
|
|
743
|
+
r.SdkType = t.asInt32();
|
|
744
|
+
break;
|
|
745
|
+
}
|
|
746
|
+
case Ht: {
|
|
747
|
+
if (t.isNull) throw new Error();
|
|
748
|
+
r.SessionId = t.asInt32();
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
case Yt: {
|
|
752
|
+
if (t.isNull) throw new Error();
|
|
753
|
+
r.ViewportWidth = t.asInt32();
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
case Kt: {
|
|
757
|
+
if (t.isNull) throw new Error();
|
|
758
|
+
r.PreciseJoinedAt = t.asUInt64();
|
|
759
|
+
break;
|
|
760
|
+
}
|
|
761
|
+
case $t: {
|
|
762
|
+
if (t.isNull) throw new Error();
|
|
763
|
+
r.PayloadType = t.asInt32();
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
case Xt: {
|
|
767
|
+
if (t.isNull) throw new Error();
|
|
768
|
+
r.IsTouchDevice = t.asBool();
|
|
769
|
+
break;
|
|
770
|
+
}
|
|
771
|
+
case jt: {
|
|
772
|
+
if (t.isNull) throw new Error();
|
|
773
|
+
r.VersionId = t.asString();
|
|
774
|
+
break;
|
|
775
|
+
}
|
|
776
|
+
case Wt: {
|
|
777
|
+
if (t.isNull) throw new Error();
|
|
778
|
+
r.UniqueSessionId = t.asString();
|
|
779
|
+
break;
|
|
780
|
+
}
|
|
781
|
+
case zt: {
|
|
782
|
+
if (t.isNull) throw new Error();
|
|
783
|
+
r.ClientType = t.asInt32();
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
case Jt: {
|
|
787
|
+
if (t.isNull) throw new Error();
|
|
788
|
+
r.IsReady = t.asBool();
|
|
789
|
+
break;
|
|
790
|
+
}
|
|
791
|
+
case Qt: {
|
|
792
|
+
if (t.isNull) throw new Error();
|
|
793
|
+
r.Parameters = ir(t.asDictionary());
|
|
794
|
+
break;
|
|
795
|
+
}
|
|
796
|
+
case qt: {
|
|
797
|
+
if (t.isNull) throw new Error();
|
|
798
|
+
r.Timezone = t.asString();
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
801
|
+
case Zt: {
|
|
802
|
+
if (t.isNull) throw new Error();
|
|
803
|
+
r.IsInternal = t.asBool();
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
806
|
+
case er: {
|
|
807
|
+
if (t.isNull) throw new Error();
|
|
808
|
+
r.ChannelLocale = t.asString();
|
|
809
|
+
break;
|
|
810
|
+
}
|
|
811
|
+
case tr: {
|
|
812
|
+
if (t.isNull) throw new Error();
|
|
813
|
+
r.EmbeddedSpaceId = t.asString();
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
function ir(e) {
|
|
819
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
820
|
+
let t;
|
|
821
|
+
for (; (t = e.next()) !== null; ) {
|
|
822
|
+
const s = t.key.asString();
|
|
823
|
+
r[s] = t.value.asString();
|
|
824
|
+
}
|
|
825
|
+
return r;
|
|
826
|
+
}
|
|
827
|
+
const or = 703025676, ar = 814454131, lr = 972460562, Ir = 976255570, Er = 1368629611, _r = 1479280922, cr = 1533537016, fr = 1909301063, ur = 2274386296, hr = 2603556958, Tr = 2885165957, Ar = 3568439632;
|
|
828
|
+
function Nr(e) {
|
|
829
|
+
const r = {};
|
|
830
|
+
return De(r), r;
|
|
831
|
+
}
|
|
832
|
+
function De(e) {
|
|
833
|
+
return e.FunctionId = h.fromBytes(new Uint8Array(16)), e.FunctionName = "", e.Parameters = [], e.ResultTypeName = "", e.IsEnumerable = !1, e.EnumerableItemTypeName = "", e.IsCancellable = !1, e.Description = "", e.LlmInlineResult = !1, e.LlmCallOnlyOnce = !1, e.RequiresInstance = !1, e.Versions = [], e;
|
|
834
|
+
}
|
|
835
|
+
function Sr(e, r) {
|
|
836
|
+
const t = r ?? Nr();
|
|
837
|
+
return De(t), Cr(e, t), t;
|
|
838
|
+
}
|
|
839
|
+
function Cr(e, r) {
|
|
840
|
+
let t;
|
|
841
|
+
for (; (t = e.next()) !== null; )
|
|
842
|
+
switch (t.fieldId) {
|
|
843
|
+
case or: {
|
|
844
|
+
if (t.isNull) throw new Error();
|
|
845
|
+
r.ResultTypeName = t.asString();
|
|
846
|
+
break;
|
|
847
|
+
}
|
|
848
|
+
case ar: {
|
|
849
|
+
if (t.isNull) throw new Error();
|
|
850
|
+
r.FunctionName = t.asString();
|
|
851
|
+
break;
|
|
852
|
+
}
|
|
853
|
+
case lr: {
|
|
854
|
+
if (t.isNull) throw new Error();
|
|
855
|
+
r.EnumerableItemTypeName = t.asString();
|
|
856
|
+
break;
|
|
857
|
+
}
|
|
858
|
+
case Ir: {
|
|
859
|
+
if (t.isNull) throw new Error();
|
|
860
|
+
r.FunctionId = t.asGuid();
|
|
861
|
+
break;
|
|
862
|
+
}
|
|
863
|
+
case Er: {
|
|
864
|
+
if (t.isNull) throw new Error();
|
|
865
|
+
r.Description = t.asString();
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
case _r: {
|
|
869
|
+
if (t.isNull) throw new Error();
|
|
870
|
+
r.IsCancellable = t.asBool();
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
case cr: {
|
|
874
|
+
if (t.isNull) throw new Error();
|
|
875
|
+
r.RequiresInstance = t.asBool();
|
|
876
|
+
break;
|
|
877
|
+
}
|
|
878
|
+
case fr: {
|
|
879
|
+
if (t.isNull) throw new Error();
|
|
880
|
+
r.Versions = dr(t.asArray());
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
case ur: {
|
|
884
|
+
if (t.isNull) throw new Error();
|
|
885
|
+
r.LlmInlineResult = t.asBool();
|
|
886
|
+
break;
|
|
887
|
+
}
|
|
888
|
+
case hr: {
|
|
889
|
+
if (t.isNull) throw new Error();
|
|
890
|
+
r.IsEnumerable = t.asBool();
|
|
891
|
+
break;
|
|
892
|
+
}
|
|
893
|
+
case Tr: {
|
|
894
|
+
if (t.isNull) throw new Error();
|
|
895
|
+
r.Parameters = Dr(t.asArray());
|
|
896
|
+
break;
|
|
897
|
+
}
|
|
898
|
+
case Ar: {
|
|
899
|
+
if (t.isNull) throw new Error();
|
|
900
|
+
r.LlmCallOnlyOnce = t.asBool();
|
|
901
|
+
break;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
function dr(e) {
|
|
906
|
+
const r = [];
|
|
907
|
+
let t;
|
|
908
|
+
for (; (t = e.next()) !== null; )
|
|
909
|
+
r.push(t.asString());
|
|
910
|
+
return r;
|
|
911
|
+
}
|
|
912
|
+
function Dr(e) {
|
|
913
|
+
const r = [];
|
|
914
|
+
let t;
|
|
915
|
+
for (; (t = e.next()) !== null; )
|
|
916
|
+
r.push(br(t.asObject()));
|
|
917
|
+
return r;
|
|
918
|
+
}
|
|
919
|
+
const wr = 607861992, Rr = 894485888, yr = 972460562, Ur = 1368629611, Lr = 1883521406, mr = 2603556958, Or = 3609695522, gr = 4075263697, Pr = 4257460908;
|
|
920
|
+
function Fr(e) {
|
|
921
|
+
const r = {};
|
|
922
|
+
return we(r), r;
|
|
923
|
+
}
|
|
924
|
+
function we(e) {
|
|
925
|
+
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;
|
|
926
|
+
}
|
|
927
|
+
function br(e, r) {
|
|
928
|
+
const t = r ?? Fr();
|
|
929
|
+
return we(t), Mr(e, t), t;
|
|
930
|
+
}
|
|
931
|
+
function Mr(e, r) {
|
|
932
|
+
let t;
|
|
933
|
+
for (; (t = e.next()) !== null; )
|
|
934
|
+
switch (t.fieldId) {
|
|
935
|
+
case wr: {
|
|
936
|
+
if (t.isNull) throw new Error();
|
|
937
|
+
r.HasDefaultValue = t.asBool();
|
|
938
|
+
break;
|
|
939
|
+
}
|
|
940
|
+
case Rr: {
|
|
941
|
+
if (t.isNull) throw new Error();
|
|
942
|
+
r.DefaultValueJson = t.asString();
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
case yr: {
|
|
946
|
+
if (t.isNull) throw new Error();
|
|
947
|
+
r.EnumerableItemTypeName = t.asString();
|
|
948
|
+
break;
|
|
949
|
+
}
|
|
950
|
+
case Ur: {
|
|
951
|
+
if (t.isNull) throw new Error();
|
|
952
|
+
r.Description = t.asString();
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
case Lr: {
|
|
956
|
+
if (t.isNull) throw new Error();
|
|
957
|
+
r.DefaultValueData = t.asBinary();
|
|
958
|
+
break;
|
|
959
|
+
}
|
|
960
|
+
case mr: {
|
|
961
|
+
if (t.isNull) throw new Error();
|
|
962
|
+
r.IsEnumerable = t.asBool();
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
case Or: {
|
|
966
|
+
if (t.isNull) throw new Error();
|
|
967
|
+
r.TypeName = t.asString();
|
|
968
|
+
break;
|
|
969
|
+
}
|
|
970
|
+
case gr: {
|
|
971
|
+
if (t.isNull) throw new Error();
|
|
972
|
+
r.ParameterName = t.asString();
|
|
973
|
+
break;
|
|
974
|
+
}
|
|
975
|
+
case Pr: {
|
|
976
|
+
if (t.isNull) throw new Error();
|
|
977
|
+
r.ParameterIndex = t.asInt32();
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
const vr = 3167053791, kr = 3342364356, Gr = 3612929027;
|
|
983
|
+
function Re(e) {
|
|
984
|
+
const r = {};
|
|
985
|
+
return ye(r), r;
|
|
986
|
+
}
|
|
987
|
+
function ye(e) {
|
|
988
|
+
return e.Category = "", e.Type = ce.Face, e.FaceBlendshapes = [], e;
|
|
989
|
+
}
|
|
990
|
+
function Br(e, r) {
|
|
991
|
+
const t = r ?? Re();
|
|
992
|
+
return ye(t), Vr(e, t), t;
|
|
993
|
+
}
|
|
994
|
+
function Vr(e, r) {
|
|
995
|
+
let t;
|
|
996
|
+
for (; (t = e.next()) !== null; )
|
|
997
|
+
switch (t.fieldId) {
|
|
998
|
+
case vr: {
|
|
999
|
+
if (t.isNull) throw new Error();
|
|
1000
|
+
r.Type = t.asInt32();
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
case kr: {
|
|
1004
|
+
if (t.isNull) throw new Error();
|
|
1005
|
+
r.FaceBlendshapes = xr(t.asArray());
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
1008
|
+
case Gr: {
|
|
1009
|
+
if (t.isNull) throw new Error();
|
|
1010
|
+
r.Category = t.asString();
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
function xr(e) {
|
|
1016
|
+
const r = [];
|
|
1017
|
+
let t;
|
|
1018
|
+
for (; (t = e.next()) !== null; )
|
|
1019
|
+
r.push(t.asString());
|
|
1020
|
+
return r;
|
|
1021
|
+
}
|
|
1022
|
+
const pr = 3612929027;
|
|
1023
|
+
function Ue(e) {
|
|
1024
|
+
const r = {};
|
|
1025
|
+
return Le(r), r;
|
|
1026
|
+
}
|
|
1027
|
+
function Le(e) {
|
|
1028
|
+
return e.Category = "", e;
|
|
1029
|
+
}
|
|
1030
|
+
function Hr(e, r) {
|
|
1031
|
+
const t = r ?? Ue();
|
|
1032
|
+
return Le(t), Yr(e, t), t;
|
|
1033
|
+
}
|
|
1034
|
+
function Yr(e, r) {
|
|
1035
|
+
let t;
|
|
1036
|
+
for (; (t = e.next()) !== null; )
|
|
1037
|
+
switch (t.fieldId) {
|
|
1038
|
+
case pr: {
|
|
1039
|
+
if (t.isNull) throw new Error();
|
|
1040
|
+
r.Category = t.asString();
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
const Kr = 161083277, $r = 164808083, Xr = 1368629611, jr = 2745379226, Wr = 2950031986, zr = 3282782683, Jr = 3284746250, Qr = 4065070594;
|
|
1046
|
+
function me(e) {
|
|
1047
|
+
const r = {};
|
|
1048
|
+
return Oe(r), r;
|
|
1049
|
+
}
|
|
1050
|
+
function Oe(e) {
|
|
1051
|
+
return e.StreamId = "", e.Description = "", e.SourceType = "", e.Codec = ue.H264, e.CodecDetails = "", e.Width = 0, e.Height = 0, e.Framerate = 30, e;
|
|
1052
|
+
}
|
|
1053
|
+
function qr(e, r) {
|
|
1054
|
+
const t = r ?? me();
|
|
1055
|
+
return Oe(t), Zr(e, t), t;
|
|
1056
|
+
}
|
|
1057
|
+
function Zr(e, r) {
|
|
1058
|
+
let t;
|
|
1059
|
+
for (; (t = e.next()) !== null; )
|
|
1060
|
+
switch (t.fieldId) {
|
|
1061
|
+
case Kr: {
|
|
1062
|
+
if (t.isNull) throw new Error();
|
|
1063
|
+
r.StreamId = t.asString();
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
case $r: {
|
|
1067
|
+
if (t.isNull) throw new Error();
|
|
1068
|
+
r.Framerate = t.asFloat64();
|
|
1069
|
+
break;
|
|
1070
|
+
}
|
|
1071
|
+
case Xr: {
|
|
1072
|
+
if (t.isNull) throw new Error();
|
|
1073
|
+
r.Description = t.asString();
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
case jr: {
|
|
1077
|
+
if (t.isNull) throw new Error();
|
|
1078
|
+
r.CodecDetails = t.asString();
|
|
1079
|
+
break;
|
|
1080
|
+
}
|
|
1081
|
+
case Wr: {
|
|
1082
|
+
if (t.isNull) throw new Error();
|
|
1083
|
+
r.Height = t.asInt32();
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
case zr: {
|
|
1087
|
+
if (t.isNull) throw new Error();
|
|
1088
|
+
r.SourceType = t.asString();
|
|
1089
|
+
break;
|
|
1090
|
+
}
|
|
1091
|
+
case Jr: {
|
|
1092
|
+
if (t.isNull) throw new Error();
|
|
1093
|
+
r.Codec = t.asInt32();
|
|
1094
|
+
break;
|
|
1095
|
+
}
|
|
1096
|
+
case Qr: {
|
|
1097
|
+
if (t.isNull) throw new Error();
|
|
1098
|
+
r.Width = t.asInt32();
|
|
1099
|
+
break;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
const es = 65539, ts = 693643444, rs = 1144553441, ss = 1497620243, ns = 1559330978, is = 1976546434, os = 1999510636, as = 2271236852, ls = 2277643855, Is = 2469008121, Es = 3042922213, _s = 3064612128, cs = 3219210453, fs = 3504054055, us = 3678477544, hs = 3696445035, Ts = 3707543140, As = 3712281496, Ns = 3895362455, Ss = 3897397815, Cs = 4225107827;
|
|
1104
|
+
function ds(e) {
|
|
1105
|
+
const r = {};
|
|
1106
|
+
return ge(r), r;
|
|
1107
|
+
}
|
|
1108
|
+
function ge(e) {
|
|
1109
|
+
return e.Clients = /* @__PURE__ */ Object.create(null), e.Functions = /* @__PURE__ */ Object.create(null), e.UIStreams = /* @__PURE__ */ Object.create(null), e.AudioStreams = /* @__PURE__ */ Object.create(null), e.VideoStreams = /* @__PURE__ */ Object.create(null), e.TrackingStreams = /* @__PURE__ */ Object.create(null), e.SpaceId = "", e.ChannelId = "", e.SessionId = "", e.ChannelUrl = "", e.SessionChannelUrl = "", e.FirstUserId = "", e.PrimaryUserId = "", e.OrganisationName = "", e.SpaceName = "", e.ChannelName = "", e.ServerRunType = Te.Local, e.AppSourceType = Ae.Bundle, e.PublicAccess = !1, e.DebugMode = !1, e;
|
|
1110
|
+
}
|
|
1111
|
+
function Ds(e, r) {
|
|
1112
|
+
const t = m.create(e);
|
|
1113
|
+
return ws(t, r);
|
|
1114
|
+
}
|
|
1115
|
+
function ws(e, r) {
|
|
1116
|
+
const t = r ?? ds();
|
|
1117
|
+
return ge(t), Rs(e, t), t;
|
|
1118
|
+
}
|
|
1119
|
+
function Rs(e, r) {
|
|
1120
|
+
let t;
|
|
1121
|
+
for (; (t = e.next()) !== null; )
|
|
1122
|
+
switch (t.fieldId) {
|
|
1123
|
+
case ts: {
|
|
1124
|
+
if (t.isNull) throw new Error();
|
|
1125
|
+
r.FirstUserId = t.asString();
|
|
1126
|
+
break;
|
|
1127
|
+
}
|
|
1128
|
+
case rs: {
|
|
1129
|
+
if (t.isNull) throw new Error();
|
|
1130
|
+
r.Clients = Us(t.asDictionary());
|
|
1131
|
+
break;
|
|
1132
|
+
}
|
|
1133
|
+
case ss: {
|
|
1134
|
+
if (t.isNull) throw new Error();
|
|
1135
|
+
r.TrackingStreams = Ls(t.asDictionary());
|
|
1136
|
+
break;
|
|
1137
|
+
}
|
|
1138
|
+
case ns: {
|
|
1139
|
+
if (t.isNull) throw new Error();
|
|
1140
|
+
r.ChannelId = t.asString();
|
|
1141
|
+
break;
|
|
1142
|
+
}
|
|
1143
|
+
case is: {
|
|
1144
|
+
if (t.isNull) throw new Error();
|
|
1145
|
+
r.AppSourceType = t.asInt32();
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1148
|
+
case os: {
|
|
1149
|
+
if (t.isNull) throw new Error();
|
|
1150
|
+
r.SessionId = t.asString();
|
|
1151
|
+
break;
|
|
1152
|
+
}
|
|
1153
|
+
case as: {
|
|
1154
|
+
if (t.isNull) throw new Error();
|
|
1155
|
+
r.SessionChannelUrl = t.asString();
|
|
1156
|
+
break;
|
|
1157
|
+
}
|
|
1158
|
+
case ls: {
|
|
1159
|
+
if (t.isNull) throw new Error();
|
|
1160
|
+
r.ChannelUrl = t.asString();
|
|
1161
|
+
break;
|
|
1162
|
+
}
|
|
1163
|
+
case Is: {
|
|
1164
|
+
if (t.isNull) throw new Error();
|
|
1165
|
+
r.ChannelName = t.asString();
|
|
1166
|
+
break;
|
|
1167
|
+
}
|
|
1168
|
+
case Es: {
|
|
1169
|
+
if (t.isNull) throw new Error();
|
|
1170
|
+
r.PublicAccess = t.asBool();
|
|
1171
|
+
break;
|
|
1172
|
+
}
|
|
1173
|
+
case _s: {
|
|
1174
|
+
if (t.isNull) throw new Error();
|
|
1175
|
+
r.ServerRunType = t.asInt32();
|
|
1176
|
+
break;
|
|
1177
|
+
}
|
|
1178
|
+
case cs: {
|
|
1179
|
+
if (t.isNull) throw new Error();
|
|
1180
|
+
r.OrganisationName = t.asString();
|
|
1181
|
+
break;
|
|
1182
|
+
}
|
|
1183
|
+
case fs: {
|
|
1184
|
+
if (t.isNull) throw new Error();
|
|
1185
|
+
r.DebugMode = t.asBool();
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
case us: {
|
|
1189
|
+
if (t.isNull) throw new Error();
|
|
1190
|
+
r.Functions = ms(t.asDictionary());
|
|
1191
|
+
break;
|
|
1192
|
+
}
|
|
1193
|
+
case hs: {
|
|
1194
|
+
if (t.isNull) throw new Error();
|
|
1195
|
+
r.UIStreams = Os(t.asDictionary());
|
|
1196
|
+
break;
|
|
1197
|
+
}
|
|
1198
|
+
case Ts: {
|
|
1199
|
+
if (t.isNull) throw new Error();
|
|
1200
|
+
r.SpaceId = t.asString();
|
|
1201
|
+
break;
|
|
1202
|
+
}
|
|
1203
|
+
case As: {
|
|
1204
|
+
if (t.isNull) throw new Error();
|
|
1205
|
+
r.PrimaryUserId = t.asString();
|
|
1206
|
+
break;
|
|
1207
|
+
}
|
|
1208
|
+
case Ns: {
|
|
1209
|
+
if (t.isNull) throw new Error();
|
|
1210
|
+
r.AudioStreams = gs(t.asDictionary());
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1213
|
+
case Ss: {
|
|
1214
|
+
if (t.isNull) throw new Error();
|
|
1215
|
+
r.VideoStreams = Ps(t.asDictionary());
|
|
1216
|
+
break;
|
|
1217
|
+
}
|
|
1218
|
+
case Cs: {
|
|
1219
|
+
if (t.isNull) throw new Error();
|
|
1220
|
+
r.SpaceName = t.asString();
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
async function ys(e, r) {
|
|
1226
|
+
const t = await Y(e, es);
|
|
1227
|
+
return Ds(t, r);
|
|
1228
|
+
}
|
|
1229
|
+
function Us(e) {
|
|
1230
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1231
|
+
let t;
|
|
1232
|
+
for (; (t = e.next()) !== null; ) {
|
|
1233
|
+
const s = t.key.asInt32();
|
|
1234
|
+
r[s] = sr(t.value.asObject());
|
|
1235
|
+
}
|
|
1236
|
+
return r;
|
|
1237
|
+
}
|
|
1238
|
+
function Ls(e) {
|
|
1239
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1240
|
+
let t;
|
|
1241
|
+
for (; (t = e.next()) !== null; ) {
|
|
1242
|
+
const s = t.key.asString();
|
|
1243
|
+
r[s] = on(t.value.asObject());
|
|
1244
|
+
}
|
|
1245
|
+
return r;
|
|
1246
|
+
}
|
|
1247
|
+
function ms(e) {
|
|
1248
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1249
|
+
let t;
|
|
1250
|
+
for (; (t = e.next()) !== null; ) {
|
|
1251
|
+
const s = t.key.asInt32();
|
|
1252
|
+
r[s] = Fs(t.value.asArray());
|
|
1253
|
+
}
|
|
1254
|
+
return r;
|
|
1255
|
+
}
|
|
1256
|
+
function Os(e) {
|
|
1257
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1258
|
+
let t;
|
|
1259
|
+
for (; (t = e.next()) !== null; ) {
|
|
1260
|
+
const s = t.key.asString();
|
|
1261
|
+
r[s] = Bs(t.value.asObject());
|
|
1262
|
+
}
|
|
1263
|
+
return r;
|
|
1264
|
+
}
|
|
1265
|
+
function gs(e) {
|
|
1266
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1267
|
+
let t;
|
|
1268
|
+
for (; (t = e.next()) !== null; ) {
|
|
1269
|
+
const s = t.key.asString();
|
|
1270
|
+
r[s] = $s(t.value.asObject());
|
|
1271
|
+
}
|
|
1272
|
+
return r;
|
|
1273
|
+
}
|
|
1274
|
+
function Ps(e) {
|
|
1275
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1276
|
+
let t;
|
|
1277
|
+
for (; (t = e.next()) !== null; ) {
|
|
1278
|
+
const s = t.key.asString();
|
|
1279
|
+
r[s] = qs(t.value.asObject());
|
|
1280
|
+
}
|
|
1281
|
+
return r;
|
|
1282
|
+
}
|
|
1283
|
+
function Fs(e) {
|
|
1284
|
+
const r = [];
|
|
1285
|
+
let t;
|
|
1286
|
+
for (; (t = e.next()) !== null; )
|
|
1287
|
+
r.push(Sr(t.asObject()));
|
|
1288
|
+
return r;
|
|
1289
|
+
}
|
|
1290
|
+
const bs = 161083277, Ms = 325678206, vs = 3469892363, ks = 3645544153;
|
|
1291
|
+
function Gs(e) {
|
|
1292
|
+
const r = {};
|
|
1293
|
+
return Pe(r), r;
|
|
1294
|
+
}
|
|
1295
|
+
function Pe(e) {
|
|
1296
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Ue(), e;
|
|
1297
|
+
}
|
|
1298
|
+
function Bs(e, r) {
|
|
1299
|
+
const t = r ?? Gs();
|
|
1300
|
+
return Pe(t), Vs(e, t), t;
|
|
1301
|
+
}
|
|
1302
|
+
function Vs(e, r) {
|
|
1303
|
+
let t;
|
|
1304
|
+
for (; (t = e.next()) !== null; )
|
|
1305
|
+
switch (t.fieldId) {
|
|
1306
|
+
case bs: {
|
|
1307
|
+
if (t.isNull) throw new Error();
|
|
1308
|
+
r.StreamId = t.asString();
|
|
1309
|
+
break;
|
|
1310
|
+
}
|
|
1311
|
+
case Ms: {
|
|
1312
|
+
if (t.isNull) throw new Error();
|
|
1313
|
+
r.ClientSessionId = t.asInt32();
|
|
1314
|
+
break;
|
|
1315
|
+
}
|
|
1316
|
+
case vs: {
|
|
1317
|
+
if (t.isNull) throw new Error();
|
|
1318
|
+
r.TrackId = t.asInt32();
|
|
1319
|
+
break;
|
|
1320
|
+
}
|
|
1321
|
+
case ks: {
|
|
1322
|
+
if (t.isNull) throw new Error();
|
|
1323
|
+
r.Info = Hr(t.asObject());
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
const xs = 161083277, ps = 325678206, Hs = 3469892363, Ys = 3645544153;
|
|
1329
|
+
function Ks(e) {
|
|
1330
|
+
const r = {};
|
|
1331
|
+
return Fe(r), r;
|
|
1332
|
+
}
|
|
1333
|
+
function Fe(e) {
|
|
1334
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Ne(), e;
|
|
1335
|
+
}
|
|
1336
|
+
function $s(e, r) {
|
|
1337
|
+
const t = r ?? Ks();
|
|
1338
|
+
return Fe(t), Xs(e, t), t;
|
|
1339
|
+
}
|
|
1340
|
+
function Xs(e, r) {
|
|
1341
|
+
let t;
|
|
1342
|
+
for (; (t = e.next()) !== null; )
|
|
1343
|
+
switch (t.fieldId) {
|
|
1344
|
+
case xs: {
|
|
1345
|
+
if (t.isNull) throw new Error();
|
|
1346
|
+
r.StreamId = t.asString();
|
|
1347
|
+
break;
|
|
1348
|
+
}
|
|
1349
|
+
case ps: {
|
|
1350
|
+
if (t.isNull) throw new Error();
|
|
1351
|
+
r.ClientSessionId = t.asInt32();
|
|
1352
|
+
break;
|
|
1353
|
+
}
|
|
1354
|
+
case Hs: {
|
|
1355
|
+
if (t.isNull) throw new Error();
|
|
1356
|
+
r.TrackId = t.asInt32();
|
|
1357
|
+
break;
|
|
1358
|
+
}
|
|
1359
|
+
case Ys: {
|
|
1360
|
+
if (t.isNull) throw new Error();
|
|
1361
|
+
r.Info = Tt(t.asObject());
|
|
1362
|
+
break;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
const js = 161083277, Ws = 325678206, zs = 3469892363, Js = 3645544153;
|
|
1367
|
+
function Qs(e) {
|
|
1368
|
+
const r = {};
|
|
1369
|
+
return be(r), r;
|
|
1370
|
+
}
|
|
1371
|
+
function be(e) {
|
|
1372
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = me(), e;
|
|
1373
|
+
}
|
|
1374
|
+
function qs(e, r) {
|
|
1375
|
+
const t = r ?? Qs();
|
|
1376
|
+
return be(t), Zs(e, t), t;
|
|
1377
|
+
}
|
|
1378
|
+
function Zs(e, r) {
|
|
1379
|
+
let t;
|
|
1380
|
+
for (; (t = e.next()) !== null; )
|
|
1381
|
+
switch (t.fieldId) {
|
|
1382
|
+
case js: {
|
|
1383
|
+
if (t.isNull) throw new Error();
|
|
1384
|
+
r.StreamId = t.asString();
|
|
1385
|
+
break;
|
|
1386
|
+
}
|
|
1387
|
+
case Ws: {
|
|
1388
|
+
if (t.isNull) throw new Error();
|
|
1389
|
+
r.ClientSessionId = t.asInt32();
|
|
1390
|
+
break;
|
|
1391
|
+
}
|
|
1392
|
+
case zs: {
|
|
1393
|
+
if (t.isNull) throw new Error();
|
|
1394
|
+
r.TrackId = t.asInt32();
|
|
1395
|
+
break;
|
|
1396
|
+
}
|
|
1397
|
+
case Js: {
|
|
1398
|
+
if (t.isNull) throw new Error();
|
|
1399
|
+
r.Info = qr(t.asObject());
|
|
1400
|
+
break;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
const en = 161083277, tn = 325678206, rn = 3469892363, sn = 3645544153;
|
|
1405
|
+
function nn(e) {
|
|
1406
|
+
const r = {};
|
|
1407
|
+
return Me(r), r;
|
|
1408
|
+
}
|
|
1409
|
+
function Me(e) {
|
|
1410
|
+
return e.StreamId = "", e.ClientSessionId = 0, e.TrackId = 0, e.Info = Re(), e;
|
|
1411
|
+
}
|
|
1412
|
+
function on(e, r) {
|
|
1413
|
+
const t = r ?? nn();
|
|
1414
|
+
return Me(t), an(e, t), t;
|
|
1415
|
+
}
|
|
1416
|
+
function an(e, r) {
|
|
1417
|
+
let t;
|
|
1418
|
+
for (; (t = e.next()) !== null; )
|
|
1419
|
+
switch (t.fieldId) {
|
|
1420
|
+
case en: {
|
|
1421
|
+
if (t.isNull) throw new Error();
|
|
1422
|
+
r.StreamId = t.asString();
|
|
1423
|
+
break;
|
|
1424
|
+
}
|
|
1425
|
+
case tn: {
|
|
1426
|
+
if (t.isNull) throw new Error();
|
|
1427
|
+
r.ClientSessionId = t.asInt32();
|
|
1428
|
+
break;
|
|
1429
|
+
}
|
|
1430
|
+
case rn: {
|
|
1431
|
+
if (t.isNull) throw new Error();
|
|
1432
|
+
r.TrackId = t.asInt32();
|
|
1433
|
+
break;
|
|
1434
|
+
}
|
|
1435
|
+
case sn: {
|
|
1436
|
+
if (t.isNull) throw new Error();
|
|
1437
|
+
r.Info = Br(t.asObject());
|
|
1438
|
+
break;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
const ln = 1405462580, In = 2968276160;
|
|
1443
|
+
function En(e) {
|
|
1444
|
+
const r = {};
|
|
1445
|
+
return ve(r), r;
|
|
1446
|
+
}
|
|
1447
|
+
function ve(e) {
|
|
1448
|
+
return e.MimeType = "", e.Value = new Uint8Array(0), e;
|
|
1449
|
+
}
|
|
1450
|
+
function _n(e, r) {
|
|
1451
|
+
const t = r ?? En();
|
|
1452
|
+
return ve(t), cn(e, t), t;
|
|
1453
|
+
}
|
|
1454
|
+
function cn(e, r) {
|
|
1455
|
+
let t;
|
|
1456
|
+
for (; (t = e.next()) !== null; )
|
|
1457
|
+
switch (t.fieldId) {
|
|
1458
|
+
case ln: {
|
|
1459
|
+
if (t.isNull) throw new Error();
|
|
1460
|
+
r.Value = t.asBinary();
|
|
1461
|
+
break;
|
|
1462
|
+
}
|
|
1463
|
+
case In: {
|
|
1464
|
+
if (t.isNull) throw new Error();
|
|
1465
|
+
r.MimeType = t.asString();
|
|
1466
|
+
break;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
const fn = 2097188, un = 979822885, hn = 2374537704;
|
|
1471
|
+
function Tn(e) {
|
|
1472
|
+
const r = {};
|
|
1473
|
+
return ke(r), r;
|
|
1474
|
+
}
|
|
1475
|
+
function ke(e) {
|
|
1476
|
+
return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
|
|
1477
|
+
}
|
|
1478
|
+
function An(e, r) {
|
|
1479
|
+
const t = m.create(e);
|
|
1480
|
+
return Nn(t, r);
|
|
1481
|
+
}
|
|
1482
|
+
function Nn(e, r) {
|
|
1483
|
+
const t = r ?? Tn();
|
|
1484
|
+
return ke(t), Sn(e, t), t;
|
|
1485
|
+
}
|
|
1486
|
+
function Sn(e, r) {
|
|
1487
|
+
let t;
|
|
1488
|
+
for (; (t = e.next()) !== null; )
|
|
1489
|
+
switch (t.fieldId) {
|
|
1490
|
+
case un: {
|
|
1491
|
+
if (t.isNull) throw new Error();
|
|
1492
|
+
r.StyleId = t.asString();
|
|
1493
|
+
break;
|
|
1494
|
+
}
|
|
1495
|
+
case hn: {
|
|
1496
|
+
if (t.isNull) throw new Error();
|
|
1497
|
+
r.Style = dn(t.asDictionary());
|
|
1498
|
+
break;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
async function Cn(e, r) {
|
|
1503
|
+
const t = await Y(e, fn);
|
|
1504
|
+
return An(t, r);
|
|
1505
|
+
}
|
|
1506
|
+
function dn(e) {
|
|
1507
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1508
|
+
let t;
|
|
1509
|
+
for (; (t = e.next()) !== null; ) {
|
|
1510
|
+
const s = t.key.asString();
|
|
1511
|
+
r[s] = t.value.asString();
|
|
1512
|
+
}
|
|
1513
|
+
return r;
|
|
1514
|
+
}
|
|
1515
|
+
const Dn = 2097192, wn = 2136687806;
|
|
1516
|
+
function Rn(e) {
|
|
1517
|
+
const r = {};
|
|
1518
|
+
return Ge(r), r;
|
|
1519
|
+
}
|
|
1520
|
+
function Ge(e) {
|
|
1521
|
+
return e.Styles = [], e;
|
|
1522
|
+
}
|
|
1523
|
+
function yn(e, r) {
|
|
1524
|
+
const t = m.create(e);
|
|
1525
|
+
return Un(t, r);
|
|
1526
|
+
}
|
|
1527
|
+
function Un(e, r) {
|
|
1528
|
+
const t = r ?? Rn();
|
|
1529
|
+
return Ge(t), Ln(e, t), t;
|
|
1530
|
+
}
|
|
1531
|
+
function Ln(e, r) {
|
|
1532
|
+
let t;
|
|
1533
|
+
for (; (t = e.next()) !== null; )
|
|
1534
|
+
switch (t.fieldId) {
|
|
1535
|
+
case wn: {
|
|
1536
|
+
if (t.isNull) throw new Error();
|
|
1537
|
+
r.Styles = On(t.asArray());
|
|
1538
|
+
break;
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
async function mn(e, r) {
|
|
1543
|
+
const t = await Y(e, Dn);
|
|
1544
|
+
return yn(t, r);
|
|
1545
|
+
}
|
|
1546
|
+
function On(e) {
|
|
1547
|
+
const r = [];
|
|
1548
|
+
let t;
|
|
1549
|
+
for (; (t = e.next()) !== null; )
|
|
1550
|
+
r.push(bn(t.asObject()));
|
|
1551
|
+
return r;
|
|
1552
|
+
}
|
|
1553
|
+
const gn = 979822885, Pn = 2374537704;
|
|
1554
|
+
function Fn(e) {
|
|
1555
|
+
const r = {};
|
|
1556
|
+
return Be(r), r;
|
|
1557
|
+
}
|
|
1558
|
+
function Be(e) {
|
|
1559
|
+
return e.StyleId = "", e.Style = /* @__PURE__ */ Object.create(null), e;
|
|
1560
|
+
}
|
|
1561
|
+
function bn(e, r) {
|
|
1562
|
+
const t = r ?? Fn();
|
|
1563
|
+
return Be(t), Mn(e, t), t;
|
|
1564
|
+
}
|
|
1565
|
+
function Mn(e, r) {
|
|
1566
|
+
let t;
|
|
1567
|
+
for (; (t = e.next()) !== null; )
|
|
1568
|
+
switch (t.fieldId) {
|
|
1569
|
+
case gn: {
|
|
1570
|
+
if (t.isNull) throw new Error();
|
|
1571
|
+
r.StyleId = t.asString();
|
|
1572
|
+
break;
|
|
1573
|
+
}
|
|
1574
|
+
case Pn: {
|
|
1575
|
+
if (t.isNull) throw new Error();
|
|
1576
|
+
r.Style = vn(t.asDictionary());
|
|
1577
|
+
break;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
function vn(e) {
|
|
1582
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1583
|
+
let t;
|
|
1584
|
+
for (; (t = e.next()) !== null; ) {
|
|
1585
|
+
const s = t.key.asString();
|
|
1586
|
+
r[s] = t.value.asString();
|
|
1587
|
+
}
|
|
1588
|
+
return r;
|
|
1589
|
+
}
|
|
1590
|
+
const kn = 2097193, Gn = 1415642792;
|
|
1591
|
+
function Bn(e) {
|
|
1592
|
+
const r = {};
|
|
1593
|
+
return Ve(r), r;
|
|
1594
|
+
}
|
|
1595
|
+
function Ve(e) {
|
|
1596
|
+
return e.StyleIds = [], e;
|
|
1597
|
+
}
|
|
1598
|
+
function Vn(e, r) {
|
|
1599
|
+
const t = m.create(e);
|
|
1600
|
+
return xn(t, r);
|
|
1601
|
+
}
|
|
1602
|
+
function xn(e, r) {
|
|
1603
|
+
const t = r ?? Bn();
|
|
1604
|
+
return Ve(t), pn(e, t), t;
|
|
1605
|
+
}
|
|
1606
|
+
function pn(e, r) {
|
|
1607
|
+
let t;
|
|
1608
|
+
for (; (t = e.next()) !== null; )
|
|
1609
|
+
switch (t.fieldId) {
|
|
1610
|
+
case Gn: {
|
|
1611
|
+
if (t.isNull) throw new Error();
|
|
1612
|
+
r.StyleIds = Yn(t.asArray());
|
|
1613
|
+
break;
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
async function Hn(e, r) {
|
|
1618
|
+
const t = await Y(e, kn);
|
|
1619
|
+
return Vn(t, r);
|
|
1620
|
+
}
|
|
1621
|
+
function Yn(e) {
|
|
1622
|
+
const r = [];
|
|
1623
|
+
let t;
|
|
1624
|
+
for (; (t = e.next()) !== null; )
|
|
1625
|
+
r.push(t.asString());
|
|
1626
|
+
return r;
|
|
1627
|
+
}
|
|
1628
|
+
const Kn = 2097190, $n = 425183262, Xn = 653781469;
|
|
1629
|
+
function jn(e) {
|
|
1630
|
+
const r = {};
|
|
1631
|
+
return xe(r), r;
|
|
1632
|
+
}
|
|
1633
|
+
function xe(e) {
|
|
1634
|
+
return e.Json = "", e.Payloads = /* @__PURE__ */ Object.create(null), e;
|
|
1635
|
+
}
|
|
1636
|
+
function Wn(e, r) {
|
|
1637
|
+
const t = m.create(e);
|
|
1638
|
+
return zn(t, r);
|
|
1639
|
+
}
|
|
1640
|
+
function zn(e, r) {
|
|
1641
|
+
const t = r ?? jn();
|
|
1642
|
+
return xe(t), Jn(e, t), t;
|
|
1643
|
+
}
|
|
1644
|
+
function Jn(e, r) {
|
|
1645
|
+
let t;
|
|
1646
|
+
for (; (t = e.next()) !== null; )
|
|
1647
|
+
switch (t.fieldId) {
|
|
1648
|
+
case $n: {
|
|
1649
|
+
if (t.isNull) throw new Error();
|
|
1650
|
+
r.Json = t.asString();
|
|
1651
|
+
break;
|
|
1652
|
+
}
|
|
1653
|
+
case Xn: {
|
|
1654
|
+
if (t.isNull) throw new Error();
|
|
1655
|
+
r.Payloads = qn(t.asDictionary());
|
|
1656
|
+
break;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
async function Qn(e, r) {
|
|
1661
|
+
const t = await Y(e, Kn);
|
|
1662
|
+
return Wn(t, r);
|
|
1663
|
+
}
|
|
1664
|
+
function qn(e) {
|
|
1665
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1666
|
+
let t;
|
|
1667
|
+
for (; (t = e.next()) !== null; ) {
|
|
1668
|
+
const s = t.key.asString();
|
|
1669
|
+
r[s] = _n(t.value.asObject());
|
|
1670
|
+
}
|
|
1671
|
+
return r;
|
|
1672
|
+
}
|
|
1673
|
+
function C(e) {
|
|
1674
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1675
|
+
}
|
|
1676
|
+
function pe(e) {
|
|
1677
|
+
const r = {}, t = Object.keys(e);
|
|
1678
|
+
for (let s = 0; s < t.length; s++) {
|
|
1679
|
+
const n = t[s];
|
|
1680
|
+
r[n] = e[n];
|
|
1681
|
+
}
|
|
1682
|
+
return r;
|
|
1683
|
+
}
|
|
1684
|
+
function He(e, r, t, s) {
|
|
1685
|
+
if (!(e === void 0 && s)) {
|
|
1686
|
+
if (Array.isArray(e)) {
|
|
1687
|
+
const n = [];
|
|
1688
|
+
for (let i = 0; i < e.length; i++) {
|
|
1689
|
+
const o = e[i];
|
|
1690
|
+
if (typeof o != "string")
|
|
1691
|
+
throw new Error(`Invalid styleIds entry at ${r}.styleIds[${i}] for element ${t}`);
|
|
1692
|
+
const a = o.trim();
|
|
1693
|
+
a.length !== 0 && n.push(a);
|
|
1694
|
+
}
|
|
1695
|
+
return n;
|
|
1696
|
+
}
|
|
1697
|
+
if (e != null)
|
|
1698
|
+
throw new Error(`Invalid styleIds for element ${t}`);
|
|
1699
|
+
return [];
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
function se(e, r) {
|
|
1703
|
+
if (!e || typeof e != "object")
|
|
1704
|
+
throw new Error(`Invalid UI node at ${r}`);
|
|
1705
|
+
const t = e.Id, s = e.Type, n = e.Props, i = e.Children, o = e.StyleIds;
|
|
1706
|
+
if (typeof t != "string")
|
|
1707
|
+
throw new Error(`Invalid or missing node id at ${r}`);
|
|
1708
|
+
if (typeof s != "string")
|
|
1709
|
+
throw new Error(`Invalid or missing node type for ${t}`);
|
|
1710
|
+
let a = {};
|
|
1711
|
+
if (n != null) {
|
|
1712
|
+
if (!C(n))
|
|
1713
|
+
throw new Error(`Invalid props for node ${t}`);
|
|
1714
|
+
a = pe(n);
|
|
1715
|
+
}
|
|
1716
|
+
let I = [];
|
|
1717
|
+
Array.isArray(i) && (I = i.map(
|
|
1718
|
+
(_, c) => se(_ ?? {}, `${r}.children[${c}]`)
|
|
1719
|
+
));
|
|
1720
|
+
const E = He(o, r, t, !1), l = typeof e.SourceMarker == "string" ? e.SourceMarker : void 0;
|
|
1721
|
+
return {
|
|
1722
|
+
id: t,
|
|
1723
|
+
type: s,
|
|
1724
|
+
props: a,
|
|
1725
|
+
children: I,
|
|
1726
|
+
styleIds: E ?? [],
|
|
1727
|
+
...l ? { sourceMarker: l } : {}
|
|
1728
|
+
};
|
|
1729
|
+
}
|
|
1730
|
+
function Zn(e, r) {
|
|
1731
|
+
if (!C(e))
|
|
1732
|
+
throw new Error(`Invalid text delta at ${r}`);
|
|
1733
|
+
const t = e.NodeId, s = e.PropertyName, n = e.Start, i = e.End, o = e.InsertedText;
|
|
1734
|
+
if (typeof t != "string" || t.length === 0)
|
|
1735
|
+
throw new Error(`Invalid text delta node id at ${r}`);
|
|
1736
|
+
if (typeof s != "string" || s.length === 0)
|
|
1737
|
+
throw new Error(`Invalid text delta property name at ${r}`);
|
|
1738
|
+
if (typeof n != "number" || !Number.isFinite(n))
|
|
1739
|
+
throw new Error(`Invalid text delta start at ${r}`);
|
|
1740
|
+
if (typeof o != "string")
|
|
1741
|
+
throw new Error(`Invalid text delta inserted text at ${r}`);
|
|
1742
|
+
let a;
|
|
1743
|
+
if (typeof i == "number") {
|
|
1744
|
+
if (!Number.isFinite(i))
|
|
1745
|
+
throw new Error(`Invalid text delta end at ${r}`);
|
|
1746
|
+
a = i;
|
|
1747
|
+
} else if (i != null)
|
|
1748
|
+
throw new Error(`Invalid text delta end at ${r}`);
|
|
1749
|
+
return {
|
|
1750
|
+
nodeId: t,
|
|
1751
|
+
propertyName: s,
|
|
1752
|
+
start: n,
|
|
1753
|
+
end: a,
|
|
1754
|
+
insertedText: o
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
function ei(e, r) {
|
|
1758
|
+
if (!C(e))
|
|
1759
|
+
throw new Error(`Invalid child insert at ${r}`);
|
|
1760
|
+
const t = e.Index, s = e.Node;
|
|
1761
|
+
if (typeof t != "number" || !Number.isFinite(t))
|
|
1762
|
+
throw new Error(`Invalid child insert index at ${r}`);
|
|
1763
|
+
if (!C(s))
|
|
1764
|
+
throw new Error(`Invalid child insert node at ${r}`);
|
|
1765
|
+
return {
|
|
1766
|
+
index: t,
|
|
1767
|
+
node: se(s, `${r}.node`)
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
function ti(e, r) {
|
|
1771
|
+
if (!C(e))
|
|
1772
|
+
throw new Error(`Invalid child move at ${r}`);
|
|
1773
|
+
const t = e.NodeId, s = e.FromIndex, n = e.ToIndex;
|
|
1774
|
+
if (typeof t != "string" || t.length === 0)
|
|
1775
|
+
throw new Error(`Invalid child move nodeId at ${r}`);
|
|
1776
|
+
if (typeof s != "number" || !Number.isFinite(s))
|
|
1777
|
+
throw new Error(`Invalid child move fromIndex at ${r}`);
|
|
1778
|
+
if (typeof n != "number" || !Number.isFinite(n))
|
|
1779
|
+
throw new Error(`Invalid child move toIndex at ${r}`);
|
|
1780
|
+
return {
|
|
1781
|
+
nodeId: t,
|
|
1782
|
+
fromIndex: s,
|
|
1783
|
+
toIndex: n
|
|
1784
|
+
};
|
|
1785
|
+
}
|
|
1786
|
+
function ri(e, r) {
|
|
1787
|
+
if (!C(e))
|
|
1788
|
+
throw new Error(`Invalid child remove at ${r}`);
|
|
1789
|
+
const t = e.NodeId, s = e.Index;
|
|
1790
|
+
if (typeof t != "string" || t.length === 0)
|
|
1791
|
+
throw new Error(`Invalid child remove nodeId at ${r}`);
|
|
1792
|
+
if (typeof s != "number" || !Number.isFinite(s))
|
|
1793
|
+
throw new Error(`Invalid child remove index at ${r}`);
|
|
1794
|
+
return {
|
|
1795
|
+
nodeId: t,
|
|
1796
|
+
index: s
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1799
|
+
function si(e, r) {
|
|
1800
|
+
if (!C(e))
|
|
1801
|
+
throw new Error(`Invalid node change at ${r}`);
|
|
1802
|
+
const t = e.nodeId;
|
|
1803
|
+
if (typeof t != "string" || t.length === 0)
|
|
1804
|
+
throw new Error(`Invalid node change nodeId at ${r}`);
|
|
1805
|
+
const s = Array.isArray(e.inserts) ? e.inserts.map(
|
|
1806
|
+
(l, _) => ei(l ?? {}, `${r}.inserts[${_}]`)
|
|
1807
|
+
) : void 0, n = Array.isArray(e.moves) ? e.moves.map(
|
|
1808
|
+
(l, _) => ti(l ?? {}, `${r}.moves[${_}]`)
|
|
1809
|
+
) : void 0, i = Array.isArray(e.removals) ? e.removals.map(
|
|
1810
|
+
(l, _) => ri(l ?? {}, `${r}.removals[${_}]`)
|
|
1811
|
+
) : void 0;
|
|
1812
|
+
let o;
|
|
1813
|
+
if (C(e.changedProps)) {
|
|
1814
|
+
o = /* @__PURE__ */ new Map();
|
|
1815
|
+
for (const [l, _] of Object.entries(e.changedProps)) {
|
|
1816
|
+
if (!C(_))
|
|
1817
|
+
continue;
|
|
1818
|
+
const c = _.New;
|
|
1819
|
+
c === void 0 ? o.set(l, void 0) : C(c) ? o.set(l, pe(c)) : o.set(l, c);
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
const a = Array.isArray(e.textUpdates) ? e.textUpdates.map(
|
|
1823
|
+
(l, _) => Zn(l ?? {}, `${r}.textUpdates[${_}]`)
|
|
1824
|
+
) : void 0, I = e.styleIds, E = I !== void 0 ? He(I, r, t, !0) : void 0;
|
|
1825
|
+
return {
|
|
1826
|
+
nodeId: t,
|
|
1827
|
+
...s && s.length > 0 ? { inserts: s } : {},
|
|
1828
|
+
...n && n.length > 0 ? { moves: n } : {},
|
|
1829
|
+
...i && i.length > 0 ? { removals: i } : {},
|
|
1830
|
+
...o && o.size > 0 ? { changedProps: o } : {},
|
|
1831
|
+
...a && a.length > 0 ? { textUpdates: a } : {},
|
|
1832
|
+
...E !== void 0 ? { styleIds: E } : {}
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
function ni(e) {
|
|
1836
|
+
const r = /* @__PURE__ */ new Map();
|
|
1837
|
+
for (const [t, s] of Object.entries(e))
|
|
1838
|
+
r.set(t, s);
|
|
1839
|
+
return r;
|
|
1840
|
+
}
|
|
1841
|
+
function ii(e, r, t) {
|
|
1842
|
+
if (!e || typeof e != "object")
|
|
1843
|
+
throw new d("UI update graph is missing");
|
|
1844
|
+
const s = se(e, "graph");
|
|
1845
|
+
if (s.type !== "root")
|
|
1846
|
+
throw new d('UI update root element must have type "root"');
|
|
1847
|
+
const n = ai(s.props, r);
|
|
1848
|
+
return {
|
|
1849
|
+
type: "full",
|
|
1850
|
+
version: t,
|
|
1851
|
+
root: s,
|
|
1852
|
+
metadata: n
|
|
1853
|
+
};
|
|
1854
|
+
}
|
|
1855
|
+
function oi(e, r, t) {
|
|
1856
|
+
if (!Array.isArray(e))
|
|
1857
|
+
throw new d("UI diff changes must be an array");
|
|
1858
|
+
if (!C(r))
|
|
1859
|
+
throw new d("UI diff metadata must be an object");
|
|
1860
|
+
const s = r.viewId;
|
|
1861
|
+
if (typeof s != "string" || s.length === 0)
|
|
1862
|
+
throw new d("UI diff metadata is missing viewId");
|
|
1863
|
+
const n = e.map(
|
|
1864
|
+
(a, I) => si(a ?? {}, `changes[${I}]`)
|
|
1865
|
+
), i = typeof r.isUpdate == "boolean" ? r.isUpdate : void 0, o = {
|
|
1866
|
+
viewId: s,
|
|
1867
|
+
...i !== void 0 ? { isUpdate: i } : {}
|
|
1868
|
+
};
|
|
1869
|
+
return {
|
|
1870
|
+
type: "diff",
|
|
1871
|
+
version: t,
|
|
1872
|
+
changes: n,
|
|
1873
|
+
metadata: o
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
function ai(e, r) {
|
|
1877
|
+
const t = e.viewId;
|
|
1878
|
+
if (typeof t != "string" || t.length === 0)
|
|
1879
|
+
throw new d("UI update root is missing viewId");
|
|
1880
|
+
let s = t, n = typeof e.isUpdate == "boolean" ? e.isUpdate : void 0;
|
|
1881
|
+
return C(r) && (typeof r.viewId == "string" && r.viewId.length > 0 && (s = r.viewId), typeof r.isUpdate == "boolean" && (n = r.isUpdate)), {
|
|
1882
|
+
viewId: s,
|
|
1883
|
+
...n !== void 0 ? { isUpdate: n } : {}
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
class d extends Error {
|
|
1887
|
+
constructor(r, t) {
|
|
1888
|
+
super(r), this.causeError = t, this.name = "UiUpdateParseError", t instanceof Error && (this.stack = t.stack);
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
function li(e) {
|
|
1892
|
+
let r;
|
|
1893
|
+
try {
|
|
1894
|
+
r = JSON.parse(e.Json);
|
|
1895
|
+
} catch (o) {
|
|
1896
|
+
throw new d("Failed to parse UIUpdate.Json payload", o);
|
|
1897
|
+
}
|
|
1898
|
+
if (!r || typeof r != "object")
|
|
1899
|
+
throw new d("UI update snapshot must be an object");
|
|
1900
|
+
const { type: t, version: s } = r;
|
|
1901
|
+
if (t !== "full" && t !== "diff")
|
|
1902
|
+
throw new d(`Unknown UI update type: ${String(t)}`);
|
|
1903
|
+
if (typeof s != "number")
|
|
1904
|
+
throw new d("UI update version must be a number");
|
|
1905
|
+
const n = t === "full" ? ii(r.graph, r.metadata, s) : oi(r.changes, r.metadata, s), i = e.Payloads ? ni(e.Payloads) : /* @__PURE__ */ new Map();
|
|
1906
|
+
return {
|
|
1907
|
+
snapshot: n,
|
|
1908
|
+
payloads: i
|
|
1909
|
+
};
|
|
1910
|
+
}
|
|
1911
|
+
class Ii {
|
|
1912
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1913
|
+
cache = /* @__PURE__ */ new Map();
|
|
1914
|
+
/**
|
|
1915
|
+
* Get a cached void handler (no payload) for a node/action combination.
|
|
1916
|
+
* Creates and caches the handler if it doesn't exist.
|
|
1917
|
+
*/
|
|
1918
|
+
getHandler(r, t, s) {
|
|
1919
|
+
const n = `${r}:${t}`;
|
|
1920
|
+
let i = this.cache.get(n);
|
|
1921
|
+
return i || (i = () => s(t), this.cache.set(n, i)), i;
|
|
1922
|
+
}
|
|
1923
|
+
/**
|
|
1924
|
+
* Get a cached handler that accepts a payload.
|
|
1925
|
+
* Creates and caches the handler if it doesn't exist.
|
|
1926
|
+
*/
|
|
1927
|
+
getHandlerWithPayload(r, t, s) {
|
|
1928
|
+
const n = `${r}:${t}:payload`;
|
|
1929
|
+
let i = this.cache.get(n);
|
|
1930
|
+
return i || (i = (o) => s(t, o), this.cache.set(n, i)), i;
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Get a cached handler for boolean payloads.
|
|
1934
|
+
*/
|
|
1935
|
+
getBooleanHandler(r, t, s) {
|
|
1936
|
+
return this.getHandlerWithPayload(r, t, s);
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* Get a cached handler for string payloads.
|
|
1940
|
+
*/
|
|
1941
|
+
getStringHandler(r, t, s) {
|
|
1942
|
+
return this.getHandlerWithPayload(r, t, s);
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Get a cached handler for number payloads.
|
|
1946
|
+
*/
|
|
1947
|
+
getNumberHandler(r, t, s) {
|
|
1948
|
+
return this.getHandlerWithPayload(r, t, s);
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Get a cached handler for number array payloads.
|
|
1952
|
+
*/
|
|
1953
|
+
getNumberArrayHandler(r, t, s) {
|
|
1954
|
+
return this.getHandlerWithPayload(r, t, s);
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Get a cached handler for nullable boolean payloads.
|
|
1958
|
+
*/
|
|
1959
|
+
getNullableBooleanHandler(r, t, s) {
|
|
1960
|
+
const n = `${r}:${t}:nullable-bool`;
|
|
1961
|
+
let i = this.cache.get(n);
|
|
1962
|
+
return i || (i = (o) => s(t, o ?? null), this.cache.set(n, i)), i;
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* Invalidate all cached handlers for a specific node.
|
|
1966
|
+
* Call this when a node is removed from the tree.
|
|
1967
|
+
*/
|
|
1968
|
+
invalidateNode(r) {
|
|
1969
|
+
const t = `${r}:`;
|
|
1970
|
+
for (const s of this.cache.keys())
|
|
1971
|
+
s.startsWith(t) && this.cache.delete(s);
|
|
1972
|
+
}
|
|
1973
|
+
/**
|
|
1974
|
+
* Invalidate a specific handler.
|
|
1975
|
+
*/
|
|
1976
|
+
invalidateHandler(r, t) {
|
|
1977
|
+
this.cache.delete(`${r}:${t}`), this.cache.delete(`${r}:${t}:payload`), this.cache.delete(`${r}:${t}:nullable-bool`);
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Clear all cached handlers.
|
|
1981
|
+
*/
|
|
1982
|
+
clear() {
|
|
1983
|
+
this.cache.clear();
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* Get the number of cached handlers (for debugging/testing).
|
|
1987
|
+
*/
|
|
1988
|
+
get size() {
|
|
1989
|
+
return this.cache.size;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
class Ei {
|
|
1993
|
+
views = /* @__PURE__ */ new Map();
|
|
1994
|
+
listeners = /* @__PURE__ */ new Set();
|
|
1995
|
+
payloads = /* @__PURE__ */ new Map();
|
|
1996
|
+
snapshotMode = !1;
|
|
1997
|
+
snapshot = {
|
|
1998
|
+
views: /* @__PURE__ */ new Map(),
|
|
1999
|
+
payloads: /* @__PURE__ */ new Map(),
|
|
2000
|
+
version: -1
|
|
2001
|
+
};
|
|
2002
|
+
rootViewId;
|
|
2003
|
+
// Per-node subscriptions for granular updates
|
|
2004
|
+
nodeListeners = /* @__PURE__ */ new Map();
|
|
2005
|
+
changedNodeIds = /* @__PURE__ */ new Set();
|
|
2006
|
+
nodeVersions = /* @__PURE__ */ new Map();
|
|
2007
|
+
structureChanged = !1;
|
|
2008
|
+
// Dirty flags for lazy snapshot rebuilding - start true to ensure first snapshot builds correctly
|
|
2009
|
+
viewsDirty = !0;
|
|
2010
|
+
payloadsDirty = !0;
|
|
2011
|
+
// Handler cache for stable event handlers
|
|
2012
|
+
handlerCache = new Ii();
|
|
2013
|
+
apply(r) {
|
|
2014
|
+
if (this.snapshotMode) {
|
|
2015
|
+
if (r.snapshot.type !== "full")
|
|
2016
|
+
return !1;
|
|
2017
|
+
this.snapshotMode = !1, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.payloadsDirty = !0, this.snapshot = {
|
|
2018
|
+
views: /* @__PURE__ */ new Map(),
|
|
2019
|
+
payloads: /* @__PURE__ */ new Map(),
|
|
2020
|
+
version: -1
|
|
2021
|
+
};
|
|
2022
|
+
}
|
|
2023
|
+
const { snapshot: t, payloads: s } = r, { metadata: n } = t, { viewId: i } = n;
|
|
2024
|
+
let o = this.views.get(i);
|
|
2025
|
+
o || (o = {
|
|
2026
|
+
version: 0
|
|
2027
|
+
}, this.views.set(i, o));
|
|
2028
|
+
const a = t.type === "diff" && n.isUpdate === !0;
|
|
2029
|
+
if (t.version < o.version || t.version === o.version && !a)
|
|
2030
|
+
return !1;
|
|
2031
|
+
let I = !1;
|
|
2032
|
+
this.rootViewId || (this.rootViewId = i, I = !0, this.structureChanged = !0);
|
|
2033
|
+
const E = o.root;
|
|
2034
|
+
if (t.type === "full")
|
|
2035
|
+
o.root = t.root, o.version = t.version, I = !0, this.viewsDirty = !0, this.structureChanged = !0, t.root && B(t.root, this.changedNodeIds);
|
|
2036
|
+
else {
|
|
2037
|
+
if (!E)
|
|
2038
|
+
return !1;
|
|
2039
|
+
const l = ci(E, t.changes);
|
|
2040
|
+
l !== E ? (o.root = l, I = !0, this.viewsDirty = !0, z(E, l, this.changedNodeIds)) : o.root = l, o.version = t.version;
|
|
2041
|
+
}
|
|
2042
|
+
for (const [l, _] of s)
|
|
2043
|
+
this.payloads.get(l) !== _ && (this.payloads.set(l, _), I = !0, this.payloadsDirty = !0);
|
|
2044
|
+
return I ? (this.commitSnapshot(), this.notify(), !0) : (o.version = t.version, !1);
|
|
2045
|
+
}
|
|
2046
|
+
replaceFromWire(r) {
|
|
2047
|
+
const t = {
|
|
2048
|
+
rootViewId: r.rootViewId,
|
|
2049
|
+
views: new Map(r.views),
|
|
2050
|
+
payloads: new Map(r.payloads),
|
|
2051
|
+
version: r.version
|
|
2052
|
+
};
|
|
2053
|
+
return this.replaceSnapshot(t);
|
|
2054
|
+
}
|
|
2055
|
+
patchFromOp(r) {
|
|
2056
|
+
this.snapshotMode = !0;
|
|
2057
|
+
const t = r.expectedBaseVersion;
|
|
2058
|
+
if (t !== void 0 && this.snapshot.version !== t)
|
|
2059
|
+
return !1;
|
|
2060
|
+
let s = !1, n = null, i = null;
|
|
2061
|
+
const o = () => (n || (n = new Map(this.snapshot.views)), n), a = () => (i || (i = new Map(this.snapshot.payloads)), i);
|
|
2062
|
+
if (r.deleteViews && r.deleteViews.length > 0)
|
|
2063
|
+
for (const l of r.deleteViews)
|
|
2064
|
+
o().delete(l) && (s = !0, this.structureChanged = !0);
|
|
2065
|
+
if (r.upsertViews && r.upsertViews.length > 0)
|
|
2066
|
+
for (const [l, _] of r.upsertViews) {
|
|
2067
|
+
const c = o(), R = c.get(l);
|
|
2068
|
+
R !== _ && (c.set(l, _), s = !0, R ? z(R, _, this.changedNodeIds) : (B(_, this.changedNodeIds), this.structureChanged = !0));
|
|
2069
|
+
}
|
|
2070
|
+
if (r.deletePayloads && r.deletePayloads.length > 0)
|
|
2071
|
+
for (const l of r.deletePayloads)
|
|
2072
|
+
a().delete(l) && (s = !0);
|
|
2073
|
+
if (r.upsertPayloads && r.upsertPayloads.length > 0)
|
|
2074
|
+
for (const [l, _] of r.upsertPayloads) {
|
|
2075
|
+
const c = a();
|
|
2076
|
+
c.get(l) !== _ && (c.set(l, _), s = !0);
|
|
2077
|
+
}
|
|
2078
|
+
const I = r.rootViewId ?? this.snapshot.rootViewId;
|
|
2079
|
+
I !== this.snapshot.rootViewId && (s = !0, this.structureChanged = !0);
|
|
2080
|
+
const E = r.nextVersion;
|
|
2081
|
+
if (E !== this.snapshot.version && (s = !0), !s)
|
|
2082
|
+
return this.snapshot = { ...this.snapshot, version: E }, !1;
|
|
2083
|
+
for (const l of this.changedNodeIds)
|
|
2084
|
+
this.nodeVersions.set(l, (this.nodeVersions.get(l) ?? 0) + 1);
|
|
2085
|
+
return this.snapshot = {
|
|
2086
|
+
rootViewId: I,
|
|
2087
|
+
views: n ?? new Map(this.snapshot.views),
|
|
2088
|
+
payloads: i ?? new Map(this.snapshot.payloads),
|
|
2089
|
+
version: E
|
|
2090
|
+
}, this.notify(), !0;
|
|
2091
|
+
}
|
|
2092
|
+
replaceSnapshot(r) {
|
|
2093
|
+
this.snapshotMode = !0;
|
|
2094
|
+
const t = this.snapshot, s = t.version !== r.version || t.rootViewId !== r.rootViewId || t.views.size !== r.views.size || t.payloads.size !== r.payloads.size;
|
|
2095
|
+
(t.rootViewId !== r.rootViewId || t.views.size !== r.views.size) && (this.structureChanged = !0);
|
|
2096
|
+
for (const [n, i] of r.views) {
|
|
2097
|
+
const o = t.views.get(n);
|
|
2098
|
+
o ? z(o, i, this.changedNodeIds) : (B(i, this.changedNodeIds), this.structureChanged = !0);
|
|
2099
|
+
}
|
|
2100
|
+
for (const n of this.changedNodeIds)
|
|
2101
|
+
this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
|
|
2102
|
+
return this.snapshot = r, s && this.notify(), s;
|
|
2103
|
+
}
|
|
2104
|
+
clear() {
|
|
2105
|
+
(this.snapshot.rootViewId === void 0 || this.snapshot.rootViewId.length === 0) && this.snapshot.views.size === 0 && this.snapshot.payloads.size === 0 || (this.snapshotMode = !0, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.payloadsDirty = !0, this.snapshot = {
|
|
2106
|
+
views: /* @__PURE__ */ new Map(),
|
|
2107
|
+
payloads: /* @__PURE__ */ new Map(),
|
|
2108
|
+
version: -1
|
|
2109
|
+
}, this.structureChanged = !0, this.notify());
|
|
2110
|
+
}
|
|
2111
|
+
getSnapshot() {
|
|
2112
|
+
return this.snapshot;
|
|
2113
|
+
}
|
|
2114
|
+
subscribe(r) {
|
|
2115
|
+
return this.listeners.add(r), () => {
|
|
2116
|
+
this.listeners.delete(r);
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2119
|
+
subscribeNode(r, t) {
|
|
2120
|
+
let s = this.nodeListeners.get(r);
|
|
2121
|
+
return s || (s = /* @__PURE__ */ new Set(), this.nodeListeners.set(r, s)), s.add(t), () => {
|
|
2122
|
+
s && (s.delete(t), s.size === 0 && this.nodeListeners.delete(r));
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
getNode(r) {
|
|
2126
|
+
const t = this.snapshot.views.get(r);
|
|
2127
|
+
if (t)
|
|
2128
|
+
return t;
|
|
2129
|
+
for (const s of this.snapshot.views.values()) {
|
|
2130
|
+
const n = $e(s, r);
|
|
2131
|
+
if (n)
|
|
2132
|
+
return n;
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
getNodeVersion(r) {
|
|
2136
|
+
return this.nodeVersions.get(r) ?? 0;
|
|
2137
|
+
}
|
|
2138
|
+
notifyNodes() {
|
|
2139
|
+
if (this.changedNodeIds.size === 0 || this.nodeListeners.size === 0) {
|
|
2140
|
+
this.changedNodeIds.clear();
|
|
2141
|
+
return;
|
|
2142
|
+
}
|
|
2143
|
+
for (const r of this.changedNodeIds) {
|
|
2144
|
+
const t = this.nodeListeners.get(r);
|
|
2145
|
+
if (t)
|
|
2146
|
+
for (const s of t)
|
|
2147
|
+
s();
|
|
2148
|
+
}
|
|
2149
|
+
this.changedNodeIds.clear();
|
|
2150
|
+
}
|
|
2151
|
+
commitSnapshot() {
|
|
2152
|
+
let r, t;
|
|
2153
|
+
if (this.viewsDirty) {
|
|
2154
|
+
const n = /* @__PURE__ */ new Map();
|
|
2155
|
+
for (const [i, o] of this.views)
|
|
2156
|
+
o.root && n.set(i, o.root);
|
|
2157
|
+
r = n, this.viewsDirty = !1;
|
|
2158
|
+
} else
|
|
2159
|
+
r = this.snapshot.views;
|
|
2160
|
+
this.payloadsDirty ? (t = new Map(this.payloads), this.payloadsDirty = !1) : t = this.snapshot.payloads;
|
|
2161
|
+
let s = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
|
|
2162
|
+
if (s === void 0)
|
|
2163
|
+
for (const n of this.views.values())
|
|
2164
|
+
s = s === void 0 ? n.version : Math.max(s, n.version);
|
|
2165
|
+
this.snapshot = {
|
|
2166
|
+
rootViewId: this.rootViewId,
|
|
2167
|
+
views: r,
|
|
2168
|
+
payloads: t,
|
|
2169
|
+
version: s
|
|
2170
|
+
};
|
|
2171
|
+
for (const n of this.changedNodeIds)
|
|
2172
|
+
this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
|
|
2173
|
+
}
|
|
2174
|
+
notify() {
|
|
2175
|
+
if (this.notifyNodes(), this.structureChanged) {
|
|
2176
|
+
this.structureChanged = !1;
|
|
2177
|
+
for (const r of this.listeners)
|
|
2178
|
+
r();
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
class _i {
|
|
2183
|
+
streams = /* @__PURE__ */ new Map();
|
|
2184
|
+
listeners = /* @__PURE__ */ new Set();
|
|
2185
|
+
apply(r, t) {
|
|
2186
|
+
const n = this.getOrCreateStreamEntry(r).store.apply(t);
|
|
2187
|
+
return n && this.notify(r), n;
|
|
2188
|
+
}
|
|
2189
|
+
applyStoreOp(r) {
|
|
2190
|
+
if (r.type === "ReplaceStreamSnapshot") {
|
|
2191
|
+
const t = this.getOrCreateStreamEntry(r.snapshot.streamId), s = t.category !== r.snapshot.category;
|
|
2192
|
+
return t.category = r.snapshot.category, t.store.replaceFromWire(r.snapshot) || s ? (this.notify(r.snapshot.streamId), !0) : !1;
|
|
2193
|
+
}
|
|
2194
|
+
if (r.type === "PatchStreamSnapshot") {
|
|
2195
|
+
const t = this.getOrCreateStreamEntry(r.streamId), s = r.category !== void 0 && t.category !== r.category;
|
|
2196
|
+
return r.category !== void 0 && (t.category = r.category), t.store.patchFromOp(r) || s ? (this.notify(r.streamId), !0) : !1;
|
|
2197
|
+
}
|
|
2198
|
+
if (r.type === "ClearStream") {
|
|
2199
|
+
const t = this.streams.get(r.streamId);
|
|
2200
|
+
return t ? (t.store.clear(), this.notify(r.streamId), !0) : !1;
|
|
2201
|
+
}
|
|
2202
|
+
return r.type === "RemoveStream" ? this.streams.delete(r.streamId) ? (this.notify(r.streamId), !0) : !1 : r.type === "SetStreamCategory" ? (this.setCategory(r.streamId, r.category), !0) : !1;
|
|
2203
|
+
}
|
|
2204
|
+
applyStoreOps(r) {
|
|
2205
|
+
for (const t of r)
|
|
2206
|
+
this.applyStoreOp(t);
|
|
2207
|
+
}
|
|
2208
|
+
clear(r) {
|
|
2209
|
+
const t = this.streams.get(r);
|
|
2210
|
+
t && (t.store.clear(), this.notify(r));
|
|
2211
|
+
}
|
|
2212
|
+
remove(r) {
|
|
2213
|
+
this.streams.delete(r) && this.notify(r);
|
|
2214
|
+
}
|
|
2215
|
+
setCategory(r, t) {
|
|
2216
|
+
const s = this.getOrCreateStreamEntry(r);
|
|
2217
|
+
s.category !== t && (s.category = t, this.notify(r));
|
|
2218
|
+
}
|
|
2219
|
+
getSnapshot(r) {
|
|
2220
|
+
const t = this.streams.get(r);
|
|
2221
|
+
return t ? {
|
|
2222
|
+
...t.store.getSnapshot(),
|
|
2223
|
+
streamId: r,
|
|
2224
|
+
category: t.category
|
|
2225
|
+
} : void 0;
|
|
2226
|
+
}
|
|
2227
|
+
getSnapshots() {
|
|
2228
|
+
const r = [];
|
|
2229
|
+
for (const [t, s] of this.streams) {
|
|
2230
|
+
const n = s.store.getSnapshot();
|
|
2231
|
+
r.push({
|
|
2232
|
+
...n,
|
|
2233
|
+
streamId: t,
|
|
2234
|
+
category: s.category
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
return r;
|
|
2238
|
+
}
|
|
2239
|
+
subscribe(r) {
|
|
2240
|
+
return this.listeners.add(r), () => {
|
|
2241
|
+
this.listeners.delete(r);
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
getOrCreateStreamEntry(r) {
|
|
2245
|
+
let t = this.streams.get(r);
|
|
2246
|
+
return t || (t = { store: new Ei() }, this.streams.set(r, t)), t;
|
|
2247
|
+
}
|
|
2248
|
+
notify(r) {
|
|
2249
|
+
for (const t of this.listeners)
|
|
2250
|
+
t(r);
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
function ci(e, r, t) {
|
|
2254
|
+
if (r.length === 0)
|
|
2255
|
+
return e;
|
|
2256
|
+
const s = /* @__PURE__ */ new Map();
|
|
2257
|
+
for (const n of r)
|
|
2258
|
+
s.set(n.nodeId, n);
|
|
2259
|
+
return Ye(e, s);
|
|
2260
|
+
}
|
|
2261
|
+
function Ye(e, r, t) {
|
|
2262
|
+
const s = r.get(e.id);
|
|
2263
|
+
let n = e, i = !1;
|
|
2264
|
+
if (s?.textUpdates && s.textUpdates.length > 0) {
|
|
2265
|
+
const f = Ti(e, s.textUpdates);
|
|
2266
|
+
n = f.node, i = f.changed;
|
|
2267
|
+
}
|
|
2268
|
+
let o = !1, a = n.props;
|
|
2269
|
+
if (s?.changedProps && s.changedProps.size > 0)
|
|
2270
|
+
for (const [f, A] of s.changedProps.entries()) {
|
|
2271
|
+
const u = a[f];
|
|
2272
|
+
if (A === void 0)
|
|
2273
|
+
(u !== void 0 || f in a) && (o || (a = G(a), o = !0), delete a[f]);
|
|
2274
|
+
else if (Q(A)) {
|
|
2275
|
+
const T = G(A);
|
|
2276
|
+
M(T, u) || (o || (a = G(a), o = !0), a[f] = T);
|
|
2277
|
+
} else
|
|
2278
|
+
M(A, u) || (o || (a = G(a), o = !0), a[f] = A);
|
|
2279
|
+
}
|
|
2280
|
+
let I = !1, E = n.styleIds;
|
|
2281
|
+
s?.styleIds !== void 0 && (Xe(n.styleIds, s.styleIds) || (E = s.styleIds, I = !0));
|
|
2282
|
+
const l = n.children ?? [];
|
|
2283
|
+
let _ = l, c = !1;
|
|
2284
|
+
if (s?.removals && s.removals.length > 0 || s?.moves && s.moves.length > 0 || s?.inserts && s.inserts.length > 0) {
|
|
2285
|
+
const f = _.slice();
|
|
2286
|
+
if (s?.removals && s.removals.length > 0) {
|
|
2287
|
+
const A = [...s.removals].sort((u, T) => T.index - u.index);
|
|
2288
|
+
for (const u of A)
|
|
2289
|
+
if (u.index >= 0 && u.index < f.length && f[u.index].id === u.nodeId)
|
|
2290
|
+
f.splice(u.index, 1);
|
|
2291
|
+
else {
|
|
2292
|
+
const T = f.findIndex((w) => w.id === u.nodeId);
|
|
2293
|
+
T >= 0 && f.splice(T, 1);
|
|
2294
|
+
}
|
|
2295
|
+
c = !0;
|
|
2296
|
+
}
|
|
2297
|
+
if (s?.moves && s.moves.length > 0) {
|
|
2298
|
+
const A = [...s.moves].sort((T, w) => T.toIndex - w.toIndex), u = /* @__PURE__ */ new Map();
|
|
2299
|
+
for (const T of A) {
|
|
2300
|
+
const w = f.findIndex((W) => W.id === T.nodeId);
|
|
2301
|
+
w >= 0 && (u.set(T.nodeId, f[w]), f.splice(w, 1));
|
|
2302
|
+
}
|
|
2303
|
+
for (const T of A) {
|
|
2304
|
+
const w = u.get(T.nodeId);
|
|
2305
|
+
if (w) {
|
|
2306
|
+
const W = Math.min(T.toIndex, f.length);
|
|
2307
|
+
f.splice(W, 0, w);
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
c = !0;
|
|
2311
|
+
}
|
|
2312
|
+
if (s?.inserts && s.inserts.length > 0) {
|
|
2313
|
+
const A = [...s.inserts].sort((u, T) => u.index - T.index);
|
|
2314
|
+
for (const u of A) {
|
|
2315
|
+
const T = Math.min(u.index, f.length);
|
|
2316
|
+
f.splice(T, 0, u.node);
|
|
2317
|
+
}
|
|
2318
|
+
c = !0;
|
|
2319
|
+
}
|
|
2320
|
+
_ = f;
|
|
2321
|
+
}
|
|
2322
|
+
let D;
|
|
2323
|
+
for (let f = 0; f < _.length; f++) {
|
|
2324
|
+
const A = _[f], u = Ye(A, r);
|
|
2325
|
+
u !== A && (D || (D = _.slice()), D[f] = u);
|
|
2326
|
+
}
|
|
2327
|
+
return D && (_ = D, c = !0), i || o || I || c ? !o && !c && !I ? n : {
|
|
2328
|
+
id: e.id,
|
|
2329
|
+
type: e.type,
|
|
2330
|
+
props: o ? a : n.props,
|
|
2331
|
+
children: c ? _ : l,
|
|
2332
|
+
styleIds: I ? E : n.styleIds,
|
|
2333
|
+
...e.sourceMarker ? { sourceMarker: e.sourceMarker } : {}
|
|
2334
|
+
} : e;
|
|
2335
|
+
}
|
|
2336
|
+
function B(e, r) {
|
|
2337
|
+
if (r.add(e.id), e.children)
|
|
2338
|
+
for (const t of e.children)
|
|
2339
|
+
B(t, r);
|
|
2340
|
+
}
|
|
2341
|
+
const $ = [];
|
|
2342
|
+
function fi(e) {
|
|
2343
|
+
for (; $.length <= e; )
|
|
2344
|
+
$.push(/* @__PURE__ */ new Map());
|
|
2345
|
+
return $[e].clear(), $[e];
|
|
2346
|
+
}
|
|
2347
|
+
function z(e, r, t) {
|
|
2348
|
+
Ke(e, r, t, 0);
|
|
2349
|
+
}
|
|
2350
|
+
function Ke(e, r, t, s) {
|
|
2351
|
+
if (e === r)
|
|
2352
|
+
return;
|
|
2353
|
+
(e.type !== r.type || !ui(e.props, r.props) || !Xe(e.styleIds, r.styleIds)) && t.add(r.id);
|
|
2354
|
+
const i = e.children ?? [], o = r.children ?? [];
|
|
2355
|
+
if (i !== o) {
|
|
2356
|
+
const a = fi(s);
|
|
2357
|
+
for (const E of i)
|
|
2358
|
+
a.set(E.id, E);
|
|
2359
|
+
let I = !1;
|
|
2360
|
+
for (let E = 0; E < o.length; E++) {
|
|
2361
|
+
const l = o[E], _ = a.get(l.id);
|
|
2362
|
+
_ ? (Ke(_, l, t, s + 1), !I && E < i.length && i[E].id !== l.id && (I = !0)) : (B(l, t), I = !0);
|
|
2363
|
+
}
|
|
2364
|
+
(i.length !== o.length || I) && t.add(r.id);
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
function ui(e, r) {
|
|
2368
|
+
return M(e, r);
|
|
2369
|
+
}
|
|
2370
|
+
function $e(e, r) {
|
|
2371
|
+
if (e.id === r)
|
|
2372
|
+
return e;
|
|
2373
|
+
if (e.children)
|
|
2374
|
+
for (const t of e.children) {
|
|
2375
|
+
const s = $e(t, r);
|
|
2376
|
+
if (s)
|
|
2377
|
+
return s;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
function Xe(e, r) {
|
|
2381
|
+
return M(e, r);
|
|
2382
|
+
}
|
|
2383
|
+
function hi(e, r) {
|
|
2384
|
+
if (r.length === 0)
|
|
2385
|
+
return e;
|
|
2386
|
+
const t = [...r].sort((i, o) => i.start - o.start);
|
|
2387
|
+
let s = e, n = 0;
|
|
2388
|
+
for (const i of t) {
|
|
2389
|
+
const o = ie(i.start + n, 0, s.length);
|
|
2390
|
+
if (i.end == null) {
|
|
2391
|
+
const l = s.slice(o), _ = Ai(l, i.insertedText);
|
|
2392
|
+
s = s.slice(0, o) + i.insertedText + l.slice(_), n += i.insertedText.length - _;
|
|
2393
|
+
continue;
|
|
2394
|
+
}
|
|
2395
|
+
const a = i.end + n, I = ie(a, o, s.length), E = I - o;
|
|
2396
|
+
s = s.slice(0, o) + i.insertedText + s.slice(I), n += i.insertedText.length - E;
|
|
2397
|
+
}
|
|
2398
|
+
return s;
|
|
2399
|
+
}
|
|
2400
|
+
function Ti(e, r, t) {
|
|
2401
|
+
if (r.length === 0)
|
|
2402
|
+
return { node: e, changed: !1 };
|
|
2403
|
+
const s = /* @__PURE__ */ new Map();
|
|
2404
|
+
for (const n of r) {
|
|
2405
|
+
const i = s.get(n.nodeId);
|
|
2406
|
+
i ? i.push(n) : s.set(n.nodeId, [n]);
|
|
2407
|
+
}
|
|
2408
|
+
return je(e, s);
|
|
2409
|
+
}
|
|
2410
|
+
function je(e, r, t) {
|
|
2411
|
+
const s = r.get(e.id) ?? [];
|
|
2412
|
+
let n = !1, i = e.props;
|
|
2413
|
+
if (s.length > 0) {
|
|
2414
|
+
const E = /* @__PURE__ */ new Map();
|
|
2415
|
+
for (const l of s) {
|
|
2416
|
+
const _ = E.get(l.propertyName);
|
|
2417
|
+
_ ? _.push(l) : E.set(l.propertyName, [l]);
|
|
2418
|
+
}
|
|
2419
|
+
for (const [l, _] of E.entries()) {
|
|
2420
|
+
const c = i[l], D = hi(typeof c == "string" ? c : "", _);
|
|
2421
|
+
n || (i = G(i), n = !0), i[l] = D;
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
let o = !1;
|
|
2425
|
+
const a = e.children ?? [];
|
|
2426
|
+
let I = a;
|
|
2427
|
+
if (a.length > 0) {
|
|
2428
|
+
let E;
|
|
2429
|
+
for (let l = 0; l < a.length; l++) {
|
|
2430
|
+
const _ = a[l], c = je(_, r);
|
|
2431
|
+
c.changed && (E || (E = [...a]), E[l] = c.node);
|
|
2432
|
+
}
|
|
2433
|
+
E && (I = E, o = !0);
|
|
2434
|
+
}
|
|
2435
|
+
return !n && !o ? { node: e, changed: !1 } : {
|
|
2436
|
+
node: {
|
|
2437
|
+
id: e.id,
|
|
2438
|
+
type: e.type,
|
|
2439
|
+
props: n ? i : e.props,
|
|
2440
|
+
children: o ? I : a,
|
|
2441
|
+
styleIds: e.styleIds,
|
|
2442
|
+
...e.sourceMarker ? { sourceMarker: e.sourceMarker } : {}
|
|
2443
|
+
},
|
|
2444
|
+
changed: !0
|
|
2445
|
+
};
|
|
2446
|
+
}
|
|
2447
|
+
function ie(e, r, t) {
|
|
2448
|
+
return Math.max(r, Math.min(t, e));
|
|
2449
|
+
}
|
|
2450
|
+
function Ai(e, r) {
|
|
2451
|
+
const t = Math.min(e.length, r.length);
|
|
2452
|
+
let s = 0;
|
|
2453
|
+
for (; s < t && e.charCodeAt(s) === r.charCodeAt(s); )
|
|
2454
|
+
s++;
|
|
2455
|
+
return s;
|
|
2456
|
+
}
|
|
2457
|
+
function G(e) {
|
|
2458
|
+
const r = {}, t = Object.keys(e);
|
|
2459
|
+
for (let s = 0; s < t.length; s++) {
|
|
2460
|
+
const n = t[s];
|
|
2461
|
+
r[n] = e[n];
|
|
2462
|
+
}
|
|
2463
|
+
return r;
|
|
2464
|
+
}
|
|
2465
|
+
function Q(e) {
|
|
2466
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
2467
|
+
}
|
|
2468
|
+
function M(e, r) {
|
|
2469
|
+
if (Object.is(e, r))
|
|
2470
|
+
return !0;
|
|
2471
|
+
if (Array.isArray(e) && Array.isArray(r)) {
|
|
2472
|
+
if (e.length !== r.length)
|
|
2473
|
+
return !1;
|
|
2474
|
+
for (let t = 0; t < e.length; t++)
|
|
2475
|
+
if (!M(e[t], r[t]))
|
|
2476
|
+
return !1;
|
|
2477
|
+
return !0;
|
|
2478
|
+
}
|
|
2479
|
+
if (Q(e) && Q(r)) {
|
|
2480
|
+
const t = Object.keys(e), s = Object.keys(r);
|
|
2481
|
+
if (t.length !== s.length)
|
|
2482
|
+
return !1;
|
|
2483
|
+
for (const n of t)
|
|
2484
|
+
if (!M(e[n], r[n]))
|
|
2485
|
+
return !1;
|
|
2486
|
+
return !0;
|
|
2487
|
+
}
|
|
2488
|
+
return !1;
|
|
2489
|
+
}
|
|
2490
|
+
const Ni = 16, Si = 50, L = new _i(), v = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
|
|
2491
|
+
let We = Ni, ze = Si, V = [], x = null, p = null, U = 0, X = 0;
|
|
2492
|
+
const P = /* @__PURE__ */ new Map();
|
|
2493
|
+
function Ci() {
|
|
2494
|
+
return typeof performance < "u" ? performance.now() : Date.now();
|
|
2495
|
+
}
|
|
2496
|
+
function di() {
|
|
2497
|
+
try {
|
|
2498
|
+
return crypto.randomUUID();
|
|
2499
|
+
} catch {
|
|
2500
|
+
return `${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
function Di(e) {
|
|
2504
|
+
const r = [];
|
|
2505
|
+
for (const s of e.views)
|
|
2506
|
+
r.push(s);
|
|
2507
|
+
const t = [];
|
|
2508
|
+
for (const s of e.payloads)
|
|
2509
|
+
t.push(s);
|
|
2510
|
+
return {
|
|
2511
|
+
streamId: e.streamId,
|
|
2512
|
+
category: e.category,
|
|
2513
|
+
version: e.version ?? -1,
|
|
2514
|
+
rootViewId: e.rootViewId,
|
|
2515
|
+
views: r,
|
|
2516
|
+
payloads: t
|
|
2517
|
+
};
|
|
2518
|
+
}
|
|
2519
|
+
function wi(e, r, t) {
|
|
2520
|
+
if (!t || t.version === -1)
|
|
2521
|
+
return { type: "ReplaceStreamSnapshot", snapshot: Di(r) };
|
|
2522
|
+
let s, n;
|
|
2523
|
+
for (const [a, I] of r.views)
|
|
2524
|
+
t.views.get(a) !== I && (s ??= []).push([a, I]);
|
|
2525
|
+
for (const a of t.views.keys())
|
|
2526
|
+
r.views.has(a) || (n ??= []).push(a);
|
|
2527
|
+
let i, o;
|
|
2528
|
+
for (const [a, I] of r.payloads)
|
|
2529
|
+
t.payloads.get(a) !== I && (i ??= []).push([a, I]);
|
|
2530
|
+
for (const a of t.payloads.keys())
|
|
2531
|
+
r.payloads.has(a) || (o ??= []).push(a);
|
|
2532
|
+
return {
|
|
2533
|
+
type: "PatchStreamSnapshot",
|
|
2534
|
+
streamId: e,
|
|
2535
|
+
category: r.category,
|
|
2536
|
+
nextVersion: r.version ?? -1,
|
|
2537
|
+
expectedBaseVersion: t.version ?? -1,
|
|
2538
|
+
rootViewId: r.rootViewId,
|
|
2539
|
+
upsertViews: s,
|
|
2540
|
+
deleteViews: n,
|
|
2541
|
+
upsertPayloads: i,
|
|
2542
|
+
deletePayloads: o
|
|
2543
|
+
};
|
|
2544
|
+
}
|
|
2545
|
+
function Je() {
|
|
2546
|
+
x || (x = setTimeout(oe, We)), p || (p = setTimeout(oe, ze));
|
|
2547
|
+
}
|
|
2548
|
+
function g(e) {
|
|
2549
|
+
V.push(e), Je();
|
|
2550
|
+
}
|
|
2551
|
+
function oe() {
|
|
2552
|
+
if (x && (clearTimeout(x), x = null), p && (clearTimeout(p), p = null), V.length === 0 && P.size === 0) {
|
|
2553
|
+
U = 0, X = 0;
|
|
2554
|
+
return;
|
|
2555
|
+
}
|
|
2556
|
+
const e = [];
|
|
2557
|
+
for (const [t, s] of P)
|
|
2558
|
+
e.push({ trackId: t, version: s.version, senderId: s.senderId });
|
|
2559
|
+
const r = {
|
|
2560
|
+
batchId: di(),
|
|
2561
|
+
createdAtMs: Ci(),
|
|
2562
|
+
ops: V,
|
|
2563
|
+
...e.length > 0 ? { acks: e } : {},
|
|
2564
|
+
stats: { uiMessagesConsumed: U, bytesConsumed: X }
|
|
2565
|
+
};
|
|
2566
|
+
V = [], U = 0, X = 0, P.clear(), self.postMessage(r);
|
|
2567
|
+
}
|
|
2568
|
+
function Qe(e) {
|
|
2569
|
+
return `${e.senderId}_${e.trackId}`;
|
|
2570
|
+
}
|
|
2571
|
+
async function Ri(e) {
|
|
2572
|
+
const r = await ys(e), t = /* @__PURE__ */ new Set();
|
|
2573
|
+
for (const s of Object.values(r.UIStreams ?? {})) {
|
|
2574
|
+
const n = s.StreamId;
|
|
2575
|
+
t.add(n);
|
|
2576
|
+
const i = s.Info?.Category;
|
|
2577
|
+
L.getSnapshot(n)?.category !== i && (L.setCategory(n, i), g({ type: "SetStreamCategory", streamId: n, category: i }));
|
|
2578
|
+
}
|
|
2579
|
+
for (const s of L.getSnapshots())
|
|
2580
|
+
t.has(s.streamId) || (L.remove(s.streamId), H.delete(s.streamId), g({ type: "RemoveStream", streamId: s.streamId }));
|
|
2581
|
+
}
|
|
2582
|
+
async function yi(e) {
|
|
2583
|
+
const r = q(e), t = Qe(r), s = await Qn(e), n = li(s), i = P.get(r.trackId);
|
|
2584
|
+
if ((i === void 0 || n.snapshot.version > i.version) && (P.set(r.trackId, { version: n.snapshot.version, senderId: r.senderId }), Je()), !L.apply(t, n))
|
|
2585
|
+
return;
|
|
2586
|
+
const a = L.getSnapshot(t);
|
|
2587
|
+
if (!a)
|
|
2588
|
+
return;
|
|
2589
|
+
const I = H.get(t);
|
|
2590
|
+
H.set(t, a), g(wi(t, a, I));
|
|
2591
|
+
}
|
|
2592
|
+
async function Ui(e) {
|
|
2593
|
+
const r = await Cn(e);
|
|
2594
|
+
if (!r.StyleId)
|
|
2595
|
+
return;
|
|
2596
|
+
const t = {
|
|
2597
|
+
styleId: r.StyleId,
|
|
2598
|
+
css: r.Style?.css,
|
|
2599
|
+
common: r.Style?.common
|
|
2600
|
+
}, s = v.get(t.styleId);
|
|
2601
|
+
s && s.css === t.css && s.common === t.common || (v.set(t.styleId, t), g({ type: "UpsertUiStyle", style: t }));
|
|
2602
|
+
}
|
|
2603
|
+
async function Li(e) {
|
|
2604
|
+
const r = await mn(e);
|
|
2605
|
+
if (r.Styles)
|
|
2606
|
+
for (const t of r.Styles) {
|
|
2607
|
+
if (!t.StyleId)
|
|
2608
|
+
continue;
|
|
2609
|
+
const s = {
|
|
2610
|
+
styleId: t.StyleId,
|
|
2611
|
+
css: t.Style?.css,
|
|
2612
|
+
common: t.Style?.common
|
|
2613
|
+
}, n = v.get(s.styleId);
|
|
2614
|
+
n && n.css === s.css && n.common === s.common || (v.set(s.styleId, s), g({ type: "UpsertUiStyle", style: s }));
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
function mi(e) {
|
|
2618
|
+
const r = q(e), t = Qe(r);
|
|
2619
|
+
L.clear(t), H.delete(t), g({ type: "ClearStream", streamId: t });
|
|
2620
|
+
}
|
|
2621
|
+
async function Oi(e) {
|
|
2622
|
+
const r = await Hn(e);
|
|
2623
|
+
if (!(!r.StyleIds || r.StyleIds.length === 0))
|
|
2624
|
+
for (const t of r.StyleIds)
|
|
2625
|
+
v.delete(t) && g({ type: "RemoveUiStyle", styleId: t });
|
|
2626
|
+
}
|
|
2627
|
+
async function gi(e) {
|
|
2628
|
+
const r = new Uint8Array(e);
|
|
2629
|
+
X += r.byteLength;
|
|
2630
|
+
const t = r;
|
|
2631
|
+
switch (Ze(t)) {
|
|
2632
|
+
case O.CORE_GLOBAL_STATE:
|
|
2633
|
+
await Ri(t), U++;
|
|
2634
|
+
return;
|
|
2635
|
+
case O.UI_UPDATE:
|
|
2636
|
+
try {
|
|
2637
|
+
await yi(t);
|
|
2638
|
+
} catch (n) {
|
|
2639
|
+
return n instanceof d, void 0;
|
|
2640
|
+
} finally {
|
|
2641
|
+
U++;
|
|
2642
|
+
}
|
|
2643
|
+
return;
|
|
2644
|
+
case O.UI_STYLES:
|
|
2645
|
+
await Ui(t), U++;
|
|
2646
|
+
return;
|
|
2647
|
+
case O.UI_STYLES_BATCH:
|
|
2648
|
+
await Li(t), U++;
|
|
2649
|
+
return;
|
|
2650
|
+
case O.UI_STYLES_DELETE:
|
|
2651
|
+
await Oi(t), U++;
|
|
2652
|
+
return;
|
|
2653
|
+
case O.ACTION_UI_CLEAR_STREAM:
|
|
2654
|
+
mi(t), U++;
|
|
2655
|
+
return;
|
|
2656
|
+
default:
|
|
2657
|
+
return;
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
self.addEventListener("message", (e) => {
|
|
2661
|
+
const r = e.data;
|
|
2662
|
+
if (r.type === "configure") {
|
|
2663
|
+
typeof r.flushIntervalMs == "number" && Number.isFinite(r.flushIntervalMs) && r.flushIntervalMs >= 0 && (We = r.flushIntervalMs), typeof r.maxLatencyMs == "number" && Number.isFinite(r.maxLatencyMs) && r.maxLatencyMs >= 0 && (ze = r.maxLatencyMs);
|
|
2664
|
+
return;
|
|
2665
|
+
}
|
|
2666
|
+
if (r.type === "clear") {
|
|
2667
|
+
V = [], H.clear(), P.clear(), v.clear();
|
|
2668
|
+
for (const t of L.getSnapshots())
|
|
2669
|
+
L.remove(t.streamId);
|
|
2670
|
+
return;
|
|
2671
|
+
}
|
|
2672
|
+
r.type === "protocol" && gi(r.message).catch(() => {
|
|
2673
|
+
});
|
|
2674
|
+
});
|